|
|
@ -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 |
|
|
|
} |
|
|
|
});*/ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|