From d8cb08ce6b68b50d2475b70eb522ea6bbbb17686 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期三, 24 七月 2024 15:26:12 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/basicInfo/ParamData.vue |   66 +++++++++++++++++++++------------
 1 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/web/src/views/modules/basicInfo/ParamData.vue b/web/src/views/modules/basicInfo/ParamData.vue
index 90f1f30..fed2bcb 100644
--- a/web/src/views/modules/basicInfo/ParamData.vue
+++ b/web/src/views/modules/basicInfo/ParamData.vue
@@ -1,12 +1,12 @@
 <template>
   <div>
     <el-row :gutter="5">
-      <el-col :span="5">
+      <el-col :span="4">
         <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
-          <product-model-tree @on-selected="onProductSelected" showXdy="false" :isShow="false"/>
+          <product-model-tree @on-selected="onProductSelected" @on-default="onDefault" showXdy="false" :isShow="false"/>
         </div>
       </el-col>
-      <el-col :span="19">
+      <el-col :span="20">
         <div class="mod-basicInfo-paramData fa-card-a" style="margin-left: 5px;">
           <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/basicInfo/ParamData/page"
                            delete-url="/basicInfo/ParamData/"
@@ -37,7 +37,7 @@
               </el-form-item>
             </el-form>
             <el-tabs v-model="activeName" @tab-click="handleClick">
-              <el-tab-pane label="鍩烘湰鍙潬鎬�" name="first" >
+              <el-tab-pane label="鍩烘湰鍙潬鎬�" name="first">
                 <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px"
                           v-adaptive="{bottomOffset:30}"
                           :header-cell-style="{'text-align':'center'}"
@@ -63,7 +63,8 @@
                                    :hit="hit"/>
                     </template>
                   </el-table-column>
-                  <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="鍩烘湰鍙潬鎬ц繍琛屾瘮" align="right">
+                  <el-table-column v-if="dataForm.productType==='2'" :key="3" prop="baseOperatRatio" label="鍩烘湰鍙潬鎬ц繍琛屾瘮"
+                                   align="right">
                     <template slot-scope="scope">
                       <el-input v-if="scope.row.isEdit" v-model="scope.row.baseOperatRatio"></el-input>
                       <span v-else v-text="scope.row.baseOperatRatio"></span>
@@ -80,7 +81,7 @@
                   <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="5"
                                    label="鍩烘湰鍙潬鎬ц绠�">
                     <!--                <zt-table-column-dict prop="joinCompute" :keys="6" label="鍙傚姞璁$畻" width="100" dict="is_or_not"/>-->
-                    <el-table-column prop="basicJoinCompute" label="鍙傚姞璁$畻" :key="6"  width="100" align="center">
+                    <el-table-column prop="basicJoinCompute" label="鍙傚姞璁$畻" :key="6" width="100" align="center">
                       <template v-slot="{ row }">
                         <el-select v-if="row.isEdit" v-model="row.basicJoinCompute"
                                    placeholder="鍙傚姞璁$畻">
@@ -95,10 +96,10 @@
                                      :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/>
                       </template>
                     </el-table-column>
-                    <el-table-column prop="basicMtbfRegulate" :key="7" label="MTBF" align="right" width="100">
+                    <el-table-column prop="basicMtbfRegulate" :key="7" label="MTBF" align="right" width="110">
                       <template slot-scope="scope">
                         <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfRegulate"></el-input>
-                        <span v-else v-text="scope.row.basicMtbfRegulate"></span>
+                        <span v-else>{{scope.row.basicMtbfRegulate | keepNumber}}</span>
                       </template>
                     </el-table-column>
                     <!--<el-table-column prop="basicMtbfAccept" :key="8" label="鍙帴鍙楃殑MTBF" width="100">
@@ -113,12 +114,12 @@
                         <span v-else v-text="scope.row.basicMtbfRegulSuccRate"></span>
                       </template>
                     </el-table-column>
-                   <!-- <el-table-column prop="basicMtbfAcceptSuccRate" :key="10" label="MTBF鍙帴鍙楁垚鍔熺巼" width="120">
-                      <template slot-scope="scope">
-                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfAcceptSuccRate"></el-input>
-                        <span v-else v-text="scope.row.basicMtbfAcceptSuccRate"></span>
-                      </template>
-                    </el-table-column>-->
+                    <!-- <el-table-column prop="basicMtbfAcceptSuccRate" :key="10" label="MTBF鍙帴鍙楁垚鍔熺巼" width="120">
+                       <template slot-scope="scope">
+                         <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfAcceptSuccRate"></el-input>
+                         <span v-else v-text="scope.row.basicMtbfAcceptSuccRate"></span>
+                       </template>
+                     </el-table-column>-->
                     <el-table-column prop="basicUnitNum" label="鍗曞厓鏁伴噺" :key="11" width="100" align="center">
                       <template slot-scope="scope">
                         <el-input v-if="scope.row.isEdit" v-model="scope.row.basicUnitNum"></el-input>
