|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="permissionList">
|
|
|
+ <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="permissionList">
|
|
|
<div class="permissionList_tree">
|
|
|
<div class="permissionList_tree_head flex">
|
|
|
<div class="permissionList_tree_head_list">名称</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
</div>
|
|
|
<div class="permissionList_tree_body">
|
|
|
<el-scrollbar style="height: 100%" :horizontal="false">
|
|
|
- <el-tree :data="data" show-checkbox node-key="tid" default-expand-all :expand-on-click-node="false">
|
|
|
+ <el-tree ref="tree" :data="data" show-checkbox node-key="tid" default-expand-all :expand-on-click-node="false">
|
|
|
<template slot-scope="{node,data}">
|
|
|
<div class="custom-tree-node flex">
|
|
|
<div class="custom-tree-node-list">{{data.pagename}}</div>
|
|
@@ -40,13 +40,24 @@ import PublicPageDialog from '@/components/PublicPageDialog'
|
|
|
import AdvancedQuery from '@/components/AdvancedQuery'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import { listToTree } from '@/utils/validate'
|
|
|
-
|
|
|
+import { Query } from "@/api/webApi"
|
|
|
export default {
|
|
|
name: 'Permissionlist',
|
|
|
+ props: {
|
|
|
+ listMap: {
|
|
|
+ type: Object,
|
|
|
+ default: () => new Object()
|
|
|
+ },
|
|
|
+ treeMap: {
|
|
|
+ type: Object,
|
|
|
+ default: () => new Object()
|
|
|
+ },
|
|
|
+ },
|
|
|
components: { PublicPageDialog, AdvancedQuery },
|
|
|
data () {
|
|
|
return {
|
|
|
advancedDrawer: false,
|
|
|
+ loading: false,
|
|
|
data: [],
|
|
|
defaultProps: {
|
|
|
children: 'children',
|
|
@@ -54,9 +65,35 @@ export default {
|
|
|
},
|
|
|
defaultKeys: [],
|
|
|
nodeKey: 'pageconfigurationid',
|
|
|
- adDep: 1
|
|
|
+ adDep: 1,
|
|
|
+ dataKey: 'pagename'
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ listMap: {
|
|
|
+ handler (row) {
|
|
|
+ if (Object.keys(row).length) {
|
|
|
+ const queryItem = {}
|
|
|
+ queryItem[this.nodeKey] = row[this.nodeKey]
|
|
|
+ this.queryTreeData(6, queryItem, '用户组')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ treeMap: {
|
|
|
+ handler (row) {
|
|
|
+ const { nodeKey, nodeValue } = row
|
|
|
+ if (nodeKey) this.nodeKey = nodeKey
|
|
|
+ if (nodeValue) {
|
|
|
+ // this.defaultProps.label = nodeValue
|
|
|
+ this.dataKey = nodeValue
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters(['authArrs'])
|
|
|
},
|
|
@@ -86,6 +123,26 @@ export default {
|
|
|
this.$store.dispatch('auth/changeAuthMsg', ndata.children)
|
|
|
this.advancedDrawer = true
|
|
|
},
|
|
|
+ async queryTreeData (serviceid, defaultfilter, pagename) {
|
|
|
+ this.loading = true;
|
|
|
+ const datacontent = { filter: defaultfilter }
|
|
|
+ try {
|
|
|
+ const { code, returnData } = await Query({
|
|
|
+ serviceid,
|
|
|
+ datacontent,
|
|
|
+ event: '0'
|
|
|
+ });
|
|
|
+ if (code == 0) {
|
|
|
+ console.log(returnData)
|
|
|
+ this.$refs.tree.setCheckedKeys([1])
|
|
|
+ } else {
|
|
|
+ this.$message.error(`获取${pagename}数据失败`);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(`获取${pagename}数据失败`);
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|