110 lines
3.1 KiB
Plaintext
110 lines
3.1 KiB
Plaintext
<template>
|
|
<!-- 帆软报表-->
|
|
<div class="full-screen">
|
|
<div v-if="isFrameShow" class="main-section flex-column">
|
|
<iframe ref="activit" :src="src" class="iframe" height="100%" width="100%"
|
|
@load="handleIframeLoaded"></iframe>
|
|
</div>
|
|
<span v-else style="text-align:center;">
|
|
<i class="el-icon-loading"></i>
|
|
正在加载中 请稍等
|
|
</span>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import importModal from '@/components/buttons/import/modal'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
isFrameShow: false,
|
|
userList: [], //传给子页面的用户列表
|
|
roleList: [],//传给子页面的角色列表,
|
|
path: "",
|
|
handledPaths: ['生产报表/生产日报表']
|
|
};
|
|
},
|
|
computed: {
|
|
src() {
|
|
if (this.handledPaths.includes(this.path)) {
|
|
return `/webroot/decision/view/report?viewlet=MX/${this.path}.cpt`
|
|
}
|
|
return "https://fineReport.cme-im.com/webroot/decision/view/report?viewlet=MX/" + this.path + ".cpt"//this.$store.modelId;//activiti主html路径
|
|
},
|
|
apiUrl() {
|
|
//被public里的app-cfg.js调用
|
|
return [process.env.VUE_APP_BASE_API] + "/basic/activiti6/modeler";//后台部署的api服务
|
|
},
|
|
token() {
|
|
//被public里的modeler.html里的open方法调用
|
|
// return getToken();//token
|
|
}
|
|
},
|
|
async created() {
|
|
if (this.$route.path[0] === '/') {
|
|
this.path = this.$route.path.substring(1)
|
|
} else {
|
|
this.path = this.$route.path
|
|
}
|
|
this.isFrameShow = true
|
|
},
|
|
methods: {
|
|
goto() {
|
|
console.log('goto')
|
|
this.$message.success("保存模型成功");
|
|
this.$emit("closeSubPage")
|
|
// this.$router.push({name:"/sys/activiti"})
|
|
},
|
|
handleIframeLoaded() {
|
|
if (!this.handledPaths.includes(this.path)) return
|
|
|
|
// 第一个是 生产日报表
|
|
if (this.path === this.handledPaths[0]) {
|
|
this.dealDailyReport()
|
|
}
|
|
},
|
|
dealDailyReport() {
|
|
const iframeEl = this.$refs.activit
|
|
if (!iframeEl) return
|
|
|
|
const buttonsEl = iframeEl.contentWindow.document.querySelector('.bi-button-group')
|
|
if (!buttonsEl) {
|
|
setTimeout(() => {
|
|
this.dealDailyReport()
|
|
}, 100)
|
|
return
|
|
}
|
|
|
|
const newNode = buttonsEl.children[7].cloneNode(true)
|
|
|
|
newNode.innerHTML = newNode.innerHTML.replace('邮件', '导入')
|
|
.replaceAll('base-disabled', '')
|
|
.replaceAll('disabled', '')
|
|
.replaceAll('mail-font', 'import-font')
|
|
|
|
newNode.onclick = () => {
|
|
importModal({
|
|
title: '导入生产日报表',
|
|
uploadUrl: '/report/workReport/import',
|
|
downloadUrl: '/report/workReport/exportExample',
|
|
downloadFileName: '生产日报表模板'
|
|
})
|
|
}
|
|
|
|
// buttonsEl.insertBefore(buttonsEl.children[7], newNode)
|
|
buttonsEl.appendChild(newNode)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.iframe {
|
|
width: 100%;
|
|
height: calc(100vh - 94px);
|
|
}
|
|
|
|
> > > .copyrightInfo-div {
|
|
display: none !important;
|
|
}
|
|
</style>
|