From 61515d8da4b90131a4cae9e5bc1013cb0288573c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 10 十一月 2023 16:58:17 +0800
Subject: [PATCH] 	modified:   src/views/basic/template/index.vue 	modified:   src/views/common/param-mergeTemplate.vue 	modified:   src/views/common/rich-text.vue 	modified:   src/views/technology/routing/routing-form.vue

---
 src/views/basic/template/index.vue            |   87 ++++++++++++++++++++-----------------------
 src/views/technology/routing/routing-form.vue |    2 
 src/views/common/rich-text.vue                |    1 
 src/views/common/param-mergeTemplate.vue      |   29 +++++++++++---
 4 files changed, 63 insertions(+), 56 deletions(-)

diff --git a/src/views/basic/template/index.vue b/src/views/basic/template/index.vue
index 14a19ff..0880d7a 100644
--- a/src/views/basic/template/index.vue
+++ b/src/views/basic/template/index.vue
@@ -15,9 +15,9 @@
             <template #toolbar></template>
           </ttable>
         </el-col>
-        <el-col :span="12" style="padding-left: 10px">
+        <el-col :span="12">
           <el-card>
-            <div slot="header">
+            <div slot="header" style="height:20px">
               <el-row>
                 <el-col :span="8">
                   <span>鍙傛暟</span>
@@ -32,7 +32,8 @@
                 </el-col>
               </el-row>
             </div>
-            <paramMergeTemplate 
+            <paramMergeTemplate
+            style="padding: 0px 5px;" 
             :key="isShowTree"
             :isModel="true"
             :option="paramTemplateOption"
@@ -44,9 +45,6 @@
             :handleParamSave="saveSample"
             :tableTreeData="operationParams">
             </paramMergeTemplate>
-            <!-- <component :is="paramMergeTemplate" 
-            :key="isShowTree"
-            :tableTreeData="operationParams"></component> -->
             <!-- <el-table
               :data="operationParams"
               id="templateParamTable"
@@ -303,7 +301,9 @@
       },
       addOrUpdateVisible: false,
       paramTemplateOption: {
-        height: 300,
+        maxHeight: 450,
+        height: 450,
+        loadingText: "Loading...",
         columnBtn: false,
         index: true,
         indexLabel: '搴忓彿',
@@ -377,7 +377,7 @@
   },
   mounted() {
     this.getParamType()
-    this.rowDrop()
+    // this.rowDrop()
   },
   methods: {
     // 鑾峰彇鏁版嵁鍒楄〃
@@ -558,7 +558,7 @@
           this.newOperationParams.push(
             Object.assign({
               technologyOperationTemplateId: this.templateId,
-              technologyOperationParamId: this.operationParams[j].id,
+              technologyOperationParamId: this.operationParams[j].id ? this.operationParams[j].id : this.operationParams[j].oneId,
               sort: this.operationParams[j].index
             })
           )
@@ -567,34 +567,7 @@
           (response) => {
             const resData = response.data
             if (resData.code === 0) {
-              const resSteps = resData.data
-              if (resSteps.length > 0) {
-                this.operationParams = []
-                let operationParam
-                for (let i = 0; i < resSteps.length; i++) {
-                  operationParam = {
-                    id: resSteps[i].id,
-                    code: resSteps[i].code,
-                    parameterItem: resSteps[i].parameterItem,
-                    unit: resSteps[i].unit,
-                    index: resSteps[i].index,
-                    type: resSteps[i].type,
-                    defaultValue: resSteps[i].defaultValue,
-                    dict: resSteps[i].dict,
-                    sysDictItemList: resSteps[i].sysDictItemList,
-                    technologyOperationTemplateId:
-                      resSteps[i].technologyOperationTemplateId
-                  }
-                  /* operationParam.id = resSteps[i].id
-                  operationParam.code = resSteps[i].code
-                  operationParam.parameterItem = resSteps[i].parameterItem
-                  operationParam.unit = resSteps[i].unit
-                  operationParam.index = resSteps[i].index
-                  operationParam.type = resSteps[i].type
-                  operationParam.defaultValue = resSteps[i].defaultValue */
-                  this.operationParams.push(operationParam)
-                }
-              }
+              this.operationParams = resData.data
               if (state) {
                 this.$message.success('鍙傛暟鍏宠仈鎴愬姛')
               }
@@ -651,29 +624,49 @@
       })
     },
     deleteOperationParam(row) {
+      let id = null
+      if(row.threeId && row.threeId!='null'){
+        id = row.threeId
+      }else{
+        if(row.twoId && row.twoId!='null'){
+          id = row.twoId
+        }else{
+          id = row.oneId
+        }
+      }
       this.$confirm('鏄惁纭鍒犻櫎鍙傛暟缂栧彿涓猴細' + row.code, {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then((data) => {
         this.operationParams.splice(
-          this.operationParams.findIndex((item) => item.index === row.index),
-          1
-        )
-        this.operationParams
-          .filter((e) => e.index >= row.index)
-          .forEach((e) => (e.index = e.index - 1))
+          this.operationParams.findIndex((item) => {
+            let itemId = null
+            if(item.threeId && item.threeId!='null'){
+              itemId = item.threeId
+            }else{
+              if(item.twoId && item.twoId!='null'){
+                itemId = item.twoId
+              }else{
+                itemId = item.oneId
+              }
+            }
+            return itemId === id
+          }),1)
+        // this.operationParams
+        //   .filter((e) => e.oneId >= row.oneId)
+        //   .forEach((e) => (e.index = e.index - 1))
         deleteOperationParamTemplate(
           Object.assign({
             technologyOperationTemplateId: this.templateId,
-            technologyOperationParamId: row.id
+            technologyOperationParamId: id
           })
         ).then((response) => {
           this.$message.success('鍒犻櫎鍏宠仈鎴愬姛')
+          // if (response.data.code == 0 && this.operationParams.length > 0) {
+          //   this.dataFormRelateOperationParam(false)
+          // }
         })
-        if (this.operationParams.length > 0) {
-          this.dataFormRelateOperationParam(false)
-        }
       })
     },
     // 鑾峰彇宸ュ簭鍙傛暟绫诲瀷
diff --git a/src/views/common/param-mergeTemplate.vue b/src/views/common/param-mergeTemplate.vue
index 209593c..796737f 100644
--- a/src/views/common/param-mergeTemplate.vue
+++ b/src/views/common/param-mergeTemplate.vue
@@ -1,7 +1,14 @@
 <template>
     <div>
-        <avue-crud ref="crud" class="l-mes" rowKey="oneId" :data="tableData" :option="option" :span-method="spanMethod"
-            :page="page" :table-loading="loading">
+        <avue-crud 
+        ref="crud" 
+        class="l-mes" 
+        rowKey="oneId" 
+        :data="tableData" 
+        :option="option" 
+        :span-method="spanMethod"
+        :page="page" 
+        :table-loading="loading">
             <template slot="code" slot-scope="scope">
                 <avue-text-ellipsis use-tooltip :text="scope.row.code" :height="textEllipsisHeight" :width="textEllipsisWidth">
                     <small slot="more">...</small>
@@ -106,7 +113,7 @@
                                 message: "鍗曚綅涓嶈兘涓虹┖",
                                 trigger: "blur"
                             }]
