| | |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | try { |
| | | console.log(data) |
| | | this.TreeValue = data.label.split("</span>")[1].trim(); |
| | | // console.log('TreeValue',this.TreeValue) |
| | | this.TreeValue = data.label; |
| | | this.$emit('TreeValue', this.TreeValue) |
| | | this.nodeClickList = data; |
| | | this.tableHeadDataFateher = [] |
| | |
| | | <el-checkbox |
| | | v-if="item.type === 'checkbox'" |
| | | v-model="row[item.prop]" |
| | | @change="checkBoxToChangeTheEvent(row[item.prop],item.code)" |
| | | :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]"> |
| | | </el-checkbox> |
| | | </template> |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | checkBoxToChangeTheEvent(check,code){ |
| | | // console.log(check,code) |
| | | // if(code === "data_view" && check){ |
| | | // |
| | | // } |
| | | }, |
| | | // 关闭对话框 |
| | | closeDialog() { |
| | | this.$emit('update:visible', false); |
| | |
| | | }, |
| | | //树点击事件 |
| | | async nodeClick(data) { |
| | | const response = this.findTheTopLevelNode(data,this.Treedata) |
| | | console.log('response',response.label) |
| | | this.allButtons = true; |
| | | getAuthButtonList({classifyId: data.oid, code: "classifyTree", authType: "classify_auth"}).then(res => { |
| | | this.btnAuthList = res.data.data; |
| | |
| | | } |
| | | }, |
| | | |
| | | // 递归查找顶层节点Id |
| | | findTheTopLevelNode(data,TreeData){ |
| | | if(data.parentId === ""){ |
| | | return data; |
| | | } |
| | | const parentNode = this.findParentNode(data.parentId, TreeData); |
| | | if (parentNode) { |
| | | return this.findTheTopLevelNode(parentNode, TreeData); // 继续查找父节点 |
| | | } |
| | | }, |
| | | // 递归查找出来多层节点的父节点 |
| | | findParentNode(parentId, TreeData){ |
| | | for (const node of TreeData) { |
| | | if (node.oid === parentId) { |
| | | return node; |
| | | } |
| | | // 如果当前节点还有子节点,继续去查子节点的父节点 |
| | | if (node.children) { |
| | | const parentNode = this.findParentNode(parentId, node.children); |
| | | if (parentNode) { |
| | | return parentNode; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | }, |
| | | async gridCode() { |
| | | try { |
| | | const res = await gridCodeClassifyTemplateAttr({ |