Ben Lin
2024-07-24 50111114eb8254fe4d6fc15e9781f2c47e3db74a
src/views/tigerprojects/system/lowcode/composition/index.vue
@@ -4,7 +4,7 @@
 * @version: 
 * @Date: 2024-06-18 23:30:30
 * @LastEditors: Ben Lin
 * @LastEditTime: 2024-07-21 18:03:22
 * @LastEditTime: 2024-07-23 23:16:58
-->
<template>
  <PageWrapper
@@ -17,7 +17,7 @@
    @back="goBack"
  >
    <Suspense class="w-1/4 xl:w-1/5">
      <LeftTree @select="NodeSelect" />
      <LeftTree @select="NodeSelect" @deletenode="delCallback" />
    </Suspense>
    <Suspense>
      <div class="w-3/4 xl:w-4/5 p-5">
@@ -98,9 +98,13 @@
  const { notification, createErrorModal } = useMessage();
  const go = useGo();
  const route = useRoute();
  const { setTitle } = useTabs();
  const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
  const entityName = ref(objParams.value.Name);
  const { setTitle, refreshPage } = useTabs();
  // const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); //ref(JSON.parse(history.state.obj))
  const routeParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  // 从sessionStorage中读取参数并转换回对象
  const savedParams = sessionStorage.getItem(`${routeParams.value.sName}_params`);
  const objParams = savedParams ? ref(JSON.parse(decodeURI(savedParams))) : ref({});
  const entityName = ref(routeParams.value.Name);
  const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法
  const useFormData = ref({});
  const cType = ref('');
@@ -110,6 +114,7 @@
  const dense = isNullOrUnDef(objParams.value.dense) ? ref(false) : ref(objParams.value.dense);
  const pageTitle = ref(objParams.value.pageTitle);
  const pageContent = ref(objParams.value.pageContent);
  const colSlots = ref<any>(objParams.value.colSlots);
  const selectedNodes = ref([]);
  const isMounted = ref(false);
  const showNav = ref(false);
@@ -134,7 +139,7 @@
    if (!isNullOrUnDef(custImport.value)) {
      const [{ GetHomeUrl }] = custImport.value['default']();
      // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页
      go(GetHomeUrl(entityName.value));
      go(GetHomeUrl({ colSlots: colSlots.value }));
    }
  }
@@ -180,7 +185,18 @@
      nodes: [],
      edges: [],
    };
    initRoute(currlf, e.nodes[0].id, routeData, currlf);
    if ((e.nodes[0].type == 'Route')) {
      initRoute(currlf, e.nodes[0].code, routeData, currlf);
    }
  }
  /**
   * @description: 删除节点后回调
   * @param {*} node
   * @return {*}
   */
  function delCallback(node) {
    refreshPage();
  }
  /**