| | |
| | | activeMenu: null, |
| | | remain: 0, |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | |
| | | |
| | | sqlmap = null |
| | | btnmap = null |
| | | allMenus = [] |
| | | appMenus = {} |
| | | |
| | | // delete _val.controlField 删除按钮控制字段 |
| | | |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | |
| | | unablemenus: [], |
| | | loading: true |
| | | }) |
| | | |
| | | this.allMenus = [] |
| | | Api.getCloudConfig({func: 's_get_pc_menus', systemType: window.GLOB.sysType, debug: 'Y'}).then(result => { |
| | | if (result.status) { |
| | | let menulist = [] |
| | |
| | | fst.snd_menu.forEach(snd => { |
| | | if (snd.trd_menu) { |
| | | snd.trd_menu.forEach(trd => { |
| | | this.allMenus.push(trd.MenuID) |
| | | |
| | | if (trd.PageParam) { |
| | | let pass = false |
| | | try { |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | this.allMenus = [] |
| | | this.appMenus = {} |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | let applist = [] |
| | |
| | | app.status = true |
| | | app.menus = [] |
| | | |
| | | this.appMenus[app.ID] = [] |
| | | |
| | | result.menus.forEach(m => { |
| | | this.appMenus[app.ID].push(m.MenuID) |
| | | |
| | | if (m.menus_rolelist) { |
| | | try { |
| | | let pageParam = JSON.parse(window.decodeURIComponent(window.atob(m.menus_rolelist))) |
| | |
| | | if (m.type === 'navbar') return |
| | | } |
| | | delete m.menus_rolelist |
| | | m.$pid = app.ID |
| | | |
| | | app.menus.push(m) |
| | | }) |
| | |
| | | } |
| | | |
| | | getMenuParam = (menus) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus, stop } = this.state |
| | | const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus, stop } = this.state |
| | | |
| | | let menu = menus.shift() |
| | | |
| | |
| | | MenuID: menu.MenuID |
| | | } |
| | | |
| | | let appType = 'pc' |
| | | let appType = 'admin' |
| | | if (menu.kei_no) { |
| | | param.TypeCharOne = menu.kei_no |
| | | param.typename = menu.typename |
| | | param.lang = menu.lang |
| | | |
| | | appType = 'pc' |
| | | if (['pad', 'mob'].includes(menu.typename)) { |
| | | appType = 'mob' |
| | | } |
| | | |
| | | this.allMenus = this.appMenus[menu.$pid] || [] |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } else { |
| | | let sqls = [] |
| | | let btns = [] |
| | | let links = [] |
| | | |
| | | this.getAllSqls(config, appType, sqls, btns) |
| | | this.getAllSqls(config, appType, sqls, btns, links) |
| | | |
| | | if (links.length) { |
| | | links.forEach(item => { |
| | | window.mkInfo(menu.pName + ':' + item) |
| | | }) |
| | | this.setState({lacklinks: [...lacklinks, menu]}) |
| | | } |
| | | |
| | | if (sqls.length) { |
| | | let keys = sqls.map(item => item.uuid) |
| | |
| | | }) |
| | | } |
| | | |
| | | getAllSqls = (config, appType, sqls, btns) => { |
| | | getAllSqls = (config, appType, sqls, btns, links) => { |
| | | let filterComponent = (components, label = '') => { |
| | | components.forEach(item => { |
| | | item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') |
| | |
| | | getCols(col.subcols || []) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | |
| | | |
| | | sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', LText: item.submit.logLabel}) |
| | | } |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | } else if (['card', 'carousel', 'timeline'].includes(item.type)) { |
| | | item.subcards && item.subcards.forEach(card => { |
| | | if (card.setting.click === 'menu' && card.setting.menu) { |
| | | if (appType === 'admin') { |
| | | if (!Array.isArray(card.setting.menu)) { |
| | | links.push(item.$menuname) |
| | | } else { |
| | | let menuId = card.setting.menu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else { |
| | | if (typeof(card.setting.menu) !== 'string') { |
| | | links.push(item.$menuname) |
| | | } else if (!this.allMenus.includes(card.setting.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else if (card.setting.click === 'menus' && card.menus && card.menus.length > 0) { |
| | | if (appType === 'admin') { |
| | | card.menus.forEach(m => { |
| | | if (!m.MenuID || !this.allMenus.includes(m.MenuID)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } else { |
| | | card.menus.forEach(m => { |
| | | if (typeof(m.menu) !== 'string' || !this.allMenus.includes(m.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') return |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | |
| | | sqls.push({uuid: item.uuid + item.billOutBtn.type, type: 'button', LText: item.$menuname + '-' + item.billOutBtn.label}) |
| | | |
| | | sqls.push({uuid: item.uuid + 'billback', type: 'btnCallBack', LText: item.$menuname + '-' + item.billOutBtn.label + '(回调)'}) |
| | | } else if (item.type === 'menubar') { |
| | | item.subMenus.forEach(cell => { |
| | | if (cell.setting.type === 'menu') { |
| | | if (!this.allMenus.includes(cell.uuid)) { |
| | | links.push(item.$menuname + '-' + cell.setting.name) |
| | | } |
| | | } else if (cell.setting.type === 'linkmenu') { |
| | | if (!this.allMenus.includes(cell.setting.linkMenuId)) { |
| | | links.push(item.$menuname + '-' + cell.setting.name) |
| | | } |
| | | } |
| | | }) |
| | | } else if (item.type === 'login') { |
| | | if (!item.wrap.linkmenu || !this.allMenus.includes(item.wrap.linkmenu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } else if (item.type === 'topbar') { |
| | | if (item.wrap.menus) { |
| | | item.wrap.menus.forEach(m => { |
| | | if (!this.allMenus.includes(m.menu)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let resetElement = (item, cell) => { |
| | | if (cell.linkmenu && cell.linkmenu.length) { |
| | | if (appType === 'admin') { |
| | | if (!Array.isArray(cell.linkmenu)) { |
| | | links.push(item.$menuname) |
| | | } else { |
| | | let menuId = cell.linkmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } else { |
| | | if (cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { |
| | | links.push(item.$menuname) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | let resetButton = (item, cell) => { |
| | |
| | | sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) |
| | | } |
| | | } |
| | | |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | | if (cell.funcType === 'print') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | |
| | | let label = (item.name ? '-' + item.name : '') + '-' + cell.label |
| | | |
| | | filterComponent(cell.config.components, label, true) |
| | | } |
| | | } |
| | | |
| | | if (appType === 'admin') { |
| | | if (cell.refreshTab && cell.refreshTab.length) { |
| | | let tabId = cell.refreshTab[cell.refreshTab.length - 1] |
| | | if (!this.allMenus.includes(tabId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | if (cell.openmenu && cell.openmenu.length) { |
| | | if (!Array.isArray(cell.openmenu)) { |
| | | links.push(cell.logLabel) |
| | | } else { |
| | | let menuId = cell.openmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | | if (cell.linkmenu && cell.linkmenu.length) { |
| | | if (!Array.isArray(cell.linkmenu)) { |
| | | links.push(cell.logLabel) |
| | | } else { |
| | | let menuId = cell.linkmenu.slice(-1)[0] |
| | | if (!this.allMenus.includes(menuId)) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | if (cell.openmenu && cell.openmenu.length && cell.openmenu !== 'goback' && (typeof(cell.openmenu) !== 'string' || !this.allMenus.includes(cell.openmenu))) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | if (cell.linkmenu && cell.linkmenu.length && cell.linkmenu !== 'goback' && (typeof(cell.linkmenu) !== 'string' || !this.allMenus.includes(cell.linkmenu))) { |
| | | links.push(cell.logLabel) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | record = (type) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | |
| | | let menus = [] |
| | | |
| | | lackmenus.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | lacklinks.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | outmenus.forEach(item => { |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { loading, activeMenu, menulist, remain, lackmenus, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | const { loading, activeMenu, menulist, remain, lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus } = this.state |
| | | |
| | | if (!sessionStorage.getItem('UserID')) return null |
| | | |
| | |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {lacklinks.length ? <div className="item-wrap"> |
| | | <div className="title">关联菜单不存在</div> |
| | | {lacklinks.map((item, i) => { |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {backmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单后端脚本ID重复</div> |
| | | {backmenus.map((item, i) => { |