feat(property): 添加用户导入和人脸导入功能
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { PersonVO, PersonForm, PersonQuery } from './model';
|
||||
import type { PersonVO, PersonForm, PersonQuery, PerssonImportParam } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { commonExport, ContentTypeEnum } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
@@ -59,3 +59,54 @@ export function personUpdate(data: PersonForm) {
|
||||
export function personRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/person/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从excel导入用户
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function personImportData(data: PerssonImportParam) {
|
||||
return requestClient.post<{ code: number; msg: string }>(
|
||||
'/property/person/importData',
|
||||
data,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': ContentTypeEnum.FORM_DATA,
|
||||
},
|
||||
isTransformResponse: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入人脸
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function personImportFace(data: PerssonImportParam) {
|
||||
return requestClient.post<{ code: number; msg: string }>(
|
||||
'/property/person/importFace',
|
||||
data,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': ContentTypeEnum.FORM_DATA,
|
||||
},
|
||||
isTransformResponse: false,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载用户导入模板
|
||||
* @returns blob
|
||||
*/
|
||||
export function downloadImportTemplate() {
|
||||
return requestClient.post<Blob>(
|
||||
'/property/person/importTemplate',
|
||||
{},
|
||||
{
|
||||
isTransformResponse: false,
|
||||
responseType: 'blob',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@@ -285,3 +285,15 @@ export interface Person extends BaseEntity {
|
||||
|
||||
email: string
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 用户导入
|
||||
* @param updateSupport 是否覆盖数据
|
||||
* @param unitId 单位Id
|
||||
* @param file excel文件
|
||||
*/
|
||||
export interface PerssonImportParam {
|
||||
updateSupport: boolean;
|
||||
unitId: number;
|
||||
file: Blob | File;
|
||||
}
|
||||
|
Reference in New Issue
Block a user