gaoshp
2024-04-24 e58bfa85f175d789445f479f55c87619c43fd7c0
src/views/mdc/MYTree.vue
@@ -1,7 +1,7 @@
<!--
 * @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>
@@ -15,6 +15,10 @@
export default {
    props: {
        showCheckbox: {
            type: Boolean,
            default: false
        },
        getAll: {
            type: Boolean,
            default: false
        }
@@ -48,9 +52,6 @@
    },
    created() {
        this.getList()
        this.customNodeClass = (data, node) => {
            return this.currentNodeKey == node.id || this.value.includes(node.id) ? 'active' : ''
        }
    },
    methods: {
        renderContent(h, { data }) {
@@ -117,6 +118,9 @@
        },
        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)
        },
    },