84 lines
1.6 KiB
TypeScript
84 lines
1.6 KiB
TypeScript
import type { FormSchemaGetter } from '#/adapter/form'
|
|
import type { VxeGridProps } from '#/adapter/vxe-table'
|
|
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'locationRemark',
|
|
label: '位置描述',
|
|
},
|
|
]
|
|
|
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
export const columns: VxeGridProps['columns'] = [
|
|
{ type: 'checkbox', width: 60 },
|
|
// {
|
|
// title: '主键id',
|
|
// field: 'id',
|
|
// },
|
|
{
|
|
title: '位置描述',
|
|
field: 'locationRemark',
|
|
},
|
|
{
|
|
title: '楼 层',
|
|
field: 'floorName',
|
|
},
|
|
{
|
|
title: '开关状态',
|
|
field: 'isOn',
|
|
slots: { default: 'isOn' },
|
|
},
|
|
{
|
|
field: 'action',
|
|
fixed: 'right',
|
|
slots: { default: 'action' },
|
|
title: '操作',
|
|
width: 180,
|
|
},
|
|
]
|
|
|
|
export const drawerSchema: FormSchemaGetter = () => [
|
|
{
|
|
label: '主键id',
|
|
fieldName: 'id',
|
|
component: 'Input',
|
|
dependencies: {
|
|
show: () => false,
|
|
triggerFields: [''],
|
|
},
|
|
},
|
|
{
|
|
label: '楼层',
|
|
fieldName: 'floorId',
|
|
component: 'TreeSelect',
|
|
defaultValue: undefined,
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '位置描述',
|
|
fieldName: 'locationRemark',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '开关状态',
|
|
fieldName: 'isOn',
|
|
component: 'Switch',
|
|
rules: 'required',
|
|
defaultValue: false,
|
|
componentProps: {
|
|
class: 'w-auto',
|
|
},
|
|
},
|
|
{
|
|
label: '灯控模块编码',
|
|
fieldName: 'code',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
|
|
]
|