|
|
@@ -14,6 +14,7 @@
|
|
|
定时设置
|
|
|
</a-button>
|
|
|
<a-button style="margin: 0px 10px" type="primary" @click="handlerOperation">操作日志</a-button>
|
|
|
+ <a-button class="device-control-btn" type="primary" @click="handlerDeviceChoice">集控设备选择</a-button>
|
|
|
</div>
|
|
|
<div class="content-r-container">
|
|
|
<div class="content-r-box" v-for="(item, index) in infoDatas" :key="index">
|
|
|
@@ -38,7 +39,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>启用状态:</span>
|
|
|
- <span class="set-time">启用</span>
|
|
|
+ <span class="set-time">启用</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>定时关闭时间:</span>
|
|
|
@@ -62,11 +63,14 @@
|
|
|
<!-- 操作日志 -->
|
|
|
<operationModal :visible="visibleOperation" @handleCancel="handleCancelOperation">
|
|
|
</operationModal>
|
|
|
+ <!-- 集控设备选择 -->
|
|
|
+ <DeviceControl v-if="visibleDeviceControl" :deviceControlData="gateControlData" @confirmChoice="handlerChoice">
|
|
|
+ </DeviceControl>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { reactive, ref, inject, watch, nextTick } from 'vue';
|
|
|
+import { reactive, ref, inject, watch, nextTick, onMounted } from 'vue';
|
|
|
import syncModal from './syncModal.vue';
|
|
|
import timeSetModal from './timeSetModal.vue';
|
|
|
import CameraModal from './cameraModal.vue';
|
|
|
@@ -75,8 +79,9 @@ import tipModal from './tipModal.vue'
|
|
|
import gateDualSVG from './gateDualSVG.ssl.vue'
|
|
|
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 } from '../airdoor.api'
|
|
|
+import { devicecontrol, insertSyncRule, GetSyncRule, controlList, confirmChoice } from '../airdoor.api'
|
|
|
import { doorStatus } from '../airdoor.data'
|
|
|
// import { getModelComponent } from '../airdoor.data'
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
@@ -107,12 +112,14 @@ let cameraData = reactive({})
|
|
|
//操作日志弹窗显示/关闭
|
|
|
let visibleOperation = ref(false)
|
|
|
const childRefs = ref<any[]>([])
|
|
|
+//集控风门列表
|
|
|
+let gateControlData = ref<any[]>([])
|
|
|
+//集控设备弹窗显示
|
|
|
+let visibleDeviceControl = ref(false)
|
|
|
+
|
|
|
const setChildRef = (el, index) => {
|
|
|
childRefs.value[index] = el
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
//同步开启/关闭--弹窗
|
|
|
function handlerOpenOrClose(data) {
|
|
|
visible.value = true;
|
|
|
@@ -150,8 +157,10 @@ async function handlerTimeSet() {
|
|
|
//确定
|
|
|
async function handleOkTime(param) {
|
|
|
console.log(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 start_time = `${param.formState.hourS}:${param.formState.minuteS}:${param.formState.secondS}`
|
|
|
+ // let end_time = `${param.formState.hourE}:${param.formState.minuteE}:${param.formState.secondE}`
|
|
|
+ let start_time = `${param.formState.hourS}:${param.formState.minuteS}`
|
|
|
+ let end_time = `${param.formState.hourE}:${param.formState.minuteE}`
|
|
|
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 })
|
|
|
console.log(res, '设置定时---')
|
|
|
@@ -192,6 +201,30 @@ function handleCancelOperation(param) {
|
|
|
function monitorAnimation(selectData, index) {
|
|
|
childRefs.value[index]?.animate?.(selectData.frontGateOpen == '1', selectData.midGateOpen == '1', selectData.rearGateOpen == '1');
|
|
|
}
|
|
|
+//获取集控风门列表
|
|
|
+async function getControlList() {
|
|
|
+ let res = await controlList({ devicekind: 'gate', pageNo: 1, pageSize: 100 })
|
|
|
+ gateControlData.value = res.records || []
|
|
|
+}
|
|
|
+//集控设备选择点击
|
|
|
+function handlerDeviceChoice() {
|
|
|
+ visibleDeviceControl.value = true
|
|
|
+}
|
|
|
+//集控设备确定选择
|
|
|
+async function handlerChoice(param) {
|
|
|
+ console.log(param, '选中')
|
|
|
+ let data: any[] = []
|
|
|
+ param.forEach(el => {
|
|
|
+ let list = gateControlData.value.find(v => v.id == el)
|
|
|
+ list.isAutosync='1'
|
|
|
+ data.push(list)
|
|
|
+ })
|
|
|
+ console.log(data, 'data---')
|
|
|
+ let res = await confirmChoice({ obj: data })
|
|
|
+ if (res) {
|
|
|
+ visibleDeviceControl.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
// function getInitSvg(param) {
|
|
|
// // const dictCodes = getDictItemsByCode('gateStyle');
|
|
|
// // console.log(dictCodes, 'dictCodes---')
|
|
|
@@ -199,7 +232,6 @@ function monitorAnimation(selectData, index) {
|
|
|
|
|
|
|
|
|
watch(() => props.infoData, (newV, oldV) => {
|
|
|
- console.log(newV, 'new---')
|
|
|
infoDatas.value = newV
|
|
|
if (newV.length) {
|
|
|
nextTick(() => {
|
|
|
@@ -211,6 +243,9 @@ watch(() => props.infoData, (newV, oldV) => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+onMounted(() => {
|
|
|
+ getControlList()
|
|
|
+})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@@ -239,7 +274,13 @@ watch(() => props.infoData, (newV, oldV) => {
|
|
|
height: 40px;
|
|
|
padding: 0px 10px;
|
|
|
display: flex;
|
|
|
+
|
|
|
// align-items: center;
|
|
|
+ .device-control-btn {
|
|
|
+ position: absolute;
|
|
|
+ right: 35px;
|
|
|
+ top: 30px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.content-r-container {
|
|
|
@@ -307,8 +348,9 @@ watch(() => props.infoData, (newV, oldV) => {
|
|
|
color: #fff;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
- .set-time{
|
|
|
- color: rgba(60, 242, 255);
|
|
|
+
|
|
|
+ .set-time {
|
|
|
+ color: rgba(60, 242, 255);
|
|
|
}
|
|
|
|
|
|
img {
|