feat: add product publish controls

This commit is contained in:
richjohnrambo
2026-10-14 19:18:53 +08:00
parent 131168c700
commit a944241a0e
2 changed files with 44 additions and 6 deletions
+13 -2
View File
@@ -1,5 +1,5 @@
import { computed, h, ref } from 'vue';
import { NImage } from 'naive-ui';
import { NImage, NTag } from 'naive-ui';
import { FormSchema } from '@/components/Form';
import { useDictStore } from '@/store/modules/dict';
@@ -42,6 +42,17 @@ export const columns = [
{ title: '名称', key: 'name', width: 145, ellipsis: { tooltip: true } },
{ title: '商品价格', key: 'price', width: 90 },
{ title: '店铺名称', key: 'shopName', width: 100, ellipsis: { tooltip: true } },
{
title: '发布状态',
key: 'publishStatus',
width: 90,
render: (row) =>
h(
NTag,
{ type: dict.getType('bizPublishStatus', row.publishStatus), bordered: false },
{ default: () => dict.getLabel('bizPublishStatus', row.publishStatus) || '-' }
),
},
{ title: '创建时间', key: 'createdAt', width: 125 },
{
title: '是否推荐',
@@ -51,4 +62,4 @@ export const columns = [
},
];
export const loadOptions = () => dict.loadOptions(['productCategoryOption']);
export const loadOptions = () => dict.loadOptions(['productCategoryOption', 'bizPublishStatus']);