| | |
| | | } |
| | | } |
| | | //给数组里面再添加一个children的空数组 |
| | | // let addnum1 = pathLength - path.length == 6 ? 6 : 7 |
| | | for (const i of newArr) { |
| | | i.children = [] |
| | | this.getTreeList(rootList, pathLength + addNum, i.children, i.productLinkPath, addNum) |
| | | let addnum1 = i.productLinkPath.length - path.length == 6 ? 6 : 7 |
| | | this.getTreeList(rootList, pathLength + addnum1, i.children, i.productLinkPath, addnum1) |
| | | if (i.children.length == 0) { |
| | | delete i.children |
| | | } |
| | |
| | | }, |
| | | } |
| | | app.MG.store.getProductDetailNoChildren(query).then((res) => { |
| | | console.log(res.datas.cmsDatas[0].datas, 2345) |
| | | if (!res.datas.cmsDatas[0].datas.length) { |
| | | return this.setData({ |
| | | noResources: true, |
| | |
| | | }) |
| | | } |
| | | } |
| | | const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | console.log(query.cmsPath, 111) |
| | | const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |
| | | list = this.changeResourceChildren(list) |
| | | console.log('修改后云', list); |
| | | console.log('修改后', list); |
| | | let result = []; |
| | | if (type.refCode == "jsek_teachingResources") { |
| | | this.findChildIds(list, result); |
| | |
| | | if (data.length > 0) { |
| | | let list = [] |
| | | // 测试 6位// 正式 5位// 测试调用传20,内部7 正式调用传17 内部传6 |
| | | const addNum = query.cmsPath.length > 12 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | |
| | | const addNum = query.cmsPath.length > 10 ? 7 : query.cmsPath.length > 14 ? 8 : 6 |
| | | const num = query.cmsPath.length + addNum |
| | | this.getTreeList(data, num, list, '\\', addNum) |
| | | list = this.ensureTreeConsistency(list) |