This commit is contained in:
lb
2023-09-25 15:47:39 +08:00
parent 56f209a27e
commit bbbfa9644d
10 changed files with 296 additions and 43 deletions

View File

@@ -55,7 +55,10 @@
</div>
<div class="graph-grid">
<div class="bg-grid grid-line">
<div class="grid-item" v-for="item in list.length" :key="item"></div>
<div
class="grid-item"
v-for="item in list.length"
:key="item"></div>
</div>
<div class="bg-grid grid-charts">
@@ -253,7 +256,7 @@ export default {
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'recordTime',
param: 'timerange',
},
{
parent: 'dateFilterType',
@@ -264,7 +267,7 @@ export default {
placeholder: '选择日期',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
param: 'recordTime',
param: 'timeday',
},
],
},
@@ -383,22 +386,18 @@ export default {
if (btnName == 'search') {
this.queryParams.factoryId = payload.factoryId || null;
this.queryParams.lineId = payload.lineId || null;
if (payload.recordTime != null) {
if (typeof payload.recordTime == 'string') {
if (payload.recordTime.trim() !== '') {
this.queryParams.recordTime = [
`${payload.recordTime} 00:00:00`,
`${payload.recordTime} 23:59:59`,
];
}
} else {
this.queryParams.recordTime = payload.recordTime;
}
} else {
this.queryParams.recordTime = null;
if (0 == payload.dateFilterType) {
this.queryParams.recordTime = payload.timerange;
} else if (1 == payload.dateFilterType) {
this.queryParams.recordTime = [
`${payload.timeday} 00:00:00`,
`${payload.timeday} 23:59:59`,
];
}
this.getList();
} else {
this.queryParams.recordTime = null;
}
this.getList();
},
cancel() {

View File

@@ -37,8 +37,14 @@ export default {
option() {
const opt = [];
this.list.map((eq) => {
/** [设备名, ok数量, 不ok数量] */
opt.push([eq.equipmentName, eq.okQuantity, eq.nokQuantity]);
/** [设备名, ok数量, 不ok数量, 加工数量, 合格率] */
opt.push([
eq.equipmentName,
eq.okQuantity,
eq.nokQuantity,
eq.totalQuantity,
eq.passRate.toFixed(2),
]);
});
return {
color: ['#288AFF', '#8EF0AB'],
@@ -51,7 +57,7 @@ export default {
legend: {
itemWidth: 12,
itemHeight: 12,
right: 0
right: 0,
},
grid: {
left: '1%',
@@ -104,6 +110,17 @@ export default {
stack: 's',
data: opt.map((item) => item[2]),
},
{
name: '加工数量',
type: 'bar',
barWidth: 20,
data: opt.map((item) => item[3]),
},
{
name: '合格率',
type: 'line',
data: opt.map((item) => item[4]),
},
],
};
},