mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 10:56:44 +08:00
完善上传操作
This commit is contained in:
@@ -103,7 +103,7 @@
|
||||
:auto-upload="false"
|
||||
>
|
||||
<el-button slot="trigger" style="margin-left: 10px;" size="small" type="primary">选择</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
|
||||
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">{{uploadBtnValue}}</el-button>
|
||||
</el-upload>
|
||||
<el-link style="margin-left:auto" @click="downloadTemplate">下载模板文件</el-link>
|
||||
</el-row>
|
||||
@@ -149,6 +149,7 @@
|
||||
description:'',
|
||||
userGroupItems:[]
|
||||
},
|
||||
uploadBtnValue:'上传',
|
||||
isUpdate:false,
|
||||
importUrl:process.env.VUE_APP_AUDIENCE_IMPORT_URL,
|
||||
searchValue:'',
|
||||
@@ -451,15 +452,18 @@
|
||||
this.$refs['upload'].handleStart(files[0]);//选择文件后的赋值方法
|
||||
},
|
||||
submitUpload(){
|
||||
if(this.selectFile){this.uploadBtnValue = '上传中';}
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
uploadSuccess(res){
|
||||
console.log(111);
|
||||
if(res.status == 200){
|
||||
this.importUserData = res.result;
|
||||
this.importRepeatUsers=res.message;
|
||||
}else{
|
||||
this.$message({ type: "error", message: res.message ,offset:50});
|
||||
}
|
||||
this.uploadBtnValue = '上传';
|
||||
},
|
||||
addImportUserToForm(){
|
||||
if(this.importUserData.length == 0){
|
||||
@@ -480,7 +484,8 @@
|
||||
}
|
||||
if(isAdd){
|
||||
let userItem = {}
|
||||
userItem.aid = udata.id;
|
||||
// userItem.aid = udata.id;
|
||||
userItem.id = udata.id;
|
||||
userItem.realName = udata.realName;
|
||||
userItem.userNo = udata.userNo;
|
||||
userItem.departId = udata.departId;
|
||||
|
||||
Reference in New Issue
Block a user