-                        },]
+                    },]
                 }
             }
         },
@@ -116,10 +123,6 @@
                 return []
             },
             required: true
-        },
-        loading: {
-            type: Boolean,
-            default: false
         },
         page: {
             type: Object,
@@ -168,21 +171,28 @@
     watch:{
         tableTreeData:{
             handler(old,newval){
+                this.loading = true
                 this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
                 this.rowSort()
                 this.rowCalc()
+                this.loading = false
             },
             deep: true
         }
     },
     created() {
+        this.loading = true
         this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
         this.rowSort()
         this.rowCalc()
+        setTimeout(()=>{
+            this.loading = false
+        },3000)
     },
     data(){
         return {
             tableData: [],
+            loading: false,
         }
     },
     methods:{
@@ -268,4 +278,9 @@
 .avue-crud__menu {
     display: none;
 }
+.avue-crud .el-table th {
+    word-break: break-word;
+    color: rgba(102,102,102,1);
+    background-color: white;
+}
 </style>
\ No newline at end of file
diff --git a/src/views/common/rich-text.vue b/src/views/common/rich-text.vue
index f61765c..402a295 100644
--- a/src/views/common/rich-text.vue
+++ b/src/views/common/rich-text.vue
@@ -115,7 +115,6 @@
   },
   mounted() {
     this.flag = true
-    console.log(this.richContent)
     this.content = this.richContent
   },
   watch: {
diff --git a/src/views/technology/routing/routing-form.vue b/src/views/technology/routing/routing-form.vue
index aaab516..4f1cafd 100644
--- a/src/views/technology/routing/routing-form.vue
+++ b/src/views/technology/routing/routing-form.vue
@@ -494,7 +494,7 @@
                 ></rich-text>
               </div>
             </el-tab-pane>
-            <el-tab-pane label="宸ュ簭鍙傛暟" style="height: 100%">
+            <el-tab-pane v-if="dataForm.id!=null" label="宸ュ簭鍙傛暟" style="height: 100%">
               <el-card class="params-template">
                 <div slot="header">
                   <span>鍙傛暟闆�</span>

--
Gitblit v1.9.3