edit.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="layout-pd">
  3. <LogicFlow ref='designerRef' v-model="flowData" />
  4. </div>
  5. </template>
  6. <script setup lang="ts" name="workflowEdit">
  7. import { defineAsyncComponent, ref, onMounted } from "vue";
  8. import { useRoute } from "vue-router";
  9. import { getWorkFlowDetail } from '/@/api/system/workflow';
  10. const LogicFlow = defineAsyncComponent(() => import('/@/components/LogicFlow/index.vue'));
  11. const designerRef = ref(null as any);
  12. let flowData = ref({
  13. "name": "",
  14. "code": "",
  15. "id": "",
  16. "moduleName": "",
  17. "moduleCode": "",
  18. "nodes": [
  19. {
  20. "id": "start",
  21. "type": "hotline:start",
  22. "x": 780,
  23. "y": 120,
  24. "properties": {},
  25. "text": {
  26. "x": 780,
  27. "y": 80,
  28. "value": "开始"
  29. }
  30. },
  31. {
  32. "id": "end",
  33. "type": "hotline:end",
  34. "x": 780,
  35. "y": 400,
  36. "properties": {},
  37. "text": {
  38. "x": 780,
  39. "y": 440,
  40. "value": "结束"
  41. }
  42. }
  43. ],
  44. "edges": []
  45. });
  46. const route = useRoute();
  47. onMounted(async () => {
  48. // 查询详情
  49. if (route.params.id) {
  50. const res: any = await getWorkFlowDetail(route.params.id);
  51. flowData.value = res.result;
  52. }
  53. })
  54. </script>
  55. <style scoped>
  56. </style>