|
@@ -238,61 +238,62 @@
|
|
async function handleTree(record: Recordable) {
|
|
async function handleTree(record: Recordable) {
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
|
|
|
- treeData.value = [
|
|
|
|
- {
|
|
|
|
- title: 'parent 1',
|
|
|
|
- key: '0-0',
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: 'parent 1-0',
|
|
|
|
- key: '0-0-0',
|
|
|
|
- children: [
|
|
|
|
- { title: 'leaf', key: '0-0-0-0' },
|
|
|
|
- {
|
|
|
|
- key: '0-0-0-1',title: 'leaf',
|
|
|
|
- },
|
|
|
|
- { title: 'leaf', key: '0-0-0-2' },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: 'parent 1-1',
|
|
|
|
- key: '0-0-1',
|
|
|
|
- children: [{ title: 'leaf', key: '0-0-1-0' }],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: 'parent 1-2',
|
|
|
|
- key: '0-0-2',
|
|
|
|
- children: [
|
|
|
|
- { title: 'leaf 1', key: '0-0-2-0' },
|
|
|
|
- {
|
|
|
|
- title: 'leaf 2',
|
|
|
|
- key: '0-0-2-1',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: 'parent 2',
|
|
|
|
- key: '0-1',
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: 'parent 2-0',
|
|
|
|
- key: '0-1-0',
|
|
|
|
- children: [
|
|
|
|
- { title: 'leaf', key: '0-1-0-0' },
|
|
|
|
- { title: 'leaf', key: '0-1-0-1' },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
|
|
+ // treeData.value = [
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 1',
|
|
|
|
+ // key: '0-0',
|
|
|
|
+ // children: [
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 1-0',
|
|
|
|
+ // key: '0-0-0',
|
|
|
|
+ // children: [
|
|
|
|
+ // { title: 'leaf', key: '0-0-0-0' },
|
|
|
|
+ // {
|
|
|
|
+ // key: '0-0-0-1',title: 'leaf',
|
|
|
|
+ // },
|
|
|
|
+ // { title: 'leaf', key: '0-0-0-2' },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 1-1',
|
|
|
|
+ // key: '0-0-1',
|
|
|
|
+ // children: [{ title: 'leaf', key: '0-0-1-0' }],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 1-2',
|
|
|
|
+ // key: '0-0-2',
|
|
|
|
+ // children: [
|
|
|
|
+ // { title: 'leaf 1', key: '0-0-2-0' },
|
|
|
|
+ // {
|
|
|
|
+ // title: 'leaf 2',
|
|
|
|
+ // key: '0-0-2-1',
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 2',
|
|
|
|
+ // key: '0-1',
|
|
|
|
+ // children: [
|
|
|
|
+ // {
|
|
|
|
+ // title: 'parent 2-0',
|
|
|
|
+ // key: '0-1-0',
|
|
|
|
+ // children: [
|
|
|
|
+ // { title: 'leaf', key: '0-1-0-0' },
|
|
|
|
+ // { title: 'leaf', key: '0-1-0-1' },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // ];
|
|
|
|
+ let res = await outlineSopTask({ id: record.id });
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ treeData.value = res.data;
|
|
expandedKeys.value = getExpandedKeys(treeData.value); // 收集所有节点的key
|
|
expandedKeys.value = getExpandedKeys(treeData.value); // 收集所有节点的key
|
|
loading.value = false;
|
|
loading.value = false;
|
|
treeModalVisible.value = true;
|
|
treeModalVisible.value = true;
|
|
- // let res = await outlineSopTask({ id: record.id });
|
|
|
|
- // console.log(res.data)
|
|
|
|
- // treeData.value = res.data;
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
// 递归收集所有 key
|
|
// 递归收集所有 key
|