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, //是否开启跨域