Merge branch 'feature/V2-公式编辑器' into develop

This commit is contained in:
黎永顺 2023-05-18 17:09:35 +08:00
commit d1eb00a786
2 changed files with 6 additions and 4 deletions

View File

@ -117,7 +117,7 @@ class CodeAction extends Component {
const variableDatalist = _.filter(variableList, it => it.value.indexOf(variableText) !== -1);
const funcDatalist = _.map(funcList, 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 (
<div className="excel-codeAction">

View File

@ -16,6 +16,7 @@ export default class FormalFormModal extends React.Component {
validateType: "",
returnType: "",
value: "",
formula: "",
extendParam: {
isCustomFunction: "0",
sqlReturnKey: "",
@ -66,6 +67,7 @@ export default class FormalFormModal extends React.Component {
}
this.setState({
value: data.formula,
formula: data.formula,
returnType: data.returnType,
validateType: data.validateType
});
@ -335,13 +337,13 @@ export default class FormalFormModal extends React.Component {
render() {
const { salaryItemStore } = this.props;
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">
<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);
if (isSaveBool) {
if (isSaveBool && value === formula) {
this.setState({ testVisible: true });
} else {
message.info("请先保存公式后再进行测试");