|
@@ -4,8 +4,8 @@ const dsk = (function () {
|
|
|
const projectType = [
|
|
|
{ key: 'folder', value: 1, name: '文件夹' },
|
|
|
{ key: 'project', value: 2, name: '建设项目' },
|
|
|
- { key: 'unit', value: 3, name: '单位工程' },
|
|
|
- { key: 'item', value: 4, name: '单项工程' },
|
|
|
+ { key: 'item', value: 3, name: '单项工程' },
|
|
|
+ { key: 'unit', value: 4, name: '单位工程' },
|
|
|
];
|
|
|
const projectTypeKey = (function(arr) {
|
|
|
const result = {};
|
|
@@ -167,6 +167,8 @@ const dsk = (function () {
|
|
|
})
|
|
|
}
|
|
|
if (data.type === projectTypeKey.project) {
|
|
|
+ const top = data.subjects.find(x => { return x.ID === data.ID; });
|
|
|
+ top.parentID = "-1";
|
|
|
projectTree.loadDatas(data.subjects);
|
|
|
cur.project_id = data.ID;
|
|
|
projectTree.children.forEach(c => {
|
|
@@ -187,6 +189,7 @@ const dsk = (function () {
|
|
|
if (!compilation.subjectTree) {
|
|
|
for (const p of compilation.project) {
|
|
|
if (p.type === projectTypeKey.project) p.subjects = await loadProjectTree(compilation.ID, p.ID, false);
|
|
|
+ console.log(p.subjects);
|
|
|
}
|
|
|
this.analysisSubjectTree(compilation);
|
|
|
}
|
|
@@ -197,7 +200,7 @@ const dsk = (function () {
|
|
|
const tree = this.subjectSheet.zh_tree;
|
|
|
if (!tree) return [];
|
|
|
|
|
|
- return tree.datas.filter(x => { return x.type === projectTypeKey.item && x.selected; }).map(x => { return { compilationId: x.compilation_id, subjectId: x.dsk_id }; });
|
|
|
+ return tree.datas.filter(x => { return x.type === projectTypeKey.unit && x.selected; }).map(x => { return { compilationId: x.compilation_id, subjectId: x.dsk_id }; });
|
|
|
},
|
|
|
csButtonClicked: function(e, info) {
|
|
|
if (!info.sheet.zh_setting) return;
|