diff --git a/src/views/renovation/commdityClass/Edit.vue b/src/views/renovation/commdityClass/Edit.vue
index 49e1bf3..6acc876 100644
--- a/src/views/renovation/commdityClass/Edit.vue
+++ b/src/views/renovation/commdityClass/Edit.vue
@@ -284,7 +284,6 @@ export default {
oneClassifyId
})
const resData = res.data
- console.log("resData--->", resData)
this.initLangInfo(resData)
this.initImageArray(resData)
@@ -446,7 +445,7 @@ export default {
if (res.code === '') {
this.isVisible = false
this.$message({
- message: this.$t('common.addsuccessful'),
+ message: '添加成功',
type: 'success'
})
this.$emit('success')
diff --git a/src/views/renovation/commdityClass/index.vue b/src/views/renovation/commdityClass/index.vue
index e55f8c3..e9debd8 100644
--- a/src/views/renovation/commdityClass/index.vue
+++ b/src/views/renovation/commdityClass/index.vue
@@ -7,15 +7,27 @@
:data="tableData"
style="width: 100%"
border
- row-key="id"
+ row-key="classifyId"
:header-cell-style="{ background: '#EEF3FF', color: '#333333' }"
- :tree-props="{ children: 'childs' }"
+ :tree-props="{ children: 'childs', hasChildren: 'hasChildren' }"
>
+
+
+
+
+ 无图片
+
+
+
+
-
- 查看
+
+ 查看
编辑
删除
设置分配比例
@@ -40,7 +52,7 @@
@close="editClose"
@success="getProductCategory"
/>
-
@@ -158,6 +170,39 @@ export default {
const res = await commdityClassGetAll(formParams)
let tempData = res.data.list;
tempData.forEach((itemData) => {
+ this.initLangInfo(itemData)
+ if (itemData.childs){
+ itemData.childs.forEach((secondChildData) => {
+ this.initLangInfo(secondChildData)
+ if (secondChildData.childs){
+ secondChildData.childs.forEach((thirdChildData) => {
+ this.initLangInfo(thirdChildData)
+ }
+ )
+ }
+ }
+ )
+ }
+ });
+ //this.initLangInfo(tempData)
+ this.tableData = tempData;
+ this.total = res.data.total;
+ },
+
+ initLangInfo(itemData) {
+
+ if(itemData && itemData.langInfoMap && itemData.langInfoMap['zh']){
+ itemData.classifyName_ZH = itemData.langInfoMap['zh'].classifyName;
+ }else{
+ itemData.classifyName_ZH = "";
+ }
+ if(itemData && itemData.langInfoMap && itemData.langInfoMap['en']){
+ itemData.classifyName_EN = itemData.langInfoMap['en'].classifyName;
+ }else{
+ itemData.classifyName_EN = "";
+ }
+
+ /* tempData.forEach((itemData) => {
if(itemData && itemData.langInfoMap && itemData.langInfoMap['zh']){
itemData.classifyName_ZH = itemData.langInfoMap['zh'].classifyName;
}else{
@@ -168,9 +213,13 @@ export default {
}else{
itemData.classifyName_EN = "";
}
- });
- this.tableData = tempData;
- this.total = res.data.total;
+ if (itemData.childs){
+ this.initLangInfo(itemData)
+ }else {
+ //为空跳出循环
+ return
+ }
+ });*/
}
}
}