diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index b2969014..1ebc30a6 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -16,7 +16,7 @@ jobs: - name: Build run: pnpm build:antd - name: cp - run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\web-antd /E + run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\propety /E 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/assetManage/assetType/index.ts similarity index 93% rename from apps/web-antd/src/api/property/assetType/index.ts rename to apps/web-antd/src/api/property/assetManage/assetType/index.ts index a2d96625..ec5852ba 100644 --- a/apps/web-antd/src/api/property/assetType/index.ts +++ b/apps/web-antd/src/api/property/assetManage/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/api/property/assetType/model.d.ts b/apps/web-antd/src/api/property/assetManage/assetType/model.d.ts similarity index 100% rename from apps/web-antd/src/api/property/assetType/model.d.ts rename to apps/web-antd/src/api/property/assetManage/assetType/model.d.ts 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/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..ca80d29f 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,9 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; +import { assetTypeselect } from "#/api/property/assetManage/assetType"; +import { depotList } from "#/api/property/assetManage/depot"; +import { suppliersList } from "#/api/property/assetManage/suppliers"; const emit = defineEmits<{ reload: [] }>(); @@ -41,6 +44,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 +104,7 @@ const [BasicModal, modalApi] = useVbenModal({ if (!isOpen) { return null; } + modalApi.modalLoading(true); const { id } = modalApi.getData() as { id?: number | string }; @@ -62,7 +115,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..8251773c 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,8 @@ import type {FormSchemaGetter} from '#/adapter/form'; import type {VxeGridProps} from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; +import {assetTypeList} from "#/api/property/assetManage/assetType"; +import type {AssetTypeVO} from "#/api/property/assetManage/assetType/model"; export const querySchema: FormSchemaGetter = () => [ @@ -13,6 +15,13 @@ export const querySchema: FormSchemaGetter = () => [ component: 'Select', fieldName: 'model', label: '资产类型', + componentProps: { + showSearch:true, + placeholder:'根据类型名称搜索...', + onSearch:handleSearch, + onChange:handleChange, + options:typeData + }, }, { component: 'Select', @@ -25,8 +34,6 @@ export const querySchema: FormSchemaGetter = () => [ ]; -// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 -// export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ {type: 'checkbox', width: 60}, { @@ -167,3 +174,31 @@ export const modalSchema: FormSchemaGetter = () => [ componentProps: {}, }, ]; +let typeData:AssetTypeVO[]=[] +const handleSearch = (val: string) => { + queryAssetsType(val, (d: any[]) => (typeData = d)); +}; +const handleChange = (val: string) => { + queryAssetsType(val, (d: any[]) => (typeData = d)); +}; + + + +function queryAssetsType(value: string, callback: any) { + let queryParam={ + pageNum:100, + pageSize:1, + assetTypeName:value + } + assetTypeList(queryParam).then(res=>{ + const data: any[] = []; + res.rows.forEach((r: any) => { + data.push({ + value: r.assetTypeName, + label: r.id, + }); + }); + callback(data); + }) +} + diff --git a/apps/web-antd/src/views/property/assetManage/asset/index.vue b/apps/web-antd/src/views/property/assetManage/asset/index.vue index 8c559e90..54433dcf 100644 --- a/apps/web-antd/src/views/property/assetManage/asset/index.vue +++ b/apps/web-antd/src/views/property/assetManage/asset/index.vue @@ -110,6 +110,7 @@ function handleDownloadExcel() {