From 98e8af135048da6ea475599495df3d12c370241f Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Tue, 6 Aug 2024 11:31:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/picReport/index.vue | 34 +++++++++++++++++++++++++--------- vue.config.js | 2 +- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/views/picReport/index.vue b/src/views/picReport/index.vue index f86f83d..a5f7416 100644 --- a/src/views/picReport/index.vue +++ b/src/views/picReport/index.vue @@ -15,7 +15,7 @@ - + {{ dyName }} - {{ xlName }} + + {{ xlName }} + {{ termTotalNum }} @@ -156,8 +158,8 @@ export default { formdata: { dyId: null, lineId: null, - picNum: "48", - norGraphRate: "100%", + picNum: "", + norGraphRate: "", starttime: new Date(new Date().setHours(0, 0, 0, 0)).getTime() - 3 * 24 * 60 * 60 * 1000, // 设置开始时间为当天凌晨00:00:00的时间戳 @@ -196,9 +198,19 @@ export default { .then((res) => { this.xlOptions = res.data.list; this.formdata.lineId = this.xlOptions[0].id; + this.getlineNum(this.xlOptions[0].id); }) .catch((err) => {}); }, + getlineNum(val) { + console.log(val); + const lineObj = this.xlOptions.find((item) => item.id == val); + console.log(lineObj); + this.formdata.picNum = + lineObj.photoCount == null ? "0" : lineObj.photoCount; + this.formdata.norGraphRate = + lineObj.photoRate == null ? "0%" : lineObj.photoRate; + }, onSubmit() { if (this.formdata.starttime > this.formdata.endtime) { return this.$message({ @@ -230,11 +242,15 @@ export default { picRportApi(params) .then((res) => { this.picLoading = false; - console.log(res.data); - this.tableData = res.data.dayList; - this.termTotalNum = res.data.termList.length; - this.dyName = res.data.termList[0].dyName; - this.xlName = res.data.termList[0].lineName; + if (res.data.termList.length !== 0) { + console.log(res.data); + this.tableData = res.data.dayList; + this.termTotalNum = res.data.termList.length; + this.dyName = res.data.termList[0].dyName; + this.xlName = res.data.termList[0].lineName; + } else { + this.tableData = []; + } }) .catch((err) => {}); }, 100); diff --git a/vue.config.js b/vue.config.js index 2cfd103..5e96aa9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -21,7 +21,7 @@ module.exports = defineConfig({ "/api": { //表示拦截以/api开头的请求路径 // target: "http://61.169.135.146:40101/", // - // target: "http://61.169.135.146:40080/", //dell + //target: "http://61.169.135.146:40080/", //dell target: "http://61.169.135.146:40085/", //运维 //target: "http://192.168.50.197:8093/", //java本地后端 changOrigin: true, //是否开启跨域