| | |
| | | :on-exceed="handleExceed"
|
| | | :headers="uploadHeaders"
|
| | | :on-success="onSuccess"
|
| | | :on-error="onError"
|
| | | :show-file-list="false"
|
| | | :on-change="uploadChange"
|
| | | :data="upParams"
|
| | |
| | | leftTree: [],
|
| | | redisOid: "",
|
| | | pageLoading: null,
|
| | | showCodeApply: false,
|
| | | currentTypeObj: {
|
| | | historyImport: {
|
| | | title: "历史数据导入",
|
| | |
| | | },
|
| | | methods: {
|
| | | async beforeUpload(file) {
|
| | | console.log(file, 'file');
|
| | | const fileType = file.name.split(".").pop();
|
| | | if (fileType !== "xlsx" && fileType !== "xls") {
|
| | | // 上传格式不符合要求,提示错误信息并取消上传
|
| | | this.$message.error("只允许上传xlsx、xls格式的文件");
|
| | | return Promise.reject(false);
|
| | | }
|
| | | if (this.type === "batchImportApply") {
|
| | | const flag = await this.$refs.CodeApply.validate();
|
| | | if (!flag) {
|
| | | return Promise.reject(false);
|
| | | }
|
| | | if (this.type === "batchImportApply" && this.showCodeApply) {
|
| | | // const flag = await this.$refs.CodeApply.validate();
|
| | | // if (!flag) {
|
| | | // return Promise.reject(false);
|
| | | // }
|
| | | }
|
| | | this.pageLoading = this.$loading({
|
| | | lock: true,
|
| | |
| | | this.dialogVisible = false
|
| | | return
|
| | | }
|
| | | let fileName = res.data.filePath.split("/").pop();
|
| | | if (res.data.fileOid) {
|
| | | const fileName = res.data.filePath.split("/").pop();
|
| | | this.$message.error("请下载错误信息文件进行查看!");
|
| | | downloadErrorFile({ uuid: res.data.fileOid }).then((res2) => {
|
| | | this.$utilFunc.downloadFileByBlob(res2.data, fileName);
|
| | |
| | | });
|
| | | }
|
| | | },
|
| | | onError(err) {
|
| | | console.log(err, 'err');
|
| | | this.pageLoading.close();
|
| | | },
|
| | | uploadChange(file) {
|
| | | console.log(file, 'file', file.status === "success");
|
| | | if (file.status === "success" || file.status === "error") {
|
| | | this.pageLoading.close();
|
| | | }
|