From c30b850bdf5c48a2279f293d414850c32501192a Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 29 四月 2024 16:25:25 +0800
Subject: [PATCH] 修改首页样式

---
 src/views/basic/template/index.vue |   50 ++++++++++++++++++++++++++++++++------------------
 1 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/src/views/basic/template/index.vue b/src/views/basic/template/index.vue
index 0c21557..8a1bfd7 100644
--- a/src/views/basic/template/index.vue
+++ b/src/views/basic/template/index.vue
@@ -12,7 +12,10 @@
             :ajaxFun="ajaxFun"
             ref="templateTable"
           >
-            <template #toolbar></template>
+            <template #toolbar>
+              <el-button type="primary" @click="addOrUpdateHandle"
+              v-if="permissions.technology_operationtemplate_add">鏂板</el-button>
+            </template>
           </ttable>
         </el-col>
         <el-col :span="12" style="padding-left: 10px">
@@ -26,6 +29,7 @@
                   <el-button
                     style="float: right; padding: 3px 0"
                     type="text"
+                    v-if="permissions.technology_operationtemplate_param_add"
                     @click="relateOperationParam()"
                     >娣诲姞</el-button
                   >
@@ -107,7 +111,8 @@
 
               <el-table-column label="鍗曚綅" prop="unit" align="center">
               </el-table-column>
-              <el-table-column label="鎿嶄綔" align="center">
+              <el-table-column label="鎿嶄綔" align="center"
+              v-if="permissions.technology_operationtemplate_param_edit">
                 <template slot-scope="scope">
                   <el-button
                     type="text"
@@ -204,6 +209,7 @@
         seqNo: true,
         isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳
         isSearch: true, // 楂樼骇鏌ヨ鎸夐挳
+        isRefresh: true, // 鏄惁鏄剧ず鍒锋柊鎸夐挳
         defaultOrderBy: { column: 'id', direction: 'desc' }
       },
       table: {
@@ -260,22 +266,8 @@
             searchInfoType: 'text'
           }
         ],
-        toolbar: [
-          {
-            text: '鏂板',
-            type: 'primary',
-            fun: this.addOrUpdateHandle
-          }
-        ],
-        operator: [
-          {
-            text: '鍒犻櫎',
-            icon: 'el-icon-delete',
-            type: 'text',
-            size: 'small',
-            fun: this.deleteHandle
-          }
-        ],
+        toolbar: [],
+        operator: null,
         operatorConfig: {
           fixed: 'right',
           label: '鎿嶄綔',
@@ -291,6 +283,19 @@
     TableForm,
     ParamDialog
   },
+  created(){
+    if(this.permissions.technology_operationtemplate_del){
+      this.table.operator = [
+          {
+            text: '鍒犻櫎',
+            icon: 'el-icon-delete',
+            type: 'text',
+            size: 'small',
+            fun: this.deleteHandle
+          }
+        ]
+    }
+  },
   computed: {
     ...mapGetters(['permissions'])
   },
@@ -305,6 +310,9 @@
     },
     // 鏂板 / 淇敼
     addOrUpdateHandle(row) {
+      if(!this.permissions.technology_operationtemplate_edit && row.id!=null){
+        return
+      }
       this.addOrUpdateVisible = true
       this.$nextTick(() => {
         this.$refs.addOrUpdate.init(row == null ? null : row.id)
@@ -608,6 +616,12 @@
       var obj = {}
       obj.technologyOperationParamId = row.id
       obj.technologyOperationTemplateId = row.technologyOperationTemplateId
+      if(row.defaultValue!=null){
+        row.defaultValue=row.defaultValue.replace(',','锛�').replace('(','锛�').replace(')','锛�')
+          if (!isNaN(row.defaultValue)) {
+            row.defaultValue='='+row.defaultValue
+          }
+      }
       obj.defaultValue = row.defaultValue
       putRelateOperationParamTemplate(obj).then((response) => {
         this.$message.success('鍙傛暟淇濆瓨鎴愬姛')

--
Gitblit v1.9.3