From 49630007005fb5068968b5ae301b68343e8c49aa Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Wed, 7 Jun 2023 20:25:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api/index.js | 9 +++++++++ src/views/alarmHandling/index.vue | 20 +++++++++++--------- src/views/components/carouselChart.vue | 2 +- vue.config.js | 6 +++--- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/utils/api/index.js b/src/utils/api/index.js index 828c669..fc8bd13 100644 --- a/src/utils/api/index.js +++ b/src/utils/api/index.js @@ -90,6 +90,15 @@ export function getAlarmList(data) { data, }); } +//获取告警label + +export function getAlarmTypeList(data) { + return request({ + url: "/api/getAlarmTypeList", + method: "post", + data, + }); +} //已读未读 export function readAlarm(data) { return request({ diff --git a/src/views/alarmHandling/index.vue b/src/views/alarmHandling/index.vue index c98a45c..513cdf7 100644 --- a/src/views/alarmHandling/index.vue +++ b/src/views/alarmHandling/index.vue @@ -43,12 +43,12 @@ > - + @@ -186,6 +186,7 @@ import { getSearchInfo, getAlarmList, + getAlarmTypeList, getLatestPhotoJoggle, getReturnedPhotoJoggle, readAlarm, @@ -197,12 +198,12 @@ export default { dyOptions: [{ id: 0, name: "全部" }], //电压数据 xlOptions: [{ id: 0, name: "全部" }], //线路数据 gtOptions: [{ id: 0, name: "全部" }], //杆塔数据 - gjOptions: [{ id: 0, name: "全部" }], //告警数据 + gjOptions: [{ id: 0, label: -1, name: "全部" }], //告警数据 formdata: { dyId: "", lineId: "", towerId: "", - warnCause: "", + label: "", timeVal: "", }, photoPic: "", @@ -276,11 +277,13 @@ export default { }, //获取告警原因 getSearchgj() { - getSearchInfo({ type: 1, id: this.formdata.lineId }) + getAlarmTypeList() .then((res) => { - this.gjOptions = [{ id: 0, name: "全部" }]; + this.gjOptions = [{ id: 0, label: -1, name: "全部" }]; this.gjOptions = this.gjOptions.concat(res.data.list); - this.formdata.warnCause = this.gjOptions[0].id; + console.log(this.gjOptions); + this.formdata.label = this.gjOptions[0].label; + console.log(this.formdata.label); }) .catch((err) => {}); }, @@ -297,7 +300,6 @@ export default { this.tableData = res.data.list; this.total = res.data.total; this.photoPic = res.data.list[0].path; - this.selectRow = res.data.list[0]; console.log(this.selectRow); this.drawline(this.selectRow); diff --git a/src/views/components/carouselChart.vue b/src/views/components/carouselChart.vue index 0b1e47c..1373718 100644 --- a/src/views/components/carouselChart.vue +++ b/src/views/components/carouselChart.vue @@ -97,7 +97,7 @@ >--{{ item.alias !== null && item.alias !== "" ? item.alias - : item.channnelname + : item.channelName }}

diff --git a/vue.config.js b/vue.config.js index 3e6b409..51f9db9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -28,11 +28,11 @@ module.exports = defineConfig({ proxy: { "/api": { //表示拦截以/api开头的请求路径 - //target: "http://47.96.238.157:8093", //阿里云服务器环境 - target: "http://180.166.218.222:40080", //dell + target: "http://47.96.238.157:8093", //阿里云服务器环境 + // target: "http://180.166.218.222:40080", //dell changOrigin: true, //是否开启跨域 pathRewrite: { - "^/api": "/api", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 + "^/api": "", //重写api,把api变成空字符,因为我们真正请求的路径是没有api的 }, }, },