|
@ -285,6 +285,16 @@ export default { |
|
|
oneClassifyId |
|
|
oneClassifyId |
|
|
}) |
|
|
}) |
|
|
const resData = res.data |
|
|
const resData = res.data |
|
|
|
|
|
this.initLangInfo(resData) |
|
|
|
|
|
this.initImageArray(resData) |
|
|
|
|
|
if (resData) { |
|
|
|
|
|
this.treeData = [resData] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.treeData = [] |
|
|
|
|
|
} |
|
|
|
|
|
console.log(this.treeData) |
|
|
|
|
|
}, |
|
|
|
|
|
initLangInfo(resData){ |
|
|
if(resData && resData.langInfoMap && resData.langInfoMap['zh']){ |
|
|
if(resData && resData.langInfoMap && resData.langInfoMap['zh']){ |
|
|
resData.classifyName_ZH = resData.langInfoMap['zh'].classifyName; |
|
|
resData.classifyName_ZH = resData.langInfoMap['zh'].classifyName; |
|
|
}else{ |
|
|
}else{ |
|
@ -295,13 +305,11 @@ export default { |
|
|
}else{ |
|
|
}else{ |
|
|
resData.classifyName_EN = ""; |
|
|
resData.classifyName_EN = ""; |
|
|
} |
|
|
} |
|
|
this.initImageArray(resData) |
|
|
|
|
|
if (resData) { |
|
|
|
|
|
this.treeData = [resData] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.treeData = [] |
|
|
|
|
|
} |
|
|
|
|
|
console.log(this.treeData) |
|
|
|
|
|
|
|
|
if(resData.childs && resData.childs.length){ |
|
|
|
|
|
for (const index in resData.childs) { |
|
|
|
|
|
this.initLangInfo(resData.childs[index]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
initImageArray(treeData){ |
|
|
initImageArray(treeData){ |
|
|
if(treeData){ |
|
|
if(treeData){ |
|
@ -423,15 +431,7 @@ export default { |
|
|
} |
|
|
} |
|
|
console.log(this.params) |
|
|
console.log(this.params) |
|
|
for (const index in params) { |
|
|
for (const index in params) { |
|
|
let itemParams = params[index] |
|
|
|
|
|
itemParams.classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap = {} |
|
|
|
|
|
itemParams.langInfoMap["zh"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["zh"].classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap["zh"].languageType = "zh"; |
|
|
|
|
|
itemParams.langInfoMap["en"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["en"].classifyName = itemParams.classifyName_EN; |
|
|
|
|
|
itemParams.langInfoMap["en"].languageType = "en"; |
|
|
|
|
|
|
|
|
this.resetLangInfo(params[index]) |
|
|
} |
|
|
} |
|
|
this.resetImage(this.treeData[0]) |
|
|
this.resetImage(this.treeData[0]) |
|
|
const obj = { |
|
|
const obj = { |
|
@ -455,15 +455,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
for (const index in params) { |
|
|
for (const index in params) { |
|
|
let itemParams = params[index] |
|
|
|
|
|
itemParams.classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap = {} |
|
|
|
|
|
itemParams.langInfoMap["zh"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["zh"].classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap["zh"].languageType = "zh"; |
|
|
|
|
|
itemParams.langInfoMap["en"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["en"].classifyName = itemParams.classifyName_EN; |
|
|
|
|
|
itemParams.langInfoMap["en"].languageType = "en"; |
|
|
|
|
|
|
|
|
this.resetLangInfo(params[index]) |
|
|
} |
|
|
} |
|
|
this.resetImage(this.treeData[0]) |
|
|
this.resetImage(this.treeData[0]) |
|
|
const obj = { |
|
|
const obj = { |
|
@ -481,6 +473,21 @@ export default { |
|
|
this.deleteArr = [] |
|
|
this.deleteArr = [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
resetLangInfo(itemParams){ |
|
|
|
|
|
itemParams.classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap = {} |
|
|
|
|
|
itemParams.langInfoMap["zh"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["zh"].classifyName = itemParams.classifyName_ZH; |
|
|
|
|
|
itemParams.langInfoMap["zh"].languageType = "zh"; |
|
|
|
|
|
itemParams.langInfoMap["en"] = {}; |
|
|
|
|
|
itemParams.langInfoMap["en"].classifyName = itemParams.classifyName_EN; |
|
|
|
|
|
itemParams.langInfoMap["en"].languageType = "en"; |
|
|
|
|
|
if(itemParams.childs && itemParams.childs.length){ |
|
|
|
|
|
for (const index in itemParams.childs) { |
|
|
|
|
|
this.resetLangInfo(itemParams.childs[index]) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
setParams ({ id }) { |
|
|
setParams ({ id }) { |
|
|
console.log(id) |
|
|
console.log(id) |
|
|
this.queryOneCategory(id) |
|
|
this.queryOneCategory(id) |
|
|