Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
145 lines
2.9 KiB
TypeScript
145 lines
2.9 KiB
TypeScript
import {type FormSchemaGetter, z} from '#/adapter/form';
|
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
import {getDictOptions} from "#/utils/dict";
|
|
import {renderDict} from "#/utils/render";
|
|
|
|
export const querySchema: FormSchemaGetter = () => [
|
|
{
|
|
component: 'Input',
|
|
fieldName: 'title',
|
|
label: '标题',
|
|
},
|
|
{
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: getDictOptions('pro_information_type'),
|
|
},
|
|
fieldName: 'type',
|
|
label: '信息类型',
|
|
},
|
|
];
|
|
|
|
export const columns: VxeGridProps['columns'] = [
|
|
{ type: 'checkbox', width: 60 },
|
|
{
|
|
title: '信息ID',
|
|
field: 'id',
|
|
},
|
|
{
|
|
title: '标题',
|
|
field: 'title',
|
|
},
|
|
{
|
|
title: '信息类型',
|
|
field: 'type',
|
|
slots:{
|
|
default: ({row})=>{
|
|
return renderDict(row.type,'pro_information_type')
|
|
}
|
|
},
|
|
},
|
|
{
|
|
title: '开始时间',
|
|
field: 'startTime',
|
|
},
|
|
{
|
|
title: '结束时间',
|
|
field: 'endTime',
|
|
},
|
|
{
|
|
title: '发布人',
|
|
field: 'issuers',
|
|
},
|
|
{
|
|
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: 'title',
|
|
component: 'Input',
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '公告类型',
|
|
fieldName: 'type',
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: getDictOptions('pro_information_type'),
|
|
},
|
|
rules: 'selectRequired',
|
|
},
|
|
{
|
|
label: '全小区公告',
|
|
fieldName: 'isAll',
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: getDictOptions('wy_sf'),
|
|
},
|
|
rules: 'required',
|
|
formItemClass: 'col-span-2',
|
|
},
|
|
{
|
|
label: '通知人',
|
|
fieldName: 'noticePersion',
|
|
component: 'ApiSelect',
|
|
componentProps:{
|
|
mode: 'multiple',
|
|
},
|
|
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
|
formItemClass: 'col-span-2',
|
|
dependencies: {
|
|
show: (formValue) =>formValue.isAll==1 ,
|
|
triggerFields: ['isAll'],
|
|
},
|
|
},
|
|
{
|
|
label: '开始时间',
|
|
fieldName: 'startTime',
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
showTime: true,
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
},
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '结束时间',
|
|
fieldName: 'endTime',
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
showTime: true,
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
},
|
|
rules: 'required',
|
|
},
|
|
{
|
|
label: '公告内容',
|
|
fieldName: 'afficheContent',
|
|
component: 'RichTextarea',
|
|
componentProps: {
|
|
// disabled: false, // 是否只读
|
|
// height: 400 // 高度 默认400
|
|
},
|
|
rules: 'required',
|
|
formItemClass: 'col-span-2'
|
|
},
|
|
];
|