Compare commits
21 Commits
ec2f257a
...
0b192801ab
Author | SHA1 | Date | |
---|---|---|---|
0b192801ab | |||
de569eb59a | |||
97a0417d50 | |||
7d5817ce33 | |||
027ba5b2a3 | |||
0b31030317 | |||
7371da5f48 | |||
652952e29c | |||
e1656bf104 | |||
8d517b3133 | |||
234c0f8096 | |||
1c3016c44b | |||
f620debe43 | |||
b802ff624b | |||
fae5d7877c | |||
87331ab607 | |||
905fbb5f06 | |||
![]() |
b2acba4114 | ||
![]() |
9c08cca095 | ||
85975db5ee | |||
a0f5599d92 |
@@ -16,7 +16,8 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build:antd
|
run: pnpm build:antd
|
||||||
- name: cp
|
- 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
|
||||||
|
run: Copy-Item -Path "./apps/web-antd/dist" -Destination "C:\devtool\nginx-1.28.0\html\property" -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
VITE_BASE=/
|
VITE_BASE=/property
|
||||||
|
|
||||||
# 是否开启压缩,可以设置为 none, brotli, gzip
|
# 是否开启压缩,可以设置为 none, brotli, gzip
|
||||||
VITE_COMPRESS=gzip
|
VITE_COMPRESS=gzip
|
||||||
|
@@ -0,0 +1,65 @@
|
|||||||
|
import type { AssetTypeVO, AssetTypeForm, AssetTypeQuery } 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 assetTypeList(params?: AssetTypeQuery) {
|
||||||
|
return requestClient.get<PageResult<AssetTypeVO>>('/property/assetType/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
export function assetTypeselect() {
|
||||||
|
return requestClient.get<AssetTypeVO[]>('/property/assetType/list');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出资产类型列表
|
||||||
|
* @param params
|
||||||
|
* @returns 资产类型列表
|
||||||
|
*/
|
||||||
|
export function assetTypeExport(params?: AssetTypeQuery) {
|
||||||
|
return commonExport('/property/assetType/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产类型详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 资产类型详情
|
||||||
|
*/
|
||||||
|
export function assetTypeInfo(id: ID) {
|
||||||
|
return requestClient.get<AssetTypeVO>(`/property/assetType/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产类型
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function assetTypeAdd(data: AssetTypeForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/property/assetType', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新资产类型
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function assetTypeUpdate(data: AssetTypeForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/property/assetType', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产类型
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function assetTypeRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/property/assetType/${id}`);
|
||||||
|
}
|
64
apps/web-antd/src/api/property/assetManage/assetType/model.d.ts
vendored
Normal file
64
apps/web-antd/src/api/property/assetManage/assetType/model.d.ts
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface AssetTypeVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
assetTypeName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
sort: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
createTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
createBy: string;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AssetTypeForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
assetTypeName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
sort?: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AssetTypeQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 分类名称
|
||||||
|
*/
|
||||||
|
assetTypeName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
sort?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
61
apps/web-antd/src/api/sis/personLib/index.ts
Normal file
61
apps/web-antd/src/api/sis/personLib/index.ts
Normal file
@@ -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<PageResult<PersonLibVO>>('/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<PersonLibVO>(`/sis/personLib/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人像库
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibAdd(data: PersonLibForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/sis/personLib', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人像库
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibUpdate(data: PersonLibForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/sis/personLib', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人像库
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/sis/personLib/${id}`);
|
||||||
|
}
|
144
apps/web-antd/src/api/sis/personLib/model.d.ts
vendored
Normal file
144
apps/web-antd/src/api/sis/personLib/model.d.ts
vendored
Normal file
@@ -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;
|
||||||
|
}
|
61
apps/web-antd/src/api/sis/personLibImg/index.ts
Normal file
61
apps/web-antd/src/api/sis/personLibImg/index.ts
Normal file
@@ -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<PageResult<PersonLibImgVO>>('/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<PersonLibImgVO>(`/sis/personLibImg/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增人像信息
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibImgAdd(data: PersonLibImgForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/sis/personLibImg', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人像信息
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibImgUpdate(data: PersonLibImgForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/sis/personLibImg', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人像信息
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function personLibImgRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/sis/personLibImg/${id}`);
|
||||||
|
}
|
228
apps/web-antd/src/api/sis/personLibImg/model.d.ts
vendored
Normal file
228
apps/web-antd/src/api/sis/personLibImg/model.d.ts
vendored
Normal file
@@ -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;
|
||||||
|
}
|
@@ -1,5 +1,8 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import { renderDict } from "#/utils/render";
|
||||||
|
import { DictEnum } from '@vben/constants';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
@@ -59,12 +62,12 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'id',
|
field: 'id',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '资产id',
|
title: '资产',
|
||||||
field: 'assetId',
|
field: 'assetName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '领用人id',
|
title: '领用人',
|
||||||
field: 'userId',
|
field: 'userName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数量',
|
title: '数量',
|
||||||
@@ -73,10 +76,15 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.state, DictEnum.WY_ZCSHZT);
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '审批人id',
|
title: '审批人',
|
||||||
field: 'acceptanceUserId',
|
field: 'acceptanceUserName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '审批时间',
|
title: '审批时间',
|
||||||
|
@@ -0,0 +1,101 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetManage/assetType';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
// 默认占满两列
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
// 默认label宽度 px
|
||||||
|
labelWidth: 80,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
schema: modalSchema(),
|
||||||
|
showDefaultActions: false,
|
||||||
|
wrapperClass: 'grid-cols-2',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
// 在这里更改宽度
|
||||||
|
class: 'w-[550px]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await assetTypeInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? assetTypeUpdate(data) : assetTypeAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -0,0 +1,65 @@
|
|||||||
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
|
||||||
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'assetTypeName',
|
||||||
|
label: '分类名称',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({rowIndex}) => {
|
||||||
|
return (rowIndex+1).toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '分类名称',
|
||||||
|
field: 'assetTypeName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
field: 'sort',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
field: 'createTime',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: 'assetTypeName',
|
||||||
|
component: 'Input',
|
||||||
|
rules:'required'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '排序',
|
||||||
|
fieldName: 'sort',
|
||||||
|
component: 'InputNumber',
|
||||||
|
},
|
||||||
|
];
|
166
apps/web-antd/src/views/property/assetManage/assetType/index.vue
Normal file
166
apps/web-antd/src/views/property/assetManage/assetType/index.vue
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useVbenVxeGrid,
|
||||||
|
vxeCheckboxChecked,
|
||||||
|
type VxeGridProps
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
import {
|
||||||
|
assetTypeExport,
|
||||||
|
assetTypeList,
|
||||||
|
assetTypeRemove,
|
||||||
|
} from '#/api/property/assetManage/assetType';
|
||||||
|
import type { AssetTypeForm } from '#/api/property/assetManage/assetType/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import assetTypeModal from './assetType-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await assetTypeList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'property-assetType-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [AssetTypeModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: assetTypeModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<AssetTypeForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<AssetTypeForm>) {
|
||||||
|
await assetTypeRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<AssetTypeForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await assetTypeRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(assetTypeExport, '资产类型数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<BasicTable table-title="资产类型列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['property:assetType:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:assetType:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['property:assetType:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:assetType:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['property:assetType:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<AssetTypeModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
@@ -0,0 +1,229 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { cleanList } from '#/api/property/clean';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [data: any] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
// 缓存清洁服务数据
|
||||||
|
let cleanListData: any[] = [];
|
||||||
|
|
||||||
|
const detailSchema = [
|
||||||
|
{
|
||||||
|
label: '劳务名称',
|
||||||
|
fieldName: 'name',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
componentProps: {
|
||||||
|
api: async () => {
|
||||||
|
const res = await cleanList({stater:1});
|
||||||
|
cleanListData = res.rows || [];
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
resultField: 'rows',
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
onChange: async (value: string) => {
|
||||||
|
// 找到选中的服务数据
|
||||||
|
const selectedService = cleanListData.find(item => item.id === value);
|
||||||
|
if (selectedService) {
|
||||||
|
// 自动填充其他字段
|
||||||
|
await formApi.setValues({
|
||||||
|
measure: selectedService.measure,
|
||||||
|
method: selectedService.method,
|
||||||
|
peices: selectedService.peices,
|
||||||
|
frequency: selectedService.frequency,
|
||||||
|
standard: selectedService.standard,
|
||||||
|
remark: selectedService.remark,
|
||||||
|
stater: selectedService.stater,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保洁面积',
|
||||||
|
fieldName: 'area',
|
||||||
|
component: 'InputNumber',
|
||||||
|
rules: 'required',
|
||||||
|
componentProps: {
|
||||||
|
onChange: async (value: number) => {
|
||||||
|
const formValues = await formApi.getValues();
|
||||||
|
if (formValues.peices && value) {
|
||||||
|
await formApi.setValues({
|
||||||
|
sumPeices: Number((formValues.peices * value).toFixed(2)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计量单位',
|
||||||
|
fieldName: 'measure',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '计算方式',
|
||||||
|
fieldName: 'method',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '申报单价含税(元)',
|
||||||
|
fieldName: 'peices',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保洁频率',
|
||||||
|
fieldName: 'frequency',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '保洁标准',
|
||||||
|
fieldName: 'standard',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
fieldName: 'remark',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '状态',
|
||||||
|
fieldName: 'stater',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
options: [
|
||||||
|
{ label: '上架', value: 1 },
|
||||||
|
{ label: '下架', value: 0 },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
label: '合计费用',
|
||||||
|
fieldName: 'sumPeices',
|
||||||
|
component: 'InputNumber',
|
||||||
|
componentProps: {
|
||||||
|
disabled: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 120,
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: detailSchema,
|
||||||
|
showDefaultActions: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
// TODO: 获取详情数据
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
|
||||||
|
// 获取选中的服务名称
|
||||||
|
const selectedService = cleanListData.find(item => item.id === data.name);
|
||||||
|
if (selectedService) {
|
||||||
|
data.name = selectedService.name;
|
||||||
|
}
|
||||||
|
handleClosed()
|
||||||
|
await markInitialized();
|
||||||
|
emit('reload', data);
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
/* 使用 :deep() 穿透 scoped 样式,影响子组件 */
|
||||||
|
:deep(.ant-input[disabled]),
|
||||||
|
:deep(.ant-input-number-disabled .ant-input-number-input),
|
||||||
|
:deep(.ant-select-disabled .ant-select-selection-item) {
|
||||||
|
/* 设置一个更深的颜色,可以自己调整 */
|
||||||
|
color: rgba(0, 0, 0, 0.65) !important;
|
||||||
|
/* 有些浏览器需要这个来覆盖默认颜色 */
|
||||||
|
-webkit-text-fill-color: rgba(0, 0, 0, 0.65) !important;
|
||||||
|
}
|
||||||
|
</style>
|
@@ -7,7 +7,7 @@ import { $t } from '@vben/locales';
|
|||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { cleanAdd, cleanInfo, cleanUpdate, cleanList } from '#/api/property/clean';
|
import { cleanList } from '#/api/property/clean';
|
||||||
import type { CleanVO } from '#/api/property/clean/model';
|
import type { CleanVO } from '#/api/property/clean/model';
|
||||||
import { clean_orderAdd, clean_orderInfo, clean_orderUpdate } from '#/api/property/clean_order';
|
import { clean_orderAdd, clean_orderInfo, clean_orderUpdate } from '#/api/property/clean_order';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
@@ -154,6 +154,7 @@ console.log(data);
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleClosed() {
|
async function handleClosed() {
|
||||||
|
detailTable.value = []
|
||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
收费管理
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
养护管理
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
租赁方案管理
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
订单管理
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
产品管理
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
报表统计
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
|
|||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -35,15 +35,6 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
@@ -55,7 +46,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
// columns: columns(),
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
@@ -138,8 +128,8 @@ function handleDownloadExcel() {
|
|||||||
<a-button
|
<a-button
|
||||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
danger
|
danger
|
||||||
type="primary"
|
type="primary"
|
||||||
v-access:code="['property:visitorManagement:remove']"
|
v-access:code="['property:visitorManagement:remove']"
|
||||||
@click="handleMultiDelete">
|
@click="handleMultiDelete">
|
||||||
{{ $t('pages.common.delete') }}
|
{{ $t('pages.common.delete') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
122
apps/web-antd/src/views/sis/personLib/data.ts
Normal file
122
apps/web-antd/src/views/sis/personLib/data.ts
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
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: '库类型',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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: '库类型',
|
||||||
|
fieldName: 'libType',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '业务类型',
|
||||||
|
fieldName: 'busiType',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {},
|
||||||
|
},
|
||||||
|
];
|
182
apps/web-antd/src/views/sis/personLib/index.vue
Normal file
182
apps/web-antd/src/views/sis/personLib/index.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { VbenFormProps } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import type { PersonLibForm } from '#/api/sis/personLib/model';
|
||||||
|
|
||||||
|
import { Page, useVbenModal } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { useVbenVxeGrid, vxeCheckboxChecked } from '#/adapter/vxe-table';
|
||||||
|
import {
|
||||||
|
personLibExport,
|
||||||
|
personLibList,
|
||||||
|
personLibRemove,
|
||||||
|
} from '#/api/sis/personLib';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
import personLibModal from './personLib-modal.vue';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||||
|
// 不需要直接删除
|
||||||
|
// fieldMappingTime: [
|
||||||
|
// [
|
||||||
|
// 'createTime',
|
||||||
|
// ['params[beginTime]', 'params[endTime]'],
|
||||||
|
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
|
// columns: columns(),
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await personLibList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'sis-personLib-index',
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [PersonLibModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: personLibModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<PersonLibForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<PersonLibForm>) {
|
||||||
|
await personLibRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<PersonLibForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await personLibRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(
|
||||||
|
personLibExport,
|
||||||
|
'人像库数据',
|
||||||
|
tableApi.formApi.form.values,
|
||||||
|
{
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<BasicTable table-title="人像库列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['sis:personLib:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['sis:personLib:remove']"
|
||||||
|
@click="handleMultiDelete"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['sis:personLib:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['sis:personLib:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['sis:personLib:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<PersonLibModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
101
apps/web-antd/src/views/sis/personLib/personLib-modal.vue
Normal file
101
apps/web-antd/src/views/sis/personLib/personLib-modal.vue
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { personLibAdd, personLibInfo, personLibUpdate } from '#/api/sis/personLib';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
// 默认占满两列
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
// 默认label宽度 px
|
||||||
|
labelWidth: 80,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
schema: modalSchema(),
|
||||||
|
showDefaultActions: false,
|
||||||
|
wrapperClass: 'grid-cols-2',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
// 在这里更改宽度
|
||||||
|
class: 'w-[550px]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await personLibInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? personLibUpdate(data) : personLibAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
224
apps/web-antd/src/views/sis/personLibImg/data.ts
Normal file
224
apps/web-antd/src/views/sis/personLibImg/data.ts
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
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: '性别',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '人像名称',
|
||||||
|
field: 'imgName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '图片编码',
|
||||||
|
field: 'imgCode',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '图片的存储地址',
|
||||||
|
field: 'imgUrl',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '性别',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '邮箱',
|
||||||
|
field: 'email',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '联系方式',
|
||||||
|
field: 'tel',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '证件类型',
|
||||||
|
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:男',
|
||||||
|
fieldName: 'sex',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '邮箱',
|
||||||
|
fieldName: 'email',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '联系方式',
|
||||||
|
fieldName: 'tel',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '证件类型',
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
];
|
182
apps/web-antd/src/views/sis/personLibImg/index.vue
Normal file
182
apps/web-antd/src/views/sis/personLibImg/index.vue
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useVbenVxeGrid,
|
||||||
|
vxeCheckboxChecked,
|
||||||
|
type VxeGridProps
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
import {
|
||||||
|
personLibImgExport,
|
||||||
|
personLibImgList,
|
||||||
|
personLibImgRemove,
|
||||||
|
} from '#/api/sis/personLibImg';
|
||||||
|
import type { PersonLibImgForm } from '#/api/sis/personLibImg/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
|
import personLibImgModal from './personLibImg-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||||
|
// 不需要直接删除
|
||||||
|
// fieldMappingTime: [
|
||||||
|
// [
|
||||||
|
// 'createTime',
|
||||||
|
// ['params[beginTime]', 'params[endTime]'],
|
||||||
|
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
|
// columns: columns(),
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await personLibImgList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
// 表格全局唯一表示 保存列配置需要用到
|
||||||
|
id: 'sis-personLibImg-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [PersonLibImgModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: personLibImgModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<PersonLibImgForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<PersonLibImgForm>) {
|
||||||
|
await personLibImgRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<PersonLibImgForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await personLibImgRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(personLibImgExport, '人像信息数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Page :auto-content-height="true">
|
||||||
|
<BasicTable table-title="人像信息列表">
|
||||||
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['sis:personLibImg:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['sis:personLibImg:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['sis:personLibImg:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['sis:personLibImg:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['sis:personLibImg:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<PersonLibImgModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
101
apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue
Normal file
101
apps/web-antd/src/views/sis/personLibImg/personLibImg-modal.vue
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
|
import { useVbenForm } from '#/adapter/form';
|
||||||
|
import { personLibImgAdd, personLibImgInfo, personLibImgUpdate } from '#/api/sis/personLibImg';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const title = computed(() => {
|
||||||
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
|
});
|
||||||
|
|
||||||
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
|
commonConfig: {
|
||||||
|
// 默认占满两列
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
// 默认label宽度 px
|
||||||
|
labelWidth: 80,
|
||||||
|
// 通用配置项 会影响到所有表单项
|
||||||
|
componentProps: {
|
||||||
|
class: 'w-full',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
schema: modalSchema(),
|
||||||
|
showDefaultActions: false,
|
||||||
|
wrapperClass: 'grid-cols-2',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
|
{
|
||||||
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
// 在这里更改宽度
|
||||||
|
class: 'w-[550px]',
|
||||||
|
fullscreenButton: false,
|
||||||
|
onBeforeClose,
|
||||||
|
onClosed: handleClosed,
|
||||||
|
onConfirm: handleConfirm,
|
||||||
|
onOpenChange: async (isOpen) => {
|
||||||
|
if (!isOpen) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
|
if (isUpdate.value && id) {
|
||||||
|
const record = await personLibImgInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? personLibImgUpdate(data) : personLibImgAdd(data));
|
||||||
|
resetInitialized();
|
||||||
|
emit('reload');
|
||||||
|
modalApi.close();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
modalApi.lock(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleClosed() {
|
||||||
|
await formApi.resetForm();
|
||||||
|
resetInitialized();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :title="title">
|
||||||
|
<BasicForm />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
@@ -28,7 +28,8 @@ export default defineConfig(async () => {
|
|||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
// mock代理目标地址
|
// mock代理目标地址
|
||||||
// target: 'http://by.missmoc.top:3010/',
|
// target: 'http://by.missmoc.top:3010/',
|
||||||
target: 'http://127.0.0.1:8080/',
|
// target: 'http://127.0.0.1:8080/',
|
||||||
|
target: 'http://47.109.37.87:3010',
|
||||||
ws: true,
|
ws: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -14,6 +14,7 @@ export const DictEnum = {
|
|||||||
WF_FORM_TYPE: 'wf_form_type', // 表单类型
|
WF_FORM_TYPE: 'wf_form_type', // 表单类型
|
||||||
WF_TASK_STATUS: 'wf_task_status', // 任务状态
|
WF_TASK_STATUS: 'wf_task_status', // 任务状态
|
||||||
WY_SF: 'wy_sf',
|
WY_SF: 'wy_sf',
|
||||||
|
WY_ZCSHZT: 'wy_zcshzt',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type DictEnumKey = keyof typeof DictEnum;
|
export type DictEnumKey = keyof typeof DictEnum;
|
||||||
|
Reference in New Issue
Block a user