lxh 4 месяцев назад
Родитель
Сommit
cb04c02a28

+ 2 - 2
src/hooks/system/useCameraPianation.ts

@@ -27,9 +27,9 @@ export function useCamera() {
   async function getCamera(deviceid, parentPlayerDom, renderPlayer, pagination, cameraData?, devKind?, isCustom = false) {
     await removeCameraRef(parentPlayerDom, renderPlayer);
     let res;
-    if (!devKind) {
+    if (!devKind && !cameraData ) {
       res = await cameraList({ deviceid, pageNo: pagination.current, pageSize: pagination.pageSize, });
-    }else {
+    }else if(devKind && !cameraData) {
       res = await cameraList({ sysId: deviceid, devKind, pageNo: pagination.current, pageSize: pagination.pageSize, });
     }
     Total.value = !cameraData ?  res.total : 0

+ 3 - 0
src/views/vent/monitorManager/airDoor/airdoor.api.ts

@@ -17,6 +17,7 @@ list='/safety/ventanalyDeviceInfo/list',
 edit='/ventanaly-device/safety/ventanalyDeviceInfo/batchEdit',
 manualTimeSync='/ventanaly-device/monitor/timeSync/manualTimeSync',
 isPasswordCurrect='/ventanaly-device/monitor/timeSync/isPasswordCurrect',
+ editDoor='/safety/ventanalyDeviceInfo/edit'
 
 }
 
@@ -70,3 +71,5 @@ export const confirmChoice = (params) => defHttp.put({ url: Api.edit, params });
 export const manualTimeSync = () => defHttp.post({ url: Api.manualTimeSync });
 //设备集控选择密码设置
 export const isPasswordCurrect = (params) => defHttp.get({ url: Api.isPasswordCurrect,params });
+//风门勾选-分组
+export const editDoor = (params) => defHttp.put({ url: Api.editDoor, params });

+ 29 - 11
src/views/vent/monitorManager/airDoor/components/door-content-r.vue

@@ -24,9 +24,9 @@
 
     </div>
     <div class="content-r-container">
-      <div class="content-r-box" v-for="(item, index) in infoDatas" :key="index">
+      <div class="content-r-box" v-for="(item, index) in infoDatas" :key="index" @click="handlerAddorDel(item)">
         <div class="box-title">
-          <SvgIcon v-show="item.iconControl" class="title-icon" size="16"  name="select-control" />
+          <SvgIcon v-show="item.iconControl" class="title-icon" size="16" name="select-control" />
           <div class="title-text">{{ item.strinstallpos }}</div>
           <div class="title-detail" @click="handlerDetail(item.deviceID)">详情</div>
         </div>
@@ -97,7 +97,7 @@ import gateSVG from './gateSVG.ssl.vue'
 import operationModal from './operationModal.vue'
 import DeviceControl from './deviceControl.vue'
 import { useRouter } from 'vue-router';
-import { devicecontrol, insertSyncRule, GetSyncRule, controlList, confirmChoice, manualTimeSync, isPasswordCurrect, dictList } from '../airdoor.api'
+import { devicecontrol, insertSyncRule, GetSyncRule, controlList, confirmChoice, manualTimeSync, isPasswordCurrect, editDoor } from '../airdoor.api'
 import { doorStatus } from '../airdoor.data'
 // import { getModelComponent } from '../airdoor.data'
 import { useMessage } from '/@/hooks/web/useMessage';
@@ -142,7 +142,8 @@ let cameraDetailTitle = ref('视屏墙详情信息')
 let cameraData = ref<any[]>([])
 //风门集控类型-字典
 const dictCodes = getDictItemsByCode('gateCentralizedControl');
-let $emit=defineEmits(['toggleInfoData']) 
+//是否开启分组
+let isOpenFz = ref('')
 
 const setChildRef = (el, index) => {
   childRefs.value[index] = el
@@ -284,15 +285,32 @@ function handleCancelCameraDetail(param) {
 
 //设备集控-分组控制
 function handlerFz(item) {
-  infoDatas.value.forEach(el => {
-    if (el.gateCentralizedControl == item.value) {
+  isOpenFz.value = item.value
+  if (item.value == '0') {
+    infoDatas.value.forEach(el => {
       el.iconControl = true
-    } else {
-      el.iconControl = false
-    }
-  })
-  $emit('toggleInfoData',item.value)
+    })
+  } else {
+    infoDatas.value.forEach(el => {
+      if (el.gateCentralizedControl == item.value) {
+        el.iconControl = true
+      } else {
+        el.iconControl = false
+      }
+    })
+  }
 }
+//分组中添加或删除元素
+async function handlerAddorDel(item) {
+  if (isOpenFz.value && item.gateCentralizedControl) {
+    item.iconControl = !item.iconControl
+    // // let res = await editDoor({ gateCentralizedControl: isOpenFz.value, id: item.deviceID })
+    // console.log(isOpenFz.value, '开启分组并且当前点击项已有分组')
+  } else {
+    isOpenFz.value = ''
+  }
+}
+
 
 watch(() => props.infoData, (newV, oldV) => {
   infoDatas.value = newV

+ 1 - 1
src/views/vent/monitorManager/airDoor/components/tipModal.vue

@@ -25,7 +25,7 @@ let props = defineProps({
 })
 
 let anc=inject( 'visibleTs30')
-let timeout = ref(30)
+let timeout = ref(10)
 let Visible = ref(false)
 let $emit = defineEmits(['handleCancel'])
 

+ 5 - 9
src/views/vent/monitorManager/airDoor/index.vue

@@ -6,7 +6,7 @@
         <doorMenuL :menuData="menuData" />
       </div>
       <div class="container-right">
-        <doorContentR :infoData="menuData" :visibleTs30="visibleTs30" @toggleInfoData="toggleInfoData" />
+        <doorContentR :infoData="menuData" :visibleTs30="visibleTs30" />
       </div>
     </div>
   </div>
@@ -22,7 +22,6 @@ import { getDevice, upcoming } from './airdoor.api'
 let menuData = ref<any[]>([]);
 //控制定时设置提示弹窗显示/隐藏
 let visibleTs30 = ref(false);
-let gateCentralizedControl = ref('')
 
 // https获取监测数据
 let timer: null | NodeJS.Timeout = null;
@@ -37,7 +36,7 @@ function getMonitor(flag?) {
       }
       getMonitor(false);
     },
-    flag ? 0 : 5000
+    flag ? 0 : 15000
   );
 }
 
@@ -46,7 +45,7 @@ async function getMenuList() {
   let res = await getDevice({ devicetype: "gate", pagetype: "normal" })
   console.log(res, 'menuList')
   if (res.msgTxt[0].datalist.length) {
-    menuData.value = gateCentralizedControl.value && gateCentralizedControl.value!='0' ? res.msgTxt[0].datalist.filter(v => v.isAutosync == '1' && v.gateCentralizedControl == gateCentralizedControl.value) : res.msgTxt[0].datalist.filter(v => v.isAutosync == '1')
+    menuData.value =  res.msgTxt[0].datalist.filter(v => v.isAutosync == '1')
   } else {
     menuData.value = []
   }
@@ -60,14 +59,11 @@ async function upcomingList() {
     visibleTs30.value = false
   }
 }
-//分组设备集控
-function toggleInfoData(param) {
-  gateCentralizedControl.value = param
-}
+
 
 onMounted(() => {
   getMenuList()
-  getMonitor(true)
+  getMonitor()
 })
 onUnmounted(() => {
   if (timer) {