提交 310672bf authored 作者: 钟是志's avatar 钟是志

30839 合并菜单栏,每个模块的申请菜单做合并处理:菜单栏名字:三好学生申请

上级 15f1b815
......@@ -14,6 +14,8 @@ import { connect } from 'dva';
import router from 'umi/router';
import { getIsQian_Nan } from '@/webPublic/zyd_public/utils/getSchoolType';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
import ApplyMerage from '@/webPublic/FormInsertDiy/ExportComponent/ApplyMerage';
import AuditMerage from '@/webPublic/FormInsertDiy/ExportComponent/AuditMerage';
export const CreateC = createContext({
routerConfig: {},
......@@ -75,6 +77,9 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
}
Res = <Apply workId={appId} {...otherProps} />;
break;
case 'ApplyMerage': // 申请页面聚合 多个流程的申请页面放在一起
Res = <ApplyMerage {...otherProps} routerConfig={routerConfig}/>;
break;
case 'Audit': // 审批类
Res = <Audit workId={appId} {...otherProps} />;
break;
......@@ -98,6 +103,9 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
}
Res = <BatchAudit workId={appId} {...otherProps} />;
break;
case 'AuditMerage': // 审核页面聚合 多个流程的审核页面放在一起
Res = <AuditMerage {...otherProps} routerConfig={routerConfig}/>;
break;
case 'Detail': // 详情
Res = <Detail {...otherProps} />;
break;
......
import React, { useState, useEffect } from 'react';
import { Tabs } from 'antd';
const TabPane = Tabs.TabPane;
import Apply from '@/webPublic/FormInsertDiy/AffairPage/ApplyPage';
import { isJSON } from '@/webPublic/one_stop_public/copy'; // 申请
export default function ApplyMerage(props) {
let settingJson = isJSON(props.routerConfig?.settingJson) ? JSON.parse(props.routerConfig?.settingJson) : [];
if(!settingJson || !Array.isArray(settingJson)){
console.log('settingJson 不是一个数组 无法渲染!');
return null;
}
const [activeKey, setActiveKey] = useState(settingJson[0].appId);
const changeActiveKey = (a) => {
setActiveKey(a);
};
useEffect(() => {
}, []);
if (!activeKey) {
return null;
}
return (
<Tabs activeKey={activeKey}
hideAdd={true}
style={{backgroundColor:'#fff'}}
onChange={changeActiveKey}
>
{
settingJson.map((g) => {
return (<TabPane tab={g.name} key={g.appId}>
{
activeKey === g.appId ?
<Apply workId={g.appId}
{...props}
/> : null
}
</TabPane>);
})
}
</Tabs>
);
}
import React, { useState, useEffect } from 'react';
import { Tabs } from 'antd';
const TabPane = Tabs.TabPane;
import BatchAudit from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/BatchAudit'; // 批量审批
import Audit from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/index.js'; // 审批
import { isJSON } from '@/webPublic/one_stop_public/copy'; // 申请
export default function AuditMerage(props) {
let settingJson = isJSON(props.routerConfig?.settingJson) ? JSON.parse(props.routerConfig?.settingJson) : [];
if(!Array.isArray(settingJson) || !settingJson.length){
console.log('settingJson 不是一个数组 无法渲染!');
return null;
}
console.log(settingJson);
const [activeKey, setActiveKey] = useState(settingJson[0].appId);
const changeActiveKey = (a) => {
setActiveKey(a);
};
useEffect(() => {
}, []);
if (!activeKey) {
return null;
}
console.log(settingJson);
return (
<Tabs activeKey={activeKey}
hideAdd={true}
style={{backgroundColor:'#fff'}}
onChange={changeActiveKey}
>
{
settingJson.map((g) => {
const Component = g.type === 'BatchAudit' ? BatchAudit : Audit;
return (<TabPane tab={g.name} key={g.appId}>
{
activeKey === g.appId ?
<Component workId={g.appId}
{...props}
/> : null
}
</TabPane>);
})
}
</Tabs>
);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论