From 404966637eda6881a0f17683c5aacc7c1c34aed8 Mon Sep 17 00:00:00 2001
From: 田源 <tianyuan@vci-tech.com>
Date: 星期四, 16 一月 2025 16:18:34 +0800
Subject: [PATCH] 增加操作类型

---
 Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue |  688 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 452 insertions(+), 236 deletions(-)

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 873a1b4..712d6a3 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
@@ -1,53 +1,88 @@
 <template>
   <el-container>
-
     <el-aside>
       <basic-container>
-        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
-          <div class="headerCon">
-            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">鍒涘缓
-            </el-button>
-            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">淇敼
-            </el-button>
-            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">鍒犻櫎
-            </el-button>
-            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">瀵煎嚭
-            </el-button>
-            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">瀵煎叆
-            </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 style="font-size: 15px">
-              <i class="el-icon-s-promotion"></i>
+            <span style="display: flex">
+              <icon-show v-if="data.icon" :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-show="treeNodeRow.id === 'root' ">
+        <div>
+          <avue-crud
+            ref="treeCrud"
+            v-model="treeForm"
+            :data="treeData[0].children"
+            :option="treeCrudOption"
+            @row-del="rowTreeDelHandler"
+            @row-save="rowTreeSaveHandler"
+            @row-update="rowTreeUpdataHandler"
+            @refresh-change="handleRefresh">
+            <template slot="menuLeft">
+              <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary"
+                         @click="addTreeClickHandler(treeNodeRow)">
+                <icon-show :name="permissionList.addBtn.source"></icon-show>
+                鍒涘缓
+              </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" class="button-custom-icon" plain size="small" type="primary" @click="uploadClickHandler">
+                <icon-show :name="permissionList.importBtn.source"></icon-show>
+                瀵煎叆
+              </el-button>
+              <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary" @click="exportClickHandler">
+                <icon-show :name="permissionList.exportBtn.source"></icon-show>
+                瀵煎嚭
+              </el-button>
+            </template>
+            <template #menu="{ row, index, size }">
+              <el-button v-if="permissionList.editBtn" size="small" type="text"
+                         @click="$refs.treeCrud.rowEdit(row, index)">
+                <icon-show :name="permissionList.editBtn.source"></icon-show>
+                缂栬緫
+              </el-button>
+              <el-button v-if="permissionList.delBtn" size="small" type="text"
+                         @click.stop="rowTreeDelHandler(row,index)">
+                <icon-show :name="permissionList.delBtn.source"></icon-show>
+                鍒犻櫎
+              </el-button>
+              <el-button v-if="permissionList.addBtn" :size="size"
+                         text
+                         type="text"
+                         @click="addTreeClickHandler(row)">
+                <icon-show :name="permissionList.addBtn.source"></icon-show>
+                鏂板瀛愮骇
+              </el-button>
+            </template>
+          </avue-crud>
+        </div>
+      </basic-container>
+      <basic-container v-show="treeNodeRow.id !== 'root'">
         <div>
           <avue-crud
             ref="crud"
             v-model="form"
             :data="data"
             :option="option"
-            :page.sync="page"
             :table-loading="tableLoading"
+            :before-open="beforeOpen"
             @row-del="rowDelHandler"
             @row-save="rowSaveHandler"
             @row-update="rowUpdateHandler"
@@ -56,16 +91,40 @@
             @refresh-change="handleRefresh"
             @selection-change="selectChangeHandler"
             @row-click="rowClickHandler">
+            <template slot="plImage" slot-scope="{row}">
+              <span class="avue-icon">
+                <icon-show :name="row.plImage"></icon-show>
+              </span>
+            </template>
+            <template slot-scope="{type,disabled}" slot="plImageForm">
+              <input-icon :disabled="disabled" v-model="form.plImage"></input-icon>
+            </template>
             <template slot="plTypeType" slot-scope="{row}">
               <el-tag :type="row.plTypeType === 'business' ? '' : 'success'">
                 {{ row.plTypeType === 'business' ? '涓氬姟绫诲瀷' : '閾炬帴绫诲瀷' }}
               </el-tag>
             </template>
             <template slot="menuLeft" slot-scope="scope">
