修改bug

This commit is contained in:
‘937886381’ 2024-04-25 18:50:58 +08:00
parent ef3f5d3fe7
commit be83c8196e
2 changed files with 21 additions and 20 deletions

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-04-25 09:02:38
* @LastEditTime: 2024-04-25 18:24:31
* @Description:
-->
<template>
@ -298,11 +298,11 @@ export default {
// equipmentList:[],
EnergyMonitoringList: [],
eqConfig: {
header: ['序号', '设备名称', '产线名', '设备状态'],
header: ['序号', '产线名', '设备名称', '设备状态'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [70, 130, 240, 120],
columnWidth: [70, 150, 200, 120],
align: ['center'],
data: [],
// index:true,
@ -462,8 +462,8 @@ export default {
name: ele.name,
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :'',
planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan)) : '',
actualQuantity: ele.actualQuantity ?this.getStr(String(ele.actualQuantity)) : '',
planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan,6)) : '',
actualQuantity: ele.actualQuantity ?this.getStr(String(ele.actualQuantity,6)) : '',
};
}
});
@ -483,10 +483,9 @@ export default {
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`,
// formatDate(item.planStartTime) || '',
`
`<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''}</span>`,`
<span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0'}"></div> ${item.status || ''}</span>`,
]);
this.eqConfig.data = eqArr;
@ -566,9 +565,9 @@ export default {
// removeEventListener('resize', resizeFun)
// },
methods: {
getStr(str) {
getStr(str,num) {
//
if (str.length > 6) { //10...
if (str.length > num) { //10...
str = str.substr(0, 6) + "..." //10...
return str
} else {
@ -744,11 +743,11 @@ export default {
if (ele.progressRate && ele.progressRate != 1) {
return {
id: ele.id,
name: ele.name,
name: this.getStr(String(ele.name,8)),
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :null,
planQuantity: ele.planQuantity ? '计划' + ele.planQuantity + '片' : null,
actualQuantity: ele.actualQuantity ? ele.actualQuantity + '片' : null,
specifications: ele.specifications ? '规格' + ele.specifications : '',
planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan,6)) : '',
actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity,6)) : '',
};
}
});

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-25 17:13:49
* @LastEditTime: 2024-04-25 18:50:41
* @LastEditors: zhp
* @Description:
-->
@ -129,7 +129,7 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'checkTime',
defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime(), new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000],
defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000, new Date(new Date(Date.now().setHours(6, 59, 59))).getTime()],
width: 350
},
{
@ -167,8 +167,8 @@ export default {
created() { },
mounted() {
// this.formConfig[1].defaultSelect[]
this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime()
this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000
this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList()
this.getDict()
@ -357,8 +357,10 @@ export default {
// this.listQuery.materialId = val.materialId ? val.materialId : undefined;
// this.listQuery.startTime = '1706144404000';
// this.listQuery.endTime = '1706230804000';
this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() : undefined;
this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000 : undefined;
// this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
// this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000 : undefined;
this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() : undefined;
this.listQuery.lineId = val.lineId ? val.lineId : undefined
this.getDataList();
break;