diff --git a/src/api/system/user.ts b/src/api/system/user.ts index 7045f6c3..b58e6f50 100644 --- a/src/api/system/user.ts +++ b/src/api/system/user.ts @@ -126,7 +126,7 @@ const UserAPI = { import(deptId: number, file: File) { const formData = new FormData(); formData.append("file", file); - return request({ + return request({ url: `${USER_BASE_URL}/import`, method: "post", params: { deptId: deptId }, diff --git a/src/types/global.d.ts b/src/types/global.d.ts index dfb3f337..efc4ba45 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -89,5 +89,18 @@ declare global { /** 子列表 */ children?: OptionType[]; } + /** + * 导入结果 + */ + interface ExcelResult { + /** 状态码 */ + code: string; + /** 无效数据条数 */ + invalidCount: number; + /** 有效数据条数 */ + validCount: number; + /** 错误信息 */ + messageList: Array; + } } export {}; diff --git a/src/views/system/user/components/UserImport.vue b/src/views/system/user/components/UserImport.vue index bfe37fd7..573bdca6 100644 --- a/src/views/system/user/components/UserImport.vue +++ b/src/views/system/user/components/UserImport.vue @@ -1,70 +1,97 @@