From e85f113865078c70c6b012054f739ed47821cd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Thu, 18 Jul 2024 16:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/model/system.js | 14 ++++++++++++++ src/components/scImport/index.vue | 13 ++++++++++--- src/views/setting/company/index.vue | 2 +- src/views/setting/user/index.vue | 28 ++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/api/model/system.js b/src/api/model/system.js index 5cdad4c..175de2a 100644 --- a/src/api/model/system.js +++ b/src/api/model/system.js @@ -350,6 +350,20 @@ export default { return await http.post(this.url, params); } }, + template:{ + url: `${config.API_URL}/user.import.template`, + name: "用户资料导入模版", + post: async function (params) { + return await http.get(this.url,params,{responseType: 'arraybuffer'}); + } + }, + import:{ + url: `${config.API_URL}/user.import`, + name: "用户资料导入", + post: async function (params) { + return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'}); + } + }, generateRegistration:{ url: `${config.API_URL}/generate.registration.challenge`, diff --git a/src/components/scImport/index.vue b/src/components/scImport/index.vue index bfeff17..6dcdb82 100644 --- a/src/components/scImport/index.vue +++ b/src/components/scImport/index.vue @@ -44,7 +44,7 @@
-
+

{{item.msg}}

@@ -66,11 +66,11 @@ export default { props:{ size:{type:String, default:'small'}, title:{type:String, default: ""}, - text:{type:String, default: ""} }, data(){ return{ visible: false, + text:"", oss:{ host:'' @@ -100,7 +100,7 @@ export default { }, methods:{ getWsResult(res){ - if(res.data && (res.data.type == 5)){ + if(res.data && (res.data.type == 4 || res.data.type == 5)){ this.importInfo = res.data; this.progressShow = true; if(res.data.status == 0){ @@ -125,6 +125,7 @@ export default { this.$message.warning(`只能选择的excel文件类型`); return false; } + this.text = file.name; return true }, async uploadFile({ file }) { @@ -145,9 +146,15 @@ export default { this.importTrue = false; setTimeout(()=>{ this.importDis = false; + this.errorClick(); },100) }, + errorClick(){ + this.errorShow= false; + this.errorList= [] + }, save(){ + this.errorClick(); this.$emit('parentParams',this.params); }, // 上传成功 diff --git a/src/views/setting/company/index.vue b/src/views/setting/company/index.vue index 1d0bdd1..9835667 100644 --- a/src/views/setting/company/index.vue +++ b/src/views/setting/company/index.vue @@ -3,7 +3,7 @@
新增公司 - +
下载导入模版
diff --git a/src/views/setting/user/index.vue b/src/views/setting/user/index.vue index 38542ed..d1a80f7 100644 --- a/src/views/setting/user/index.vue +++ b/src/views/setting/user/index.vue @@ -17,6 +17,9 @@ 分配角色 密码重置 + +
下载导入模版
+