From c4e17e16e32f396432303270004883da6ac27161 Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期四, 26 十二月 2024 17:56:27 +0800
Subject: [PATCH] 修改样式,action管理左侧树去掉按钮

---
 Source/plt-web/plt-web-ui/src/components/PLT-basic-component/iconShow.vue |    2 
 Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue   |   11 -
 Source/plt-web/plt-web-ui/src/styles/ui.scss                              |    9 +
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue    |    1 
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue      |  224 ++++++++++++++++++++++++++------------------
 Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue      |   13 --
 6 files changed, 145 insertions(+), 115 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/iconShow.vue b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/iconShow.vue
index e27677a..3dca8ec 100644
--- a/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/iconShow.vue
+++ b/Source/plt-web/plt-web-ui/src/components/PLT-basic-component/iconShow.vue
@@ -1,5 +1,5 @@
 <template>
-   <div :title="title" class="iconShow" :style="'width:'+fontSize+';height:'+fontSize+';font-size: '+fontSize+';'+style" v-html="svgHtml"></div>
+   <div v-show="name" :title="title" class="iconShow" :style="'width:'+fontSize+';height:'+fontSize+';font-size: '+fontSize+';'+style" v-html="svgHtml"></div>
 </template>
 
 <script>
diff --git a/Source/plt-web/plt-web-ui/src/styles/ui.scss b/Source/plt-web/plt-web-ui/src/styles/ui.scss
index f37d65c..e7722cb 100644
--- a/Source/plt-web/plt-web-ui/src/styles/ui.scss
+++ b/Source/plt-web/plt-web-ui/src/styles/ui.scss
@@ -527,10 +527,19 @@
   padding-left: 4.5px;
 }
 
+/*
+鏍�
+ */
 /***闅愯棌鏍戞噿鍔犺浇鏃惰妭鐐逛笂鐨刲oading锛岄槻姝㈣妭鐐规姈鍔�*****/
 .el-tree .el-tree-node__loading-icon{
   display: none !important;
 }
+.el-tree-node__label .iconShow{
+  display: inline-block;
+  width: 14px !important;
+  height: 14px !important;
+  margin-right: 3px;
+}
 
 .el-select{
   width: 100%;
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
index 26189cb..19d7f72 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -2,43 +2,53 @@
   <el-container>
     <el-aside>
       <basic-container>
-        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
-          <div class="headerCon">
-            <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
-            </el-button>
-            <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
-            </el-button>
-            <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
-            </el-button>
-            <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
-            </el-button>
-            <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
-            </el-button>
-          </div>
-          <!-- 宸︿晶鏍� -->
-          <div style="height:  calc(100vh - 280px);">
-            <avue-tree
-              ref="tree"
-              v-model="treeForm"
-              :data="treeData"
-              :option="treeOption"
-              @save="rowTreeSaveHandler"
-              @update="rowTreeUpdataHandler"
-              @node-click="nodeClick">
+        <!-- 宸︿晶鏍� -->
+        <div style="height:  calc(100vh - 150px);">
+          <avue-tree
+            ref="tree"
+            v-model="treeForm"
+            :data="treeData"
+            :option="treeOption"
+            @node-click="nodeClick">
           <span slot-scope="{ node, data }" class="el-tree-node__label">
-           <span>
-              <i class="el-icon-s-promotion"></i>
+            <span style="display: flex">
+              <icon-show :name="data.icon"></icon-show>
                 {{ (node || {}).label }}
             </span>
           </span>
-            </avue-tree>
-          </div>
+          </avue-tree>
         </div>
       </basic-container>
     </el-aside>
 
     <el-main>
-      <basic-container>
+      <basic-container v-if="treeNodeRow.id === 'root' ">
+        <div class="headerCon">
+          <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
+          </el-button>
+          <!--<el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
+          </el-button>
+          <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
+          </el-button>-->
+          <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
+          </el-button>
+          <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
+          </el-button>
+        </div>
+        <div>
+          <avue-crud
+            ref="treeCrud"
+            v-model="treeForm"
+            :data="treeData[0].childs"
+            :option="treeCrudOption"
+            @row-del="rowTreeDelHandler"
+            @row-save="rowTreeSaveHandler"
+            @row-update="rowTreeUpdataHandler"
+            @refresh-change="handleRefresh">
+          </avue-crud>
+        </div>
+      </basic-container>
+      <basic-container v-else>
         <div>
           <avue-crud
             ref="crud"
@@ -159,66 +169,15 @@
       treeNodeRow: {},
       treeForm: {},
       treeOption: {
-        addBtn: false,
+        menu: false,
         defaultExpandedKeys: ['root'],
         props: {
           label: 'name',
           value: 'id',
           children: 'childs'
-        },
-        dialogWidth:'800',
-        dialogMenuPosition: 'right',
-        formOption: {
-          dialogMenuPosition: 'right',
-          column: [
-            {
-              label: '鍒嗙被鍚嶇О',
-              prop: 'name',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲悕绉�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒嗙被搴忓彿',
-              prop: 'serialno',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲簭鍙�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒涘缓鑰�',
-              prop: 'creator',
-              disabled: true,
-            },
-            {
-              label: '鍒涘缓鏃堕棿',
-              prop: 'createTime',
-              disabled: true,
-            },
-            {
-              label: '鐖朵富绫�',
-              prop: 'pidName',
-              disabled: true,
-              span:24
-            },
-            {
-              label: '澶囨敞',
-              prop: 'description',
-              type:'textarea',
-              span:24
-            },
-          ],
         }
       },
-      treeData: [],
+      treeData: []
     }
   },
   computed:{
@@ -238,6 +197,52 @@
         actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomDel, false),
         actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomEdit, false),
       };
