| | |
| | | export function exportCode(data){ |
| | | return request({ |
| | | url: 'api/ubcs-code/mdmEngineController/exportCode', |
| | | method: 'excel', |
| | | method: 'post', |
| | | responseType: 'blob', // 设置响应类型为blob |
| | | params:{ |
| | | ...data |
| | |
| | | func.downloadFileByBlob(blob,fileName); |
| | | window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | } |
| | | |
| | | // let src = window.URL.createObjectURL(blob); |
| | | // if (src) { |
| | | // let link = document.createElement("a"); |
| | | // link.style.display = "none"; |
| | | // link.href = src; |
| | | // link.setAttribute("download", "文件名字.xls"); |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); //下载完成移除元素 |
| | | // window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | // } |
| | | }) |
| | | } |
| | | }; |
| | |
| | | if(res){ |
| | | const fileNames = res.headers['content-disposition'].split(";"); |
| | | let characterSet = fileNames[2].split("filename*=")[1]; |
| | | let fileName = decodeURI(fileNames[1].split("filename=")[1],characterSet); |
| | | // console.log(fileName) |
| | | let fileName = decodeURI(fileNames[1].split("filename=")[1],characterSet); // 下载的文件名 |
| | | let blob = new Blob([res.data], { |
| | | type: res.data.type + ";charset=utf-8", |
| | | }); |
| | | let src = window.URL.createObjectURL(blob); |
| | | if (src) { |
| | | let link = document.createElement("a"); |
| | | link.style.display = "none"; |
| | | link.href = src; |
| | | link.setAttribute("download", fileName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); //下载完成移除元素 |
| | | func.downloadFileByBlob(blob,fileName); |
| | | window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | <el-form-item label="中文名称" label-width="100px"> |
| | | <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="数据库表名" label-width="100px"> |
| | | <!-- <el-form-item label="数据库表名" label-width="100px"> |
| | | <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="所属领域" label-width="100px" prop="domain" class="domainSelect"> |
| | | <el-select placeholder="请选择领域" v-model="btmType.bizDomain" :prefix-icon="icons.domain"> |
| | | <el-option v-for="item in domainOption" |