update 质量管理,产品成品率

This commit is contained in:
lb 2022-11-21 15:40:16 +08:00
parent 6df938da04
commit 4297d5c804
2 changed files with 143 additions and 61 deletions

View File

@ -184,7 +184,7 @@
<techy-box class="" style="padding: calc(16px * var(--beilv));"> <techy-box class="" style="padding: calc(16px * var(--beilv));">
<techy-analysis-header>产品成品率</techy-analysis-header> <techy-analysis-header>产品成品率</techy-analysis-header>
<div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"> <div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
<new-line-stack :data-update-token="dataUpdateToken" /> <new-line-stack :data-update-token="dataUpdateToken" :mode="dateMode2" />
</div> </div>
<div class="date-select"> <div class="date-select">
<span <span

View File

@ -10,6 +10,11 @@ export default {
name: 'PlFaultAnalysisPieChart', name: 'PlFaultAnalysisPieChart',
mixins: [resize], mixins: [resize],
props: { props: {
mode: {
type: String,
default: '',
validator: val => ['month', 'day'].indexOf(val) !== -1
},
dataUpdateToken: { dataUpdateToken: {
type: String, type: String,
default: 'default-token' default: 'default-token'
@ -37,25 +42,28 @@ export default {
bottom: '5%', bottom: '5%',
containLabel: true containLabel: true
}, },
xAxis: [ xAxis: {
{ type: 'category',
type: 'category', boundaryGap: false,
boundaryGap: false, axisLine: {
axisLine: { lineStyle: {
lineStyle: { color: '#ffffff66'
color: '#ffffff66' }
} },
axisTick: { show: false },
axisLabel: {
textStyle: {
fontSize: 10,
color: '#fff8' //
}, },
axisTick: { show: false }, margin: 12
axisLabel: { },
textStyle: { data:
color: 'rgba(255,255,255,1)' // this.mode === 'month'
}, ? [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
margin: 12 : ['A', 'B', 'C', 'D', 'E', 'F', 'G']
}, },
data: ['A', 'B', 'C', 'D', 'E', 'F', 'G']
}
],
yAxis: [ yAxis: [
{ {
name: '成品率', name: '成品率',
@ -120,13 +128,24 @@ export default {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [11, 199, 140, 63, 185, 5, 78].map(_ => { data:
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
}, },
{ {
name: '磨边机', name: '磨边机',
@ -157,13 +176,24 @@ export default {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [151, 57, 31, 7, 77, 88, 119].map(_ => { data:
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
}, },
{ {
name: '镀膜机', name: '镀膜机',
@ -194,13 +224,24 @@ export default {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [58, 3, 67, 100, 42, 96, 124].map(_ => { data:
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
}, },
{ {
name: '包装纸', name: '包装纸',
@ -231,13 +272,24 @@ export default {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [92, 88, 122, 169, 108, 130, 147].map(_ => { data:
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
}, },
{ {
name: '丝印', name: '丝印',
@ -272,13 +324,24 @@ export default {
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: [44, 40, 118, 197, 123, 95, 96].map(_ => { data:
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
} }
] ]
} }
@ -308,15 +371,34 @@ export default {
}, },
methods: { methods: {
refreshData() { refreshData() {
// update xaxis
this.configs.xAxis.data =
this.mode === 'month'
? [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
: ['A', 'B', 'C', 'D', 'E', 'F', 'G']
// update series
this.configs.series.forEach(item => { this.configs.series.forEach(item => {
item.data = [44, 40, 118, 197, 123, 95, 96].map(_ => { item.data =
let v = Math.floor(Math.random() * 100) this.mode === 'month'
while (v < 80) { ? Array(30)
v = Math.floor(Math.random() * 100) .fill(1)
} .map(_ => {
return v let v = Math.floor(Math.random() * 100)
}) while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
: [11, 199, 140, 63, 185, 5, 78].map(_ => {
let v = Math.floor(Math.random() * 100)
while (v < 80) {
v = Math.floor(Math.random() * 100)
}
return v
})
}) })
if (this.chart) this.chart.setOption(this.configs) if (this.chart) this.chart.setOption(this.configs)
} }
} }