修改接口

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

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

Loading…
Cancel
Save