diff --git a/src/assets/images/map.png b/src/assets/images/map.png new file mode 100644 index 0000000..083e44f Binary files /dev/null and b/src/assets/images/map.png differ diff --git a/src/store/modules/home.js b/src/store/modules/home.js index aaa4d21..234fa10 100644 --- a/src/store/modules/home.js +++ b/src/store/modules/home.js @@ -378,10 +378,14 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO transformRate.target[fId] = componentConversionEfficiency } // 芯片OEE - chipOeeRate.current[fId] = factory.oee; + if (factory.glassType === 0) { + chipOeeRate.current[fId] = factory.oee; + } // chipOeeRate.previous[fId] = factory.previousYearOee; // 转化效率 - transformRate.current[fId] = factory.componentConversionEfficiency; + if (factory.glassType === 1) { + transformRate.current[fId] = factory.componentConversionEfficiency; + } // transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency ; // 芯片良率 与 标准组件良率 if (![0, 1].includes(factory.glassType)) continue; @@ -448,8 +452,11 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu if (factoryListResponse && factoryListResponse[0] != null) { for (const factory of factoryListResponse) { const fId = getFactoryId(factory); + console.log('factory.inputNumber', factory, fId); + if (factory.glassType === 0) { + chipInvest.current[fId] = factory.inputNumber + } // const preFId = getPreFactoryId(factory); - // 获取目标值 if (targetListResponse) { const { chipYield, componentYield, bipvProductOutput } = @@ -459,7 +466,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu bipvOutput.target[fId] = bipvProductOutput; } // 芯片投入 - chipInvest.current[fId] = factory.inputNumber; // 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出 // 因为后端写的垃圾数据,所以这里要做一下判断 @@ -467,6 +473,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; _t.current[fId] = factory.outputNumber; } + console.log('chipInvest',chipInvest); return { chipInvest, // ftoInvest, @@ -475,15 +482,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu stdOutput, bipvOutput, }; - }else{ - return { - chipInvest, - // ftoInvest, - ftoInvest, - chipOutput, - stdOutput, - bipvOutput, - } } } diff --git a/src/views/copilot/efficiency/components/ChipOee.vue b/src/views/copilot/efficiency/components/ChipOee.vue index f2a0ae4..16c89be 100644 --- a/src/views/copilot/efficiency/components/ChipOee.vue +++ b/src/views/copilot/efficiency/components/ChipOee.vue @@ -47,8 +47,11 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -60,13 +63,13 @@ export default { const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${yesterday}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${dayBeYes}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -96,7 +99,7 @@ export default { items = [ { label: `${year - 1}年`, color: "#12f7f1" }, { label: `${year}年`, color: "#58adfa" }, - { label: `${year}年`, color: "#58adfa" }, + { label: `${year}年目标`, color: "#58adfa" }, // { label: `${year}年目标`, value: valueTuple[2] }, ]; @@ -163,8 +166,11 @@ function getTemplate(period, dataList, than) { // console.log('dataList',dataList); let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -177,11 +183,11 @@ function getTemplate(period, dataList, than) { if (period === '日' && than === '同比') { items = [ { - name: `${year-1}年${month}月${today}日`, + name: `${year - 1}年${yesterday}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, @@ -189,11 +195,11 @@ function getTemplate(period, dataList, than) { } else if (period === '日' && than === '环比') { items = [ { - name: `${yesterday}日`, + name: `${dayBeYes}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, diff --git a/src/views/copilot/efficiency/components/TransformRate.vue b/src/views/copilot/efficiency/components/TransformRate.vue index 9c3dc91..04e07f5 100644 --- a/src/views/copilot/efficiency/components/TransformRate.vue +++ b/src/views/copilot/efficiency/components/TransformRate.vue @@ -47,8 +47,11 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -60,13 +63,13 @@ export default { const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${yesterday}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${dayBeYes}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -96,7 +99,7 @@ export default { items = [ { label: `${year - 1}年`, color: "#12f7f1" }, { label: `${year}年`, color: "#58adfa" }, - { label: `${year}年`, color: "#58adfa" }, + { label: `${year}年目标`, color: "#58adfa" }, // { label: `${year}年目标`, value: valueTuple[2] }, ]; @@ -154,8 +157,11 @@ function getTemplate(period, dataList,than) { // console.log('dataList',dataList); let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -168,11 +174,11 @@ function getTemplate(period, dataList,than) { if (period === '日' && than === '同比') { items = [ { - name: `${year-1}年${month}月${today}日`, + name: `${year - 1}年${yesterday}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, @@ -180,11 +186,11 @@ function getTemplate(period, dataList,than) { } else if (period === '日' && than === '环比') { items = [ { - name: `${yesterday}日`, + name: `${dayBeYes}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, diff --git a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue index 67b2633..c227aef 100644 --- a/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue +++ b/src/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue @@ -1,7 +1,7 @@ diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index d2959e9..8d90011 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -87,8 +87,11 @@ export default { const vt = this.valueTuple; let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -100,13 +103,13 @@ export default { // const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${month}月${today}日良率`, }, - { label: `${year-1}年${month}月${today}日良率` }, + { label: `${yesterday}日良率`, }, + { label: `${year - 1}年${yesterday}日良率` }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${month}月${today}日良率` }, { label: `${yesterday}日良率` }, + { label: `${dayBeYes}日良率` }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -139,7 +142,7 @@ export default { } let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%', subtitle = { - 日: "本日良率", + 日: "昨日良率", 周: "本周良率", 月: `${month}月良率`, 年: `${year}良率`, @@ -161,8 +164,11 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -174,13 +180,13 @@ export default { const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, - { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, + { label: `${year - 1}年${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, + { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, - { label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, + { label: `${dayBeYes}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, + { label: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ diff --git a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue index 1a79296..a6d707e 100644 --- a/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/std/StdRateItem.vue @@ -1,7 +1,7 @@ @@ -69,16 +69,19 @@ export default { titlePre() { console.log(this.city); var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() const today = new Date().getDate(); const month = new Date().getMonth() + 1; const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { - return `${year-1}年${month}月${today}日` + return `${year - 1}年${yesterday}日` } else if (this.period === '日' && this.than === '环比') { - return `${yesterday}日` + return `${dayBeYes}日` } else if (this.period === '周' && this.than === '同比') { return `${year-1}年本周` } else if (this.period === '周' && this.than === '环比') { @@ -93,14 +96,18 @@ export default { }, title() { var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) + var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() const today = new Date().getDate(); const month = new Date().getMonth() + 1; const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { - return `${month}月${today}日` + return `${yesterday}日` } else if (this.period === '日' && this.than === '环比') { - return `${month}月${today}日` + return `${yesterday}日` } else if (this.period === '周' && this.than === '同比') { return `本周` } else if (this.period === '周' && this.than === '环比') { diff --git a/src/views/copilot/yield/components/ChipInvest.vue b/src/views/copilot/yield/components/ChipInvest.vue index dd3033c..3d2b3fc 100644 --- a/src/views/copilot/yield/components/ChipInvest.vue +++ b/src/views/copilot/yield/components/ChipInvest.vue @@ -45,8 +45,11 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -58,13 +61,13 @@ export default { const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${yesterday}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${dayBeYes}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -149,8 +152,11 @@ export default { function getTemplate(period, dataList,than) { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -163,11 +169,11 @@ function getTemplate(period, dataList,than) { if (period === '日' && than === '同比') { items = [ { - name: `${year-1}年${month}月${today}日`, + name: `${year - 1}年${yesterday}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, @@ -175,11 +181,11 @@ function getTemplate(period, dataList,than) { } else if (period === '日' && than === '环比') { items = [ { - name: `${yesterday}日`, + name: `${dayBeYes}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, diff --git a/src/views/copilot/yield/components/FtoInvest.vue b/src/views/copilot/yield/components/FtoInvest.vue index 63184fb..0274af6 100644 --- a/src/views/copilot/yield/components/FtoInvest.vue +++ b/src/views/copilot/yield/components/FtoInvest.vue @@ -45,8 +45,11 @@ export default { legend() { let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -58,13 +61,13 @@ export default { const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${year - 1}年${yesterday}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${yesterday}日`, color: "#12f7f1" }, - { label: `${month}月${today}日`, color: "#58adfa" }, + { label: `${dayBeYes}日`, color: "#12f7f1" }, + { label: `${yesterday}日`, color: "#58adfa" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ @@ -150,9 +153,15 @@ export default { function getTemplate(period, dataList,than) { let items = []; + // var day1 = new Date(); + // day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + // var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -165,11 +174,11 @@ function getTemplate(period, dataList,than) { if (period === '日' && than === '同比') { items = [ { - name: `${year-1}年${month}月${today}日`, + name: `${year - 1}年${yesterday}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, @@ -177,11 +186,11 @@ function getTemplate(period, dataList,than) { } else if (period === '日' && than === '环比') { items = [ { - name: `${yesterday}日`, + name: `${dayBeYes}日`, data: dataList ? dataList[0] : [], }, { - name: `${month}月${today}日`, + name: `${yesterday}日`, data: dataList ? dataList[1] : [], // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), }, diff --git a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue index ca350e8..a592e46 100644 --- a/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue +++ b/src/views/copilot/yield/components/sub/ring/DoubleRingChart.vue @@ -1,7 +1,7 @@ @@ -78,13 +78,13 @@ export default { valueTuple() { // [previousValue, currentValue, sumValue?] const getter = this.$store.getters.copilot.yield[this.dataSourceField]; - if (this.period === "日" || this.period === "周") { - console.log(this.period) - return [ - getter.previous[this.factoryId], - getter.current[this.factoryId], - ]; - } + // if (this.period === "日" || this.period === "周") { + // console.log(this.period) + // return [ + // getter.previous[this.factoryId], + // getter.current[this.factoryId], + // ]; + // } // [100, 200, 200] return [ getter.previous[this.factoryId], @@ -100,8 +100,11 @@ export default { const vt = this.valueTuple; let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -113,14 +116,14 @@ export default { // const year = new Date().getFullYear(); if (this.period === '日' && this.than === '同比') { items = [ - { label: `${month}月${today}日累计`,}, - { label: `${year-1}年${month}月${today}日累计` }, + { label: `${yesterday}日累计`,}, + { label: `${year - 1}年${yesterday}累计` }, { label: `${month}月${today}日目标`, }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ - { label: `${month}月${today}日累计`}, - { label: `${yesterday}日累计` }, + { label: `${yesterday}日累计`}, + { label: `${dayBeYes}日累计` }, { label: `${month}月${today}日目标`, }, ]; } else if (this.period === '周' && this.than === '同比') { @@ -160,9 +163,9 @@ export default { : (vt[1] != 0 && vt[1] != null) && vt[2] == 0 ? "100%" : '0%', subtitle = - this.period == "日" ? `${month}月${today}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`; - console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],) - console.log(this.valueTuple[2]- this.valueTuple[1]) + this.period == "日" ? `${yesterday}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`; + console.log('titleValue', items) + // console.log(this.valueTuple[2]- this.valueTuple[1]) return getOptions({ titleValue, subtitle, @@ -221,8 +224,12 @@ function calculateItems(period, valueTuple, than) { console.log('valueTuple', valueTuple); let items = []; var day1 = new Date(); - day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); + var day2 = new Date(); + day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000) + day2.setTime(day2.getTime() - 48 * 60 * 60 * 1000) var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() + var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate() + //今天的时间 // var day2 = new Date(); // day2.setTime(day2.getTime()); @@ -234,14 +241,14 @@ function calculateItems(period, valueTuple, than) { const year = new Date().getFullYear(); if (period === '日' && than === '同比') { items = [ - { label: `${year-1}年${month}月${today}日累计`, value: valueTuple[0] }, - { label: `${month}月${today}日累计`, value: valueTuple[1] }, + { label: `${year - 1}年${yesterday}累计`, value: valueTuple[0] }, + { label: `${yesterday}累计`, value: valueTuple[1] }, { label: `${month}月${today}日目标`, value: valueTuple[2] }, ]; } else if (period === '日' && than === '环比') { items = [ - { label: `${yesterday}日累计`, value: valueTuple[0] }, - { label: `${month}月${today}日累计`, value: valueTuple[1] }, + { label: `${dayBeYes}日累计`, value: valueTuple[0] }, + { label: `${yesterday}日累计`, value: valueTuple[1] }, { label: `${month}月${today}日目标`, value: valueTuple[2] }, ]; } else if (period === '周' && than === '同比') { diff --git a/src/views/dashboard/charts/ChipYieldChart.vue b/src/views/dashboard/charts/ChipYieldChart.vue index eaf3c35..fc5b61e 100644 --- a/src/views/dashboard/charts/ChipYieldChart.vue +++ b/src/views/dashboard/charts/ChipYieldChart.vue @@ -1,7 +1,7 @@ @@ -221,6 +221,7 @@ export default { }; }, actualOptions() { + console.log('this.output.current / this.output.target', this.output.current/this.output.target); const year = new Date().getFullYear() const options = JSON.parse(JSON.stringify(this.options)); // console.log('options', options); @@ -228,7 +229,7 @@ export default { if (!this.output.target) options.title.text = "0%"; else options.title.text = - (this.output.current / this.output.target) * 100 + "%"; + ((this.output.current / this.output.target).toFixed(2)) * 100 + "%"; // 外环 if ( this.output.current == this.output.target && diff --git a/src/views/dashboard/charts/LeftChartBase.vue b/src/views/dashboard/charts/LeftChartBase.vue index d0e1acd..7ba5c38 100644 --- a/src/views/dashboard/charts/LeftChartBase.vue +++ b/src/views/dashboard/charts/LeftChartBase.vue @@ -59,7 +59,7 @@ export default { actualOptions: null, options: { grid: { - left: "3%", + left: "5%", right: "4%", bottom: "0", top: "15%", diff --git a/src/views/dashboard/charts/RightChartBase.vue b/src/views/dashboard/charts/RightChartBase.vue index 4070b8b..d94f8e1 100644 --- a/src/views/dashboard/charts/RightChartBase.vue +++ b/src/views/dashboard/charts/RightChartBase.vue @@ -1,7 +1,7 @@ @@ -65,7 +65,7 @@ export default { isFullscreen: false, options: { grid: { - left: "3%", + left: "5%", right: "4%", bottom: "0", top: "18%", diff --git a/src/views/login.vue b/src/views/login.vue index 8b646f6..1bef94f 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -10,7 +10,7 @@ style=" position: absolute; top: 12%; - left: 20%; + left: 15%; user-select: none; display: flex; flex-direction: column; @@ -31,7 +31,7 @@