diff --git a/src/store/modules/equipment.js b/src/store/modules/equipment.js index 8af1171..0cf7074 100644 --- a/src/store/modules/equipment.js +++ b/src/store/modules/equipment.js @@ -47,6 +47,10 @@ export const useEquipmentStore = defineStore( } console.log(currentIndex,'currentIndex') this.deviceStatus[Number(index)].list[index1].defIndex = currentIndex + }, + setSslSelect(index, index1) { + this.deviceStatus[Number(index)].list[index1].isSslSelect = !this.deviceStatus[Number(index)].list[index1].isSslSelect + console.log(this.deviceStatus[Number(index)].list[index1].isSslSelect,'isSslSelect') } } } diff --git a/src/views/equipment/common/AddMonitorData.vue b/src/views/equipment/common/AddMonitorData.vue index d9dded3..7e4ae14 100644 --- a/src/views/equipment/common/AddMonitorData.vue +++ b/src/views/equipment/common/AddMonitorData.vue @@ -103,7 +103,8 @@ const options = [ defIndex: 0, value:'', unit:'', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '导体直径' }, @@ -116,7 +117,8 @@ const options = [ defIndex: 0, value: '', unit: '', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '导体直径X' }, @@ -129,7 +131,8 @@ const options = [ defIndex: 0, value: '', unit: '', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '导体直径Y' }, @@ -156,7 +159,8 @@ const options = [ defIndex: 0, value: '', unit: '', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '热外径' }, @@ -169,7 +173,8 @@ const options = [ defIndex: 0, value: '', unit: '', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '热外径X' }, @@ -182,7 +187,8 @@ const options = [ defIndex: 0, value: '', unit: '', - xy:'xy' + xy:'xy', + isSsl:false, }, label: '热外径Y' }, @@ -195,6 +201,7 @@ const options = [ defIndex: 0, value: '', unit: '', + isSsl:false, }, label: '热外径椭圆度' } @@ -217,18 +224,21 @@ const options = [ defIndex: 0, value: '', unit: '', + isSsl:true, + isSslSelect:false, }, label: '总厚度' }, { value: { - title: '总厚度', + title: '总厚度最小厚度', calculationValue: 'MinALL', productValue: 'WtALL', lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '总厚度最小厚度' }, @@ -240,7 +250,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '总厚度偏心' }, @@ -252,7 +263,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '总厚度偏心度' }, @@ -264,7 +276,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '总厚度同心度' } @@ -282,7 +295,9 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:true, + isSslSelect:false, }, label: '内屏层厚度' }, @@ -294,7 +309,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '内屏层最小厚度' }, @@ -306,7 +322,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '内屏层偏心' }, @@ -318,7 +335,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '内屏层同心度' }, @@ -330,7 +348,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '内屏层偏心度' } @@ -348,7 +367,9 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:true, + isSslSelect:false, }, label: '绝缘层厚度' }, @@ -360,7 +381,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '绝缘层最小厚度' }, @@ -372,7 +394,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '绝缘层偏心' }, @@ -384,7 +407,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '绝缘层同心度' }, @@ -396,7 +420,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '绝缘层偏心度' } @@ -414,7 +439,9 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:true, + isSslSelect:false, }, label: '外屏层厚度' }, @@ -426,7 +453,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '外屏层最小厚度' }, @@ -438,7 +466,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '外屏层偏心' }, @@ -450,7 +479,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '外屏层同心度' }, @@ -462,7 +492,8 @@ const options = [ lists, defIndex: 0, value: '', - unit: '' + unit: '', + isSsl:false, }, label: '外屏层偏心度' } diff --git a/src/views/equipment/equipmentDetails.vue b/src/views/equipment/equipmentDetails.vue index 65baf35..24f0dfb 100644 --- a/src/views/equipment/equipmentDetails.vue +++ b/src/views/equipment/equipmentDetails.vue @@ -63,27 +63,37 @@
- {{item.title}} +
+ + +
{{ item.title }}
+ +
-
+
收缩率 {{ item.ssl }}%
-
+
{{ item.isaddorsub }} 公差
-
+
{{ item.value }}
+
+ {{ (item.value - (item.value * (item.ssl/100))).toFixed(2) }} +
@@ -392,11 +402,26 @@ const cardClick = (e) => { } const handleDataConfirm = (dataType) => { console.log('选择的数据项:', dataType) + let isExist = false + chartDataList.value.forEach(item => { + item.list.forEach(listItem => { + if (listItem.title === dataType.title) { + isExist = true + } + }) + }) + if (isExist) { + ElMessage.warning('该数据项已存在') + return + } useEquipment.setDeviceData(activeIndex.value, dataType) console.log(chartDataList.value, '数据') - changeMode() // 这里处理选择的数据项 } +// +const handleSslSelect = (index1) => { + useEquipment.setSslSelect(activeIndex.value, index1) +} // mqtt连接 const mqttConnect = () => { console.log(clientId.value) @@ -678,6 +703,7 @@ const initSubscribe = async () => { } }) + changeMode() }) // deviceData.value = message @@ -780,12 +806,16 @@ onMounted(async() => { const changeMode = () => { chartDataList.value.forEach(item => { item.list.forEach(listItem => { - console.log(listItem, 'listItem') + console.log(listItem.productValue, 'listItem.productValue') let values = listItem.productValue - listItem.lists.forEach(listItem1 => { - listItem1.value = productInfo.value[values][listItem1.label] + listItem.lists = listItem.lists.map(listItem1 => { listItem[listItem1.label] = productInfo.value[values][listItem1.label] - console.log(values, listItem[listItem1.label], productInfo.value[values][listItem1.label]) + return { + name: listItem1.name, + unit: listItem1.unit, + label: listItem1.label, + value: productInfo.value[values][listItem1.label] + } }) listItem.lists.push({ name: '公差', @@ -805,8 +835,9 @@ const changeMode = () => { listItem.lists = listItem.lists.filter(item1 => { return item1.value !== undefined && item1.label !== 'fgc' && item1.label !== 'zgc' }) - listItem.isgc = listItem.value > (Number(listItem.zgc) + Number(listItem.bcz)) || listItem.value < Number(listItem.fgc) + Number(listItem.bcz) + listItem.isgc = listItem.value > (Number(listItem.zgc) + Number(listItem.bcz)) || Number(listItem.bcz) - Number(listItem.fgc) > listItem.value listItem.isaddorsub = listItem.value > Number(listItem.zgc) + Number(listItem.bcz) ? '+' : '-' + console.log(listItem, 'listItem.bcz') }) }) } @@ -933,6 +964,15 @@ watch(() => productInfo.value, (newVal) => { font-size: 14px; color: #333; font-weight: 600; + display: flex; + align-items: center; + cursor: pointer; + + img { + margin-right: 10px; + width: 20px; + height: 20px; + } } .close-icon {