From d0e1a3fb24d0ee76aa4ef1b0e042392b4d3ac794 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 07 十一月 2024 16:38:26 +0800
Subject: [PATCH] 预计参数多层次分级,新增型号增加namePath
---
web/src/views/modules/baseReliability/ParamDataBasic.vue | 84 +++++++++++++++++++++++++++++++----------
1 files changed, 63 insertions(+), 21 deletions(-)
diff --git a/web/src/views/modules/baseReliability/ParamDataBasic.vue b/web/src/views/modules/baseReliability/ParamDataBasic.vue
index 36aa965..3039eac 100644
--- a/web/src/views/modules/baseReliability/ParamDataBasic.vue
+++ b/web/src/views/modules/baseReliability/ParamDataBasic.vue
@@ -4,7 +4,7 @@
<el-col :span="5">
<div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
<product-model-tree ref="modelTree" @on-selected="onProductSelected" @on-default="onDefault" showXdy="false"
- basic="3"/>
+ basic="3" :isShow="false"/>
</div>
</el-col>
<el-col :span="19">
@@ -24,27 +24,40 @@
row-key="id"
:expand-row-keys="defultKey"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
+ :header-cell-style="{'text-align':'center'}"
+ :cell-style="cellStyle"
border @selection-change="table.selectionChangeHandle">
<!--<el-table-column type="selection" width="40"/>-->
<el-table-column prop="name" label="鍚嶇О"/>
- <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right">
+ <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺" align="center" width="100"/>
+ <el-table-column prop="basicMtbfRegulate" label="MTBF" align="right" width="120">
<template slot-scope="scope">
- <span>{{ scope.row.basicMtbfRegulate | keepNumber }}</span>
+ <span>{{ keepNumber(scope.row.basicMtbfRegulate) }}</span>
</template>
</el-table-column>
- <el-table-column prop="repairMttcr" label="MTTR" align="right">
+ <el-table-column prop="repairMttcr" label="MTTR" align="right" width="120">
<template slot-scope="scope">
- <span>{{ scope.row.repairMttcr | keepNumber }}</span>
+ <span>{{ keepNumber(scope.row.repairMttcr) }}</span>
</template>
</el-table-column>
- <el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right">
+ <el-table-column prop="basicMtbfRegulSuccRate" label="鎴愬姛鐜�" align="right" width="100">
<template slot-scope="scope">
- <span>{{ scope.row.basicMtbfOperatingRatio | keepNumber }}</span>
+ <span>{{keepNumber(scope.row.basicMtbfRegulSuccRate) }}</span>
</template>
</el-table-column>
- <el-table-column prop="ai" label="鍙敤搴�" align="right">
+ <el-table-column prop="basicRunsNum" label="杩愯娆℃暟" align="right" width="100">
<template slot-scope="scope">
- <span>{{ scope.row.ai | keepNumber }}</span>
+ <span>{{scope.row.basicRunsNum}}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="basicMtbfOperatingRatio" label="杩愯姣�" align="right" width="100">
+ <template slot-scope="scope">
+ <span>{{keepNumber(scope.row.basicMtbfOperatingRatio) }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="ai" label="鍙敤搴�" align="right" width="100">
+ <template slot-scope="scope">
+ <span>{{keepNumber(scope.row.ai)}}</span>
</template>
</el-table-column>
</el-table>
@@ -66,7 +79,9 @@
basicMtbfRegulate: '',
repairMttcr: '',
basicMtbfOperatingRatio: '',
- ai: ''
+ ai: '',
+ basicMtbfRegulSuccRate:'',
+ basicRunsNum:''
},
defultKey: []
}
@@ -74,18 +89,20 @@
components: {
ProductModelTree,
},
- filters: {
- keepNumber(value) { //杩囨护鍣ㄤ繚鐣�4涓哄皬鏁�
- const numM = Number(value).toFixed(5);
- if (numM === "NaN") {
- return "0.0000";
+ computed: {
+ keepNumber() { //杩囨护鍣ㄤ繚鐣�4涓哄皬鏁�
+ return function (val) { // 瀵硅绠楀睘鎬ц繘琛屼紶鍙�
+ let numM = 0.0
+ if (val){
+ numM = Number(val).toFixed(4);
+ numM.substring(0, numM.length - 1)
+ }
+ return numM;
}
- if (numM === '0.0000' && value > 0) {
-
- }
- const realVal = numM.substring(0, numM.length - 1);
- return realVal;
},
+ },
+ mounted() {
+ this.$refs.modelTree.getProductList()
},
methods: {
onProductSelected(data) {
@@ -99,7 +116,6 @@
})
},
setDefultKey() {
- console.log(this.$refs.tableObj.dataList[0].id,'this.$refs.tableObj.dataList[0].id')
this.defultKey.push(this.dataForm.shipId + "")
},
onDefault(defaultId) {
@@ -115,6 +131,32 @@
this.$refs.tableObj.query()
})
},
+ cellStyle({row, column, rowIndex, columnIndex}) {
+ 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 ''
+ }
+ // 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;
+ // }
+ // }
+ // }
+ // });
+ },
}
}
</script>
--
Gitblit v1.9.1