Преглед изворни кода

1. 历史数据设备添加模糊查询

hongrunxia пре 10 месеци
родитељ
комит
d2f67e3abb
1 измењених фајлова са 11 додато и 7 уклоњено
  1. 11 7
      src/views/vent/monitorManager/comment/HistoryTable.vue

+ 11 - 7
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -331,16 +331,20 @@
                 {
                   label: '查询设备',
                   field: 'gdeviceid',
-                  component: 'Input',
-                  // defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
+                  component: 'Select',
+                  defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
                   required: true,
                   componentProps: {
-                    // options: deviceOptions,
+                    showSearch: true,
+                    filterOption: (input: string, option: any) => {
+                      return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+                    },
+                    options: deviceOptions,
                     onChange: (e, option) => {
-                      // if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind']))
-                      //   historyType.value = option['strtype'] || option['devicekind'];
-                      // if (option['strtype']) deviceTypeStr.value = option['strtype'];
-                      // stationType.value = option['stationtype'];
+                      if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind']))
+                        historyType.value = option['strtype'] || option['devicekind'];
+                      if (option['strtype']) deviceTypeStr.value = option['strtype'];
+                      stationType.value = option['stationtype'];
                       nextTick(async () => {
                         await getDataSource();
                       });