index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <MindmapModal
  3. ref="mindmapModalRef"
  4. :hide-close="true"
  5. :default-data="mindmapData"
  6. defaultOpen
  7. @refresh="getData"
  8. />
  9. </template>
  10. <script setup lang="ts">
  11. import { onMounted, ref } from 'vue';
  12. import MindmapModal from '../excel/MindmapModal.vue';
  13. import { useRoute } from 'vue-router';
  14. const mindmapModalRef = ref<InstanceType<typeof MindmapModal>>();
  15. const route = useRoute();
  16. const mindmapData = ref<any>();
  17. const getData = () => {
  18. if (!route.query?.id) return;
  19. window.parent?.BpmTools?.program(
  20. {
  21. interfaceCode: 'Common.getBOMAiImageData',
  22. bom_id: route.query.id,
  23. },
  24. (res: any) => {
  25. if (res?.code) {
  26. mindmapData.value = res?.data;
  27. }
  28. }
  29. );
  30. };
  31. onMounted(() => {
  32. // 测试接口
  33. // fetch(`https://sl-yf-bommgr-admin-dev.shalu.com/api/module/Invoke`, {
  34. // method: "POST",
  35. // headers: {
  36. // 'Authorization': "bpm_client_1419718313868529664",
  37. // "content-type": "application/json;charset=UTF-8",
  38. // },
  39. // body: JSON.stringify({
  40. // interfaceCode: "Common.getBOMAiImageData",
  41. // bom_id: "7f492047-5127-45fc-9398-b5effd640f79",
  42. // }),
  43. // })
  44. // .then((res) => res.json())
  45. // .then((res) => {
  46. // console.log("res", res);
  47. // mindmapData.value = res.result.data;
  48. // });
  49. getData();
  50. });
  51. </script>
  52. <style scoped></style>