| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Modal } from 'antd' |
| | | import moment from 'moment' |
| | | import { SwapOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { getAllSqls } from '@/utils/utils-custom.js' |
| | | import './index.scss' |
| | | |
| | | const Header = asyncComponent(() => import('./header')) |
| | |
| | | activeMenu: null, |
| | | remain: 0, |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | unablemenus: [], |
| | | } |
| | | |
| | | sqlmap = null |
| | | btnmap = null |
| | | allMenus = [] |
| | | appMenus = {} |
| | | |
| | | // delete _val.controlField 删除按钮控制字段 |
| | | |
| | | UNSAFE_componentWillMount() { |
| | | document.body.className = '' |
| | | window.GLOB.syscheck = true |
| | | } |
| | | |
| | | componentDidMount() { |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | 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 { |
| | |
| | | }) |
| | | } else { |
| | | this.sqlmap = new Map() |
| | | this.btnmap = new Map() |
| | | |
| | | let errlist = sessionStorage.getItem('syscheck_main') |
| | | errlist = errlist ? JSON.parse(errlist) : null |
| | |
| | | remain: 0, |
| | | menulist: [], |
| | | lackmenus: [], |
| | | lacklinks: [], |
| | | outmenus: [], |
| | | backmenus: [], |
| | | appbackmenus: [], |
| | | btnmenus: [], |
| | | appbtnmenus: [], |
| | | unablemenus: [], |
| | | 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) |
| | | }) |
| | |
| | | }) |
| | | } else { |
| | | this.sqlmap = new Map() |
| | | this.btnmap = new Map() |
| | | |
| | | let errlist = sessionStorage.getItem('syscheck_app') |
| | | errlist = errlist ? JSON.parse(errlist) : null |
| | |
| | | } |
| | | |
| | | getMenuParam = (menus) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus, stop } = this.state |
| | | const { lackmenus, lacklinks, outmenus, unablemenus, backmenus, appbackmenus, btnmenus, appbtnmenus, stop } = this.state |
| | | |
| | | let menu = menus.shift() |
| | | |
| | |
| | | MenuID: menu.MenuID |
| | | } |
| | | |
| | | 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 if (!config.enabled) { |
| | | this.setState({unablemenus: [...unablemenus, menu]}) |
| | | } else { |
| | | let sqls = getAllSqls(config) |
| | | let keys = sqls.map(item => item.uuid) |
| | | let sqls = [] |
| | | let btns = [] |
| | | let links = [] |
| | | |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({backmenus: [...backmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | sqls.forEach(item => { |
| | | if (this.sqlmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.sqlmap.get(item.uuid) |
| | | } else { |
| | | this.sqlmap.set(item.uuid, menu) |
| | | } |
| | | this.getAllSqls(config, appType, sqls, btns, links) |
| | | |
| | | if (links.length) { |
| | | links.forEach(item => { |
| | | window.mkInfo(menu.pName + ':' + item) |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) |
| | | this.setState({lacklinks: [...lacklinks, menu]}) |
| | | } |
| | | |
| | | if (sqls.length) { |
| | | let keys = sqls.map(item => item.uuid) |
| | | |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({backmenus: [...backmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | sqls.forEach(item => { |
| | | if (this.sqlmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.sqlmap.get(item.uuid) |
| | | } else { |
| | | this.sqlmap.set(item.uuid, menu) |
| | | } |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbackmenus: [...appbackmenus, [premenu, menu]]}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (btns.length) { |
| | | let keys = btns.map(item => item.uuid) |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | this.setState({btnmenus: [...btnmenus, menu]}) |
| | | } else { |
| | | let repeat = false |
| | | let premenu = null |
| | | btns.forEach(item => { |
| | | if (this.btnmap.has(item.uuid)) { |
| | | window.mkInfo(item) |
| | | if (repeat) return |
| | | repeat = true |
| | | premenu = this.btnmap.get(item.uuid) |
| | | } else { |
| | | this.btnmap.set(item.uuid, menu) |
| | | } |
| | | }) |
| | | if (premenu) { |
| | | this.setState({appbtnmenus: [...appbtnmenus, [premenu, menu]]}) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | getAllSqls = (config, appType, sqls, btns, links) => { |
| | | let filterComponent = (components, label = '') => { |
| | | components.forEach(item => { |
| | | item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') |
| | | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | filterComponent(tab.components, label) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | filterComponent(item.components, label) |
| | | } else { |
| | | if (item.wrap && item.setting) { |
| | | if (item.wrap.datatype === 'public' || item.wrap.datatype === 'static') { |
| | | item.setting.interType = 'other' |
| | | } |
| | | } |
| | | |
| | | if (appType === 'mob' && item.type !== 'search' && item.type !== 'topbar' && item.search && item.search.length > 0) { |
| | | item.search = [] |
| | | } |
| | | if (appType !== 'mob' && item.search && item.search.length > 0) { |
| | | item.search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | sqls.push({uuid: md5(item.uuid + cell.uuid), type: 'sForm', LText: `${item.$menuname}-${cell.label}(搜索)`}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.subtype === 'tablecard') { // 兼容 |
| | | item.type = 'card' |
| | | } |
| | | |
| | | if (item.setting && item.setting.interType === 'system') { |
| | | item.setting.$name = item.$menuname || '' |
| | | |
| | | sqls.push({uuid: item.uuid, type: 'datasource', LText: item.setting.$name}) |
| | | } |
| | | |
| | | item.action && item.action.forEach(cell => { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return false |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | |
| | | if (item.type === 'table') { |
| | | let getCols = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'action') { |
| | | col.type = 'custom' |
| | | } |
| | | if (col.type === 'colspan') { |
| | | getCols(col.subcols || []) |
| | | } else if (col.type === 'custom') { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | } else if (item.subtype === 'editable' && col.editable === 'true') { |
| | | if (col.editType === 'select' && col.resourceType === '1') { |
| | | sqls.push({uuid: col.uuid, type: 'tbForm', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | } else if (col.editType === 'popSelect') { |
| | | if (col.pops) { |
| | | col.pops.forEach(n => { |
| | | sqls.push({uuid: n.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | }) |
| | | } else { |
| | | sqls.push({uuid: col.uuid, type: 'popSource', LText: `${item.$menuname}-${col.label}(列表单)`}) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getCols(item.cols) |
| | | |
| | | if (item.subtype === 'editable' && item.submit.intertype === 'system') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | |
| | | sqls.push({uuid: 'submit_' + item.uuid, type: 'editable', LText: item.submit.logLabel}) |
| | | } |
| | | } 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') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button') { |
| | | resetElement(item, cell) |
| | | return |
| | | } |
| | | |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | |
| | | btns.push({uuid: cell.uuid, label: cell.logLabel}) |
| | | |
| | | if (cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.modal = { |
| | | fields: group.fields |
| | | } |
| | | |
| | | group.subButton.logLabel = item.$menuname + '-' + group.subButton.label |
| | | |
| | | btns.push({uuid: group.uuid, label: group.subButton.logLabel}) |
| | | |
| | | resetButton(item, group.subButton) |
| | | }) |
| | | } else if (item.type === 'module' && item.subtype === 'invoice') { |
| | | if (item.buyer.setting && item.buyer.setting.interType === 'system') { |
| | | sqls.push({uuid: item.uuid + 'buyer', type: 'datasource', LText: item.$menuname + '-buyer'}) |
| | | } |
| | | |
| | | if (item.detail.setting && item.detail.setting.interType === 'system') { |
| | | sqls.push({uuid: item.uuid + 'detail', type: 'datasource', LText: item.$menuname + '-detail'}) |
| | | } |
| | | |
| | | sqls.push({uuid: item.uuid + item.billSaveBtn.type, type: 'button', LText: item.$menuname + '-' + item.billSaveBtn.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) => { |
| | | if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { |
| | | if (cell.intertype === 'system' || cell.procMode === 'system') { // 系统接口 |
| | | sqls.push({uuid: cell.uuid, type: 'button', LText: cell.logLabel}) |
| | | } |
| | | if (cell.callbackType === 'script' && cell.verify && cell.verify.cbScripts) { |
| | | sqls.push({uuid: 'back_' + cell.uuid, type: 'btnCallBack', LText: cell.logLabel}) |
| | | } |
| | | if (['pop', 'formSubmit'].includes(cell.OpenType) && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } else if (form.type === 'popSelect') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn') { |
| | | if (cell.intertype === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'excelIn', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'excelOut') { |
| | | if (cell.intertype === 'system' && cell.verify && cell.verify.dataType === 'custom') { |
| | | sqls.push({uuid: cell.uuid, type: 'excelOut', LText: cell.logLabel || ''}) |
| | | } else if (cell.intertype === 'system' && cell.verify && item.setting && item.setting.interType === 'system') { |
| | | if (appType === 'mob') { |
| | | cell.pagination = 'false' |
| | | } |
| | | if (item.subtype === 'dualdatacard' || item.setting.laypage !== cell.pagination) { |
| | | 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') { |
| | | sqls.push({uuid: cell.uuid, type: 'print', LText: cell.logLabel || ''}) |
| | | } |
| | | if (cell.execMode === 'pop' && cell.modal && cell.modal.fields) { |
| | | cell.modal.fields.forEach(form => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(form.type) && form.resourceType === '1') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'form', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } else if (form.type === 'popSelect') { |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', LText: `${cell.logLabel}-${form.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } else if ((cell.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { |
| | | if (cell.pageTemplate === 'pay' && cell.payMode === 'system') { |
| | | sqls.push({uuid: cell.uuid, type: 'pay', LText: cell.logLabel}) |
| | | } |
| | | } else if (cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | 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) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (appType === 'mob') { |
| | | config.components.forEach(item => { |
| | | if (item.type === 'topbar' && item.wrap.type !== 'navbar' && item.search) { |
| | | let search = [] |
| | | search.push(...item.search.fields) |
| | | |
| | | item.search.groups.forEach(group => { |
| | | search.push(...group.fields) |
| | | }) |
| | | |
| | | if (search.length > 0) { |
| | | search.forEach(cell => { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { |
| | | sqls.push({uuid: cell.uuid, type: 'sForm', LText: `搜索栏-${cell.label}(表单)`}) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (config.interfaces && config.interfaces.length > 0) { |
| | | config.interfaces.forEach(m => { |
| | | if (m.status !== 'true' || m.setting.interType !== 'system') return false |
| | | |
| | | m.setting.$name = (config.MenuName || '') + '-' + (m.name || '') |
| | | |
| | | sqls.push({uuid: m.uuid, type: 'interface', LText: m.setting.$name}) |
| | | }) |
| | | } |
| | | |
| | | filterComponent(config.components) |
| | | } |
| | | |
| | | record = (type) => { |
| | | const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = 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 => { |
| | |
| | | menus.push(item.MenuID) |
| | | }) |
| | | appbackmenus.forEach(item => { |
| | | menus.push(item[0].MenuID) |
| | | menus.push(item[1].MenuID) |
| | | }) |
| | | btnmenus.forEach(item => { |
| | | menus.push(item.MenuID) |
| | | }) |
| | | appbtnmenus.forEach(item => { |
| | | menus.push(item[0].MenuID) |
| | | menus.push(item[1].MenuID) |
| | | }) |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { loading, activeMenu, menulist, remain, lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = 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) => { |
| | |
| | | return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {btnmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单按钮ID重复</div> |
| | | {btnmenus.map((item, i) => { |
| | | return <div key={i}>{item.MenuName} <span></span> {item.pName}</div> |
| | | })} |
| | | </div> : null} |
| | | {appbtnmenus.length ? <div className="item-wrap"> |
| | | <div className="title">菜单按钮ID重复(菜单间)</div> |
| | | {appbtnmenus.map((item, i) => { |
| | | return <div key={i}>{item[0].MenuName} <span></span> {item[0].pName} <SwapOutlined /> {item[1].MenuName} <span></span> {item[1].pName}</div> |
| | | })} |
| | | </div> : null} |
| | | </div> |
| | | </div> |
| | | ) |