From 1d8ffe35090c3e541dc2e0d9a26a4ef1c853d3b1 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 27 九月 2024 18:10:20 +0800 Subject: [PATCH] UI授权 --- Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 109 ++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 84 insertions(+), 25 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue index 308c333..e29f4a0 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/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 - 200px);"> <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-user-solid"></i> + {{ (node || {}).label }} + </span> + </span> </avue-tree> </div> </div> @@ -43,8 +27,83 @@ </template> <script> +import {gridRoles} from "@/api/system/role/api"; +import {getUIAuthor,authorizedUI} from "@/api/authority/ui/uiAuthor"; + export default { - name: "index" + name: "index", + data() { + return { + type:'',//涓氬姟绫诲瀷 + treeOption: { + height: '500px', + menu: false, + addBtn: false, + props: { + label: 'name', + value: 'oid', + children: 'children' + } + }, + nodeRow: {}, + treeData: [], + uiTreeOption: { + height: '500px', + menu: false, + addBtn: false, + filter:false, + props: { + label: 'name', + value: 'oid', + children: 'children' + } + }, + uiTreeData: [], + } + }, + created() { + this.getTreeList() + }, + methods:{ + getTreeList() { + const loading = this.$loading({}); + gridRoles().then(res => { + this.treeData = res.data.data; + loading.close(); + }).catch(error=>{ + loading.close(); + }) + }, + // 瑙掕壊鐐瑰嚮 + nodeClick(row) { + this.nodeRow = row; + const loading = this.$loading({}); + getUIAuthor().then(res => { + this.uiTreeData = res.data.data; + loading.close(); + }).catch(error=>{ + loading.close(); + }) + }, + saveHandler() { + this.$refs.form.validate((valid) => { + if (valid) { + const formData={} + authorizedUI(formData).then(res => { + if (res.data.success) { + this.$message.success("淇濆瓨鎴愬姛"); + this.cancelDialog(); + } + }); + } else { + return false; + } + }); + }, + clearValue(){ + this.$refs.uiTree.setCheckedNodes([]) + } + } } </script> -- Gitblit v1.9.3