修改bug

This commit is contained in:
‘937886381’ 2024-06-14 10:18:20 +08:00
parent fad6028469
commit f14e9d7408
14 changed files with 149 additions and 103 deletions

BIN
src/assets/images/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 MiB

View File

@ -378,10 +378,14 @@ function splitCurrentAndPreviousA(factoryListResponse, targetListResponse, prodO
transformRate.target[fId] = componentConversionEfficiency transformRate.target[fId] = componentConversionEfficiency
} }
// 芯片OEE // 芯片OEE
if (factory.glassType === 0) {
chipOeeRate.current[fId] = factory.oee; chipOeeRate.current[fId] = factory.oee;
}
// chipOeeRate.previous[fId] = factory.previousYearOee; // chipOeeRate.previous[fId] = factory.previousYearOee;
// 转化效率 // 转化效率
if (factory.glassType === 1) {
transformRate.current[fId] = factory.componentConversionEfficiency; transformRate.current[fId] = factory.componentConversionEfficiency;
}
// transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency ; // transformRate.previous[fId] = factory.previousYearComponentConversionEfficiency ;
// 芯片良率 与 标准组件良率 // 芯片良率 与 标准组件良率
if (![0, 1].includes(factory.glassType)) continue; if (![0, 1].includes(factory.glassType)) continue;
@ -448,8 +452,11 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
if (factoryListResponse && factoryListResponse[0] != null) { if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) { for (const factory of factoryListResponse) {
const fId = getFactoryId(factory); const fId = getFactoryId(factory);
console.log('factory.inputNumber', factory, fId);
if (factory.glassType === 0) {
chipInvest.current[fId] = factory.inputNumber
}
// const preFId = getPreFactoryId(factory); // const preFId = getPreFactoryId(factory);
// 获取目标值 // 获取目标值
if (targetListResponse) { if (targetListResponse) {
const { chipYield, componentYield, bipvProductOutput } = const { chipYield, componentYield, bipvProductOutput } =
@ -459,7 +466,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
bipvOutput.target[fId] = bipvProductOutput; bipvOutput.target[fId] = bipvProductOutput;
} }
// 芯片投入 // 芯片投入
chipInvest.current[fId] = factory.inputNumber;
// 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出 // 产出数据, 0 - (玻璃)芯片产出, 1 - 标准组件产出, 2 - BIPV产出
// 因为后端写的垃圾数据,所以这里要做一下判断 // 因为后端写的垃圾数据,所以这里要做一下判断
@ -467,6 +473,7 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType]; const _t = [chipOutput, stdOutput, bipvOutput][factory.glassType];
_t.current[fId] = factory.outputNumber; _t.current[fId] = factory.outputNumber;
} }
console.log('chipInvest',chipInvest);
return { return {
chipInvest, chipInvest,
// ftoInvest, // ftoInvest,
@ -475,15 +482,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse, prodOu
stdOutput, stdOutput,
bipvOutput, bipvOutput,
}; };
}else{
return {
chipInvest,
// ftoInvest,
ftoInvest,
chipOutput,
stdOutput,
bipvOutput,
}
} }
} }

View File

