From dcf9c9e0410fe1186239e3f8d6f7bdc789c08010 Mon Sep 17 00:00:00 2001 From: lzhe <lzhe@example.com> Date: 星期三, 05 六月 2024 18:00:39 +0800 Subject: [PATCH] 1 --- src/views/mdc/MYTree.vue | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/views/mdc/MYTree.vue b/src/views/mdc/MYTree.vue index 687ad0d..1713833 100644 --- a/src/views/mdc/MYTree.vue +++ b/src/views/mdc/MYTree.vue @@ -1,7 +1,7 @@ <!-- * @Date: 2024-04-18 19:53:35 * @LastEditors: Sneed - * @LastEditTime: 2024-04-23 23:09:18 + * @LastEditTime: 2024-06-04 21:33:08 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue --> <template> @@ -21,6 +21,12 @@ getAll: { type: Boolean, default: false + }, + props: { + type: Object, + default: () => { + return {} + } } }, data() { @@ -31,10 +37,11 @@ defalutProps: { label: 'title', children: 'children', - disabled: 'disabled', + disabled: this.showCheckbox ? '' : 'disabled', class: (data, node) => { return this.value.includes(data.id) ? 'active' : '' - } + }, + ...this.props }, data: [], value: [], @@ -54,10 +61,13 @@ this.getList() }, methods: { - renderContent(h, { data }) { + renderContent(h, { data, node }) { let img = data.groupTag == 'fms_beltline' return h('a', { - disabled: data.disabled + class: { + disabled: this.props.disabled ? this.props.disabled(data, node) : data.disabled + }, + disabled: this.props.disabled ? this.props.disabled(data, node) : data.disabled }, img ? h('img', { src: pmsPng @@ -74,6 +84,7 @@ this.$nextTick(() => { this.currentNodeKey = this.firstWorkKey this.$emit('loaded', this.firstWorkKey) + this.$emit('request', data) }) } }) @@ -128,7 +139,11 @@ </script> <style lang="scss"> -.active .el-tree-node__content { +.is-current .el-tree-node__content { background: var(--el-color-primary) !important; } + +a.disabled { + color: #ccc; +} </style> \ No newline at end of file -- Gitblit v1.9.3