From 5c1e5b08d28251186e99cf5e24c5114c404dc968 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期二, 02 四月 2024 08:59:46 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/basicInfo/ProductModelTree.vue                                                           |   43 +++++++++----
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java       |   13 +++-
 web/src/views/modules/basicInfo/XhProductModel.vue                                                             |    2 
 web/src/views/modules/taskReliability/TaskPhaseModel.vue                                                       |    4 
 modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml                                     |   20 ++----
 web/src/views/modules/taskReliability/ModelRbd.vue                                                             |    2 
 web/src/views/modules/taskReliability/TaskPhase-AddOrUpdate.vue                                                |   16 ++--
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java |    4 
 web/src/views/modules/taskReliability/SimulatAssess.vue                                                        |   15 ++++-
 web/src/views/modules/basicInfo/ParamData.vue                                                                  |   28 ++++-----
 10 files changed, 84 insertions(+), 63 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
index 5656750..7837c47 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -60,8 +60,8 @@
     }
 
     @GetMapping("tree")
-    public Result<List<XhProductModel>> getTreeList() {
-        List<XhProductModel> list = xhProductModelService.getAllTree();
+    public Result<List<XhProductModel>> getTreeList(Boolean showXdy) {
+        List<XhProductModel> list = xhProductModelService.getAllTree(showXdy);
 
         return Result.ok(list);
     }
diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
index cf4c438..911c047 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -42,9 +42,16 @@
         super.deleteLogic(ids);
     }
 
-    public List<XhProductModel> getAllTree() {
-        List<XhProductModel> productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
-                Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
+    public List<XhProductModel> getAllTree(Boolean showXdy) {
+        List<XhProductModel> productList;
+        if (showXdy) {
+            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
+                    Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
+        } else {
+            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
+                    Constant.Bool.NO).gt("product_type", 1).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
+
+        }
         return TreeUtils.build(productList);
     }
 
diff --git a/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml b/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml
index 30b878d..da973e9 100644
--- a/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/basicInfo/TyProductModelDao.xml
@@ -6,26 +6,18 @@
     <select id="getList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel">
         select a.*
         from product_model_common a
-        <where>
-            a.is_delete = 0
-            <if test="nodeType!=null and nodeType!=''">
-                and a.node_type = ${nodeType}
-                <if test="nodeType==1">
-                    and a.pid = (select src_id from product_model where id = ${pid})
-                </if>
-                <if test="nodeType==2">
-                    and a.id not in (select src_id from product_model where PID = ${pid})
-                </if>
-            </if>
-        </where>
+        where a.is_delete = 0
+        and a.pid in (select src_id from product_model where id = ${pid})
+        and ((a.node_type = 1) or (a.node_type &lt;&gt; 1 and id not in (select src_id from product_model where pid = ${pid})))
         <if test="orderBySql!=null">
             ORDER BY ${orderBySql}
         </if>
     </select>
     <select id="getProductList" resultType="com.zt.life.modules.mainPart.basicInfo.model.TyProductModel">
-        select a.name,a.id
+        select a.name, a.id
         from product_model_common a
-        where a.is_delete =0 and a.node_type != 1
+        where a.is_delete = 0
+          and a.node_type != 1
     </select>
     <select id="getNo" resultType="java.lang.Integer">
         SELECT COUNT(*)
diff --git a/web/src/views/modules/basicInfo/ParamData.vue b/web/src/views/modules/basicInfo/ParamData.vue
index 6155b6e..a519745 100644
--- a/web/src/views/modules/basicInfo/ParamData.vue
+++ b/web/src/views/modules/basicInfo/ParamData.vue
@@ -3,7 +3,7 @@
     <el-row :gutter="5">
       <el-col :span="5">
         <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
-          <product-model-tree @on-selected="onProductSelected"/>
+          <product-model-tree @on-selected="onProductSelected" showXdy="false"/>
         </div>
       </el-col>
       <el-col :span="19">
@@ -29,7 +29,7 @@
               <el-form-item>
                 <zt-button type="warning" @click="handleSaveRows">淇濆瓨</zt-button>
                 <zt-button type="query" @click="table.query()"/>
