diff --git a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue index eea8a76..60f37e4 100644 --- a/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue +++ b/src/views/copilot/efficiency/components/sub/chip/ChipRateItem.vue @@ -65,13 +65,13 @@ export default { valueTuple() { const getter = this.chipRate; // console.log(getter) - if (this.period === "日" || this.period === "周") { - return [ - getter.previous[this.factoryId], - getter.current[this.factoryId], - 0, - ]; - } + // if (this.period === "日" || this.period === "周") { + // return [ + // getter.previous[this.factoryId], + // getter.current[this.factoryId], + // 0, + // ]; + // } // [100, 200, 200] return [ getter.previous[this.factoryId], @@ -105,21 +105,25 @@ export default { items = [ { label: `${yesterday}日良率`, }, { label: `${year - 1}年${yesterday}日良率` }, + { label: `${yesterday}日目标` }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ { label: `${yesterday}日良率` }, { label: `${dayBeYes}日良率` }, + { label: `${yesterday}日目标` }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ { label: `本周良率`, }, - { label: `${year-1}年本周良率` }, + { label: `${year - 1}年本周良率` }, + { label: `本周目标`, }, ]; } else if (this.period === '周' && this.than === '环比') { items = [ { label: `本周良率`, }, { label: `上周良率`, }, + { label: `本周目标`, }, ]; } else if (this.period === '月' && this.than === '同比') { items = [ @@ -182,22 +186,25 @@ export default { items = [ { 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])) + "%" }, + { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, ]; } else if (this.period === '日' && this.than === '环比') { items = [ { 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])) + "%" }, + { label: `${yesterday}日目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, ]; } else if (this.period === '周' && this.than === '同比') { items = [ { label: `${year-1}年本周良率`, 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])) + "%" }, - + { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, ]; } else if (this.period === '周' && this.than === '环比') { items = [ { 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])) + "%" }, + { label: `本周目标`, value: isNaN(this.valueTuple[2]) || this.valueTuple[2] == null ? 0 + "%" : (this.formatNumber(this.valueTuple[2])) + "%" }, ]; } else if (this.period === '月' && this.than === '同比') { items = [ diff --git a/src/views/copilot/yield/options/double-ring-chart-options.js b/src/views/copilot/yield/options/double-ring-chart-options.js index 2768b60..6d9d3a3 100644 --- a/src/views/copilot/yield/options/double-ring-chart-options.js +++ b/src/views/copilot/yield/options/double-ring-chart-options.js @@ -17,7 +17,7 @@ export default ({ tooltip: {}, title: { text: titleValue, - left: "44%", + left: "48%", top: "37%", textAlign: "center", textStyle: { @@ -39,7 +39,7 @@ export default ({ type: "pie", name: "当前目标", radius: ["80%", "90%"], - center: ["45%", "52%"], + center: ["50%", "52%"], emptyCircleStyle: { color: "#042c5f33", }, @@ -48,7 +48,7 @@ export default ({ { type: "pie", radius: ["80%", "90%"], - center: ["45%", "52%"], + center: ["50%", "52%"], avoidLabelOvervlap: false, label: { show: false, @@ -97,7 +97,7 @@ export default ({ { type: "pie", radius: ["70%", "80%"], - center: ["45%", "52%"], + center: ["50%", "52%"], avoidLabelOvervlap: false, label: { show: false, diff --git a/src/views/report/components/produceLineBarTarget.vue b/src/views/report/components/produceLineBarTarget.vue index 53bf2bd..aca2d24 100644 --- a/src/views/report/components/produceLineBarTarget.vue +++ b/src/views/report/components/produceLineBarTarget.vue @@ -1,7 +1,7 @@ @@ -51,7 +51,7 @@ export default { }, }, formatter: function (params) { - // console.log('params', params); + console.log('params', params.data) var res = `${params[0].axisValueLabel}`; for (var i = 0, l = params.length; i < l; i++) { res += @@ -59,12 +59,12 @@ export default { `` + `${params[i].seriesName}` + `${params[i].seriesName === "综合良率" - ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" + ? (params[i].data.titleValue ? params[i].data.titleValue.toFixed(2) : 0.0) + "%" : params[i].seriesName === "转化效率" - ? (params[i].value ? params[i].value.toFixed(2) : 0.0) + "%" + ? (params[i].data.titleValue ? params[i].data.titleValue.toFixed(2) : 0.0) + "%" : params[i].seriesName.search('总功率') != -1 - ? (params[i].value ? params[i].value : 0) + "MW" - : (params[i].value ? params[i].value : 0) + "片" + ? (params[i].data.titleValue ? params[i].data.titleValue : 0) + "MW" + : (params[i].data.titleValue ? params[i].data.titleValue : 0) + "片" }`; } return res; diff --git a/src/views/report/components/produceLineYieldBarTarget.vue b/src/views/report/components/produceLineYieldBarTarget.vue index 75a816d..bb49779 100644 --- a/src/views/report/components/produceLineYieldBarTarget.vue +++ b/src/views/report/components/produceLineYieldBarTarget.vue @@ -1,7 +1,7 @@ @@ -51,7 +51,7 @@ export default { }, }, formatter: function (params) { - console.log('params', params) + // console.log('params', params) let arr = [] var res = ``; // for (var i = 0, l = params.length; i < l; i++) { diff --git a/src/views/report/produceConversion.vue b/src/views/report/produceConversion.vue index 05af8b0..2c8b3f7 100644 --- a/src/views/report/produceConversion.vue +++ b/src/views/report/produceConversion.vue @@ -175,6 +175,14 @@ export default { { type: "value", name: "单位/MW", + // splitNumber: 5, + min: function (value) {//取最小值向下取整为最小刻度 + return 0 + }, + max: function (value) {//取最大值向上取整为最大刻度 + return Math.ceil(value.max) + }, + alignTicks: true, nameTextStyle: { fontSize: 12, align: "right", @@ -183,7 +191,13 @@ export default { }, { type: 'value', + alignTicks: true, + min: 0, + max: 100, + // scale: true, + interval: 25,//间隔 // inverse: true, + splitNumber: 5, name: "单位/%", nameTextStyle: { fontSize: 12, @@ -235,7 +249,7 @@ export default { type: "value", name: "单位/片", min: function (value) {//取最小值向下取整为最小刻度 - return Math.floor(value.min) + return 0 }, max: function (value) {//取最大值向上取整为最大刻度 return Math.ceil(value.max) @@ -258,8 +272,8 @@ export default { min: 0, max: 100, // scale: true, - interval: 20,//间隔 - // splitNumber: 8, + interval: 25,//间隔 + // splitNumber: 5, nameTextStyle: { fontSize: 12, align: "right", diff --git a/src/views/report/productionSituationMW.vue b/src/views/report/productionSituationMW.vue index 912c4d3..c38df8c 100644 --- a/src/views/report/productionSituationMW.vue +++ b/src/views/report/productionSituationMW.vue @@ -222,9 +222,10 @@ export default { xData: [], yName: "单位/MW", yAxis: { + show: true, type: "value", name: "单位/MW", - show: true, + // splitNumber: 4, nameTextStyle: { fontSize: 12, align: "right", @@ -239,10 +240,10 @@ export default { color: ["#8EF0AB", "#288AFF"], xData: [], yName: "单位/MW", - yAxis: - { + yAxis:{ type: "value", name: "单位/MW", + // splitNumber: 4, nameTextStyle: { fontSize: 12, align: "right", @@ -257,7 +258,7 @@ export default { barWidth: 20, label: { show: true, - position: [-40, -16], + position: [-30, -16], color: "#68C483", formatter: function (params) { return params.value @@ -523,6 +524,10 @@ export default { }) this.chartMsg.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 this.chartMsgTarget.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 + this.chartMsg.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 + this.chartMsgTarget.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 + this.chartMsg.yAxis.interval = (this.chartMsg.yAxis.max - this.chartMsg.yAxis.min) / 4 + this.chartMsgTarget.yAxis.interval = (this.chartMsgTarget.yAxis.max - this.chartMsgTarget.yAxis.min) / 4 if (this.listQuery.type === 2) { // res.data.list.forEach((ele) => { @@ -564,98 +569,19 @@ export default { let arr = [] let chip = [] let std = [] + let obj = {} + let targetObj = {} res.data.list.slice(res.data.list.length - 3, res.data.list.length - 1).forEach((ele, index) => { console.log(ele.titleValue.search('目标')); // let i = index + 1 // this.chartMsgTarget.xData.push(ele.titleValue) ele.productionSituationPowerDataVOList.forEach((item) => { if (ele.titleValue.search('目标') != -1) { - chip.push({ - name: "芯片总功率目标值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片总功率目标值", value: item.chipTotalPower }, - // { name: '芯片总功率目标值', value: 22 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131,.5)", - formatter: function (params) { - return params.value - }, - }, - },) - std.push({ - name: "标准组件总功率目标值", - stack: 'b', - data: [ - { name: "标准组件总功率目标值", value: item.componentTotalPower }, - // { name: '标准组件总功率目标值', value: 23 }, - - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(40,138,255,.5)", - formatter: function (params) { - return params.value - }, - }, - }) + targetObj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower + targetObj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower } else { - chip.unshift({ - name: "芯片总功率完成值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片总功率完成值", value: item.chipTotalPower }, - // { name: '芯片总功率完成值', value: 55 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131)", - formatter: function (params) { - return params.value - }, - }, - },) - std.unshift({ - name: "标准组件总功率完成值", - stack: 'b', - data: [ - { name: "标准组件总功率完成值", value: item.componentTotalPower }, - // { name: '标准组件总功率完成值', value: 23 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(40,138,255)", - formatter: function (params) { - return params.value - }, - }, - }) + obj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower + obj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower } // this.chartMsgTarget.series[1].data.push() @@ -663,6 +589,88 @@ export default { // this.chartMsgTarget.series[3].data.push() }) }) + chip.push({ + name: "芯片总功率完成值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片总功率完成值", value: obj.chipTotalPower, titleValue: obj.chipTotalPower }, + // { name: '芯片总功率完成值', value: 55 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "芯片总功率目标值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片总功率目标值", value: (targetObj.chipTotalPower - obj.chipTotalPower) > 0 ? (targetObj.chipTotalPower - obj.chipTotalPower) : null, titleValue: targetObj.chipTotalPower }, + // { name: '芯片总功率目标值', value: 22 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131,.5)", + formatter: function (params) { + return params.value + }, + }, + }) + std.push({ + name: "标准组件总功率完成值", + stack: 'b', + data: [ + { name: "标准组件总功率完成值", value: obj.componentTotalPower,titleValue:obj.componentTotalPower }, + // { name: '标准组件总功率完成值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(40,138,255)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "标准组件总功率目标值", + stack: 'b', + data: [ + { name: "标准组件总功率目标值", value: (targetObj.componentTotalPower - obj.componentTotalPower) > 0 ? (targetObj.componentTotalPower - obj.componentTotalPower) : null, titleValue: targetObj.componentTotalPower }, + // { name: '标准组件总功率目标值', value: 23 }, + + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(40,138,255,.5)", + formatter: function (params) { + return params.value + }, + }, + }) console.log('arr', chip,std) this.chartMsgTarget.series = [...chip, ...std] // arr.forEach((ele) => { @@ -724,99 +732,19 @@ export default { let arr = [] let chip = [] let std = [] - console.log(' res.data.list.slice(res.data.list.length - 1, res.data.list.length)', res.data.list.slice(res.data.list.length - 2, res.data.list.length)); + let obj = {} + let targetObj = {} res.data.list.slice(res.data.list.length - 2, res.data.list.length).forEach((ele, index) => { console.log(ele.titleValue.search('目标')); // let i = index + 1 // this.chartMsgTarget.xData.push(ele.titleValue) ele.productionSituationPowerDataVOList.forEach((item) => { if (ele.titleValue.search('目标') != -1) { - chip.push({ - name: "芯片总功率目标值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片总功率目标值", value: item.componentTotalPower }, - // { name: '芯片总功率目标值', value: 22 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131,.5)", - formatter: function (params) { - return params.value - }, - }, - },) - std.push({ - name: "标准组件总功率目标值", - stack: 'b', - data: [ - { name: "标准组件总功率目标值", value: item.componentTotalPower }, - // { name: '标准组件总功率目标值', value: 23 }, - - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(40,138,255,.5)", - formatter: function (params) { - return params.value - }, - }, - }) + targetObj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower + targetObj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower } else { - chip.unshift({ - name: "芯片总功率完成值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片总功率完成值", value: item.componentTotalPower }, - // { name: '芯片总功率完成值', value: 55 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131)", - formatter: function (params) { - return params.value - }, - }, - },) - std.unshift({ - name: "标准组件总功率完成值", - stack: 'b', - data: [ - { name: "标准组件总功率完成值", value: item.componentTotalPower }, - // { name: '标准组件总功率完成值', value: 23 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(40,138,255)", - formatter: function (params) { - return params.value - }, - }, - }) + obj.chipTotalPower = item.chipTotalPower === 0 ? null : item.chipTotalPower + obj.componentTotalPower = item.componentTotalPower === 0 ? null : item.componentTotalPower } // this.chartMsgTarget.series[1].data.push() @@ -824,9 +752,90 @@ export default { // this.chartMsgTarget.series[3].data.push() }) }) - console.log('arr', arr) - this.chartMsgTarget.series = [...chip,...std] - console.log(this.chartMsg.xData) + chip.push({ + name: "芯片总功率完成值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片总功率完成值", value: obj.chipTotalPower, titleValue: obj.chipTotalPower }, + // { name: '芯片总功率完成值', value: 55 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "芯片总功率目标值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片总功率目标值", value: (targetObj.chipTotalPower - obj.chipTotalPower) > 0 ? (targetObj.chipTotalPower - obj.chipTotalPower) : null, titleValue: targetObj.chipTotalPower }, + // { name: '芯片总功率目标值', value: 22 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131,.5)", + formatter: function (params) { + return params.value + }, + }, + }) + std.push({ + name: "标准组件总功率完成值", + stack: 'b', + data: [ + { name: "标准组件总功率完成值", value: obj.componentTotalPower, titleValue: obj.componentTotalPower }, + // { name: '标准组件总功率完成值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(40,138,255)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "标准组件总功率目标值", + stack: 'b', + data: [ + { name: "标准组件总功率目标值", value: (targetObj.componentTotalPower - obj.componentTotalPower) > 0 ? (targetObj.componentTotalPower - obj.componentTotalPower) : null, titleValue: targetObj.componentTotalPower }, + // { name: '标准组件总功率目标值', value: 23 }, + + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(40,138,255,.5)", + formatter: function (params) { + return params.value + }, + }, + }) + console.log('arr', chip, std) + this.chartMsgTarget.series = [...chip, ...std] } else { res.data.list.forEach((ele, index) => { this.chartMsg.xData.push(ele.titleValue) diff --git a/src/views/report/productionSituationTablets.vue b/src/views/report/productionSituationTablets.vue index 6f51023..ad9a172 100644 --- a/src/views/report/productionSituationTablets.vue +++ b/src/views/report/productionSituationTablets.vue @@ -180,6 +180,7 @@ export default { type: "value", name: "单位/片", show: true, + splitNumber: 5, nameTextStyle: { fontSize: 12, align: "right", @@ -210,7 +211,7 @@ export default { barWidth: 20, label: { show: true, - position: [-18, -16], + position: [0, -16], color: "#288AFF", formatter: function (params) { return params.value @@ -225,7 +226,7 @@ export default { barWidth: 20, label: { show: true, - position: [0, -16], + position: [18, -16], color: "#64BDFF", formatter: function (params) { return params.value @@ -239,7 +240,7 @@ export default { barWidth: 20, label: { show: true, - position: [0, -16], + position: [20, -16], color: "#7164FF", formatter: function (params) { return params.value @@ -263,7 +264,7 @@ export default { // max: function (value) {//取最大值向上取整为最大刻度 // return Math.ceil(value.max) // }, - scale: true, + splitNumber: 4, nameTextStyle: { fontSize: 12, align: "right", @@ -283,11 +284,11 @@ export default { fontSize: 12, align: "right", }, - scale: true, + // scale: true, // min: function (value) {//取最小值向下取整为最小刻度 // return Math.floor(value.min) // }, - splitNumber: 5, + splitNumber: 4, // max: function (value) {//取最大值向上取整为最大刻度 // return Math.ceil(value.max) // }, @@ -317,7 +318,7 @@ export default { barWidth: 20, label: { show: true, - position: [10, -16], + position: [0, -16], color: "#288AFF", formatter: function (params) { return params.value @@ -332,7 +333,7 @@ export default { barWidth: 20, label: { show: true, - position: [0, -16], + position: [5, -16], color: "#64BDFF", formatter: function (params) { return params.value @@ -660,6 +661,11 @@ export default { }) this.chartMsg.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 this.chartMsgTarget.yAxis.max = Math.ceil(Math.max(...maxData) / 100) * 100 + this.chartMsg.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 + this.chartMsgTarget.yAxis.min = Math.ceil(Math.min(...maxData) / 100) * 100 + this.chartMsg.yAxis.interval = (this.chartMsg.yAxis.max - this.chartMsg.yAxis.min) / 4 + this.chartMsgTarget.yAxis.interval = (this.chartMsgTarget.yAxis.max - this.chartMsgTarget.yAxis.min) / 4 + // ele.titleValue // .push({ // label: ele.titleValue, @@ -718,198 +724,198 @@ export default { let chip = [] let std = [] let bipv = [] - + let targetObj = {} + let obj = {} res.data.list.slice(res.data.list.length - 3, res.data.list.length - 1).forEach((ele, index) => { console.log("ele",ele.titleValue); // let i = index + 1 // this.chartMsgTarget.xData.push(ele.titleValue) if (ele.titleValue.search('完成') == -1) { ele.productionSituationDataVOList.forEach((item) => { - console.log(item); - // if (ele.titleValue.search('目标') != -1) { - fto.push({ - name: "FTO投入目标值", - data: [ - // s - { name: 'FTO投入目标', value: item.ftoInput }, - // { name: 'FTO投入目标值', value: 11 }, - // { name: "%", value: 85 }, - // { name: "%", value: 85 }, - ], - type: "bar", - barWidth: 20, - stack: 'f', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131,.3)", - formatter: function (params) { - return params.value - }, - }, - },) - chip.push({ - name: "芯片产量目标值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片产量目标值", value: item.chipYield }, - // { name: '芯片产量目标值', value: 22 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(40,138,255,.2)", - formatter: function (params) { - return params.value - }, - }, - },) - std.push({ - name: "标准组件产量目标值", - stack: 'b', - data: [ - { name: "标准组件产量目标值", value: item.componentYield }, - // { name: '标准组件产量目标值', value: 23 }, - - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(100,189,255,.3)", - formatter: function (params) { - return params.value - }, - }, - }) - bipv.push(this.currentMenu == '瑞昌' ? null : - { - name: "BIPV产量目标值", - stack: 'c', - data: [ - { name: "BIPV产量目标值", value: item.bipvProductOutput }, - // { name: 'BIPV产量目标值', value: 24 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(113,100,255,.2)", - formatter: function (params) { - return params.value - }, - }, - },) - // } else { - // } - }) + targetObj.ftoInput = item.ftoInput + targetObj.chipYield = item.chipYield + targetObj.componentYield = item.componentYield + targetObj.bipvProductOutput = this.currentMenu == '瑞昌' ? null : item.bipvProductOutput + }) console.log("fto",ele.titleValue,fto); } else { ele.productionSituationDataVOList.forEach((item) => { - console.log(item); + obj.ftoInput = item.ftoInput + obj.chipYield = item.chipYield + obj.componentYield = item.componentYield + obj.bipvProductOutput = this.currentMenu == '瑞昌' ? null : item.bipvProductOutput // if (ele.titleValue.search('目标') != -1) { // } else { - fto.unshift({ - name: "FTO投入完成值", - data: [ - // s - { name: 'FTO投入完成值', value: item.ftoInput }, - // { name: 'FTO投入完成值', value: 33 }, - // { name: "%", value: 85 }, - // { name: "%", value: 85 }, - ], - type: "bar", - barWidth: 20, - stack: 'f', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131)", - formatter: function (params) { - return params.value - }, - }, - }) - chip.unshift({ - name: "芯片产量完成值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片产量完成值", value: item.chipYield }, - // { name: '芯片产量完成值', value: 55 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - color: "rgba(40,138,255)", - position: [-18, -16], - formatter: function (params) { - return params.value - }, - }, - },) - std.unshift({ - name: "标准组件产量完成值", - stack: 'b', - data: [ - { name: "标准组件产量完成值", value: item.componentYield }, - // { name: '标准组件产量完成值', value: 23 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - color: "rgba(100,189,255)", - show: true, - position: [0, -16], - formatter: function (params) { - return params.value - }, - }, - }) - bipv.unshift(this.currentMenu == '瑞昌' ? null : - { - name: "BIPV产量完成值", - stack: 'c', - data: [ - { name: "BIPV产量完成值", value: item.bipvProductOutput }, - // { name: 'BIPV产量完成值', value: 32 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(113,100,255)", - formatter: function (params) { - return params.value - }, - }, - },) - // } + }) } }) + fto.push({ + name: "FTO投入完成值", + data: [ + // s + { name: 'FTO投入完成值', value: obj.ftoInput,titleValue: obj.ftoInput }, + // { name: 'FTO投入完成值', value: 33 }, + // { name: "%", value: 85 }, + // { name: "%", value: 85 }, + ], + type: "bar", + barWidth: 20, + stack: 'f', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "FTO投入目标值", + data: [ + // s + { name: 'FTO投入目标', value: (targetObj.ftoInput - obj.ftoInput) > 0 ? (targetObj.ftoInput - obj.ftoInput) : null, titleValue: targetObj.ftoInput }, + // { name: 'FTO投入目标值', value: 11 }, + // { name: "%", value: 85 }, + // { name: "%", value: 85 }, + ], + type: "bar", + barWidth: 20, + stack: 'f', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131,.3)", + formatter: function (params) { + return params.value + }, + }, + }) + chip.push({ + name: "芯片产量完成值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片产量完成值", value: obj.chipYield, titleValue: obj.chipYield }, + // { name: '芯片产量完成值', value: 55 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + color: "rgba(40,138,255)", + position: [-18, -16], + formatter: function (params) { + return params.value + }, + }, + }, { + name: "芯片产量目标值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片产量目标值", value: (targetObj.chipYield - obj.chipYield) > 0 ? (targetObj.chipYield - obj.chipYield) : null, titleValue: targetObj.chipYield }, + // { name: '芯片产量目标值', value: 22 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(40,138,255,.2)", + formatter: function (params) { + return params.value + }, + }, + }) + std.push({ + name: "标准组件产量完成值", + stack: 'b', + data: [ + { name: "标准组件产量完成值", value: obj.componentYield, titleValue: obj.componentYield }, + // { name: '标准组件产量完成值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + color: "rgba(100,189,255)", + show: true, + position: [0, -16], + formatter: function (params) { + return params.value + }, + }, + }, { + name: "标准组件产量目标值", + stack: 'b', + data: [ + { name: "标准组件产量目标值", value: (targetObj.componentYield - obj.componentYield) > 0 ? (targetObj.componentYield - obj.componentYield) : null, titleValue: targetObj.componentYield }, + // { name: '标准组件产量目标值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(100,189,255,.3)", + formatter: function (params) { + return params.value + }, + }, + }) + bipv.push(this.currentMenu == '瑞昌' ? null : + { + name: "BIPV产量完成值", + stack: 'c', + data: [ + { name: "BIPV产量完成值", value: obj.bipvProductOutput, titleValue: obj.bipvProductOutput }, + // { name: 'BIPV产量完成值', value: 32 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(113,100,255)", + formatter: function (params) { + return params.value + }, + }, + }, this.currentMenu == '瑞昌' ? null : + { + name: "BIPV产量目标值", + stack: 'c', + data: [ + { name: "BIPV产量目标值", value: (targetObj.bipvProductOutput - obj.bipvProductOutput) > 0 ? (targetObj.bipvProductOutput - obj.bipvProductOutput) : null, titleValue: targetObj.bipvProductOutput }, + // { name: 'BIPV产量目标值', value: 24 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(113,100,255,.2)", + formatter: function (params) { + return params.value + }, + }, + },) + // } this.chartMsgTarget.series = [...fto, ...chip, ...std, ...bipv] console.log('arr', this.chartMsgTarget.series) // arr.forEach((ele) => { @@ -994,199 +1000,196 @@ export default { let chip = [] let std = [] let bipv = [] - + let targetObj = {} + let obj = {} res.data.list.slice(res.data.list.length - 2, res.data.list.length).forEach((ele, index) => { - // console.log("ele", ele.titleValue); + console.log("ele", ele.titleValue); // let i = index + 1 // this.chartMsgTarget.xData.push(ele.titleValue) + ele.productionSituationDataVOList.forEach((item) => { if (ele.titleValue.search('完成') == -1) { - console.log(ele); - ele.productionSituationDataVOList.forEach((item) => { - console.log(item); - // if (ele.titleValue.search('目标') != -1) { - fto.push({ - name: "FTO投入目标值", - data: [ - // s - { name: 'FTO投入目标', value: item.ftoInput }, - // { name: 'FTO投入目标值', value: 11 }, - // { name: "%", value: 85 }, - // { name: "%", value: 85 }, - ], - type: "bar", - barWidth: 20, - stack: 'f', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131,.3)", - formatter: function (params) { - return params.value - }, - }, - },) - chip.push({ - name: "芯片产量目标值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片产量目标值", value: item.chipYield }, - // { name: '芯片产量目标值', value: 22 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - position: [-18, -16], - color: "rgba(40,138,255,.2)", - formatter: function (params) { - return params.value - }, - }, - },) - std.push({ - name: "标准组件产量目标值", - stack: 'b', - data: [ - { name: "标准组件产量目标值", value: item.componentYield }, - // { name: '标准组件产量目标值', value: 23 }, - - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(100,189,255,.3)", - formatter: function (params) { - return params.value - }, - }, - }) - bipv.push(this.currentMenu == '瑞昌' ? null : - { - name: "BIPV产量目标值", - stack: 'c', - data: [ - { name: "BIPV产量目标值", value: item.bipvProductOutput }, - // { name: 'BIPV产量目标值', value: 24 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(113,100,255,.2)", - formatter: function (params) { - return params.value - }, - }, - },) - // } else { - // } - }) - + targetObj.ftoInput = item.ftoInput + targetObj.chipYield = item.chipYield + targetObj.componentYield = item.componentYield + targetObj.bipvProductOutput = this.currentMenu == '瑞昌' ? null : item.bipvProductOutput + console.log("fto", ele.titleValue, fto); } else { - ele.productionSituationDataVOList.forEach((item) => { - console.log(item); + + obj.ftoInput = item.ftoInput + obj.chipYield = item.chipYield + obj.componentYield = item.componentYield + obj.bipvProductOutput = this.currentMenu == '瑞昌' ? null : item.bipvProductOutput // if (ele.titleValue.search('目标') != -1) { // } else { - fto.unshift({ - name: "FTO投入完成值", - data: [ - // s - { name: 'FTO投入完成值', value: item.ftoInput }, - // { name: 'FTO投入完成值', value: 33 }, - // { name: "%", value: 85 }, - // { name: "%", value: 85 }, - ], - type: "bar", - barWidth: 20, - stack: 'f', - label: { - show: true, - position: [-18, -16], - color: "rgba(104,196,131)", - formatter: function (params) { - return params.value - }, - }, - }) - chip.unshift({ - name: "芯片产量完成值", - // barGap: '-100%', - stack: 'a', - data: [ - { name: "芯片产量完成值", value: item.chipYield }, - // { name: '芯片产量完成值', value: 55 }, - // { name: "%", value: 21.66 }, - // { name: "%", value: 18.4 }, - ], - type: "bar", - barWidth: 20, - // barGap: '-100%', - label: { - show: true, - color: "rgba(40,138,255)", - position: [-18, -16], - formatter: function (params) { - return params.value - }, - }, - },) - std.unshift({ - name: "标准组件产量完成值", - stack: 'b', - data: [ - { name: "标准组件产量完成值", value: item.componentYield }, - // { name: '标准组件产量完成值', value: 23 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - color: "rgba(100,189,255)", - show: true, - position: [0, -16], - formatter: function (params) { - return params.value - }, - }, - }) - bipv.unshift(this.currentMenu == '瑞昌' ? null : - { - name: "BIPV产量完成值", - stack: 'c', - data: [ - { name: "BIPV产量完成值", value: item.bipvProductOutput }, - // { name: 'BIPV产量完成值', value: 32 }, - // { name: "%", value: 7.02 }, - // { name: "%", value: 80.2 }, - ], - type: "bar", - barWidth: 20, - label: { - show: true, - position: [0, -16], - color: "rgba(113,100,255)", - formatter: function (params) { - return params.value - }, - }, - },) - // } - }) } + }) }) + fto.push({ + name: "FTO投入完成值", + data: [ + // s + { name: 'FTO投入完成值', value: obj.ftoInput, titleValue: obj.ftoInput }, + // { name: 'FTO投入完成值', value: 33 }, + // { name: "%", value: 85 }, + // { name: "%", value: 85 }, + ], + type: "bar", + barWidth: 20, + stack: 'f', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131)", + formatter: function (params) { + return params.value + }, + }, + }, { + name: "FTO投入目标值", + data: [ + // s + { name: 'FTO投入目标', value: (targetObj.ftoInput - obj.ftoInput) > 0 ? (targetObj.ftoInput - obj.ftoInput) : null, titleValue: targetObj.ftoInput }, + // { name: 'FTO投入目标值', value: 11 }, + // { name: "%", value: 85 }, + // { name: "%", value: 85 }, + ], + type: "bar", + barWidth: 20, + stack: 'f', + label: { + show: true, + position: [-18, -16], + color: "rgba(104,196,131,.3)", + formatter: function (params) { + return params.value + }, + }, + }) + chip.push({ + name: "芯片产量完成值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片产量完成值", value: obj.chipYield, titleValue: obj.chipYield }, + // { name: '芯片产量完成值', value: 55 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + color: "rgba(40,138,255)", + position: [-18, -16], + formatter: function (params) { + return params.value + }, + }, + }, { + name: "芯片产量目标值", + // barGap: '-100%', + stack: 'a', + data: [ + { name: "芯片产量目标值", value: (targetObj.chipYield - obj.chipYield) > 0 ? (targetObj.chipYield - obj.chipYield) : null, titleValue: targetObj.chipYield }, + // { name: '芯片产量目标值', value: 22 }, + // { name: "%", value: 21.66 }, + // { name: "%", value: 18.4 }, + ], + type: "bar", + barWidth: 20, + // barGap: '-100%', + label: { + show: true, + position: [-18, -16], + color: "rgba(40,138,255,.2)", + formatter: function (params) { + return params.value + }, + }, + }) + std.push({ + name: "标准组件产量完成值", + stack: 'b', + data: [ + { name: "标准组件产量完成值", value: obj.componentYield, titleValue: obj.componentYield }, + // { name: '标准组件产量完成值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + color: "rgba(100,189,255)", + show: true, + position: [0, -16], + formatter: function (params) { + return params.value + }, + }, + }, { + name: "标准组件产量目标值", + stack: 'b', + data: [ + { name: "标准组件产量目标值", value: (targetObj.componentYield - obj.componentYield) > 0 ? (targetObj.componentYield - obj.componentYield) : null, titleValue: targetObj.componentYield }, + // { name: '标准组件产量目标值', value: 23 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(100,189,255,.3)", + formatter: function (params) { + return params.value + }, + }, + }) + bipv.push(this.currentMenu == '瑞昌' ? null : + { + name: "BIPV产量完成值", + stack: 'c', + data: [ + { name: "BIPV产量完成值", value: obj.bipvProductOutput, titleValue: obj.bipvProductOutput }, + // { name: 'BIPV产量完成值', value: 32 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(113,100,255)", + formatter: function (params) { + return params.value + }, + }, + }, this.currentMenu == '瑞昌' ? null : + { + name: "BIPV产量目标值", + stack: 'c', + data: [ + { name: "BIPV产量目标值", value: (targetObj.bipvProductOutput - obj.bipvProductOutput) > 0 ? (targetObj.bipvProductOutput - obj.bipvProductOutput) : null, titleValue: targetObj.bipvProductOutput }, + // { name: 'BIPV产量目标值', value: 24 }, + // { name: "%", value: 7.02 }, + // { name: "%", value: 80.2 }, + ], + type: "bar", + barWidth: 20, + label: { + show: true, + position: [0, -16], + color: "rgba(113,100,255,.2)", + formatter: function (params) { + return params.value + }, + }, + },) + // } this.chartMsgTarget.series = [...fto, ...chip, ...std, ...bipv] } else { res.data.list.forEach((ele, index) => { @@ -1234,10 +1237,6 @@ export default { // console.log(this.dataArr) // console.log(this.tableData); // this.$nextTick(() => { - console.log(this.chartMsg.series) - this.$refs.dayChart.getMes() - this.$refs.dayTargetChart.getMes() - this.$refs.chartYearTarget.getMes() this.tableData = this.dataArr this.showTable = !this.showTable // }) diff --git a/src/views/report/productionYield.vue b/src/views/report/productionYield.vue index 8a25ee1..ba434e5 100644 --- a/src/views/report/productionYield.vue +++ b/src/views/report/productionYield.vue @@ -173,6 +173,14 @@ export default { { type: "value", name: "单位/片", + splitNumber: 4, + min: function (value) {//取最小值向下取整为最小刻度 + return Math.floor(value.min) + }, + max: function (value) {//取最大值向上取整为最大刻度 + return Math.ceil(value.max) + }, + alignTicks: true, nameTextStyle: { fontSize: 12, align: "right", @@ -182,6 +190,12 @@ export default { { type: 'value', // inverse: true, + alignTicks: true, + min: 0, + max: 100, + // scale: true, + interval: 25,//间隔 + splitNumber: 4, name: "单位/%", nameTextStyle: { fontSize: 12, @@ -239,7 +253,7 @@ export default { return Math.ceil(value.max) }, alignTicks:true, - // splitNumber: 5, + splitNumber: 4, scale: true, nameTextStyle: { fontSize: 12, @@ -251,13 +265,12 @@ export default { type: 'value', // inverse: true, name: "单位/%", - scale: true, alignTicks: true, min: 0, max:100, // scale: true, - interval: 20,//间隔 - // splitNumber: 8, + interval: 25,//间隔 + splitNumber: 4, nameTextStyle: { fontSize: 12, align: "right",