From 1bc8d02cec2396556c864e50e0b7a238f99a7f7f Mon Sep 17 00:00:00 2001 From: lxj <15683799673@163.com> Date: Thu, 26 Jun 2025 22:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=83=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/sis/accessControlDevice/index.ts | 69 +++++ .../api/sis/accessControlDevice/model.d.ts | 202 ++++++++++++++ .../web-antd/src/api/sis/devicePoint/index.ts | 62 +++++ .../src/api/sis/devicePoint/model.d.ts | 259 ++++++++++++++++++ .../src/api/sis/personLibImg/model.d.ts | 42 +-- .../accessControlDevice-modal.vue | 106 +++++++ .../src/views/sis/accessControlDevice/data.ts | 108 ++++++++ .../views/sis/accessControlDevice/index.vue | 182 ++++++++++++ .../src/views/sis/devicePoint/data.ts | 236 ++++++++++++++++ .../sis/devicePoint/devicePoint-modal.vue | 104 +++++++ .../src/views/sis/devicePoint/index.vue | 182 ++++++++++++ apps/web-antd/src/views/sis/personLib/data.ts | 76 ++--- .../src/views/sis/personLibImg/data.ts | 155 ++--------- .../src/views/sis/personLibImg/index.vue | 46 ++-- .../sis/personLibImg/personLibImg-modal.vue | 13 +- .../base/shared/src/constants/dict-enum.ts | 4 + 16 files changed, 1600 insertions(+), 246 deletions(-) create mode 100644 apps/web-antd/src/api/sis/accessControlDevice/index.ts create mode 100644 apps/web-antd/src/api/sis/accessControlDevice/model.d.ts create mode 100644 apps/web-antd/src/api/sis/devicePoint/index.ts create mode 100644 apps/web-antd/src/api/sis/devicePoint/model.d.ts create mode 100644 apps/web-antd/src/views/sis/accessControlDevice/accessControlDevice-modal.vue create mode 100644 apps/web-antd/src/views/sis/accessControlDevice/data.ts create mode 100644 apps/web-antd/src/views/sis/accessControlDevice/index.vue create mode 100644 apps/web-antd/src/views/sis/devicePoint/data.ts create mode 100644 apps/web-antd/src/views/sis/devicePoint/devicePoint-modal.vue create mode 100644 apps/web-antd/src/views/sis/devicePoint/index.vue diff --git a/apps/web-antd/src/api/sis/accessControlDevice/index.ts b/apps/web-antd/src/api/sis/accessControlDevice/index.ts new file mode 100644 index 00000000..ae5b9b23 --- /dev/null +++ b/apps/web-antd/src/api/sis/accessControlDevice/index.ts @@ -0,0 +1,69 @@ +import type { + AccessControlDeviceForm, + AccessControlDeviceQuery, + AccessControlDeviceVO, +} from './model'; + +import type { ID, IDS, PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** + * 查询门禁设备列表 + * @param params + * @returns 门禁设备列表 + */ +export function accessControlDeviceList(params?: AccessControlDeviceQuery) { + return requestClient.get>( + '/sis/accessControlDevice/list', + { params }, + ); +} + +/** + * 导出门禁设备列表 + * @param params + * @returns 门禁设备列表 + */ +export function accessControlDeviceExport(params?: AccessControlDeviceQuery) { + return commonExport('/sis/accessControlDevice/export', params ?? {}); +} + +/** + * 查询门禁设备详情 + * @param id id + * @returns 门禁设备详情 + */ +export function accessControlDeviceInfo(id: ID) { + return requestClient.get( + `/sis/accessControlDevice/${id}`, + ); +} + +/** + * 新增门禁设备 + * @param data + * @returns void + */ +export function accessControlDeviceAdd(data: AccessControlDeviceForm) { + return requestClient.postWithMsg('/sis/accessControlDevice', data); +} + +/** + * 更新门禁设备 + * @param data + * @returns void + */ +export function accessControlDeviceUpdate(data: AccessControlDeviceForm) { + return requestClient.putWithMsg('/sis/accessControlDevice', data); +} + +/** + * 删除门禁设备 + * @param id id + * @returns void + */ +export function accessControlDeviceRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/accessControlDevice/${id}`); +} diff --git a/apps/web-antd/src/api/sis/accessControlDevice/model.d.ts b/apps/web-antd/src/api/sis/accessControlDevice/model.d.ts new file mode 100644 index 00000000..f60326c2 --- /dev/null +++ b/apps/web-antd/src/api/sis/accessControlDevice/model.d.ts @@ -0,0 +1,202 @@ +import type { BaseEntity, PageQuery } from '#/api/common'; + +export interface AccessControlDeviceVO { + /** + * 主键id + */ + id: number | string; + + /** + * 设备编码 + */ + eqpNo: string; + + /** + * 设备名称 + */ + eqpName: string; + + /** + * 厂商编码 + */ + factoryNo: string; + + /** + * 设备类型 + */ + eqpType: number; + + /** + * 接入类型(1: 平台接入,2:设备接入) + */ + accessType: number; + + /** + * 设备ip + */ + eqpIp: string; + + /** + * 设备端口 + */ + eqpPort: number; + + /** + * 设备账号 + */ + eqpAccount: string; + + /** + * 设备密码 + */ + eqpPwd: string; + + /** + * 创建人id + */ + createById: number | string; + + /** + * 更新人id + */ + updateById: number | string; + + /** + * 搜索值 + */ + searchValue: string; +} + +export interface AccessControlDeviceForm extends BaseEntity { + /** + * 主键id + */ + id?: number | string; + + /** + * 设备编码 + */ + eqpNo?: string; + + /** + * 设备名称 + */ + eqpName?: string; + + /** + * 厂商编码 + */ + factoryNo?: string; + + /** + * 设备类型 + */ + eqpType?: number; + + /** + * 接入类型(1: 平台接入,2:设备接入) + */ + accessType?: number; + + /** + * 设备ip + */ + eqpIp?: string; + + /** + * 设备端口 + */ + eqpPort?: number; + + /** + * 设备账号 + */ + eqpAccount?: string; + + /** + * 设备密码 + */ + eqpPwd?: string; + + /** + * 创建人id + */ + createById?: number | string; + + /** + * 更新人id + */ + updateById?: number | string; + + /** + * 搜索值 + */ + searchValue?: string; +} + +export interface AccessControlDeviceQuery extends PageQuery { + /** + * 设备编码 + */ + eqpNo?: string; + + /** + * 设备名称 + */ + eqpName?: string; + + /** + * 厂商编码 + */ + factoryNo?: string; + + /** + * 设备类型 + */ + eqpType?: number; + + /** + * 接入类型(1: 平台接入,2:设备接入) + */ + accessType?: number; + + /** + * 设备ip + */ + eqpIp?: string; + + /** + * 设备端口 + */ + eqpPort?: number; + + /** + * 设备账号 + */ + eqpAccount?: string; + + /** + * 设备密码 + */ + eqpPwd?: string; + + /** + * 创建人id + */ + createById?: number | string; + + /** + * 更新人id + */ + updateById?: number | string; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/sis/devicePoint/index.ts b/apps/web-antd/src/api/sis/devicePoint/index.ts new file mode 100644 index 00000000..12cb1be3 --- /dev/null +++ b/apps/web-antd/src/api/sis/devicePoint/index.ts @@ -0,0 +1,62 @@ +import type { DevicePointForm, DevicePointQuery, DevicePointVO } from './model'; + +import type { ID, IDS, PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** + * 查询宇视设备点位(通道)列表 + * @param params + * @returns 宇视设备点位(通道)列表 + */ +export function devicePointList(params?: DevicePointQuery) { + return requestClient.get>('/sis/devicePoint/list', { + params, + }); +} + +/** + * 导出宇视设备点位(通道)列表 + * @param params + * @returns 宇视设备点位(通道)列表 + */ +export function devicePointExport(params?: DevicePointQuery) { + return commonExport('/sis/devicePoint/export', params ?? {}); +} + +/** + * 查询宇视设备点位(通道)详情 + * @param id id + * @returns 宇视设备点位(通道)详情 + */ +export function devicePointInfo(id: ID) { + return requestClient.get(`/sis/devicePoint/${id}`); +} + +/** + * 新增宇视设备点位(通道) + * @param data + * @returns void + */ +export function devicePointAdd(data: DevicePointForm) { + return requestClient.postWithMsg('/sis/devicePoint', data); +} + +/** + * 更新宇视设备点位(通道) + * @param data + * @returns void + */ +export function devicePointUpdate(data: DevicePointForm) { + return requestClient.putWithMsg('/sis/devicePoint', data); +} + +/** + * 删除宇视设备点位(通道) + * @param id id + * @returns void + */ +export function devicePointRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/devicePoint/${id}`); +} diff --git a/apps/web-antd/src/api/sis/devicePoint/model.d.ts b/apps/web-antd/src/api/sis/devicePoint/model.d.ts new file mode 100644 index 00000000..f60f3cb5 --- /dev/null +++ b/apps/web-antd/src/api/sis/devicePoint/model.d.ts @@ -0,0 +1,259 @@ +import type { BaseEntity, PageQuery } from '#/api/common'; + +export interface DevicePointVO { + /** + * 主键id + */ + id: number | string; + + /** + * 设备编码 + */ + eqpCode: string; + + /** + * 视频协议 1:onvif 2: +rtsp + */ + video: number | string; + + /** + * 传输协议(AIBOX 需要,一 +体机不需要) 1: tcp 2: +udp + */ + transportType: number; + + /** + * 点位名称 + */ + channelName: string; + + /** + * rtsp 地址(当视频协议为 +rtsp 时,该字段必填) + */ + rtspAddr: string; + + /** + * 点位名称 + */ + ip: string; + + /** + * 端口 + */ + port: number; + + /** + * 通道相机账号 + */ + username: string; + + /** + * 相机密码 + */ + pwd: string; + + /** + * onvif 设备码流添加方 +式:1:主码流 2:自定 +义码流 + */ + videoType: number | string; + + /** + * 码流 id:当选择自定义码 +流时,该字段必填,值为 +获取设备码流信息接口返 +回的码流 id + */ + videoId: number | string; + + /** + * 创建人id + */ + createById: number | string; + + /** + * 更新人id + */ + updateById: number | string; + + /** + * 搜索值 + */ + searchValue: string; +} + +export interface DevicePointForm extends BaseEntity { + /** + * 主键id + */ + id?: number | string; + + /** + * 设备编码 + */ + eqpCode?: string; + + /** + * 视频协议 1:onvif 2: +rtsp + */ + video?: number | string; + + /** + * 传输协议(AIBOX 需要,一 +体机不需要) 1: tcp 2: +udp + */ + transportType?: number; + + /** + * 点位名称 + */ + channelName?: string; + + /** + * rtsp 地址(当视频协议为 +rtsp 时,该字段必填) + */ + rtspAddr?: string; + + /** + * 点位名称 + */ + ip?: string; + + /** + * 端口 + */ + port?: number; + + /** + * 通道相机账号 + */ + username?: string; + + /** + * 相机密码 + */ + pwd?: string; + + /** + * onvif 设备码流添加方 +式:1:主码流 2:自定 +义码流 + */ + videoType?: number | string; + + /** + * 码流 id:当选择自定义码 +流时,该字段必填,值为 +获取设备码流信息接口返 +回的码流 id + */ + videoId?: number | string; + + /** + * 创建人id + */ + createById?: number | string; + + /** + * 更新人id + */ + updateById?: number | string; + + /** + * 搜索值 + */ + searchValue?: string; +} + +export interface DevicePointQuery extends PageQuery { + /** + * 设备编码 + */ + eqpCode?: string; + + /** + * 视频协议 1:onvif 2: +rtsp + */ + video?: number | string; + + /** + * 传输协议(AIBOX 需要,一 +体机不需要) 1: tcp 2: +udp + */ + transportType?: number; + + /** + * 点位名称 + */ + channelName?: string; + + /** + * rtsp 地址(当视频协议为 +rtsp 时,该字段必填) + */ + rtspAddr?: string; + + /** + * 点位名称 + */ + ip?: string; + + /** + * 端口 + */ + port?: number; + + /** + * 通道相机账号 + */ + username?: string; + + /** + * 相机密码 + */ + pwd?: string; + + /** + * onvif 设备码流添加方 +式:1:主码流 2:自定 +义码流 + */ + videoType?: number | string; + + /** + * 码流 id:当选择自定义码 +流时,该字段必填,值为 +获取设备码流信息接口返 +回的码流 id + */ + videoId?: number | string; + + /** + * 创建人id + */ + createById?: number | string; + + /** + * 更新人id + */ + updateById?: number | string; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/sis/personLibImg/model.d.ts b/apps/web-antd/src/api/sis/personLibImg/model.d.ts index d0e0d6ca..a5ca8f66 100644 --- a/apps/web-antd/src/api/sis/personLibImg/model.d.ts +++ b/apps/web-antd/src/api/sis/personLibImg/model.d.ts @@ -1,10 +1,10 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type { BaseEntity, PageQuery } from '#/api/common'; export interface PersonLibImgVO { /** * 主键id */ - id: string | number; + id: number | string; /** * 人员库编码 @@ -59,28 +59,17 @@ export interface PersonLibImgVO { */ birthDate: string; - /** - * 创建人id - */ - createById: string | number; - - /** - * 更新人id - */ - updateById: string | number; - /** * 搜索值 */ searchValue: string; - } export interface PersonLibImgForm extends BaseEntity { /** * 主键id */ - id?: string | number; + id?: number | string; /** * 人员库编码 @@ -135,21 +124,10 @@ export interface PersonLibImgForm extends BaseEntity { */ birthDate?: string; - /** - * 创建人id - */ - createById?: string | number; - - /** - * 更新人id - */ - updateById?: string | number; - /** * 搜索值 */ searchValue?: string; - } export interface PersonLibImgQuery extends PageQuery { @@ -206,23 +184,13 @@ export interface PersonLibImgQuery extends PageQuery { */ birthDate?: string; - /** - * 创建人id - */ - createById?: string | number; - - /** - * 更新人id - */ - updateById?: string | number; - /** * 搜索值 */ searchValue?: string; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; } diff --git a/apps/web-antd/src/views/sis/accessControlDevice/accessControlDevice-modal.vue b/apps/web-antd/src/views/sis/accessControlDevice/accessControlDevice-modal.vue new file mode 100644 index 00000000..bbee13cc --- /dev/null +++ b/apps/web-antd/src/views/sis/accessControlDevice/accessControlDevice-modal.vue @@ -0,0 +1,106 @@ + + + diff --git a/apps/web-antd/src/views/sis/accessControlDevice/data.ts b/apps/web-antd/src/views/sis/accessControlDevice/data.ts new file mode 100644 index 00000000..62f790ca --- /dev/null +++ b/apps/web-antd/src/views/sis/accessControlDevice/data.ts @@ -0,0 +1,108 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +import { DictEnum } from '@vben/constants'; +import { getPopupContainer } from '@vben/utils'; + +import { getDictOptions } from '#/utils/dict'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'eqpName', + label: '设备名称', + }, + { + component: 'Select', + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SIS_ACCESS_CONTROL_DEVICE_TYPE), + }, + fieldName: 'factoryNo', + label: '设备厂商', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '设备编码', + field: 'eqpNo', + }, + { + title: '设备名称', + field: 'eqpName', + }, + { + title: '设备厂商', + field: 'factoryName', + }, + + { + title: '设备ip', + field: 'eqpIp', + }, + { + title: '设备端口', + field: 'eqpPort', + }, + { + title: '设备账号', + field: 'eqpAccount', + }, + { + title: '设备密码', + field: 'eqpPwd', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '设备名称', + fieldName: 'eqpName', + component: 'Input', + rules: 'required', + }, + { + label: '设备厂商', + fieldName: 'factoryNo', + component: 'Select', + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SIS_ACCESS_CONTROL_DEVICE_TYPE), + }, + }, + { + label: '设备ip', + fieldName: 'eqpIp', + component: 'Input', + rules: 'required', + }, + { + label: '设备端口', + fieldName: 'eqpPort', + component: 'Input', + rules: 'required', + }, + { + label: '设备账号', + fieldName: 'eqpAccount', + component: 'Input', + rules: 'required', + }, + { + label: '设备密码', + fieldName: 'eqpPwd', + component: 'Input', + rules: 'required', + }, +]; diff --git a/apps/web-antd/src/views/sis/accessControlDevice/index.vue b/apps/web-antd/src/views/sis/accessControlDevice/index.vue new file mode 100644 index 00000000..584f083f --- /dev/null +++ b/apps/web-antd/src/views/sis/accessControlDevice/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/sis/devicePoint/data.ts b/apps/web-antd/src/views/sis/devicePoint/data.ts new file mode 100644 index 00000000..1d1ddc35 --- /dev/null +++ b/apps/web-antd/src/views/sis/devicePoint/data.ts @@ -0,0 +1,236 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'eqpCode', + label: '设备编码', + }, + { + component: 'Input', + fieldName: 'video', + label: '视频协议', + }, + { + component: 'Select', + componentProps: {}, + fieldName: 'transportType', + label: '传输协议', + }, + { + component: 'Input', + fieldName: 'channelName', + label: '点位名称', + }, + { + component: 'Input', + fieldName: 'rtspAddr', + label: 'rtsp 地址', + }, + { + component: 'Input', + fieldName: 'ip', + label: '点位名称', + }, + { + component: 'Input', + fieldName: 'port', + label: '端口', + }, + { + component: 'Input', + fieldName: 'username', + label: '通道相机账号', + }, + { + component: 'Input', + fieldName: 'pwd', + label: '相机密码', + }, + { + component: 'Select', + componentProps: {}, + fieldName: 'videoType', + label: '码流', + }, + { + component: 'Input', + fieldName: 'videoId', + label: '码流id', + }, + { + component: 'Input', + fieldName: 'createById', + label: '创建人id', + }, + { + component: 'Input', + fieldName: 'updateById', + label: '更新人id', + }, + { + component: 'Input', + fieldName: 'searchValue', + label: '搜索值', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '主键id', + field: 'id', + }, + { + title: '设备编码', + field: 'eqpCode', + }, + { + title: '视频协议', + }, + { + title: '传输协议', + field: 'transportType', + }, + { + title: '点位名称', + field: 'channelName', + }, + { + title: 'rtsp 地址', + field: 'rtspAddr', + }, + { + title: '点位名称', + field: 'ip', + }, + { + title: '端口', + field: 'port', + }, + { + title: '通道相机账号', + field: 'username', + }, + { + title: '相机密码', + field: 'pwd', + }, + { + title: '设备码流', + field: 'videoType', + }, + { + title: '码流id', + field: 'videoId', + }, + { + title: '创建人id', + field: 'createById', + }, + { + title: '更新人id', + field: 'updateById', + }, + { + title: '搜索值', + field: 'searchValue', + }, + { + field: 'action', + fixed: 'right', + slots: { + default: 'action', + }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键id', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '设备编码', + fieldName: 'eqpCode', + component: 'Input', + rules: 'required', + }, + { + label: '视频协议', + fieldName: 'video', + component: 'Input', + }, + { + label: '传输协议', + fieldName: 'transportType', + component: 'Select', + componentProps: {}, + }, + { + label: '点位名称', + fieldName: 'channelName', + component: 'Input', + }, + { + label: 'rtsp 地址', + fieldName: 'rtspAddr', + component: 'Input', + }, + { + label: '点位名称', + fieldName: 'ip', + component: 'Input', + }, + { + label: '端口', + fieldName: 'port', + component: 'Input', + }, + { + label: '通道相机账号', + fieldName: 'username', + component: 'Input', + }, + { + label: '相机密码', + fieldName: 'pwd', + component: 'Input', + }, + { + label: '设备码流', + fieldName: 'videoType', + component: 'Select', + componentProps: {}, + }, + { + label: '码流id', + fieldName: 'videoId', + component: 'Input', + }, + { + label: '创建人id', + fieldName: 'createById', + component: 'Input', + }, + { + label: '更新人id', + fieldName: 'updateById', + component: 'Input', + }, + { + label: '搜索值', + fieldName: 'searchValue', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/sis/devicePoint/devicePoint-modal.vue b/apps/web-antd/src/views/sis/devicePoint/devicePoint-modal.vue new file mode 100644 index 00000000..3e5ad95b --- /dev/null +++ b/apps/web-antd/src/views/sis/devicePoint/devicePoint-modal.vue @@ -0,0 +1,104 @@ + + + diff --git a/apps/web-antd/src/views/sis/devicePoint/index.vue b/apps/web-antd/src/views/sis/devicePoint/index.vue new file mode 100644 index 00000000..b8e41518 --- /dev/null +++ b/apps/web-antd/src/views/sis/devicePoint/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/sis/personLib/data.ts b/apps/web-antd/src/views/sis/personLib/data.ts index 8a64e9c5..8e9603b4 100644 --- a/apps/web-antd/src/views/sis/personLib/data.ts +++ b/apps/web-antd/src/views/sis/personLib/data.ts @@ -1,44 +1,34 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; +import { DictEnum } from '@vben/constants'; +import { getPopupContainer } from '@vben/utils'; + +import { getDictOptions } from '#/utils/dict'; + export const querySchema: FormSchemaGetter = () => [ - { - component: 'Input', - fieldName: 'libCode', - label: '人员库编码', - }, { component: 'Input', fieldName: 'libName', label: '人员库名称', }, - { - component: 'Input', - fieldName: 'libDesc', - label: '人员库描述', - }, + { component: 'Select', - componentProps: {}, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SIS_LIB_TYPE), + }, fieldName: 'libType', label: '库类型', }, - { - component: 'Select', - componentProps: {}, - fieldName: 'busiType', - label: '业务类型', - }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, - { - title: '主键id', - field: 'id', - }, + { title: '人员库编码', field: 'libCode', @@ -52,25 +42,13 @@ export const columns: VxeGridProps['columns'] = [ field: 'libDesc', }, { - title: '库类型,1:人员库,2:工服库', + title: '库类型', field: 'libType', }, - { - title: '库的业务类型 1: 门禁库,2: 黑名单库', + /* { + title: '业务类型', field: 'busiType', - }, - { - title: '创建人id', - field: 'createById', - }, - { - title: '更新人id', - field: 'updateById', - }, - { - title: '搜索值', - field: 'searchValue', - }, + },*/ { field: 'action', fixed: 'right', @@ -81,21 +59,6 @@ export const columns: VxeGridProps['columns'] = [ ]; export const modalSchema: FormSchemaGetter = () => [ - { - label: '主键id', - fieldName: 'id', - component: 'Input', - dependencies: { - show: () => false, - triggerFields: [''], - }, - }, - { - label: '人员库编码', - fieldName: 'libCode', - component: 'Input', - rules: 'required', - }, { label: '人员库名称', fieldName: 'libName', @@ -111,12 +74,15 @@ export const modalSchema: FormSchemaGetter = () => [ label: '库类型', fieldName: 'libType', component: 'Select', - componentProps: {}, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SIS_LIB_TYPE), + }, }, - { + /* { label: '业务类型', fieldName: 'busiType', component: 'Select', componentProps: {}, - }, + },*/ ]; diff --git a/apps/web-antd/src/views/sis/personLibImg/data.ts b/apps/web-antd/src/views/sis/personLibImg/data.ts index a2f4621c..5131c503 100644 --- a/apps/web-antd/src/views/sis/personLibImg/data.ts +++ b/apps/web-antd/src/views/sis/personLibImg/data.ts @@ -1,84 +1,33 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; +import { DictEnum } from '@vben/constants'; +import { getPopupContainer } from '@vben/utils'; + +import { getDictOptions } from '#/utils/dict'; + export const querySchema: FormSchemaGetter = () => [ - { - component: 'Input', - fieldName: 'libCode', - label: '人员库编码', - }, { component: 'Input', fieldName: 'imgName', label: '人像名称', }, - { - component: 'Input', - fieldName: 'imgCode', - label: '图片编码', - }, - { - component: 'Input', - fieldName: 'imgUrl', - label: '图片的存储地址', - }, { component: 'Select', - componentProps: {}, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SYS_USER_SEX), + }, fieldName: 'sex', label: '性别', }, - { - component: 'Input', - fieldName: 'email', - label: '邮箱', - }, - { - component: 'Input', - fieldName: 'tel', - label: '联系方式', - }, - { - component: 'Select', - componentProps: {}, - fieldName: 'certificateType', - label: '证件类型', - }, - { - component: 'Input', - fieldName: 'certificateNo', - label: '证件号码', - }, - { - component: 'Input', - fieldName: 'birthDate', - label: '出生日期', - }, - { - component: 'Input', - fieldName: 'createById', - label: '创建人id', - }, - { - component: 'Input', - fieldName: 'updateById', - label: '更新人id', - }, - { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', - }, ]; // 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 // export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, - { - title: '主键id', - field: 'id', - }, + { title: '人员库编码', field: 'libCode', @@ -87,16 +36,9 @@ export const columns: VxeGridProps['columns'] = [ title: '人像名称', field: 'imgName', }, - { - title: '图片编码', - field: 'imgCode', - }, - { - title: '图片的存储地址', - field: 'imgUrl', - }, { title: '性别', + field: 'sex', }, { title: '邮箱', @@ -118,45 +60,16 @@ export const columns: VxeGridProps['columns'] = [ title: '出生日期', field: 'birthDate', }, - { - title: '创建人id', - field: 'createById', - }, - { - title: '更新人id', - field: 'updateById', - }, - { - title: '搜索值', - field: 'searchValue', - }, { field: 'action', fixed: 'right', - slots: { - default: 'action', - }, + slots: { default: 'action' }, title: '操作', width: 180, }, ]; export const modalSchema: FormSchemaGetter = () => [ - { - label: '主键id', - fieldName: 'id', - component: 'Input', - dependencies: { - show: () => false, - triggerFields: [''], - }, - }, - { - label: '人员库编码', - fieldName: 'libCode', - component: 'Input', - rules: 'required', - }, { label: '人像名称', fieldName: 'imgName', @@ -164,21 +77,13 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - label: '图片编码', - fieldName: 'imgCode', - component: 'Input', - }, - { - label: '图片的存储地址', - fieldName: 'imgUrl', - component: 'Input', - rules: 'required', - }, - { - label: '性别 1:男', + label: '性别', fieldName: 'sex', component: 'Select', - componentProps: {}, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SYS_USER_SEX), + }, }, { label: '邮箱', @@ -194,7 +99,10 @@ export const modalSchema: FormSchemaGetter = () => [ label: '证件类型', fieldName: 'certificateType', component: 'Select', - componentProps: {}, + componentProps: { + getPopupContainer, + options: getDictOptions(DictEnum.SYS_CERTIFICATE_TYPE), + }, }, { label: '证件号码', @@ -207,18 +115,13 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', }, { - label: '创建人id', - fieldName: 'createById', - component: 'Input', - }, - { - label: '更新人id', - fieldName: 'updateById', - component: 'Input', - }, - { - label: '搜索值', - fieldName: 'searchValue', - component: 'Input', + label: '人像图片', + fieldName: 'img', + component: 'ImageUpload', + componentProps: { + // accept: 'image/*', // 可选拓展名或者mime类型 ,拼接 + maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型 + }, + formItemClass: 'col-span-2', }, ]; diff --git a/apps/web-antd/src/views/sis/personLibImg/index.vue b/apps/web-antd/src/views/sis/personLibImg/index.vue index aa309e8a..ccd2ad00 100644 --- a/apps/web-antd/src/views/sis/personLibImg/index.vue +++ b/apps/web-antd/src/views/sis/personLibImg/index.vue @@ -1,30 +1,24 @@ @@ -130,7 +129,7 @@ function handleDownloadExcel() {