|
|
@@ -112,61 +112,63 @@
|
|
|
<span class="textblod">条件{{ conditionIndex + 1 }}</span>
|
|
|
<el-button type="danger" size="mini" @click="removeCondition(conditionIndex)" class=" mg-l-20">删除</el-button>
|
|
|
</div>
|
|
|
- <div v-for="(innerItem, innerIndex) in conditionList[conditionIndex].innerList">
|
|
|
- <div class="mg-t-20 flex jc-al-c" :key="innerIndex">
|
|
|
- <span class="textblod mg-r-20" >IF</span>
|
|
|
+ <div v-for="(innerItem, innerIndex) in conditionList[conditionIndex].formulaIfElse">
|
|
|
+ <!-- 逻辑符号选择框 - 从第二个条件开始显示(innerIndex >= 1) -->
|
|
|
+ <div v-if="innerIndex >= 1" style="margin-left: 25%;" class="mg-t-10 mg-b-10">
|
|
|
+ <el-select
|
|
|
+ v-model="conditionList[conditionIndex].formulaIfElse[innerIndex].logicSymbol"
|
|
|
+ @change="setConditionMulti(conditionIndex, innerIndex)"
|
|
|
+ size="medium"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:120px"
|
|
|
+ >
|
|
|
+ <el-option label="或者" value="||"></el-option>
|
|
|
+ <el-option label="并且" value="&&"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
|
|
|
- <vue-tags-input
|
|
|
- v-model="conditionList[conditionIndex].innerList[innerIndex].tag2"
|
|
|
- :tags="conditionList[conditionIndex].innerList[innerIndex].tags2"
|
|
|
- @focus="setMultiFocus(conditionIndex, innerIndex, 'tag2')"
|
|
|
- @blur="inputBlurMulti(conditionIndex, innerIndex, 'tag2')"
|
|
|
- placeholder="输入/参数"
|
|
|
- @before-adding-tag="beforeAddingTag"
|
|
|
- />
|
|
|
- <span class="mg-l-20 mg-r-20">
|
|
|
- <el-select
|
|
|
- v-model="conditionList[conditionIndex].innerList[innerIndex].symbol1"
|
|
|
- @change="setConditionMulti(conditionIndex, innerIndex)"
|
|
|
- size="medium"
|
|
|
- placeholder="请选择"
|
|
|
- style="width:120px"
|
|
|
- >
|
|
|
- <el-option label=">=" value=">="></el-option>
|
|
|
- <el-option label="<=" value="<="></el-option>
|
|
|
- <el-option label="=" value="="></el-option>
|
|
|
- <el-option label=">" value=">"></el-option>
|
|
|
- <el-option label="<" value="<"></el-option>
|
|
|
- <el-option label="≠" value="≠"></el-option>
|
|
|
- <el-option label="包含" value="包含"></el-option>
|
|
|
- <el-option label="不包含" value="不包含"></el-option>
|
|
|
+ <!-- if条件内容 -->
|
|
|
+ <div class="mg-t-20 flex jc-al-c" :key="innerIndex">
|
|
|
+ <span class="textblod mg-r-20" >IF</span>
|
|
|
|
|
|
- </el-select>
|
|
|
- </span>
|
|
|
- <vue-tags-input
|
|
|
- v-model="conditionList[conditionIndex].innerList[innerIndex].tag3"
|
|
|
- :tags="conditionList[conditionIndex].innerList[innerIndex].tags3"
|
|
|
- @focus="setMultiFocus(conditionIndex, innerIndex, 'tag3')"
|
|
|
- @blur="inputBlurMulti(conditionIndex, innerIndex, 'tag3')"
|
|
|
- placeholder="输入/参数"
|
|
|
- @before-adding-tag="beforeAddingTag"
|
|
|
- />
|
|
|
- <i class="el-icon-circle-plus-outline mg-l-20" style="color: #409EFF;cursor: pointer;" @click="addConditionItem(conditionIndex, innerIndex)"></i>
|
|
|
- <i class="el-icon-delete mg-l-20" style="color: red;cursor: pointer;" @click="removeConditionItem(conditionIndex, innerIndex)" v-if="innerIndex > 0 || conditionIndex > 0"></i>
|
|
|
- </div>
|
|
|
- <div v-if="innerIndex > 0" style="margin-left: 25%;" class="mg-t-10 mg-b-10">
|
|
|
- <el-select
|
|
|
- v-model="conditionList[conditionIndex].innerList[innerIndex].logicSymbol"
|
|
|
- @change="setConditionMulti(conditionIndex, innerIndex)"
|
|
|
- size="medium"
|
|
|
- placeholder="请选择"
|
|
|
- style="width:120px"
|
|
|
- >
|
|
|
- <el-option label="或者" value="or"></el-option>
|
|
|
- <el-option label="并且" value="and"></el-option>
|
|
|
- </el-select>
|
|
|
+ <vue-tags-input
|
|
|
+ v-model="conditionList[conditionIndex].formulaIfElse[innerIndex].tag2"
|
|
|
+ :tags="conditionList[conditionIndex].formulaIfElse[innerIndex].tags2"
|
|
|
+ @focus="setMultiFocus(conditionIndex, innerIndex, 'tag2')"
|
|
|
+ @blur="inputBlurMulti(conditionIndex, innerIndex, 'tag2')"
|
|
|
+ placeholder="输入/参数"
|
|
|
+ @before-adding-tag="beforeAddingTag"
|
|
|
+ />
|
|
|
+ <span class="mg-l-20 mg-r-20">
|
|
|
+ <el-select
|
|
|
+ v-model="conditionList[conditionIndex].formulaIfElse[innerIndex].symbol1"
|
|
|
+ @change="setConditionMulti(conditionIndex, innerIndex)"
|
|
|
+ size="medium"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width:120px"
|
|
|
+ >
|
|
|
+ <el-option label=">=" value=">="></el-option>
|
|
|
+ <el-option label="<=" value="<="></el-option>
|
|
|
+ <el-option label="=" value="="></el-option>
|
|
|
+ <el-option label=">" value=">"></el-option>
|
|
|
+ <el-option label="<" value="<"></el-option>
|
|
|
+ <el-option label="≠" value="≠"></el-option>
|
|
|
+ <el-option label="包含" value="包含"></el-option>
|
|
|
+ <el-option label="不包含" value="不包含"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </span>
|
|
|
+ <vue-tags-input
|
|
|
+ v-model="conditionList[conditionIndex].formulaIfElse[innerIndex].tag3"
|
|
|
+ :tags="conditionList[conditionIndex].formulaIfElse[innerIndex].tags3"
|
|
|
+ @focus="setMultiFocus(conditionIndex, innerIndex, 'tag3')"
|
|
|
+ @blur="inputBlurMulti(conditionIndex, innerIndex, 'tag3')"
|
|
|
+ placeholder="输入/参数"
|
|
|
+ @before-adding-tag="beforeAddingTag"
|
|
|
+ />
|
|
|
+ <i class="el-icon-circle-plus-outline mg-l-20" style="color: #409EFF;cursor: pointer;" @click="addConditionItem(conditionIndex, innerIndex)"></i>
|
|
|
+ <i class="el-icon-delete mg-l-20" style="color: red;cursor: pointer;" @click="removeConditionItem(conditionIndex, innerIndex)" v-if="innerIndex > 0 || conditionIndex > 0"></i>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<div class="flex jc-al-c mg-t-20" v-if="result == 1">
|
|
|
<span class="textblod mg-r-10">满足</span>
|
|
|
<vue-tags-input
|
|
|
@@ -192,65 +194,68 @@
|
|
|
<el-button size="small" type="primary" @click="addCondition(conditionIndex)">添加其他条件</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="mg-t-20" v-if="result == 2">
|
|
|
- <div class="flex">
|
|
|
- <span class="textblod mg-r-10">满足</span>
|
|
|
- <div class="border-grey sele-ele-box flex1"
|
|
|
- :class="{'border-green': isCurFocus(conditionIndex, null, 'formula1')}"
|
|
|
- @click="setMultiFocus(conditionIndex, null, 'formula1')">
|
|
|
- <div class="flex jc-sb mg-b-20">
|
|
|
- <div class="icon-box">
|
|
|
- <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelectMulti(conditionIndex, 'formula1')"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '+', 'formula1')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '-', 'formula1')" icon="el-icon-remove-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '*', 'formula1')" icon="el-icon-circle-close"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '%', 'formula1')">÷</el-link>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, '(', false, 'formula1')">(</el-link>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, ')', true, 'formula1')">)</el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addTextMulti(conditionIndex, 'formula1')">输入值</el-link>
|
|
|
- </div>
|
|
|
+ <template v-if="result == 2">
|
|
|
+ <div class="mg-t-20" >
|
|
|
+ <div class="flex">
|
|
|
+ <span class="textblod mg-r-10">满足</span>
|
|
|
+ <div class="border-grey sele-ele-box flex1"
|
|
|
+ :class="{'border-green': isCurFocus(conditionIndex, null, 'formula1')}"
|
|
|
+ @click="setMultiFocus(conditionIndex, null, 'formula1')">
|
|
|
+ <div class="flex jc-sb mg-b-20">
|
|
|
+ <div class="icon-box">
|
|
|
+ <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelectMulti(conditionIndex, 'formula1')"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '+', 'formula1')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '-', 'formula1')" icon="el-icon-remove-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '*', 'formula1')" icon="el-icon-circle-close"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '%', 'formula1')">÷</el-link>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, '(', false, 'formula1')">(</el-link>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, ')', true, 'formula1')">)</el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addTextMulti(conditionIndex, 'formula1')">输入值</el-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <draggable v-model="conditionList[conditionIndex].formula1">
|
|
|
+ <formula-item
|
|
|
+ v-for="(item,index) in conditionList[conditionIndex].formula1" :key="index"
|
|
|
+ :item="item" @click="obj => eleFormulaClickMulti(obj, index, conditionIndex, 'formula1')"
|
|
|
+ >
|
|
|
+ </formula-item>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex mg-t-10">
|
|
|
+ <span class="textblod mg-r-10">不满足</span>
|
|
|
+ <div class="border-grey sele-ele-box flex1"
|
|
|
+ :class="{'border-green': isCurFocus(conditionIndex, null, 'formula2')}"
|
|
|
+ @click="setMultiFocus(conditionIndex, null, 'formula2')">
|
|
|
+ <div class="flex jc-sb mg-b-20">
|
|
|
+ <div class="icon-box">
|
|
|
+ <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelectMulti(conditionIndex, 'formula2')"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '+', 'formula2')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '-', 'formula2')" icon="el-icon-remove-outline"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '*', 'formula2')" icon="el-icon-circle-close"></el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '%', 'formula2')">÷</el-link>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, '(', false, 'formula2')">(</el-link>
|
|
|
+ <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, ')', true, 'formula2')">)</el-link>
|
|
|
+ <el-link :underline="false" type="primary" @click="addTextMulti(conditionIndex, 'formula2')">输入值</el-link>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <draggable v-model="conditionList[conditionIndex].formula2">
|
|
|
+ <formula-item
|
|
|
+ v-for="(item,index) in conditionList[conditionIndex].formula2" :key="index"
|
|
|
+ :item="item" @click="obj => eleFormulaClickMulti(obj, index, conditionIndex, 'formula2')"
|
|
|
+ >
|
|
|
+ </formula-item>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-button size="small" @click="addCondition(conditionIndex)" type="primary">添加条件</el-button>
|
|
|
</div>
|
|
|
- <draggable v-model="conditionList[conditionIndex].formula1">
|
|
|
- <formula-item
|
|
|
- v-for="(item,index) in conditionList[conditionIndex].formula1" :key="index"
|
|
|
- :item="item" @click="obj => eleFormulaClickMulti(obj, index, conditionIndex, 'formula1')"
|
|
|
- >
|
|
|
- </formula-item>
|
|
|
- </draggable>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="flex mg-t-10">
|
|
|
- <span class="textblod mg-r-10">不满足</span>
|
|
|
- <div class="border-grey sele-ele-box flex1"
|
|
|
- :class="{'border-green': isCurFocus(conditionIndex, null, 'formula2')}"
|
|
|
- @click="setMultiFocus(conditionIndex, null, 'formula2')">
|
|
|
- <div class="flex jc-sb mg-b-20">
|
|
|
- <div class="icon-box">
|
|
|
- <el-link :underline="false" icon="el-icon-delete" type="danger" @click="removeSelectMulti(conditionIndex, 'formula2')"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '+', 'formula2')" icon="el-icon-circle-plus-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '-', 'formula2')" icon="el-icon-remove-outline"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '*', 'formula2')" icon="el-icon-circle-close"></el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addOperatorMulti(conditionIndex, '%', 'formula2')">÷</el-link>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, '(', false, 'formula2')">(</el-link>
|
|
|
- <el-link :underline="false" type="primary" class="mg-r-10" @click="addBracketsMulti(conditionIndex, ')', true, 'formula2')">)</el-link>
|
|
|
- <el-link :underline="false" type="primary" @click="addTextMulti(conditionIndex, 'formula2')">输入值</el-link>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <draggable v-model="conditionList[conditionIndex].formula2">
|
|
|
- <formula-item
|
|
|
- v-for="(item,index) in conditionList[conditionIndex].formula2" :key="index"
|
|
|
- :item="item" @click="obj => eleFormulaClickMulti(obj, index, conditionIndex, 'formula2')"
|
|
|
- >
|
|
|
- </formula-item>
|
|
|
- </draggable>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -268,7 +273,7 @@
|
|
|
import VueTagsInput from '@johmun/vue-tags-input';
|
|
|
import formulaItem from "../formulaItem";
|
|
|
import draggable from 'vuedraggable';
|
|
|
-import { template } from '@antv/g2plot/lib/utils';
|
|
|
+
|
|
|
export default {
|
|
|
name: "ifelse",
|
|
|
components: {
|
|
|
@@ -295,6 +300,20 @@ export default {
|
|
|
default: function () {
|
|
|
return {};
|
|
|
}
|
|
|
+ },
|
|
|
+ isMore:{
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ moreConditions:{
|
|
|
+ type: Array,
|
|
|
+ default: function () {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ conditionIndex:{//当前是多条件中的哪一个
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
}
|
|
|
},
|
|
|
data(){
|
|
|
@@ -331,14 +350,14 @@ export default {
|
|
|
// 重构多条件列表结构,包含独立的tags和公式
|
|
|
conditionList:[
|
|
|
{
|
|
|
- innerList: [
|
|
|
+ formulaIfElse: [
|
|
|
{
|
|
|
tag2: '',
|
|
|
tags2: [],
|
|
|
tag3: '',
|
|
|
tags3: [],
|
|
|
symbol1: '',
|
|
|
- logicSymbol: 'and'
|
|
|
+ logicSymbol: '&&'
|
|
|
}
|
|
|
],
|
|
|
tag4: '',
|
|
|
@@ -352,6 +371,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
+ console.log(this.formulainfo,'this.formulainfo333333');
|
|
|
+
|
|
|
let args0 = this.formulainfo.arguments[0];
|
|
|
let args1 = this.formulainfo.arguments[1];
|
|
|
let args2 = this.formulainfo.arguments[2];
|
|
|
@@ -365,13 +386,74 @@ export default {
|
|
|
this.result = '2';
|
|
|
this.initTFFormula(args1,args2)
|
|
|
}
|
|
|
+ if(this.isMore){
|
|
|
+ this.symbol = 'more';
|
|
|
+ console.log( this.moreConditions,' this.moreConditions;');
|
|
|
+
|
|
|
+ this.conditionList = this.moreConditions.map(item => this.clearTagsIfHasValue(item));
|
|
|
|
|
|
- // 初始化多条件数据
|
|
|
- if (this.symbol === 'more' && this.formulainfo.arguments[0] && Array.isArray(this.formulainfo.arguments[0])) {
|
|
|
- this.initMultiConditions(this.formulainfo.arguments[0]);
|
|
|
+
|
|
|
+
|
|
|
+ }else{
|
|
|
+ // this.conditionList=[]
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
methods:{
|
|
|
+
|
|
|
+ clearTagsIfHasValue(obj) {
|
|
|
+ // 复制对象以避免修改原对象
|
|
|
+ const result = JSON.parse(JSON.stringify(obj));
|
|
|
+
|
|
|
+ // 检查tags数组中是否存在name不为空的元素
|
|
|
+ const hasNonEmptyNameElement = (tagsArray) => {
|
|
|
+ return tagsArray && Array.isArray(tagsArray) &&
|
|
|
+ tagsArray.length > 0 &&
|
|
|
+ tagsArray.some(item => typeof item.name === 'string' && item.name.trim() !== '');
|
|
|
+ };
|
|
|
+
|
|
|
+ // 检查tags数组中是否存在name为空字符串的元素
|
|
|
+ const hasEmptyNameElement = (tagsArray) => {
|
|
|
+ return tagsArray && Array.isArray(tagsArray) &&
|
|
|
+ tagsArray.length > 0 &&
|
|
|
+ tagsArray.some(item => typeof item.name === 'string' && item.name.trim() === '');
|
|
|
+ };
|
|
|
+ // 处理顶层的tags4和tags5
|
|
|
+ if (hasEmptyNameElement(result.tags4)) {
|
|
|
+ result.tags4 = []; // 赋值为null
|
|
|
+ }
|
|
|
+ if (hasEmptyNameElement(result.tags5)) {
|
|
|
+ result.tags5 = []; // 赋值为null
|
|
|
+ }
|
|
|
+ // 处理顶层的tag4和tag5
|
|
|
+ if (hasNonEmptyNameElement(result.tags4)) {
|
|
|
+ result.tag4 = ""; // 清空对应的tag值
|
|
|
+ }
|
|
|
+ if (hasNonEmptyNameElement(result.tags5)) {
|
|
|
+ result.tag5 = ""; // 清空对应的tag值
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理formulaIfElse数组中的tag2和tag3
|
|
|
+ if (result.formulaIfElse && Array.isArray(result.formulaIfElse)) {
|
|
|
+ result.formulaIfElse.forEach(item => {
|
|
|
+ if (hasNonEmptyNameElement(item.tags2)) {
|
|
|
+ item.tag2 = ""; // 清空对应的tag值
|
|
|
+ }
|
|
|
+ if (hasNonEmptyNameElement(item.tags3)) {
|
|
|
+ item.tag3 = ""; // 清空对应的tag值
|
|
|
+ }
|
|
|
+ if (hasEmptyNameElement(item.tags2)) {
|
|
|
+ item.tags2 = []; // 赋值为null
|
|
|
+ }
|
|
|
+ if (hasEmptyNameElement(item.tags3)) {
|
|
|
+ item.tags3 = []; // 赋值为null
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ },
|
|
|
+
|
|
|
showSelectEle(){
|
|
|
this.$set(this.formulainfo,'showSelectEle',!this.formulainfo.showSelectEle);
|
|
|
},
|
|
|
@@ -412,7 +494,7 @@ export default {
|
|
|
let target;
|
|
|
|
|
|
if (innerIndex !== null) {
|
|
|
- target = conditionItem.innerList[innerIndex];
|
|
|
+ target = conditionItem.formulaIfElse[innerIndex];
|
|
|
} else {
|
|
|
target = conditionItem;
|
|
|
}
|
|
|
@@ -649,6 +731,7 @@ export default {
|
|
|
// 多条件下点选公式中的元素
|
|
|
eleFormulaClickMulti({selected,item}, index, conditionIndex, formulaType) {
|
|
|
const eleFormula = this.conditionList[conditionIndex][formulaType];
|
|
|
+ console.log(eleFormula,'eleFormula');
|
|
|
|
|
|
if(selected){
|
|
|
eleFormula.forEach((ele)=>{
|
|
|
@@ -821,7 +904,7 @@ export default {
|
|
|
this.multiFocus.field = formulaType;
|
|
|
this.inputVisible = true;
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
setELe(ele){
|
|
|
// 处理多条件情况
|
|
|
if (this.symbol === 'more' && this.multiFocus.conditionIndex !== -1) {
|
|
|
@@ -831,7 +914,7 @@ export default {
|
|
|
|
|
|
// 确定目标对象
|
|
|
if (innerIndex !== null) {
|
|
|
- target = conditionItem.innerList[innerIndex];
|
|
|
+ target = conditionItem.formulaIfElse[innerIndex];
|
|
|
} else {
|
|
|
target = conditionItem;
|
|
|
}
|
|
|
@@ -946,6 +1029,8 @@ export default {
|
|
|
|
|
|
//初始化真假值判断if(xxx)部分
|
|
|
initCondition(args0){
|
|
|
+
|
|
|
+
|
|
|
if(args0){
|
|
|
if(args0.length == 3){
|
|
|
//运算符号
|
|
|
@@ -1029,25 +1114,25 @@ export default {
|
|
|
if (Array.isArray(args0)) {
|
|
|
this.conditionList = args0.map(condition => {
|
|
|
// 处理内部条件列表
|
|
|
- const innerList = Array.isArray(condition.innerList) ?
|
|
|
- condition.innerList.map(inner => ({
|
|
|
+ const formulaIfElse = Array.isArray(condition.formulaIfElse) ?
|
|
|
+ condition.formulaIfElse.map(inner => ({
|
|
|
tag2: inner.tag2 || '',
|
|
|
tags2: inner.tags2 || [],
|
|
|
tag3: inner.tag3 || '',
|
|
|
tags3: inner.tags3 || [],
|
|
|
symbol1: inner.symbol1 || '',
|
|
|
- logicSymbol: inner.logicSymbol || 'and'
|
|
|
+ logicSymbol: inner.logicSymbol || '&&'
|
|
|
})) : [{
|
|
|
tag2: '',
|
|
|
tags2: [],
|
|
|
tag3: '',
|
|
|
tags3: [],
|
|
|
symbol1: '',
|
|
|
- logicSymbol: 'and'
|
|
|
+ logicSymbol: '&&'
|
|
|
}];
|
|
|
|
|
|
return {
|
|
|
- innerList,
|
|
|
+ formulaIfElse,
|
|
|
tag4: condition.tag4 || '',
|
|
|
tags4: condition.tags4 || [],
|
|
|
tag5: condition.tag5 || '',
|
|
|
@@ -1102,7 +1187,7 @@ export default {
|
|
|
} else {
|
|
|
// 处理多条件情况
|
|
|
this.formulainfo.arguments[0] = this.conditionList.map(condition => ({
|
|
|
- innerList: condition.innerList.map(inner => ({
|
|
|
+ formulaIfElse: condition.formulaIfElse.map(inner => ({
|
|
|
tag2: inner.tag2,
|
|
|
tags2: inner.tags2,
|
|
|
tag3: inner.tag3,
|
|
|
@@ -1227,14 +1312,14 @@ export default {
|
|
|
// 复制最后一个条件的结构作为新条件的基础
|
|
|
const newCondition = JSON.parse(JSON.stringify(this.conditionList[index]));
|
|
|
// 清空值但保留结构
|
|
|
- newCondition.innerList = [
|
|
|
+ newCondition.formulaIfElse = [
|
|
|
{
|
|
|
tag2: '',
|
|
|
tags2: [],
|
|
|
tag3: '',
|
|
|
tags3: [],
|
|
|
symbol1: '',
|
|
|
- logicSymbol: 'and'
|
|
|
+ logicSymbol: '&&'
|
|
|
}
|
|
|
];
|
|
|
newCondition.tag4 = '';
|
|
|
@@ -1266,17 +1351,17 @@ export default {
|
|
|
tag3: '',
|
|
|
tags3: [],
|
|
|
symbol1: '',
|
|
|
- logicSymbol: 'and'
|
|
|
+ logicSymbol: '&&'
|
|
|
};
|
|
|
|
|
|
- this.conditionList[conditionIndex].innerList.splice(innerIndex + 1, 0, newInnerItem);
|
|
|
+ this.conditionList[conditionIndex].formulaIfElse.splice(innerIndex + 1, 0, newInnerItem);
|
|
|
this.setCondition();
|
|
|
},
|
|
|
|
|
|
// 删除内部条件项
|
|
|
removeConditionItem(conditionIndex, innerIndex) {
|
|
|
- if (this.conditionList[conditionIndex].innerList.length > 1) {
|
|
|
- this.conditionList[conditionIndex].innerList.splice(innerIndex, 1);
|
|
|
+ if (this.conditionList[conditionIndex].formulaIfElse.length > 1) {
|
|
|
+ this.conditionList[conditionIndex].formulaIfElse.splice(innerIndex, 1);
|
|
|
this.setCondition();
|
|
|
} else {
|
|
|
this.$message({ type: "warning", message: "至少保留一个条件项" });
|