modelViewer.vue 827 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="app-container">
  3. <!-- 流程设计器,负责绘制流程等 -->
  4. <my-process-viewer key="designer" v-model="xmlString" v-bind="controlForm" keyboard ref="processDesigner" />
  5. </div>
  6. </template>
  7. <script>
  8. import {getModel} from "@/api/bpm/model";
  9. export default {
  10. name: "App",
  11. components: { },
  12. data() {
  13. return {
  14. xmlString: "", // BPMN XML
  15. controlForm: {
  16. prefix: "activiti"
  17. },
  18. };
  19. },
  20. created() {
  21. // 如果 modelId 非空,说明是修改流程模型
  22. const modelId = this.$route.query && this.$route.query.modelId
  23. if (modelId) {
  24. getModel(modelId).then(response => {
  25. this.xmlString = response.data.bpmnXml
  26. })
  27. }
  28. }
  29. };
  30. </script>
  31. <style lang="scss">
  32. .my-process-designer {
  33. height: calc(100vh - 84px);
  34. }
  35. </style>