feat: 更新产品类型表格字段,调整列标题和数据键名;移除不必要的字段

This commit is contained in:
2025-12-22 05:50:33 +07:00
parent a1f1e5800c
commit 3b8c416c05

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { useTemplateRef } from 'vue';
import { NDatePicker, useDialog, useMessage } from 'naive-ui';
import { useDateFormat } from '@vueuse/core';
import { useDialog, useMessage } from 'naive-ui';
import { client, safeClient } from '@/service/api';
import type { TableBaseColumns, TableFetchData, TableFilterColumns, TableInst } from '@/components/table';
@@ -22,31 +23,26 @@ const fetchData: TableFetchData = ({ pagination, filter }) => {
const columns: TableBaseColumns = [
{
title: 'ID',
key: 'userId'
key: 'id'
},
{
title: 'code',
title: '编号',
key: 'code'
},
{
title: 'name',
title: '名称',
key: 'name'
},
{
title: 'description',
title: '描述',
key: 'description'
},
{
title: 'displayOrder',
key: 'displayOrder'
},
{
title: 'createdAt',
key: 'createdAt'
},
{
title: 'updatedAt',
key: 'updatedAt'
title: '创建时间',
key: 'createdAt',
render: (row: any) => {
return useDateFormat(row.createdAt, 'YYYY-MM-DD HH:mm').value;
}
},
{
title: '操作',
@@ -57,6 +53,7 @@ const columns: TableBaseColumns = [
{
contentText: '编辑',
type: 'primary',
ghost: true,
onClick: () => {
tableInst.value?.reload();
}
@@ -65,7 +62,6 @@ const columns: TableBaseColumns = [
contentText: '删除',
type: 'error',
ghost: true,
size: 'small',
onClick: async () => {
dialog.create({
title: '提示',
@@ -90,13 +86,8 @@ const columns: TableBaseColumns = [
const filterColumns: TableFilterColumns = [
{
title: 'description',
key: 'description'
},
{
title: 'name',
key: 'name',
component: NDatePicker
title: '名称',
key: 'name'
}
];
</script>