208 lines
3.5 KiB
TypeScript
208 lines
3.5 KiB
TypeScript
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||
|
|
||
|
|
||
|
export const querySchema: FormSchemaGetter = () => [
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'name',
|
||
|
label: '资产名称',
|
||
|
},
|
||
|
{
|
||
|
component: 'Textarea',
|
||
|
fieldName: 'model',
|
||
|
label: '类型',
|
||
|
},
|
||
|
{
|
||
|
component: 'Textarea',
|
||
|
fieldName: 'specs',
|
||
|
label: '规格',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'price',
|
||
|
label: '价格',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'stock',
|
||
|
label: '库存',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'unit',
|
||
|
label: '计量单位',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'depotId',
|
||
|
label: '仓库id',
|
||
|
},
|
||
|
{
|
||
|
component: 'Textarea',
|
||
|
fieldName: 'msg',
|
||
|
label: '描述信息',
|
||
|
},
|
||
|
{
|
||
|
component: 'Input',
|
||
|
fieldName: 'suppliersId',
|
||
|
label: '供应商id',
|
||
|
},
|
||
|
{
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
showTime: true,
|
||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
},
|
||
|
fieldName: 'storageTime',
|
||
|
label: '入库时间',
|
||
|
},
|
||
|
{
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
},
|
||
|
fieldName: 'type',
|
||
|
label: '固定资产类型',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||
|
export const columns: VxeGridProps['columns'] = [
|
||
|
{ type: 'checkbox', width: 60 },
|
||
|
{
|
||
|
title: '主键',
|
||
|
field: 'id',
|
||
|
},
|
||
|
{
|
||
|
title: '资产名称',
|
||
|
field: 'name',
|
||
|
},
|
||
|
{
|
||
|
title: '类型',
|
||
|
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',
|
||
|
},
|
||
|
{
|
||
|
title: '固定资产类型',
|
||
|
field: 'type',
|
||
|
},
|
||
|
{
|
||
|
title: '创建时间',
|
||
|
field: 'createTime',
|
||
|
},
|
||
|
{
|
||
|
field: 'action',
|
||
|
fixed: 'right',
|
||
|
slots: { default: 'action' },
|
||
|
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',
|
||
|
componentProps: {
|
||
|
},
|
||
|
},
|
||
|
];
|