xielei 2024-09-23 09:43:24 +08:00
commit 9da19e6321
2 changed files with 193 additions and 164 deletions

View File

@ -175,176 +175,205 @@ export function loadRole(data:any) {
export async function loadMenu(): Promise<MenuItem[]> { export async function loadMenu(): Promise<MenuItem[]> {
await wait(200) // await wait(200)
const { code, data } = await xyt_httpget2(apiurl.xytlogin.role) // const { code, data } = await xyt_httpget2(apiurl.xytlogin.role)
if( code!== 200){ // if( code!== 200){
message.error('获取用户权限失败') // message.error('获取用户权限失败')
return [] // return []
} // }
//获取到菜单后遍历 // //获取到菜单后遍历
// const id = idgen()
// // handelTreeData(data,id)
// const tree = buildTree(data,0)
// const tree2 = tree?.filter((item:any) =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3"))
// handelTreeData(tree2,id)
// return tree2
const id = idgen() const id = idgen()
// handelTreeData(data,id) return [
{ id: id(), title: '水库一张图', path: '/mgr/home', icon: 'jbqk' },
{ id: id(), title: '四预', redirect: '/mgr/sy/fhxzfx', icon: 'fxzb',
children: [
{ id: id(), title: '防洪形势', path: '/mgr/sy/fhxzfx'},
// { id: id(), title: '天气预报', path: '/mgr/fxzb/tqyb'},
// {
// id: id(), title: '洪水预报', redirect: '/mgr/fxzb/hsyb/hyybjs',
// children: [
// { id: id(), title: '洪水预报计算', path: '/mgr/fxzb/hsyb/hyybjs' },
// { id: id(), title: '预报方案管理', path: '/mgr/fxzb/hsyb/ybfagl' },
// { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' },
// ]
// },
// { id: id(), title: '调度规程', path: '/mgr/fxzb/ddgc'},
// { id: id(), title: '防汛预案', path: '/mgr/fxzb/fxya'},
// {
// id: id(),
// title: '抢险物料',
// path: '/mgr/fxzb/qxwl',
// },
// {
// id: id(),
// title: '抢险队伍',
// path: '/mgr/fxzb/qxdw',
// },
],
},
const tree = buildTree(data,0) // { id: id(), title: '基本2情况', path: '/mgr/home', icon: 'jbqk' },
const tree2 = tree?.filter((item:any) =>(item.menuId != "1" && item.menuId != "2" && item.menuId != "3")) // {
handelTreeData(tree2,id) // id: id(),
// title: '防汛调度',
return tree2 // redirect: '/mgr/fxzb/fhxs',
// icon: 'fxzb',
// return [ // children: [
// { id: id(), title: '基本情况', path: '/mgr/home', icon: 'jbqk' }, // { id: id(), title: '防洪形势', path: '/mgr/fxzb/fhxs'},
// { // { id: id(), title: '天气预报', path: '/mgr/fxzb/tqyb'},
// id: id(), // {
// title: '防汛调度', // id: id(), title: '洪水预报', redirect: '/mgr/fxzb/hsyb/hyybjs',
// redirect: '/mgr/fxzb/fhxs', // children: [
// icon: 'fxzb', // { id: id(), title: '洪水预报计算', path: '/mgr/fxzb/hsyb/hyybjs' },
// children: [ // { id: id(), title: '预报方案管理', path: '/mgr/fxzb/hsyb/ybfagl' },
// { id: id(), title: '防洪形势', path: '/mgr/fxzb/fhxs'}, // { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' },
// { id: id(), title: '天气预报', path: '/mgr/fxzb/tqyb'}, // ]
// { // },
// id: id(), title: '洪水预报', redirect: '/mgr/fxzb/hsyb/hyybjs', // { id: id(), title: '调度规程', path: '/mgr/fxzb/ddgc'},
// children: [ // { id: id(), title: '防汛预案', path: '/mgr/fxzb/fxya'},
// { id: id(), title: '洪水预报计算', path: '/mgr/fxzb/hsyb/hyybjs' }, // {
// { id: id(), title: '预报方案管理', path: '/mgr/fxzb/hsyb/ybfagl' }, // id: id(),
// { id: id(), title: '参数管理', path: '/mgr/fxzb/hsyb/csgl' }, // title: '抢险物料',
// ] // path: '/mgr/fxzb/qxwl',
// }, // },
// { id: id(), title: '调度规程', path: '/mgr/fxzb/ddgc'}, // {
// { id: id(), title: '防汛预案', path: '/mgr/fxzb/fxya'}, // id: id(),
// { // title: '抢险队伍',
// id: id(), // path: '/mgr/fxzb/qxdw',
// title: '抢险物料', // },
// path: '/mgr/fxzb/qxwl', // ],
// }, // },
// { // {
// id: id(), // id: id(),
// title: '抢险队伍', // title: '工程安全监测',
// path: '/mgr/fxzb/qxdw', // redirect: '/mgr/gcaqjc/gcaqyj/bzt',
// }, // icon: 'fxzb',
// ], // children: [
// }, // { id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt' },
// { // {
// id: id(), // id: id(), title: '工程安全预警', redirect: '/mgr/gcaqjc/gcaqyj/yhyj',
// title: '工程安全监测', // children: [
// redirect: '/mgr/gcaqjc/gcaqyj/bzt', // { id: id(), title: '隐患预警', path: '/mgr/gcaqjc/gcaqyj/yhyj' },
// icon: 'fxzb', // { id: id(), title: '预警规则配置', path: '/mgr/gcaqjc/gcaqyj/yjgzpz' },
// children: [
// { id: id(), title: '布置图', path: '/mgr/gcaqjc/gcaqyj/bzt' },
// {
// id: id(), title: '工程安全预警', redirect: '/mgr/gcaqjc/gcaqyj/yhyj',
// children: [
// { id: id(), title: '隐患预警', path: '/mgr/gcaqjc/gcaqyj/yhyj' },
// { id: id(), title: '预警规则配置', path: '/mgr/gcaqjc/gcaqyj/yjgzpz' },
// ] // ]
// }, // },
// { // {
// id: id(), title: '工程安全分析', redirect: '/mgr/gcaqjc/gcaqfx/jrx', // id: id(), title: '工程安全分析', redirect: '/mgr/gcaqjc/gcaqfx/jrx',
// children: [ // children: [
// { id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx' }, // { id: id(), title: '浸润线', path: '/mgr/gcaqjc/gcaqfx/jrx' },
// ] // ]
// }, // },
// { // {
// id: id(), title: '数据统计查询', redirect: '/mgr/gcaqjc/sjtjcx/sljx', // id: id(), title: '数据统计查询', redirect: '/mgr/gcaqjc/sjtjcx/sljx',
// children: [ // children: [
// { id: id(), title: '测值查询', path: '/mgr/gcaqjc/sjtjcx/czcx' }, // { id: id(), title: '测值查询', path: '/mgr/gcaqjc/sjtjcx/czcx' },
// { id: id(), title: '渗压监测', path: '/mgr/gcaqjc/sjtjcx/syjx' }, // { id: id(), title: '渗压监测', path: '/mgr/gcaqjc/sjtjcx/syjx' },
// { id: id(), title: '渗流监测', path: '/mgr/gcaqjc/sjtjcx/sljx' }, // { id: id(), title: '渗流监测', path: '/mgr/gcaqjc/sjtjcx/sljx' },
// { id: id(), title: '位移监测', path: '/mgr/gcaqjc/sjtjcx/wyjx' }, // { id: id(), title: '位移监测', path: '/mgr/gcaqjc/sjtjcx/wyjx' },
// { id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' }, // { id: id(), title: '年度渗压统计表', path: '/mgr/gcaqjc/sjtjcx/ndsytjb' },
// { id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' }, // { id: id(), title: '年度渗流统计表', path: '/mgr/gcaqjc/sjtjcx/ndsltjb' },
// { id: id(), title: '年度位移统计表', path: '/mgr/gcaqjc/sjtjcx/ndwytjb' }, // { id: id(), title: '年度位移统计表', path: '/mgr/gcaqjc/sjtjcx/ndwytjb' },
// ] // ]
// }, // },
// ], // ],
// }, // },
// { // {
// id: id(), // id: id(),
// title: '日常管理', // title: '日常管理',
// redirect: '/mgr/rcgl/gcdsj', // redirect: '/mgr/rcgl/gcdsj',
// icon: 'fxzb', // icon: 'fxzb',
// children: [ // children: [
// { // {
// id: id(), // id: id(),
// title: '工程大事件', // title: '工程大事件',
// path: '/mgr/rcgl/gcdsj', // path: '/mgr/rcgl/gcdsj',
// }, // },
// { // {
// id: id(), title: '值班管理', redirect: '/mgr/rcgl/zbgl/zbb', // id: id(), title: '值班管理', redirect: '/mgr/rcgl/zbgl/zbb',
// children: [ // children: [
// { id: id(), title: '值班表', path: '/mgr/rcgl/zbgl/zbb' }, // { id: id(), title: '值班表', path: '/mgr/rcgl/zbgl/zbb' },
// { id: id(), title: '值班日志', path: '/mgr/rcgl/zbgl/zbrz' }, // { id: id(), title: '值班日志', path: '/mgr/rcgl/zbgl/zbrz' },
// ] // ]
// }, // },
// { // {
// id: id(), // id: id(),
// title: '水质整编', // title: '水质整编',
// path: '/mgr/rcgl/szzb', // path: '/mgr/rcgl/szzb',
// }, // },
// { // {
// id: id(), // id: id(),
// title: '生态流量监控', // title: '生态流量监控',
// path: '/mgr/rcgl/stlljc', // path: '/mgr/rcgl/stlljc',
// }, // },
// ], // ],
// }, { // }, {
// id: id(), // id: id(),
// title: '供水兴利', // title: '供水兴利',
// redirect: '/mgr/gsxl/zfzl', // redirect: '/mgr/gsxl/zfzl',
// icon: 'fxzb', // icon: 'fxzb',
// children: [ // children: [
// { // {
// id: id(), // id: id(),
// title: '闸阀总览', // title: '闸阀总览',
// path: '/mgr/gsxl/zfzl', // path: '/mgr/gsxl/zfzl',
// }, // },
// { // {
// id: id(), // id: id(),
// title: '闸阀监控', // title: '闸阀监控',
// path: '/mgr/gsxl/zfjk', // path: '/mgr/gsxl/zfjk',
// }, // },
// { // {
// id: id(), // id: id(),
// title: '供水统计分析', // title: '供水统计分析',
// path: '/mgr/gsxl/gstjfx', // path: '/mgr/gsxl/gstjfx',
// }, // },
// { // {
// id: id(), // id: id(),
// title: '典型年降雨资料', // title: '典型年降雨资料',
// path: '/mgr/gsxl/dxnjyzl', // path: '/mgr/gsxl/dxnjyzl',
// }, // },
// ], // ],
// }, // },
// { // {
// id: id(), // id: id(),
// title: '视频监控', // title: '视频监控',
// redirect: '/mgr/spjk/spjk', // redirect: '/mgr/spjk/spjk',
// icon: 'spjk', // icon: 'spjk',
// children: [ // children: [
// { // {
// id: id(), // id: id(),
// title: '视频监控', // title: '视频监控',
// path: '/mgr/spjk/spjk', // path: '/mgr/spjk/spjk',
// }, // },
// { // {
// id: id(), // id: id(),
// title: 'AI告警', // title: 'AI告警',
// path: '/mgr/spjk/aiWarn', // path: '/mgr/spjk/aiWarn',
// }, // },
// ], // ],
// }, // },
// { // {
// id: id(), // id: id(),
// title: '数字孪生大屏', // title: '数字孪生大屏',
// path: '/', // path: '/',
// icon: 'spjk' // icon: 'spjk'
// }, // },
// ] ]
} }
export function defaultHomePage() { export function defaultHomePage() {

View File

@ -109,7 +109,7 @@ const AppRouters: React.FC = () => {
{ path: 'home', element: <HomePage /> }, { path: 'home', element: <HomePage /> },
// 防汛调度 // 防汛调度
{ path: 'fxzb/fhxs', element: <HomePage /> }, { path: 'sy/fhxzfx', element: <HomePage /> },
{ path: 'fxzb/tqyb', element: <HomePage /> }, { path: 'fxzb/tqyb', element: <HomePage /> },
//洪水预报 //洪水预报
{ path: 'fxzb/hsyb/hyybjs', element: <Hsybjs /> }, { path: 'fxzb/hsyb/hyybjs', element: <Hsybjs /> },