From 9c08cca0959f233333d5bd92f40a3c11067c9e10 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Tue, 24 Jun 2025 23:55:59 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=83=8F?= =?UTF-8?q?=E5=BA=93=20=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=83=8F=E5=BA=93?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/sis/personLib/index.ts | 61 +++++ .../web-antd/src/api/sis/personLib/model.d.ts | 144 +++++++++++ .../src/api/sis/personLibImg/index.ts | 61 +++++ .../src/api/sis/personLibImg/model.d.ts | 228 +++++++++++++++++ apps/web-antd/src/views/sis/personLib/data.ts | 157 ++++++++++++ .../src/views/sis/personLib/index.vue | 182 ++++++++++++++ .../views/sis/personLib/personLib-modal.vue | 101 ++++++++ .../src/views/sis/personLibImg/data.ts | 237 ++++++++++++++++++ .../src/views/sis/personLibImg/index.vue | 182 ++++++++++++++ .../sis/personLibImg/personLibImg-modal.vue | 101 ++++++++ 10 files changed, 1454 insertions(+) create mode 100644 apps/web-antd/src/api/sis/personLib/index.ts create mode 100644 apps/web-antd/src/api/sis/personLib/model.d.ts create mode 100644 apps/web-antd/src/api/sis/personLibImg/index.ts create mode 100644 apps/web-antd/src/api/sis/personLibImg/model.d.ts create mode 100644 apps/web-antd/src/views/sis/personLib/data.ts create mode 100644 apps/web-antd/src/views/sis/personLib/index.vue create mode 100644 apps/web-antd/src/views/sis/personLib/personLib-modal.vue create mode 100644 apps/web-antd/src/views/sis/personLibImg/data.ts create mode 100644 apps/web-antd/src/views/sis/personLibImg/index.vue create mode 100644 apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue diff --git a/apps/web-antd/src/api/sis/personLib/index.ts b/apps/web-antd/src/api/sis/personLib/index.ts new file mode 100644 index 00000000..e2f43600 --- /dev/null +++ b/apps/web-antd/src/api/sis/personLib/index.ts @@ -0,0 +1,61 @@ +import type { PersonLibVO, PersonLibForm, PersonLibQuery } 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 personLibList(params?: PersonLibQuery) { + return requestClient.get>('/sis/personLib/list', { params }); +} + +/** + * 导出人像库列表 + * @param params + * @returns 人像库列表 + */ +export function personLibExport(params?: PersonLibQuery) { + return commonExport('/sis/personLib/export', params ?? {}); +} + +/** + * 查询人像库详情 + * @param id id + * @returns 人像库详情 + */ +export function personLibInfo(id: ID) { + return requestClient.get(`/sis/personLib/${id}`); +} + +/** + * 新增人像库 + * @param data + * @returns void + */ +export function personLibAdd(data: PersonLibForm) { + return requestClient.postWithMsg('/sis/personLib', data); +} + +/** + * 更新人像库 + * @param data + * @returns void + */ +export function personLibUpdate(data: PersonLibForm) { + return requestClient.putWithMsg('/sis/personLib', data); +} + +/** + * 删除人像库 + * @param id id + * @returns void + */ +export function personLibRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/personLib/${id}`); +} diff --git a/apps/web-antd/src/api/sis/personLib/model.d.ts b/apps/web-antd/src/api/sis/personLib/model.d.ts new file mode 100644 index 00000000..5a93ec83 --- /dev/null +++ b/apps/web-antd/src/api/sis/personLib/model.d.ts @@ -0,0 +1,144 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface PersonLibVO { + /** + * 主键id + */ + id: string | number; + + /** + * 人员库编码 + */ + libCode: string; + + /** + * 人员库名称 + */ + libName: string; + + /** + * 人员库描述 + */ + libDesc: string; + + /** + * 库类型,1:人员库,2:工服库 + */ + libType: number; + + /** + * 库的业务类型 1: 门禁库,2: 黑名单库 + */ + busiType: number; + + /** + * 创建人id + */ + createById: string | number; + + /** + * 更新人id + */ + updateById: string | number; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface PersonLibForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 人员库编码 + */ + libCode?: string; + + /** + * 人员库名称 + */ + libName?: string; + + /** + * 人员库描述 + */ + libDesc?: string; + + /** + * 库类型,1:人员库,2:工服库 + */ + libType?: number; + + /** + * 库的业务类型 1: 门禁库,2: 黑名单库 + */ + busiType?: number; + + /** + * 创建人id + */ + createById?: string | number; + + /** + * 更新人id + */ + updateById?: string | number; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface PersonLibQuery extends PageQuery { + /** + * 人员库编码 + */ + libCode?: string; + + /** + * 人员库名称 + */ + libName?: string; + + /** + * 人员库描述 + */ + libDesc?: string; + + /** + * 库类型,1:人员库,2:工服库 + */ + libType?: number; + + /** + * 库的业务类型 1: 门禁库,2: 黑名单库 + */ + busiType?: number; + + /** + * 创建人id + */ + createById?: string | number; + + /** + * 更新人id + */ + updateById?: string | number; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/api/sis/personLibImg/index.ts b/apps/web-antd/src/api/sis/personLibImg/index.ts new file mode 100644 index 00000000..351ba3fa --- /dev/null +++ b/apps/web-antd/src/api/sis/personLibImg/index.ts @@ -0,0 +1,61 @@ +import type { PersonLibImgVO, PersonLibImgForm, PersonLibImgQuery } 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 personLibImgList(params?: PersonLibImgQuery) { + return requestClient.get>('/sis/personLibImg/list', { params }); +} + +/** + * 导出人像信息列表 + * @param params + * @returns 人像信息列表 + */ +export function personLibImgExport(params?: PersonLibImgQuery) { + return commonExport('/sis/personLibImg/export', params ?? {}); +} + +/** + * 查询人像信息详情 + * @param id id + * @returns 人像信息详情 + */ +export function personLibImgInfo(id: ID) { + return requestClient.get(`/sis/personLibImg/${id}`); +} + +/** + * 新增人像信息 + * @param data + * @returns void + */ +export function personLibImgAdd(data: PersonLibImgForm) { + return requestClient.postWithMsg('/sis/personLibImg', data); +} + +/** + * 更新人像信息 + * @param data + * @returns void + */ +export function personLibImgUpdate(data: PersonLibImgForm) { + return requestClient.putWithMsg('/sis/personLibImg', data); +} + +/** + * 删除人像信息 + * @param id id + * @returns void + */ +export function personLibImgRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/sis/personLibImg/${id}`); +} diff --git a/apps/web-antd/src/api/sis/personLibImg/model.d.ts b/apps/web-antd/src/api/sis/personLibImg/model.d.ts new file mode 100644 index 00000000..d0e0d6ca --- /dev/null +++ b/apps/web-antd/src/api/sis/personLibImg/model.d.ts @@ -0,0 +1,228 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface PersonLibImgVO { + /** + * 主键id + */ + id: string | number; + + /** + * 人员库编码 + */ + libCode: string; + + /** + * 人像名称 + */ + imgName: string; + + /** + * 图片编码 + */ + imgCode: string; + + /** + * 图片的存储地址 + */ + imgUrl: string; + + /** + * 性别 1:男 +2:女 99:未说明 + */ + sex: number; + + /** + * 邮箱 + */ + email: string; + + /** + * 联系方式 + */ + tel: string; + + /** + * 证件类型 +1:身份证 2:护照 +3:行驶证 99:其它 + */ + certificateType: number; + + /** + * 证件号码 + */ + certificateNo: string; + + /** + * 出生日期 + */ + birthDate: string; + + /** + * 创建人id + */ + createById: string | number; + + /** + * 更新人id + */ + updateById: string | number; + + /** + * 搜索值 + */ + searchValue: string; + +} + +export interface PersonLibImgForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 人员库编码 + */ + libCode?: string; + + /** + * 人像名称 + */ + imgName?: string; + + /** + * 图片编码 + */ + imgCode?: string; + + /** + * 图片的存储地址 + */ + imgUrl?: string; + + /** + * 性别 1:男 +2:女 99:未说明 + */ + sex?: number; + + /** + * 邮箱 + */ + email?: string; + + /** + * 联系方式 + */ + tel?: string; + + /** + * 证件类型 +1:身份证 2:护照 +3:行驶证 99:其它 + */ + certificateType?: number; + + /** + * 证件号码 + */ + certificateNo?: string; + + /** + * 出生日期 + */ + birthDate?: string; + + /** + * 创建人id + */ + createById?: string | number; + + /** + * 更新人id + */ + updateById?: string | number; + + /** + * 搜索值 + */ + searchValue?: string; + +} + +export interface PersonLibImgQuery extends PageQuery { + /** + * 人员库编码 + */ + libCode?: string; + + /** + * 人像名称 + */ + imgName?: string; + + /** + * 图片编码 + */ + imgCode?: string; + + /** + * 图片的存储地址 + */ + imgUrl?: string; + + /** + * 性别 1:男 +2:女 99:未说明 + */ + sex?: number; + + /** + * 邮箱 + */ + email?: string; + + /** + * 联系方式 + */ + tel?: string; + + /** + * 证件类型 +1:身份证 2:护照 +3:行驶证 99:其它 + */ + certificateType?: number; + + /** + * 证件号码 + */ + certificateNo?: string; + + /** + * 出生日期 + */ + birthDate?: string; + + /** + * 创建人id + */ + createById?: string | number; + + /** + * 更新人id + */ + updateById?: string | number; + + /** + * 搜索值 + */ + searchValue?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/sis/personLib/data.ts b/apps/web-antd/src/views/sis/personLib/data.ts new file mode 100644 index 00000000..ab64c53b --- /dev/null +++ b/apps/web-antd/src/views/sis/personLib/data.ts @@ -0,0 +1,157 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'libCode', + label: '人员库编码', + }, + { + component: 'Input', + fieldName: 'libName', + label: '人员库名称', + }, + { + component: 'Input', + fieldName: 'libDesc', + label: '人员库描述', + }, + { + component: 'Select', + componentProps: { + }, + fieldName: 'libType', + label: '库类型,1:人员库,2:工服库', + }, + { + component: 'Select', + componentProps: { + }, + fieldName: 'busiType', + label: '库的业务类型 1: 门禁库,2: 黑名单库', + }, + { + 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', + }, + { + title: '人员库名称', + field: 'libName', + }, + { + title: '人员库描述', + field: 'libDesc', + }, + { + title: '库类型,1:人员库,2:工服库', + field: 'libType', + }, + { + title: '库的业务类型 1: 门禁库,2: 黑名单库', + field: 'busiType', + }, + { + 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: 'libCode', + component: 'Input', + rules: 'required', + }, + { + label: '人员库名称', + fieldName: 'libName', + component: 'Input', + rules: 'required', + }, + { + label: '人员库描述', + fieldName: 'libDesc', + component: 'Input', + }, + { + label: '库类型,1:人员库,2:工服库', + fieldName: 'libType', + component: 'Select', + componentProps: { + }, + }, + { + label: '库的业务类型 1: 门禁库,2: 黑名单库', + fieldName: 'busiType', + component: 'Select', + componentProps: { + }, + }, + { + 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/personLib/index.vue b/apps/web-antd/src/views/sis/personLib/index.vue new file mode 100644 index 00000000..68710759 --- /dev/null +++ b/apps/web-antd/src/views/sis/personLib/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/sis/personLib/personLib-modal.vue b/apps/web-antd/src/views/sis/personLib/personLib-modal.vue new file mode 100644 index 00000000..a10f4264 --- /dev/null +++ b/apps/web-antd/src/views/sis/personLib/personLib-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/sis/personLibImg/data.ts b/apps/web-antd/src/views/sis/personLibImg/data.ts new file mode 100644 index 00000000..1285cd8a --- /dev/null +++ b/apps/web-antd/src/views/sis/personLibImg/data.ts @@ -0,0 +1,237 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + + +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: { + }, + fieldName: 'sex', + label: '性别 1:男 +2:女 99:未说明', + }, + { + component: 'Input', + fieldName: 'email', + label: '邮箱', + }, + { + component: 'Input', + fieldName: 'tel', + label: '联系方式', + }, + { + component: 'Select', + componentProps: { + }, + fieldName: 'certificateType', + label: '证件类型 +1:身份证 2:护照 +3:行驶证 99:其它', + }, + { + 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', + }, + { + title: '人像名称', + field: 'imgName', + }, + { + title: '图片编码', + field: 'imgCode', + }, + { + title: '图片的存储地址', + field: 'imgUrl', + }, + { + title: '性别 1:男 +2:女 99:未说明', + field: 'sex', + }, + { + title: '邮箱', + field: 'email', + }, + { + title: '联系方式', + field: 'tel', + }, + { + title: '证件类型 +1:身份证 2:护照 +3:行驶证 99:其它', + field: 'certificateType', + }, + { + title: '证件号码', + field: 'certificateNo', + }, + { + title: '出生日期', + field: 'birthDate', + }, + { + 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: 'libCode', + component: 'Input', + rules: 'required', + }, + { + label: '人像名称', + fieldName: 'imgName', + component: 'Input', + rules: 'required', + }, + { + label: '图片编码', + fieldName: 'imgCode', + component: 'Input', + }, + { + label: '图片的存储地址', + fieldName: 'imgUrl', + component: 'Input', + rules: 'required', + }, + { + label: '性别 1:男 +2:女 99:未说明', + fieldName: 'sex', + component: 'Select', + componentProps: { + }, + }, + { + label: '邮箱', + fieldName: 'email', + component: 'Input', + }, + { + label: '联系方式', + fieldName: 'tel', + component: 'Input', + }, + { + label: '证件类型 +1:身份证 2:护照 +3:行驶证 99:其它', + fieldName: 'certificateType', + component: 'Select', + componentProps: { + }, + }, + { + label: '证件号码', + fieldName: 'certificateNo', + component: 'Input', + }, + { + label: '出生日期', + fieldName: 'birthDate', + 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/personLibImg/index.vue b/apps/web-antd/src/views/sis/personLibImg/index.vue new file mode 100644 index 00000000..aa309e8a --- /dev/null +++ b/apps/web-antd/src/views/sis/personLibImg/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue b/apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue new file mode 100644 index 00000000..04e93c35 --- /dev/null +++ b/apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue @@ -0,0 +1,101 @@ + + + + From b2acba4114bd1fc98e91838f7692e520d31e0f22 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Wed, 25 Jun 2025 00:37:48 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=BA=E5=83=8F?= =?UTF-8?q?=E5=BA=93=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/sis/personLib/data.ts | 51 +++---------------- .../src/views/sis/personLib/index.vue | 38 +++++++------- .../src/views/sis/personLibImg/data.ts | 39 +++++--------- 3 files changed, 40 insertions(+), 88 deletions(-) diff --git a/apps/web-antd/src/views/sis/personLib/data.ts b/apps/web-antd/src/views/sis/personLib/data.ts index ab64c53b..8a64e9c5 100644 --- a/apps/web-antd/src/views/sis/personLib/data.ts +++ b/apps/web-antd/src/views/sis/personLib/data.ts @@ -1,7 +1,6 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; - export const querySchema: FormSchemaGetter = () => [ { component: 'Input', @@ -20,32 +19,15 @@ export const querySchema: FormSchemaGetter = () => [ }, { component: 'Select', - componentProps: { - }, + componentProps: {}, fieldName: 'libType', - label: '库类型,1:人员库,2:工服库', + label: '库类型', }, { component: 'Select', - componentProps: { - }, + componentProps: {}, fieldName: 'busiType', - label: '库的业务类型 1: 门禁库,2: 黑名单库', - }, - { - component: 'Input', - fieldName: 'createById', - label: '创建人id', - }, - { - component: 'Input', - fieldName: 'updateById', - label: '更新人id', - }, - { - component: 'Input', - fieldName: 'searchValue', - label: '搜索值', + label: '业务类型', }, ]; @@ -126,32 +108,15 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', }, { - label: '库类型,1:人员库,2:工服库', + label: '库类型', fieldName: 'libType', component: 'Select', - componentProps: { - }, + componentProps: {}, }, { - label: '库的业务类型 1: 门禁库,2: 黑名单库', + label: '业务类型', fieldName: 'busiType', component: 'Select', - componentProps: { - }, - }, - { - label: '创建人id', - fieldName: 'createById', - component: 'Input', - }, - { - label: '更新人id', - fieldName: 'updateById', - component: 'Input', - }, - { - label: '搜索值', - fieldName: 'searchValue', - component: 'Input', + componentProps: {}, }, ]; diff --git a/apps/web-antd/src/views/sis/personLib/index.vue b/apps/web-antd/src/views/sis/personLib/index.vue index 68710759..da110e76 100644 --- a/apps/web-antd/src/views/sis/personLib/index.vue +++ b/apps/web-antd/src/views/sis/personLib/index.vue @@ -1,30 +1,24 @@ @@ -138,9 +137,10 @@ function handleDownloadExcel() { + type="primary" + v-access:code="['sis:personLib:remove']" + @click="handleMultiDelete" + > {{ $t('pages.common.delete') }} [ { component: 'Input', @@ -25,11 +24,9 @@ export const querySchema: FormSchemaGetter = () => [ }, { component: 'Select', - componentProps: { - }, + componentProps: {}, fieldName: 'sex', - label: '性别 1:男 -2:女 99:未说明', + label: '性别', }, { component: 'Input', @@ -43,12 +40,9 @@ export const querySchema: FormSchemaGetter = () => [ }, { component: 'Select', - componentProps: { - }, + componentProps: {}, fieldName: 'certificateType', - label: '证件类型 -1:身份证 2:护照 -3:行驶证 99:其它', + label: '证件类型', }, { component: 'Input', @@ -102,9 +96,7 @@ export const columns: VxeGridProps['columns'] = [ field: 'imgUrl', }, { - title: '性别 1:男 -2:女 99:未说明', - field: 'sex', + title: '性别', }, { title: '邮箱', @@ -115,9 +107,7 @@ export const columns: VxeGridProps['columns'] = [ field: 'tel', }, { - title: '证件类型 -1:身份证 2:护照 -3:行驶证 99:其它', + title: '证件类型', field: 'certificateType', }, { @@ -143,7 +133,9 @@ export const columns: VxeGridProps['columns'] = [ { field: 'action', fixed: 'right', - slots: { default: 'action' }, + slots: { + default: 'action', + }, title: '操作', width: 180, }, @@ -183,12 +175,10 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - label: '性别 1:男 -2:女 99:未说明', + label: '性别 1:男', fieldName: 'sex', component: 'Select', - componentProps: { - }, + componentProps: {}, }, { label: '邮箱', @@ -201,13 +191,10 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', }, { - label: '证件类型 -1:身份证 2:护照 -3:行驶证 99:其它', + label: '证件类型', fieldName: 'certificateType', component: 'Select', - componentProps: { - }, + componentProps: {}, }, { label: '证件号码', From ec2f257a8790f1bd31fc258dd0b137a125a3be27 Mon Sep 17 00:00:00 2001 From: mocheng <3057647414@qq.com> Date: Wed, 25 Jun 2025 09:27:33 +0800 Subject: [PATCH 3/6] asset --- apps/web-antd/.env.production | 2 +- apps/web-antd/.env.test | 2 +- .../src/api/property/assetType/index.ts | 4 + .../application/application-modal.vue | 106 +++++++++++++++++- .../property/assetManage/application/data.ts | 64 +++++------ .../assetManage/asset/asset-modal.vue | 56 ++++++++- .../views/property/assetManage/asset/data.ts | 30 +++-- .../src/views/property/floor/index.vue | 15 +-- apps/web-antd/vite.config.mts | 3 +- .../base/shared/src/constants/dict-enum.ts | 1 + 10 files changed, 224 insertions(+), 59 deletions(-) diff --git a/apps/web-antd/.env.production b/apps/web-antd/.env.production index 5fa61183..2b43bb72 100644 --- a/apps/web-antd/.env.production +++ b/apps/web-antd/.env.production @@ -7,7 +7,7 @@ VITE_COMPRESS=gzip VITE_PWA=false # vue-router 的模式 -VITE_ROUTER_HISTORY=history +VITE_ROUTER_HISTORY=hash # 是否注入全局loading VITE_INJECT_APP_LOADING=true diff --git a/apps/web-antd/.env.test b/apps/web-antd/.env.test index f66a206f..41548e98 100644 --- a/apps/web-antd/.env.test +++ b/apps/web-antd/.env.test @@ -10,7 +10,7 @@ VITE_COMPRESS=gzip VITE_PWA=false # vue-router 的模式 -VITE_ROUTER_HISTORY=history +VITE_ROUTER_HISTORY=hash # 是否注入全局loading VITE_INJECT_APP_LOADING=true diff --git a/apps/web-antd/src/api/property/assetType/index.ts b/apps/web-antd/src/api/property/assetType/index.ts index a2d96625..ec5852ba 100644 --- a/apps/web-antd/src/api/property/assetType/index.ts +++ b/apps/web-antd/src/api/property/assetType/index.ts @@ -15,6 +15,10 @@ export function assetTypeList(params?: AssetTypeQuery) { return requestClient.get>('/property/assetType/list', { params }); } +export function assetTypeselect() { + return requestClient.get('/property/assetType/list'); +} + /** * 导出资产类型列表 * @param params diff --git a/apps/web-antd/src/views/property/assetManage/application/application-modal.vue b/apps/web-antd/src/views/property/assetManage/application/application-modal.vue index 304b9fe3..9c9dac78 100644 --- a/apps/web-antd/src/views/property/assetManage/application/application-modal.vue +++ b/apps/web-antd/src/views/property/assetManage/application/application-modal.vue @@ -5,11 +5,16 @@ import { useVbenModal } from '@vben/common-ui'; import { $t } from '@vben/locales'; import { cloneDeep } from '@vben/utils'; -import { useVbenForm } from '#/adapter/form'; +import { type FormSchemaGetter, useVbenForm } from "#/adapter/form"; import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/assetManage/application'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; +import { assetTypeselect } from "#/api/property/assetType"; +import { depotList } from "#/api/property/assetManage/depot"; +import { suppliersList } from "#/api/property/assetManage/suppliers"; +import { assetList } from "#/api/property/assetManage/asset"; +import { userList } from "#/api/system/user"; const emit = defineEmits<{ reload: [] }>(); @@ -41,6 +46,103 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff( }, ); +formApi.getValues().then(setupPackageSelect); + +async function upSelectUser(nickName: string){ + const list=await userList({ + nickName:nickName, + pageNum: 1, + pageSize: 10, + }); + const options=list.map(item=>{ + item.label=item.userName; + item.value=item.id; + }) + fromApi.updateSchema([ + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options, + showSearch: true, + }, + fieldName: 'userId', + }, + ]); +} + +async function upSelectAssets(assetsName: string){ + const list=await assetList({ + assetsName:assetsName, + pageNum: 1, + pageSize: 10, + }); + const options=list.map(item=>{ + item.label=item.assetsName; + item.value=item.id; + }) + fromApi.updateSchema([ + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options, + showSearch: true, + }, + fieldName: 'assetsId', + }, + ]); +} + +async function setupPackageSelect() { + const users = await userList({ + pageNum: 1, + pageSize: 10, + }); + const assets = await assetList({ + pageNum: 1, + pageSize: 10, + }); + const options = users.rows.map((item) => ({ + label: item.nickName, + value: item.userId, + })); + const assetOptions = assets.rows.map((item) => ({ + label: item.name, + value: item.id, + })); + formApi.updateSchema([ + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options, + showSearch: true, + }, + async select(userId) { + await upSelectUser(userId); + userId="" + }, + fieldName: 'userId', + }, + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options: assetOptions, + showSearch: true, + }, + async select(assetsId) { + await upSelectAssets(assetsId); + assetsId="" + }, + fieldName: 'assetId', + }, + + ]); + +} + const [BasicModal, modalApi] = useVbenModal({ // 在这里更改宽度 class: 'w-[550px]', @@ -62,7 +164,7 @@ const [BasicModal, modalApi] = useVbenModal({ await formApi.setValues(record); } await markInitialized(); - + await setupPackageSelect(); modalApi.modalLoading(false); }, }); diff --git a/apps/web-antd/src/views/property/assetManage/application/data.ts b/apps/web-antd/src/views/property/assetManage/application/data.ts index 0ee40ab9..8b14dd49 100644 --- a/apps/web-antd/src/views/property/assetManage/application/data.ts +++ b/apps/web-antd/src/views/property/assetManage/application/data.ts @@ -112,46 +112,46 @@ export const modalSchema: FormSchemaGetter = () => [ { label: '资产id', fieldName: 'assetId', - component: 'Input', + component: 'Select', }, { label: '领用人id', fieldName: 'userId', - component: 'Input', + component: 'Select', }, { label: '数量', fieldName: 'number', component: 'Input', }, - { - label: '状态', - fieldName: 'state', - component: 'Input', - }, - { - label: '审批人id', - fieldName: 'acceptanceUserId', - component: 'Input', - }, - { - label: '审批时间', - fieldName: 'acceptanceTime', - component: 'DatePicker', - componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - }, - { - label: '申请时间', - fieldName: 'applicationTime', - component: 'DatePicker', - componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - }, - }, + // { + // label: '状态', + // fieldName: 'state', + // component: 'Input', + // }, + // { + // label: '审批人id', + // fieldName: 'acceptanceUserId', + // component: 'Input', + // }, + // { + // label: '审批时间', + // fieldName: 'acceptanceTime', + // component: 'DatePicker', + // componentProps: { + // showTime: true, + // format: 'YYYY-MM-DD HH:mm:ss', + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // }, + // }, + // { + // label: '申请时间', + // fieldName: 'applicationTime', + // component: 'DatePicker', + // componentProps: { + // showTime: true, + // format: 'YYYY-MM-DD HH:mm:ss', + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // }, + // }, ]; diff --git a/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue b/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue index 4afd063a..c3c13dea 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue +++ b/apps/web-antd/src/views/property/assetManage/asset/asset-modal.vue @@ -10,6 +10,10 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; +import { packageSelectList } from "#/api/system/tenant-package"; +import { assetTypeselect } from "#/api/property/assetType"; +import { depotList } from "#/api/property/assetManage/depot"; +import { suppliersList } from "#/api/property/assetManage/suppliers"; const emit = defineEmits<{ reload: [] }>(); @@ -41,6 +45,55 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff( }, ); +async function setupPackageSelect() { + const tenantPackageList = await assetTypeselect(); + const depot = await depotList(); + const suppliers =await suppliersList(); + const options = tenantPackageList.rows.map((item) => ({ + label: item.assetTypeName, + value: item.id, + })); + const depotoptions = depot.rows.map((item) => ({ + label: item.depotName, + value: item.id, + })); + const supplieroptions = suppliers.rows.map((item) => ({ + label: item.suppliersName, + value: item.id, + })); + + formApi.updateSchema([ + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options, + showSearch: true, + }, + fieldName: 'model', + }, + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options: depotoptions, + showSearch: true, + }, + fieldName: 'depotId', + }, + { + componentProps: { + optionFilterProp: 'label', + optionLabelProp: 'label', + options: supplieroptions, + showSearch: true, + }, + fieldName: 'suppliersId', + }, + ]); + +} + const [BasicModal, modalApi] = useVbenModal({ // 在这里更改宽度 class: 'w-[550px]', @@ -52,6 +105,7 @@ const [BasicModal, modalApi] = useVbenModal({ if (!isOpen) { return null; } + modalApi.modalLoading(true); const { id } = modalApi.getData() as { id?: number | string }; @@ -62,7 +116,7 @@ const [BasicModal, modalApi] = useVbenModal({ await formApi.setValues(record); } await markInitialized(); - + await setupPackageSelect(); modalApi.modalLoading(false); }, }); diff --git a/apps/web-antd/src/views/property/assetManage/asset/data.ts b/apps/web-antd/src/views/property/assetManage/asset/data.ts index bd513f29..2b381f74 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/data.ts +++ b/apps/web-antd/src/views/property/assetManage/asset/data.ts @@ -1,6 +1,9 @@ import type {FormSchemaGetter} from '#/adapter/form'; import type {VxeGridProps} from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; +import { renderDict } from "#/utils/render"; +import { DictEnum } from '@vben/constants'; + export const querySchema: FormSchemaGetter = () => [ @@ -44,7 +47,7 @@ export const columns: VxeGridProps['columns'] = [ }, { title: '资产类型', - field: 'model', + field: 'modelName', }, { title: '规格', @@ -63,16 +66,16 @@ export const columns: VxeGridProps['columns'] = [ field: 'unit', }, { - title: '仓库id', - field: 'depotId', + title: '仓库', + field: 'depotName', }, { title: '描述信息', field: 'msg', }, { - title: '供应商id', - field: 'suppliersId', + title: '供应商', + field: 'suppliersName', }, { title: '入库时间', @@ -81,6 +84,11 @@ export const columns: VxeGridProps['columns'] = [ { title: '固定资产', field: 'type', + slots: { + default: ({ row }) => { + return renderDict(row.type, DictEnum.WY_SF); + }, + }, }, { title: '创建时间', @@ -113,7 +121,7 @@ export const modalSchema: FormSchemaGetter = () => [ { label: '类型', fieldName: 'model', - component: 'Textarea', + component: 'Select', }, { label: '规格', @@ -136,9 +144,9 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', }, { - label: '仓库id', + label: '仓库', fieldName: 'depotId', - component: 'Input', + component: 'Select', }, { label: '描述信息', @@ -148,7 +156,7 @@ export const modalSchema: FormSchemaGetter = () => [ { label: '供应商id', fieldName: 'suppliersId', - component: 'Input', + component: 'Select', }, { label: '入库时间', @@ -164,6 +172,8 @@ export const modalSchema: FormSchemaGetter = () => [ label: '固定资产类型', fieldName: 'type', component: 'Select', - componentProps: {}, + componentProps: { + options: getDictOptions('wy_sf'), + }, }, ]; diff --git a/apps/web-antd/src/views/property/floor/index.vue b/apps/web-antd/src/views/property/floor/index.vue index 27953212..ed2d40ad 100644 --- a/apps/web-antd/src/views/property/floor/index.vue +++ b/apps/web-antd/src/views/property/floor/index.vue @@ -1,18 +1,11 @@