Files
admin-vben5/apps/web-antd/src/views/property/greenPlantRentalManagement/conservationManagement/data.ts
fyy 007bda30bc
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
fix: 修改大屏不能显示bug、修改大屏字体、替换系统logo
2025-07-24 16:09:54 +08:00

276 lines
5.6 KiB
TypeScript

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';
import { rentalOrderList } from '#/api/property/rentalOrder';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'maintainName',
label: '养护名称',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_processing_status'),
},
fieldName: 'state',
label: '处理状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
minWidth: '120',
},
{
title: '养护名称',
field: 'maintainName',
minWidth: '120',
},
// {
// title: '服务地点',
// field: 'roomName',
// minWidth: '120'
// },
{
title: '服务类型',
field: 'serveType',
slots: {
default: ({ row }) => {
return renderDict(row.serveType, 'pro_service_type');
},
},
minWidth: '120',
},
{
title: '养护周期类型',
field: 'periodType',
slots: {
default: ({ row }) => {
return renderDict(row.periodType, 'wy_time_unit');
},
},
minWidth: '120',
},
{
title: '养护周期频次',
field: 'periodFrequency',
minWidth: '120',
},
{
title: '关联订单',
field: 'orderId',
minWidth: '120',
},
{
title: '计划执行时间',
field: 'startTime',
minWidth: '120',
},
{
title: '计划完成时间',
field: 'endTime',
minWidth: '120',
},
{
title: '巡检结果',
field: 'inspectResult',
slots: {
default: ({ row }) => {
return renderDict(row.inspectResult, 'pro_inspection_results');
},
},
minWidth: '120',
},
{
title: '处理措施',
field: 'measure',
minWidth: '120',
},
{
title: '客户评分',
field: 'customerScore',
slots: {
default: ({ row }) => {
return h(Rate, {
value: row.customerScore || 0,
disabled: true,
});
},
},
minWidth: '150',
},
{
title: '客户反馈',
field: 'customerAdvice',
minWidth: '120',
},
{
title: '处理状态',
field: 'state',
slots: {
default: ({ row }) => {
return renderDict(row.state, 'pro_processing_status');
},
},
minWidth: '120',
},
{
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',
labelWidth: 100,
},
{
label: '服务地点',
fieldName: 'roomId',
component: 'TreeSelect',
defaultValue: undefined,
rules: 'required',
labelWidth: 100,
},
{
label: '服务类型',
fieldName: 'serveType',
component: 'Select',
componentProps: {
options: getDictOptions('pro_service_type'),
},
rules: 'selectRequired',
labelWidth: 100,
},
{
label: '养护周期类型',
fieldName: 'periodType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_TIME_UNIT 便于维护
options: getDictOptions('wy_time_unit'),
},
rules: 'selectRequired',
labelWidth: 100,
},
{
label: '养护周期频次',
fieldName: 'periodFrequency',
component: 'Input',
rules: 'required',
labelWidth: 100,
},
{
label: '关联订单',
fieldName: 'orderId',
component: 'ApiSelect',
componentProps: {
api: rentalOrderList,
resultField: 'rows',
labelField: 'orderNo',
valueField: 'id',
},
rules: 'required',
labelWidth: 100,
},
{
label: '计划执行时间',
fieldName: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
labelWidth: 100,
},
{
label: '计划完成时间',
fieldName: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
labelWidth: 100,
},
{
label: '巡检结果',
fieldName: 'inspectResult',
component: 'Select',
componentProps: {
options: getDictOptions('pro_inspection_results'),
},
rules: 'selectRequired',
labelWidth: 100,
},
{
label: '处理措施',
fieldName: 'measure',
component: 'Textarea',
rules: 'required',
labelWidth: 100,
},
{
label: '客户评分',
fieldName: 'customerScore',
component: 'Rate',
componentProps: {
allowHalf: false,
count: 5,
tooltips: ['1星', '2星', '3星', '4星', '5星'],
defaultValue: 0,
},
rules: 'required',
labelWidth: 100,
},
{
label: '客户反馈',
fieldName: 'customerAdvice',
component: 'Textarea',
labelWidth: 100,
},
{
label: '处理状态',
fieldName: 'state',
component: 'Select',
componentProps: {
options: getDictOptions('pro_processing_status'),
},
rules: 'selectRequired',
labelWidth: 100,
},
];