@ -47,8 +47,11 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -60,13 +63,13 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}`, color: "#12f7f1" }, { label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}`, color: "#12f7f1" }, { label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -96,7 +99,7 @@ export default {
items = [ items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}目标`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] }, // { label: `${year}`, value: valueTuple[2] },
]; ];
@ -163,8 +166,11 @@ function getTemplate(period, dataList, than) {
// console.log('dataList',dataList); // console.log('dataList',dataList);
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -177,11 +183,11 @@ function getTemplate(period, dataList, than) {
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ {
name: `${year-1}${month}${today}`, name: `${year - 1}${yesterday}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
@ -189,11 +195,11 @@ function getTemplate(period, dataList, than) {
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ {
name: `${yesterday}`, name: `${dayBeYes}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },

View File

@ -47,8 +47,11 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -60,13 +63,13 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}`, color: "#12f7f1" }, { label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}`, color: "#12f7f1" }, { label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -96,7 +99,7 @@ export default {
items = [ items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}目标`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] }, // { label: `${year}`, value: valueTuple[2] },
]; ];
@ -154,8 +157,11 @@ function getTemplate(period, dataList,than) {
// console.log('dataList',dataList); // console.log('dataList',dataList);
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -168,11 +174,11 @@ function getTemplate(period, dataList,than) {
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ {
name: `${year-1}${month}${today}`, name: `${year - 1}${yesterday}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
@ -180,11 +186,11 @@ function getTemplate(period, dataList,than) {
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ {
name: `${yesterday}`, name: `${dayBeYes}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 13:22:43 * @Date: 2024-05-07 13:22:43
* @LastEditTime: 2024-06-06 15:12:58 * @LastEditTime: 2024-06-14 10:05:37
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -87,8 +87,11 @@ export default {
const vt = this.valueTuple; const vt = this.valueTuple;
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -100,13 +103,13 @@ export default {
// const year = new Date().getFullYear(); // const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${month}${today}日良率`, }, { label: `${yesterday}日良率`, },
{ label: `${year-1}${month}${today}日良率` }, { label: `${year - 1}${yesterday}日良率` },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${month}${today}日良率` },
{ label: `${yesterday}日良率` }, { label: `${yesterday}日良率` },
{ label: `${dayBeYes}日良率` },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -139,7 +142,7 @@ export default {
} }
let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%', let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%',
subtitle = { subtitle = {
: "日良率", : "日良率",
: "本周良率", : "本周良率",
: `${month}月良率`, : `${month}月良率`,
: `${year}良率`, : `${year}良率`,
@ -161,8 +164,11 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -174,13 +180,13 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0]) ) + "%" }, { label: `${year - 1}${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: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, { label: `${dayBeYes}日良率`, 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: `${yesterday}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:25:10 * @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-06-06 15:14:29 * @LastEditTime: 2024-06-14 09:58:01
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -69,16 +69,19 @@ export default {
titlePre() { titlePre() {
console.log(this.city); console.log(this.city);
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
const today = new Date().getDate(); const today = new Date().getDate();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1; const lastMonth = new Date().getMonth() + 1 === 12 ? 1 : new Date().getMonth() + 1 - 1;
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
return `${year-1}${month}${today}` return `${year - 1}${yesterday}`
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
return `${yesterday}` return `${dayBeYes}`
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
return `${year-1}年本周` return `${year-1}年本周`
} else if (this.period === '周' && this.than === '环比') { } else if (this.period === '周' && this.than === '环比') {
@ -93,14 +96,18 @@ export default {
}, },
title() { title() {
var day1 = new Date(); 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 today = new Date().getDate();
const month = new Date().getMonth() + 1; const month = new Date().getMonth() + 1;
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
return `${month}${today}` return `${yesterday}`
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
return `${month}${today}` return `${yesterday}`
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
return `本周` return `本周`
} else if (this.period === '周' && this.than === '环比') { } else if (this.period === '周' && this.than === '环比') {

View File

@ -45,8 +45,11 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -58,13 +61,13 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}`, color: "#12f7f1" }, { label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}`, color: "#12f7f1" }, { label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -149,8 +152,11 @@ export default {
function getTemplate(period, dataList,than) { function getTemplate(period, dataList,than) {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -163,11 +169,11 @@ function getTemplate(period, dataList,than) {
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ {
name: `${year-1}${month}${today}`, name: `${year - 1}${yesterday}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
@ -175,11 +181,11 @@ function getTemplate(period, dataList,than) {
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ {
name: `${yesterday}`, name: `${dayBeYes}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },

View File

@ -45,8 +45,11 @@ export default {
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -58,13 +61,13 @@ export default {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}`, color: "#12f7f1" }, { label: `${year - 1}${yesterday}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${yesterday}`, color: "#12f7f1" }, { label: `${dayBeYes}`, color: "#12f7f1" },
{ label: `${month}${today}`, color: "#58adfa" }, { label: `${yesterday}`, color: "#58adfa" },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
items = [ items = [
@ -150,9 +153,15 @@ export default {
function getTemplate(period, dataList,than) { function getTemplate(period, dataList,than) {
let items = []; 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(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -165,11 +174,11 @@ function getTemplate(period, dataList,than) {
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ {
name: `${year-1}${month}${today}`, name: `${year - 1}${yesterday}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },
@ -177,11 +186,11 @@ function getTemplate(period, dataList,than) {
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ {
name: `${yesterday}`, name: `${dayBeYes}`,
data: dataList ? dataList[0] : [], data: dataList ? dataList[0] : [],
}, },
{ {
name: `${month}${today}`, name: `${yesterday}`,
data: dataList ? dataList[1] : [], data: dataList ? dataList[1] : [],
// : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)), // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
}, },

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 13:32:59 * @Date: 2024-05-20 13:32:59
* @LastEditTime: 2024-06-06 08:42:04 * @LastEditTime: 2024-06-14 09:44:42
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -78,13 +78,13 @@ export default {
valueTuple() { valueTuple() {
// [previousValue, currentValue, sumValue?] // [previousValue, currentValue, sumValue?]
const getter = this.$store.getters.copilot.yield[this.dataSourceField]; const getter = this.$store.getters.copilot.yield[this.dataSourceField];
if (this.period === "日" || this.period === "周") { // if (this.period === "" || this.period === "") {
console.log(this.period) // console.log(this.period)
return [ // return [
getter.previous[this.factoryId], // getter.previous[this.factoryId],
getter.current[this.factoryId], // getter.current[this.factoryId],
]; // ];
} // }
// [100, 200, 200] // [100, 200, 200]
return [ return [
getter.previous[this.factoryId], getter.previous[this.factoryId],
@ -100,8 +100,11 @@ export default {
const vt = this.valueTuple; const vt = this.valueTuple;
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -113,14 +116,14 @@ export default {
// const year = new Date().getFullYear(); // const year = new Date().getFullYear();
if (this.period === '日' && this.than === '同比') { if (this.period === '日' && this.than === '同比') {
items = [ items = [
{ label: `${month}${today}日累计`,}, { label: `${yesterday}日累计`,},
{ label: `${year-1}${month}${today}累计` }, { label: `${year - 1}${yesterday}累计` },
{ label: `${month}${today}日目标`, }, { label: `${month}${today}日目标`, },
]; ];
} else if (this.period === '日' && this.than === '环比') { } else if (this.period === '日' && this.than === '环比') {
items = [ items = [
{ label: `${month}${today}日累计`},
{ label: `${yesterday}日累计`}, { label: `${yesterday}日累计`},
{ label: `${dayBeYes}日累计` },
{ label: `${month}${today}日目标`, }, { label: `${month}${today}日目标`, },
]; ];
} else if (this.period === '周' && this.than === '同比') { } else if (this.period === '周' && this.than === '同比') {
@ -160,9 +163,9 @@ export default {
: (vt[1] != 0 && vt[1] != null) && vt[2] == 0 : (vt[1] != 0 && vt[1] != null) && vt[2] == 0
? "100%" : '0%', ? "100%" : '0%',
subtitle = subtitle =
this.period == "日" ? `${month}${today}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`; this.period == "日" ? `${yesterday}日累计完成值` : this.period == "周" ? `本周累计完成值` : this.period == "月" ? `${month}月累计完成值` : `${year}年累计完成值`;
console.log(this.valueTuple[0], this.valueTuple[1], this.valueTuple[2],) console.log('titleValue', items)
console.log(this.valueTuple[2]- this.valueTuple[1]) // console.log(this.valueTuple[2]- this.valueTuple[1])
return getOptions({ return getOptions({
titleValue, titleValue,
subtitle, subtitle,
@ -221,8 +224,12 @@ function calculateItems(period, valueTuple, than) {
console.log('valueTuple', valueTuple); console.log('valueTuple', valueTuple);
let items = []; let items = [];
var day1 = new Date(); 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 yesterday = (day1.getMonth() + 1) + "月" + day1.getDate()
var dayBeYes = (day2.getMonth() + 1) + "月" + day2.getDate()
// //
// var day2 = new Date(); // var day2 = new Date();
// day2.setTime(day2.getTime()); // day2.setTime(day2.getTime());
@ -234,14 +241,14 @@ function calculateItems(period, valueTuple, than) {
const year = new Date().getFullYear(); const year = new Date().getFullYear();
if (period === '日' && than === '同比') { if (period === '日' && than === '同比') {
items = [ items = [
{ label: `${year-1}${month}${today}累计`, value: valueTuple[0] }, { label: `${year - 1}${yesterday}累计`, value: valueTuple[0] },
{ label: `${month}${today}累计`, value: valueTuple[1] }, { label: `${yesterday}累计`, value: valueTuple[1] },
{ label: `${month}${today}日目标`, value: valueTuple[2] }, { label: `${month}${today}日目标`, value: valueTuple[2] },
]; ];
} else if (period === '日' && than === '环比') { } else if (period === '日' && than === '环比') {
items = [ items = [
{ label: `${yesterday}日累计`, value: valueTuple[0] }, { label: `${dayBeYes}日累计`, value: valueTuple[0] },
{ label: `${month}${today}日累计`, value: valueTuple[1] }, { label: `${yesterday}日累计`, value: valueTuple[1] },
{ label: `${month}${today}日目标`, value: valueTuple[2] }, { label: `${month}${today}日目标`, value: valueTuple[2] },
]; ];
} else if (period === '周' && than === '同比') { } else if (period === '周' && than === '同比') {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-28 13:42:51 * @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-06-05 14:12:31 * @LastEditTime: 2024-06-14 09:03:26
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -221,6 +221,7 @@ export default {
}; };
}, },
actualOptions() { actualOptions() {
console.log('this.output.current / this.output.target', this.output.current/this.output.target);
const year = new Date().getFullYear() const year = new Date().getFullYear()
const options = JSON.parse(JSON.stringify(this.options)); const options = JSON.parse(JSON.stringify(this.options));
// console.log('options', options); // console.log('options', options);
@ -228,7 +229,7 @@ export default {
if (!this.output.target) options.title.text = "0%"; if (!this.output.target) options.title.text = "0%";
else else
options.title.text = options.title.text =
(this.output.current / this.output.target) * 100 + "%"; ((this.output.current / this.output.target).toFixed(2)) * 100 + "%";
// //
if ( if (
this.output.current == this.output.target && this.output.current == this.output.target &&

View File

@ -59,7 +59,7 @@ export default {
actualOptions: null, actualOptions: null,
options: { options: {
grid: { grid: {
left: "3%", left: "5%",
right: "4%", right: "4%",
bottom: "0", bottom: "0",
top: "15%", top: "15%",

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-28 13:42:51 * @Date: 2024-04-28 13:42:51
* @LastEditTime: 2024-06-04 15:35:54 * @LastEditTime: 2024-06-14 09:16:09
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -65,7 +65,7 @@ export default {
isFullscreen: false, isFullscreen: false,
options: { options: {
grid: { grid: {
left: "3%", left: "5%",
right: "4%", right: "4%",
bottom: "0", bottom: "0",
top: "18%", top: "18%",

View File

@ -10,7 +10,7 @@
style=" style="
position: absolute; position: absolute;
top: 12%; top: 12%;
left: 20%; left: 15%;
user-select: none; user-select: none;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -31,7 +31,7 @@
<p <p
style=" style="
margin: 0; margin: 0;
font-size: 26px; font-size: 24px;
letter-spacing: 1px; letter-spacing: 1px;
color: #26b9de; color: #26b9de;
opacity: 75%; opacity: 75%;
@ -52,8 +52,8 @@
</p> </p>
</div> </div>
<img <img
src="../assets/images/login.png" src="../assets/images/map.png"
style="position: absolute; top: 30%; left: 15%; width: 40vw" style="position: absolute; top: 00%; left: 11%; width: 50vw"
alt="" alt=""
/> />
</div> </div>