From f31d6505363fa191fb715976826369484c26cf16 Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期二, 03 十二月 2024 12:05:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/plt-web/plt-web-ui/src/views/authority/ui/dataAuthorization/index.vue |  227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 226 insertions(+), 1 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 45507cf..3ed864f 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
@@ -19,7 +19,61 @@
     </el-aside>
 
     <el-main>
-      <basic-container>
+      <basic-container cardBodyStyle="padding-bottom:0;">
+        <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 style="margin-top: 15px;">
+          <data-view key="dataView" :btmNode="nodeRow" :data="viewData" :actionDic="actionMap" :readOnly="true" :height="clientHeight-260-220"></data-view>
+        </div>
+        <!-- 鏂板 && 缂栬緫 -->
+        <el-dialog
+          v-dialogDrag
+          :title="title === 'add' ? '鍒涘缓' : '淇敼'"
+          :visible.sync="visible"
+          append-to-body="true"
+          class="avue-dialog"
+          width="70%"
+          @close="addDialogClose">
+            <div>
+              <data-view ref="editView" key="editView" :btmNode="nodeRow" :data="viewData" :actionDic="actionMap" :readOnly="false" :height="clientHeight-340"></data-view>
+            </div>
+            <span slot="footer" class="dialog-footer">
+               <el-button size="small" type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button>
+               <el-button size="small" @click="addDialogClose">鍙� 娑�</el-button>
+            </span>
+        </el-dialog>
+        <!-- 鏌ョ湅鎺堟潈缁撴灉    -->
+        <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>
 
@@ -28,10 +82,17 @@
 
 <script>
 import {getBizTree} from "@/api/UI/uiDefine";
+import basicOption from "@/util/basic-option";
+import dataView from "./dataView";
+import {getData,saveGrand,delGrand} from "@/api/authority/ui/dataAuthor";
+import func from "@/util/func";
+import {getUsedEnumList} from "@/api/modeling/enumType/api";
 export default {
   name: "index",
+  components:{dataView},
   data:function (){
     return{
+      clientHeight:Math.max(document.body.clientHeight,700),
       treeOption: {
         height: 'auto',
         defaultExpandAll: true,
@@ -45,6 +106,39 @@
       },
       nodeRow: {},
       treeData: [],
+      tableLoading: false,
+      selectList: [],
+      option: {
+        ...basicOption,
+        height:280,
+        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: [],
+      viewData:{},
+      title: '',
+      visible: false,
+      form:{},
+      actionMap:{}
     }
   },
   created() {
@@ -69,7 +163,138 @@
       }
     },
     getTableList() {
+      getData({
+        'typeName': this.nodeRow.attributes.name,
+      }).then(res => {
+        this.data = res.data.obj.rowList;
+        this.$refs.crud.clearSelection();
+        this.tableLoading = false;
+        this.actionMap=res.data.obj.actionMap
+      })
+    },
+    handleRefresh() {
+      this.getTableList();
+    },
+    // 琛岀偣鍑�
+    rowClickHandler(row) {
+      func.rowClickHandler(
+        row,
+        this.$refs.crud,
+        this.lastIndex,
+        (newIndex) => {
+          this.lastIndex = newIndex;
+        },
+        () => {
+          this.selectList = [row];
+        }
+      );
+      this.getViewData(row)
+    },
+    // 閫夋嫨妗�
+    selectChange(row) {
+      this.selectList = row;
+    },
+    //鑾峰彇涓嬫柟鏁版嵁
+    getViewData(row){
+      this.viewData={
+        oid:row.plOId
+      };
+    },
+    // 鏌ョ湅鎺堟潈缁撴灉
+    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();
+
+    },
+    //鍒涘缓
+    addHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇烽�夋嫨瑕佹坊鍔犵殑鑺傜偣');
+        return;
+      }
+      this.title = 'add';
+      this.visible = true;
+    },
+    //淇敼
+    editHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�');
+        return;
+      }
+      this.title = 'edit';
+      this.visible = true;
+    },
+    // 鏂板缂栬緫淇濆瓨
+    addDialogSavaHandler() {
+      saveGrand(this.viewData).then(res => {
+        if (res.data.code === 200) {
+          this.$message.success(res.data.obj);
+          this.getTableList();
+          this.addDialogClose();
+        }
+      })
+    },
+    // 鏂板缂栬緫瀵硅瘽妗嗗彇娑�
+    addDialogClose() {
+      this.visible = false;
+    },
+    //鍒犻櫎
+    delHandler(){
+      if (func.isEmptyObject(this.nodeRow)) {
+        this.$message.error('璇烽�夋嫨鏁版嵁');
+        return;
+      }
+      this.$confirm('鎮ㄧ‘瀹氳鍒犻櫎鎵�閫夋嫨鐨勬暟鎹悧锛�', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        delGrand({name:this.templateForm}).then(res => {
+          if (res.data.code === 200) {
+            this.$message.success(res.data.obj);
+            this.getTableList();
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '宸插彇娑堝垹闄�'
+        });
+      });
+    },
+    // 鏌ョ湅浣跨敤鑼冨洿閲嶇疆
+    checkHandleReset() {
+      this.checkViewData = this.checkViewDataSearch;
     },
   }
 }

--
Gitblit v1.9.3