Merge branch 'feature/V2-公式编辑器' into develop
This commit is contained in:
commit
d1eb00a786
|
|
@ -117,7 +117,7 @@ class CodeAction extends Component {
|
||||||
const variableDatalist = _.filter(variableList, it => it.value.indexOf(variableText) !== -1);
|
const variableDatalist = _.filter(variableList, it => it.value.indexOf(variableText) !== -1);
|
||||||
const funcDatalist = _.map(funcList, it => ({
|
const funcDatalist = _.map(funcList, it => ({
|
||||||
...it,
|
...it,
|
||||||
children: _.filter(it.children, child => _.lowerCase(child.name).indexOf(funcText) !== -1)
|
children: _.filter(it.children, child => _.lowerCase(child.name).indexOf(_.lowerCase(funcText)) !== -1)
|
||||||
}));
|
}));
|
||||||
return (
|
return (
|
||||||
<div className="excel-codeAction">
|
<div className="excel-codeAction">
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ export default class FormalFormModal extends React.Component {
|
||||||
validateType: "",
|
validateType: "",
|
||||||
returnType: "",
|
returnType: "",
|
||||||
value: "",
|
value: "",
|
||||||
|
formula: "",
|
||||||
extendParam: {
|
extendParam: {
|
||||||
isCustomFunction: "0",
|
isCustomFunction: "0",
|
||||||
sqlReturnKey: "",
|
sqlReturnKey: "",
|
||||||
|
|
@ -66,6 +67,7 @@ export default class FormalFormModal extends React.Component {
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
value: data.formula,
|
value: data.formula,
|
||||||
|
formula: data.formula,
|
||||||
returnType: data.returnType,
|
returnType: data.returnType,
|
||||||
validateType: data.validateType
|
validateType: data.validateType
|
||||||
});
|
});
|
||||||
|
|
@ -335,13 +337,13 @@ export default class FormalFormModal extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const { salaryItemStore } = this.props;
|
const { salaryItemStore } = this.props;
|
||||||
const { searchGroup, searchFields } = salaryItemStore;
|
const { searchGroup, searchFields } = salaryItemStore;
|
||||||
const { value, formulaDatasourceList, extendParam, testVisible, showTestVal, groupParams } = this.state;
|
const { value, formula, formulaDatasourceList, extendParam, testVisible, showTestVal, groupParams } = this.state;
|
||||||
const title = <div className="formulaTitleWrapper">
|
const title = <div className="formulaTitleWrapper">
|
||||||
<div>{`${(this.props.valueType == 2 || this.props.valueType === "FORMULA") ? "函数" : "SQL"}公式`}</div>
|
<div>{`${(this.props.valueType == 2 || this.props.valueType === "FORMULA") ? "函数" : "SQL"}公式`}</div>
|
||||||
{
|
{
|
||||||
value && <Button type="primary" onClick={() => {
|
!_.isEmpty(this.parameters) && <Button type="primary" onClick={() => {
|
||||||
const isSaveBool = _.every(this.parameters, it => !!it.id);
|
const isSaveBool = _.every(this.parameters, it => !!it.id);
|
||||||
if (isSaveBool) {
|
if (isSaveBool && value === formula) {
|
||||||
this.setState({ testVisible: true });
|
this.setState({ testVisible: true });
|
||||||
} else {
|
} else {
|
||||||
message.info("请先保存公式后再进行测试");
|
message.info("请先保存公式后再进行测试");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue