From 3e091224ab26252d8624b42b461ba773ee8bee0f Mon Sep 17 00:00:00 2001 From: gaoshp <291585735@qq.com> Date: 星期日, 03 十一月 2024 19:16:31 +0800 Subject: [PATCH] update --- src/views/mdc/MYTree.vue | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/views/mdc/MYTree.vue b/src/views/mdc/MYTree.vue index 4e70583..93e9090 100644 --- a/src/views/mdc/MYTree.vue +++ b/src/views/mdc/MYTree.vue @@ -1,13 +1,13 @@ <!-- * @Date: 2024-04-18 19:53:35 * @LastEditors: Sneed - * @LastEditTime: 2024-05-26 15:49:11 + * @LastEditTime: 2024-06-16 16:21:59 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue --> <template> - <el-tree ref="treeRef" v-bind="$attrs" :show-checkbox="showCheckbox" :current-node-key="currentNodeKey" - node-key="id" :props="defalutProps" :data="data" @check-change="checkChange" @node-click="handleNodeClick" - highlight-current default-expand-all :expand-on-click-node="false" :render-content="renderContent"></el-tree> + <el-tree :expand-on-click-node="false" ref="treeRef" v-bind="$attrs" :show-checkbox="showCheckbox" + :current-node-key="currentNodeKey" node-key="id" :props="defalutProps" :data="data" @check-change="checkChange" + @node-click="handleNodeClick" highlight-current default-expand-all :render-content="renderContent"></el-tree> </template> <script> @@ -37,7 +37,7 @@ defalutProps: { label: 'title', children: 'children', - disabled: 'disabled', + disabled: this.showCheckbox ? '' : 'disabled', class: (data, node) => { return this.value.includes(data.id) ? 'active' : '' }, @@ -61,13 +61,13 @@ this.getList() }, methods: { - renderContent(h, { data,node }) { + renderContent(h, { data, node }) { let img = data.groupTag == 'fms_beltline' return h('a', { class: { - disabled: this.props.disabled ? this.props.disabled(data,node) : data.disabled + disabled: this.props.disabled ? this.props.disabled(data, node) : data.disabled }, - 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 @@ -75,7 +75,7 @@ data.title) }, getList() { - this.$HTTP.post('/api/blade-cps/group/groupWorkstation/type', { + this.$HTTP.post('/api/smis/group/groupWorkstation/type', { groupCategory: 1, groupType: "group_workstation" }).then(({ code, data }) => { @@ -139,9 +139,10 @@ </script> <style lang="scss"> -.active .el-tree-node__content { - background: var(--el-color-primary) !important; +.is-current>.el-tree-node__content { + // background: var(--el-color-primary) !important; } + a.disabled { color: #ccc; } -- Gitblit v1.9.3