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),

View File

@@ -148,7 +148,7 @@
<!-- <img class="img2" src="../../assets/images/projectadd/keep.png" />
<div class="pub">保存</div>
<div class="line"></div> -->
<router-link to="/taskpage">
<router-link to="/libraryAdd">
<div style="display: flex">
<img
class="img2"
@@ -1388,7 +1388,13 @@ export default {
};
array.push(obj);
});
state.level = array;
console.log(array)
if(array[0].id=='0'){
state.level = [];
}else{
state.level = array;
}
};
const tableDataFunc = () => {
@@ -1525,11 +1531,12 @@ export default {
api
.templateDetail(localStorage.getItem("projectTemplateId"))
.then((res) => {
console.log('获取的任务列表信息',res)
if (res.status == 200) {
console.log("22222", res.data.data.stageList);
state.projectTitle = res.data.data.projectTemplateInfo.name;
state.picUrl = res.data.data.projectTemplateInfo.picUrl;
let leng = res.data.data.stageList.length;
let leng = res.data.data.stageList[0].name!==null ?res.data.data.stageList.length:0;
if (leng > 0) {
let stage = localStorage.getItem("templateStageId")
? localStorage.getItem("templateStageId")