对接标准/译文获取申请

This commit is contained in:
范强强
2024-03-29 09:42:28 +08:00
parent 417b490039
commit 9ec0d610b1
@@ -182,6 +182,7 @@
import standardsAndTranslationModal from './components/standardTranslationAcquisitionRequestModal';
import detailModal from './components/detailModal';
import exportDialog from './components/exportDialog';
import axios from '@/common/axiosV2'
export default {
name: 'StandardTranslationAcquisitionRequest',
@@ -335,23 +336,36 @@ export default {
this.$refs.selections.clearSelection()
})
},
exportName(name) {
exportName (name) {
const params = {
...this.StandardApplyForEOPage,
exportFileName: name,
ids: this.selectedList.length > 0 ? this.selectedList.join(',') : '',
};
const url = '/api/lawss/standardApplyFor/exportStandardApplyForEOExcel?'
const formattedParams = Object.keys(params).map((key) => `${key}=${params[key]}`).join('&')
const link = document.createElement('a')
link.href = `${url}${formattedParams}`
link.download = name + '.xlsx'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
axios({
url: '/api/lawss/standardApplyFor/exportStandardApplyForEOExcel',
method: 'get',
responseType: 'blob',
params: params
}).then(res => {
const blob = new Blob([ res ], { type: 'application/vnd.ms-excel' });
// 浏览器兼容,Google和火狐支持a标签的downloadIE不支持
if (window.navigator && window.navigator.msSaveBlob) {
// IE浏览器、微软浏览器
/* 经过测试,微软浏览器Microsoft Edge下载文件时必须要重命名文件才可以打开,
IE可不重命名,以防万一,所以都写上比较好 */
window.navigator.msSaveBlob(blob, name + '.xlsx');
} else {
// 其他浏览器
const link = document.createElement('a'); // 创建a标签
link.style.display = 'none';
const objectUrl = URL.createObjectURL(blob);
link.href = objectUrl;
link.download = name + '.xlsx';
link.click();
URL.revokeObjectURL(objectUrl);
}
})
},
exportList () {
this.$refs.exportDialogRef.openModel()