You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
785 B

2 years ago
export default {
data() {
return {
stationData: uni.getStorageSync('_pro_stations') || [{stationName: ''}]
}
},
created() {
},
methods: {
itemStateClass(code) {
// 状态映射内容
const errorCode = ['2', '4', '6']
const warnCode = ['8', '10', '11', '12', '13', '14', '15']
const successCode = ['1']
const stateObj = {
z1: {
clas: 'z1',
text: '运行'
},
z2: {
clas: 'z2',
text: '停机'
},
z3: {
clas: 'z3',
text: '故障'
},
z4: {
clas: 'z4',
text: '不在线'
}
}
const zCode = successCode.includes(code) ? 'z1' :
errorCode.includes(code) ? 'z2' :
warnCode.includes(code) ? 'z3' :
'z4'
return stateObj[zCode]
},
}
}