admin-vben5/apps/web-antd/src/views/property/assetManage/asset/data.ts

170 lines
2.9 KiB
TypeScript
Raw Normal View History

2025-06-24 14:52:45 +08:00
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
2025-06-23 09:27:28 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '资产名称',
},
{
2025-06-24 14:52:45 +08:00
component: 'Select',
2025-06-23 09:27:28 +08:00
fieldName: 'model',
2025-06-24 14:52:45 +08:00
label: '资产类型',
2025-06-23 09:27:28 +08:00
},
{
component: 'Select',
componentProps: {
2025-06-24 14:52:45 +08:00
options: getDictOptions('wy_sf'),
2025-06-23 09:27:28 +08:00
},
fieldName: 'type',
2025-06-24 14:52:45 +08:00
label: '固定资产',
2025-06-23 09:27:28 +08:00
},
2025-06-24 14:52:45 +08:00
2025-06-23 09:27:28 +08:00
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
2025-06-24 14:52:45 +08:00
{type: 'checkbox', width: 60},
2025-06-23 09:27:28 +08:00
{
2025-06-24 14:52:45 +08:00
title: '序号',
2025-06-23 09:27:28 +08:00
field: 'id',
2025-06-24 14:52:45 +08:00
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
2025-06-23 09:27:28 +08:00
},
{
title: '资产名称',
field: 'name',
},
{
2025-06-24 14:52:45 +08:00
title: '资产类型',
2025-06-23 09:27:28 +08:00
field: 'model',
},
{
title: '规格',
field: 'specs',
},
{
title: '价格',
field: 'price',
},
{
title: '库存',
field: 'stock',
},
{
title: '计量单位',
field: 'unit',
},
{
title: '仓库id',
field: 'depotId',
},
{
title: '描述信息',
field: 'msg',
},
{
title: '供应商id',
field: 'suppliersId',
},
{
title: '入库时间',
field: 'storageTime',
},
{
2025-06-24 14:52:45 +08:00
title: '固定资产',
2025-06-23 09:27:28 +08:00
field: 'type',
},
{
title: '创建时间',
field: 'createTime',
},
{
field: 'action',
fixed: 'right',
2025-06-24 14:52:45 +08:00
slots: {default: 'action'},
2025-06-23 09:27:28 +08:00
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '资产名称',
fieldName: 'name',
component: 'Input',
},
{
label: '类型',
fieldName: 'model',
component: 'Textarea',
},
{
label: '规格',
fieldName: 'specs',
component: 'Textarea',
},
{
label: '价格',
fieldName: 'price',
component: 'Input',
},
{
label: '库存',
fieldName: 'stock',
component: 'Input',
},
{
label: '计量单位',
fieldName: 'unit',
component: 'Input',
},
{
label: '仓库id',
fieldName: 'depotId',
component: 'Input',
},
{
label: '描述信息',
fieldName: 'msg',
component: 'Textarea',
},
{
label: '供应商id',
fieldName: 'suppliersId',
component: 'Input',
},
{
label: '入库时间',
fieldName: 'storageTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
{
label: '固定资产类型',
fieldName: 'type',
component: 'Select',
2025-06-24 14:52:45 +08:00
componentProps: {},
2025-06-23 09:27:28 +08:00
},
];