| | |
| | | <!-- |
| | | * @Date: 2024-04-18 19:53:35 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-11-04 20:05:01 |
| | | * @LastEditors: 李喆(开发组) lzhe@yxqiche.com |
| | | * @LastEditTime: 2025-03-27 14:47:57 |
| | | * @FilePath: /cps-web/src/views/mdc/MYTree.vue |
| | | --> |
| | | <template> |
| | |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | isSelectId: { //默认选中 |
| | | type: String, |
| | | default: "" |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | tableData: [], |
| | | pmsPng, |
| | | firstWorkKey: '', |
| | | currentNodeKey: [], |
| | | currentNodeKey: '', |
| | | defalutProps: { |
| | | label: 'title', |
| | | children: 'children', |
| | |
| | | localStorage.setItem(this.$route.path, val ? '1' : '0') |
| | | }, |
| | | handleSelectionChange(selection) { |
| | | if (this.getAll) { |
| | | return this.value = selection |
| | | } |
| | | this.value = selection.map(v => v.id) |
| | | }, |
| | | rowClick(row) { |
| | |
| | | }) |
| | | }, |
| | | 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 = [] |