From 2ad20e8ccb16a42d13d501215706cdd9439b5449 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Tue, 22 Jul 2025 20:52:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E6=84=8F=E8=A7=81=E5=8F=8D?= =?UTF-8?q?=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerService/feedbacks/index.ts | 61 +++++++ .../customerService/feedbacks/model.d.ts | 159 ++++++++++++++++ .../customerService/feedbacks/data.ts | 168 +++++++++++++++++ .../feedbacks/feedbacks-modal.vue | 101 +++++++++++ .../customerService/feedbacks/index.vue | 169 ++++++++++++++++++ 5 files changed, 658 insertions(+) create mode 100644 apps/web-antd/src/api/property/customerService/feedbacks/index.ts create mode 100644 apps/web-antd/src/api/property/customerService/feedbacks/model.d.ts create mode 100644 apps/web-antd/src/views/property/customerService/feedbacks/data.ts create mode 100644 apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue create mode 100644 apps/web-antd/src/views/property/customerService/feedbacks/index.vue diff --git a/apps/web-antd/src/api/property/customerService/feedbacks/index.ts b/apps/web-antd/src/api/property/customerService/feedbacks/index.ts new file mode 100644 index 00000000..5989ef68 --- /dev/null +++ b/apps/web-antd/src/api/property/customerService/feedbacks/index.ts @@ -0,0 +1,61 @@ +import type { FeedbacksVO, FeedbacksForm, FeedbacksQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询意见反馈列表 +* @param params +* @returns 意见反馈列表 +*/ +export function feedbacksList(params?: FeedbacksQuery) { + return requestClient.get>('/system/feedbacks/list', { params }); +} + +/** + * 导出意见反馈列表 + * @param params + * @returns 意见反馈列表 + */ +export function feedbacksExport(params?: FeedbacksQuery) { + return commonExport('/system/feedbacks/export', params ?? {}); +} + +/** + * 查询意见反馈详情 + * @param id id + * @returns 意见反馈详情 + */ +export function feedbacksInfo(id: ID) { + return requestClient.get(`/system/feedbacks/${id}`); +} + +/** + * 新增意见反馈 + * @param data + * @returns void + */ +export function feedbacksAdd(data: FeedbacksForm) { + return requestClient.postWithMsg('/system/feedbacks', data); +} + +/** + * 更新意见反馈 + * @param data + * @returns void + */ +export function feedbacksUpdate(data: FeedbacksForm) { + return requestClient.putWithMsg('/system/feedbacks', data); +} + +/** + * 删除意见反馈 + * @param id id + * @returns void + */ +export function feedbacksRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/system/feedbacks/${id}`); +} diff --git a/apps/web-antd/src/api/property/customerService/feedbacks/model.d.ts b/apps/web-antd/src/api/property/customerService/feedbacks/model.d.ts new file mode 100644 index 00000000..bab69c5a --- /dev/null +++ b/apps/web-antd/src/api/property/customerService/feedbacks/model.d.ts @@ -0,0 +1,159 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface FeedbacksVO { + /** + * 主键 + */ + id: string | number; + + /** + * 反馈类型(0保修1保洁2会议) + */ + feedbackType: string; + + /** + * 反馈人 + */ + feedbackPersion: number; + + /** + * 反馈人电话 + */ + feedbackPersionPhone: string; + + /** + * 反馈内容 + */ + feedbackContent: string; + + /** + * 反馈位置 + */ + feedbackLocation: string; + + /** + * 反馈图片 + */ + feedbackImg: string; + + /** + * 是否转至工单 + */ + isWorkOrder: string; + + /** + * 状态(1待处理2处理中3处理完成) + */ + status: string; + + /** + * 客服电话 + */ + serviceName: string; + +} + +export interface FeedbacksForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 反馈类型(0保修1保洁2会议) + */ + feedbackType?: string; + + /** + * 反馈人 + */ + feedbackPersion?: number; + + /** + * 反馈人电话 + */ + feedbackPersionPhone?: string; + + /** + * 反馈内容 + */ + feedbackContent?: string; + + /** + * 反馈位置 + */ + feedbackLocation?: string; + + /** + * 反馈图片 + */ + feedbackImg?: string; + + /** + * 是否转至工单 + */ + isWorkOrder?: string; + + /** + * 状态(1待处理2处理中3处理完成) + */ + status?: string; + + /** + * 客服电话 + */ + serviceName?: string; + +} + +export interface FeedbacksQuery extends PageQuery { + /** + * 反馈类型(0保修1保洁2会议) + */ + feedbackType?: string; + + /** + * 反馈人 + */ + feedbackPersion?: number; + + /** + * 反馈人电话 + */ + feedbackPersionPhone?: string; + + /** + * 反馈内容 + */ + feedbackContent?: string; + + /** + * 反馈位置 + */ + feedbackLocation?: string; + + /** + * 反馈图片 + */ + feedbackImg?: string; + + /** + * 是否转至工单 + */ + isWorkOrder?: string; + + /** + * 状态(1待处理2处理中3处理完成) + */ + status?: string; + + /** + * 客服电话 + */ + serviceName?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/customerService/feedbacks/data.ts b/apps/web-antd/src/views/property/customerService/feedbacks/data.ts new file mode 100644 index 00000000..04e73671 --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/feedbacks/data.ts @@ -0,0 +1,168 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; +import {getDictOptions} from "#/utils/dict"; +import {renderDict} from "#/utils/render"; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Select', + componentProps: { + options:getDictOptions('wy_yjfklx') + }, + fieldName: 'feedbackType', + label: '反馈类型', + }, + { + component: 'Select', + componentProps: { + options:getDictOptions('wy_yjclzt') + }, + fieldName: 'status', + label: '处理状态', + }, +]; + + +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '反馈类型', + field: 'feedbackType', + slots:{ + default: ({row})=>{ + return renderDict(row.feedbackType,'wy_yjfklx') + } + } + }, + { + title: '反馈人', + field: 'feedbackPersion', + }, + { + title: '反馈人电话', + field: 'feedbackPersionPhone', + }, + { + title: '反馈内容', + field: 'feedbackContent', + }, + { + title: '反馈位置', + field: 'feedbackLocation', + }, + { + title: '反馈图片', + field: 'feedbackImg', + }, + { + title: '是否转至工单', + field: 'isWorkOrder', + slots:{ + default: ({row})=>{ + return renderDict(row.isWorkOrder,'wy_sf') + } + } + }, + { + title: '处理状态', + field: 'status', + slots:{ + default: ({row})=>{ + return renderDict(row.status,'wy_yjclzt') + } + } + }, + { + title: '客服电话', + field: 'serviceName', + }, + { + 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: 'feedbackType', + component: 'Select', + componentProps: { + options:getDictOptions('wy_yjfklx') + }, + rules: 'selectRequired', + }, + { + label: '反馈人', + fieldName: 'feedbackPersion', + component: 'Input', + rules: 'required', + }, + { + label: '反馈人电话', + fieldName: 'feedbackPersionPhone', + component: 'Input', + rules: 'required', + }, + { + label: '反馈内容', + fieldName: 'feedbackContent', + component: 'Textarea', + rules: 'required', + formItemClass:'col-span-2' + }, + { + label: '反馈位置', + fieldName: 'feedbackLocation', + component: 'Input', + rules: 'required', + formItemClass:'col-span-2' + }, + { + label: '反馈图片', + fieldName: 'feedbackImg', + component: 'ImageUpload', + componentProps: { + // accept: 'image/*', // 可选拓展名或者mime类型 ,拼接 + // maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型 + }, + rules: 'required', + formItemClass:'col-span-2' + }, + { + label: '转至工单', + fieldName: 'isWorkOrder', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + options: getDictOptions('wy_sf'), + }, + defaultValue:'0' + }, + { + label: '处理状态', + fieldName: 'status', + component: 'Select', + componentProps: { + options: getDictOptions('wy_yjclzt') + }, + }, + { + label: '客服电话', + fieldName: 'serviceName', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue b/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue new file mode 100644 index 00000000..ead082ef --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/feedbacks/feedbacks-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/property/customerService/feedbacks/index.vue b/apps/web-antd/src/views/property/customerService/feedbacks/index.vue new file mode 100644 index 00000000..ad9d0cb7 --- /dev/null +++ b/apps/web-antd/src/views/property/customerService/feedbacks/index.vue @@ -0,0 +1,169 @@ + + + From 0d6259e3359174838dbcdfa5f897641d523fe932 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Wed, 23 Jul 2025 14:12:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(sis):=20=E6=96=B0=E5=A2=9E=E9=80=9A?= =?UTF-8?q?=E8=A1=8C=E6=9D=83=E9=99=90=E7=BB=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/property/resident/person/model.d.ts | 116 ++++++------ .../src/api/property/resident/unit/model.d.ts | 10 ++ apps/web-antd/src/api/sis/authGroup/index.ts | 61 +++++++ .../web-antd/src/api/sis/authGroup/model.d.ts | 69 +++++++ .../views/property/resident/person/data.ts | 79 +++++--- .../src/views/property/resident/unit/data.ts | 60 +++++-- .../property/resident/unit/unit-detail.vue | 5 +- .../views/sis/authGroup/authGroup-modal.vue | 101 +++++++++++ apps/web-antd/src/views/sis/authGroup/data.ts | 75 ++++++++ .../src/views/sis/authGroup/index.vue | 170 ++++++++++++++++++ 10 files changed, 650 insertions(+), 96 deletions(-) create mode 100644 apps/web-antd/src/api/sis/authGroup/index.ts create mode 100644 apps/web-antd/src/api/sis/authGroup/model.d.ts create mode 100644 apps/web-antd/src/views/sis/authGroup/authGroup-modal.vue create mode 100644 apps/web-antd/src/views/sis/authGroup/data.ts create mode 100644 apps/web-antd/src/views/sis/authGroup/index.vue diff --git a/apps/web-antd/src/api/property/resident/person/model.d.ts b/apps/web-antd/src/api/property/resident/person/model.d.ts index 524bd55a..ac53f8b9 100644 --- a/apps/web-antd/src/api/property/resident/person/model.d.ts +++ b/apps/web-antd/src/api/property/resident/person/model.d.ts @@ -1,70 +1,75 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type { PageQuery, BaseEntity } from '#/api/common' export interface PersonVO { /** * 主键id */ - id: string | number; + id: string | number /** * 用户id */ - userId: string | number; + userId: string | number /** * 用户名称 */ - userName: string; + userName: string /** * 联系电话 */ - phone: string; + phone: string /** * 性别 */ - gender: number; + gender: number /** * 人脸图片 */ - img: string; + img: string /** * 所属单位id */ - unitId: string | number; + unitId: string | number /** * 所属单位名称 */ - unitName: string; + unitName: string /** * 入驻位置 */ - locathon: string; + locathon: string /** * 入驻时间 */ - time: string; + time: string /** * 车牌号码 */ - carNumber: string; + carNumber: string /** * 状态 */ - state: number|string; + state: number | string /** * 备注 */ - remark: string; + remark: string + + /** + * 权限组id + */ + authGroupId?: string | number } @@ -72,67 +77,72 @@ export interface PersonForm extends BaseEntity { /** * 主键id */ - id?: string | number; + id?: string | number /** * 用户id */ - userId?: string | number; + userId?: string | number /** * 用户名称 */ - userName?: string; + userName?: string /** * 联系电话 */ - phone?: string; + phone?: string /** * 性别 */ - gender?: number; + gender?: number /** * 人脸图片 */ - img?: string; + img?: string /** * 所属单位id */ - unitId?: string | number; + unitId?: string | number /** * 所属单位名称 */ - unitName?: string; + unitName?: string /** * 入驻位置 */ - locathon?: string; + locathon?: string /** * 入驻时间 */ - time?: string; + time?: string /** * 车牌号码 */ - carNumber?: string; + carNumber?: string /** * 状态 */ - state?: number; + state?: number /** * 备注 */ - remark?: string; + remark?: string + + /** + * 权限组id + */ + authGroupId?: string | number } @@ -140,128 +150,128 @@ export interface PersonQuery extends PageQuery { /** * 用户id */ - userId?: string | number; + userId?: string | number /** * 用户名称 */ - userName?: string; + userName?: string /** * 联系电话 */ - phone?: string; + phone?: string /** * 性别 */ - gender?: number; + gender?: number /** * 人脸图片 */ - img?: string; + img?: string /** * 所属单位id */ - unitId?: string | number; + unitId?: string | number /** * 所属单位名称 */ - unitName?: string; + unitName?: string /** * 入驻位置 */ - locathon?: string; + locathon?: string /** * 入驻时间 */ - time?: string; + time?: string /** * 车牌号码 */ - carNumber?: string; + carNumber?: string /** * 状态 */ - state?: number; + state?: number /** * 日期范围参数 */ - params?: any; + params?: any } -export interface Person extends BaseEntity{ +export interface Person extends BaseEntity { /** * 主键id */ - id: string | number; + id: string | number /** * 用户id */ - userId: string | number; + userId: string | number /** * 用户名称 */ - userName: string; + userName: string /** * 联系电话 */ - phone: string; + phone: string /** * 性别 */ - gender: number; + gender: number /** * 人脸图片 */ - img: string; + img: string /** * 所属单位id */ - unitId: string | number; + unitId: string | number /** * 所属单位名称 */ - unitName: string; + unitName: string /** * 入驻位置 */ - locathon: string; + locathon: string /** * 入驻时间 */ - time: string; + time: string /** * 车牌号码 */ - carNumber: string; + carNumber: string /** * 状态 */ - state: number; + state: number /** * 备注 */ - remark: string; + remark: string } diff --git a/apps/web-antd/src/api/property/resident/unit/model.d.ts b/apps/web-antd/src/api/property/resident/unit/model.d.ts index 471f6103..747ee0cc 100644 --- a/apps/web-antd/src/api/property/resident/unit/model.d.ts +++ b/apps/web-antd/src/api/property/resident/unit/model.d.ts @@ -56,6 +56,16 @@ export interface Resident_unitVO { */ remark: string; + /** + * 权限组id + */ + authGroupId?: string | number; + + /** + * 权限组名称 + */ + authGroupName?: string; + } export interface Resident_unitForm extends BaseEntity { diff --git a/apps/web-antd/src/api/sis/authGroup/index.ts b/apps/web-antd/src/api/sis/authGroup/index.ts new file mode 100644 index 00000000..fa985c1b --- /dev/null +++ b/apps/web-antd/src/api/sis/authGroup/index.ts @@ -0,0 +1,61 @@ +import type { AuthGroupVO, AuthGroupForm, AuthGroupQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询授权组列表 +* @param params +* @returns 授权组列表 +*/ +export function authGroupList(params?: AuthGroupQuery) { + return requestClient.get>('/sis/authGroup/list', { params }); +} + +/** + * 导出授权组列表 + * @param params + * @returns 授权组列表 + */ +export function authGroupExport(params?: AuthGroupQuery) { + return commonExport('/sis/authGroup/export', params ?? {}); +} + +/** + * 查询授权组详情 + * @param id id + * @returns 授权组详情 + */ +export function authGroupInfo(id: ID) { + return requestClient.get(`/sis/authGroup/${id}`); +} + +/** + * 新增授权组 + * @param data + * @returns void + */ +export function authGroupAdd(data: AuthGroupForm) { + return requestClient.postWithMsg('/sis/authGroup', data); +} + +/** + * 更新授权组 + * @param data + * @returns void + */ +export function authGroupUpdate(data: AuthGroupForm) { + return requestClient.putWithMsg('/sis/authGroup', data); +} + +/** + * 删除授权组 + * @param id id + * @returns void + */ +export function authGroupRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/authGroup/${id}`); +} diff --git a/apps/web-antd/src/api/sis/authGroup/model.d.ts b/apps/web-antd/src/api/sis/authGroup/model.d.ts new file mode 100644 index 00000000..50809321 --- /dev/null +++ b/apps/web-antd/src/api/sis/authGroup/model.d.ts @@ -0,0 +1,69 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface AuthGroupVO { + /** + * 主键id + */ + id: string | number; + + /** + * 权限名称 + */ + name: string; + + /** + * 面向对象(1-单位、2-个人) + */ + groupType: number; + + /** + * 是否启用(0:禁用,1启用) + */ + isEnable: boolean; + +} + +export interface AuthGroupForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 权限名称 + */ + name?: string; + + /** + * 面向对象(1-单位、2-个人) + */ + groupType?: number; + + /** + * 是否启用(0:禁用,1启用) + */ + isEnable?: boolean; + +} + +export interface AuthGroupQuery extends PageQuery { + /** + * 权限名称 + */ + name?: string; + + /** + * 面向对象(1-单位、2-个人) + */ + groupType?: number; + + /** + * 是否启用(0:禁用,1启用) + */ + isEnable?: boolean; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/resident/person/data.ts b/apps/web-antd/src/views/property/resident/person/data.ts index 9a3346c7..94cae24d 100644 --- a/apps/web-antd/src/views/property/resident/person/data.ts +++ b/apps/web-antd/src/views/property/resident/person/data.ts @@ -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 } diff --git a/apps/web-antd/src/views/property/resident/unit/data.ts b/apps/web-antd/src/views/property/resident/unit/data.ts index 308d9dfa..256a5b7a 100644 --- a/apps/web-antd/src/views/property/resident/unit/data.ts +++ b/apps/web-antd/src/views/property/resident/unit/data.ts @@ -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' }, -]; +] diff --git a/apps/web-antd/src/views/property/resident/unit/unit-detail.vue b/apps/web-antd/src/views/property/resident/unit/unit-detail.vue index 33f31bd6..90b2871c 100644 --- a/apps/web-antd/src/views/property/resident/unit/unit-detail.vue +++ b/apps/web-antd/src/views/property/resident/unit/unit-detail.vue @@ -44,7 +44,7 @@ async function handleOpenChange(open: boolean) {