Browse Source

1.分类列表获取业务功能添加子分类信息业务功能 2.解决一级分类图片上传无法显示问题

master
dy-hu 1 year ago
parent
commit
8d93f65a5d
  1. 3
      src/views/renovation/commdityClass/Edit.vue
  2. 65
      src/views/renovation/commdityClass/index.vue

3
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')

65
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' }"
>
<el-table-column prop="classifyName_ZH" label="商品类别(中文)" />
<el-table-column prop="classifyName_EN" label="商品类别(英文)" />
<el-table-column
align="center"
label="分类图片"
>
<template v-slot="scope">
<el-image :src="scope.row.classifyImage" :preview-src-list="[scope.row.classifyImage]" style="width: 50px;height: 50px" >
<div slot="error" class="image-slot" style="line-height:60px;text-align: center;color: orange">
无图片
</div>
</el-image>
</template>
</el-table-column>
<el-table-column prop="status" label="操作">
<template slot-scope="scope">
<el-button type="text" @click.native.prevent="checkRow(scope.row)">查看</el-button>
<template slot-scope="scope" v-if="!scope.row.classifyPid">
<el-button type="text" @click.native.prevent="checkRow(scope.row)">查看</el-button>
<el-button type="text" @click.native.prevent="updateRow(scope.row)">编辑</el-button>
<el-button type="text" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
<el-button type="text" @click.native.prevent="setShareSetting(scope.row)">设置分配比例</el-button>
@ -40,7 +52,7 @@
@close="editClose"
@success="getProductCategory"
/>
<SharesettingDialog
<SharesettingDialog
ref="shareSettingDialog"/>
</div>
</template>
@ -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
}
});*/
}
}
}

Loading…
Cancel
Save