From 9a37c5e1b2190c3f6ec71483923922189091dd52 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 18 Dec 2024 09:42:01 +0800
Subject: [PATCH] 事件模拟更新

---
 src/views/space/components/leftContainer.vue |  237 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 203 insertions(+), 34 deletions(-)

diff --git a/src/views/space/components/leftContainer.vue b/src/views/space/components/leftContainer.vue
index 0781c33..3b7bdcb 100644
--- a/src/views/space/components/leftContainer.vue
+++ b/src/views/space/components/leftContainer.vue
@@ -2,47 +2,216 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2023-03-10 15:27:59
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-10-25 18:43:23
- * @FilePath: \bigScreen\src\views\statistics\components\leftContainer.vue
- * @Description: 
- * 
- * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
+ * @LastEditTime: 2024-11-28 11:35:07
+ * @FilePath: \bigScreen\src\views\space\components\leftContainer.vue
+ * @Description:
+ *
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 -->
 <script setup>
-import dataContent from './box/dataContent.vue'
-import unitContent from './box/unitContent.vue'
-import fireContent from './box/fireContent.vue'
+import EventBus from 'utils/bus'
+
+import { getDictionary } from "@/api/dict/dict"
+import { onUnmounted, reactive } from 'vue'
+const resData = reactive({
+  data: []
+})
+
+const gawList = ref([
+  {
+    label: '污水管网',
+    value: "3-3-2",
+    select: true
+  },
+  {
+    label: '雨水管网',
+    value: "3-3-4",
+    select: false
+  },
+])
+const curSelect = ref('')
+
+// 获取下拉字典
+const getDictData = (code) => {
+  const param = {
+    code: code,
+  }
+  getDictionary(param).then((res) => {
+    resData.data = res.data.data.filter(i => i.dictKey != 7 && i.dictKey != 9 && i.dictKey != 11).map(item => {
+      return {
+        label: item.dictValue,
+        value: item.dictKey
+      }
+    })
+
+    tabClick(resData.data[0])
+  })
+}
+
+const tabClick = (item) => {
+  EventBus.emit('destroyPop', 'destroyPop')
+  if (curSelect.value) {
+    if (curSelect.value == '3') {
+      EventBus.emit('restHandleDelChange', `3-3`)
+      EventBus.emit('restHandleDelChange', `3-3-1`)
+      EventBus.emit('restHandleDelChange', `3-3-2`)
+      EventBus.emit('restHandleDelChange', `3-3-3`)
+      EventBus.emit('restHandleDelChange', `3-3-4`)
+    } else {
+      gawList.value.forEach(element => {
+        if (element.value == `3-3-2`) {
+          element.select = true
+        } else {
+          element.select = false
+        }
+      });
+      EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
+    }
+  }
+  curSelect.value = item.value
+  if (item.value == '3') {
+    EventBus.emit('restHandleCheckChange', `3-3-2`)
+  } else {
+    EventBus.emit('restHandleCheckChange', `3-${item.value}`)
+  }
+  EventBus.emit('spaceTabChange', item.value)
+  EventBus.emit('flyToyqfw', 'flyToyqfw')
+}
+
+const tabClickGW = (item) => {
+  if (item.select) {
+    EventBus.emit('restHandleDelChange', item.value)
+    item.select = false
+  } else {
+    EventBus.emit('restHandleCheckChange', item.value)
+    item.select = true
+  }
+}
+
+const showOn = computed(() => (item) => {
+  if (curSelect.value == item.value) {
+    return true
+  }
+  return false
+})
+
+getDictData("emergency_space_type")
+
+onUnmounted(() => {
+  if (curSelect.value) EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
+  EventBus.emit('restHandleDelChange', `3-3-1`)
+  EventBus.emit('restHandleDelChange', `3-3-2`)
+  EventBus.emit('restHandleDelChange', `3-3-3`)
+  EventBus.emit('restHandleDelChange', `3-3-4`)
+})
 </script>
 
 <template>
-  <div class="left-container">
-    <div class="data box">
-      <title-box>
-        <template #titleName>
-          数据概览
-        </template>
-      </title-box>
-      <data-content></data-content>
+  <div>
+    <div class="left-container cur-container">
+      <div class="tablist h100">
+        <div class="cursor-p" :class="{ on: showOn(item) }" v-for="item, index in resData.data" :key="index"
+          @click="tabClick(item)">
+          <div class="label-box">
+            {{ item.label }}
+          </div>
+        </div>
+      </div>
+    </div>
+    <div v-if="curSelect == '3'">
+      <div class="cur-container-title">
+        <div class="tablist">
+          <div class="cursor-p" :class="{ on: item.select }" v-for="item, index in gawList" :key="index"
+            @click="tabClickGW(item)">
+            <div class="label-box">
+              {{ item.label }}
+            </div>
+          </div>
+        </div>
+      </div>
     </div>
 
-    <div class="unit box">
-      <title-box>
-        <template #titleName>
-          入住单位统计
-        </template>
-      </title-box>
-      <unit-content></unit-content>
-    </div>
-
-    <div class="fire box">
-      <title-box>
-        <template #titleName>
-          实时火警事件
-        </template>
-      </title-box>
-      <fire-content></fire-content>
-    </div>
   </div>
 </template>
 
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss" scoped>
+.left-container {
+  width: auto;
+}
+
+.cur-container {
+  background: transparent;
+  pointer-events: none;
+
+  .tablist {
+    pointer-events: all;
+
+    &>div {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-top: 10px;
+      padding: 8px;
+      width: 64px;
+      height: 48px;
+
+      border-radius: 50%;
+      box-shadow: inset 0 0 40px #409eff;
+      color: #fff;
+      box-sizing: content-box;
+      font-size: 12px;
+
+      &.on {
+        position: relative;
+        // color: #75b1ff;
+        box-shadow: inset 0 0 100px #2a8ef1;
+      }
+
+      .label-box {
+        padding: 8px;
+        line-height: 20px;
+        text-align: center;
+      }
+    }
+  }
+}
+
+.cur-container-title {
+  background: transparent;
+  pointer-events: none;
+  margin-left: 120px;
+  margin-top: 120px;
+
+  .tablist {
+    pointer-events: all;
+
+    &>div {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      margin-top: 10px;
+      padding: 8px;
+      width: 64px;
+      height: 48px;
+
+      color: #fff;
+      border-radius: 50%;
+      box-shadow: inset 0 0 40px #409eff;
+      box-sizing: content-box;
+      font-size: 12px;
+
+      &.on {
+        position: relative;
+        // color: #75b1ff;
+        box-shadow: inset 0 0 100px #2a8ef1;
+      }
+
+      .label-box {
+        padding: 8px;
+        line-height: 16px;
+        text-align: center;
+      }
+    }
+  }
+}
+</style>

--
Gitblit v1.9.3