feat(sis): 新增通行权限组功能
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -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'
|
||||
},
|
||||
];
|
||||
]
|
||||
|
@@ -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 ?? '-' }}
|
||||
|
Reference in New Issue
Block a user