From 4b3fd35893972bb05fd7ab89dc624ab805093ff3 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周日, 18 5月 2025 19:47:46 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx | 80 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 80 insertions(+), 0 deletions(-) diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx new file mode 100644 index 0000000..0d03f55 --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/PipeAccessoryAssembly.tsx @@ -0,0 +1,80 @@ +import { + Component, + DefineComponent, + defineComponent, + markRaw, + ref, + SetupContext, + onMounted, +} from 'vue' +import styles from './PipeAccessoryAssembly.module.scss' +import Tab from '@/components/Tab/Tab' +import { useProvideModels } from '@/libs/Provider/app' +import { usePermission } from '@/libs/Permission/Permission' +import { permissionCodes } from '../enum' +import { ModuleType, TabItem } from '../type/Type' +import { getEntityNames } from '@/hooks/hook' +import TabPane from '@/components/Tab/TabPane' + +const Models: ModuleType = import.meta.glob('./config/*.json', { + eager: true, +}) + +const entityNames = getEntityNames(Models) + +const nameToLabelMap = [{ name: 'PipeAccessoryAssembly', label: '绠¢檮浠惰閰�' }] + +export default defineComponent({ + name: 'PipeAccessoryAssembly', + + setup(props, ctx: SetupContext) { + useProvideModels() + usePermission(props, permissionCodes) + + const rf = ref<{ + [key: string]: any + }>({}) + + const tabData = ref<TabItem[]>([]) + + const onTabChange = (v: string) => { + rf.value?.[v]?.reloadList() + } + + const initTableData = async () => { + for (const i in entityNames) { + const name = entityNames[i] + const module = await import(`./Pages/${name}/${name}.tsx`) + const PipeAccessoryAssembly = markRaw(module.default) + const foundLabel = + nameToLabelMap.find((item) => item.name === name)?.label || name + tabData.value.push({ + label: foundLabel, + name, + component: PipeAccessoryAssembly, + }) + } + } + + initTableData() + + return () => { + return ( + <div class={styles.PipeAccessoryAssembly}> + <Tab data={tabData.value} type="list" onTab={onTabChange}> + {tabData.value.map((widgetInfo) => { + const Widget: any = widgetInfo.component + return ( + <TabPane label={widgetInfo.label} name={widgetInfo.name}> + <Widget + ref={(r: any) => (rf.value['PipeAccessoryAssembly'] = r)} + ></Widget> + </TabPane> + ) + })} + </Tab> + </div> + ) + } + }, +}) -- Gitblit v1.9.3