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