| | |
| | | return request({ |
| | | url: 'api/ubcs-code/mdmEngineController/exportCode', |
| | | method: 'excel', |
| | | responseType: 'json', // 设置响应类型为arraybuffer |
| | | headers: { |
| | | 'Content-Type': 'application/vnd.ms-excel', // 设置请求头为二进制流类型 |
| | | // 在这里可以设置其他请求头信息 |
| | | // 例如: |
| | | // 'Authorization': 'Bearer your-token', |
| | | }, |
| | | responseType: 'blob', // 设置响应类型为blob |
| | | params:{ |
| | | ...data |
| | | } |
| | |
| | | url: '/api/ubcs-resource/fileController/downloadFilesByOids', |
| | | method: 'post', |
| | | headers:{'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | data: data |
| | | |
| | | }) |
| | |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':ids,...exportArr}).then(res=>{ |
| | | console.log('res',res) |
| | | const filename = '下载.xlsx'; // 下载的文件名 |
| | | const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }); |
| | | const a = document.createElement('a'); |
| | | const url = window.URL.createObjectURL(blob); |
| | | a.href = url; |
| | | a.download = filename; |
| | | a.style.display = 'none'; |
| | | document.body.appendChild(a); |
| | | a.click(); |
| | | document.body.removeChild(a); |
| | | window.URL.revokeObjectURL(url); |
| | | |
| | | // const filename = '下载.xlsx'; // 下载的文件名 |
| | | // const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' }); |
| | | // |
| | | // const url = window.URL.createObjectURL(blob); |
| | | // const link = document.createElement('a'); |
| | | // link.href = url; |
| | | // link.setAttribute('download', filename); |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); |
| | | // URL.revokeObjectURL(url); |
| | | 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", "文件名字.xls"); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); //下载完成移除元素 |
| | | window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | } |
| | | }) |
| | | |
| | | } |
| | | }; |
| | | }, |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | // 监听父组件传的窗口显示隐藏的值 |
| | | visible (){ |
| | | this.isShowformulaEdit = this.visible; |
| | | } |
| | | // 监听父组件传的窗口显示隐藏的值,以及值的回填 |
| | | visible() { |
| | | this.isShowformulaEdit = this.visible; |
| | | this.formulaContent=this.componentRuleText || ''; |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.formulaContent=this.componentRuleText |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | |
| | | import {mapGetters} from "vuex"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import {validatenull} from "@/util/validate"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | props: ["options","visible","ownbizOid"], |
| | |
| | | let data=new FormData(); |
| | | if(row && row.oid){ |
| | | data.append('fileOids',row.oid) |
| | | download(data) |
| | | this.downloadFile(data); |
| | | }else{ |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | data.append('fileOids',this.oids) |
| | | download(data); |
| | | this.downloadFile(data); |
| | | } |
| | | }, |
| | | downloadFile(data){ |
| | | download(data).then(res=>{ |
| | | // console.log(res); |
| | | 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 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); //下载完成移除元素 |
| | | window.URL.revokeObjectURL(src); //释放掉blob对象 |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择文件删除?", { |
| | | confirmButtonText: "确定", |
| | |
| | | return new Promise((resolve) => { |
| | | getButtons().then(res => { |
| | | const data = res.data.data; |
| | | // console.log(data); |
| | | commit('SET_PERMISSION', data); |
| | | resolve(); |
| | | }) |
| | |
| | | <formula-editor |
| | | ref="formulaEditor" |
| | | @updateFormulaContent="updateFormulaContent" |
| | | :componentRuleText="form.getValueClass" |
| | | :visible.sync="formulaEditorParams.formulaEditorSettingBox" |
| | | :thisSceneTableData="formulaEditorParams.thisSceneTableData" |
| | | :systemVariableTableData="formulaEditorParams.systemVariableTableData"> |
| | |
| | | this.loadlistClassifyLinkAttr(); |
| | | }else if(condition === 'value'){ |
| | | //打开公式编辑框,第二层嵌套对话框 |
| | | //this.$refs.formulaEditor.isShowformulaEdit = true; |
| | | this.formulaEditorParams.formulaEditorSettingBox = true; |
| | | }else if(condition === 'parentClassifySecOid'){ |
| | | this.parentClsfyParams.isShowParentClassifySettingBox = true; |
| | |
| | | if(enumCach == null) { |
| | | getDictionary("codeFillSeparator").then(res=>{ |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | localStorage.setItem(key,JSON.stringify(res.data.data)); |
| | | localStorage.setItem("codeFillSeparator",JSON.stringify(res.data.data)); |
| | | }) |
| | | } |
| | | }, |
| | |
| | | plain |
| | | @click="cloneMenuButton">从其他菜单克隆按钮 |
| | | </el-button> |
| | | <el-button type="info" |
| | | size="small" |
| | | icon="el-icon-connection" |
| | | plain |
| | | @click="test">test |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | |
| | | }, |
| | | }, |
| | | computed: { |
| | | // mapGetters: 辅助函数仅仅将store 中的 getter 映射到局部计算属性 |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | |
| | | delBtn: this.vaildData(this.permission.menu_delete, false), |
| | | editBtn: this.vaildData(this.permission.menu_edit, false) |
| | | }; |
| | | |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | |
| | | }, |
| | | methods: { |
| | | |
| | | test(){ |
| | | console.log(this.permission) |
| | | }, |
| | | |
| | | /** 从其他菜单克隆按钮 */ |
| | | cloneMenuButton(){ |
| | | if(this.selectionList.length != 1 || this.selectionList[0].category === 2){ |
| | |
| | | public static void downloadFile(HttpServletResponse response, FileObjectBO fileObjectBO,boolean closeInputStream) throws IOException { |
| | | MediaType mediaType = MediaTypeFactory.getMediaType(fileObjectBO.getBucketName() + "." + fileObjectBO.getFileExtension()).orElse(MediaType.APPLICATION_OCTET_STREAM); |
| | | // 设置强制下载不打开 |
| | | response.setContentType(mediaType.toString()); |
| | | response.setContentType(mediaType.toString()+";application/force-download;charset=UTF-8"); |
| | | try{ |
| | | String fileName = URLEncoder.encode(fileObjectBO.getName() + "." + fileObjectBO.getFileExtension(), "UTF8"); |
| | | response.addHeader("Content-Disposition", "attachment; filename="+ fileName+ ";filename*=utf-8''" + fileName); |
| | | response.addHeader("Content-Disposition", "attachment;filename="+ fileName+ ";filename*=utf-8''"); |
| | | }catch(Exception e){ |
| | | if(log.isErrorEnabled()){ |
| | | log.error("设置文件的名称到响应流的时候出错",e); |