| | |
| | | <!-- |
| | | * @Date: 2024-04-18 19:53:35 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-21 10:37:48 |
| | | * @LastEditTime: 2024-04-23 23:09:18 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue |
| | | --> |
| | | <template> |
| | |
| | | export default { |
| | | props: { |
| | | showCheckbox: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | getAll: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | this.customNodeClass = (data, node) => { |
| | | return this.currentNodeKey == node.id || this.value.includes(node.id) ? 'active' : '' |
| | | } |
| | | }, |
| | | methods: { |
| | | renderContent(h, { data }) { |
| | |
| | | |
| | | }, |
| | | checkChange(data, data1, data2) { |
| | | if (this.getAll) { |
| | | return this.value = this.$refs.treeRef.getCheckedNodes().filter(v => v.isWorkstation) |
| | | } |
| | | this.value = this.$refs.treeRef.getCheckedNodes().filter(v => v.isWorkstation).map(item => item.id) |
| | | }, |
| | | }, |