feat(sis): 新增通行权限组功能
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-07-23 14:12:02 +08:00
parent 2ad20e8ccb
commit 0d6259e335
10 changed files with 650 additions and 96 deletions

View File

@@ -1,8 +1,10 @@
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";
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"
import { authGroupList } from '#/api/sis/authGroup'
import type { AuthGroupVO, AuthGroupQuery } from '#/api/sis/authGroup/model'
export const querySchema: FormSchemaGetter = () => [
@@ -19,7 +21,7 @@ export const querySchema: FormSchemaGetter = () => [
debounceTime: 500,
allowClear: true,
placeholder: '请选择所属单位',
filterOption:true
filterOption: true
},
},
{
@@ -35,7 +37,7 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'state',
label: '状态',
},
];
]
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
@@ -66,9 +68,9 @@ export const columns: VxeGridProps['columns'] = [
{
title: '性别',
field: 'gender',
slots:{
default: ({row})=>{
return renderDict(row.gender,'sys_user_sex')
slots: {
default: ({ row }) => {
return renderDict(row.gender, 'sys_user_sex')
}
},
width: 100
@@ -101,9 +103,9 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
slots:{
default: ({row})=>{
return renderDict(row.state,'wy_rzryzt')
slots: {
default: ({ row }) => {
return renderDict(row.state, 'wy_rzryzt')
}
},
width: 100
@@ -120,8 +122,9 @@ export const columns: VxeGridProps['columns'] = [
title: '操作',
minWidth: 180,
},
];
]
let authGroupArr: AuthGroupVO[] = []
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
@@ -144,7 +147,7 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'unitId',
component: 'Select',
formItemClass: 'col-span-2',
rules:'selectRequired',
rules: 'selectRequired',
},
// {
// label: '入驻位置',
@@ -162,7 +165,7 @@ export const modalSchema: FormSchemaGetter = () => [
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules:"required"
rules: "required"
},
{
label: '车牌号码',
@@ -186,7 +189,31 @@ export const modalSchema: FormSchemaGetter = () => [
componentProps: {
options: getDictOptions('wy_rzryzt'),
},
rules:'selectRequired'
rules: 'selectRequired'
},
{
label: '通行权限组',
fieldName: 'authGroupId',
component: 'ApiSelect',
componentProps: {
resultField: 'list', // 根据API返回结构调整
labelField: 'name',
valueField: 'id',
// immediate: true,
api: async () => {
if (!authGroupArr || authGroupArr.length == 0) {
const params: AuthGroupQuery = {
groupType: 2,
pageNum: 1,
pageSize: 500,
}
const res = await authGroupList(params)
authGroupArr = res.rows
}
return authGroupArr
},
},
rules: 'required',
},
{
label: '备注',
@@ -194,7 +221,7 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Textarea',
formItemClass: 'col-span-2',
},
];
]
//门禁记录
export const accessControlColumns: VxeGridProps['columns'] = [
@@ -231,7 +258,7 @@ export const accessControlColumns: VxeGridProps['columns'] = [
field: 'locathon',
},
];
]
//车辆记录
export const carColumns: VxeGridProps['columns'] = [
@@ -275,20 +302,20 @@ export const carColumns: VxeGridProps['columns'] = [
title: '备注',
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 }[] = [];
}
const res = await resident_unitList(queryParam)
const data: { value: number; label: string }[] = []
res.rows.forEach((r: any) => {
data.push({
value: r.id,
label: r.name,
});
});
return data;
})
})
return data
}