|
@@ -14,8 +14,6 @@
|
|
>
|
|
>
|
|
</p>
|
|
</p>
|
|
<div class="tree__content">
|
|
<div class="tree__content">
|
|
- <!-- @node-click="handleNodeClick" -->
|
|
|
|
-
|
|
|
|
<dg-tree
|
|
<dg-tree
|
|
ref="authTree"
|
|
ref="authTree"
|
|
node-key="id"
|
|
node-key="id"
|
|
@@ -34,12 +32,12 @@
|
|
<i class="el-icon-document" v-else></i>
|
|
<i class="el-icon-document" v-else></i>
|
|
<span>
|
|
<span>
|
|
<span class="tree-node__name">{{ data.label }}</span>
|
|
<span class="tree-node__name">{{ data.label }}</span>
|
|
- <span
|
|
|
|
|
|
+ <!-- <span
|
|
class="tree-node__operate"
|
|
class="tree-node__operate"
|
|
v-if="!data.treeNode && tab == 'TABLE'"
|
|
v-if="!data.treeNode && tab == 'TABLE'"
|
|
@click="handleViewCheckList($event, data)"
|
|
@click="handleViewCheckList($event, data)"
|
|
>查看数据资源</span
|
|
>查看数据资源</span
|
|
- >
|
|
|
|
|
|
+ > -->
|
|
<el-popover placement="top-start" width="400" trigger="hover" :open-delay="1000">
|
|
<el-popover placement="top-start" width="400" trigger="hover" :open-delay="1000">
|
|
<div class="tip-box">
|
|
<div class="tip-box">
|
|
<h3>{{ data.label }}</h3>
|
|
<h3>{{ data.label }}</h3>
|
|
@@ -58,6 +56,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import tableCheckLayer from "./table-check-layer";
|
|
import tableCheckLayer from "./table-check-layer";
|
|
|
|
+import { reactTree } from "@/api/data-auth"
|
|
export default {
|
|
export default {
|
|
props: {
|
|
props: {
|
|
treeData: {
|
|
treeData: {
|
|
@@ -74,7 +73,8 @@ export default {
|
|
idcard: {
|
|
idcard: {
|
|
type: String,
|
|
type: String,
|
|
default: ""
|
|
default: ""
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ reactTree: Boolean,
|
|
},
|
|
},
|
|
activated() {},
|
|
activated() {},
|
|
components: {},
|
|
components: {},
|
|
@@ -95,27 +95,66 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
|
|
+ watch: {
|
|
|
|
+ // treeData: {
|
|
|
|
+ // deep: true,
|
|
|
|
+ // handler(val){
|
|
|
|
+ // debugger
|
|
|
|
+ // this.selectkeys = val.selectNodes ? val.selectNodes.map((item) => item.dataId) : [];
|
|
|
|
+ // this.selectNodesNum = this.selectkeys.length;
|
|
|
|
+ // console.log("selectkeys",this.selectkeys)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
- /**
|
|
|
|
- * @description: 点击节点
|
|
|
|
- * @param {*} node
|
|
|
|
- */
|
|
|
|
- handleNodeClick(node, a, b) {
|
|
|
|
- const { id, isParent, name } = node;
|
|
|
|
- if (this.selectkeys.includes(id)) {
|
|
|
|
- this.$refs.authTree.setChecked(id, false, true);
|
|
|
|
- } else {
|
|
|
|
- this.$refs.authTree.setChecked(id, true, true);
|
|
|
|
- }
|
|
|
|
- this.getSelectKeys();
|
|
|
|
- },
|
|
|
|
/**
|
|
/**
|
|
* @description: 复选框选中值
|
|
* @description: 复选框选中值
|
|
* @param {object} data 当前选中数据
|
|
* @param {object} data 当前选中数据
|
|
* @param {array} checkedKeys 当前选中key集合
|
|
* @param {array} checkedKeys 当前选中key集合
|
|
*/
|
|
*/
|
|
- handleCheckTree(data, { checkedKeys }) {
|
|
|
|
|
|
+ handleCheckTree(data, params) {
|
|
this.getSelectKeys();
|
|
this.getSelectKeys();
|
|
|
|
+
|
|
|
|
+ // 勾选联动,点击数据资源分类和字段分类的数据会联动,点击其他的不联动
|
|
|
|
+ if (data.classifyCode !== "DATA_LEVEL" && data.classifyCode !== "COLUMN_SECURITY_LEVEL" && data.classifyCode !== "COLUMN_RELATION_CATALOG") {
|
|
|
|
+ let vo = {
|
|
|
|
+ operateType: "",
|
|
|
|
+ operateList: [],
|
|
|
|
+ authList: []
|
|
|
|
+ }
|
|
|
|
+ console.log(this.oldSelectNodes)
|
|
|
|
+ const currentCheckNodes = this.$refs.authTree.getCheckedNodes(true);
|
|
|
|
+ if (currentCheckNodes.length > this.oldSelectNodes.length) {
|
|
|
|
+ // 说明是新增节点
|
|
|
|
+ vo.operateType = "ADD";
|
|
|
|
+ for (let i = 0; i < currentCheckNodes.length; i++) {
|
|
|
|
+ const {id, code, classifyCode} = currentCheckNodes[i];
|
|
|
|
+ if (this.oldSelectNodes.filter(item => item.id == id) < 1) {
|
|
|
|
+ vo.operateList.push({
|
|
|
|
+ dataId: id,
|
|
|
|
+ dataCode: code,
|
|
|
|
+ classifyCode
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // 说明是取消节点
|
|
|
|
+ vo.operateType = "DEL";
|
|
|
|
+ for (let i = 0; i < this.oldSelectNodes.length; i++) {
|
|
|
|
+ const {id, code, classifyCode} = this.oldSelectNodes[i];
|
|
|
|
+ if (currentCheckNodes.filter(item => item.id == id) < 1) {
|
|
|
|
+ vo.operateList.push({
|
|
|
|
+ dataId: id,
|
|
|
|
+ dataCode: code,
|
|
|
|
+ classifyCode
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.oldSelectNodes = currentCheckNodes;
|
|
|
|
+ this.$emit("checkChange", vo)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* @description: 获取选中的节点key
|
|
* @description: 获取选中的节点key
|
|
@@ -126,15 +165,16 @@ export default {
|
|
this.selectNodesNum = this.selectkeys.length;
|
|
this.selectNodesNum = this.selectkeys.length;
|
|
const nodes = selectNodes.map((item) => {
|
|
const nodes = selectNodes.map((item) => {
|
|
return {
|
|
return {
|
|
- dataType: item.dataType,
|
|
|
|
|
|
+ dataCode: item.code,
|
|
dataId: item.id,
|
|
dataId: item.id,
|
|
- innerId: item.innerId
|
|
|
|
|
|
+ classifyCode: item.classifyCode
|
|
};
|
|
};
|
|
});
|
|
});
|
|
this.$emit("getSelectNodes", {
|
|
this.$emit("getSelectNodes", {
|
|
type: this.treeData.id,
|
|
type: this.treeData.id,
|
|
selectNodes: nodes
|
|
selectNodes: nodes
|
|
});
|
|
});
|
|
|
|
+ // return nodes
|
|
},
|
|
},
|
|
|
|
|
|
// 查看清单
|
|
// 查看清单
|
|
@@ -146,8 +186,7 @@ export default {
|
|
content: tableCheckLayer,
|
|
content: tableCheckLayer,
|
|
props: {
|
|
props: {
|
|
tab: vm.tab,
|
|
tab: vm.tab,
|
|
- codeDataTypeStr: data.codeDataTypeStr,
|
|
|
|
- idcard: vm.idcard
|
|
|
|
|
|
+ resourceId: data.id
|
|
},
|
|
},
|
|
on: {
|
|
on: {
|
|
success(params) {
|
|
success(params) {
|
|
@@ -165,6 +204,14 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.selectkeys = this.treeData.selectNodes ? this.treeData.selectNodes.map((item) => item.dataId) : [];
|
|
this.selectkeys = this.treeData.selectNodes ? this.treeData.selectNodes.map((item) => item.dataId) : [];
|
|
|
|
+ const oldSelectNodes = this.$lodash.cloneDeep(this.treeData.selectNodes || []);
|
|
|
|
+ this.oldSelectNodes = oldSelectNodes.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.dataId,
|
|
|
|
+ code: item.dataCode,
|
|
|
|
+ classifyCode: item.classifyCode
|
|
|
|
+ }
|
|
|
|
+ })
|
|
this.selectNodesNum = this.selectkeys.length;
|
|
this.selectNodesNum = this.selectkeys.length;
|
|
this.defaultExpandKeys = this.treeData.nodes[0] ? [this.treeData.nodes[0].id] : [];
|
|
this.defaultExpandKeys = this.treeData.nodes[0] ? [this.treeData.nodes[0].id] : [];
|
|
},
|
|
},
|