绿植管理

This commit is contained in:
FLL
2025-07-02 11:02:14 +08:00
parent b6f7558aaa
commit 79fe4c6412
17 changed files with 1031 additions and 133 deletions

View File

@@ -0,0 +1,229 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
import {h} from "vue";
import {Rate} from "ant-design-vue";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'maintainName',
label: '养护名称',
},
{
component: 'Select',
componentProps: {
},
fieldName: 'state',
label: '处理状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '养护名称',
field: 'maintainName',
},
{
title: '小区id',
field: 'communityId',
},
{
title: '建筑id',
field: 'buildingId',
},
{
title: '楼层id',
field: 'floorId',
},
{
title: '服务类型',
field: 'serveType',
},
{
title: '养护周期类型',
field: 'periodType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_TIME_UNIT 便于维护
return renderDict(row.periodType, 'wy_time_unit');
},
},
},
{
title: '养护周期频次',
field: 'periodFrequency',
},
{
title: '订单id',
field: 'orderId',
},
{
title: '计划执行时间',
field: 'startTime',
},
{
title: '计划完成时间',
field: 'endTime',
},
{
title: '巡检结果',
field: 'inspectResult',
},
{
title: '处理措施',
field: 'measure',
},
{
title: '客户评分',
field: 'customerScore',
slots: {
default: ({ row }) => {
return h(Rate, {
value: row.customerScore || 0,
disabled: true,
});
},
},
width:200
},
{
title: '客户反馈',
field: 'customerAdvice',
},
{
title: '处理状态',
field: 'state',
},
{
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: 'maintainName',
component: 'Input',
rules: 'required',
},
{
label: '小区id',
fieldName: 'communityId',
component: 'Input',
rules: 'required',
},
{
label: '建筑id',
fieldName: 'buildingId',
component: 'Input',
rules: 'required',
},
{
label: '楼层id',
fieldName: 'floorId',
component: 'Input',
rules: 'required',
},
{
label: '服务类型',
fieldName: 'serveType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '养护周期类型',
fieldName: 'periodType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_TIME_UNIT 便于维护
options: getDictOptions('wy_time_unit'),
},
rules: 'selectRequired',
},
{
label: '养护周期频次',
fieldName: 'periodFrequency',
component: 'Input',
rules: 'required',
},
{
label: '订单id',
fieldName: 'orderId',
component: 'Input',
rules: 'required',
},
{
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: 'inspectResult',
component: 'Input',
},
{
label: '处理措施',
fieldName: 'measure',
component: 'Input',
},
{
label: '客户评分',
fieldName: 'customerScore',
component: 'Rate',
componentProps: {
allowHalf: false,
count: 5,
tooltips: ['1星', '2星', '3星', '4星', '5星'],
defaultValue: 0
},
rules: 'required',
},
{
label: '客户反馈',
fieldName: 'customerAdvice',
component: 'Textarea',
},
{
label: '处理状态',
fieldName: 'state',
component: 'Select',
componentProps: {
},
},
];