-              <el-button v-if="treeNodeRow.id !== 'root'" icon="el-icon-plus" plain size="small" type="primary"
-                         @click="addClickHandler">澧炲姞
+              <el-button v-if="treeNodeRow.id !== 'root' && permissionList.actionTopAddBtn" class="button-custom-icon" plain size="small" type="primary"
+                         @click="addClickHandler">
+                <icon-show :name="permissionList.actionTopAddBtn.source"></icon-show>
+                澧炲姞
               </el-button>
-              <el-button icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">瀵煎嚭
+              <el-button v-if="permissionList.actionTopExportBtn" class="button-custom-icon" plain size="small" type="success" @click="downLoadHandler">
+                <icon-show :name="permissionList.actionTopExportBtn.source"></icon-show>
+                瀵煎嚭
+              </el-button>
+            </template>
+            <template #menu="{row,index,size}">
+              <el-button v-if="permissionList.actionTopEditBtn" size="small" type="text"
+                         @click="$refs.crud.rowEdit(row, index)">
+                <icon-show :name="permissionList.actionTopEditBtn.source"></icon-show>
+                缂栬緫
+              </el-button>
+              <el-button v-if="permissionList.actionTopDelBtn" size="small" type="text"
+                         @click.stop="rowDelHandler(row,index)">
+                <icon-show :name="permissionList.actionTopDelBtn.source"></icon-show>
+                鍒犻櫎
               </el-button>
             </template>
           </avue-crud>
@@ -74,6 +133,7 @@
         <div style="margin-top: 10px">
           <avue-crud
             ref="BottomCrud"
+            v-model="bottomForm"
             :data="bottomData"
             :option="bottomOption"
             :table-loading="bottomTableLoading"
@@ -82,10 +142,35 @@
             @row-del="BottomRowDelHandler"
           >
             <template slot="menuLeft" slot-scope="scope">
-              <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">澧炲姞
+              <el-button v-if="permissionList.actionBottomAddBtn" class="button-custom-icon" plain size="small" type="primary" @click="bottomAddClickHandler">
+                <icon-show :name="permissionList.actionBottomAddBtn.source"></icon-show>
+                澧炲姞
               </el-button>
             </template>
-
+            <template #menu="{row,index,size}">
+              <el-button v-if="permissionList.actionBottomEditBtn" size="small" type="text"
+                         @click="$refs.BottomCrud.rowEdit(row, index)">
+                <icon-show :name="permissionList.actionBottomEditBtn.source"></icon-show>
+                缂栬緫
+              </el-button>
+              <el-button v-if="permissionList.actionBottomDelBtn" size="small" type="text"
+                         @click.stop="BottomRowDelHandler(row,index)">
+                <icon-show :name="permissionList.actionBottomDelBtn.source"></icon-show>
+                鍒犻櫎
+              </el-button>
+            </template>
+            <template slot="menuForm" slot-scope="scope">
+              <el-button type="primary"
+                         size="small"
+                         icon="el-icon-check"
+                         v-if="scope.type === 'add'"
+                         @click="handleSaveNext()">淇濆瓨鍚庣户缁坊鍔�</el-button>
+              <el-button type="primary"
+                         size="small"
+                         icon="el-icon-circle-plus-outline"
+                         v-if="scope.type === 'add'"
+                         @click="$refs.BottomCrud.rowSave()">淇濆瓨</el-button>
+            </template>
           </avue-crud>
         </div>
       </basic-container>
@@ -122,6 +207,7 @@
 } from '@/api/UI/Action/api'
 import func from "@/util/func";
 import basicOption from "@/util/basic-option";
+import {mapGetters} from "vuex";
 
 export default {
   name: "index",
@@ -138,14 +224,215 @@
       rightRoleData: [],
       form: {},
       bottomTableLoading: false,
+      bottomForm:{},
       bottomData: [],
-      bottomOption: {
+      tableLoading: false,
+      lastIndex: null,
+      selectList: [],
+      data: [],
+      treeNodeRow: {},
+      treeForm: {},
+      treeOption: {
+        menu: false,
+        defaultExpandedKeys: ['root'],
+        props: {
+          label: 'name',
+          value: 'id',
+          children: 'children'
+        }
+      },
+      treeData: []
+    }
+  },
+  computed:{
+    ...mapGetters(["permission"]),
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false),
+        delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false),
+        editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false),
+        exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+        importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+        actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD2, false),
+        actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE2, false),
+        actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT2, false),
+        actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT2, false),
+        actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].ADD3, false),
+        actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].DELETE3, false),
+        actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].EDIT3, false),
+      };
+    },
+    treeCrudOption(){
+      return {
+        ...basicOption,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        calcHeight: -50,
+        highlightCurrentRow: true,
+        rowKey: 'id',
+        rowParentKey: 'pid',
+        menuWidth: 300,
+        span: 24,
+        labelWidth: 100,
+        dialogWidth: '800',
+        align:'left',
+        column: [{
+          label: '鍒嗙被鍚嶇О',
+          prop: 'name',
+          rules: [{
+            required: true,
+            message: '璇疯緭鍏ュ垎绫诲悕绉�',
+            trigger: 'blur'
+          }]
+        }, {
+          label: '鍒嗙被搴忓彿',
+          prop: 'serialno',
+          rules: [{
+            required: true,
+            message: '璇疯緭鍏ュ垎绫诲簭鍙�',
+            trigger: 'blur'
+          }]
+        }, {
+          label: '鐖朵富绫�',
+          prop: 'pidName',
+          disabled: true,
+          span: 24
+        }, {
+          label: '澶囨敞',
+          prop: 'description',
+          type: 'textarea',
+          span: 24
+        }],
+      }
+    },
+    option() {
+      return {
+        ...basicOption,
+        editBtn:false,
+        delBtn:false,
+        addBtn: false,
+        height: 350,
+        highlightCurrentRow: true,
+        menuWidth:160,
+        span:24,
+        labelWidth:100,
+        dialogWidth:'700',
+        column: [
+          {
+            label: '缂栧彿',
+            prop: 'plCode',
+            width: 220,
+            overHidden: true,
+            search: true,
+            rules: [
+              {
+                required: true,
+                message: '璇疯緭鍏ョ紪鍙�',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '鍚嶇О',
+            prop: 'plName',
+            overHidden: true,
+            search: true,
+            rules: [
+              {
+                required: true,
+                message: '璇疯緭鍏ュ悕绉�',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '鍥炬爣',
+            prop: 'plImage',
+            width: 80,
+            rules: [
+              {
+                required: true,
+                message: '璇烽�夋嫨鍥炬爣',
+                trigger: 'submit'
+              }
+            ]
+          },
+          {
+            label: '鍒嗙被',
+            prop: 'plActionCls',
+            type: 'tree',
+            defaultExpandedKeys:['root'],
+            props: {
+              label: 'name',
+              value: 'id',
+              children: 'children'
+            },
+            rules: [
+              {
+                required: true,
+                message: '璇烽�夋嫨鍒嗙被',
+                trigger: 'blur'
+              }
+            ],
+            dicData: []
+          },
+          /*{
+            label: 'C/S绫昏矾寰�',
+            prop: 'plCSClass',
+            hide:true,
+            searchLabelWidth:120,
+            overHidden: true,
+          },*/
+          {
+            label: 'B/S閾炬帴鍦板潃',
+            prop: 'plBSUrl',
+            search: true,
+            searchLabelWidth:120,
+            overHidden: true,
+          },
+          {
+            label: '绫诲瀷',
+            prop: 'plTypeType',
+            search: true,
+            type: 'radio',
+            width:100,
+            dicData: [{
+              label: '涓氬姟绫诲瀷',
+              value: 'business'
+            }, {
+              label: '閾炬帴绫诲瀷',
+              value: 'link'
+            }],
+            rules: [
+              {
+                required: true,
+                message: '璇烽�夋嫨绫诲瀷',
+                trigger: 'blur'
+              }
+            ]
+          },
+          {
+            label: '鎻忚堪',
+            prop: 'plDesc',
+            search: true,
+            overHidden: true,
+            type: 'textarea'
+          },
+        ]
+      }
+    },
+    bottomOption(){
+      return {
         ...basicOption,
         addBtn: false,
-        calcHeight: -30,
+        editBtn:false,
+        delBtn:false,
+        calcHeight: -20,
         selection: false,
         refreshBtn: false,
-        // height:'auto',
+        dialogWidth:'700',
+        saveBtn:false,
         column: [
           {
             label: '鍙傛暟鍚嶇О',
@@ -170,156 +457,7 @@
             rows: 4
           },
         ],
-      },
-      tableLoading: false,
-      lastIndex: null,
-      selectList: [],
-      data: [],
-      option: {
-        ...basicOption,
-        addBtn: false,
-        height: 350,
-        highlightCurrentRow: true,
-        column: [
-          {
-            label: '缂栧彿',
-            prop: 'plCode',
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: '璇疯緭鍏ョ紪鍙�',
-                trigger: 'blur'
-              }
-            ]
-          },
-          {
-            label: '鍚嶇О',
-            prop: 'plName',
-            search: true,
-            rules: [
-              {
-                required: true,
-                message: '璇疯緭鍏ュ悕绉�',
-                trigger: 'blur'
-              }
-            ]
-          },
-          {
-            label: '绫昏矾寰�',
-            prop: 'plCSClass',
-            search: true,
-            overHidden: true,
-          },
-          {
-            label: '鍒嗙被',
-            prop: 'plActionCls',
-            type: 'tree',
-            hide: true,
-            props: {
-              label: 'name',
-              value: 'id',
-              children: 'childs'
-            },
-            rules: [
-              {
-                required: true,
-                message: '璇烽�夋嫨鍒嗙被',
-                trigger: 'blur'
-              }
-            ],
-            dicData: []
-          },
-          {
-            label: '閾炬帴鍦板潃',
-            prop: 'plBSUrl',
-            search: true,
-          },
-          {
-            label: '绫诲瀷',
-            prop: 'plTypeType',
-            search: true,
-            type: 'select',
-            dicData: [{
-              label: '涓氬姟绫诲瀷',
-              value: 'business'
-            }, {
-              label: '閾炬帴绫诲瀷',
-              value: 'link'
-            }],
-            rules: [
-              {
-                required: true,
-                message: '璇烽�夋嫨绫诲瀷',
-                trigger: 'blur'
-              }
-            ]
-          },
-          {
-            label: '鎻忚堪',
-            prop: 'plDesc',
-            search: true,
-            overHidden: true,
-          },
-        ]
-      },
-      treeNodeRow: {},
-      treeForm: {},
-      treeOption: {
-        addBtn: false,
-        defaultExpandedKeys: ['root'],
-        props: {
-          label: 'name',
-          value: 'id',
-          children: 'childs'
-        },
-        formOption: {
-          column: [
-            {
-              label: '鍒嗙被鍚嶇О',
-              prop: 'name',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲悕绉�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒嗙被搴忓彿',
-              prop: 'serialno',
-              rules: [
-                {
-                  required: true,
-                  message: '璇疯緭鍏ュ垎绫诲簭鍙�',
-                  trigger: 'blur'
-                }
-              ]
-            },
-            {
-              label: '鍒涘缓鑰�',
-              prop: 'creator',
-              readonly: true,
-            },
-            {
-              label: '鍒涘缓鏃堕棿',
-              prop: 'createTime',
-              readonly: true,
-            },
-            {
-              label: '鐖朵富绫�',
-              prop: 'pidName',
-              readonly: true,
-            },
-            {
-              label: '澶囨敞',
-              prop: 'description'
-            },
-          ],
-        }
-      },
-      treeData: [],
+      }
     }
   },
   created() {
@@ -333,17 +471,34 @@
       }
       getActionTree(params).then(res => {
         const data = res.data.obj;
-        this.treeData = [data];
+        this.treeData = this.treeDataFormAtter([data],'Action鍒嗙被');
         const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 鎵惧埌action娣诲姞鍒嗙被鏍�
-        selectTreeData.dicData = [data];
+        const dicData=this.treeData;
+        dicData[0].disabled=true;//鍒嗙被鏍硅妭鐐逛笉鑳介��
+        selectTreeData.dicData = dicData;
+        selectTreeData.hide=true;//闅愯棌鍒嗙被鍒椼�備笉鑳界洿鎺ュ湪option璁剧疆锛屼細瀵煎嚭dicData鍔犺浇涓嶅嚭
       })
+    },
+
+    treeDataFormAtter(items,pidName) {
+      return items.map(item => {
+        // 杞崲褰撳墠鑺傜偣鐨勫睘鎬�
+        const formList = {
+          ...item,
+          pidName:pidName,
+          children: item.childs && item.childs.length > 0 ? this.treeDataFormAtter(item.childs,item.name) : undefined
+        };
+        return formList;
+      });
     },
 
     // 宸︿晶鏍戣鐐瑰嚮
     nodeClick(row) {
       this.treeNodeRow = row;
-      this.getRightTableList(row);
-      this.bottomData = [];
+      if(this.treeNodeRow.id !== 'root'){
+        this.getRightTableList(row);
+        this.bottomData = [];
+      }
     },
 
     // 澶撮儴鍒锋柊鎸夐挳
@@ -358,7 +513,7 @@
     getRightTableList(row) {
       this.tableLoading = true;
       const params = {
-        plactioncls: row.id
+        plactioncls: row.id ? row.id : ''
       }
       getActionTableData(params).then(res => {
         const data = res.data.data;
@@ -383,7 +538,7 @@
           this.lastIndex = newIndex;
         },
         () => {
-          this.selectList = [];
+          this.selectList = [row];
         }
       );
 
@@ -399,7 +554,7 @@
       }
       this.tableLoading = true;
       const apiParams = {
-        plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id,
+        plactioncls: this.treeNodeRow.id === 'root' ? '' : this.treeNodeRow.id ? this.treeNodeRow.id : '',
         ...params
       }
 
@@ -420,6 +575,16 @@
       this.getRightTableList(this.treeNodeRow);
     },
 
+    beforeOpen(done, type, loading) {
+      if ([ 'edit'].includes(type)) {
+        // 缂栬緫閫昏緫
+        this.$set(this.option.column[3],'disabled',false);
+      } else {
+        // 鏂板閫昏緫
+        this.$set(this.option.column[3],'disabled',true);
+      }
+      done();
+    },
     // action鍒楄〃澧炲姞
     addClickHandler() {
       if (func.isEmptyObject(this.treeNodeRow)) {
@@ -464,29 +629,24 @@
       this.leftRoleData = [{
         name: '缂栧彿',
         oid: '缂栧彿'
-      },
-        {
-          name: '绫昏矾寰�',
-          oid: '绫昏矾寰�'
-        },
-        {
-          name: '閾炬帴鍦板潃',
-          oid: '閾炬帴鍦板潃'
-        },
-        {
-          name: '绫诲瀷',
-          oid: '绫诲瀷'
-        },
-        {
-          name: '鎻忚堪',
-          oid: '鎻忚堪'
-        },]
+      }, {
+        name: '绫昏矾寰�',
+        oid: '绫昏矾寰�'
+      }, {
+        name: '閾炬帴鍦板潃',
+        oid: '閾炬帴鍦板潃'
+      }, {
+        name: '绫诲瀷',
+        oid: '绫诲瀷'
+      }, {
+        name: '鎻忚堪',
+        oid: '鎻忚堪'
+      },]
       this.$refs.transfer.visible = true;
     },
 
     // 绌挎妗嗕繚瀛� index涓�0鏄�夋嫨 1鏄叏閮�
     exportSendHandler(row, index) {
-      console.log(row, index);
       const params = {
         dataType: index,
         chooseDataOid: index === 0 ? this.selectList.map(item => item.plOId) : [],
@@ -497,9 +657,7 @@
       exportAction(params).then(res => {
         func.downloadFileByBlobHandler(res);
         this.$message.success('瀵煎嚭鎴愬姛');
-      }).catch(err => {
-        this.$message.error(err);
-      })
+      });
     },
 
     // action鍒楄〃琛屽垹闄�
@@ -544,6 +702,7 @@
 
     // 鍙傛暟鍒楄〃鏂板淇濆瓨
     BottomRowSaveHandler(form, done, loading) {
+      form.actionOid=this.currenRow.plOId;
       savePLActionParam(form).then(res => {
         if (res.data.code === 200) {
           this.$message.success('娣诲姞鎴愬姛');
@@ -553,7 +712,24 @@
       })
       loading();
     },
+    handleSaveNext(){
+      this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.validate((valid) => {
+        if (valid) {
+          this.bottomForm.actionOid=this.currenRow.plOId;
+          savePLActionParam(this.bottomForm).then(res => {
+            if (res.data.code === 200) {
+              this.$message.success('娣诲姞鎴愬姛');
+              this.bottomForm={};
+              this.getBottomList();
+              this.$refs.BottomCrud.$refs.dialogForm.$refs.tableForm.$refs.form.resetFields()
+            }
+          })
+        } else {
+          return false;
+        }
+      });
 
+    },
     // 鍙傛暟鍒楄〃淇敼淇濆瓨
     BottomRowUpdateHandler(row, index, done, loading) {
       updatePLActionParam(row).then(res => {
@@ -588,30 +764,37 @@
     },
 
     // 宸︿晶鏍戝垱寤�
-    addTreeClickHandler() {
-      if (func.isEmptyObject(this.treeNodeRow)) {
+    addTreeClickHandler(row) {
+      let parentRow=row;
+      if(!row || !row.id){
+        parentRow=this.treeNodeRow
+      }
+      if (func.isEmptyObject(parentRow)) {
         this.$message.error('璇烽�夋嫨涓�鏉″垎绫昏繘琛屾坊鍔�');
         return;
       }
-
-      const {createTime, creator, name, id, description} = this.treeNodeRow;
+      if (!parentRow.id && parentRow.name=='鏈垎绫�') {
+        this.$message.error('鏈垎绫讳笅涓嶈兘鍒涘缓瀛愬垎绫�');
+        return;
+      }
+      const {createTime, creator, name, id, description} = parentRow;
       this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
       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();
         }
-        done();
       })
+      done();
       loading();
     },
 
@@ -626,6 +809,10 @@
         this.$message.error('鏍硅妭鐐逛笉鑳戒慨鏀�');
         return;
       }
+      if (!this.treeNodeRow.id && this.treeNodeRow.name=='鏈垎绫�') {
+        this.$message.error('鏈垎绫讳笉鑳戒慨鏀�');
+        return;
+      }
       const {name, serialno, creator, createTime, pid, description, id} = this.treeNodeRow;
       const pidName = this.findObjectNameById(this.treeData, pid);
       this.$set(this.treeForm, 'name', name);
@@ -637,15 +824,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();
       })
@@ -666,6 +853,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鍒嗙被鍒犻櫎
@@ -701,12 +914,18 @@
 
     // action鍒嗙被瀵煎嚭
     exportClickHandler() {
-
+      this.$message({
+        type: 'info',
+        message: '寰呭疄鐜�'
+      });
     },
 
     // action鍒嗙被瀵煎叆
     uploadClickHandler() {
-
+      this.$message({
+        type: 'info',
+        message: '寰呭疄鐜�'
+      });
     }
 
   }
@@ -718,12 +937,9 @@
   .el-scrollbar__wrap {
     overflow: auto !important;
   }
-}
 
-.smallBtn {
-  width: 82px;
-  text-align: center;
-  padding-left: 4.5px;
+  .avue-dialog .el-dialog__body .avue-form{
+    margin: 0 auto !important;
+  }
 }
-
 </style>

--
Gitblit v1.9.3