-                <zt-button type="add" v-if="dataForm.nodeType==='2'" @click="add()"/>
+                <zt-button type="add" v-if="dataForm.productType==='3'" @click="add()"/>
                 <zt-button type="delete" @click="table.deleteHandle()"/>
               </el-form-item>
             </el-form>
@@ -38,13 +38,13 @@
                       @selection-change="table.selectionChangeHandle">
               <el-table-column type="selection" :key="1" width="40" align="center"/>
               <el-table-column prop="name" :key="2" label="鍚嶇О" fixed="left"/>
-              <el-table-column v-if="dataForm.nodeType==='4'" :key="3" prop="baseOperatRatio" label="鍩烘湰鍙潬鎬ц繍琛屾瘮">
+              <el-table-column v-if="dataForm.productType==='4'" :key="3" prop="baseOperatRatio" label="鍩烘湰鍙潬鎬ц繍琛屾瘮">
                 <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>
                 </template>
               </el-table-column>
-              <el-table-column v-if="dataForm.nodeType==='5'||dataForm.nodeType==='4'" :key="4" prop="actualRunTime"
+              <el-table-column v-if="dataForm.productType==='5'||dataForm.productType==='4'" :key="4" prop="actualRunTime"
                                label="瀹為檯杩愯鏃堕棿">
                 <!--                <template slot-scope="scope">
                                     <span v-if="editingCell && editingCell.row === scope.row && editingCell.column.property === scope.column.property">
@@ -57,7 +57,7 @@
                   <span v-else v-text="scope.row.actualRunTime"></span>
                 </template>
               </el-table-column>
-              <el-table-column v-if="dataForm.nodeType==='2'" :key="5" label="鍩烘湰鍙潬鎬ц绠�">
+              <el-table-column v-if="dataForm.productType==='3'" :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">
                   <template v-slot="{ row }">
@@ -124,7 +124,7 @@
                 </el-table-column>
               </el-table-column>
 
-              <el-table-column v-if="dataForm.nodeType==='2'" :key="15" label="浠诲姟鍙潬鎬ц绠�">
+              <el-table-column v-if="dataForm.productType==='3'" :key="15" label="浠诲姟鍙潬鎬ц绠�">
                 <el-table-column prop="taskMtbcfRegulate" :key="16" label="瑙勫畾MTBCF" width="120">
                   <template slot-scope="scope">
                     <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfRegulate"></el-input>
@@ -163,7 +163,7 @@
                 </el-table-column>
               </el-table-column>
 
-              <el-table-column v-if="dataForm.nodeType==='2'" :key="22" label="缁翠慨鍒嗗竷">
+              <el-table-column v-if="dataForm.productType==='3'" :key="22" label="缁翠慨鍒嗗竷">
                 <!--                <zt-table-column-dict prop="repairable" :keys="23" label="鍙淮淇�" dict="is_or_not"/>-->
                 <el-table-column prop="repairable" label="鍙淮淇�" :key="23">
                   <template v-slot="{ row }">
@@ -210,9 +210,9 @@
                 </el-table-column>
               </el-table-column>
 
-              <!--  <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�"
+              <!--  <zt-table-column-dict v-if="dataForm.productType==='3'" :key="27" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�"
                                       width="160"/>-->
-              <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�" :key="27"
+              <el-table-column v-if="dataForm.productType==='3'" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�" :key="27"
                                width="160">
                 <template v-slot="{ row }">
                   <el-select v-if="row.isEdit" v-model="row.reliabDistribType"
@@ -228,7 +228,7 @@
                                :hit="hit"/>
                 </template>
               </el-table-column>
-              <el-table-column v-if="dataForm.nodeType==='2'" :key="28" prop="runTime" label="杩愯鏃堕棿" width="100">
+              <el-table-column v-if="dataForm.productType==='3'" :key="28" prop="runTime" label="杩愯鏃堕棿" width="100">
                 <template slot-scope="scope">
                   <el-input v-if="scope.row.isEdit" v-model="scope.row.runTime"></el-input>
                   <span v-else v-text="scope.row.runTime"></span>
@@ -277,7 +277,7 @@
           srcId: '',
           name: '',
           dataThreeList: null,
