|
|
@ -7,14 +7,26 @@ |
|
|
|
: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="$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="updateRow(scope.row)">{{ $t('common.edit') }}</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()}) |
|
|
|
let tempData = res.data.list; |
|
|
|
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.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 = ""; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|