yangys
2025-11-20 fe25b9d9dc98187a0b885631bc39dfd5daa15163
src/views/mdc/MYTree.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-04-18 19:53:35
 * @LastEditors: gaoshp
 * @LastEditTime: 2024-11-08 19:14:11
 * @LastEditors: 李喆(开发组) lzhe@yxqiche.com
 * @LastEditTime: 2025-03-27 14:47:57
 * @FilePath: /cps-web/src/views/mdc/MYTree.vue
-->
<template>
@@ -40,6 +40,10 @@
            default: () => {
                return {}
            }
        },
        isSelectId: {  //默认选中
            type: String,
            default: ""
        }
    },
    data() {
@@ -50,7 +54,7 @@
            tableData: [],
            pmsPng,
            firstWorkKey: '',
            currentNodeKey: [],
            currentNodeKey: '',
            defalutProps: {
                label: 'title',
                children: 'children',
@@ -129,7 +133,11 @@
            })
        },
        setCurrentKey(data) {
            this.currentNodeKey = data.find(v => v.isWorkstation && v.title.indexOf(this.word) > -1).id
            if(this.isSelectId) {
                this.currentNodeKey = this.isSelectId;
            }else {
                this.currentNodeKey = data.find(v => v.isWorkstation && v.title.indexOf(this.word) > -1).id;
            }
        },
        formatData(data, current) {
            let newData = []