Browse Source

158分站操作记录修改

lxh 1 month ago
parent
commit
de2b213eab
1 changed files with 12 additions and 3 deletions
  1. 12 3
      src/views/vent/safetyList/common/operateRecord.vue

+ 12 - 3
src/views/vent/safetyList/common/operateRecord.vue

@@ -12,7 +12,7 @@
                 <a-col :span="4">
                     <div class="area-item">
                         <div class="item-text">所选分站:</div>
-                        <a-select v-model:value="searchData.stationId" style="width: 220px" placeholder="请选择分站">
+                        <a-select v-model:value="searchData.stationId" style="width: 220px" placeholder="请选择分站" >
                             <a-select-option v-for="(item, index) in stationList" :key="index" :value="item.value">{{
                                 item.label
                                 }}</a-select-option>
@@ -22,7 +22,7 @@
                 <a-col :span="4">
                     <div class="area-item">
                         <div class="item-text">所选设备:</div>
-                        <a-select v-model:value="searchData.deviceId" style="width: 220px" placeholder="请选择设备">
+                        <a-select v-model:value="searchData.deviceId" style="width: 220px" placeholder="请选择设备" @dropdownVisibleChange="dropdownVisibleChange">
                             <a-select-option v-for="(item, index) in deviceList" :key="index" :value="item.value">{{
                                 item.label
                                 }}</a-select-option>
@@ -48,6 +48,7 @@
 import { ref, reactive,watch, onMounted } from 'vue'
 import { columnsOperate } from '../safetyList.data';
 import { subStationList, get158StationDevices } from '../safetyList.api'
+import { useMessage } from '/@/hooks/web/useMessage';
 
 let props=defineProps({
     operationData:{
@@ -67,6 +68,7 @@ let deviceList = ref<any[]>([])
 
 let tableData = ref<any[]>([])
 let $emit = defineEmits(['getSearchRecord'])
+const { createMessage } = useMessage();
 
 //获取分站信息
 async function getSubStationList() {
@@ -93,6 +95,13 @@ async function get158StationDevicesList() {
         })
     }
 }
+function dropdownVisibleChange(open){
+    if(open && searchData.stationId){
+        get158StationDevicesList()
+    }else {
+        createMessage.warning('请选择对应分站!');
+    }
+}
 //查询
 function getSearchRecord() {
     $emit('getSearchRecord', searchData)
@@ -111,7 +120,7 @@ onMounted(() => {
     //获取分站列表
     getSubStationList()
     //获取设备列表
-    get158StationDevicesList()
+    // get158StationDevicesList()
 })
 </script>