|
|
@@ -0,0 +1,379 @@
|
|
|
+<template>
|
|
|
+ <div class="wind-control-page">
|
|
|
+ <!-- <div class="title">
|
|
|
+ <div class="panel-title">
|
|
|
+ <div class="tab-title">短路风门管控详情</div>
|
|
|
+ <div>
|
|
|
+ <a-button class="btn" @click="yjControl()">应急控制</a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div> -->
|
|
|
+ <div class="content-layout">
|
|
|
+ <div class="left-panel">
|
|
|
+ <!-- 风门数据列表 -->
|
|
|
+ <div class="door-list">
|
|
|
+ <div class="door-card" v-for="(item, index) in props.data" :key="index">
|
|
|
+ <div class="door-position">
|
|
|
+ <div class="position"></div>
|
|
|
+ <div class="door-name"
|
|
|
+ ><span>{{ item.strname }}</span></div
|
|
|
+ >
|
|
|
+ <a-button class="door-btn" @click="oneKeyClose(index)">一键关闭</a-button>
|
|
|
+ <a-button class="door-btn" @click="oneKeyOpen(index)">一键打开</a-button>
|
|
|
+ </div>
|
|
|
+ <div class="door-header">
|
|
|
+ <div class="info-column" v-for="(i, idx) in config.config.items" :key="idx">
|
|
|
+ <span class="col-label">{{ i.label }}</span>
|
|
|
+ <span
|
|
|
+ class="col-value"
|
|
|
+ :class="[
|
|
|
+ getFormattedText(item, i.value, i.trans) === '打开' || getFormattedText(item, i.value, i.trans) === '连接'
|
|
|
+ ? 'status-open'
|
|
|
+ : 'status-close',
|
|
|
+ 'status-dot',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ {{ getFormattedText(item, i.value, i.trans) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 模型展示占位div -->
|
|
|
+ <!-- <div class="model-placeholder">
|
|
|
+ <gateSVG :ref="(el) => setChildRef(el, index)" :identify="String(index)" />
|
|
|
+ </div> -->
|
|
|
+ <div class="model-placeholder">
|
|
|
+ <img :src="gatePng" alt="风门" class="model-img" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+ import { ref, onMounted, watch } from 'vue';
|
|
|
+ import { getFormattedText } from '../../../hooks/helper';
|
|
|
+ // import gateSVG from '../gateSVG.vue';
|
|
|
+ import gateSVG from '../../../../../monitorManager/gateMonitor/components/gateDualSVG.vue';
|
|
|
+ import gatePng from '/@/assets/images/fireDoorMonitor.png'; //暂时用图片
|
|
|
+ import { nextTick } from 'process';
|
|
|
+ const props = withDefaults(
|
|
|
+ defineProps<{
|
|
|
+ config: {
|
|
|
+ config: {
|
|
|
+ tilte: string;
|
|
|
+ items: {
|
|
|
+ value: string;
|
|
|
+ label: string;
|
|
|
+ trans?: any;
|
|
|
+ }[];
|
|
|
+ };
|
|
|
+ };
|
|
|
+ data?: any;
|
|
|
+ }>(),
|
|
|
+ {
|
|
|
+ data: () => ({
|
|
|
+ data: {
|
|
|
+ strname: '设备1',
|
|
|
+ readData: {
|
|
|
+ frontGateOpen: 1,
|
|
|
+ rearGateOpen: 0,
|
|
|
+ },
|
|
|
+ netStatus: 1,
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ }
|
|
|
+ );
|
|
|
+ const childRefs = ref<(InstanceType<typeof gateSVG> | null)[]>([]);
|
|
|
+ const setChildRef = (el, index) => {
|
|
|
+ if (el) {
|
|
|
+ childRefs.value[index] = el;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ function yjControl() {
|
|
|
+ console.log('应急控制');
|
|
|
+ }
|
|
|
+ function monitorAnimation(selectData, index) {
|
|
|
+ if (!selectData?.readData) return;
|
|
|
+ const frontOpen = selectData.readData.frontGateOpen === '1';
|
|
|
+ const midOpen = selectData.readData.midGateOpen === '1';
|
|
|
+ const rearOpen = selectData.readData.rearGateOpen === '1';
|
|
|
+ if (childRefs.value[index]) {
|
|
|
+ childRefs.value[index].animate(frontOpen, midOpen, rearOpen);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function oneKeyOpen(index) {
|
|
|
+ if (childRefs.value[index]) {
|
|
|
+ childRefs.value[index].animate(true, true, true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function oneKeyClose(index) {
|
|
|
+ if (childRefs.value[index]) {
|
|
|
+ childRefs.value[index].animate(false, false, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => props.data,
|
|
|
+ (newData) => {
|
|
|
+ console.log('数据更新11111', newData);
|
|
|
+ if (!newData || !newData.length) return;
|
|
|
+ newData.forEach((item, index) => {
|
|
|
+ monitorAnimation(item, index);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deep: true,
|
|
|
+ immediate: true, // 初始化立刻执行
|
|
|
+ }
|
|
|
+ );
|
|
|
+ onMounted(() => {
|
|
|
+ console.log('页面加载完成', props.data);
|
|
|
+ });
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+ .wind-control-page {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ margin-top: -20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title {
|
|
|
+ margin-top: 20px;
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/1-2title.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .panel-title {
|
|
|
+ height: 40px;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 50px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .tab-title {
|
|
|
+ margin-top: 12px;
|
|
|
+ margin-left: 20px;
|
|
|
+ background: linear-gradient(180deg, #34b7f1 0%, #1890ff 100%);
|
|
|
+ border: 1px solid #40c4ff;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 2px 8px;
|
|
|
+ height: 24px;
|
|
|
+ box-shadow: 0 0 6px 2px rgba(24, 144, 255, 0.4);
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ margin-top: 22px;
|
|
|
+ margin-right: 20px;
|
|
|
+ background: linear-gradient(180deg, #34b7f1 0%, #1890ff 100%);
|
|
|
+ border: 1px solid #40c4ff;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 2px 8px;
|
|
|
+ height: 24px;
|
|
|
+ box-shadow: 0 0 6px 2px rgba(24, 144, 255, 0.4);
|
|
|
+ }
|
|
|
+ .content-layout {
|
|
|
+ display: flex;
|
|
|
+ height: calc(100%);
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .center-panel {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 10px;
|
|
|
+ }
|
|
|
+ .left-panel {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 10px;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .door-list {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 10px;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .door-card {
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/2-1.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 12px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 15px;
|
|
|
+ }
|
|
|
+ .door-position {
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/1-5.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .door-position .position {
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/1-1-1.svg') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ margin-top: 8px;
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+ .door-position .door-name {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #c4ebff;
|
|
|
+ margin: 0 25px 0 25px;
|
|
|
+ line-height: 33px;
|
|
|
+ font-style: italic;
|
|
|
+ }
|
|
|
+ .door-btn {
|
|
|
+ background: linear-gradient(180deg, #34b7f1 0%, #1890ff 100%);
|
|
|
+ border: 1px solid #40c4ff;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 2px 8px;
|
|
|
+ height: 24px;
|
|
|
+ margin: auto;
|
|
|
+ margin-left: 3px;
|
|
|
+ box-shadow: 0 0 6px 2px rgba(24, 144, 255, 0.4);
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .door-header {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ gap: 6px;
|
|
|
+ }
|
|
|
+ .info-column {
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/1-3-1.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ height: 60px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .col-label {
|
|
|
+ padding-top: 5px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #fff;
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+ .col-value {
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: bold;
|
|
|
+ font-style: italic;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .col {
|
|
|
+ flex: 1;
|
|
|
+ padding: 0 4px;
|
|
|
+ }
|
|
|
+ .status-dot {
|
|
|
+ position: relative;
|
|
|
+ padding-left: 12px;
|
|
|
+ }
|
|
|
+ .status-open::before {
|
|
|
+ content: '';
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #52c41a;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ box-shadow: 0 0 6px 2px rgba(82, 196, 26, 0.6);
|
|
|
+ }
|
|
|
+ .status-close::before {
|
|
|
+ content: '';
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background: #3a3a3a;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ box-shadow: 0 0 6px 2px rgba(90, 90, 90, 0.6);
|
|
|
+ }
|
|
|
+ .one-key-btn {
|
|
|
+ padding: 2px 8px;
|
|
|
+ font-size: 12px;
|
|
|
+ background: #1890ff;
|
|
|
+ border-color: #1890ff;
|
|
|
+ }
|
|
|
+ .model-placeholder {
|
|
|
+ width: 100%;
|
|
|
+ height: 180px;
|
|
|
+ background: url('/@/assets/images/beltFire/yjkf/1-4-1.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ .model-img {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+ gap: 10px;
|
|
|
+ object-fit: cover;
|
|
|
+ }
|
|
|
+ .right-panel {
|
|
|
+ width: 22%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+ .video-card {
|
|
|
+ background: rgba(15, 36, 87, 0.6);
|
|
|
+ border: 1px solid #2a52be;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 12px;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 12px;
|
|
|
+ }
|
|
|
+ .video-title {
|
|
|
+ margin: 0;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #fff;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .video-placeholder {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ .video-frame {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border: 2px solid #2a52be;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: transparent;
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+</style>
|