+    },
+    treeCrudOption(){
+      return {
+        ...basicOption,
+        editBtn: this.permissionList.editBtn,
+        delBtn: this.permissionList.delBtn,
+        addBtn: false,
+        calcHeight: -50,
+        highlightCurrentRow: true,
+        menuWidth: 160,
+        span: 24,
+        labelWidth: 100,
+        dialogWidth: '800',
+        column: [{
+          label: '鍒嗙被鍚嶇О',
+          prop: 'name',
+          rules: [{
+            required: true,
+            message: '璇疯緭鍏ュ垎绫诲悕绉�',
+            trigger: 'blur'
+          }]
+        }, {
+          label: '鍒嗙被搴忓彿',
+          prop: 'serialno',
+          rules: [{
+            required: true,
+            message: '璇疯緭鍏ュ垎绫诲簭鍙�',
+            trigger: 'blur'
+          }]
+        }, {
+          label: '鐖朵富绫�',
+          prop: 'pidName',
+          formatter:function(row){
+            if(row.pid=='root'){
+              return 'Action鍒嗙被'
+            }
+          },
+          disabled: true,
+          span: 24
+        }, {
+          label: '澶囨敞',
+          prop: 'description',
+          type: 'textarea',
+          span: 24
+        }],
+      }
     },
     option() {
       return {
@@ -348,12 +353,11 @@
         addBtn: false,
         editBtn:this.permissionList.actionBottomEditBtn,
         delBtn:this.permissionList.actionBottomDelBtn,
-        calcHeight: -30,
+        calcHeight: -20,
         selection: false,
         refreshBtn: false,
         dialogWidth:'700',
         saveBtn:false,
-        // height:'auto',
         column: [
           {
             label: '鍙傛暟鍚嶇О',
@@ -417,7 +421,6 @@
 
     // 鍙充晶琛ㄦ牸淇℃伅
     getRightTableList(row) {
-      console.log(row);
       this.tableLoading = true;
       const params = {
         plactioncls: row.id ? row.id : ''
@@ -686,13 +689,13 @@
       this.$set(this.treeForm, 'creator', creator);
       this.$set(this.treeForm, 'pid', id);
       this.$set(this.treeForm, 'pidName', name);
-      this.$refs.tree.rowAdd();
+      this.$refs.treeCrud.rowAdd();
 
     },
 
     // action鍒嗙被淇濆瓨
-    rowTreeSaveHandler(node, data, done, loading) {
-      saveActionCls(data).then(res => {
+    rowTreeSaveHandler(row, done, loading) {
+      saveActionCls(row).then(res => {
         if (res.data.code === 200) {
           this.$message.success('鍒嗙被鍒涘缓鎴愬姛');
           this.getTreeList();
@@ -728,15 +731,15 @@
       this.$set(this.treeForm, 'pidName', pidName);
       this.$set(this.treeForm, 'description', description);
 
-      this.$refs.tree.rowEdit();
+      this.$refs.treeCrud.rowEdit();
     },
 
     // action鍒嗙被淇敼淇濆瓨
-    rowTreeUpdataHandler(node, data, done, loading) {
-      updateActionCls(data).then(res => {
+    rowTreeUpdataHandler(row, done, loading) {
+      updateActionCls(row).then(res => {
         if (res.data.code === 200) {
           this.$message.success('淇敼鎴愬姛');
-          //this.getBottomList();
+          this.getTreeList();
         }
         done();
       })
@@ -757,6 +760,32 @@
         }
       }
       return 'null';
+    },
+
+    // action鍒嗙被淇敼淇濆瓨
+    rowTreeDelHandler( row) {
+      if (row.id === 'root') {
+        this.$message.error('鏍硅妭鐐逛笉鑳藉垹闄�');
+        return;
+      }
+
+      this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎褰撳墠鏁版嵁鍚楋紵', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        deleteActionCls(row).then(res => {
+          if (res.data.code === 200) {
+            this.$message.success('鍒嗙被鍒犻櫎鎴愬姛');
+            this.getTreeList();
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
     },
 
     // action鍒嗙被鍒犻櫎
@@ -792,12 +821,18 @@
 
     // action鍒嗙被瀵煎嚭
     exportClickHandler() {
-
+      this.$message({
+        type: 'info',
+        message: '寰呭疄鐜�'
+      });
     },
 
     // action鍒嗙被瀵煎叆
     uploadClickHandler() {
-
+      this.$message({
+        type: 'info',
+        message: '寰呭疄鐜�'
+      });
     }
 
   }
@@ -809,8 +844,9 @@
   .el-scrollbar__wrap {
     overflow: auto !important;
   }
+
   .avue-dialog .el-dialog__body .avue-form{
-    margin: 0 auto;
+    margin: 0 auto !important;
   }
 }
 </style>
diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
index 112fc0a..3577ecd 100644
--- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
@@ -223,7 +223,6 @@
         addBtn: false,
         editBtn: false,
         delBtn: false,
-        tip: false,
         searchMenuSpan: 6,
         align: 'left',
         column: [{
diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue
index 451f2a7..4942a5a 100644
--- a/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue
@@ -7,7 +7,7 @@
                      @node-click="nodeClick">
           <span slot-scope="{ node, data }" class="el-tree-node__label">
             <span style="display: flex">
-             <icon-show :name="data.icon" class="iconShowSpan"></icon-show>
+              <icon-show :name="data.icon"></icon-show>
                 {{ (node || {}).label }}
             </span>
           </span>
@@ -69,7 +69,7 @@
           <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">鍒犻櫎
           </el-button>
         </div>
-        <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 200px);overflow: auto;">
+        <el-form ref="form" :model="form" label-width="85px" size="small" style="max-height: calc(100vh - 200px);overflow: auto;">
           <span v-if="form.category !== 1">
             <el-form-item label="妯″潡鍚嶏細">
             <el-input v-model="form.name" :disabled="!editStatus && !addStatus" placeholder="璇疯緭鍏ユā鍧楀悕"></el-input>
@@ -561,12 +561,5 @@
   display: flex;
   justify-content: left;
   margin-bottom: 15px;
-}
-
-.iconShowSpan{
-  display: inline-block;
-  width: 14px !important;
-  height: 14px !important;
-  margin-right: 3px;
 }
 </style>
diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue
index 443976c..78eda45 100644
--- a/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue
@@ -6,8 +6,8 @@
           <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" node-key="id"
                      @node-click="nodeClick">
           <span slot-scope="{ node, data }" class="el-tree-node__label">
-           <span style="display: flex">
-             <icon-show :name="data.icon" class="iconShowSpan"></icon-show>
+            <span style="display: flex">
+              <icon-show :name="data.icon"></icon-show>
                 {{ (node || {}).label }}
             </span>
           </span>
@@ -69,7 +69,7 @@
           <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">鍒犻櫎
           </el-button>
         </div>
-        <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 200px);overflow: auto;">
+        <el-form ref="form" :model="form" label-width="85px" size="small" style="max-height: calc(100vh - 200px);overflow: auto;">
           <span v-if="form.category !== 1">
             <el-form-item label="妯″潡鍚嶏細">
             <el-input v-model="form.name" :disabled="!editStatus && !addStatus" placeholder="璇疯緭鍏ユā鍧楀悕"></el-input>
@@ -552,12 +552,5 @@
   display: flex;
   justify-content: left;
   margin-bottom: 15px;
-}
-
-.iconShowSpan{
-  display: inline-block;
-  width: 14px !important;
-  height: 14px !important;
-  margin-right: 3px;
 }
 </style>

--
Gitblit v1.9.3