Browse Source

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

master
dy-hu 1 year ago
parent
commit
4b39f6a2e4
  1. 52
      src/views/commodity/commdityClass/index.vue

52
src/views/commodity/commdityClass/index.vue

@ -7,14 +7,26 @@
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
border border
row-key="id"
row-key="classifyId"
:header-cell-style="{ background: '#EEF3FF', color: '#333333' }" :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_ZH" label="商品类别(中文)" />
<el-table-column prop="classifyName_EN" 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="$t('common.operate')"> <el-table-column prop="status" :label="$t('common.operate')">
<template slot-scope="scope">
<template slot-scope="scope" v-if="!scope.row.classifyPid">
<el-button type="text" @click.native.prevent="checkRow(scope.row)">{{ $t('common.view') }}</el-button> <el-button type="text" @click.native.prevent="checkRow(scope.row)">{{ $t('common.view') }}</el-button>
<el-button type="text" @click.native.prevent="updateRow(scope.row)">{{ $t('common.edit') }}</el-button> <el-button type="text" @click.native.prevent="updateRow(scope.row)">{{ $t('common.edit') }}</el-button>
<el-button type="text" @click.native.prevent="deleteRow(scope.row)">{{ $t('common.delete') }}</el-button> <el-button type="text" @click.native.prevent="deleteRow(scope.row)">{{ $t('common.delete') }}</el-button>
@ -156,19 +168,35 @@ export default {
const res = await commdityClassGetAll(formParams, {project: getBusinessId()}) const res = await commdityClassGetAll(formParams, {project: getBusinessId()})
let tempData = res.data.list; let tempData = res.data.list;
tempData.forEach((itemData) => { tempData.forEach((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 = "";
this.initLangInfo(itemData)
if (itemData.childs){
itemData.childs.forEach((secondChildData) => {
this.initLangInfo(secondChildData)
if (secondChildData.childs){
secondChildData.childs.forEach((thirdChildData) => {
this.initLangInfo(thirdChildData)
}
)
}
}
)
} }
}); });
this.tableData = tempData; this.tableData = tempData;
this.total = res.data.total; 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 = "";
}
} }
} }
} }

Loading…
Cancel
Save