60 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2024-01-15 15:34:15 +08:00
<el-dialog v-if="visible" v-model="visible" title="Flowable工作流在线流程设计器" width="90%" height="100%" :before-close="handleClose">
<div class="modeler">
<iframe class="iframe" :src="src"></iframe>
</div>
</el-dialog>
</template>
2023-06-12 20:46:19 +08:00
<script lang="ts">
2024-01-15 15:34:15 +08:00
import { propTypes } from '@/utils/propTypes';
const baseURL = import.meta.env.VITE_APP_BASE_API;
import { getToken } from '@/utils/auth';
export default {
props: {
2024-01-15 15:34:15 +08:00
modelId: propTypes.string.isRequired
},
2024-01-15 15:34:15 +08:00
emits: ['handleClose'],
data() {
return {
visible: false
};
},
computed: {
src() {
return `/static/flowable-modeler/index.html#/editor/${this.modelId}`;
},
apiUrl() {
return baseURL;
},
token() {
return getToken();
2023-07-29 13:39:14 +08:00
},
clientid() {
return import.meta.env.VITE_APP_CLIENT_ID;
2024-01-15 15:34:15 +08:00
}
},
2023-06-13 22:37:23 +08:00
mounted() {
//全局存入当前vue实例
(window as any).this = this;
},
methods: {
2023-06-13 22:37:23 +08:00
async handleClose() {
2024-01-15 15:34:15 +08:00
await this.$modal.confirm('请记得点击左上角保存按钮,确定关闭设计窗口?').finally(() => ((this as any).loading = false));
2023-06-13 22:37:23 +08:00
this.visible = false;
// 刷新数据
2024-01-15 15:34:15 +08:00
this.$emit('handleClose');
}
}
};
</script>
<style scoped>
.iframe {
width: 100%;
height: calc(100vh - 120px);
2024-01-15 15:34:15 +08:00
border: 0;
}
</style>