From cd287ae3ff6a15f83b0726e548b75c23b04c0f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E6=99=B6=E5=9C=9F=E8=B1=86?= <水晶土豆@devide> Date: Mon, 20 Nov 2023 17:50:00 +0800 Subject: [PATCH] Mon Nov 20 17:50:00 CST 2023 inscode --- .../contractList/add/addMain.vue | 5 +- src/util/toTree.js | 52 +++++++++---------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/component/contractManagement/contractList/add/addMain.vue b/src/component/contractManagement/contractList/add/addMain.vue index 303474b..694c3d6 100644 --- a/src/component/contractManagement/contractList/add/addMain.vue +++ b/src/component/contractManagement/contractList/add/addMain.vue @@ -69,8 +69,7 @@ - @@ -167,7 +166,7 @@ export default { field118: undefined, field119: undefined, field120: undefined, - field135: null, + field135: [], field122: undefined, field124: 2, field123: undefined, diff --git a/src/util/toTree.js b/src/util/toTree.js index d183bfc..1b5558c 100644 --- a/src/util/toTree.js +++ b/src/util/toTree.js @@ -1,30 +1,30 @@ -// const treeData = [ -// { -// id: 1, -// title: "课程1", -// children: [ -// { id: 4, title: "课程1-1" }, -// { -// id: 5, -// title: "课程1-2", -// children: [ -// { id: 6, title: "课程1-2-1" }, -// { id: 7, title: "课程1-2-2" }, -// ], -// }, -// ], -// }, -// { id: 2, title: "课程2" }, -// { id: 3, title: "课程3" }, -// ]; +const treeData = [ + { + id: '1', + title: "课程1", + children: [ + { id: '4', title: "课程1-1" }, + { + id: '5', + title: "课程1-2", + children: [ + { id: '6', title: "课程1-2-1" }, + { id: '7', title: "课程1-2-2" }, + ], + }, + ], + }, + { id: '2', title: "课程2" }, + { id: '3', title: "课程3" }, +]; const flatData = [ - { id: 1, parentID: 0, title: "课程1" }, - { id: 4, parentID: 1, title: "课程1-1" }, - { id: 5, parentID: 1, title: "课程1-2" }, - { id: 6, parentID: 5, title: "课程1-2-1" }, - { id: 7, parentID: 5, title: "课程1-2-2" }, - { id: 2, parentID: 0, title: "课程2" }, - { id: 3, parentID: 0, title: "课程3" }, + { id: '1', parentID: '0', title: "课程1" }, + { id: '4', parentID: '1', title: "课程1-1" }, + { id: '5', parentID: '1', title: "课程1-2" }, + { id: '6', parentID: '5', title: "课程1-2-1" }, + { id: '7', parentID: '5', title: "课程1-2-2" }, + { id: '2', parentID: '0', title: "课程2" }, + { id: '3', parentID: '0', title: "课程3" }, ] export function TreeToFlat(data) { -- GitLab