From 6a7257f9d8f659c508cf826726126c0fa4363eef Mon Sep 17 00:00:00 2001 From: YangYuGang <1378265336@qq.com> Date: 星期一, 14 四月 2025 17:04:39 +0800 Subject: [PATCH] 盘点单没有数据时一直加载中 --- src/views/tigerprojects/system/lowcode/detail/index.vue | 120 ++++++------------------------------------------------------ 1 files changed, 12 insertions(+), 108 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/detail/index.vue b/src/views/tigerprojects/system/lowcode/detail/index.vue index c7375b0..0d23006 100644 --- a/src/views/tigerprojects/system/lowcode/detail/index.vue +++ b/src/views/tigerprojects/system/lowcode/detail/index.vue @@ -4,78 +4,37 @@ * @version: * @Date: 2024-05-30 13:28:20 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-21 18:02:52 + * @LastEditTime: 2024-07-22 01:55:07 --> <template> <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 v-if="currentKey == 'detailsecond'"> - <Suspense></Suspense> - </div> </div> - <Suspense> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - :entityName="entityName" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <template #[item.name] v-for="item in dtlSlots" :key="item.name"> - <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]"> - <!-- 鐢ㄦ彃妲借嚜瀹氫箟寮瑰嚭閫夋嫨妗� --> - <template #[name]="{ field }" v-for="name in item.slots" :key="name"> - <a-button - class="mt-1 ml-1" - size="small" - @click="handleCustClick(field)" - :preIcon="item.preIcons[name]" - /> - <GeneralModal - @register="useModalData[name][0]" - @success="(d, u) => handleEntSuccess(d, u, item.name)" - /> - </template> - </BasicForm> - <!-- 鑷畾涔夊唴瀹� --> - </template> - </CustModal> - </Suspense> </PageWrapper> </template> <script lang="ts" setup> - import { ref, provide, Ref } 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 detail from './detail.vue'; + import { custOnChange } from '../data'; import { useI18n } from '/@/hooks/web/useI18n'; - import { useMessage } from '/@/hooks/web/useMessage'; - import GeneralModal from '/@/views/components/GeneralModal.vue'; - import CustModal from '/@/views/components/CustModal.vue'; - import { BasicForm } from '/@/components/Form/index'; - import { useGlobSetting } from '/@/hooks/setting'; - import { useModal } from '/@/components/Modal'; const { t } = useI18n(); - - const { createMessage } = useMessage(); + const detail = defineAsyncComponent(() => import('./detail.vue')); 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))); @@ -88,25 +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 formSchemas = ref({}); //寮瑰嚭妗嗗琛ㄥ崟缁撴瀯 - const useModalData = ref({}); //琛ㄥ崟涓彃妲芥覆鏌撴寜閽墦寮�妯℃�佹useModal鏂规硶 - const useFormData = ref({}); - const secondColSlots = ref<any>(objParams.value.secondColSlots); //鎸夐挳鎻掓Ы const crudColSlots = ref<any>(objParams.value.colSlots); - const cType = ref(''); - const dtlSlots = ref([] as any[]); - const selectVals = ref({}); const keyFieldValues = ref<any>(null); provide<Ref<any>>('objParams', objParams.value); provide<Ref<any>>('keyFieldValues', keyFieldValues); - const [registerCust] = useModal(); - var currentKey = ref('detailfirst'); + var currentKey = ref(TabList[0].key); const { setTitle } = useTabs(); // 璁剧疆Tab鐨勬爣棰橈紙涓嶄細褰卞搷椤甸潰鏍囬锛� @@ -120,7 +71,7 @@ .then((m) => { const [{ GetHomeUrl }] = m.default(); // 鏈緥鐨勬晥鏋滄椂鐐瑰嚮杩斿洖濮嬬粓璺宠浆鍒拌处鍙峰垪琛ㄩ〉锛屽疄闄呭簲鐢ㄦ椂鍙繑鍥炰笂涓�椤� - go(GetHomeUrl({colSlots:crudColSlots.value})); + go(GetHomeUrl({ colSlots: crudColSlots.value })); }) .catch(() => {}); } catch (e) {} @@ -147,52 +98,5 @@ }; }; } - } - - /** - * @description: 鑷畾涔夊脊鍑烘纭畾杩斿洖 - * @param {*} d - * @return {*} - */ - function custSuccess(d) { - // reload(); - } - - /** - * @description: 鍚勮〃鍗曞唴寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛鍚庢柟娉� - * @param {*} d - * @param {*} u - * @param {*} item - * @return {*} - */ - function handleEntSuccess(d, u, item) { - /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ - try { - import(`../entityts/${cType.value}.ts`).then((m) => { - const [{ GetSelectSuccess }] = m.default(); - var values = GetSelectSuccess(d, u); - selectVals.value = values; //淇濆瓨寮瑰嚭妗嗛�夋嫨鐨勭粨鏋� - let _val = {}; - d.returnFieldName.map((x) => { - _val[x] = values[x]; - }); - useFormData.value[item][1].setFieldsValue(_val); - }); - } catch (e) {} - } - - /** - * @description: 鎵撳紑鑷畾涔夋ā鎬佹 - * @param {*} item - * @return {*} - */ - function handleCustClick(item) { - OpenCustModal( - useModalData.value[item][1].openModal, //甯﹀叆openModal鏂规硶 - cType.value, - item, - [], - // selectVals.value['ROUTE_CODE'], - ); //[openRvModal], selectVals.value['ID']杩欐槸鑷畾涔夊弬鏁帮紝鎸夊疄闄呴渶姹� } </script> -- Gitblit v1.9.3