@@ -1,7 +1,7 @@ | |||
### | |||
# @Author: zhp | |||
# @Date: 2024-04-28 13:42:51 | |||
# @LastEditTime: 2024-06-03 08:44:09 | |||
# @LastEditTime: 2024-06-03 08:50:41 | |||
# @LastEditors: DY | |||
# @Description: | |||
### | |||
@@ -1,7 +1,7 @@ | |||
/* | |||
* @Author: zhp | |||
* @Date: 2024-05-07 08:54:59 | |||
* @LastEditTime: 2024-05-31 10:25:55 | |||
* @LastEditTime: 2024-06-03 08:52:02 | |||
* @LastEditors: DY | |||
* @Description: | |||
*/ | |||
@@ -147,3 +147,12 @@ export function cockpitDataMonitor(data) { | |||
data: data | |||
}) | |||
} | |||
export function exportFactoryDataExcel(data) { | |||
return request({ | |||
url: '/ip/prod-output-month/export/excel', | |||
method: 'post', | |||
data: data, | |||
responseType: 'blob' | |||
}) | |||
} |
@@ -4,16 +4,16 @@ function __resizeHandler(entries) { | |||
console.log(entries) | |||
for (const entry of entries) { | |||
if (entry.contentBoxSize) { | |||
const contentBoxSize = Array.isArray(entry.contentBoxSize) | |||
? entry.contentBoxSize[0] | |||
: entry.contentBoxSize; | |||
this.chart_mixin_chartInstance.resize({ | |||
width: | |||
contentBoxSize.inlineSize < this.MIN_WIDTH | |||
? this.MIN_WIDTH | |||
: contentBoxSize.inlineSize, | |||
height: contentBoxSize.blockSize, | |||
}); | |||
// const contentBoxSize = Array.isArray(entry.contentBoxSize) | |||
// ? entry.contentBoxSize[0] | |||
// : entry.contentBoxSize; | |||
// this.chart_mixin_chartInstance.resize({ | |||
// width: | |||
// contentBoxSize.inlineSize < this.MIN_WIDTH | |||
// ? this.MIN_WIDTH | |||
// : contentBoxSize.inlineSize, | |||
// height: contentBoxSize.blockSize, | |||
// }); | |||
} else { | |||
// manipulate contentRect | |||
this.chart_mixin_chartInstance.resize({ | |||
@@ -92,10 +92,11 @@ const actions = { | |||
/** 初始化首页数据 */ | |||
async initHome({ commit }) { | |||
const dataArr = await getHomeInfo(); | |||
console.log('dataArr',dataArr); | |||
console.log('dataArr', dataArr); | |||
let preData = dataArr.previousProdOutputOutDO | |||
let preFtoData = dataArr.previousProdOutputFtoDO | |||
// const targetArr = await getHomeInfo(); | |||
const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO | |||
); | |||
const payload = splitCurrentAndPrevious(dataArr.prodOutputOutDO, dataArr.prodTargetDO,dataArr.prodOutputFtoDO,preData,preFtoData); | |||
commit("SET_HOME_INFO", payload); | |||
}, | |||
/** 初始化驾驶舱数据 */ | |||
@@ -125,6 +126,7 @@ const actions = { | |||
// const payload = handler(factoryData) | |||
// commit("SET_COPILOT_INFO", { type, payload }); | |||
// } else { | |||
console.log('factoryList',factoryList) | |||
let factoryData = factoryList.prodOutputOutDO ? factoryList.prodOutputOutDO : factoryList.prodOutputRateDO | |||
let preData = factoryList.previousProdOutputOutDO ? factoryList.previousProdOutputOutDO : factoryList.previousProdOutputRateDO | |||
let preFtoData = factoryList.previousProdOutputFtoDO ? factoryList.previousProdOutputFtoDO : [] | |||
@@ -19,7 +19,7 @@ | |||
<CopilotButton v-for="i in ['日', '周', '月', '年']" :key="i" :label="i" :active="i === period" | |||
@click="() => $emit('update:period', i)" /> | |||
<div class="btn-group"> | |||
<button type="button" class="export-btn" /> | |||
<!-- <button type="button" class="export-btn" @click="handleExport" /> --> | |||
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']" | |||
@click="toggleFullScreen" /> | |||
<!-- <button class="times-btn"> {{ times }} </button> --> | |||
@@ -31,6 +31,7 @@ | |||
<script> | |||
import CopilotButton from "./button.vue"; | |||
import screenfull from "screenfull"; | |||
import { exportFactoryDataExcel } from "@/api/produceData"; | |||
export default { | |||
name: "CopilotHeader", | |||
@@ -58,6 +59,15 @@ export default { | |||
}, | |||
computed: {}, | |||
methods: { | |||
handleExport() { | |||
exportFactoryDataExcel({ | |||
// factoryId: this.companyId, | |||
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3, | |||
}).then(response => { | |||
this.$download.excel(response, `生产数据.xls`); | |||
// this.exportLoading = false; | |||
}).catch(() => { }); | |||
}, | |||
getTimes() { | |||
setInterval(this.getTimesInterval, 60000); | |||
}, | |||
@@ -7,7 +7,7 @@ | |||
<CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than" | |||
@click="() => $emit('update:than', i)" /> | |||
<div class="btn-group"> | |||
<button type="button" class="export-btn" /> | |||
<button type="button" class="export-btn" @click="handleExport" /> | |||
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']" | |||
@click="toggleFullScreen" /> | |||
</div> | |||
@@ -25,6 +25,8 @@ | |||
import FactorySelect from "./FactorySelect.vue"; | |||
import screenfull from "screenfull"; | |||
import CopilotButton from "./button.vue"; | |||
import { exportFactoryDataExcel } from "@/api/produceData"; | |||
export default { | |||
name: "FactoryDataHeader", | |||
components: { CopilotButton, FactorySelect }, | |||
@@ -55,6 +57,15 @@ export default { | |||
}, | |||
computed: {}, | |||
methods: { | |||
handleExport() { | |||
exportFactoryDataExcel({ | |||
factoryId: this.companyId, | |||
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3, | |||
}).then(response => { | |||
this.$download.excel(response, `${this.companyName}生产数据.xls`); | |||
// this.exportLoading = false; | |||
}).catch(() => { }); | |||
}, | |||
toggleFullScreen() { | |||
this.isFullscreen = !this.isFullscreen; | |||
@@ -1,8 +1,15 @@ | |||
<!-- | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-28 13:42:51 | |||
* @LastEditTime: 2024-05-31 13:26:32 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: button.vue | |||
author: liubin | |||
date: 2024-04-16 15:02:34 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -50,7 +57,7 @@ button { | |||
padding: 12px; | |||
padding-left: 20px; | |||
color: #fff; | |||
font-size: 22px; | |||
font-size: 18px; | |||
letter-spacing: 10px; | |||
cursor: pointer; | |||
} | |||
@@ -1,16 +1,10 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-23 15:49:14 | |||
* @LastEditTime: 2024-05-29 10:56:21 | |||
* @LastEditTime: 2024-05-31 16:06:50 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: BarChartBase.vue | |||
author: liubin | |||
date: 2024-04-10 08:59:28 | |||
description: | |||
--> | |||
<template> | |||
<chart-container class="bar-chart-base"> | |||
@@ -35,7 +35,7 @@ export default { | |||
data() { | |||
return { | |||
page: "产量", | |||
period: "日", | |||
period: "月", | |||
than:'同比', | |||
currentsStyles: '', | |||
}; | |||
@@ -36,7 +36,9 @@ export default { | |||
}, | |||
data() { | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
xAxis: cities, | |||
}; | |||
@@ -1,15 +1,15 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-10 11:10:54 | |||
* @LastEditTime: 2024-05-30 13:23:03 | |||
* @LastEditTime: 2024-05-31 16:19:45 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<div class="chip-rate"> | |||
<ChipRateItem :period="period" :than="than" :cities="['成都', '邯郸', '株洲', '瑞昌']" :color="1" /> | |||
<ChipRateItem :period="period" :than="than" :cities="['佳木斯', '凯盛光伏', '蚌埠兴科']" :color="2" /> | |||
<ChipRateItem :period="period" :than="than" :cities="['邯郸', '瑞昌']" :color="1" /> | |||
<!-- <ChipRateItem :period="period" :than="than" :cities="['佳木斯', '凯盛光伏', '蚌埠兴科']" :color="2" /> --> | |||
</div> | |||
</template> | |||
@@ -43,15 +43,15 @@ export default { | |||
gap: 5px; | |||
position: relative; | |||
&:after { | |||
content: ""; | |||
position: absolute; | |||
left: 50%; | |||
top: 0; | |||
width: 3px; | |||
height: 100%; | |||
transform: translateX(-50%); | |||
background: linear-gradient(to bottom, transparent, #00f2ff, transparent); | |||
} | |||
// &:after { | |||
// content: ""; | |||
// position: absolute; | |||
// left: 50%; | |||
// top: 0; | |||
// width: 3px; | |||
// height: 100%; | |||
// transform: translateX(-50%); | |||
// background: linear-gradient(to bottom, transparent, #00f2ff, transparent); | |||
// } | |||
} | |||
</style> |
@@ -1,21 +1,21 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-07 10:25:10 | |||
* @LastEditTime: 2024-05-30 11:19:51 | |||
* @LastEditTime: 2024-05-31 16:38:29 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<!-- <div class="order"> --> | |||
<div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px"> | |||
<div class="span-2"> | |||
<div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px"> | |||
<!-- <div class="span-2"> | |||
<StdRateItem :period="period" :city="cities[5]" /> | |||
</div> | |||
<div class="flex-item" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name"> | |||
<StdRateItem :period="period" :than="than" :city="item" /> | |||
</div> | |||
</div> --> | |||
<div class="span-2" v-for="item in cities.filter((val, index) => index != 5)" :key="item.name"> | |||
<StdRateItem :period="period" :than="than" :city="item" /> | |||
</div> | |||
</div> | |||
</template> | |||
<script> | |||
@@ -49,8 +49,8 @@ export default { | |||
// break; | |||
// } | |||
const _cities = [ | |||
{ name: "瑞昌", target: 0, total: 0, current: 0, componentYield: 0, goodNumber:0,}, | |||
{ name: "邯郸", target: 0, total: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
{ name: "瑞昌", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
{ name: "邯郸",target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
{ name: "株洲", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
{ name: "佳木斯", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
{ name: "成都", target: 0, previous: 0, current: 0, componentYield: 0, goodNumber: 0, }, | |||
@@ -80,7 +80,10 @@ export default { | |||
} | |||
// 删掉凯盛光伏 | |||
// _cities.splice(4, 1); | |||
return _cities; | |||
let arr = [] | |||
arr.push(_cities[0]) | |||
arr.push(_cities[1]) | |||
return arr; | |||
}, | |||
}, | |||
data() { | |||
@@ -36,7 +36,9 @@ export default { | |||
}, | |||
data() { | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
xAxis: cities, | |||
}; | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-07 13:22:43 | |||
* @LastEditTime: 2024-05-29 14:09:08 | |||
* @LastEditTime: 2024-05-31 15:55:00 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -11,7 +11,7 @@ | |||
<span v-for="(item,index) in legend" :key="index" class="legend-item" | |||
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> | |||
</div> | |||
<div ref="oeeChart" style="height:96%;width:100%"></div> | |||
<div ref="oeeChart" style="height:100%;width:100%"></div> | |||
</chart-container> | |||
</template> | |||
@@ -220,30 +220,30 @@ export default { | |||
this.canvasReset() | |||
}, | |||
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ | |||
isFullscreen(val) { | |||
this.actualOptions.series.map((item) => { | |||
item.barWidth = val ? 18 : 12; | |||
}); | |||
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; | |||
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; | |||
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; | |||
// if (val === false && this.isOpen === true) { | |||
// console.log(val) | |||
// this.width = 97 + '%' | |||
// this.canvasReset() | |||
// } else if (val === false && this.isOpen === false) { | |||
// this.width = 100 + '%' | |||
// this.canvasReset() | |||
// } | |||
// this.actualOptions.series.map((item) => { | |||
// item.barWidth = val ? 18 : 12; | |||
// }); | |||
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; | |||
this.initChart(this.actualOptions) | |||
this.canvasReset() | |||
}, | |||
// isFullscreen(val) { | |||
// this.actualOptions.series.map((item) => { | |||
// item.barWidth = val ? 18 : 12; | |||
// }); | |||
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; | |||
// // if (val === false && this.isOpen === true) { | |||
// // console.log(val) | |||
// // this.width = 97 + '%' | |||
// // this.canvasReset() | |||
// // } else if (val === false && this.isOpen === false) { | |||
// // this.width = 100 + '%' | |||
// // this.canvasReset() | |||
// // } | |||
// // this.actualOptions.series.map((item) => { | |||
// // item.barWidth = val ? 18 : 12; | |||
// // }); | |||
// // this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// // this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// // this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; | |||
// this.initChart(this.actualOptions) | |||
// this.canvasReset() | |||
// }, | |||
series(val) { | |||
if (!val) { | |||
this.initChart(this.options); | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-23 15:50:44 | |||
* @LastEditTime: 2024-05-29 14:25:10 | |||
* @LastEditTime: 2024-05-31 15:54:41 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -11,7 +11,7 @@ | |||
<span v-for="(item,index) in legend" :key="index" class="legend-item" | |||
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> | |||
</div> | |||
<div ref="oeeChart" style="height:96%;width:100%"></div> | |||
<div ref="oeeChart" style="height:100%;width:100%"></div> | |||
</chart-container> | |||
</template> | |||
@@ -241,7 +241,7 @@ export default { | |||
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12; | |||
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12; | |||
this.initChart(this.actualOptions) | |||
// this.initChart(this.actualOptions) | |||
// this.canvasReset() | |||
}, | |||
series(val) { | |||
@@ -79,15 +79,64 @@ export default { | |||
]; | |||
}, | |||
options() { | |||
const single = this.period === "日" || this.period === "周"; | |||
// const single = this.period === "日" || this.period === "周"; | |||
const today = new Date().getDate(); | |||
const year = new Date().getFullYear(); | |||
const month = new Date().getMonth() + 1; | |||
const vt = this.valueTuple; | |||
let titleValue = single | |||
? (vt[1] != null && `${vt[1] * 100}%`) || "0%" | |||
: vt[0] != null && vt[2] != null && vt[2] !== 0 | |||
? `${((vt[1] / vt[2]) * 100).toFixed(0)}%` | |||
: "0%", | |||
let items = []; | |||
var day1 = new Date(); | |||
day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000); | |||
var yesterday = (day1.getMonth() + 1) + "月" + day1.getDate() | |||
//今天的时间 | |||
// var day2 = new Date(); | |||
// day2.setTime(day2.getTime()); | |||
// var s2 = (day2.getMonth() + 1) + "月" + day2.getDate() + '日'; | |||
// const today = new Date().getDate(); | |||
// let yesterday = new Date().getDate() -1; | |||
// 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 === '同比') { | |||
items = [ | |||
{ label: `${month}月${today}日良率`, }, | |||
{ label: `去年${month}月${today}日良率` }, | |||
]; | |||
} else if (this.period === '日' && this.than === '环比') { | |||
items = [ | |||
{ label: `${month}月${today}日良率` }, | |||
{ label: `${yesterday}日良率` }, | |||
]; | |||
} else if (this.period === '周' && this.than === '同比') { | |||
items = [ | |||
{ label: `本周良率`, }, | |||
{ label: `去年本周良率` }, | |||
]; | |||
} else if (this.period === '周' && this.than === '环比') { | |||
items = [ | |||
{ label: `本周良率`, }, | |||
{ label: `上周良率`, }, | |||
]; | |||
} else if (this.period === '月' && this.than === '同比') { | |||
items = [ | |||
{ label: `${month}月良率`, }, | |||
{ label: `去年${month}月良率`, }, | |||
{ label: `${month}月目标良率`, }, | |||
]; | |||
} else if (this.period === '月' && this.than === '环比') { | |||
items = [ | |||
{ label: `${month}月良率`, }, | |||
{ label: `${lastMonth}月良率`, }, | |||
{ label: `${month}月目标良率`, }, | |||
]; | |||
} else { | |||
items = [ | |||
{ label: `${year}年良率`, }, | |||
{ label: `${year - 1}年良率` }, | |||
{ label: `${year}年目标良率` }, | |||
]; | |||
} | |||
let titleValue = vt[1] === null ? 0 + '%' : this.formatNumber(vt[1]) + '%', | |||
subtitle = { | |||
日: "本日良率", | |||
周: "本周良率", | |||
@@ -96,10 +145,12 @@ export default { | |||
}[this.period]; | |||
const t = getOptions({ | |||
single, | |||
// single, | |||
color: this.color == 1 ? "#4CF0E8" : "#1065ff", | |||
titleValue, | |||
subtitle, | |||
currentName: items[0].label, | |||
preName: items[1].label, | |||
previousSum: vt[0], | |||
currentSum: vt[1], | |||
targetSum: vt[2], | |||
@@ -122,41 +173,45 @@ export default { | |||
const year = new Date().getFullYear(); | |||
if (this.period === '日' && this.than === '同比') { | |||
items = [ | |||
{ label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `去年${month}月${today}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `去年${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])) + "%" }, | |||
]; | |||
} else if (this.period === '日' && this.than === '环比') { | |||
items = [ | |||
{ label: `${month}月${today}日良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `${yesterday}日良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ 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])) + "%" }, | |||
]; | |||
} else if (this.period === '周' && this.than === '同比') { | |||
items = [ | |||
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `去年本周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | |||
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
]; | |||
} else if (this.period === '周' && this.than === '环比') { | |||
items = [ | |||
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `上周良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | |||
{ label: `本周良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
]; | |||
} else if (this.period === '月' && this.than === '同比') { | |||
items = [ | |||
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, | |||
{ label: `去年${month}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | |||
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | |||
]; | |||
} else if (this.period === '月' && this.than === '环比') { | |||
items = [ | |||
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, | |||
{ label: `${lastMonth}月良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[0])) + "%" }, | |||
{ label: `${month}月良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
{ label: `${month}月目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | |||
]; | |||
} else { | |||
items = [ | |||
{ label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.valueTuple[1]) + "%" }, | |||
{ label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.valueTuple[0]) + "%" }, | |||
{ label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.valueTuple[2]) + "%" }, | |||
{ label: `${year - 1}年良率`, value: isNaN(this.valueTuple[0]) || this.valueTuple[0] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
{ label: `${year}年良率`, value: isNaN(this.valueTuple[1]) || this.valueTuple[1] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[1])) + "%" }, | |||
{ label: `${year}年目标良率`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, | |||
]; | |||
} | |||
return items | |||
@@ -191,6 +246,15 @@ export default { | |||
}, | |||
}, | |||
methods: { | |||
formatNumber(num) { | |||
// 判断是否为整数 | |||
if (Number.isInteger(num)) { | |||
return num; // 如果是整数,直接转换为字符串 | |||
} else { | |||
// 如果不是整数,保留两位小数并转换为字符串 | |||
return num.toFixed(2); | |||
} | |||
}, | |||
handleCityUpdate(id) { | |||
this.factoryId = id; | |||
}, | |||
@@ -216,14 +280,11 @@ export default { | |||
.chart { | |||
// margin-left: 5%; | |||
// width: 290px; | |||
align-self: stretch; | |||
// flex: 1 1 auto; | |||
// align-items: center; | |||
// margin:0 auto; | |||
// padding: 0 10%;; | |||
flex: 1 1 auto; | |||
padding: 0 15%; | |||
/* margin: 10%; */ | |||
/* min-width: 300px; */ | |||
height: 200px; | |||
align-self: stretch; | |||
} | |||
.legend { | |||
height: 80px; | |||
@@ -1,8 +1,8 @@ | |||
<!-- | |||
<!-- | |||
filename: DoubleRingChart.vue | |||
author: liubin | |||
date: 2024-04-17 11:01:55 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-07 10:04:53 | |||
* @LastEditTime: 2024-05-30 11:13:01 | |||
* @LastEditTime: 2024-05-31 13:19:34 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -1,163 +1,138 @@ | |||
export default function ({ | |||
single = false, | |||
color, | |||
export default ({ | |||
titleValue, | |||
subtitle, | |||
previousSum, | |||
currentSum, | |||
targetSum, | |||
}) { | |||
return { | |||
grid: { | |||
left: 0, | |||
right: 0, | |||
bottom: 0, | |||
top: 0, | |||
containLabel: true, | |||
currentName, | |||
preName, | |||
}) => ({ | |||
grid: { | |||
left: 0, | |||
right: 0, | |||
bottom: 0, | |||
top: 0, | |||
containLabel: true, | |||
}, | |||
tooltip: {}, | |||
title: { | |||
text: titleValue, | |||
left: "44%", | |||
top: "37%", | |||
textAlign: "center", | |||
textStyle: { | |||
fontWeight: 600, | |||
fontSize: 32, | |||
color: "#fffd", | |||
}, | |||
tooltip: { | |||
// formatter(params) { | |||
// return `${params.name}: ${(params.value * 100).toFixed(0)}%`; | |||
// } | |||
subtext: `\u2002${subtitle}\u2002`, | |||
subtextStyle: { | |||
fontSize: 14, | |||
fontWeight: 100, | |||
color: "#fffd", | |||
align: "right", | |||
}, | |||
title: { | |||
text: titleValue, | |||
left: "49%", | |||
top: "39%", | |||
textAlign: "center", | |||
textStyle: { | |||
fontWeight: 600, | |||
fontSize: 32, | |||
color: "#fffd", | |||
}, | |||
subtext: `\u2002${subtitle}\u2002`, | |||
subtextStyle: { | |||
fontSize: 14, | |||
fontWeight: 100, | |||
color: "#fffd", | |||
align: "right", | |||
}, | |||
series: [ | |||
// 背景 series | |||
{ | |||
type: "pie", | |||
name: "当前良率", | |||
radius: ["70%", "85%"], | |||
center: ["45%", "52%"], | |||
emptyCircleStyle: { | |||
color: "#042c5f33", | |||
}, | |||
}, | |||
series: [ | |||
// 背景 series | |||
{ | |||
type: "pie", | |||
name: "当前目标", | |||
radius: ["70%", "85%"], | |||
center: ["50%", "52%"], | |||
emptyCircleStyle: { | |||
color: "#040c5f45", | |||
}, | |||
// 数据 series | |||
{ | |||
type: "pie", | |||
radius: ["70%", "85%"], | |||
center: ["45%", "52%"], | |||
avoidLabelOvervlap: false, | |||
label: { | |||
show: false, | |||
}, | |||
// 数据 series | |||
{ | |||
type: "pie", | |||
radius: ["70%", "85%"], | |||
center: ["50%", "52%"], | |||
avoidLabelOvervlap: false, | |||
label: { | |||
show: false, | |||
}, | |||
labelLine: { | |||
show: false, | |||
}, | |||
data: [ | |||
{ | |||
value: currentSum, | |||
name: "当前良率", | |||
selected: false, | |||
itemStyle: { | |||
borderJoin: "round", | |||
borderCap: "round", | |||
borderWidth: 12, | |||
borderRadius: "50%", | |||
color: { | |||
type: "linear", | |||
x: 1, | |||
y: 0, | |||
x2: 0, | |||
y2: 1, | |||
colorStops: single | |||
? [ | |||
{ offset: 0, color: `${color}11` }, | |||
{ offset: 1, color: `${color}` }, | |||
] | |||
: [ | |||
{ offset: 0, color: "#4CF0E811" }, | |||
{ offset: 1, color: "#4CF0E8" }, | |||
], | |||
}, | |||
labelLine: { | |||
show: false, | |||
}, | |||
data: [ | |||
{ | |||
value: currentSum, | |||
name: currentName, | |||
selected: false, | |||
itemStyle: { | |||
borderJoin: "round", | |||
borderCap: "round", | |||
borderWidth: 12, | |||
borderRadius: "50%", | |||
color: { | |||
type: "linear", | |||
x: 1, | |||
y: 0, | |||
x2: 0, | |||
y2: 1, | |||
colorStops: [ | |||
{ offset: 0, color: "#4CF0E811" }, | |||
{ offset: 1, color: "#4CF0E8" }, | |||
], | |||
}, | |||
}, | |||
{ | |||
value: | |||
targetSum > currentSum | |||
? targetSum - currentSum | |||
: targetSum == 0 | |||
? currentSum == 0 | |||
? 1 | |||
: 0 | |||
: targetSum, | |||
name: "未达成", | |||
itemStyle: { color: "transparent" }, | |||
label: { show: false }, | |||
}, | |||
], | |||
}, | |||
{ | |||
value:currentSum == 0 | |||
? 1 | |||
: 0, | |||
name: "未达成良率", | |||
itemStyle: { color: "transparent" }, | |||
label: { show: false }, | |||
}, | |||
], | |||
}, | |||
// 数据 series2 - 2023累计 | |||
{ | |||
type: "pie", | |||
radius: ["55%", "70%"], | |||
center: ["45%", "52%"], | |||
avoidLabelOvervlap: false, | |||
label: { | |||
show: false, | |||
}, | |||
// 数据 series2 - 2023累计 | |||
single | |||
? null | |||
: { | |||
type: "pie", | |||
radius: ["55%", "70%"], | |||
center: ["50%", "52%"], | |||
avoidLabelOvervlap: false, | |||
label: { | |||
show: false, | |||
}, | |||
labelLine: { | |||
show: false, | |||
labelLine: { | |||
show: false, | |||
}, | |||
data: [ | |||
{ | |||
value: previousSum, | |||
name: preName, | |||
selected: false, | |||
itemStyle: { | |||
borderJoin: "round", | |||
borderCap: "round", | |||
borderWidth: 12, | |||
borderRadius: "50%", | |||
color: { | |||
type: "linear", | |||
x: 1, | |||
y: 0, | |||
x2: 0, | |||
y2: 1, | |||
colorStops: [ | |||
{ offset: 0, color: "#1065ff66" }, | |||
{ offset: 1, color: "#1065ff" }, | |||
], | |||
}, | |||
data: [ | |||
{ | |||
value: previousSum, | |||
name: "上期良率", | |||
selected: false, | |||
itemStyle: { | |||
borderJoin: "round", | |||
borderCap: "round", | |||
borderWidth: 12, | |||
borderRadius: "50%", | |||
color: { | |||
type: "linear", | |||
x: 1, | |||
y: 0, | |||
x2: 0, | |||
y2: 1, | |||
colorStops: [ | |||
{ offset: 0, color: "#1065ff66" }, | |||
{ offset: 1, color: "#1065ff" }, | |||
], | |||
}, | |||
}, | |||
}, | |||
{ | |||
value: | |||
targetSum > previousSum | |||
? targetSum - previousSum | |||
: previousSum == 0 | |||
? 1 | |||
: 0, | |||
name: "-", | |||
formatter: { | |||
show: false | |||
}, | |||
itemStyle: { color: "transparent" }, | |||
label: { show: false }, | |||
}, | |||
], | |||
}, | |||
], | |||
}; | |||
} | |||
}, | |||
{ | |||
value:previousSum == 0 | |||
? 1 | |||
: 0, | |||
name: "-", | |||
itemStyle: { color: "transparent" }, | |||
label: { show: false }, | |||
}, | |||
], | |||
}, | |||
], | |||
}); |
@@ -1,13 +1,13 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-20 16:04:18 | |||
* @LastEditTime: 2024-05-30 11:14:17 | |||
* @LastEditTime: 2024-05-31 13:16:26 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<!-- <div class="copilot-layout" ref="copilot-layout"> --> | |||
<div class="copilot-layout other" ref="copilot-layout"> | |||
<div class="copilot-layout" ref="copilot-layout"> | |||
<CopilotHeaderVue :than="than" :active="page" :period="period" @update:active="updateActive" | |||
@update:period="period = $event" @update:than="updateThan" /> | |||
@@ -34,7 +34,7 @@ export default { | |||
return { | |||
than:'同比', | |||
page: "效率", | |||
period: "日", | |||
period: "月", | |||
currentsStyles: '', | |||
}; | |||
}, | |||
@@ -101,7 +101,7 @@ export default { | |||
position: absolute; | |||
left: -16px; | |||
/* top: -8px; */ | |||
/* height: calc(100% + 38px); */ | |||
height: calc(100% + 240px); | |||
width: calc(100% + 30px); | |||
z-index: 1001; | |||
color: #fff; | |||
@@ -114,7 +114,7 @@ export default { | |||
height: calc(100% + 38px); | |||
} | |||
.other { | |||
height: calc(100% + 240px); | |||
/* height: calc(100% + 240px); */ | |||
} | |||
.copilot-footer { | |||
/** position: absolute; | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-30 08:58:39 | |||
* @LastEditTime: 2024-05-30 10:38:32 | |||
* @LastEditTime: 2024-05-31 15:52:28 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -11,7 +11,7 @@ | |||
<span v-for="(item,index) in legend" :key="index" class="legend-item" | |||
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span> | |||
</div> | |||
<div ref="oeeChart" style="height:96%;width:100%"></div> | |||
<div ref="oeeChart" style="height:100%"></div> | |||
</chart-container> | |||
</template> | |||
@@ -79,7 +79,7 @@ export default { | |||
data: this.xAxis, | |||
}, | |||
yAxis: { | |||
name: "单位/%", | |||
name: "单位/片", | |||
nameTextStyle: { | |||
color: "#fff", | |||
fontSize: 12, | |||
@@ -5,7 +5,7 @@ | |||
</div> | |||
<div class="chart"> | |||
<div class="chart-title"> | |||
<span class="title">生产情况</span> | |||
<span class="title">工单情况</span> | |||
<span class="line"></span> | |||
</div> | |||
<barChartBase :energyCockpits="prodOrder" ref="barChart" style="height: 0;flex:1"></barChartBase> | |||
@@ -23,7 +23,10 @@ export default { | |||
components: { BarChartBase }, | |||
data() { | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
xAxis: cities, | |||
}; | |||
@@ -23,7 +23,10 @@ export default { | |||
components: { BarChartBase }, | |||
data() { | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
xAxis: cities, | |||
}; | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-20 13:32:59 | |||
* @LastEditTime: 2024-05-30 13:35:00 | |||
* @LastEditTime: 2024-05-31 15:05:20 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -151,9 +151,10 @@ export default { | |||
]; | |||
} | |||
let titleValue = | |||
vt[0] != null && vt[2] != null && vt[2] !== 0 | |||
? `${vt[1] / vt[2]}%` | |||
: "0%", | |||
vt[1] != null && vt[2] !== 0 | |||
? this.formatNumber((vt[1] / vt[2] * 100)) + '%' | |||
: (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],) | |||
@@ -196,6 +197,15 @@ export default { | |||
} | |||
}, | |||
methods: { | |||
formatNumber(num) { | |||
// 判断是否为整数 | |||
if (Number.isInteger(num)) { | |||
return num; // 如果是整数,直接转换为字符串 | |||
} else { | |||
// 如果不是整数,保留两位小数并转换为字符串 | |||
return num.toFixed(2); | |||
} | |||
} | |||
// fullscreen mixin 需要的回调 | |||
// fullscreenCallback(isFullscreen) { | |||
// console.log("isFullscreen--->", isFullscreen); | |||
@@ -219,40 +229,40 @@ function calculateItems(period, valueTuple,than) { | |||
const year = new Date().getFullYear(); | |||
if (period === '日' && than === '同比') { | |||
items = [ | |||
{ label: `${month}月${today}日累计`, value: valueTuple[1] }, | |||
{ label: `去年${month}月${today}日累计`, value: valueTuple[0] }, | |||
{ label: `${month}月${today}日累计`, value: valueTuple[1] }, | |||
]; | |||
} else if (period === '日' && than === '环比') { | |||
items = [ | |||
{ label: `${month}月${today}日累计`, value: valueTuple[1] }, | |||
{ label: `${yesterday}日累计`, value: valueTuple[0] }, | |||
{ label: `${month}月${today}日累计`, value: valueTuple[1] }, | |||
]; | |||
} else if (period === '周' && than === '同比') { | |||
items = [ | |||
{ label: `本周累计`, value: valueTuple[1] }, | |||
{ label: `去年本周累计`, value: valueTuple[0] }, | |||
{ label: `本周累计`, value: valueTuple[1] }, | |||
]; | |||
} else if (period === '周' && than === '环比') { | |||
items = [ | |||
{ label: `本周累计`, value: valueTuple[1] }, | |||
{ label: `上周累计`, value: valueTuple[0] }, | |||
{ label: `本周累计`, value: valueTuple[1] }, | |||
]; | |||
} else if (period === '月' && than === '同比') { | |||
items = [ | |||
{ label: `${month}月累计`, value: valueTuple[1] }, | |||
{ label: `去年${month}月累计`, value: valueTuple[0] }, | |||
{ label: `${month}月累计`, value: valueTuple[1] }, | |||
{ label: `${month}月目标`, value: valueTuple[2] }, | |||
]; | |||
} else if (period === '月' && than === '环比') { | |||
items = [ | |||
{ label: `${month}月累计`, value: valueTuple[1] }, | |||
{ label: `${lastMonth}月累计`, value: valueTuple[0] }, | |||
{ label: `${month}月累计`, value: valueTuple[1] }, | |||
{ label: `${month}月目标`, value: valueTuple[2] }, | |||
]; | |||
} else { | |||
items = [ | |||
{ label: `${year}年累计`, value: valueTuple[1] }, | |||
{ label: `${year - 1}年累计`, value: valueTuple[0] }, | |||
{ label: `${year}年累计`, value: valueTuple[1] }, | |||
{ label: `${year}年目标`, value: valueTuple[2] }, | |||
]; | |||
} | |||
@@ -314,17 +324,17 @@ function calculateItems(period, valueTuple,than) { | |||
left: -18px; | |||
} | |||
.legend-item:nth-child(1) .legend-item__label::before { | |||
.legend-item:nth-child(2) .legend-item__label::before { | |||
background: #12fff5; | |||
} | |||
.legend-item:nth-child(1) .legend-item__value { | |||
.legend-item:nth-child(2) .legend-item__value { | |||
color: #12fff5; | |||
} | |||
.legend-item:nth-child(2) .legend-item__label::before { | |||
.legend-item:nth-child(1) .legend-item__label::before { | |||
background: #0f65ff; | |||
} | |||
.legend-item:nth-child(2) .legend-item__value { | |||
.legend-item:nth-child(1) .legend-item__value { | |||
color: #0f65ff; | |||
} | |||
@@ -1,3 +1,10 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-30 16:00:50 | |||
* @LastEditTime: 2024-05-31 16:15:51 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: DoubleRingWrapper.vue | |||
author: liubin | |||
@@ -42,13 +49,13 @@ export default { | |||
return { | |||
factoryId: 4, // 默认成都 | |||
cityOptions: [ | |||
"成都", | |||
// "成都", | |||
"邯郸", | |||
"株洲", | |||
// "株洲", | |||
"瑞昌", | |||
"佳木斯", | |||
"凯盛光伏", | |||
"蚌埠兴科", | |||
// "佳木斯", | |||
// "凯盛光伏", | |||
// "蚌埠兴科", | |||
], | |||
}; | |||
}, | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-05-24 15:15:00 | |||
* @LastEditTime: 2024-05-28 08:42:36 | |||
* @LastEditTime: 2024-05-31 16:16:16 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -54,12 +54,12 @@ export default { | |||
return { | |||
factoryId: 4, // 默认成都 | |||
cityOptions: [ | |||
"成都", | |||
// "成都", | |||
"邯郸", | |||
"株洲", | |||
"佳木斯", | |||
"凯盛光伏", | |||
"蚌埠兴科", | |||
// "株洲", | |||
// "佳木斯", | |||
// "凯盛光伏", | |||
// "蚌埠兴科", | |||
], | |||
}; | |||
}, | |||
@@ -80,15 +80,9 @@ export default ({ | |||
}, | |||
}, | |||
{ | |||
value: | |||
targetSum > currentSum | |||
? targetSum - currentSum | |||
: targetSum == 0 | |||
? currentSum == 0 | |||
? 1 | |||
: 0 | |||
value:currentSum == 0 | |||
? 1 | |||
: 0, | |||
name: "未达成累计", | |||
itemStyle: { color: "transparent" }, | |||
label: { show: false }, | |||
@@ -131,10 +125,7 @@ export default ({ | |||
}, | |||
}, | |||
{ | |||
value: | |||
targetSum > previousSum | |||
? targetSum - previousSum | |||
: previousSum == 0 | |||
value:previousSum == 0 | |||
? 1 | |||
: 0, | |||
name: "-", | |||
@@ -1,8 +1,15 @@ | |||
<!-- | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-28 13:42:51 | |||
* @LastEditTime: 2024-05-31 16:14:09 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: Bipv.vue | |||
author: liubin | |||
date: 2024-04-10 15:39:54 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -24,7 +31,10 @@ export default { | |||
data() { | |||
const year = new Date().getFullYear(); | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
legend: [ | |||
{ label: `${year}年目标值`, color: "#f3c000" }, | |||
@@ -1,8 +1,8 @@ | |||
<!-- | |||
<!-- | |||
filename: chip-invest.vue | |||
author: liubin | |||
date: 2024-04-10 08:59:28 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -23,7 +23,9 @@ export default { | |||
data() { | |||
const year = new Date().getFullYear(); | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
legend: [ | |||
{ label: `${year - 1}年`, color: "#12f7f1" }, | |||
@@ -1,8 +1,8 @@ | |||
<!-- | |||
<!-- | |||
filename: ChipYield.vue | |||
author: liubin | |||
date: 2024-04-11 10:46:47 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -11,24 +11,24 @@ | |||
<section class="right-part"> | |||
<div class="yield-location"> | |||
<section class="btn-group"> | |||
<button | |||
<!-- <button | |||
@click="activeLoc = '1'" | |||
:class="activeLoc === '1' ? 'active' : ''" | |||
> | |||
成都 | |||
</button> | |||
</button> --> | |||
<button | |||
@click="activeLoc = '2'" | |||
:class="activeLoc === '2' ? 'active' : ''" | |||
> | |||
邯郸 | |||
</button> | |||
<button | |||
<!-- <button | |||
@click="activeLoc = '3'" | |||
:class="activeLoc === '3' ? 'active' : ''" | |||
> | |||
株洲 | |||
</button> | |||
</button> --> | |||
<button | |||
@click="activeLoc = '4'" | |||
:class="activeLoc === '4' ? 'active' : ''" | |||
@@ -37,7 +37,7 @@ | |||
</button> | |||
</section> | |||
<section class="btn-group"> | |||
<button | |||
<!-- <button | |||
@click="activeLoc = '5'" | |||
:class="activeLoc === '5' ? 'active' : ''" | |||
class="fixwidth" | |||
@@ -55,7 +55,7 @@ | |||
:class="activeLoc === '7' ? 'active' : ''" | |||
> | |||
蚌埠兴科 | |||
</button> | |||
</button> --> | |||
</section> | |||
</div> | |||
<div class="yield-summary"> | |||
@@ -85,13 +85,14 @@ export default { | |||
props: {}, | |||
data() { | |||
return { | |||
activeLoc: "1", | |||
activeLoc: "2", | |||
}; | |||
}, | |||
computed: { | |||
output() { | |||
// ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"] | |||
const chipOutput = this.$store.getters.home.chipOutput; | |||
console.log('chipOutput', chipOutput); | |||
if ( | |||
!chipOutput || | |||
!chipOutput.target || | |||
@@ -1,8 +1,15 @@ | |||
<!-- | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-28 13:42:51 | |||
* @LastEditTime: 2024-05-31 16:11:56 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: ChipYield.vue | |||
author: liubin | |||
date: 2024-04-11 10:46:47 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -1,8 +1,15 @@ | |||
<!-- | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-28 13:42:51 | |||
* @LastEditTime: 2024-05-31 16:11:06 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: fto.vue | |||
author: liubin | |||
date: 2024-04-10 08:59:28 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -23,7 +30,9 @@ export default { | |||
data() { | |||
const year = new Date().getFullYear(); | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
legend: [ | |||
{ label: `${year - 1}年`, color: "#12f7f1" }, | |||
@@ -1,8 +1,8 @@ | |||
<!-- | |||
<!-- | |||
filename: left-chart-base | |||
author: liubin | |||
date: 2024-04-10 08:59:28 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -113,6 +113,16 @@ export default { | |||
barWidth: 12, | |||
itemStyle: { | |||
borderRadius: [10, 10, 0, 0], | |||
normal: { | |||
label: { | |||
show: true, //开启显示 | |||
position: 'top', //在上方显示 | |||
textStyle: { //数值样式 | |||
color: '#DFF1FE', | |||
fontSize: 16 | |||
} | |||
} | |||
}, | |||
color: { | |||
type: "linear", | |||
x: 0, | |||
@@ -146,11 +156,6 @@ export default { | |||
name: '', // this.series[1].name, | |||
type: "bar", | |||
barWidth: 12, | |||
// tooltip: { | |||
// valueFormatter: function (value) { | |||
// return value + " ml"; | |||
// }, | |||
// }, | |||
itemStyle: { | |||
borderRadius: [10, 10, 0, 0], | |||
color: { | |||
@@ -1,8 +1,15 @@ | |||
<!-- | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-28 13:42:51 | |||
* @LastEditTime: 2024-05-31 16:13:47 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<!-- | |||
filename: right-chart-base | |||
author: liubin | |||
date: 2024-04-10 08:59:28 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -1,8 +1,8 @@ | |||
<!-- | |||
<!-- | |||
filename: Bipv.vue | |||
author: liubin | |||
date: 2024-04-10 15:39:54 | |||
description: | |||
description: | |||
--> | |||
<template> | |||
@@ -25,7 +25,9 @@ export default { | |||
data() { | |||
const year = new Date().getFullYear(); | |||
// 城市数组的顺序必须是固定的 | |||
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; | |||
const cities = ["瑞昌", "邯郸", | |||
// "株洲", "佳木斯", "成都", "凯盛", "蚌埠" | |||
]; | |||
return { | |||
legend: [ | |||
{ label: `${year}年目标值`, color: "#f3c000" }, | |||
@@ -1,18 +1,18 @@ | |||
<template> | |||
<div class="dashboard-factory-all"> | |||
<div id="map-container"> | |||
<div v-if="visible" class="cdLine"></div> | |||
<div v-if="visible" class="zzLine"></div> | |||
<!-- <div v-if="visible" class="cdLine"></div> --> | |||
<!-- <div v-if="visible" class="zzLine"></div> --> | |||
<div v-if="visible" class="rcLine"></div> | |||
<div v-if="visible" class="rcLineTwo"></div> | |||
<div v-if="visible" class="hdLine"></div> | |||
<div v-if="visible" class="hdLineTwo"></div> | |||
<div v-if="visible" class="ksLine"></div> | |||
<div v-if="visible" class="bbLine"></div> | |||
<div v-if="visible" class="bbLineTwo"></div> | |||
<div v-if="visible" class="bbLineThree"></div> | |||
<div v-if="visible" class="jmsLine"></div> | |||
<div v-if="visible" class="jmsLineTwo"></div> | |||
<!-- <div v-if="visible" class="ksLine"></div> --> | |||
<!-- <div v-if="visible" class="bbLine"></div> --> | |||
<!-- <div v-if="visible" class="bbLineTwo"></div> --> | |||
<!-- <div v-if="visible" class="bbLineThree"></div> --> | |||
<!-- <div v-if="visible" class="jmsLine"></div> --> | |||
<!-- <div v-if="visible" class="jmsLineTwo"></div> --> | |||
<div class="databoard"> | |||
<db-header class="db-header"></db-header> | |||
<div class="db-body"> | |||
@@ -61,19 +61,19 @@ import StdChart from "./dashboard/charts/StdChart.vue"; | |||
const LOCATIONS = [ | |||
// 佳木斯 | |||
{ x: 67, y: 20, tx: 60, ty: 29, path: 'copilot/jmsIndex' }, | |||
// { x: 67, y: 20, tx: 60, ty: 29, path: 'factoryData/jmsIndex' }, | |||
// 成都 | |||
{ x: 46, y: 56,tx:46,ty:93, path: 'copilot/cdIndex' }, | |||
// { x: 46, y: 56, tx: 46, ty: 93, path: 'factoryData/cdIndex' }, | |||
// 蚌埠1 | |||
{ x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'copilot/bbIndex' }, | |||
// { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'factoryData/bbIndex' }, | |||
// 蚌埠2 | |||
{ x: 61, y: 53,tx:39,ty:68, path: 'copilot/ksIndex' }, | |||
// { x: 61, y: 53, tx: 39, ty: 68, path: 'factoryData/ksIndex' }, | |||
// 江西 瑞昌 | |||
{ x: 60, y: 58, tx: 68, ty: 52, path: 'copilot/factory-data' }, | |||
{ x: 60, y: 58, tx: 68, ty: 52, path: 'factoryData/factory-data' }, | |||
// 湖南 株洲 | |||
{ x: 56, y: 60, tx: 60, ty: 95, path: 'copilot/zzIndex' }, | |||
// { x: 56, y: 60, tx: 60, ty: 95, path: 'factoryData/zzIndex' }, | |||
// 邯郸 | |||
{ x: 58, y: 45, tx: 47, ty: 34, path: 'copilot/hdIndex' }, | |||
{ x: 58, y: 45, tx: 47, ty: 34, path: 'factoryData/hdIndex' }, | |||
]; | |||
export default { | |||
@@ -213,39 +213,41 @@ export default { | |||
{ label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) }, | |||
], | |||
}; | |||
if (position === LOCATIONS[0]) { | |||
templateInfo.companyName = "佳木斯中建材"; | |||
this.jmsHintPosition = position; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest.current[3]; | |||
templateInfo.items[2].value = this.homeStore.chipInvest.current[3]; | |||
templateInfo.items[1].value = this.homeStore.chipOutput.current[3]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[3]; | |||
this.jmsInfo = templateInfo; | |||
} else if (position === LOCATIONS[1]) { | |||
this.cdHintPosition = position; | |||
templateInfo.companyName = "成都中建材"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4]; | |||
templateInfo.items[2].value = this.homeStore.chipInvest.current[4]; | |||
templateInfo.items[1].value = this.homeStore.chipOutput.current[4]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[4]; | |||
this.cdInfo = templateInfo; | |||
} else if (position === LOCATIONS[2]) { | |||
this.bbHintPosition = position; | |||
templateInfo.companyName = "蚌埠兴科"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6]; | |||
templateInfo.items[2].value = this.homeStore.chipInvest.current[6]; | |||
templateInfo.items[1].value = this.homeStore.chipOutput?.current[6]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[6]; | |||
this.bbInfo = templateInfo; | |||
} else if (position === LOCATIONS[3]) { | |||
this.ksHintPosition = position; | |||
templateInfo.companyName = "凯盛光伏"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5]; | |||
templateInfo.items[2].value = this.homeStore.chipInvest.current[5]; | |||
templateInfo.items[1].value = this.homeStore.chipOutput.current[5]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[5]; | |||
this.ksInfo = templateInfo; | |||
} else if (position === LOCATIONS[4]) { | |||
if | |||
// (position === LOCATIONS[0]) { | |||
// templateInfo.companyName = "佳木斯中建材"; | |||
// this.jmsHintPosition = position; | |||
// templateInfo.items[0].value = this.homeStore.ftoInvest.current[3]; | |||
// templateInfo.items[2].value = this.homeStore.chipInvest.current[3]; | |||
// templateInfo.items[1].value = this.homeStore.chipOutput.current[3]; | |||
// templateInfo.items[3].value = this.homeStore.stdOutput.current[3]; | |||
// this.jmsInfo = templateInfo; | |||
// } else if (position === LOCATIONS[1]) { | |||
// this.cdHintPosition = position; | |||
// templateInfo.companyName = "成都中建材"; | |||
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4]; | |||
// templateInfo.items[2].value = this.homeStore.chipInvest.current[4]; | |||
// templateInfo.items[1].value = this.homeStore.chipOutput.current[4]; | |||
// templateInfo.items[3].value = this.homeStore.stdOutput.current[4]; | |||
// this.cdInfo = templateInfo; | |||
// } else if (position === LOCATIONS[2]) { | |||
// this.bbHintPosition = position; | |||
// templateInfo.companyName = "蚌埠兴科"; | |||
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6]; | |||
// templateInfo.items[2].value = this.homeStore.chipInvest.current[6]; | |||
// templateInfo.items[1].value = this.homeStore.chipOutput?.current[6]; | |||
// templateInfo.items[3].value = this.homeStore.stdOutput.current[6]; | |||
// this.bbInfo = templateInfo; | |||
// } else if (position === LOCATIONS[3]) { | |||
// this.ksHintPosition = position; | |||
// templateInfo.companyName = "凯盛光伏"; | |||
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5]; | |||
// templateInfo.items[2].value = this.homeStore.chipInvest.current[5]; | |||
// templateInfo.items[1].value = this.homeStore.chipOutput.current[5]; | |||
// templateInfo.items[3].value = this.homeStore.stdOutput.current[5]; | |||
// this.ksInfo = templateInfo; | |||
// } | |||
(position === LOCATIONS[0]) { | |||
this.rcHintPosition = position; | |||
templateInfo.companyName = "瑞昌中建材"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0]; | |||
@@ -253,15 +255,15 @@ export default { | |||
templateInfo.items[1].value = this.homeStore.chipOutput.current[0]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[0]; | |||
this.info = templateInfo; | |||
} else if (position === LOCATIONS[5]) { | |||
this.zzHintPosition = position; | |||
templateInfo.companyName = "株洲中建材"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2]; | |||
templateInfo.items[2].value = this.homeStore.chipInvest.current[2]; | |||
templateInfo.items[1].value = this.homeStore.chipOutput.current[2]; | |||
templateInfo.items[3].value = this.homeStore.stdOutput.current[2]; | |||
this.zzInfo = templateInfo; | |||
} else if (position === LOCATIONS[6]) { | |||
// } else if (position === LOCATIONS[5]) { | |||
// this.zzHintPosition = position; | |||
// templateInfo.companyName = "株洲中建材"; | |||
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2]; | |||
// templateInfo.items[2].value = this.homeStore.chipInvest.current[2]; | |||
// templateInfo.items[1].value = this.homeStore.chipOutput.current[2]; | |||
// templateInfo.items[3].value = this.homeStore.stdOutput.current[2]; | |||
// this.zzInfo = templateInfo; | |||
} else if (position === LOCATIONS[1]) { | |||
this.hdHintPosition = position; | |||
templateInfo.companyName = "邯郸中建材"; | |||
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1]; | |||