From 8f50c8203c8df64dd0a566b228bae7f69156e109 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期二, 15 四月 2025 17:34:08 +0800 Subject: [PATCH] fix:添加季度选择器 --- src/views/screen/flow/graphic/index.vue | 59 +++++++++++++++++++++++++++++------------------------------ 1 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/views/screen/flow/graphic/index.vue b/src/views/screen/flow/graphic/index.vue index bb71b1a..8d5a773 100644 --- a/src/views/screen/flow/graphic/index.vue +++ b/src/views/screen/flow/graphic/index.vue @@ -1,16 +1,13 @@ <script setup> -import {ref} from "vue"; +import {onMounted, ref} from "vue"; import {getUserType} from '@/utils/auth.js' import html2canvas from "html2canvas"; +import {getFlowPointList} from '@/api/screen/index' +const menuList = ref([]) const userType = ref(getUserType()) const monitorRef = ref() const searchVal = ref('') -const selectType = ref(1); -const typeOption = ref([ - { label: '水电站流量监测点', value: 1 }, - { label: '新扎口流量监测点', value: 2 }, -]) const video = ref() // 全屏操作 @@ -33,6 +30,19 @@ const handleSearch = async () => { } + +// 获取监控点 +const getMoitorList = () => { + getFlowPointList().then(res => { + menuList.value = res.data + }) +} + + +onMounted(() => { + getMoitorList() +}) + </script> <template> @@ -40,37 +50,26 @@ <div class="graphic-menu"> <div class="menu-t">监控点列表</div> <el-menu class="el-menu"> - <el-sub-menu index="1"> - <template #title> - <span>可移动监测点</span> + <template v-for="(item, index) in menuList" :key="index+1"> + <template v-if="item?.childrenList?.length === 0"> + <el-menu-item :index="item.id">{{ item.pointName }}</el-menu-item> </template> - <el-menu-item index="1-1">水电站流量监测点</el-menu-item> - </el-sub-menu> - <el-sub-menu index="2"> - <template #title> - <span>固定位监测点</span> + <template v-else> + <el-sub-menu :index="item.id"> + <template #title> + <span>{{ item.pointName }}</span> + </template> + <el-menu-item v-for="(child, cidx) in item.childrenList" :key="cidx" :index="child.id"> + {{ child.pointName }} + </el-menu-item> + </el-sub-menu> </template> - <el-menu-item index="2-1">新扎口流量监测点</el-menu-item> - </el-sub-menu> + </template> </el-menu> </div> <div class="graphic-monitor"> <div class="monitor-tool"> <div class="tool-l"> - <div class="name">监测点类型</div> - <el-select - v-model="selectType" - class="tool-select" - placeholder="Select" - style="width: 15rem" - > - <el-option - v-for="item in typeOption" - :key="item.value" - :label="item.label" - :value="item.value" - /> - </el-select> <el-input v-model="searchVal" style="width: 20rem" placeholder="请输入监测点名称" /> <el-button @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button> <el-button style="margin-left: 0" v-if="userType === '1'"><el-icon><Plus /></el-icon>新增</el-button> -- Gitblit v1.9.3