@@ -167,10 +168,10 @@
 
                   <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="15"
                                    label="浠诲姟鍙潬鎬ц绠�">
-                    <el-table-column prop="taskMtbcfRegulate" :key="16" label="MTBCF" width="100" align="right">
+                    <el-table-column prop="taskMtbcfRegulate" :key="16" label="MTBCF" width="110" align="right">
                       <template slot-scope="scope">
                         <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfRegulate"></el-input>
-                        <span v-else v-text="scope.row.taskMtbcfRegulate"></span>
+                        <span v-else>{{scope.row.taskMtbcfRegulate | keepNumber}}</span>
                       </template>
                     </el-table-column>
                     <!--<el-table-column prop="taskMtbcfAccept" :key="17" label="鍙帴鍙楃殑MTBCF" width="100">
@@ -185,12 +186,12 @@
                         <span v-else v-text="scope.row.taskMtbcfRegulSuccRate"></span>
                       </template>
                     </el-table-column>
-                   <!-- <el-table-column prop="taskMtbcfAcceptSuccRate" :key="19" label="MTBCF鍙帴鍙楁垚鍔熺巼" width="100">
-                      <template slot-scope="scope">
-                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfAcceptSuccRate"></el-input>
-                        <span v-else v-text="scope.row.taskMtbcfAcceptSuccRate"></span>
-                      </template>
-                    </el-table-column>-->
+                    <!-- <el-table-column prop="taskMtbcfAcceptSuccRate" :key="19" label="MTBCF鍙帴鍙楁垚鍔熺巼" width="100">
+                       <template slot-scope="scope">
+                         <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfAcceptSuccRate"></el-input>
+                         <span v-else v-text="scope.row.taskMtbcfAcceptSuccRate"></span>
+                       </template>
+                     </el-table-column>-->
                     <el-table-column prop="taskMtbcfOperatingRatio" :key="20" label="MTBCF杩愯姣�" align="right">
                       <template slot-scope="scope">
                         <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOperatingRatio"></el-input>
@@ -210,7 +211,8 @@
                       </template>
                     </el-table-column>
                   </el-table-column>
-                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="缁翠慨鍒嗗竷" align="center">
+                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='4'" :key="22" label="缁翠慨鍒嗗竷"
+                                   align="center">
                     <!--                <zt-table-column-dict prop="repairable" :keys="23" label="鍙淮淇�" dict="is_or_not"/>-->
                     <el-table-column prop="repairable" label="鍙淮淇�" :key="23" width="80" align="center">
                       <template v-slot="{ row }">
@@ -246,7 +248,7 @@
                     <el-table-column prop="repairMttcr" label="MTTCR" :key="25" width="100" align="right">
                       <template slot-scope="scope">
                         <el-input v-if="scope.row.isEdit" v-model="scope.row.repairMttcr"></el-input>
-                        <span v-else v-text="scope.row.repairMttcr"></span>
+                        <span v-else>{{scope.row.repairMttcr | keepNumber}}</span>
                       </template>
                     </el-table-column>
                     <el-table-column prop="repairMttcrOtherParams2" :key="26" label="MTTCR鍏朵粬鍙傛暟2" align="right">
@@ -346,6 +348,16 @@
         originalData: null, // 璁板綍淇敼鍓嶇殑鏁版嵁
       }
     },
+    filters: {
+      keepNumber(value) { //杩囨护鍣ㄤ繚鐣�4涓哄皬鏁�
+        const numM = Number(value).toFixed(5);
+        if (numM === "NaN") {
+          return "0.0000";
+        }
+        const realVal = numM.substring(0, numM.length - 1);
+        return realVal;
+      },
+    },
     // 鍦ㄧ粍浠朵腑瀹氫箟 beforeRouteLeave 瀵艰埅瀹堝崼
     beforeRouteLeave(to, from, next) {
       console.log(this.$store.state.contentTabs, 'this.$store.state.contentTabsActiveName')
@@ -437,6 +449,12 @@
           this.$refs.tableObj.query()
         })
       },
+      onDefault(defaultId) {
+        this.dataForm.srcId = defaultId
+        this.dataForm.productType = 2
+        this.activeName = 'first'
+        this.$refs.tableObj.query()
+      },
       dataLoaded(data) {
         this.dataList = data
         for (let dataList of data) {

--
Gitblit v1.9.1