修改接口

master
夜笙歌 9 months ago
parent 3a1e2a4d17
commit 548efde455

@ -546,18 +546,17 @@ export default {
{
e: 'fp-1-05',
i: "SCADA_INV_STATS_01('')",
t:2,
t: 2,
f: (e) => {
console.log(JSON.stringify(e))
let table = e.map(val => {
return {
value1: val.EQUIPMENT_CODE,
value2: val.FIXTUREBOXTYPE,
value3: val.FIXTURESTATUS,
value4: val.TARGET,
value5: val.PLAN_SUM,
value5: val.TARGET * 11,
value6: val.PRO_SUM,
value7: (val.PLAN_SUM === 0 ? 0 : ((val.PRO_SUM / val.PLAN_SUM) * 100).toFixed(2)) + '%',
value7: (val.TARGET === 0 ? 0 : ((val.PRO_SUM / (val.TARGET*11)) * 100).toFixed(2)) + '%',
value8: val.ANHOUR,
value9: val.TWOHOUR,
value10: val.THREEHOUR,
@ -573,12 +572,12 @@ export default {
}
})
this.scrollTableData1 = table
let totalArr = table
let totalArr = table.slice(this.show*6,(this.show+1)*6)
this.total = {
value1: ((totalArr.filter(val => val.value3 === '生产中').length / 6) * 100).toFixed(2),
value2: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0),
value3: totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0),
value4: totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0) === 0 ? 0 : ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value4).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2),
value4: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0) === 0 ? 0 : ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2),
value5: totalArr.map(val => val.value8).reduce((acc, curr) => acc + curr, 0),
value6: totalArr.map(val => val.value9).reduce((acc, curr) => acc + curr, 0),
value7: totalArr.map(val => val.value10).reduce((acc, curr) => acc + curr, 0),
@ -830,7 +829,7 @@ export default {
splitLine: {
show: true,
lineStyle: {
color: "rgba(255,255,255,0.1)",
color: ['#c20f0f',"rgba(255,255,255,0.1)","rgba(255,255,255,0.1)",'#c20f0f'],
},
},
axisLine: {
@ -840,7 +839,13 @@ export default {
show: true,
margin: 20,
textStyle: {
color: "#d1e6eb",
color: (e) => {
if (e === '18' || e === '24') {
return '#c20f0f'
} else {
return '#d1e6eb'
}
}
},
},
axisTick: {
@ -1171,7 +1176,6 @@ export default {
e: 'fp-2-05',
i: "SCADA_INV_STATS_02('')",
f: (e) => {
console.log(e)
let table = e.map(val => {
return {
value1: val.EQUIPMENT_CODE,
@ -1180,7 +1184,7 @@ export default {
value4: val.TARGET,
value5: val.PLAN_SUM,
value6: val.PRO_SUM,
value7: (val.PLAN_SUM === 0 ? 0 : ((val.PRO_SUM / val.PLAN_SUM) * 100).toFixed(2)) + '%',
value7: (val.TARGET === 0 ? 0 : ((val.PRO_SUM / (val.TARGET*11)) * 100).toFixed(2)) + '%',
value8: val.ANHOUR,
value9: val.TWOHOUR,
value10: val.THREEHOUR,
@ -1196,7 +1200,7 @@ export default {
}
})
this.scrollTableData1 = table
let totalArr = table
let totalArr = table.slice(this.show*6,(this.show+1)*6)
this.total = {
value1: ((totalArr.filter(val => val.value3 === '生产中').length / 6) * 100).toFixed(2),
value2: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0),
@ -1454,7 +1458,7 @@ export default {
splitLine: {
show: true,
lineStyle: {
color: "rgba(255,255,255,0.1)",
color: ['#c20f0f',"rgba(255,255,255,0.1)","rgba(255,255,255,0.1)",'#c20f0f'],
},
},
axisLine: {
@ -1464,7 +1468,13 @@ export default {
show: true,
margin: 20,
textStyle: {
color: "#d1e6eb",
color: (e) => {
if (e === '18' || e === '24') {
return '#c20f0f'
} else {
return '#d1e6eb'
}
}
},
},
axisTick: {
@ -1697,6 +1707,26 @@ export default {
num = num % num1
this.show = num
let totalArr = this.scrollTableData1.slice(num*6,(num+1)*6)
this.total = {
value1: ((totalArr.filter(val => val.value3 === '生产中').length / 6) * 100).toFixed(2),
value2: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0),
value3: totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0),
value4: totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0) === 0 ? 0 : ((totalArr.map(val => val.value6).reduce((acc, curr) => acc + curr, 0) / totalArr.map(val => val.value5).reduce((acc, curr) => acc + curr, 0)) * 100).toFixed(2),
value5: totalArr.map(val => val.value8).reduce((acc, curr) => acc + curr, 0),
value6: totalArr.map(val => val.value9).reduce((acc, curr) => acc + curr, 0),
value7: totalArr.map(val => val.value10).reduce((acc, curr) => acc + curr, 0),
value8: totalArr.map(val => val.value11).reduce((acc, curr) => acc + curr, 0),
value9: totalArr.map(val => val.value12).reduce((acc, curr) => acc + curr, 0),
value10: totalArr.map(val => val.value13).reduce((acc, curr) => acc + curr, 0),
value11: totalArr.map(val => val.value14).reduce((acc, curr) => acc + curr, 0),
value12: totalArr.map(val => val.value15).reduce((acc, curr) => acc + curr, 0),
value13: totalArr.map(val => val.value16).reduce((acc, curr) => acc + curr, 0),
value14: totalArr.map(val => val.value17).reduce((acc, curr) => acc + curr, 0),
value15: totalArr.map(val => val.value18).reduce((acc, curr) => acc + curr, 0),
value16: totalArr.map(val => val.value19).reduce((acc, curr) => acc + curr, 0),
}
}, 30 * 1000)
if (this.$route.query.id === '1' || this.id === '1') {
this.RequestDataSet.forEach(val => {
@ -1731,7 +1761,6 @@ export default {
},
methods: {},
beforeDestroy() {
console.log(1)
if (intervalFun) {
clearInterval(intervalFun)
intervalFun = null

Loading…
Cancel
Save