-          nodeType: '5',
+          productType: '5',
           basicJoinCompute:'',
           repairable:'',
           repairDistribType:'',
@@ -345,7 +345,7 @@
     methods: {
       add() {
         this.$refs.SelectTyModel.$refs.dialog.init(null, {
-          type: this.dataForm.nodeType - 1,
+          type: this.dataForm.productType - 1,
           id: this.dataForm.srcId,
           pageCode: this.pageCode
         })
@@ -396,9 +396,7 @@
       // },
       onProductSelected(data) {
         this.dataForm.srcId = data.id
-        if (data.productType === '3') {
-          this.dataForm.nodeType = '2'
-        }
+        this.dataForm.productType =data.productType
         console.log(data, 'onProductSelected(data)')
         this.$refs.tableObj.query()
       },
diff --git a/web/src/views/modules/basicInfo/ProductModelTree.vue b/web/src/views/modules/basicInfo/ProductModelTree.vue
index 79e571f..a34ee67 100644
--- a/web/src/views/modules/basicInfo/ProductModelTree.vue
+++ b/web/src/views/modules/basicInfo/ProductModelTree.vue
@@ -30,7 +30,12 @@
 
   export default {
     name: 'ProductModelTree',
-    props: {},
+    props: {
+      showXdy: {
+        type: Boolean,
+        default: true
+      },
+    },
 
     data() {
       return {
@@ -41,32 +46,42 @@
           label: 'name'
         }
       }
-    },
+    }
+    ,
     watch: {
       filterText(val) {
         this.$refs.tree.filter(val)
       }
-    },
+    }
+    ,
     components: {
       AddOrUpdate
-    },
+    }
+    ,
     mounted() {
       this.getProductList()
-    },
+    }
+    ,
     methods: {
       // 鑾峰彇绯荤粺鍒楄〃
       async getProductList() {
-        let res = await this.$http.get('/basicInfo/XhProductModel/tree')
+        let params = {
+          showXdy:this.showXdy
+        }
+        let res = await this.$http.get('/basicInfo/XhProductModel/tree',{params:params})
         this.productList = res.data
-        console.log(res.data,'async getProductList()')
-      },
+        console.log(res.data, 'async getProductList()')
+      }
+      ,
       add() {
-        this.$refs.AddOrUpdate.$refs.dialog.init(null,{id: null, type: 'tree'})
-      },
+        this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'tree'})
+      }
+      ,
       filterNode(value, data) {
         if (!value) return true
         return data.name.indexOf(value) !== -1
-      },
+      }
+      ,
       handleNodeClick(data) {
         this.$emit('on-selected', data)
       }
@@ -74,7 +89,7 @@
   }
 </script>
 <style>
-.product-tree-container{
-  height: 100%;
-}
+  .product-tree-container {
+    height: 100%;
+  }
 </style>
diff --git a/web/src/views/modules/basicInfo/XhProductModel.vue b/web/src/views/modules/basicInfo/XhProductModel.vue
index 855604c..a0fd1f3 100644
--- a/web/src/views/modules/basicInfo/XhProductModel.vue
+++ b/web/src/views/modules/basicInfo/XhProductModel.vue
@@ -3,7 +3,7 @@
     <el-row :gutter="5">
       <el-col :span="5">
         <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
-          <product-model-tree @on-selected="onProductSelected"/>
+          <product-model-tree @on-selected="onProductSelected" showXdy="true"/>
         </div>
       </el-col>
       <el-col :span="19">
diff --git a/web/src/views/modules/taskReliability/ModelRbd.vue b/web/src/views/modules/taskReliability/ModelRbd.vue
index 9025ad3..7ef3205 100644
--- a/web/src/views/modules/taskReliability/ModelRbd.vue
+++ b/web/src/views/modules/taskReliability/ModelRbd.vue
@@ -3,7 +3,7 @@
     <el-row :gutter="5">
       <el-col :span="5">
         <div class="fa-card-a" style="margin-right: 5px;height: calc(100vh - 123px)">
-          <product-model-tree @on-selected="onProductSelected"/>
+          <product-model-tree @on-selected="onProductSelected" showXdy="true"/>
         </div>
       </el-col>
       <el-col :span="19">
