|
@@ -22,11 +22,11 @@
|
|
|
<div class="mg-t-20 flex jc-al-c">
|
|
|
<span class="textblod mg-r-20">IF</span>
|
|
|
<div class="flex jc-al-c" v-if="symbol == '<&&<' || symbol == '<=&&<='">
|
|
|
- <vue-tags-input v-model="tag1" :tags="tags1" @focus="curFocusIndex = 1" @blur="tags1 = [];setCondition()" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
+ <vue-tags-input v-model="tag1" :tags="tags1" @focus="curFocusIndex = 1" @blur="inputBlur(1)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
<span v-if="symbol == '<&&<'" class="mg-l-20 mg-r-20"><</span>
|
|
|
<span v-if="symbol == '<=&&<='" class="mg-l-20 mg-r-20">≤</span>
|
|
|
</div>
|
|
|
- <vue-tags-input v-model="tag2" :tags="tags2" @focus="curFocusIndex = 2" @blur="tags2 = [];setCondition()" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
+ <vue-tags-input v-model="tag2" :tags="tags2" @focus="curFocusIndex = 2" @blur="inputBlur(2)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
<span class="mg-l-20 mg-r-20">
|
|
|
<span v-if="symbol == '>='">≥</span>
|
|
|
<span v-if="symbol == '<='">≤</span>
|
|
@@ -36,14 +36,14 @@
|
|
|
<span v-if="symbol == '<&&<'"><</span>
|
|
|
<span v-if="symbol == '<=&&<='">≤</span>
|
|
|
</span>
|
|
|
- <vue-tags-input v-model="tag3" :tags="tags3" @focus="curFocusIndex = 3" @blur="tags3 = [];setCondition()" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
+ <vue-tags-input v-model="tag3" :tags="tags3" @focus="curFocusIndex = 3" @blur="inputBlur(3)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
</div>
|
|
|
|
|
|
<div class="flex jc-al-c mg-t-20" v-if="result == 1">
|
|
|
<span class="textblod mg-r-10">真值</span>
|
|
|
- <vue-tags-input v-model="tag4" :tags="tags4" @focus="curFocusIndex = 4" @blur="tags4 = [];setTF()" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
+ <vue-tags-input v-model="tag4" :tags="tags4" @focus="curFocusIndex = 4" @blur="inputBlur(4)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
<span class="textblod mg-r-10 mg-l-20">假值</span>
|
|
|
- <vue-tags-input v-model="tag5" :tags="tags5" @focus="curFocusIndex = 5" @blur="tags5 = [];setTF()" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
+ <vue-tags-input v-model="tag5" :tags="tags5" @focus="curFocusIndex = 5" @blur="inputBlur(5)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
|
|
|
</div>
|
|
|
<div class="mg-t-20" v-if="result == 2">
|
|
|
<div class="flex">
|
|
@@ -205,6 +205,19 @@ export default {
|
|
|
console.log(111)
|
|
|
},
|
|
|
|
|
|
+ inputBlur(num){
|
|
|
+ if(this['tag'+num]){
|
|
|
+ this['tags'+num] = [];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(num>=1&&num<=3){
|
|
|
+ this.setCondition();
|
|
|
+ }else if(num>=4&&num<=5){
|
|
|
+ this.setTF();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
addText(){
|
|
|
this.inputVisible = true;
|
|
|
},
|
|
@@ -348,8 +361,13 @@ export default {
|
|
|
this['tags'+this.curFocusIndex] = [obj];
|
|
|
this['tag'+this.curFocusIndex] = '';
|
|
|
|
|
|
+ if(this.curFocusIndex == 4 || this.curFocusIndex == 5){
|
|
|
+ this.setTF();
|
|
|
+ }else{
|
|
|
+ this.setCondition();
|
|
|
+ }
|
|
|
+
|
|
|
this.curFocusIndex = 0;
|
|
|
- this.setCondition();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -423,6 +441,13 @@ export default {
|
|
|
}else if((typeof args0[6]) == 'string'){
|
|
|
this.tag3 = args0[6];
|
|
|
}
|
|
|
+ }else if(typeof args0 == 'object' && args0.type == 'Element'){
|
|
|
+ let ele = args0;
|
|
|
+ this.tags2 = [
|
|
|
+ Object.assign({
|
|
|
+ text:ele.name,
|
|
|
+ style:'background-color: #409EFF',
|
|
|
+ },ele)]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -499,15 +524,45 @@ export default {
|
|
|
//初始化运算的真假值
|
|
|
initTFFormula(args1,args2){
|
|
|
if(Array.isArray(args1)){
|
|
|
+ args1.forEach((a,index)=>{
|
|
|
+ if(typeof a == 'string'){
|
|
|
+ this.$set(args1,index,{
|
|
|
+ type:'Text',
|
|
|
+ name:a,
|
|
|
+ selected:false,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
this.selectEleFormula = args1;
|
|
|
}else if(typeof args1 == 'object' && args1.type == 'Element'){
|
|
|
this.selectEleFormula = [Object.assign({},args1)];
|
|
|
+ }else if(typeof args1 == 'string'){
|
|
|
+ this.selectEleFormula = [{
|
|
|
+ type:'Text',
|
|
|
+ name:args1,
|
|
|
+ selected:false,
|
|
|
+ }]
|
|
|
}
|
|
|
|
|
|
if(Array.isArray(args2)){
|
|
|
- this.selectEleFormula2 = args1;
|
|
|
+ args2.forEach((a,index)=>{
|
|
|
+ if(typeof a == 'string'){
|
|
|
+ this.$set(args2,index,{
|
|
|
+ type:'Text',
|
|
|
+ name:a,
|
|
|
+ selected:false,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.selectEleFormula2 = args2;
|
|
|
}else if(typeof args2 == 'object' && args2.type == 'Element'){
|
|
|
this.selectEleFormula2 = [Object.assign({},args2)];
|
|
|
+ }else if(typeof args2 == 'string'){
|
|
|
+ this.selectEleFormula2 = [{
|
|
|
+ type:'Text',
|
|
|
+ name:args2,
|
|
|
+ selected:false,
|
|
|
+ }]
|
|
|
}
|
|
|
},
|
|
|
|