Merge branch 'develop' into release
This commit is contained in:
commit
f24960f64b
|
|
@ -205,7 +205,7 @@ export default class CustomSalaryItemSlide extends React.Component {
|
|||
}}
|
||||
onClick={() => {
|
||||
if (this.props.record.canEdit || isAdd) {
|
||||
this.handleShowFormal();
|
||||
editable && this.handleShowFormal();
|
||||
}
|
||||
}}>
|
||||
{formulaContent}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export default class FormalFormModal extends React.Component {
|
|||
this.field = {};
|
||||
this.parameters = [];
|
||||
this.referenceType = "";
|
||||
this.timer = null;
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
|
@ -73,6 +74,33 @@ export default class FormalFormModal extends React.Component {
|
|||
this.formulaDatasourceList();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
|
||||
triggerKeyDown = (e) => {
|
||||
let propsTextarea = this.contentProps.refs.textareaNormal.refs.input.refs.input; // 获取dom节点实例
|
||||
const { value } = this.state;
|
||||
if (e.key === "Backspace" && value) {
|
||||
const { end } = this.getPositionForTextArea(propsTextarea);
|
||||
const str = value.substring(end - 1, end);
|
||||
if (str === "}") {
|
||||
e.preventDefault();
|
||||
const index = value.lastIndexOf("{", end - 1);
|
||||
const currentValue = value.substring(index, end);
|
||||
this.setState({
|
||||
value: value.replace(currentValue, "")
|
||||
}, () => {
|
||||
if (propsTextarea.setSelectionRange) {
|
||||
this.timer = setTimeout(() => {
|
||||
propsTextarea.setSelectionRange(index, index);
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
formulaDatasourceList = () => {
|
||||
const { salaryItemStore } = this.props;
|
||||
const { formulaDatasourceList } = salaryItemStore;
|
||||
|
|
@ -271,9 +299,11 @@ export default class FormalFormModal extends React.Component {
|
|||
ref={(input) => this.contentProps = input}
|
||||
minRows={8}
|
||||
maxRows={8}
|
||||
value={value} onChange={(value) => this.handleChange(value)}
|
||||
value={value}
|
||||
onChange={(value) => this.handleChange(value)}
|
||||
noResize={true}
|
||||
style={{ fontSize: "14px", lineHeight: 1.2 }}
|
||||
onKeyDown={this.triggerKeyDown}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: "flex", height: "300px", marginTop: "10px" }}>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export default class SalaryItem extends React.Component {
|
|||
const { salaryItemStore: { deleteItemRequest, getTableDatas } } = this.props;
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认删除",
|
||||
content: "确认删除该条数据吗?",
|
||||
onOk: () => {
|
||||
deleteItemRequest([record.id]).then(() => {
|
||||
getTableDatas({ ...this.state.searchParams }).then(res => {
|
||||
|
|
@ -143,7 +143,7 @@ export default class SalaryItem extends React.Component {
|
|||
}}>删除</a>
|
||||
</Menu.Item>
|
||||
</Menu>}>
|
||||
<i className="icon-coms-more"></i>
|
||||
<a href="javascript:void(0)" style={{textDecoration: "none"}}><i className="icon-coms-more" style={{fontSize: 18}}></i></a>
|
||||
</Dropdown>
|
||||
);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue