From 2ad2a3cdd0df63b6557789ba8a9d968984fe5da3 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期二, 26 十一月 2024 16:25:31 +0800
Subject: [PATCH] 调整页面

---
 Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue |  251 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 192 insertions(+), 59 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
index 308c333..f3955f1 100644
--- a/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue
@@ -1,33 +1,17 @@
 <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="addClickHandler">鍒涘缓
-            </el-button>
-            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">淇敼
-            </el-button>
-            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">鍒犻櫎
-            </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>
-            <el-button class="smallBtn" plain size="small" type="primary"
-                       @click="checkViewClickHandler">鏌ョ湅浣跨敤鑼冨洿
-            </el-button>
-          </div>
+        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
           <!-- 宸︿晶鏍�         -->
-          <div style="height:  calc(100vh - 280px);">
+          <div style="height:  calc(100vh - 190px);">
             <avue-tree :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>
-                {{ (node || {}).label }}
-            </span>
-          </span>
+              <span slot-scope="{ node, data }" class="el-tree-node__label">
+               <span style="font-size: 15px">
+                  <i class="el-icon-s-promotion"></i>
+                    {{ (node || {}).label }}
+                </span>
+              </span>
             </avue-tree>
           </div>
         </div>
@@ -36,6 +20,43 @@
 
     <el-main>
       <basic-container>
+        <avue-crud
+          ref="crud"
+          :data="data"
+          :option="option"
+          :table-loading="tableLoading"
+          @refresh-change="handleRefresh"
+          @selection-change="selectChange"
+          @row-click="rowClickHandler">
+          <template slot="menuLeft">
+            <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">娣诲姞</el-button>
+            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">鍒犻櫎</el-button>
+            <el-button icon="el-icon-view" plain size="small" type="primary" @click="chekView">鏌ョ湅鎺堟潈缁撴灉</el-button>
+          </template>
+        </avue-crud>
+        <div>
+          <data-view key="dataView"></data-view>
+        </div>
+        <!-- 鏌ョ湅鎺堟潈缁撴灉    -->
+        <el-dialog
+          v-dialogDrag
+          v-loading="checkViewLoading"
+          :visible.sync="checkViewVisible"
+          append-to-body="true"
+          class="avue-dialog"
+          title="鏌ョ湅浣跨敤鑼冨洿"
+          width="60%"
+        >
+          <avue-crud
+            ref="checkViewCrud"
+            :data="checkViewData"
+            :option="checkViewOption"
+            @search-change="checkHandleSearch"
+            @search-reset="checkHandleReset"
+          >
+
+          </avue-crud>
+        </el-dialog>
       </basic-container>
     </el-main>
 
@@ -43,8 +64,154 @@
 </template>
 
 <script>
+import {getBizTree} from "@/api/UI/uiDefine";
+import basicOption from "@/util/basic-option";
+import dataView from "./dataView";
+import {getTypeActionByType} from "@/api/authority/ui/typeAction";
+import func from "@/util/func";
+import {getUsedEnumList} from "@/api/modeling/enumType/api";
 export default {
-  name: "index"
+  name: "index",
+  components:{dataView},
+  data:function (){
+    return{
+      treeOption: {
+        height: 'auto',
+        defaultExpandAll: true,
+        menu: false,
+        addBtn: false,
+        props: {
+          label: 'text',
+          value: 'oid',
+          children: 'children'
+        }
+      },
+      nodeRow: {},
+      treeData: [],
+      tableLoading: false,
+      selectList: [],
+      option: {
+        ...basicOption,
+        height:260,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        filterBtn:false,
+        columnBtn:false,
+        gridBtn:false,
+        tip: false,
+        align: 'left',
+        menu:false,
+        column: [
+          {
+            label: '瑙勫垯鍚嶇О',
+            prop: 'plCode',
+            overHidden: true
+          },
+          {
+            label: '瑙勫垯绫诲瀷',
+            prop: 'plName',
+            overHidden: true
+          }
+        ]
+      },
+      data: [],
+    }
+  },
+  created() {
+    this.getTreeList();
+  },
+  methods: {
+    //鏍戣〃鏌ヨ
+    getTreeList() {
+      const loading = this.$loading({});
+      getBizTree().then(res => {
+        this.treeData = [res.data.obj];
+        loading.close();
+      }).catch(error => {
+        loading.close();
+      })
+    },
+    // 鏍戠偣鍑�
+    nodeClick(row) {
+      if (row.oid) {
+        this.nodeRow = row;
+        this.getTableList();
+      }
+    },
+    getTableList() {
+      getTypeActionByType({
+        'typeName': this.nodeRow.attributes.name,
+      }).then(res => {
+        this.data = res.data.data;
+        this.$refs.crud.clearSelection();
+        this.tableLoading = false;
+      })
+    },
+    handleRefresh() {
+      this.getTableList();
+    },
+    // 琛岀偣鍑�
+    rowClickHandler(row) {
+      func.rowClickHandler(
+        row,
+        this.$refs.crud,
+        this.lastIndex,
+        (newIndex) => {
+          this.lastIndex = newIndex;
+        },
+        () => {
+          this.selectList = [row];
+        }
+      );
+    },
+    // 閫夋嫨妗�
+    selectChange(row) {
+      this.selectList = row;
+    },
+    // 鏌ョ湅鎺堟潈缁撴灉
+    chekView() {
+      if (this.selectList.length <= 0) {
+        this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+        return;
+      }
+      if (this.selectList.length > 1) {
+        this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹繘琛屾煡鐪�');
+        return;
+      }
+
+      getUsedEnumList({enumName: this.selectList[0].id}).then(res => {
+        if (res.data.code === 200) {
+          this.checkViewVisible = true;
+          this.checkViewData = res.data.data;
+          this.checkViewDataSearch = res.data.data;
+        }
+      })
+    },
+
+    // 鏌ョ湅鎺堟潈缁撴灉鏌ヨ
+    checkHandleSearch(params, done) {
+      const {source} = params;
+
+      if (!params.source) {
+        this.checkViewData = this.checkViewDataSearch;
+        return done();
+      }
+      ;
+
+      this.checkViewData = this.checkViewData.filter(item => {
+        return item.source && item.source.includes(source);
+      });
+
+      done();
+
+    },
+
+    // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
+    checkHandleReset() {
+      this.checkViewData = this.checkViewDataSearch;
+    },
+  }
 }
 </script>
 
@@ -53,40 +220,6 @@
   .el-scrollbar__wrap {
     overflow: auto !important;
   }
-  .headerCon{
-    .el-button{
-      width: 82px;
-    }
-  }
-}
-
-.headerCon {
-  display: flex;
-  flex-wrap: wrap;
-  margin-bottom: 5px;
-
-  .el-button + .el-button {
-    margin-left: 5px;
-  }
-
-  .el-button {
-    margin-top: 5px;
-  }
-}
-
-.headerCon > .el-button:nth-child(4) {
-  margin-left: 0;
-}
-
-.headerCon > .el-button:nth-child(7) {
-  margin-left: 0;
-}
-
-
-.smallBtn {
-  width: 82px;
-  text-align: center;
-  padding-left: 4.5px;
 }
 
 </style>

--
Gitblit v1.9.3