Преглед на файлове

级联选择过滤搜索

yuhan преди 1 месец
родител
ревизия
1d94b57008

+ 12 - 0
src/views/module_interLock/interlockSummarySet/InterlockConditionForm.vue

@@ -10,6 +10,7 @@
                 v-model="model.interlockConditionData"
                 :options="tagDataOptions"
                 :fieldNames="customFieldNames"
+                :show-search="{ filter }"
                 expand-trigger="hover"
                 placeholder="请选择点位"
                 @change="changeCascaderCondition"
@@ -51,6 +52,7 @@
                   v-model="model.inputStatusData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择输入卡件状态"
                   @change="changeCascaderInput"
@@ -72,6 +74,7 @@
                   v-model="model.outputStatusData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择输出卡件状态"
                   @change="changeCascaderOutput"
@@ -93,6 +96,7 @@
                   v-model="model.mpStatusData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择MP状态"
                   @change="changeCascaderMp"
@@ -126,6 +130,7 @@
                   v-model="model.instrumentStatusData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择仪表位号"
                   @change="changeCascaderInstrument"
@@ -140,6 +145,7 @@
                   v-model="model.ysmnlData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择原始模拟量"
                   @change="changeCascaderYsmnl"
@@ -166,6 +172,7 @@
                   v-model="model.ysmnlData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择原始模拟量"
                   @change="changeCascaderYsmnl"
@@ -230,6 +237,7 @@
                   v-model="model.bypassData"
                   :options="tagDataOptions"
                   :fieldNames="customFieldNames"
+                  :show-search="{ filter }"
                   expand-trigger="hover"
                   placeholder="请选择旁路"
                   @change="changeCascaderBypass"
@@ -482,6 +490,10 @@
         this.model.bypass = selectedOptions[2].value
         this.model = {...this.model}
       },
+      // 级联选择过滤搜索
+      filter(inputValue, path) {
+        return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
+      },
       statusRadioChange(e){
         // console.log(e)
         // console.log(this.model.inputStatusRadio)

+ 5 - 0
src/views/module_interLock/interlockSummarySet/InterlockSummarySet.vue

@@ -138,6 +138,7 @@
                     v-model="model.interlockOutValueData"
                     :options="tagDataOptions"
                     :fieldNames="customFieldNames"
+                    :show-search="{ filter }"
                     expand-trigger="hover"
                     placeholder="请选择"
                     @change="changeCascader"
@@ -444,6 +445,10 @@
           this.model.interlockOutValueTag = value[2]
           this.model.interlockOutValue = selectedOptions[2].value
         },
+        // 级联选择过滤搜索
+        filter(inputValue, path) {
+          return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
+        },
         // 新增联锁条件
         handleAddCondition(){
           this.tableClickRowIndex = -1