| | |
| | | children: [] |
| | | }; |
| | | //当前已选择数据回填 |
| | | if (!record.attributes.selected) { |
| | | if (record.attributes.selected == 'true') { |
| | | NumberList.push(record.value); |
| | | } |
| | | if (parent) { |
| | | const existingChild = parent.children.find(child => child.label === record.label); |
| | | if (existingChild) { |
| | | record.value = existingChild.value; // 使用已存在的子节点的value值 |
| | | const stingChild = parent.children.find(child => child.label === record.label); |
| | | if (stingChild) { |
| | | record.value = stingChild.value; // 使用已存在的子节点的value值 |
| | | } else { |
| | | parent.children.push(record); |
| | | value++; |
| | | } |
| | | } else { |
| | | const existingRecord = List.find(item => item.label === record.label); |
| | | if (existingRecord) { |
| | | record.value = existingRecord.value; // 使用已存在的顶层节点的value值 |
| | | const stingRecord = List.find(item => item.label === record.label); |
| | | if (stingRecord) { |
| | | record.value = stingRecord.value; // 使用已存在的顶层节点的value值 |
| | | } else { |
| | | List.push(record); |
| | | value++; |
| | |
| | | for (let item of res.data) { |
| | | traverse(item, null); |
| | | } |
| | | // console.log('list', List); |
| | | console.log('list', List); |
| | | this.TreeData = List; |
| | | // this.ModifyProperties(this.TreeData, 'text', 'label'); |
| | | // 根据this.TreeData的长度计算延迟时间 |