fix:模板库部分显示判断,无阶段显示判断

This commit is contained in:
wyx
2022-12-07 21:04:32 +08:00
parent 4274e6ce0d
commit 48a4a67089
2 changed files with 16 additions and 5 deletions

View File

@@ -955,13 +955,17 @@ export default defineComponent({
state.projectInfo.picUrl = res.data.data.projectTemplateInfo.picUrl;
state.projectInfo.attach = res.data.data.projectTemplateInfo.attach;
state.projectInfo.category = res.data.data.projectTemplateInfo.category;
state.fileList = JSON.parse(res.data.data.projectTemplateInfo.attach);
try{
state.fileList = JSON.parse(res.data.data.projectTemplateInfo.attach);
}catch{
state.fileList = [];
}
state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false
let data = res.data.data.stageList;
console.log("data=====", data);
for (let i in data) {
console.log("what ------ > ", i, data);
state.taskSyllabus.push({ text: data[i].name, children: [] });
state.taskSyllabus.push({ text: data[i].name?data[i].name:'无阶段任务', children: [] });
for (let j in data[i].taskList) {
state.taskSyllabus[i].children.push({
course: checkType(data[i].taskList[j].type),