From c27335221171cc82ac6ef117318a4d1e4c4fc5ee Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 12 Nov 2024 18:30:29 +0800
Subject: [PATCH] 应急空间调整
---
src/views/space/index.vue | 14 +-
src/pages/layout/components/scomponents/layersControl.vue | 2
src/views/space/components/rightContainer.vue | 20 -----
src/views/space/components/leftContainer.vue | 97 +++++++++++++++++++-----
src/views/space/components/box/dataContent.vue | 66 ++++++----------
5 files changed, 108 insertions(+), 91 deletions(-)
diff --git a/src/pages/layout/components/scomponents/layersControl.vue b/src/pages/layout/components/scomponents/layersControl.vue
index 84cc8a4..c5187c8 100644
--- a/src/pages/layout/components/scomponents/layersControl.vue
+++ b/src/pages/layout/components/scomponents/layersControl.vue
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-10-31 10:47:29
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-12 14:20:54
+ * @LastEditTime: 2024-11-12 18:15:54
* @FilePath: \bigScreen\src\pages\layout\components\scomponents\layersControl.vue
* @Description:
*
diff --git a/src/views/space/components/box/dataContent.vue b/src/views/space/components/box/dataContent.vue
index 33fc026..cef64e9 100644
--- a/src/views/space/components/box/dataContent.vue
+++ b/src/views/space/components/box/dataContent.vue
@@ -2,21 +2,23 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2023-03-13 14:54:26
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-08 20:17:16
+ * @LastEditTime: 2024-11-12 17:55:45
* @FilePath: \bigScreen\src\views\space\components\box\dataContent.vue
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup>
+import EventBus from 'utils/bus'
+
import publicContent from "./publicContent.vue"
import { getList } from "@/api/space/space"
-import { getDictionary } from "@/api/dict/dict"
-import { nextTick, reactive } from "vue"
+import { nextTick, onUnmounted, reactive } from "vue"
const SeachBarCondition = ref(null)
const loading = ref(false)
const TableContent = ref(null)
const curTableHeight = ref(0)
+const curSelectTabType = ref('')
// 搜索项配置
const options = reactive({
@@ -32,16 +34,7 @@
placeholder: '请输入名称',
changeSearch: true,
flex: 1,
- },
- {
- label: "类型",
- type: "select",
- props: "type",
- data: [],
- changeSearch: true,
- clearable: true,
- flex: 1,
- },
+ }
]
})
@@ -86,37 +79,10 @@
curTableHeight.value = TableContent.value.offsetHeight
})
-watch(
- () => TableContent,
- (newData) => {
- console.log(newData.value?.clientHeight, 456465456)
- },
- {
- immediate: true,
- deep: true
- })
-
// 分页改变
const handleCurrentChange = (val) => {
pages.page = val
getLists(SeachBarCondition.value.getSeachCondition())
-}
-
-// 获取下拉字典
-const getDictData = (code) => {
- const param = {
- code: code,
- }
- getDictionary(param).then((res) => {
- options.columns[1].data = res.data.data.map(item => {
- return {
- label: item.dictValue,
- value: item.dictKey
- }
- })
-
- searchBtn(SeachBarCondition.value.getSeachCondition())
- })
}
// 查询分页数据
@@ -124,7 +90,10 @@
param.current = pages.page
param.size = pages.pageSize
loading.value = true
- getList(param)
+ getList({
+ ...param,
+ type: curSelectTabType.value
+ })
.then((res) => {
const data = res.data.data
tableData.value = data.records
@@ -173,6 +142,7 @@
// layer.addOverlay(label)
// })
}
+
function generatePosition (lng, lat) {
let list = []
list.push(new DC.Position(lng, lat, 100))
@@ -205,7 +175,19 @@
getLists(SeachBarCondition.value.getSeachCondition())
}
-getDictData("emergency_space_type")
+const spaceTabChange = (type) => {
+ curSelectTabType.value = type
+
+ nextTick(() => {
+ searchBtn(SeachBarCondition.value.getSeachCondition())
+ })
+}
+
+EventBus.on('spaceTabChange', spaceTabChange)
+
+onUnmounted(() => {
+ EventBus.off('spaceTabChange', spaceTabChange)
+})
</script>
<template>
diff --git a/src/views/space/components/leftContainer.vue b/src/views/space/components/leftContainer.vue
index 362a7e7..200364d 100644
--- a/src/views/space/components/leftContainer.vue
+++ b/src/views/space/components/leftContainer.vue
@@ -2,38 +2,71 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2023-03-10 15:27:59
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2024-11-09 15:46:30
+ * @LastEditTime: 2024-11-12 18:10:32
* @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 curSelect = ref('')
+
+// 获取下拉字典
+const getDictData = (code) => {
+ const param = {
+ code: code,
+ }
+ getDictionary(param).then((res) => {
+ resData.data = res.data.data.map(item => {
+ return {
+ label: item.dictValue,
+ value: item.dictKey
+ }
+ })
+
+ tabClick(resData.data[0])
+ })
+}
+
+const tabClick = (item) => {
+ if (curSelect.value) EventBus.emit('restHandleDelChange', `3-${curSelect.value}`)
+ curSelect.value = item.value
+ EventBus.emit('restHandleCheckChange', `3-${item.value}`)
+ EventBus.emit('spaceTabChange', item.value)
+}
+
+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}`)
+})
</script>
<template>
<div class="left-container cur-container">
-
- <!-- <div class="unit box">
- <title-box>
- <template #titleName>
- 入住单位统计
- </template>
- </title-box>
- <unit-content></unit-content>
+ <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="nowrap-ellipsis-hidden">
+ {{ item.label }}
+ </div>
+ </div>
</div>
-
- <div class="fire box">
- <title-box>
- <template #titleName>
- 实时火警事件
- </template>
- </title-box>
- <fire-content></fire-content>
- </div> -->
</div>
</template>
@@ -41,5 +74,27 @@
.cur-container {
background: transparent;
pointer-events: none;
+
+ .tablist {
+ pointer-events: all;
+
+ &>div {
+ margin-top: 16px;
+ padding: 10px;
+ width: 64px;
+ height: 64px;
+ line-height: 64px;
+ text-align: center;
+ border-radius: 50%;
+ box-shadow: inset 0 0 40px #409eff;
+ color: #fff;
+ box-sizing: content-box;
+
+ &.on {
+ position: relative;
+ color: #75b1ff;
+ }
+ }
+ }
}
</style>
\ No newline at end of file
diff --git a/src/views/space/components/rightContainer.vue b/src/views/space/components/rightContainer.vue
index a22198b..21f669e 100644
--- a/src/views/space/components/rightContainer.vue
+++ b/src/views/space/components/rightContainer.vue
@@ -10,8 +10,6 @@
-->
<script setup>
import dataContent from './box/dataContent.vue'
-import unitContent from './box/unitContent.vue'
-import fireContent from './box/fireContent.vue'
</script>
<template>
@@ -26,24 +24,6 @@
<data-content></data-content>
</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>
diff --git a/src/views/space/index.vue b/src/views/space/index.vue
index f230165..ac1b96f 100644
--- a/src/views/space/index.vue
+++ b/src/views/space/index.vue
@@ -14,16 +14,16 @@
</script>
<template>
- <div class="container page-container">
- <left-container></left-container>
- <right-container></right-container>
- </div>
+ <div class="container page-container">
+ <left-container></left-container>
+ <right-container></right-container>
+ </div>
</template>
<style lang="scss" scoped>
.container {
- position: absolute;
- width: 100%;
- height: 100%;
+ position: absolute;
+ width: 100%;
+ height: 100%;
}
</style>
\ No newline at end of file
--
Gitblit v1.9.3