Activiti.vue 1.51 KB
<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>