From 274fdb99d22987ed058f48e71d6b4f4f08f6ca03 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期四, 07 十二月 2023 11:16:57 +0800 Subject: [PATCH] 导出下载错误信息更改 --- Source/UBCS-WEB/src/components/Master/MasterTransfer.vue | 60 ++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 34 insertions(+), 26 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue index 7ddabc7..08d4d34 100644 --- a/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue +++ b/Source/UBCS-WEB/src/components/Master/MasterTransfer.vue @@ -10,7 +10,8 @@ <el-radio :label="1">鍏ㄩ儴</el-radio> <el-radio :label="2">椤电爜</el-radio> </el-radio-group> - <span v-if="radio === 2" style="margin-left: 20px;"><el-input v-model="pageExport" style="width: 150px"></el-input> 锛堣緭鍏ラ〉鐮佹垨鑰呴〉闈㈣寖鍥达紝濡傦細1-10锛�</span> + <span v-if="radio === 2" style="margin-left: 20px;"><el-input v-model="pageExport" + style="width: 150px"></el-input> 锛堣緭鍏ラ〉鐮佹垨鑰呴〉闈㈣寖鍥达紝濡傦細1-10锛�</span> </div> </div> <div style="text-align: center"> @@ -120,6 +121,24 @@ mounted() { }, methods: { + handlerFile(res) { + // let reader = new FileReader(); + // reader.readAsText(res.data); + // reader.onload = (result) => { + // try { + // let resData = JSON.parse(result.target.result); // 瑙f瀽瀵硅薄鎴愬姛 + // if (resData.code != 200) { + // this.$message.error(resData.msg); + // } + // } catch (err) { + // // 瑙f瀽鎴愬璞″け璐ワ紝璇存槑鏄甯哥殑鏂囦欢娴� + // func.downloadFileByBlobHandler(res); + // this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�'); + // } + // }; + func.downloadFileByBlobHandler(res); + this.$message.success('涓嬭浇鎴愬姛锛岃鏌ョ湅锛�'); + }, escHandler() { this.$emit('update:visible', false); this.value = []; @@ -157,11 +176,8 @@ 'conditionMap[oid]': this.ids, ...this.exportArrTwo, limit: -1 }).then(res => { - // console.log('res',res) - if (res) { - func.downloadFileByBlobHandler(res); - this.escHandler() - } + this.handlerFile(res); + this.escHandler(); }) } else { @@ -170,10 +186,9 @@ 'conditionMap[oid]': this.ids, ...this.exportArr }).then(res => { // console.log('res',res) - if (res) { - func.downloadFileByBlobHandler(res); - this.escHandler() - } + this.handlerFile(res); + this.escHandler(); + }) } @@ -185,19 +200,15 @@ this.exportArrTwo[`attrIdIndexMap[${index}]`] = prop; }); exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArrTwo, limit: -1}).then(res => { - // console.log('res',res) if (res) { func.downloadFileByBlobHandler(res); - this.escHandler() + this.escHandler(); } }) } else { exportCode({codeClassifyOid: this.codeClassifyOid, ...this.exportArr, limit: -1}).then(res => { - // console.log('res',res) - if (res) { - func.downloadFileByBlobHandler(res); - this.escHandler() - } + this.handlerFile(res); + this.escHandler(); }) } } else if (this.radio === 2) { @@ -233,10 +244,9 @@ endPage: end }).then((res) => { // console.log('res',res) - if (res) { - func.downloadFileByBlobHandler(res); - this.escHandler() - } + this.handlerFile(res); + this.escHandler(); + }); } else { this.tableHeadData.map(item => item.prop) @@ -249,11 +259,9 @@ page: start, endPage: end }).then(res => { - // console.log('res',res) - if (res) { - func.downloadFileByBlobHandler(res); - this.escHandler() - } + // console.log('res', res) + this.handlerFile(res); + this.escHandler(); }) } } -- Gitblit v1.9.3