lex-xin пре 4 година
родитељ
комит
d11e5b15cd

+ 52 - 3
src/components/wfd/components/DetailPanel/FlowDetail.vue

@@ -33,7 +33,7 @@
             style="width:90%; font-size:12px"
             placeholder="请选择关联字段"
             clearable
-            @change="onChangeCondition"
+            @change="onChangeSelectCondition"
           >
             <el-option-group
               v-for="group in fieldList"
@@ -63,7 +63,18 @@
             <el-option label="不等于" value="!=" />
             <el-option label="等于" value="==" />
           </el-select>
+          <el-select
+            v-if="fieldType[index].type == 'select'"
+            v-model="item.value"
+            style="width:90%; font-size:12px"
+            placeholder="请选择"
+            clearable
+            @change="onChangeCondition"
+          >
+            <el-option v-for="type in fieldType[index].options" :key="type.value" :label="type.value" :value="type.value" />
+          </el-select>
           <el-input
+            v-else
             v-model="item.value"
             style="width:90%; font-size:12px"
             clearable
@@ -114,6 +125,10 @@ export default {
         sign: null,
         value: null
       }],
+      fieldType: [{
+        type: null,
+        options: []
+      }],
       fieldList: []
     }
   },
@@ -127,6 +142,8 @@ export default {
       conditionExpression = conditionExpression ? JSON.parse(conditionExpression) : null
       if (conditionExpression) {
         this.conditionList = conditionExpression
+        this.onFormatField()
+        this.$forceUpdate()
       } else {
         this.conditionList = [{
           key: null,
@@ -140,6 +157,30 @@ export default {
     this.__init()
   },
   methods: {
+    onChangeSelectCondition() {
+      this.onFormatField()
+      this.$forceUpdate()
+      this.onChange('conditionExpression', JSON.stringify(this.conditionList))
+    },
+    onFormatField() {
+      this.conditionList.forEach((con, index) => {
+        this.fieldType[index] = this.onFormatType(con.key)
+      })
+    },
+    onFormatType(value) {
+      const temp = {}
+      this.fieldList.forEach(list => {
+        if (list.options && list.options.length) {
+          list.options.forEach(item => {
+            if (item.value == value) {
+              temp.type = item.type
+              temp.options = item.options
+            }
+          })
+        }
+      })
+      return temp
+    },
     onChangeCondition() {
       this.onChange('conditionExpression', JSON.stringify(this.conditionList))
     },
@@ -156,11 +197,12 @@ export default {
         conditionExpression = conditionExpression ? JSON.parse(conditionExpression) : null
         if (conditionExpression) {
           this.conditionList = conditionExpression
+          this.onFormatField()
+          this.$forceUpdate()
         }
       })
     },
     async getFieldList(id) {
-      console.log(id)
       return new Promise(async(resolve, reject) => {
         await templateDetails({ template_id: id }).then(res => {
           resolve(res.data)
@@ -183,7 +225,9 @@ export default {
             if (item.type != 'subform') {
               options.options.push({
                 label: item.name,
-                value: item.model
+                type: item.type,
+                value: item.model,
+                options: item.options.options || []
               })
             }
           })
@@ -199,6 +243,10 @@ export default {
         sign: null,
         value: null
       })
+      this.fieldType.push({
+        type: null,
+        options: []
+      })
     },
     delDisplayCondition(index) {
       this.$confirm('是否删除条件表达式?', {
@@ -207,6 +255,7 @@ export default {
         type: 'warning'
       }).then(() => {
         this.conditionList.splice(index, 1)
+        this.fieldType.splice(index, 1)
       })
     }
   }

+ 1 - 1
src/views/login/index.vue

@@ -239,7 +239,7 @@ export default {
             })
             .catch(() => {
               this.loading = false
-              this.getCode()
+              // this.getCode()
             })
         } else {
           return false

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/index.html


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/css/chunk-66ec1369.c4ce1d3c.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/css/chunk-b2979236.cfd1bfa7.css


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/app.0e02b43c.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-66ec1369.cbae780b.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-7d19a5ec.8c00ed3b.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-7d19a5ec.a9dfa22a.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-a72e6e4c.fbc6c36d.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-b2979236.0cff3e9e.js


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
web/static/web/js/chunk-f2e50f6c.49f75019.js


Неке датотеке нису приказане због велике количине промена