修改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 {
@@ -743,12 +742,12 @@ export default {
this.orderList = this.SJGWsData.detData.map((ele, index) => {
if (ele.progressRate && ele.progressRate != 1) {
return {
id: ele.id,
name: ele.name,
id: ele.id,
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)) : '',
};
}
});