|  | @ -10,9 +10,13 @@ import { resize } from '../../actions/global'; | 
			
		
	
		
		
			
				
					|  |  | import * as NProgress from 'nprogress'; |  |  | import * as NProgress from 'nprogress'; | 
			
		
	
		
		
			
				
					|  |  | import PerfectScrollbar from 'perfect-scrollbar'; |  |  | import PerfectScrollbar from 'perfect-scrollbar'; | 
			
		
	
		
		
			
				
					|  |  | import { useLocation } from "react-router"; |  |  | import { useLocation } from "react-router"; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { RouteTable } from '$utils'; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { RouteRequest } from '@peace/utils'; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import Cookie from 'js-cookie'; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { login, LOGIN_SUCCESS } from '../../../sections/auth/actions/auth'; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | NProgress.configure({ |  |  | NProgress.configure({ | 
			
		
	
		
		
			
				
					
					|  |  |     template: ` |  |  |    template: ` | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |     <div class="bar" style="height:2px" role="bar"> |  |  |     <div class="bar" style="height:2px" role="bar"> | 
			
		
	
		
		
			
				
					|  |  |         <div class="peg"></div> |  |  |         <div class="peg"></div> | 
			
		
	
		
		
			
				
					|  |  |     </div> |  |  |     </div> | 
			
		
	
	
		
		
			
				
					|  | @ -23,303 +27,354 @@ NProgress.configure({ | 
			
		
	
		
		
			
				
					|  |  | }); |  |  | }); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | let scrollbar |  |  | let scrollbar | 
			
		
	
		
		
			
				
					|  |  |  |  |  | let requestUser = true | 
			
		
	
		
		
			
				
					|  |  |  |  |  | let requestlogout = false; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | // const location111 = useLocation(); |  |  | // const location111 = useLocation(); | 
			
		
	
		
		
			
				
					|  |  | const LayoutContainer = props => { |  |  | const LayoutContainer = props => { | 
			
		
	
		
		
			
				
					
					|  |  |     const { |  |  |    const { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         dispatch, msg, user, copyright, children, sections, clientWidth, clientHeight, |  |  |       dispatch,actions, msg, user, copyright, children, sections, clientWidth, clientHeight, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         location, match, routes, history, socket, |  |  |       location, match, routes, history, socket, apiRoot | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     } = props |  |  |    } = props | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const [collapsed, setCollapsed] = useState(false) |  |  |    const [collapsed, setCollapsed] = useState(false) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     NProgress.start(); |  |  |    NProgress.start(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     const resize_ = () => { |  |  |    const resize_ = () => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         dispatch(resize( |  |  |       dispatch(resize( | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             document.getElementById('DrApp').clientHeight, |  |  |          document.getElementById('DrApp').clientHeight, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             document.getElementById('DrApp').clientWidth - (collapsed ? 120 : 240) |  |  |          document.getElementById('DrApp').clientWidth - (collapsed ? 120 : 240) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         )); |  |  |       )); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     } |  |  |    } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     function deepCopy(data) {//深拷贝 |  |  |    function deepCopy (data) {//深拷贝 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         //string,number,bool,null,undefined,symbol |  |  |       //string,number,bool,null,undefined,symbol | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         //object,array,date |  |  |       //object,array,date | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if (data && typeof data === "object") { |  |  |       if (data && typeof data === "object") { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             //针对函数的拷贝 |  |  |          //针对函数的拷贝 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (typeof data === "function") { |  |  |          if (typeof data === "function") { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 let tempFunc = data.bind(null); |  |  |             let tempFunc = data.bind(null); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 tempFunc.prototype = deepCopy(data.prototype); |  |  |             tempFunc.prototype = deepCopy(data.prototype); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 return tempFunc; |  |  |             return tempFunc; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } |  |  |          } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |             switch (Object.prototype.toString.call(data)) { |  |  |          switch (Object.prototype.toString.call(data)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object String]": |  |  |             case "[object String]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return data.toString(); |  |  |                return data.toString(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object Number]": |  |  |             case "[object Number]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return Number(data.toString()); |  |  |                return Number(data.toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object Boolean]": |  |  |             case "[object Boolean]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return new Boolean(data.toString()); |  |  |                return new Boolean(data.toString()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object Date]": |  |  |             case "[object Date]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return new Date(data.getTime()); |  |  |                return new Date(data.getTime()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object Array]": |  |  |             case "[object Array]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     var arr = []; |  |  |                var arr = []; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     for (let i = 0; i < data.length; i++) { |  |  |                for (let i = 0; i < data.length; i++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         arr[i] = deepCopy(data[i]); |  |  |                   arr[i] = deepCopy(data[i]); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     } |  |  |                } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return arr; |  |  |                return arr; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                 //js自带对象或用户自定义类实例 |  |  |             //js自带对象或用户自定义类实例 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 case "[object Object]": |  |  |             case "[object Object]": | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     var obj = {}; |  |  |                var obj = {}; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     for (let key in data) { |  |  |                for (let key in data) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         //会遍历原型链上的属性方法,可以用hasOwnProperty来控制 (obj.hasOwnProperty(prop) |  |  |                   //会遍历原型链上的属性方法,可以用hasOwnProperty来控制 (obj.hasOwnProperty(prop) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         obj[key] = deepCopy(data[key]); |  |  |                   obj[key] = deepCopy(data[key]); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     } |  |  |                } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     return obj; |  |  |                return obj; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } else { |  |  |       } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             //string,number,bool,null,undefined,symbol |  |  |          //string,number,bool,null,undefined,symbol | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             return data; |  |  |          return data; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     } |  |  |    } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const [allItems, setAllItems] = useState([]) |  |  |    const [allItems, setAllItems] = useState([]) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     // const [headerItems, setHeaderItems] = useState([]) |  |  |    // const [headerItems, setHeaderItems] = useState([]) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const [leftItems, setLeftItems] = useState([]) |  |  |    const [leftItems, setLeftItems] = useState([]) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const [leftChange, setLeftChange] = useState(true) |  |  |    const [leftChange, setLeftChange] = useState(true) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const [leftShow, setLeftShow] = useState(false) |  |  |    const [leftShow, setLeftShow] = useState(false) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     useEffect(() => { |  |  |    useEffect(() => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         let topItems = []//头部导航 |  |  |       let topItems = []//头部导航 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         const lastSelectedKeys = localStorage.getItem('poms_selected_sider') |  |  |       const lastSelectedKeys = localStorage.getItem('poms_selected_sider') | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         let nextItems = []//所有导航 |  |  |       let nextItems = []//所有导航 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         for (let c of sections) { |  |  |       for (let c of sections) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (typeof c.getNavItem == 'function') { |  |  |          if (typeof c.getNavItem == 'function') { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 let item = c.getNavItem(user, dispatch); |  |  |             let item = c.getNavItem(user, dispatch); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 if (item) { |  |  |             if (item) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     nextItems.push.apply(nextItems, item) |  |  |                nextItems.push.apply(nextItems, item) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     if (item.length > 0) { |  |  |                if (item.length > 0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         for (let j = 0; j < item.length; j++) { |  |  |                   for (let j = 0; j < item.length; j++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             let itm = deepCopy(item[j]); |  |  |                      let itm = deepCopy(item[j]); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             if (itm.hasOwnProperty('items')) { |  |  |                      if (itm.hasOwnProperty('items')) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                 for (let i = 0; i < itm.items.length; i++) { |  |  |                         for (let i = 0; i < itm.items.length; i++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     itm.items[i].fatherKey = itm.itemKey |  |  |                            itm.items[i].fatherKey = itm.itemKey | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     delete itm.items[i].items |  |  |                            delete itm.items[i].items | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 //     topItems.push(itm) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 // } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 // else { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 //     topItems.push.apply(topItems, item) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             } |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                         } |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |                     } |  |  |                         //     topItems.push(itm) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 } |  |  |                         // } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                         // else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         //     topItems.push.apply(topItems, item) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         setAllItems(nextItems) |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         // setHeaderItems(topItems) |  |  |       setAllItems(nextItems) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if (lastSelectedKeys) {//如果有缓存 |  |  |       // setHeaderItems(topItems) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             for (let i = 0; i < nextItems.length; i++) { |  |  |       if (lastSelectedKeys) {//如果有缓存 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 if (JSON.parse(lastSelectedKeys)[0] == nextItems[i].itemKey) { |  |  |          for (let i = 0; i < nextItems.length; i++) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             if (JSON.parse(lastSelectedKeys)[0] == nextItems[i].itemKey) { | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                     // let openArr = [] |  |  |                // let openArr = [] | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     // for (let j = 0; j < nextItems[i].items.length; j++) { |  |  |                // for (let j = 0; j < nextItems[i].items.length; j++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     //     openArr.push(nextItems[i].items[j].itemKey) |  |  |                //     openArr.push(nextItems[i].items[j].itemKey) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     // } |  |  |                // } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     // localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) |  |  |                // localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     setLeftItems(nextItems[i].items) |  |  |                setLeftItems(nextItems[i].items) | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                 } |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |             setLeftShow(true) |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          setLeftShow(true) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         else { |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             setLeftShow(false) |  |  |       else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          setLeftShow(false) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |         window.addEventListener('resize', resize_); |  |  |       window.addEventListener('resize', resize_); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         return () => { |  |  |       return () => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             window.removeEventListener('resize', resize_); |  |  |          window.removeEventListener('resize', resize_); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     }, []) |  |  |    }, []) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     useEffect(() => { |  |  |    useEffect(() => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         let pathnameArr = location.pathname.split('/') |  |  |       let pathnameArr = location.pathname.split('/') | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         let openArr = [] |  |  |       let openArr = [] | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         for (let i = 0; i < allItems.length; i++) { |  |  |       for (let i = 0; i < allItems.length; i++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (allItems[i].items) { |  |  |          if (allItems[i].items) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 for (let j = 0; j < allItems[i].items.length; j++) { |  |  |             for (let j = 0; j < allItems[i].items.length; j++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     if (allItems[i].items[j].items) { |  |  |                if (allItems[i].items[j].items) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         for (let k = 0; k < allItems[i].items[j].items.length; k++) { |  |  |                   for (let k = 0; k < allItems[i].items[j].items.length; k++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             if (allItems[i].items[j].items[k].to == location.pathname) { |  |  |                      if (allItems[i].items[j].items[k].to == location.pathname) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                 for (let o = 0; o < allItems[i].items.length; o++) { |  |  |                         for (let o = 0; o < allItems[i].items.length; o++) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     openArr.push(allItems[i].items[o].itemKey) |  |  |                            openArr.push(allItems[i].items[o].itemKey) | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 localStorage.setItem('poms_selected_sider', JSON.stringify([pathnameArr[1]])) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 // localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 setLeftItems(allItems[i].items) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 setLeftShow(true) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             } |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                         } |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |                     } |  |  |                         localStorage.setItem('poms_selected_sider', JSON.stringify([pathnameArr[1]])) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 } |  |  |                         // localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                         setLeftItems(allItems[i].items) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         setLeftShow(true) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     }, [location]) |  |  |       } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |    }, [location]) | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     useEffect(() => { |  |  |    useEffect(() => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         NProgress.done(); |  |  |       NProgress.done(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if ((!user || !user.authorized)) { |  |  |       if ((!user || !user.authorized)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             history.push('/signin'); |  |  |          // history.push('/signin'); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          getUserInfoByToken() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if (msg) { |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (msg.done) { |  |  |       if (msg) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 Notification.success({ |  |  |          if (msg.done) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     // title: msg.done, |  |  |             Notification.success({ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     content: msg.done, |  |  |                // title: msg.done, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     duration: 2, |  |  |                content: msg.done, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 }) |  |  |                duration: 2, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } |  |  |             }) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (msg.error) { |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 Notification.error({ |  |  |          if (msg.error) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     // title: msg.error, |  |  |             Notification.error({ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     content: msg.error, |  |  |                // title: msg.error, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     duration: 2, |  |  |                content: msg.error, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 }) |  |  |                duration: 2, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } |  |  |             }) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         const dom = document.getElementById('page-content'); |  |  |       } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if (dom) { |  |  |       const dom = document.getElementById('page-content'); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             if (!scrollbar) { |  |  |       if (dom) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 scrollbar = new PerfectScrollbar('#page-content', { suppressScrollX: true }); |  |  |          if (!scrollbar) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 scrollbar.update(); |  |  |             scrollbar = new PerfectScrollbar('#page-content', { suppressScrollX: true }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } else { |  |  |             scrollbar.update(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 scrollbar.update(); |  |  |          } else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 dom.scrollTop = 0; |  |  |             scrollbar.update(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             } |  |  |             dom.scrollTop = 0; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     }) |  |  |       } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |    }) | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    const getUserInfoByToken = () => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       if (requestUser) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          requestUser = false; | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          console.log(RouteTable.apiRoot); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          RouteRequest.get(RouteTable.apiRoot).then(res => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             let token = Cookie.get('pepToken', { domain: res.domain }); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             console.log(token); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             dispatch(login({ token })).then(res => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                console.log(res); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                if (res.type == 'LOGIN_SUCCESS') { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   const data = res.payload?.user || {} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   history.push('/businessManagement/pmReport/reserveItemsReporting') | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   localStorage.setItem('poms_open_sider', JSON.stringify(["pmReport"])) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   localStorage.setItem('poms_selected_sider', JSON.stringify(["businessManagement"])) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   localStorage.setItem('word', JSON.stringify(''))  //系统登录代码时候存的,不清楚意义 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   dispatch(actions.layout.initWebSocket({ ioUrl: apiRoot, token: data.token, hrUserId: data.hrUserInfo && hrUserInfo.id })) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                } else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   redirectToLogin(true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }, error => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                redirectToLogin(true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             }) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          }, error => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             message.error('鉴权失败', 5); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             redirectToLogin(true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          }) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     // websocket 使用测试 |  |  |    const redirectToLogin = (toLogin = false) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     useEffect(() => { |  |  |       //重定位至大平台的登录页 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         //   console.log(socket) |  |  |       if (!requestlogout) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         if (socket) { |  |  |          requestlogout = true;//目的执行一遍。退出登录后,redirectToLogin执行两遍,注释window.location.href,可message.warning验证 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             socket.on('CAMERA_ONLINE', function (msg) { |  |  |          RouteRequest.get(RouteTable.getPepWebUrl).then(res => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 console.info(msg); |  |  |             if (res.url) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 if (msg.online == 'ON') { |  |  |                if (toLogin) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     Notification.success({ |  |  |                   window.location.href = `${res.url}/signin`; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         title: 'Hi', |  |  |                } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         content: (<div><div>{msg.name}</div><div style={{ marginTop: 5 }}>已上线。</div></div>), |  |  |                else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         duration: 2, |  |  |                   window.location.href = `${res.url}/signin?isLogout=true`; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     }) |  |  |                } | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 if (msg.online == 'OFF') { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                     Notification.error({ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         title: 'Hi', |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         content: (<div><div>{msg.name}</div><div style={{ marginTop: 5 }}>发生离线。</div></div>), |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         duration: 2, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                     }) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             }); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |             return () => { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 socket.off("CAMERA_ONLINE"); |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |         } |  |  |          }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     }, [socket]) |  |  |       } | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |    } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |     return ( |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         <Layout id="layout" style={{ height: '100%' }}> |  |  |    // websocket 使用测试 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |             { |  |  |    useEffect(() => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 <> |  |  |       //   console.log(socket) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                     <Layout.Header> |  |  |       if (socket) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                         <Header |  |  |          socket.on('CAMERA_ONLINE', function (msg) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             // headerItems={headerItems} //菜单重新分类规整 |  |  |             console.info(msg); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             user={user} |  |  |             if (msg.online == 'ON') { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             pathname={location.pathname} |  |  |                Notification.success({ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             toggleCollapsed={() => { |  |  |                   title: 'Hi', | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                 setCollapsed(!collapsed); |  |  |                   content: (<div><div>{msg.name}</div><div style={{ marginTop: 5 }}>已上线。</div></div>), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             }} |  |  |                   duration: 2, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             collapsed={collapsed} |  |  |                }) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             history={history} |  |  |             } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                             tochange={(val) => { |  |  |             if (msg.online == 'OFF') { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                 // setLeftChange(!leftChange)  //会导致顶部右上角转小圈 |  |  |                Notification.error({ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                 if (val.fatherKey) { |  |  |                   title: 'Hi', | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     localStorage.setItem('poms_selected_sider', JSON.stringify([val.itemKey])); |  |  |                   content: (<div><div>{msg.name}</div><div style={{ marginTop: 5 }}>发生离线。</div></div>), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     const historyOpenKeys = localStorage.getItem('poms_open_sider'); |  |  |                   duration: 2, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                                     const openKeys = historyOpenKeys && JSON.parse(historyOpenKeys).concat(val.openKey || val.itemKey) || [val.openKey || val.itemKey] |  |  |                }) | 
			
				
				
			
		
	
		
		
			
				
					|  |  |                                     localStorage.setItem('poms_open_sider', JSON.stringify(openKeys)); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     // for (let i = 0; i < allItems.length; i++) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //     if (val.fatherKey == allItems[i].itemKey) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         let openArr = [] |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         for (let j = 0; j < allItems[i].items.length; j++) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //             openArr.push(allItems[i].items[j].itemKey) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         localStorage.setItem('poms_selected_sider', JSON.stringify([val.fatherKey])) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //         setLeftItems(allItems[i].items) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     //     } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     // } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     // setLeftShow(true) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 else { |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     localStorage.setItem('poms_open_sider', JSON.stringify([])) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     localStorage.removeItem('poms_selected_sider') |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     // setLeftShow(false) |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 } |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 history.push(val.to); |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             }} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         /> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                     </Layout.Header> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                     <Layout style={{ height: 'calc(100% - 50px)' }}> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         {leftShow ? (<Layout.Sider> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             <Sider |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 sections={sections} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 leftItems={leftItems} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 dispatch={dispatch} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 user={user} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 leftChange={leftChange} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 pathname={location.pathname} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 collapsed={collapsed} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             /> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         </Layout.Sider>) : ('')} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         <Layout.Content> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             <div style={{ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 background: "#F2F3F5", |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             }}> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 <div id="page-content" style={{ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     height: clientHeight - 12, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     minWidth: 520, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     position: 'relative', |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 }}> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     <div style={{ |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                         minHeight: clientHeight - 32 - 12, |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                         position: 'relative', |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                         padding: '12px 8px', |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     }}> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                         {children} |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     </div> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     <Layout.Footer> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                         <Footer /> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                     </Layout.Footer> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                                 </div> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                             </div> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                         </Layout.Content> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                     </Layout> |  |  |  | 
			
		
	
		
		
			
				
					|  |  |                 </> |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |         </Layout > |  |  |          }); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     ) |  |  |          return () => { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             socket.off("CAMERA_ONLINE"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    }, [socket]) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    return ( | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       <Layout id="layout" style={{ height: '100%' }}> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             <> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                <Layout.Header> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   <Header | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      // headerItems={headerItems} //菜单重新分类规整 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      user={user} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      pathname={location.pathname} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      toggleCollapsed={() => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         setCollapsed(!collapsed); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      }} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      collapsed={collapsed} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      history={history} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      tochange={(val) => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         // setLeftChange(!leftChange)  //会导致顶部右上角转小圈 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         if (val.fatherKey) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            localStorage.setItem('poms_selected_sider', JSON.stringify([val.itemKey])); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            const historyOpenKeys = localStorage.getItem('poms_open_sider'); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            const openKeys = historyOpenKeys && JSON.parse(historyOpenKeys).concat(val.openKey || val.itemKey) || [val.openKey || val.itemKey] | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            localStorage.setItem('poms_open_sider', JSON.stringify(openKeys)); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            // for (let i = 0; i < allItems.length; i++) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //     if (val.fatherKey == allItems[i].itemKey) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         let openArr = [] | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         for (let j = 0; j < allItems[i].items.length; j++) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //             openArr.push(allItems[i].items[j].itemKey) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         localStorage.setItem('poms_selected_sider', JSON.stringify([val.fatherKey])) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         localStorage.setItem('poms_open_sider', JSON.stringify(openArr)) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //         setLeftItems(allItems[i].items) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            //     } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            // } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            // setLeftShow(true) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            localStorage.setItem('poms_open_sider', JSON.stringify([])) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            localStorage.removeItem('poms_selected_sider') | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            // setLeftShow(false) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         history.push(val.to); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      }} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   /> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                </Layout.Header> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                <Layout style={{ height: 'calc(100% - 50px)' }}> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   {leftShow ? (<Layout.Sider> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      <Sider | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         sections={sections} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         leftItems={leftItems} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         dispatch={dispatch} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         user={user} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         leftChange={leftChange} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         pathname={location.pathname} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         collapsed={collapsed} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      /> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   </Layout.Sider>) : ('')} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   <Layout.Content> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      <div style={{ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         background: "#F2F3F5", | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      }}> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         <div id="page-content" style={{ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            height: clientHeight - 12, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            minWidth: 520, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            position: 'relative', | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         }}> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            <div style={{ | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                               minHeight: clientHeight - 32 - 12, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                               position: 'relative', | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                               padding: '12px 8px', | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            }}> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                               {children} | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            </div> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            <Layout.Footer> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                               <Footer /> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                            </Layout.Footer> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                         </div> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                      </div> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                   </Layout.Content> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                </Layout> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             </> | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          } | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       </Layout > | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    ) | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | function mapStateToProps(state) { |  |  | function mapStateToProps (state) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     const { global, auth, ajaxResponse, webSocket } = state; |  |  |    const { global, auth, ajaxResponse, webSocket } = state; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     return { |  |  |    return { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         title: global.title, |  |  |       title: global.title, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         copyright: global.copyright, |  |  |       copyright: global.copyright, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         sections: global.sections, |  |  |       sections: global.sections, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         actions: global.actions, |  |  |       actions: global.actions, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         clientWidth: global.clientWidth, |  |  |       clientWidth: global.clientWidth, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         clientHeight: global.clientHeight, |  |  |       clientHeight: global.clientHeight, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         msg: ajaxResponse.msg, |  |  |       msg: ajaxResponse.msg, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         user: auth.user, |  |  |       user: auth.user, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |         socket: webSocket.socket |  |  |       socket: webSocket.socket, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |     }; |  |  |       apiRoot: global.apiRoot, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |    }; | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | export default connect(mapStateToProps)(LayoutContainer); |  |  | export default connect(mapStateToProps)(LayoutContainer); |