From 826cd5b51d5106cfea07e397eda184fb15ec7a30 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期五, 02 八月 2024 14:33:59 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/baseReliability/ParamDataBasic.vue | 47 ++++++++++++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 21 deletions(-) diff --git a/web/src/views/modules/baseReliability/ParamDataBasic.vue b/web/src/views/modules/baseReliability/ParamDataBasic.vue index cab88f5..3de24d4 100644 --- a/web/src/views/modules/baseReliability/ParamDataBasic.vue +++ b/web/src/views/modules/baseReliability/ParamDataBasic.vue @@ -84,6 +84,10 @@ } }, }, + mounted() { + this.$refs.modelTree.getProductList() + console.log(this.pageCode, 'this.pageCode this.pageCode') + }, methods: { onProductSelected(data) { this.defultKey = [] @@ -112,29 +116,30 @@ }) }, cellStyle({row, column, rowIndex, columnIndex}) { - let warningColor = false; - // console.log(row, column, rowIndex, columnIndex); - //console.log(row, "row"); - Object.keys(row).forEach((key, index) => { - //閬嶅巻姣忚涓瘡涓暟鎹殑state - if (key === "repairMttcr" || key === "basicMtbfRegulate") { - //console.log(key, "row key"); - let val = row[key] - const numM = Number(val).toFixed(5); - if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) { - //瀹氫綅璇ユ暟鎹殑鍧愭爣 - if (columnIndex === 2) { - warningColor = true; - } - } - } - }); - - if (warningColor) { - // red涓烘兂鍙樻垚鐨勫崟鍏冩牸鏍峰紡 + const numM1 = Number(row.repairMttcr).toFixed(5); + const numM2 = Number(row.basicMtbfRegulate).toFixed(5); + console.log(numM1,numM2,'234') + if (numM1.substring(0, numM1.length - 1) === '0.0000' && row.repairMttcr > 0 && column.property ==="repairMttcr") { return 'color : red' + } else if (numM2.substring(0, numM1.length - 1) === '0.0000' && row.basicMtbfRegulate > 0 && column.property ==="basicMtbfRegulate") { + return 'color : red' + }else { + return '' } - return ""; + // Object.keys(row).forEach((key, index) => { + // //閬嶅巻姣忚涓瘡涓暟鎹殑state + // if (key === "repairMttcr" || key === "basicMtbfRegulate") { + // //console.log(key, "row key"); + // let val = row[key] + // const numM = Number(val).toFixed(5); + // if (numM.substring(0, numM.length - 1) === '0.0000' && val > 0) { + // //瀹氫綅璇ユ暟鎹殑鍧愭爣 + // if (columnIndex === 2) { + // warningColor = true; + // } + // } + // } + // }); }, } } -- Gitblit v1.9.1