Ben Lin
2025-03-08 745815f637e5385b2cbc23a6ae02401bb8b6c675
src/views/tigerprojects/system/lowcode/detail/index.vue
@@ -10,14 +10,13 @@
  <PageWrapper :title="pageTitle" :content="contentStr" contentBackground @back="goBack">
    <template #footer>
      <a-tabs default-active-key="detail" v-model:activeKey="currentKey" @tabClick="tabClkcallback">
        <a-tab-pane key="detailfirst" :tab="firstTabName" />
        <a-tab-pane key="detailsecond" :tab="secondTabName" />
        <a-tab-pane v-for="t in TabList" :tab="t.name" :key="t.key" />
      </a-tabs>
    </template>
    <div>
      <div v-if="currentKey == 'detailfirst'">
      <div  v-for="t in TabList" :key="t.key">
        <Suspense>
          <detail :entityName="entityName" />
          <detail :entityName="t.entityName" v-if="currentKey == t.key"/>
        </Suspense>
      </div>
    </div>
@@ -25,20 +24,17 @@
</template>
<script lang="ts" setup>
  import { ref, provide, Ref, defineAsyncComponent } from 'vue';
  import { ref, reactive, provide, Ref, defineAsyncComponent } from 'vue';
  import { useRoute } from 'vue-router';
  import { PageWrapper } from '/@/components/Page';
  import { useTabs } from '/@/hooks/web/useTabs';
  import { Tabs } from 'ant-design-vue';
  import { useGo } from '/@/hooks/web/usePage';
  import { OpenCustModal, custOnChange } from '../data';
  import { custOnChange } from '../data';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useGlobSetting } from '/@/hooks/setting';
  const { t } = useI18n();
  const detail = defineAsyncComponent(() => import('./detail.vue'));
  const { createMessage } = useMessage();
  const route = useRoute();
  // const objParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
  const routeParams = ref(JSON.parse(decodeURI(route.params?.id as string)));
@@ -51,17 +47,17 @@
  const go = useGo();
  const pageTitle = ref(objParams.value.pageTitle);
  const contentStr = ref(objParams.value.contentStr);
  const firstTabName = ref(objParams.value.firstTabName);
  const secondTabName = ref(objParams.value.secondTabName);
  // const firstTabName = ref(objParams.value.firstTabName);
  // const secondTabName = ref(objParams.value.secondTabName);
  const TabList = reactive(objParams.value.Tabs);
  const entityName = ref(routeParams.value.Name);
  const detailName = ref(objParams.value.detailName);
  const globSetting = useGlobSetting();
  const crudColSlots = ref<any>(objParams.value.colSlots);
  const keyFieldValues = ref<any>(null);
  provide<Ref<any>>('objParams', objParams.value);
  provide<Ref<any>>('keyFieldValues', keyFieldValues);
  var currentKey = ref('detailfirst');
  var currentKey = ref(TabList[0].key);
  const { setTitle } = useTabs();
  // 设置Tab的标题(不会影响页面标题)