feat: 商品上架优化

This commit is contained in:
duan
2025-03-06 10:09:55 +08:00
parent 8838df65fb
commit a8a8a58cad
4 changed files with 14 additions and 5 deletions

View File

@@ -22,6 +22,10 @@
<template #gender="scope">
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
</template>
<template #switchs="scope">
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0" active-text="启用"
inactive-text="禁用" @change="handleSwitchChange"></el-switch>
</template>
<template #mobile="scope">
<el-text>{{ scope.row[scope.prop] }}</el-text>
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
@@ -103,6 +107,11 @@ async function handleAddClick() {
// 加载角色下拉数据源
// addModalConfig.formItems[4]!.options = await RoleAPI.getOptions();
}
// 上架
function handleSwitchChange(val: boolean, row: IObject) {
console.log(val, row);
// UserAPI.updateById({ id: row.id, isSale: val ? 1 : 0 });
}
// 编辑
async function handleEditClick(row: IObject) {
router.push({ name: 'addgoods', query: { goods_id: row.id } });

View File

@@ -43,7 +43,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
id: data.id,
isSale: data.value
}
// return UserAPI.onOff(obj);
return UserAPI.onOff(obj);
},
deleteAction: UserAPI.deleteByIds,
importsAction(data) {
@@ -82,7 +82,7 @@ const contentConfig: IContentConfig<UserPageQuery> = {
{
label: "上架",
align: "center",
prop: "isSale",
prop: "status",
templet: "switch",
slotName: "status",
},