Activiti.vue
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div>
<!-- <div>{{modelId}}</div> -->
<iframe ref="activit" width="100%" height="100%" :src="src" style="border:none;width:100vw;height:100vh;" frameborder="0"></iframe>
</div>
</template>
<style lang="less" scoped>
</style>
<script>
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
export default Vue.extend({
name:'activiti',
data(){
return{
modelId:'',
token: Vue.ls.get(ACCESS_TOKEN) || ''
}
},
computed:{
src(){
return process.env.BASE_URL + "resources/static/modeler.html?modelId=" + this.modelId;//activiti主html路径
}
},
created(){
window.addEventListener('message', this.handleMessage)
},
mounted(){
if(this.$route.query.modelId){
this.modelId = this.$route.query.modelId
window.getMyvue = this //全局存入当前vue实例,供activiti调用] = this //全局存入当前vue实例,供activiti调用
window.getMyvue['token'] = Vue.ls.get(ACCESS_TOKEN)
if(this.$route.query.disabled){
window.getMyvue['__disable'] = this.$route.query.disabled
}
}else{
this.$router.push({
path: "/core/strategicModel/strategy",
});
}
},
methods:{
handleMessage(){
this.$router.push({
path: "/core/strategicModel/strategy",
});
}
}
})
</script>