From 3aedad63dd01f1fc5154cb520af32edab967d6e0 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周一, 12 5月 2025 09:15:26 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
---
PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/WorkPlan.tsx | 80 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/WorkPlan.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/WorkPlan.tsx
new file mode 100644
index 0000000..6b30caa
--- /dev/null
+++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/WorkPlan.tsx
@@ -0,0 +1,80 @@
+import {
+ Component,
+ DefineComponent,
+ defineComponent,
+ markRaw,
+ ref,
+ SetupContext,
+ onMounted,
+} from 'vue'
+import styles from './WorkPlan.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: 'WorkPlan', label: '浣滀笟璁″垝' }]
+
+export default defineComponent({
+ name: 'WorkPlan',
+
+ 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 WorkPlan = markRaw(module.default)
+ const foundLabel =
+ nameToLabelMap.find((item) => item.name === name)?.label || name
+ tabData.value.push({
+ label: foundLabel,
+ name,
+ component: WorkPlan,
+ })
+ }
+ }
+
+ initTableData()
+
+ return () => {
+ return (
+ <div class={styles.WorkPlan}>
+ <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['WorkPlan'] = r)}
+ ></Widget>
+ </TabPane>
+ )
+ })}
+ </Tab>
+ </div>
+ )
+ }
+ },
+})
--
Gitblit v1.9.3