Browse Source

思山岭铁矿-风门同控更新

lxh 11 hours ago
parent
commit
074ec21189

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

@@ -9,7 +9,9 @@ enum Api {
   devicecontrol = '/safety/ventanalyMonitorData/devicecontrol_ssl',
   insertSyncRule = '/ventanaly-device/synccontrol/upcoming/saveOrUpdateRule',
   upcoming = '/ventanaly-device/synccontrol/upcoming',
-  GetSyncRule='/ventanaly-device/synccontrol/upcoming/GetSyncRule'
+  GetSyncRule='/ventanaly-device/synccontrol/upcoming/GetSyncRule',
+  GetSyncRuleOperationLog='/ventanaly-device/synccontrol/upcoming/GetSyncRuleOperationLog',
+  GetSyncRuleExecLog='/ventanaly-device/synccontrol/upcoming/GetSyncRuleExecLog'
 }
 
 
@@ -44,11 +46,17 @@ export const GetSyncRule = (params) => defHttp.post({ url: Api.GetSyncRule, para
 */
 export const insertSyncRule = (params) => {
   // 加密password
-  const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
-  params.password = encryption.encryptByAES(params.password);
+  //const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
+  //params.password = encryption.encryptByAES(params.password);
   return defHttp.post({ url: Api.insertSyncRule, params });
 };
 
 //读取未来30秒内的预告
 export const upcoming = (params) => defHttp.get({ url: Api.upcoming, params });
 
+//读取规则日志
+export const GetSyncRuleOperationLog = (params) => defHttp.get({ url: Api.GetSyncRuleOperationLog, params });
+
+//读取集控风门操作日志
+export const GetSyncRuleExecLog = (params) => defHttp.get({ url: Api.GetSyncRuleExecLog, params });
+

+ 138 - 0
src/views/vent/monitorManager/airDoor/airdoor.data.ts

@@ -1,4 +1,122 @@
 import { defineAsyncComponent } from 'vue';
+import { BasicColumn } from '/@/components/Table';
+
+export const columns: BasicColumn[] = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`
+  },
+  {
+    title: 'ID',
+    dataIndex: 'id',
+    key: 'id',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '操作状态',
+    dataIndex: 'operationStatus',
+    key: 'operationStatus',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '操作类型',
+    dataIndex: 'operationType',
+    key: 'operationType',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '操作时间',
+    dataIndex: 'operationTime',
+    key: 'operationTime',
+    align: 'center',
+    ellipsis: true,
+  },
+]
+export const controlColumns: BasicColumn[] = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`
+  },
+  {
+    title: '操作类型',
+    dataIndex: 'message',
+    key: 'message',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '成功数',
+    dataIndex: 'successCount',
+    key: 'successCount',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '失败数',
+    dataIndex: 'failCount',
+    key: 'failCount',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '创建时间',
+    dataIndex: 'createdAt',
+    key: 'createdAt',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    width: 150,
+    align: 'center',
+    slots: { customRender: 'action' },
+  },
+]
+
+export const detailColumns: BasicColumn[] = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`
+  },
+  {
+    title: 'ID',
+    dataIndex: 'id',
+    key: 'id',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '设备名称',
+    dataIndex: 'name',
+    key: 'name',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '前门状态',
+    dataIndex: '前门',
+    key: '前门',
+    align: 'center',
+    ellipsis: true,
+  },
+  {
+    title: '后门状态',
+    dataIndex: '后门',
+    key: '后门',
+    align: 'center',
+    ellipsis: true,
+  },
+]
 
 export const hourOption: any[] = [
   { label: '00', value: 0 },
@@ -91,6 +209,26 @@ export const minuteOption: any[] = [
 
 ]
 
+//分页参数配置
+export let pagination = {
+  current: 1, // 当前页码
+  pageSize: 10, // 每页显示条数
+  total: 0, // 总条目数,后端返回
+  // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
+  showSizeChanger: true, // 是否可改变每页显示条数
+  pageSizeOptions: ['10', '20', '50'], // 可选的每页显示条数
+}
+
+//操作类型
+export let OptionList = [
+  { label: 'INSERT', value: 'INSERT' },
+  { label: 'UPDATE', value: 'UPDATE' },
+]
+export let controlOptionList = [
+  { label: '手动', value: '手动' },
+  { label: '自动', value: '自动' },
+]
+
 const componentsCaches = new Map<string, any>();
 export function getModelComponent(is2DModel: boolean = false, type: string = '') {
   if (!is2DModel) return '';

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

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     ref="modalRef"
-    width="850px"
+    width="1100px"
     :visible="props.visible"
     :wrap-style="{ overflow: 'hidden' }"
     @ok="handleOk"

+ 7 - 7
src/views/vent/monitorManager/airDoor/components/cameraModal.vue

@@ -146,8 +146,8 @@
           lang: 'zh',
           id: id,
           url: videoAddr,
-          width: 376,
-          height: 210,
+          width: 500,
+          height: 282,
           isLive: true,
           autoplay: true,
           autoplayMuted: true,
@@ -176,8 +176,8 @@
           lang: 'zh',
           id: id,
           url: videoAddr,
-          width: 376,
-          height: 210,
+          width: 500,
+          height: 282,
           isLive: true,
           autoplay: true,
           autoplayMuted: true,
@@ -248,9 +248,9 @@
     flex-wrap: wrap;
 
     .player-box {
-      width: 400px;
-      height: 235px;
-      padding: 10px 12px;
+      width: 525px;
+      height: 312px;
+      padding: 12px 13px;
       background: var(--image-camera_bg);
       background-size: 100% 100%;
       position: relative;

+ 52 - 42
src/views/vent/monitorManager/airDoor/components/door-content-r.vue

@@ -1,13 +1,10 @@
 <template>
   <div class="door-content-r">
     <div class="content-r-btn">
-       <a-button type="primary" @click="handlerOpenOrClose('open')">
-        同步开启
-      </a-button>
-      <!-- <a-button type="primary" @click="handlerOpenOrClose('open')">
+      <a-button type="primary" @click="handlerOpenOrClose('open')">
         <SvgIcon class="icon-style" size="14" color="#30b3fc" name="open-door" />
         同步开启
-      </a-button> -->
+      </a-button>
       <a-button type="primary" style="margin: 0px 10px" @click="handlerOpenOrClose('close')">
         <SvgIcon class="icon-style" size="14" color="#30b3fc" name="close-door" />
         同步关闭
@@ -16,7 +13,7 @@
         <SvgIcon class="icon-style" size="14" color="#30b3fc" name="time-setting-door" />
         定时设置
       </a-button>
-      <a-button style="margin: 0px 10px" type="primary">操作日志</a-button>
+      <a-button style="margin: 0px 10px" type="primary" @click="handlerOperation">操作日志</a-button>
     </div>
     <div class="content-r-container">
       <div class="content-r-box" v-for="(item, index) in infoDatas" :key="index">
@@ -26,9 +23,10 @@
         </div>
         <div class="box-content">
           <!-- 二三维信息 -->
-          <!-- <gateDualSVG :ref="`modelRef${index}`" :indexCode="index"></gateDualSVG> -->
-          <component :ref="`modelRef${index}`" :indexCode="index"
-            :is="getModelComponent(globalConfig.is2DModel, item.deviceType)" />
+          <gateDualSVG v-if="item.deviceType == 'gate_qd'" :ref="`modelRef${index}`" :indexCode="index"></gateDualSVG>
+          <gateSVG v-if="item.deviceType == 'gate_ss'" :ref="`modelRef${index}`" :indexCode="index"></gateSVG>
+          <!-- <component :ref="`modelRef${index}`" :indexCode="index"
+            :is="getModelComponent(globalConfig.is2DModel, item.deviceType)" /> -->
         </div>
         <img src="@/assets/images/camera.png" alt="" @click="handlerCamera(item, index)" />
       </div>
@@ -44,6 +42,9 @@
     <Modal :visible="modalVisible" :centered="true" :destroyOnClose="true" @cancel="handleCancelCamera">
       <CameraModal :cameraData="cameraData"></CameraModal>
     </Modal>
+    <!-- 操作日志 -->
+    <operationModal :visible="visibleOperation"  @handleCancel="handleCancelOperation" >
+    </operationModal>
   </div>
 </template>
 
@@ -54,10 +55,12 @@ import timeSetModal from './timeSetModal.vue';
 import CameraModal from './cameraModal.vue';
 import Modal from './Modal.vue';
 import tipModal from './tipModal.vue'
-// import gateDualSVG from './gateDualSVG.vue'
+import gateDualSVG from './gateDualSVG.vue'
+import gateSVG from './gateSVG.vue'
+import operationModal from './operationModal.vue'
 import { useRouter } from 'vue-router';
 import { devicecontrol, insertSyncRule, GetSyncRule } from '../airdoor.api'
-import { getModelComponent } from '../airdoor.data'
+// import { getModelComponent } from '../airdoor.data'
 import { useMessage } from '/@/hooks/web/useMessage';
 import { SvgIcon } from '/@/components/Icon';
 
@@ -93,12 +96,13 @@ const modelRef5 = ref(null);
 const modelRef6 = ref(null);
 const modelRef7 = ref(null);
 const modelRef8 = ref(null);
-// const modelComponent = shallowRef(getModelComponent(globalConfig.is2DModel));
+//操作日志弹窗显示/关闭
+let visibleOperation = ref(false)
+
 
 
 //同步开启/关闭--弹窗
 function handlerOpenOrClose(data) {
-  console.log('111kaiqi')
   visible.value = true;
   visibleStatus.value = data
 }
@@ -131,7 +135,7 @@ async function handleOkTime(param) {
   let start_time = `${param.formState.hourS}:${param.formState.minuteS}:${param.formState.secondS}`
   let end_time = `${param.formState.hourE}:${param.formState.minuteE}:${param.formState.secondE}`
   let enabled = param.formState.checked ? '1' : '0'
-  let res = await insertSyncRule({ startTime: start_time, endTime: end_time, enabled: enabled, id: Ids.value, password: param.formState.passWord || globalConfig?.simulatedPassword })
+  let res = await insertSyncRule({ startTime: start_time, endTime: end_time, enabled: enabled, id: Ids.value, password: param.formState.passWord })
   console.log(res, '设置定时---')
   if (res) {
     visibleTime.value = param.visib
@@ -150,52 +154,58 @@ function handlerDetail(id) {
 }
 //摄像头切换
 function handlerCamera(item, index) {
-  console.log(item,'cemarea')
   modalVisible.value = true;
   cameraData = Object.assign({}, item)
 }
+//摄像头弹窗关闭
 function handleCancelCamera(param) {
-  console.log(param,'990099')
   modalVisible.value = param;
 }
+//操作日志弹窗-打开
+function handlerOperation(){
+    visibleOperation.value = true
+}
 
-
+//操作日志弹窗-关闭
+function handleCancelOperation(param) {
+  visibleOperation.value = param
+}
+//模型动画
 function monitorAnimation(selectData, index) {
   if (index == 0) {
     modelRef0.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  }else if (index == 1) {
+    modelRef1.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 2) {
+    modelRef2.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 3) {
+    modelRef3.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 4) {
+    modelRef4.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 5) {
+    modelRef5.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 6) {
+    modelRef6.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 7) {
+    modelRef7.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
+  } else if (index == 8) {
+    modelRef8.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
   }
-  //  else if (index == 1) {
-  //   modelRef1.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 2) {
-  //   modelRef2.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 3) {
-  //   modelRef3.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 4) {
-  //   modelRef4.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 5) {
-  //   modelRef5.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 6) {
-  //   modelRef6.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 7) {
-  //   modelRef7.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // } else if (index == 8) {
-  //   modelRef8.value[0]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
-  // }
 }
 
 
 watch(() => props.infoData, (newV, oldV) => {
   console.log(newV, 'new---')
   infoDatas.value = newV
-  // if (newV.length) {
-  //   setTimeout(() => {
-  //     newV.forEach((el: any, index: number) => {
-  //       el = Object.assign(el, el.readData)
-  //       monitorAnimation(el, index);
-  //     })
-  //   }, 1000)
+  if (newV.length) {
+    setTimeout(() => {
+      newV.forEach((el: any, index: number) => {
+        el = Object.assign(el, el.readData)
+        monitorAnimation(el, index);
+      })
+    }, 1000)
 
-  // }
+  }
 })
 
 

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

@@ -1,6 +1,6 @@
 <template>
   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
-    preserveAspectRatio="none" x="0px" y="0px" width="360px" height="204" viewBox="500 320 1000 500">
+    preserveAspectRatio="none" x="0px" y="0px" width="360px" height="204" style="padding:5px" viewBox="500 320 1000 500">
     <defs>
       <linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="-961.8" y1="-242.45" x2="-961.8" y2="-242.45"
         spreadMethod="pad">

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

@@ -1,6 +1,6 @@
 <template>
   <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
-    preserveAspectRatio="none" x="0px" y="0px"  width="360px" height="204" viewBox="500 320 1000 500">
+    preserveAspectRatio="none" x="0px" y="0px"  width="360px" height="204" style="padding:5px" viewBox="500 320 1000 500">
     <defs>
       <linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="-961.8" y1="-242.45" x2="-961.8" y2="-242.45"
         spreadMethod="pad">

+ 178 - 0
src/views/vent/monitorManager/airDoor/components/operationModal.vue

@@ -0,0 +1,178 @@
+<template>
+  <div class="operation-modal">
+    <a-modal v-model:visible="Visible" width="1200px" title="操作日志" :footer="null" centered destroyOnClose
+      @cancel="handleCancel">
+      <a-tabs v-model:activeKey="activeKey" @change="tabChange">
+        <a-tab-pane key="0" tab="读取规则日志">
+          <a-form :model="formState" layout="inline" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }"
+            autocomplete="off">
+            <a-form-item label="操作类型">
+              <a-select v-model:value="formState.operationType" style="width: 220px">
+                <a-select-option v-for="(item, index) in OptionList" :key="index" :value="item.value">{{ item.label
+                  }}</a-select-option>
+              </a-select>
+            </a-form-item>
+            <a-button type="primary" preIcon="ant-design:search-outlined" @click="getSearch">查询</a-button>
+            <a-button type="primary" preIcon="ant-design:sync-outlined" @click="getReset">重置</a-button>
+          </a-form>
+          <a-table size="small" :dataSource="tableData" :columns="columns" :scroll="{ y: 420 }" :pagination="pagination"
+            @change="pageChange">
+
+          </a-table>
+        </a-tab-pane>
+        <a-tab-pane key="1" tab="读取集控风门日志">
+          <a-form :model="formState" layout="inline" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }"
+            autocomplete="off">
+            <a-form-item label="操作类型">
+              <a-select v-model:value="formState.nctrltype" style="width: 220px">
+                <a-select-option v-for="(item, index) in controlOptionList" :key="index" :value="item.value">{{
+                  item.label
+                  }}</a-select-option>
+              </a-select>
+            </a-form-item>
+            <a-button type="primary" preIcon="ant-design:search-outlined" @click="getSearch">查询</a-button>
+            <a-button type="primary" preIcon="ant-design:sync-outlined" @click="getReset">重置</a-button>
+          </a-form>
+          <a-table size="small" :dataSource="controlTableData" :columns="controlColumns" :scroll="{ y: 420 }"
+            :pagination="pagination" @change="pageChange">
+            <template #action="{ record }">
+              <a class="table-action-link" @click="handleSpDetail(record)">详情</a>
+            </template>
+          </a-table>
+        </a-tab-pane>
+      </a-tabs>
+      <!-- 集控风门详情 -->
+      <a-modal v-model:visible="visibleDetail" width="800px" title="详情信息" :footer="null" centered destroyOnClose>
+        <a-table size="small" :dataSource="detailTableData" :columns="detailColumns" :scroll="{ y: 420 }"
+          :pagination="false"></a-table>
+      </a-modal>
+    </a-modal>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, reactive, watchEffect } from 'vue'
+import { pagination, columns, controlColumns, detailColumns, OptionList, controlOptionList } from '../airdoor.data'
+import { GetSyncRuleOperationLog, GetSyncRuleExecLog } from '../airdoor.api'
+
+let props = defineProps({
+  visible: {
+    type: Boolean,
+    default: false
+  },
+})
+
+let Visible = ref(false)
+let activeKey = ref('0')
+let tableData = ref<any[]>([])
+let controlTableData = ref<any[]>([])
+//集控风门详情弹窗
+let visibleDetail = ref(false)
+let detailTableData = ref<any[]>([])
+//操作类型
+let formState = reactive({
+  operationType: '',
+  nctrltype: "",
+})
+let $emit = defineEmits(['handleCancel'])
+//tabs选项切换
+function tabChange(val) {
+  activeKey.value = val
+  pagination.current = 1
+  pagination.total = 0
+  formState.nctrltype = ''
+  formState.operationType = ''
+  switch (activeKey.value) {
+    case '0':
+      getTableData()
+      break;
+    case '1':
+      getControlTableData()
+      break;
+  }
+}
+//读写规则日志列表
+async function getTableData() {
+  let res = await GetSyncRuleOperationLog({ pageNo: pagination.current, pageSize: pagination.pageSize, operationType: formState.operationType })
+  console.log(res, '读写规则日志列表---')
+  tableData.value = res.records || []
+  pagination.total = res.total
+}
+//集控风门日志列表
+async function getControlTableData() {
+  let res = await GetSyncRuleExecLog({ pageNo: pagination.current, pageSize: pagination.pageSize, nctrltype: formState.nctrltype })
+  console.log(res, '集控风门列表---')
+  controlTableData.value = res.records || []
+  pagination.total = res.total
+}
+//集控风门详情
+function handleSpDetail(record) {
+  visibleDetail.value = true
+  let detailData = JSON.parse(record.failedDetailJson)
+  console.log(detailData, '详情数据---')
+  detailTableData.value = detailData
+}
+
+//切换分页
+function pageChange(val) {
+  pagination.current = val.current;
+  pagination.pageSize = val.pageSize;
+  if (activeKey.value == '0') {
+    getTableData();
+  } else {
+    getControlTableData()
+  }
+}
+//查询
+function getSearch() {
+  pagination.current = 1
+  if (activeKey.value == '0') {
+    getTableData();
+  } else {
+    getControlTableData()
+  }
+
+}
+//重置
+function getReset() {
+  pagination.current = 1
+  if (activeKey.value == '0') {
+    formState.operationType = ''
+    getTableData();
+  } else {
+    formState.nctrltype = ''
+    getControlTableData()
+  }
+}
+function handleCancel() {
+  formState.nctrltype = ''
+  formState.operationType = ''
+  $emit('handleCancel', false)
+}
+
+watchEffect(() => {
+  Visible.value = props.visible
+  activeKey.value = '0'
+  if (Visible.value) {
+    getTableData()
+  }
+})
+</script>
+
+<style lang="less" scoped>
+.zxm-tabs {
+  margin: 0px 10px;
+}
+
+.zxm-form {
+  margin-bottom: 15px;
+}
+
+.zxm-btn {
+  margin: 0px 10px;
+}
+
+::v-deep .zxm-table-small {
+  margin: 10px !important;
+}
+</style>

+ 7 - 2
src/views/vent/monitorManager/airDoor/components/syncModal.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="sync-modal">
     <a-modal v-model:visible="Visible" width="450px" :title="Title" centered destroyOnClose @ok="handleOk"
-      @cancel="$emit('handleCancel', false)">
+      @cancel="handleCancel">
       <p>您正在执行 “开启/关闭” 全部风门的操作,请输入密码执行。</p>
       <a-form :model="formState" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off">
         <a-form-item label="输入密码" name="passWord" :rules="[{ required: true, message: '请输入密码!' }]">
@@ -31,11 +31,16 @@ let Visible = ref(false)
 let formState = reactive({
   passWord: ''
 })
-let $emit = defineEmits(['handleOk'])
+let $emit = defineEmits(['handleOk','handleCancel'])
 //确定
 function handleOk() {
   $emit('handleOk', { pass: formState.passWord, visib: false })
 }
+//取消
+function handleCancel(){
+  formState.passWord=''
+  $emit('handleCancel',false)
+}
 
 
 watchEffect(() => {

+ 14 - 2
src/views/vent/monitorManager/airDoor/components/timeSetModal.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="time-set">
     <a-modal v-model:visible="Visible" width="550px" :title="Title" centered destroyOnClose @ok="handleOk"
-      @cancel="$emit('handleCancelTime', false)">
+      @cancel="handleCancelTime">
 
       <a-form :model="formState" name="basic" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }" autocomplete="off">
         <a-form-item label="开启时间">
@@ -75,12 +75,24 @@ let formState = reactive({
   checked: true,
   passWord: ''
 })
-let $emit = defineEmits(['handleOk'])
+let $emit = defineEmits(['handleOk','handleCancelTime'])
 
 //确定
 function handleOk() {
   $emit('handleOk', { formState: formState, visib: false })
 }
+//取消
+function handleCancelTime(){
+  formState.checked=false,
+  formState.hourE=''
+  formState.hourS=''
+  formState.minuteE=''
+  formState.minuteS=''
+  formState.passWord=''
+  formState.secondE=''
+  formState.secondS=''
+  $emit('handleCancelTime',false)
+}
 
 watchEffect(() => {
   Visible.value = props.visibleTime