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
}

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 {z} from "#/adapter/form";
import type { FormSchemaGetter } from '#/adapter/form'
import { authGroupList } from '#/api/sis/authGroup'
import type { AuthGroupVO, AuthGroupQuery } from '#/api/sis/authGroup/model'
import type { VxeGridProps } from '#/adapter/vxe-table'
import { getDictOptions } from "#/utils/dict"
import { renderDict } from "#/utils/render"
import { z } from "#/adapter/form"
export const querySchema: FormSchemaGetter = () => [
{
@@ -23,10 +25,10 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'state',
label: '状态',
},
];
]
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{ type: 'checkbox', width: 60 },
// {
// title: '序号',
// field: 'id',
@@ -40,10 +42,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '单位编号',
field: 'unitNumber',
slots:{
slots: {
default: ({ row }) => {
return row.id;
}},
return row.id
}
},
width: 100
},
{
@@ -56,7 +59,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'type',
slots: {
default: ({ row }) => {
return renderDict(row.type, 'wy_qylx');
return renderDict(row.type, 'wy_qylx')
},
},
width: 100
@@ -84,7 +87,7 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
slots: {default: 'state'},
slots: { default: 'state' },
width: 100,
},
// {
@@ -105,12 +108,13 @@ export const columns: VxeGridProps['columns'] = [
{
field: 'action',
fixed: 'right',
slots: {default: 'action'},
slots: { default: 'action' },
title: '操作',
minWidth: 180,
},
];
]
let authGroupArr: AuthGroupVO[] = []
export const modalSchema: FormSchemaGetter = () => [
{
label: 'id',
@@ -147,7 +151,7 @@ export const modalSchema: FormSchemaGetter = () => [
label: '联系电话',
fieldName: 'phone',
component: 'Input',
rules:z.union([
rules: z.union([
z.string().regex(/^1[3-9]\d{9}$/, { message: '手机号格式错误' }),
z.number().int().min(1000000000).max(19999999999, { message: '手机号格式错误' })
]).transform(val => val.toString()),
@@ -170,10 +174,34 @@ export const modalSchema: FormSchemaGetter = () => [
},
rules: 'required',
},
{
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: 1,
pageNum: 1,
pageSize: 500,
}
const res = await authGroupList(params)
authGroupArr = res.rows
}
return authGroupArr
},
},
rules: 'required',
},
{
label: '备注',
fieldName: 'remark',
component: 'Textarea',
formItemClass: 'col-span-2'
},
];
]

View File

@@ -44,7 +44,7 @@ async function handleOpenChange(open: boolean) {
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="入驻单位信息" class="w-[70%]">
<Descriptions v-if="unitDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<Descriptions v-if="unitDetail" size="small" :column="2" bordered :labelStyle="{width:'110px'}">
<DescriptionsItem label="单位编号">
{{ unitDetail.id }}
</DescriptionsItem>
@@ -75,6 +75,9 @@ async function handleOpenChange(open: boolean) {
<component
:is="renderDict(unitDetail.state,'wy_state')"
/>
</DescriptionsItem>
<DescriptionsItem label="通行权限组">
{{ unitDetail.authGroupId ?? '-' }}
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ unitDetail.remark ?? '-' }}