|
|
@@ -8,7 +8,7 @@
|
|
|
action="javascript:;"
|
|
|
:show-file-list="false"
|
|
|
:before-upload="handleExcelUpload"
|
|
|
- accept=".xlsx,.xls"
|
|
|
+ accept=".zip"
|
|
|
>
|
|
|
<el-button type="text" plain>
|
|
|
<el-icon><Upload /></el-icon>Import
|
|
|
@@ -371,16 +371,25 @@ export default {
|
|
|
handleExcelUpload(file) {
|
|
|
this.importFileName = file.name;
|
|
|
this.importDialogVisible = true;
|
|
|
+ this.zipFIle = file;
|
|
|
return false; // 阻止默认上传
|
|
|
},
|
|
|
|
|
|
// 确认导入
|
|
|
- confirmImport() {
|
|
|
+ async confirmImport() {
|
|
|
// 模拟导入处理
|
|
|
ElMessage.success(`文件 ${this.importFileName} 导入成功`);
|
|
|
this.importDialogVisible = false;
|
|
|
this.importFileName = '';
|
|
|
// 实际项目中应解析Excel文件并添加角色
|
|
|
+
|
|
|
+ let formData = {
|
|
|
+ file: this.zipFIle
|
|
|
+ }
|
|
|
+ anycallService.importZip(formData).then(res => {
|
|
|
+ console.log(res.data);
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
|
|
|
// 上传前检查头像
|