From 2f0fa3545b539e8b6f952ea82a1ca2350c64a0e8 Mon Sep 17 00:00:00 2001 From: web <candymxq888@outlook.com> Date: 星期二, 22 四月 2025 17:28:48 +0800 Subject: [PATCH] fix:修改报警,添加参数 --- src/screen/flow.vue | 27 +++++++++++-- src/views/screen/flow/ecology/index.vue | 2 src/views/screen/flow/graphic/components/FullScreenVideo.vue | 22 +++++++++- src/views/facility/monitorList/index.vue | 9 ++++ src/api/system/dict.js | 7 +++ src/views/screen/flow/graphic/index.vue | 38 +++++++++---------- src/views/screen/temperature/statics/index.vue | 2 src/views/system/dict/index.vue | 12 +++-- 8 files changed, 83 insertions(+), 36 deletions(-) diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 9eebb58..a63ae02 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -40,6 +40,13 @@ data }); }, + //删除 + remove: (id) => { + return publicRequest({ + url: `/sysDictType/remove/${id}`, + method: 'post', + }); + }, //分页查询 search: (data) => { return publicRequest({ diff --git a/src/screen/flow.vue b/src/screen/flow.vue index 03c0a0c..e37bbb9 100644 --- a/src/screen/flow.vue +++ b/src/screen/flow.vue @@ -29,11 +29,10 @@ </template> <script setup> import{ useRouter,useRoute } from 'vue-router' -import useUserStore from '@/store/modules/user.js' -import {onMounted, ref, watch} from "vue"; +import {onMounted, ref, watch, onUnmounted} from "vue"; import { getUserType } from '@/utils/auth' +import { warnHistory } from '@/api/screen/warning/index.js' -const userStore = useUserStore() const router = useRouter() const route = ref(useRoute()) @@ -48,7 +47,7 @@ const userType = ref(getUserType()) const openWarn = ref(false) -const text = ref('新扎沟口流量监测点水位到达下限值, 金川水电站生态流量监测点水位到达下限值,流量监测点水位到达下限值') +const text = ref('') let timer = null; watch(openWarn, (newVal) => { @@ -71,12 +70,30 @@ router.push(item.url) } +// 获取报警内容 +const getWarnList = () => { + let str = '' + warnHistory({limit: 10, page: 1, monitorType: 2}).then(res => { + res.data.list?.forEach((item)=>{ + str += item.description + ',' + }) + text.value = str + }) +} + onMounted(() => { - if(userStore.userType == 1) { + getWarnList() + if(userType.value == 1) { btnList.value.push({name:'系统管理',url:'/user'}) } }) +onUnmounted(() => { + if(timer){ + clearInterval(timer) + } +}) + </script> <style lang="scss" scoped> diff --git a/src/views/facility/monitorList/index.vue b/src/views/facility/monitorList/index.vue index 5a75b87..b414fe0 100644 --- a/src/views/facility/monitorList/index.vue +++ b/src/views/facility/monitorList/index.vue @@ -44,6 +44,7 @@ pointName: '监控点名称', pointCode: '监控点编号', pointType: '监控类型', + waterWidth: '水面宽度', address: '详细地址', createTimeView: '创建时间', imageUrl: '图片', @@ -71,6 +72,7 @@ pointCode: '监控点编号', pointType: '监控点类型', parentId: '父级监控点', + waterWidth: '水面宽度', address: '详细地址', imageUrl: '图片', remark: '备注' @@ -85,6 +87,7 @@ pointCode: '', pointType: '', parentId: '', + waterWidth: '', address: '', imageUrl: '', remark: '' @@ -192,6 +195,7 @@ pointName: '', pointCode: '', pointType: '', + waterWidth: '', address: '', imageUrl: '', remark: '' @@ -297,7 +301,10 @@ <el-form-item :label="formLabel.remark" prop="address"> <el-input v-model="form.remark" :placeholder="'请输入'+formLabel.remark"/> </el-form-item> - <!-- <el-form-item></el-form-item>--> + <el-form-item :label="formLabel.waterWidth" prop="waterWidth"> + <el-input v-model="form.waterWidth" :placeholder="'请输入'+formLabel.waterWidth"/> + </el-form-item> + <el-form-item></el-form-item> <el-form-item label="图片" prop="imageUrl" style="flex: 1"> <upload-icons @uploadData="uploadData" :imageList="form.imageUrl" :limit="1"></upload-icons> <span style="display: block;">(请上传1张设备图片)</span> diff --git a/src/views/screen/flow/ecology/index.vue b/src/views/screen/flow/ecology/index.vue index e30b530..ce342f4 100644 --- a/src/views/screen/flow/ecology/index.vue +++ b/src/views/screen/flow/ecology/index.vue @@ -110,7 +110,7 @@ }, yAxis: { type: 'value', - name: '10⁸m³', + name: 'm³', nameTextStyle: { color: '#fff', fontSize: '1.2rem' diff --git a/src/views/screen/flow/graphic/components/FullScreenVideo.vue b/src/views/screen/flow/graphic/components/FullScreenVideo.vue index c188ecf..701ea62 100644 --- a/src/views/screen/flow/graphic/components/FullScreenVideo.vue +++ b/src/views/screen/flow/graphic/components/FullScreenVideo.vue @@ -50,6 +50,14 @@ <div class="name">累计流量:</div> <div class="val"><span>{{props.data.totalFlow}}</span>m³</div> </div> + <div class="item"> + <div class="name">水面宽度:</div> + <div class="val"><span>{{props.data.waterWidth}}</span>m</div> + </div> + <div class="item"> + <div class="name">过水面积:</div> + <div class="val"><span>{{props.data.waterArea}}</span>m³</div> + </div> </div> </div> </div> @@ -92,10 +100,18 @@ align-items: center; padding: 0.5rem 0; .name{ - width: 50%; + width: 6rem; } - span{ - margin-right: 0.8rem; + .val{ + display: flex; + align-items: center; + span{ + display: inline-block; + width: 6rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } } } diff --git a/src/views/screen/flow/graphic/index.vue b/src/views/screen/flow/graphic/index.vue index 2c48386..d208ed6 100644 --- a/src/views/screen/flow/graphic/index.vue +++ b/src/views/screen/flow/graphic/index.vue @@ -167,6 +167,14 @@ <div class="name">累计流量:</div> <div class="val"><span>{{ item.totalFlow }}</span>m³</div> </div> + <div class="info-item"> + <div class="name">水面宽度:</div> + <div class="val"><span>{{ item.waterWidth }}</span>m</div> + </div> + <div class="info-item"> + <div class="name">过水面积:</div> + <div class="val"><span>{{ item.waterArea }}</span>m³</div> + </div> </div> <div class="info-btn"> <div class="fullScreen" @click="handleFullScreen(index)"> @@ -314,9 +322,16 @@ width: 100px; } - .val span { - display: inline-block; - padding: 0 20px; + .val{ + display: flex; + align-items: center; + span { + display: inline-block; + width: 6rem; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } } } } @@ -350,23 +365,6 @@ } } } - } - } - - .mask{ - position: absolute; - left: 0; - top: 0; - z-index: 100; - width: 100vw; - height: 100vh; - .mask-item{ - position: absolute; - left: 5%; - bottom: 10%; - height: 400px; - width: 300px; - background-color: rgba(0, 0, 0, 0.4); } } } diff --git a/src/views/screen/temperature/statics/index.vue b/src/views/screen/temperature/statics/index.vue index 6628720..491e1fc 100644 --- a/src/views/screen/temperature/statics/index.vue +++ b/src/views/screen/temperature/statics/index.vue @@ -126,7 +126,7 @@ }, yAxis: { type: 'value', - name: 'm', + name: '次', nameTextStyle: { color: '#fff', fontSize: '1.2rem' diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 28040ea..08ac732 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -2,6 +2,7 @@ import {sysDictType, sysDictData} from "@/api/system/dict"; import {onMounted} from "vue"; import setPostParams from "@/utils/searchParams.js"; +import {ElMessage} from "element-plus"; const {proxy} = getCurrentInstance(); @@ -145,11 +146,12 @@ /** 删除按钮操作 */ function handleDelete(row) { - proxy.$modal.confirm('确认删除"' + row.dictName + '?') - .then(async () => { - console.log("无删除功能"); - }).catch(() => { - }); + proxy.$modal.confirm('确认删除"' + row.dictName + '?').then(() => { + sysDictType().remove(row.id).then(() => { + ElMessage.success('删除成功') + getList() + }) + }) } /** 关闭弹窗 */ -- Gitblit v1.9.3