diff --git a/web/src/views/modules/taskReliability/SimulatAssess.vue b/web/src/views/modules/taskReliability/SimulatAssess.vue
index cd7588f..d87c221 100644
--- a/web/src/views/modules/taskReliability/SimulatAssess.vue
+++ b/web/src/views/modules/taskReliability/SimulatAssess.vue
@@ -22,6 +22,11 @@
                   <template slot="append">鍒嗛挓</template>
                 </el-input>
               </zt-form-item>
+              <zt-form-item label="浠跨湡鏃堕暱" prop="simulatTime">
+                <el-input type="number" :min="1" v-model="dataForm.simulatTime">
+                  <template slot="append">鍒嗛挓</template>
+                </el-input>
+              </zt-form-item>
               <zt-form-item label="浠跨湡娆℃暟" prop="simulatFrequency">
                 <el-input type="number" :min="1" v-model="dataForm.simulatFrequency">
                   <template slot="append">娆℃暟</template>
@@ -64,6 +69,7 @@
           isRepair: '',
           samplPeriod: '',
           simulatFrequency: '',
+          simulatTime:''
         }
       }
     },
@@ -132,15 +138,15 @@
 </script>
 <style>
   .mod-taskReliability-simulatAssess {
-    height: calc(100vh - 165px);
+    height: calc(100vh - 175px);
   }
 
   .mod-taskReliability-simulatAssess .el-form-item__label {
-    line-height: calc((100vh - 165px) / 7);
+    line-height: calc((100vh - 175px) / 8);
   }
 
   .mod-taskReliability-simulatAssess .el-form-item__content {
-    line-height: calc((100vh - 165px) / 7);
+    line-height: calc((100vh - 175px) / 8);
   }
 
   .mod-taskReliability-simulatAssess .el-form-item__content > .el-input-group--append {
@@ -150,4 +156,7 @@
   div.el-col.el-col-17 {
     background: white;
   }
+  div.el-select-dropdown.el-popper{
+    /*top: calc((100vh - 155px) / 4) !important;*/
+  }
 </style>
diff --git a/web/src/views/modules/taskReliability/TaskPhase-AddOrUpdate.vue b/web/src/views/modules/taskReliability/TaskPhase-AddOrUpdate.vue
index aa4e95c..dfcd968 100644
--- a/web/src/views/modules/taskReliability/TaskPhase-AddOrUpdate.vue
+++ b/web/src/views/modules/taskReliability/TaskPhase-AddOrUpdate.vue
@@ -55,14 +55,14 @@
       async formSubmit() {
         console.log(this.time,'dataLoaded')
         if (this.time + Number(this.dataForm.phaseDurationRate > 1)) {
-          this.$alert("褰撳墠杩愯鏃堕暱姣斿凡瓒呭嚭锛岃閲嶆柊璁剧疆")
-          return
-        }
-        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhase/', this.dataForm)
-        if (res.success) {
-          await this.$tip.success()
-          this.$refs.dialog.close()
-          this.$emit('refreshDataList')
+          this.$alert("璇烽噸鏂拌缃綋鍓嶆椂闀挎瘮鍒嗛厤")
+        }else{
+          let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/TaskPhase/', this.dataForm)
+          if (res.success) {
+            await this.$tip.success()
+            this.$refs.dialog.close()
+            this.$emit('refreshDataList')
+          }
         }
       }
     }
diff --git a/web/src/views/modules/taskReliability/TaskPhaseModel.vue b/web/src/views/modules/taskReliability/TaskPhaseModel.vue
index 00c182c..7218eab 100644
--- a/web/src/views/modules/taskReliability/TaskPhaseModel.vue
+++ b/web/src/views/modules/taskReliability/TaskPhaseModel.vue
@@ -86,8 +86,8 @@
         }
         this.dataForm.dataThreeList = list
         console.log(time, 'async handleSaveRows')
-        if (time > 1) {
-          this.$alert("鏃堕暱姣斿拰宸茶秴杩囷紝璇烽噸鏂拌缃�")
+        if (time!== 1) {
+          this.$alert("璇烽噸鏂拌缃綋鍓嶆椂闀挎瘮鍒嗛厤")
           return
         }
         if (!flag) {

--
Gitblit v1.9.1