From d0a8247ffe01cf4184b07f6658fe1a9c5f243cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Tue, 26 Nov 2024 12:55:16 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=9C=8B=E6=9D=BF=E6=95=B0=E6=8D=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=202.=E5=A2=9E=E5=8A=A0=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +++++ .env.production | 5 +++++ package.json | 5 +++-- src/components/AmphiPosition/index.vue | 4 ++-- src/components/ForwardDemand/index.vue | 10 ++++++---- src/components/LineTableAnalysis/index.vue | 6 +++--- src/components/MonthPlan/index.vue | 16 ++++++++-------- src/components/ViewPDF/index.vue | 2 +- src/utils/request.js | 2 +- 9 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .env.development create mode 100644 .env.production diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..6b7a7e8 --- /dev/null +++ b/.env.development @@ -0,0 +1,5 @@ +# just a flag +ENV = development + +# base api +VUE_APP_BASE_API = 'http://127.0.0.1:9080/' diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..2d07a05 --- /dev/null +++ b/.env.production @@ -0,0 +1,5 @@ +# just a flag +ENV = 'production' + +#铁舾生产环境服务器 +VUE_APP_BASE_API = 'http://192.127.0.22:8081/' diff --git a/package.json b/package.json index 3d3e65a..ae0bfca 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,9 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "dev": "vue-cli-service serve --mode development", + "serve": "vue-cli-service serve --mode server", + "build": "vue-cli-service build --mode production", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/src/components/AmphiPosition/index.vue b/src/components/AmphiPosition/index.vue index f5507a7..e0dbcfe 100644 --- a/src/components/AmphiPosition/index.vue +++ b/src/components/AmphiPosition/index.vue @@ -2,7 +2,7 @@
-
+
diff --git a/src/components/ForwardDemand/index.vue b/src/components/ForwardDemand/index.vue index 45df25f..6265a20 100644 --- a/src/components/ForwardDemand/index.vue +++ b/src/components/ForwardDemand/index.vue @@ -2,7 +2,7 @@
-
+
@@ -156,6 +156,8 @@ export default { nf: this.formData.year, }).then((res) => { this.tableList = res.data.detail; + res.data.xq=res.data.xq?parseInt(res.data.xq).toFixed(0):'0' + this.xqzlSum=res.data.xq this.rowObj = res.data; this.$nextTick(() => { const elementHeight = this.$refs.refHeight; @@ -174,7 +176,7 @@ export default { let dataJhzlY = []; let dataWczlY = []; let dataXqzlY = []; - this.xqzlSum = 0; + // this.xqzlSum = 0; this.jhzlSum = 0; this.wczlSum = 0; res.data.forEach((item) => { @@ -182,7 +184,7 @@ export default { dataJhzlY.push(item.jhzl); dataWczlY.push(item.wczl); dataXqzlY.push(item.xqzl); - this.xqzlSum += item.xqzl; + // this.xqzlSum += item.xqzl; this.jhzlSum += item.jhzl; this.wczlSum += item.wczl; }); diff --git a/src/components/LineTableAnalysis/index.vue b/src/components/LineTableAnalysis/index.vue index c98feb3..b3ebc15 100644 --- a/src/components/LineTableAnalysis/index.vue +++ b/src/components/LineTableAnalysis/index.vue @@ -2,7 +2,7 @@
-
+
@@ -90,7 +90,7 @@ export default { }).then((res) => { const ydjhList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; res.data.ydjh.forEach((item) => { - ydjhList[item.mon - 1] = item.zl; + ydjhList[item.mon - 1] = item.zl?.toFixed(0); }); this.xbjhList = res.data.xbjh; this.ydjhList = ydjhList; diff --git a/src/components/MonthPlan/index.vue b/src/components/MonthPlan/index.vue index 0e6c1a8..b590297 100644 --- a/src/components/MonthPlan/index.vue +++ b/src/components/MonthPlan/index.vue @@ -147,24 +147,24 @@ export default { zrcTable() { zrcTable().then((res) => { this.tableSumObj = res.data; - var bgData = [res.data.xqzl, res.data.xqzl, res.data.xqzl, res.data.xqzl]; - var zlData = [ res.data.xqzl,res.data.dhzl, res.data.jhzl, res.data.wczl]; + var bgData = [res.data.xqzl||0, res.data.xqzl||0, res.data.xqzl||0, res.data.xqzl||0]; + var zlData = [res.data.xqzl||0,res.data.dhzl||0, res.data.jhzl||0, res.data.wczl||0]; this.DrawingBar(bgData,zlData); // this.ForwardDemandBar(); // this.MonthlyPlanBar(); // this.finishBar(); - this.drawingPie(res.data.ltsl, res.data.tzsl); - this.planFinishPie(res.data.jhzl, res.data.wczl); - this.forwardDemandPie(res.data.xqzl, res.data.dhzl); - this.monthlyPlanPie(res.data.xqzl, res.data.jhzl); - this.finishPie(res.data.xqzl, res.data.wczl); + this.drawingPie(res.data.ltsl||0, res.data.tzsl||0); + this.planFinishPie(res.data.jhzl||0, res.data.wczl||0); + this.forwardDemandPie(res.data.xqzl||0, res.data.dhzl||0); + this.monthlyPlanPie(res.data.xqzl||0, res.data.jhzl||0); + this.finishPie(res.data.xqzl||0, res.data.wczl||0); }); }, DrawingBar(bgData,zlData) { var myChart = this.$echarts.init(document.getElementById("DrawingBar")); - + var option = { // color: ["#2e7cff", "#fc8452"], tooltip: { diff --git a/src/components/ViewPDF/index.vue b/src/components/ViewPDF/index.vue index 8f82769..f28ff58 100644 --- a/src/components/ViewPDF/index.vue +++ b/src/components/ViewPDF/index.vue @@ -120,7 +120,7 @@ export default { }, pdfChange(item) { this.pdfUrl = pdf.createLoadingTask( - `http://kban.runpengsoft.com/upload/${this.formData.dcCh}/${this.formData.dcPl}/PDF/${item}.pdf` + `${process.env.VUE_APP_BASE_API}/upload/${this.formData.dcCh}/${this.formData.dcPl}/PDF/${item}.pdf` ); this.pdfUrl.promise .then((pdf) => { diff --git a/src/utils/request.js b/src/utils/request.js index b0cd188..d5b6f24 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,6 @@ import axios from "axios"; const service = axios.create({ - baseURL: "http://kban.runpengsoft.com", + baseURL: process.env.VUE_APP_BASE_API, timeout: 600000, //600000 withCredentials: false, });