| | |
| | | <!-- |
| | | * @Date: 2024-04-18 19:53:35 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-23 23:09:18 |
| | | * @LastEditTime: 2024-06-05 21:46:20 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue |
| | | --> |
| | | <template> |
| | |
| | | getAll: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | props: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | 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: [], |
| | |
| | | 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 |
| | |
| | | this.$nextTick(() => { |
| | | this.currentNodeKey = this.firstWorkKey |
| | | this.$emit('loaded', this.firstWorkKey) |
| | | this.$emit('request', data) |
| | | }) |
| | | } |
| | | }) |
| | |
| | | </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; |
| | | } |
| | | </style> |