1、入驻单位、人员优化
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-06-27 17:56:05 +08:00
parent ef24216dbc
commit f01cb4abce
12 changed files with 506 additions and 107 deletions

View File

@@ -1,6 +1,9 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
import {resident_unitList} from "#/api/property/resident/unit";
export const querySchema: FormSchemaGetter = () => [
{
@@ -8,6 +11,22 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'unitId',
label: '所属单位',
},
{
component: 'ApiSelect',
fieldName: 'unitId',
label: '所属单位',
componentProps: {
api: getUnitList,
resultField: 'data',
labelField: 'label',
valueField: 'value',
immediate: true,
debounceTime: 500,
allowClear: true,
placeholder: '请选择所属单位',
},
rules: 'required',
},
{
component: 'Input',
fieldName: 'userName',
@@ -16,7 +35,7 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_state'),
options: getDictOptions('wy_rzryzt'),
},
fieldName: 'state',
label: '状态',
@@ -49,6 +68,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '性别',
field: 'gender',
slots:{
default: ({row})=>{
return renderDict(row.gender,'wy_rzryzt')
}
}
},
{
field: 'img',
@@ -75,7 +99,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
// slots: { default: 'state' },
slots:{
default: ({row})=>{
return renderDict(row.state,'wy_rzryzt')
}
}
},
{
title: '备注',
@@ -114,13 +142,13 @@ export const modalSchema: FormSchemaGetter = () => [
formItemClass: 'col-span-2',
rules:'selectRequired',
},
{
label: '入驻位置',
fieldName: 'locathon',
component: 'Input',
rules:'required',
formItemClass: 'col-span-2',
},
// {
// label: '入驻位置',
// fieldName: 'locathon',
// component: 'Input',
// rules:'required',
// formItemClass: 'col-span-2',
// },
{
label: '人脸图片',
fieldName: 'img',
@@ -131,7 +159,6 @@ export const modalSchema: FormSchemaGetter = () => [
},
formItemClass: 'col-span-2',
},
{
label: '入驻时间',
fieldName: 'time',
@@ -147,6 +174,14 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'carNumber',
component: 'Input',
},
{
label: '人员状态',
fieldName: 'state',
component: 'Select',
componentProps: {
options: getDictOptions('wy_rzryzt'),
},
},
{
label: '备注',
fieldName: 'remark',
@@ -235,3 +270,19 @@ export const carColumns: VxeGridProps['columns'] = [
field: 'remark',
},
];
export async function getUnitList(): Promise<{ value: number; label: string }[]> {
const queryParam = {
pageNum: 1000,
pageSize: 1,
};
const res = await resident_unitList(queryParam);
const data: { value: number; label: string }[] = [];
res.rows.forEach((r: any) => {
data.push({
value: r.name,
label: r.id,
});
});
return data;
}