king
2020-11-23 f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a
2020-11-23
8 文件已重命名
30个文件已修改
1992 ■■■■■ 已修改文件
src/components/header/index.jsx 459 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.scss 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/config.jsx 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/index.jsx 322 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/actioncomponent/actionform/index.jsx 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/actioncomponent/index.jsx 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/data-card/wrapsetting/settingform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action-type.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/action.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/reducer.js 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/cardcellList/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/tabtransfer/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/menuform/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/dragelement/card.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/dragelement/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/dragelement/index.scss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/dragelement/itemtypes.js 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/index.jsx 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/menuform/index.jsx 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editfirstmenu/menuform/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editsecmenu/index.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editthdmenu/index.jsx 141 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editthdmenu/menuform/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/menuelement/card.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/menuelement/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/menuform/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/actionform/index.jsx 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/index.jsx 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/columnform/index.jsx 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/index.jsx 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/billprint/index.jsx 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/homeform/index.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/menuform/index.jsx 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/printmenuform/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -9,6 +9,7 @@
import asyncComponent from '@/utils/asyncComponent'
import {
  toggleCollapse,
  modifyMenuTree,
  modifyMainMenu,
  modifyTabview,
  resetState,
@@ -30,17 +31,13 @@
import LoginForm from './loginform'
import './index.scss'
const EditMenu = asyncComponent(() => import('@/templates/headerconfig'))
const EditMenu = asyncComponent(() => import('@/templates/menuconfig/editfirstmenu'))
const { confirm } = Modal
const { Search } = Input
class Header extends Component {
  static propTpyes = {
    collapse: PropTypes.bool,
    mainMenu: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.object
    ])
    collapse: PropTypes.bool
  }
  state = {
    menulist: null, // 一级菜单
@@ -51,7 +48,7 @@
    logourl: window.GLOB.mainlogo,
    loginVisible: false,
    loginLoading: false,
    avatar: avatar,
    avatar: Utils.getrealurl(sessionStorage.getItem('avatar')),
    systems: [],
    searchkey: '',
    thdMenuList: [],
@@ -79,27 +76,23 @@
      this.setState({
        confirmLoading: true
      })
      this.resetPwdSubmitexec(res)
    }, () => {})
  }
  async resetPwdSubmitexec (param) {
    let _param = {
      func: 's_PwdUpt',
      LText: `select '${param.originpwd}','${param.password}'`
        LText: `select '${res.originpwd}','${res.password}'`
    }
    
    _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')          // 时间戳
    _param.LText = Utils.formatOptions(_param.LText)                   // 关键字符替换,base64加密
    _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp)   // md5密钥
    let result = await Api.getSystemConfig(_param) // 取消修改本地密码,只修改单点服务器
    if (result.status) {
      Api.getSystemConfig(_param).then(result => {
      this.setState({
        visible: false,
          visible: !result.status,
        confirmLoading: false
      })
        if (result.status) {
      notification.success({
        top: 92,
        message: this.state.dict['main.password.resetsuccess'],
@@ -111,10 +104,9 @@
        message: result.message,
        duration: 5
      })
      this.setState({
        confirmLoading: false
      })
    }
      })
    }, () => {})
  }
  handleCancel = () => {
@@ -154,13 +146,14 @@
  async loadmenu () {
    // 获取主菜单
    let _param = {func: 'sPC_Get_MainMenu', systemType: options.sysType}
    if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取一级菜单,增加参数debug
    let _param = {func: 's_get_pc_menus', systemType: options.sysType}
    if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,增加参数debug
      _param.debug = 'Y'
    }
    if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') {
      _param.linkurl = window.GLOB.linkurl
    }
    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
    let result = await Api.getSystemConfig(_param)
@@ -168,33 +161,15 @@
    if (!result) return
    if (result.status) {
      let MainMenuId = sessionStorage.getItem('MainMenu') // 是否为打开新页面
      if (MainMenuId) {
        // 通过url中menuid筛选出选中的主菜单
        let _menu = result.data.filter(item => item.MenuID === MainMenuId)[0]
        sessionStorage.removeItem('MainMenu')
        this.props.modifyMainMenu(_menu || result.data[0])
      } else {
        this.props.modifyMainMenu(result.data[0])
      }
      let res = this.getMenulist(result)
      this.setState({
        menulist: result.data.map((item, index) => {
          item.id = index
          item.text = item.MenuName
          if (item.PageParam) {
            try {
              item.PageParam = JSON.parse(item.PageParam)
            } catch (e) {
              item.PageParam = {OpenType: 'menu', linkUrl: ''}
            }
          } else {
            item.PageParam = {OpenType: 'menu', linkUrl: ''}
          }
          return item
        }),
        systems: sessionStorage.getItem('isEditState') === 'true' ? [] : result.Systems.filter(sys => sys.LinkUrl1 && sys.AppName && sys.AppKey !== window.GLOB.appkey)
        menulist: res.menulist,
        systems: []
      })
      this.props.modifyMenuTree(res.menulist)
      this.props.modifyMainMenu(res.menulist[0] || null)
    } else {
      notification.error({
        top: 92,
@@ -204,13 +179,16 @@
    }
  }
  async getRolesMenu () {
  getRolesMenu () {
    // 获取角色权限
    let promiseRole = new Promise(resolve => {
      Api.getSystemConfig({func: 's_Get_TrdMenu_Role', edition_type: 'Y'}).then(result => {
    let roledefer = new Promise(resolve => {
      // edition_type 接口版本控制 ''、'Y'、'A'
      Api.getSystemConfig({
        func: 's_Get_TrdMenu_Role',
        edition_type: 'A',
        pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
      }).then(result => {
        let _permAction = {} // 按钮权限
        let _permMenus = {}  // 菜单权限,字段透视等
        let menulist = []    // 三级菜单列表
        if (result && result.status) {
          if (result.UserRoles_Menu) {
@@ -219,54 +197,6 @@
              _permAction[menu.MenuID] = true
            })
          }
          if (result.UserRoles) {
            let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
            let menukeys = []
            result.UserRoles.forEach(menu => {
              if (!menu.MenuID) return
              if (menukeys.includes(menu.MenuID)) {
                console.warn('s_Get_TrdMenu_Role重复的菜单ID:' + menu.MenuID)
                return
              }
              _permMenus[menu.MenuID] = true
              let _type = ''
              if (menu.LinkUrl === 'CommonTable') {
                _type = 'CommonTable'
              } else if (menu.LinkUrl && iframes.includes(menu.LinkUrl.split('?')[0])) {
                _type = 'iframe'
              }
              if (_type !== 'iframe') {
                let pageParam = {}
                try {
                  pageParam = JSON.parse(menu.PageParam)
                } catch (e) {
                  pageParam = {}
                }
                _type = pageParam.Template || _type
              }
              menukeys.push(menu.MenuID)
              menulist.push({
                MenuID: menu.MenuID,
                MenuName: menu.MenuName,
                MenuNo: menu.MenuNo || '',
                EasyCode: menu.EasyCode || '',
                LinkUrl: menu.LinkUrl,
                type: _type
              })
            })
          }
          this.setState({
            thdMenuList: menulist
          })
          this.props.initMenuPermission(_permMenus)
        } else if (result) {
          notification.error({
            top: 92,
@@ -275,79 +205,207 @@
          })
        }
        resolve(_permAction)
        this.props.initActionPermission(_permAction)
        resolve()
      })
    })
    // 获取主菜单参数
    let promiseMenu = new Promise(resolve => {
      let _param = {func: 'sPC_Get_MainMenu', systemType: options.sysType}
    let menudefer = new Promise(resolve => {
      let _param = {func: 's_get_pc_menus', systemType: options.sysType}
      if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') {
        _param.linkurl = window.GLOB.linkurl
      }
      _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
      Api.getSystemConfig(_param).then(result => {
        let mainMenu = null
        if (result && result.status) {
          let MainMenuId = sessionStorage.getItem('MainMenu') // 是否为打开新页面
          if (MainMenuId) {
            // 通过url中menuid筛选出选中的主菜单
            let _menu = result.data.filter(item => item.MenuID === MainMenuId)[0]
            sessionStorage.removeItem('MainMenu')
            mainMenu = _menu || result.data[0]
          } else {
            mainMenu = result.data[0]
          }
          this.setState({
            menulist: result.data.map((item, index) => {
              item.id = index
              item.text = item.MenuName
              if (item.PageParam) {
                try {
                  item.PageParam = JSON.parse(item.PageParam)
                } catch (e) {
                  item.PageParam = {OpenType: 'menu', linkUrl: ''}
                }
              } else {
                item.PageParam = {OpenType: 'menu', linkUrl: ''}
              }
              return item
            }),
            systems: result.Systems.filter(sys => sys.LinkUrl1 && sys.AppName && sys.AppKey !== window.GLOB.appkey)
          })
        } else if (result) {
        if (!result.status || !result.fst_menu) {
          notification.error({
            top: 92,
            message: result.message,
            message: result.message || '未查询到菜单信息!',
            duration: 10
          })
          return
        }
        resolve(mainMenu)
        let res = this.getMenulist(result)
        this.setState({
          menulist: res.menulist,
          thdMenuList: res.thdMenuList,
          systems: window.GLOB.systemType === 'production' || options.sysType === 'SSO' ? (result.sys_list || []) : []
        })
        let mainMenu = res.menulist[0] || null
        let _menu = null
        if (sessionStorage.getItem('ThirdMenu')) { // 是否为打开新页面
          let ThirdMenuId = sessionStorage.getItem('ThirdMenu')
          _menu = res.thdMenuList.filter(item => item.MenuID === ThirdMenuId)[0] // 通过url中menuid筛选出选中的主菜单
          if (_menu) {
            mainMenu = res.menulist.filter(item => item.MenuID === _menu.FstId)[0]
            mainMenu = fromJS(mainMenu).toJS()
            mainMenu.openId = _menu.ParentId
          }
          sessionStorage.removeItem('ThirdMenu')
        }
        this.props.modifyMenuTree(res.menulist)
        this.props.modifyMainMenu(mainMenu)
        this.props.initMenuPermission(res.permMenus)
        resolve(_menu)
      })
    })
    
    let _mainMenu = await promiseMenu
    if (_mainMenu) {
      this.props.modifyMainMenu(_mainMenu)
    Promise.all([roledefer, menudefer]).then(response => {
      if (response[1]) {
        let tabs = fromJS(this.props.tabviews).toJS()
        let menu = fromJS(response[1]).toJS()
        tabs = tabs.map(tab => {
          tab.selected = false
          return tab
        })
        menu.selected = true
        tabs.push(menu)
        this.props.modifyTabview(tabs)
      }
    })
    }
    let permAction = await promiseRole
  getMenulist = (result) => {
    let thdMenuList = []
    let permMenus = {}
    let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
    let menulist = result.fst_menu.map(fst => {
      let fstItem = {
        MenuID: fst.MenuID,
        MenuName: fst.MenuName,
        PageParam: {OpenType: 'menu', linkUrl: ''},
        children: []
      }
      if (fst.PageParam) {
        try {
          fstItem.PageParam = JSON.parse(fst.PageParam)
        } catch (e) {
          fstItem.PageParam = {OpenType: 'menu', linkUrl: ''}
        }
      }
    this.props.initActionPermission(permAction)
      if (fst.snd_menu) {
        fstItem.children = fst.snd_menu.map(snd => {
          let sndItem = {
            ParentId: fst.MenuID,
            MenuID: snd.MenuID,
            MenuName: snd.MenuName,
            PageParam: {Icon: 'folder'},
            children: []
          }
          if (snd.PageParam) {
            try {
              sndItem.PageParam = JSON.parse(snd.PageParam)
            } catch (e) {
              sndItem.PageParam = {Icon: 'folder'}
            }
          }
          let msg = {
            UserID: sessionStorage.getItem('UserID'),
            LoginUID: sessionStorage.getItem('LoginUID'),
            User_Name: sessionStorage.getItem('User_Name'),
            Full_Name: sessionStorage.getItem('Full_Name'),
            Member_Level: sessionStorage.getItem('Member_Level'),
            dataM: sessionStorage.getItem('dataM'),
            avatar: sessionStorage.getItem('avatar'),
            debug: sessionStorage.getItem('debug'),
            role_id: sessionStorage.getItem('role_id'),
            mainlogo: window.GLOB.mainlogo,
            mstyle: window.GLOB.style
          }
          if (snd.trd_menu) {
            sndItem.children = snd.trd_menu.map(trd => {
              let trdItem = {
                FstId: fst.MenuID,
                ParentId: snd.MenuID,
                MenuID: trd.MenuID,
                MenuName: trd.MenuName,
                MenuNo: trd.MenuNo,
                EasyCode: trd.EasyCode,
                type: 'CommonTable',            // 默认值为常用表
                OpenType: 'newtab'              // 打开方式
              }
              if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) {
                trdItem.type = 'iframe'
                trdItem.LinkUrl = trd.LinkUrl
                trdItem.forbidden = true
              } else {
                try {
                  trdItem.PageParam = trd.PageParam ? JSON.parse(trd.PageParam) : {OpenType: 'newtab'}
                } catch (e) {
                  trdItem.PageParam = {OpenType: 'newtab'}
                }
                trdItem.type = trdItem.PageParam.Template || trdItem.type
                trdItem.OpenType = trdItem.PageParam.OpenType || trdItem.OpenType
                if (trdItem.type === 'CustomPage' && this.props.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限
                  trdItem.forbidden = true
                }
                if (trdItem.type === 'NewPage') {
                  trdItem.src = trdItem.PageParam.url || ''
                  if (trdItem.src.indexOf('paramsmain/') > -1) {
                    try {
                      let _url = trdItem.src.split('paramsmain/')[0] + 'paramsmain/'
                      let _param = JSON.parse(window.decodeURIComponent(window.atob(trdItem.src.split('paramsmain/')[1])))
                      _param.UserID = sessionStorage.getItem('UserID')
                      _param.LoginUID = sessionStorage.getItem('LoginUID')
                      _param.User_Name = sessionStorage.getItem('User_Name')
                      _param.Full_Name = sessionStorage.getItem('Full_Name')
                      trdItem.src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
                    } catch {
                      console.warn('菜单参数解析错误!')
                    }
                  }
                } else {
                  // 打开新页面链接
                  trdItem.src = '#/paramsmain/' + window.btoa(window.encodeURIComponent(JSON.stringify({
                    ...msg,
                    ThirdMenu: trd.MenuID
                  })))
                }
              }
              permMenus[trd.MenuID] = true
              thdMenuList.push(trdItem)
              return trdItem
            })
          }
          return sndItem
        })
      }
      return fstItem
    })
    return { menulist, thdMenuList, permMenus}
  }
  reload = () => {
    this.setState({
      menulist: null
    })
    this.loadmenu()
  }
  changeEditState = (state) => {
    const { menulist } = this.state
    if (!state) { // 退出编辑,页面刷新
      window.location.reload()
      return
@@ -357,48 +415,23 @@
    let UserID = sessionStorage.getItem('CloudUserID')
    let LoginUID = sessionStorage.getItem('CloudLoginUID')
    if (state && (!UserID || !LoginUID)) {
    if (!UserID || !LoginUID) {
      this.setState({
        loginVisible: true
      })
    } else {
      sessionStorage.setItem('isEditState', state)
      let _userName = sessionStorage.getItem('User_Name')
      let _avatar = avatar
      sessionStorage.setItem('isEditState', 'true')
      this.props.modifyDataManager(sessionStorage.getItem('cloudDataM') === 'true')
      if (sessionStorage.getItem('cloudDataM') === 'true') {
        this.props.modifyDataManager(true)
      }
      if (!state && sessionStorage.getItem('avatar')) {
        _avatar = Utils.getrealurl(sessionStorage.getItem('avatar')) // 头像
      } else if (state && sessionStorage.getItem('CloudAvatar')) {
        _avatar = Utils.getrealurl(sessionStorage.getItem('CloudAvatar')) // 头像
      }
      if (state) {
        _userName = sessionStorage.getItem('CloudUserName')
      }
      if (window.GLOB.systemType === 'production' && state) {
      if (window.GLOB.systemType === 'production') {
        this.props.resetEditLevel('HS')
        this.props.modifyMainMenu({
          MenuID: 'systemManageView'
        })
        this.setState({
          userName: _userName,
          avatar: _avatar
        })
        this.props.resetEditState(state)
        return
      } else if (window.GLOB.systemType === 'production' && !state) {
        this.props.resetEditLevel(false)
        this.props.modifyMainMenu(menulist[0] || '')
        this.setState({
          userName: _userName,
          avatar: _avatar
          userName: sessionStorage.getItem('CloudUserName'),
          avatar: Utils.getrealurl(sessionStorage.getItem('CloudAvatar'))
        })
        this.props.resetEditState(state)
@@ -407,15 +440,15 @@
      this.setState({
        menulist: null,
        userName: _userName,
        avatar: _avatar
        userName: sessionStorage.getItem('CloudUserName'),
        avatar: Utils.getrealurl(sessionStorage.getItem('CloudAvatar'))
      })
      this.loadmenu()
      this.props.modifyMainMenu('')
      this.props.modifyMainMenu(null)
      this.props.resetEditState(state)
    }
    if (state && this.props.sysRoles.length === 0 && this.props.permFuncField.length === 0 && window.GLOB.systemType !== 'production') {
    if (window.GLOB.systemType !== 'production') {
      Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => {
        if (res.status) {
          let _permFuncField = []
@@ -458,13 +491,9 @@
          sessionStorage.setItem('CloudUserName', res.UserName)
          sessionStorage.setItem('CloudFullName', res.FullName)
          sessionStorage.setItem('CloudAvatar', res.icon)
          sessionStorage.setItem('isEditState', 'true')
          sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '')
          let _avatar = avatar
          if (res.icon) {
            _avatar = Utils.getrealurl(res.icon) // 头像
          }
          sessionStorage.setItem('isEditState', 'true')
          if (res.dataM) {
            this.props.modifyDataManager(true)
@@ -480,7 +509,7 @@
              loginVisible: false,
              loginLoading: false,
              userName: res.UserName,
              avatar: _avatar
              avatar: res.icon
            })
            this.props.resetEditState(true)
    
@@ -492,10 +521,10 @@
            loginVisible: false,
            loginLoading: false,
            userName: res.UserName,
            avatar: _avatar
            avatar: res.icon
          })
          this.loadmenu()
          this.props.modifyMainMenu('')
          this.props.modifyMainMenu(null)
          this.props.resetEditState(true)
        } else {
          this.setState({
@@ -531,14 +560,15 @@
   * @description 退出管理界面菜单
   */
  exitManage = () => {
    const { menulist } = this.state
    if (window.GLOB.systemType === 'production') { // 正式系统版本升级后,页面刷新
      window.location.reload()
      return
    }
    this.props.resetEditState(true)
    this.props.modifyMainMenu(menulist[0] || null)
    this.props.resetEditLevel(false)
    this.reload()
  }
  
  exitEdit = () => {
@@ -576,40 +606,36 @@
  }
  selectMenu = (item) => {
    const { tabviews } = this.props
    let menu = JSON.parse(JSON.stringify(item))
    let tabs = fromJS(this.props.tabviews).toJS()
    let menu = fromJS(item).toJS()
    menu.selected = true
    let index = 0
    let isexit = false
    let tabs = tabviews.map((tab, i) => {
    tabs = tabs.filter(tab => {
      tab.selected = false
      if (tab.MenuID === menu.MenuID) {
        tab.selected = true
        isexit = true
      }
      return tab
      return tab.MenuID !== menu.MenuID
    })
    if (!isexit) {
      tabs.splice(index + 1, 0, menu)
    if (this.props.tabviews.length !== tabs.length) {
      this.props.modifyTabview(fromJS(tabs).toJS())
    }
    this.setState({}, () => {
      tabs.push(menu)
    this.props.modifyTabview(tabs)
    })
  }
  
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    let _avatar = sessionStorage.getItem('avatar')
    if (_avatar) {
      _avatar = Utils.getrealurl(_avatar) // 头像
      this.setState({avatar: _avatar})
    this.getRolesMenu()
    }
    this.getRolesMenu()
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (!is(fromJS(this.props.menuTree), fromJS(nextProps.menuTree)) && !is(fromJS(this.state.menulist), fromJS(nextProps.menuTree))) {
      this.setState({
        menulist: nextProps.menuTree
      })
    }
  }
  componentDidMount () {
@@ -675,6 +701,7 @@
  }
  render () {
    const { mainMenu, collapse } = this.props
    const { thdMenuList, searchkey, oriVersion, newVersion } = this.state
    const menu = (
@@ -699,16 +726,16 @@
    return (
      <header className="header-container ant-menu-dark" id="main-header-container">
        <div className={this.props.collapse ? "collapse header-logo" : "header-logo"}><img src={this.state.logourl} alt=""/></div>
        <div className={this.props.collapse ? "collapse header-collapse" : "header-collapse"} onClick={this.handleCollapse}>
          <Icon type={this.props.collapse ? 'menu-unfold' : 'menu-fold'} />
        <div className={collapse ? "collapse header-logo" : "header-logo"}><img src={this.state.logourl} alt=""/></div>
        <div className={collapse ? "collapse header-collapse" : "header-collapse"} onClick={this.handleCollapse}>
          <Icon type={collapse ? 'menu-unfold' : 'menu-fold'} />
        </div>
        {/* 正常菜单 */}
        {this.props.editLevel !== 'level1' && this.state.menulist ?
          <ul className={'header-menu ' + this.props.editLevel}>{
            this.state.menulist.map(item => {
              return (
                <li key={item.MenuID} onClick={() => {this.changeMenu(item)}} className={this.props.selectmenu.MenuID === item.MenuID ? 'active' : ''}>
                <li key={item.MenuID} onClick={() => {this.changeMenu(item)}} className={mainMenu && mainMenu.MenuID === item.MenuID ? 'active' : ''}>
                  <span>{item.MenuName}</span>
                </li>
              )
@@ -737,7 +764,7 @@
        {/* 头像、用户名 */}
        <Dropdown className="header-setting" overlay={menu}>
          <div>
            <img src={this.state.avatar} alt=""/>
            <img src={this.state.avatar || avatar} alt=""/>
            <span>
              <span className="username">{this.state.userName}</span> <Icon type="down" />
            </span>
@@ -811,7 +838,8 @@
  return {
    tabviews: state.tabviews,
    collapse: state.collapse,
    selectmenu: state.selectedMainMenu,
    menuTree: state.menuTree,
    mainMenu: state.mainMenu,
    debug: state.debug,
    editState: state.editState,
    editLevel: state.editLevel,
@@ -826,7 +854,8 @@
  return {
    toggleCollapse: (collapse) => dispatch(toggleCollapse(collapse)),
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)),
    modifyMainMenu: (selectmenu) => dispatch(modifyMainMenu(selectmenu)),
    modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)),
    modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)),
    resetEditState: (state) => dispatch(resetEditState(state)),
    resetEditLevel: (level) => dispatch(resetEditLevel(level)),
    initActionPermission: (permAction) => dispatch(initActionPermission(permAction)),
src/components/header/index.scss
@@ -31,9 +31,10 @@
  .header-collapse {
    float: left;
    width: 80px;
    width: 35px;
    line-height: 48px;
    padding-left: 20px;
    padding-left: 10px;
    margin: 0 10px;
    cursor: pointer;
    transition: padding-left 0.15s;
    i {
@@ -44,7 +45,8 @@
    }
  }
  .header-collapse.collapse {
    padding-left: 30px;
    width: 60px;
    padding-left: 20px;
  }
  .header-menu {
    float: left;
src/components/sidemenu/config.jsx
@@ -1,8 +1,7 @@
// 系统菜单
export const SySMenuList = {
  systemManageView: [{
export const SySMenuList = [{
    MenuID: 'systemManageViewConfig',
    text: '配置',
  MenuName: '配置',
    PageParam: {Icon: 'folder'},
    children: [{
      src: '',
@@ -11,7 +10,6 @@
      MenuID: '1581067625930haged11ieaivpavv77k',
      MenuNo: 'sDatasM',
      MenuName: '数据字典',
      text: '数据字典'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -19,7 +17,6 @@
      MenuID: '1581734956310scks442ul2d955g9tu5',
      MenuNo: 'sVersionM',
      MenuName: '传输号管理',
      text: '传输号管理'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -27,7 +24,6 @@
      MenuID: '1583991994144ndddg0bhh0is6shi0v1',
      MenuNo: 'sVersionQueryM',
      MenuName: '传输号查询',
      text: '传输号查询'
    }, {
      src: '',
      systems: ['production', 'local', 'SSO', 'cloud'],
@@ -36,7 +32,6 @@
      MenuID: '1583979633842550imkchl4qt4qppsiv',
      MenuNo: 'sVersionMUpgrade',
      MenuName: '版本升级',
      text: '版本升级'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'TabManage'},
@@ -44,7 +39,6 @@
      MenuID: 'TabManageView',
      MenuNo: 'TabManage',
      MenuName: '标签页管理',
      text: '标签页管理'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -52,7 +46,6 @@
      MenuID: '1578900109100np8aqd0a77q3na46oas',
      MenuNo: 'sPrintTemplateM',
      MenuName: '标签打印模板',
      text: '标签打印模板'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -60,7 +53,6 @@
      MenuID: '16044812935562g807p3p12huk8kokmb',
      MenuNo: 'sPrintTemplate_webM',
      MenuName: '单据打印模板',
      text: '单据打印模板'
    }, {
      src: '',
      systems: ['SSO', 'cloud'],
@@ -69,7 +61,6 @@
      MenuID: '1585192949946f3et2ts8tn82krmumdf',
      MenuNo: 'MyAppManage',
      MenuName: '系统UI',
      text: '系统UI'
    }, {
      src: '',
      systems: ['SSO', 'cloud'],
@@ -78,7 +69,6 @@
      MenuID: '15855615451212m12ip23vpcm79kloro',
      MenuNo: 'sUsersAppM',
      MenuName: '系统用户管理',
      text: '系统用户管理'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ScriptTable'},
@@ -86,7 +76,6 @@
      MenuID: '1587005717541lov40vg61q7l1rbveon',
      MenuNo: 's_custom_scriptM',
      MenuName: '自定义函数',
      text: '自定义函数'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -94,7 +83,6 @@
      MenuID: '1590458676585agbbr63t6ihighg2i1g',
      MenuNo: 'LdropdownmenuNewM',
      MenuName: '通用下拉菜单',
      text: '通用下拉菜单'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -102,11 +90,10 @@
      MenuID: '1602315375262ikd33ii0nii34pt861o',
      MenuNo: 's_worksflow_roleM',
      MenuName: '关键角色管理',
      text: '关键角色管理'
    }]
  }, {
    MenuID: 'systemManageViewInterface',
    text: '接口',
  MenuName: '接口',
    PageParam: {Icon: 'folder'},
    children: [{
      src: '',
@@ -115,7 +102,6 @@
      MenuID: '1582771068837vsv54a089lgp45migbg',
      MenuNo: 'KUNTitleM',
      MenuName: '接口主数据',
      text: '接口主数据'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -123,7 +109,6 @@
      MenuID: '1582777675954ifu05upurs465omoth7',
      MenuNo: 'KUNMainM',
      MenuName: '查询接口',
      text: '查询接口'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -131,7 +116,6 @@
      MenuID: '158294809668898cklbv6c5bou8e1fpu',
      MenuNo: 'KUNMainMOut_advanced',
      MenuName: '高阶查询',
      text: '高阶查询'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -139,7 +123,6 @@
      MenuID: '1584676379094iktph45fb8imhg96bql',
      MenuNo: 'KUNMainM_Out_usual',
      MenuName: '通用查询接口',
      text: '通用查询接口'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -147,7 +130,6 @@
      MenuID: '1584695125339vo5g7iqgfn01qmrd6s2',
      MenuNo: 'KUNMainM_In_usual',
      MenuName: '通用写入接口',
      text: '通用写入接口'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -155,7 +137,6 @@
      MenuID: '1584699661372vhmpp9dn9foo0eob722',
      MenuNo: 'KUNMainM_In',
      MenuName: '写入接口',
      text: '写入接口'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -163,11 +144,10 @@
      MenuID: '15848421131551gg04ie8sitsd3f7467',
      MenuNo: 'KUNOsMainM',
      MenuName: '外部接口',
      text: '外部接口'
    }]
  }, {
    MenuID: 'systemManageViewCommunication',
    text: '通信',
  MenuName: '通信',
    PageParam: {Icon: 'folder'},
    children: [{
      src: '',
@@ -176,7 +156,6 @@
      MenuID: '1589782279158ngr675kk3oksin35sul',
      MenuNo: 'bd_msn_emailM',
      MenuName: '邮件服务器',
      text: '邮件服务器'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -184,7 +163,6 @@
      MenuID: '1589788042787ffdt9hle4s45k9r1nvs',
      MenuNo: 'bd_msn_email_tempM',
      MenuName: '邮件模板',
      text: '邮件模板'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -192,7 +170,6 @@
      MenuID: '15900310928174dro07ihfckghpb5h13',
      MenuNo: 'bd_msn_sms_tempM',
      MenuName: '大于短信模板',
      text: '大于短信模板'
    // }, {
    //   src: '',
    //   PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -200,11 +177,10 @@
    //   MenuID: '1599613340050c8nu6rbst9d4emnnbsq',
    //   MenuNo: 's_sms_qxM',
    //   MenuName: '奇云短信模板',
    //   text: '奇云短信模板'
    }]
  }, {
    MenuID: 'systemPayManage',
    text: '支付',
  MenuName: '支付',
    PageParam: {Icon: 'folder'},
    children: [{
      src: '',
@@ -214,11 +190,10 @@
      MenuID: '1594095599055qicg2eb642v5qglhnuo',
      MenuNo: 's_weixin_pay_bdM',
      MenuName: '微信支付',
      text: '微信支付'
    }]
  }, {
    MenuID: 'systemManageViewParam',
    text: '系统参数',
  MenuName: '系统参数',
    PageParam: {Icon: 'folder'},
    children: [{
      src: '',
@@ -227,7 +202,6 @@
      MenuID: '1577972969199lei1g0qkvlh4tkc908m',
      MenuNo: 'sModularM',
      MenuName: '系统模块',
      text: '系统模块'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -235,7 +209,6 @@
      MenuID: '1578479100252lfbp29v1kafk4s4q4ig',
      MenuNo: 'BDLanguagePacksM',
      MenuName: '语言包',
      text: '语言包'
    }, {
      src: '',
      systems: ['production', 'local', 'SSO', 'cloud'],
@@ -244,7 +217,6 @@
      MenuID: '1577971621421tg4v0i1ur8873k7e0ob',
      MenuNo: 'sSystemParametersM',
      MenuName: '接口地址',
      text: '接口地址'
    }, {
      src: '',
      systems: ['production', 'local', 'SSO', 'cloud'],
@@ -253,7 +225,6 @@
      MenuID: '1577929944419lgc5h3hepum765e2k7u',
      MenuNo: 'sProcExcepM',
      MenuName: '报错日志',
      text: '报错日志'
    }, {
      src: '',
      PageParam: {OpenType: 'newtab', Template: 'ManageTable'},
@@ -261,7 +232,5 @@
      MenuID: '1588493493409k9guqp067d31lu7blsv',
      MenuNo: 's_job_stepM',
      MenuName: '计划任务',
      text: '计划任务'
    }]
  }]
}
src/components/sidemenu/index.jsx
@@ -6,7 +6,7 @@
import { Menu, Icon, notification } from 'antd'
import asyncComponent from '@/utils/asyncComponent'
import { modifyTabview, resetEditLevel } from '@/store/action'
import { modifyTabview, resetEditLevel, modifyMenuTree, modifyMainMenu } from '@/store/action'
import { SySMenuList } from './config'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/main.js'
@@ -20,16 +20,11 @@
class Sidemenu extends Component {
  static propTypes = {
    collapse: PropTypes.bool,
    mainMenu: PropTypes.oneOfType([
      PropTypes.string,
      PropTypes.object
    ])
    collapse: PropTypes.bool
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    mainMenuList: null,      // 一级菜单,编辑调整上级菜单时获取
    subMenulist: [],         // 二级菜单
    editMenu: null,          // 编辑三级菜单时设置
    rootSubmenuKeys: null,
@@ -49,179 +44,23 @@
      return
    }
    let _param = {func: 'sPC_Get_FunMenu', ParentID: menu.MenuID, systemType: options.sysType}
    menu = fromJS(menu).toJS()
    let openKey = ''
    if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取菜单,增加参数debug
      _param.debug = 'Y'
    if (menu.children[0]) {
      openKey = menu.openId || menu.children[0].MenuID
    }
    let result = await Api.getSystemConfig(_param)
    if (result.status) {
      if (this.props.editState && this.props.editLevel === 'HS') return
      if (result.data.length === 0) { // 查询菜单为空
        this.setState({
          subMenulist: [],
          rootSubmenuKeys: [],
          openKeys: []
        })
        return
      }
      let SubMenuId = sessionStorage.getItem('SubMenu')   // 是否为打开新页面
      let ThirdMenuId = sessionStorage.getItem('ThirdMenu') // 是否为打开新页面
      let submenuId = '' // 展开二级菜单ID
      let tabId = '' // 打开的tab页id
      let msg = {
        UserID: sessionStorage.getItem('UserID'),
        LoginUID: sessionStorage.getItem('LoginUID'),
        User_Name: sessionStorage.getItem('User_Name'),
        Full_Name: sessionStorage.getItem('Full_Name'),
        Member_Level: sessionStorage.getItem('Member_Level'),
        dataM: sessionStorage.getItem('dataM'),
        avatar: sessionStorage.getItem('avatar'),
        debug: sessionStorage.getItem('debug'),
        role_id: sessionStorage.getItem('role_id'),
        mainlogo: window.GLOB.mainlogo,
        mstyle: window.GLOB.style,
        MainMenu: menu.MenuID
      }
      if (SubMenuId && ThirdMenuId) {
        submenuId = SubMenuId
        let submenu = result.data.filter(item => item.ParentID === SubMenuId)[0]
        if (!submenu) {
          submenuId = ''
        } else {
          tabId = ThirdMenuId
          let tabmenu = submenu.FunMenu.filter(item => item.MenuID === ThirdMenuId)[0]
          if (!tabmenu) {
            submenuId = ''
            tabId = ''
          }
        }
        sessionStorage.removeItem('SubMenu')
        sessionStorage.removeItem('ThirdMenu')
      }
      let parentID = submenuId ? submenuId : result.data[0].ParentID // 展开二级菜单ID
      let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
      let menulist = result.data.map(item => {
        let _smenu = {}
        _smenu.id = item.ParentID
        _smenu.MenuID = item.ParentID
        _smenu.text = item.MenuNameP
        try {
          _smenu.PageParam = JSON.parse(item.PageParamP)
        } catch (e) {
          _smenu.PageParam = {Icon: 'folder'}
        }
        if (item.FunMenu) {
          _smenu.children = item.FunMenu.map(child => {
            let _tmenu = {
              ParentId: item.ParentID,
              OpenType: 'newtab'
            }
            if (child.LinkUrl === 'CommonTable') {
              _tmenu.type = 'CommonTable'
            } else if (iframes.includes(child.LinkUrl.split('?')[0])) {
              _tmenu.type = 'iframe'
              _tmenu.forbidden = true
            }
            if (_tmenu.type !== 'iframe') {
              try {
                _tmenu.PageParam = JSON.parse(child.PageParam)
              } catch (e) {
                _tmenu.PageParam = {OpenType: 'newtab'}
              }
              _tmenu.type = _tmenu.PageParam.Template || _tmenu.type
              _tmenu.OpenType = _tmenu.PageParam.OpenType
            }
            if (_tmenu.type === 'NewPage') {
              _tmenu.src = _tmenu.PageParam.url
              if (this.props.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限
                _tmenu.forbidden = true
              }
              if (_tmenu.src.indexOf('paramsmain/') > -1) {
                try {
                  let _url = _tmenu.src.split('paramsmain/')[0] + 'paramsmain/'
                  let _param = JSON.parse(window.decodeURIComponent(window.atob(_tmenu.src.split('paramsmain/')[1])))
                  _param.UserID = sessionStorage.getItem('UserID')
                  _param.LoginUID = sessionStorage.getItem('LoginUID')
                  _param.User_Name = sessionStorage.getItem('User_Name')
                  _tmenu.src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
                } catch {
                  console.warn('菜单参数解析错误!')
                }
              }
            } else {
              // 打开新页面链接
              _tmenu.src = '#/paramsmain/' + window.btoa(window.encodeURIComponent(JSON.stringify({
                ...msg,
                SubMenu: _smenu.MenuID,
                ThirdMenu: child.MenuID
              })))
            }
            _tmenu.id = child.MenuID
            _tmenu.MenuID = child.MenuID
            _tmenu.MenuNo = child.MenuNo
            _tmenu.MenuName = child.MenuName
            _tmenu.text = child.MenuName
            return _tmenu
          })
        }
        return _smenu
      })
      this.setState({
        subMenulist: menulist,
        rootSubmenuKeys: result.data.map(item => item.ParentID),
        openKeys: this.props.collapse ? [] : [parentID],
        editMenu: this.props.editLevel === 'level3' && menulist.filter(menu => menu.MenuID === this.state.editMenu.MenuID)[0]
      })
      if (tabId) {
        let _menu = menulist.filter(menu => menu.MenuID === submenuId)[0]
        let opentab = _menu && _menu.children.filter(tab => tab.MenuID === tabId)[0]
        if (opentab) {
          if (sessionStorage.getItem('MenuParam')) {
            try {
              let thParam = JSON.parse(sessionStorage.getItem('MenuParam'))
              if (tabId === thParam.ThirdMenu) {
                delete thParam.ThirdMenu
                opentab.param = thParam
              }
            } catch {
              console.warn('菜单参数解析错误!')
            }
            sessionStorage.removeItem('MenuParam')
          }
          opentab.selected = true
          let home = this.props.tabviews[0]
          home.selected = false
          this.props.modifyTabview([home, opentab])
        }
      }
    } else {
      notification.warning({
        top: 92,
        message: result.message,
        duration: 5
      subMenulist: menu.children,
      rootSubmenuKeys: menu.children.map(item => item.MenuID),
      openKeys: this.props.collapse ? [] : [openKey],
      editMenu: this.props.editLevel === 'level3' ? menu.children.filter(_menu => _menu.MenuID === this.state.editMenu.MenuID)[0] : null
      })
    }
  }
  enterManageView = (type) => {
    let menulist = SySMenuList[type]
  enterManageView = () => {
    let menulist = SySMenuList
    if (window.GLOB.systemType === 'production') {
      menulist.forEach(menu => {
@@ -252,10 +91,7 @@
    
    let menu = JSON.parse(e.target.dataset.item)
    if (menu.OpenType === 'newpage') {
      e.preventDefault()
      window.open(menu.src)
    } else if (menu.OpenType === 'NewPage') {
    if (menu.OpenType === 'newpage' || menu.OpenType === 'NewPage') {
      e.preventDefault()
      window.open(menu.src)
    } else if (menu.OpenType === 'blank') {
@@ -285,7 +121,7 @@
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (!is(fromJS(this.props.mainMenu), fromJS(nextProps.mainMenu)) && nextProps.mainMenu && nextProps.mainMenu.MenuID === 'systemManageView') {
      this.enterManageView(nextProps.mainMenu.MenuID)
      this.enterManageView()
    } else if (!is(fromJS(this.props.mainMenu), fromJS(nextProps.mainMenu))) {
      // 主菜单切换,请求2、3级菜单数据
      this.loadsubmenu(nextProps.mainMenu)
@@ -316,17 +152,6 @@
    // 编辑二级菜单
    e.stopPropagation()
    this.props.resetEditLevel('level2')
    // 获取一级菜单列表
    Api.getSystemConfig({func: 'sPC_Get_MainMenu', debug: 'Y'}).then(res => {
      this.setState({
        mainMenuList: res.data.map(item => {
          return {
            MenuID: item.MenuID,
            text: item.MenuName
          }
        })
      })
    })
  }
  enterThrEdit = (e, menu) => {
@@ -337,7 +162,113 @@
  }
  reload = () => {
    const { mainMenu } = this.props
    let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}
    if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') {
      _param.linkurl = window.GLOB.linkurl
    }
    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
    Api.getSystemConfig(_param).then(result => {
      // 登录超时
      if (!result) return
      if (result.status) {
        let res = this.getMenulist(result)
        let _mainMenu = res.menulist.filter(item => item.MenuID === mainMenu.MenuID)[0]
        this.props.modifyMenuTree(res.menulist)
        this.props.modifyMainMenu(_mainMenu || null)
      } else {
        notification.error({
          top: 92,
          message: result.message,
          duration: 10
        })
      }
    this.loadsubmenu(this.props.mainMenu)
    })
  }
  getMenulist = (result) => {
    let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt']
    let menulist = result.fst_menu.map(fst => {
      let fstItem = {
        MenuID: fst.MenuID,
        MenuName: fst.MenuName,
        PageParam: {OpenType: 'menu', linkUrl: ''},
        children: []
      }
      if (fst.PageParam) {
        try {
          fstItem.PageParam = JSON.parse(fst.PageParam)
        } catch (e) {
          fstItem.PageParam = {OpenType: 'menu', linkUrl: ''}
        }
      }
      if (fst.snd_menu) {
        fstItem.children = fst.snd_menu.map(snd => {
          let sndItem = {
            ParentId: fst.MenuID,
            MenuID: snd.MenuID,
            MenuName: snd.MenuName,
            PageParam: {Icon: 'folder'},
            children: []
          }
          if (snd.PageParam) {
            try {
              sndItem.PageParam = JSON.parse(snd.PageParam)
            } catch (e) {
              sndItem.PageParam = {Icon: 'folder'}
            }
          }
          if (snd.trd_menu) {
            sndItem.children = snd.trd_menu.map(trd => {
              let trdItem = {
                FstId: fst.MenuID,
                ParentId: snd.MenuID,
                MenuID: trd.MenuID,
                MenuName: trd.MenuName,
                MenuNo: trd.MenuNo,
                EasyCode: trd.EasyCode,
                type: 'CommonTable',            // 默认值为常用表
                OpenType: 'newtab'              // 打开方式
              }
              if (trd.LinkUrl && iframes.includes(trd.LinkUrl.split('?')[0])) {
                trdItem.type = 'iframe'
                trdItem.LinkUrl = trd.LinkUrl
                trdItem.forbidden = true
              } else {
                try {
                  trdItem.PageParam = trd.PageParam ? JSON.parse(trd.PageParam) : {OpenType: 'newtab'}
                } catch (e) {
                  trdItem.PageParam = {OpenType: 'newtab'}
                }
                trdItem.type = trdItem.PageParam.Template || trdItem.type
                trdItem.OpenType = trdItem.PageParam.OpenType || trdItem.OpenType
                if (trdItem.type === 'CustomPage' && this.props.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限
                  trdItem.forbidden = true
                }
              }
              return trdItem
            })
          }
          return sndItem
        })
      }
      return fstItem
    })
    return { menulist }
  }
  exitEdit = () => {
@@ -362,7 +293,7 @@
                title={
                  <span className={editShow && index === 0 ? 'edit-control' : ''}>
                    <Icon type={item.PageParam.Icon} />
                    <span>{item.text}</span>
                    <span>{item.MenuName}</span>
                  </span>
                }
              >
@@ -372,7 +303,7 @@
                {item.children.map(cell => {
                  return (
                    <Menu.Item key={cell.MenuID}>
                      <a href={cell.src} id={cell.MenuID} data-item={JSON.stringify(cell)} onClick={this.changemenu.bind(this)}>{cell.text}</a>
                      <a href={cell.src} id={cell.MenuID} data-item={JSON.stringify(cell)} onClick={this.changemenu.bind(this)}>{cell.MenuName}</a>
                    </Menu.Item>
                  )
                })}
@@ -383,13 +314,13 @@
        {this.props.editLevel === 'level2' ?
          <EditSecMenu
            menulist={this.state.subMenulist}
            supMenuList={this.state.mainMenuList}
            menuTree={this.props.menuTree}
            supMenu={this.props.mainMenu}
            reload={this.reload}
            exitEdit={this.exitEdit}
          /> : null
        }
        {this.props.editLevel === 'level3' && this.state.subMenulist && this.state.editMenu ?
        {this.props.editLevel === 'level3' && this.state.editMenu ?
          <EditThdMenu
            menulist={this.state.editMenu.children}
            supMenuList={this.state.subMenulist}
@@ -408,7 +339,8 @@
    tabviews: state.tabviews,
    collapse: state.collapse,
    isiframe: state.isiframe,
    mainMenu: state.selectedMainMenu,
    mainMenu: state.mainMenu,
    menuTree: state.menuTree,
    memberLevel: state.memberLevel,
    editState: state.editState,
    editLevel: state.editLevel
@@ -417,6 +349,8 @@
const mapDispatchToProps = (dispatch) => {
  return {
    modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)),
    modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)),
    modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)),
    resetEditLevel: (level) => dispatch(resetEditLevel(level))
  }
src/menu/actioncomponent/actionform/index.jsx
@@ -4,8 +4,6 @@
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd'
import { btnIcons, btnCustomClasses, formRule } from '@/utils/option.js'
import Api from '@/api'
import options from '@/store/options.js'
import './index.scss'
const { TextArea } = Input
@@ -157,7 +155,7 @@
          _options.push('execMode', 'intertype', 'innerFunc', 'Ot', 'execSuccess', 'execError')
        }
      }
    } else {
    } else if (_opentype === 'popview' && _opentype === 'tab') {
      if (_intertype === 'outer') {
        _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc')
      } else if (_intertype === 'inner') {
@@ -548,7 +546,6 @@
              })(
                <Cascader
                  options={this.state.menulist}
                  loadData={this.loadData}
                  placeholder=""
                />
              )}
@@ -570,57 +567,6 @@
      }
    })
    return fields
  }
  loadData = selectedOptions => {
    const { MenuID } = this.props
    const targetOption = selectedOptions[selectedOptions.length - 1]
    targetOption.loading = true
    let _param = {
      func: 'sPC_Get_FunMenu',
      ParentID: targetOption.value,
      systemType: options.sysType,
      debug: 'Y'
    }
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        targetOption.loading = false
        targetOption.children = result.data.map(item => {
          let submenu = {
            value: item.ParentID,
            label: item.MenuNameP,
            children: item.FunMenu.map(cell => {
              return {
                value: cell.MenuID,
                label: cell.MenuName,
                MenuID: cell.MenuID,
                MenuName: cell.MenuName,
                MenuNo: cell.MenuNo,
                Ot: cell.Ot,
                PageParam: cell.PageParam,
                LinkUrl: cell.LinkUrl,
                disabled: cell.MenuID === MenuID
              }
            })
          }
          return submenu
        })
        this.setState({
          menulist: [...this.state.menulist]
        })
      } else {
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
        targetOption.loading = false
      }
    })
  }
  handleConfirm = () => {
src/menu/actioncomponent/index.jsx
@@ -4,8 +4,6 @@
import { is, fromJS } from 'immutable'
import { Modal, notification, Button } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import DevUtils from '@/utils/devutils.js'
import zhCN from '@/locales/zh-CN/model.js'
@@ -169,75 +167,37 @@
    </div>
    let menulist = []
    if (menu.fstMenuList) {
      menulist = menu.fstMenuList.map(item => {
        return {
          value: item.MenuID,
          label: item.text,
          isLeaf: false
        }
      let trees = fromJS(menu.fstMenuList).toJS()
      menulist = trees.map(fst => {
        fst.value = fst.MenuID
        fst.label = fst.MenuName
        fst.isLeaf = false
        fst.children = fst.children.map(snd => {
          snd.value = snd.MenuID
          snd.label = snd.MenuName
          snd.children = snd.children.map(thd => {
            thd.value = thd.MenuID
            thd.label = thd.MenuName
            thd.disabled = thd.MenuID === menu.MenuID
            return thd
          })
          return snd
        })
        return fst
      })
    }
    let modules = this.getModules(menu.components, config.uuid)
    if (menu.fstMenuList && card.linkmenu && card.linkmenu.length > 0) {
      let _param = {
        func: 'sPC_Get_FunMenu',
        ParentID: card.linkmenu[0],
        systemType: options.sysType,
        debug: 'Y'
      }
      Api.getSystemConfig(_param).then(result => {
        if (result.status) {
          menulist = menulist.map(item => {
            if (item.value === card.linkmenu[0]) {
              item.children = result.data.map(item => {
                let submenu = {
                  value: item.ParentID,
                  label: item.MenuNameP,
                  children: item.FunMenu.map(cell => {
                    return {
                      value: cell.MenuID,
                      label: cell.MenuName,
                      MenuID: cell.MenuID,
                      MenuName: cell.MenuName,
                      MenuNo: cell.MenuNo,
                      Ot: cell.Ot,
                      PageParam: cell.PageParam,
                      LinkUrl: cell.LinkUrl,
                      disabled: cell.MenuID === menu.MenuID
                    }
                  })
                }
                return submenu
              })
            }
            return item
          })
        } else {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
          })
        }
        this.setState({
          visible: true,
          card: card,
          formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules)
        })
      })
    } else {
      this.setState({
        visible: true,
        card: card,
        formlist: getActionForm(card, functip, config.setting, menu.permFuncField, this.props.type, menulist, modules)
      })
    }
  }
  /**
src/menu/components/card/cardcellcomponent/index.jsx
@@ -2,10 +2,8 @@
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import {connect} from 'react-redux'
import { Modal, Button, notification } from 'antd'
import { Modal, Button } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import asyncComponent from '@/utils/asyncComponent'
@@ -254,74 +252,35 @@
    let menulist = []
    if (menu.fstMenuList) {
      menulist = menu.fstMenuList.map(item => {
        return {
          value: item.MenuID,
          label: item.text,
          isLeaf: false
        }
      let trees = fromJS(menu.fstMenuList).toJS()
      menulist = trees.map(fst => {
        fst.value = fst.MenuID
        fst.label = fst.MenuName
        fst.isLeaf = false
        fst.children = fst.children.map(snd => {
          snd.value = snd.MenuID
          snd.label = snd.MenuName
          snd.children = snd.children.map(thd => {
            thd.value = thd.MenuID
            thd.label = thd.MenuName
            thd.disabled = thd.MenuID === menu.MenuID
            return thd
          })
          return snd
        })
        return fst
      })
    }
    let modules = this.getModules(menu.components, cards.uuid)
    if (menu.fstMenuList && card.linkmenu && card.linkmenu.length > 0) {
      let _param = {
        func: 'sPC_Get_FunMenu',
        ParentID: card.linkmenu[0],
        systemType: options.sysType,
        debug: 'Y'
      }
      Api.getSystemConfig(_param).then(result => {
        if (result.status) {
          menulist = menulist.map(item => {
            if (item.value === card.linkmenu[0]) {
              item.children = result.data.map(item => {
                let submenu = {
                  value: item.ParentID,
                  label: item.MenuNameP,
                  children: item.FunMenu.map(cell => {
                    return {
                      value: cell.MenuID,
                      label: cell.MenuName,
                      MenuID: cell.MenuID,
                      MenuName: cell.MenuName,
                      MenuNo: cell.MenuNo,
                      Ot: cell.Ot,
                      PageParam: cell.PageParam,
                      LinkUrl: cell.LinkUrl,
                      disabled: cell.MenuID === menu.MenuID
                    }
                  })
                }
                return submenu
              })
            }
            return item
          })
        } else {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
          })
        }
        this.setState({
          actvisible: true,
          card: card,
          formlist: getActionForm(card, functip, cards.setting, menu.permFuncField, 'card', menulist, modules)
        })
      })
    } else {
      this.setState({
        actvisible: true,
        card: card,
        formlist: getActionForm(card, functip, cards.setting, menu.permFuncField, 'card', menulist, modules)
      })
    }
  }
  getModules = (components, selfId) => {
src/menu/components/card/data-card/wrapsetting/settingform/index.jsx
@@ -133,9 +133,9 @@
            </Col> : null}
            {MenuType !== 'billPrint' && config.subtype !== 'tablecard' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="选择卡片切换时,可向其他组件传递主键值。">
                <Tooltip placement="topLeft" title="卡片点击时,是否向其他组件传递主键值。">
                  <Icon type="question-circle" />
                  是否切换
                  传递主键
                </Tooltip>
              }>
                {getFieldDecorator('switch', {
src/store/action-type.js
@@ -1,3 +1,6 @@
// 初始化菜单信息
export const MODIFY_MENUTREE = 'MODIFY_MENUTREE'
// 切换主菜单
export const MODIFY_MAINMENU = 'MODIFY_MAINMENU'
src/store/action.js
@@ -8,11 +8,19 @@
  }
}
// 初始化菜单信息
export const modifyMenuTree = (menuTree) => {
  return {
    type: user.MODIFY_MENUTREE,
    menuTree
  }
}
// 切换主菜单
export const modifyMainMenu = (selectedMainMenu) => {
export const modifyMainMenu = (mainMenu) => {
  return {
    type: user.MODIFY_MAINMENU,
    selectedMainMenu
    mainMenu
  }
}
src/store/reducer.js
@@ -17,7 +17,8 @@
}
let defaultState = {
  selectedMainMenu: '', // 已选主菜单
  menuTree: null,       // 菜单结构树
  mainMenu: null,       // 已选主菜单
  tabviews: [],         // 导航栏
  collapse: _collapse,  // 是否收起侧边栏导航
  isiframe: false,      // 是否为iframe窗口
@@ -43,11 +44,17 @@
        ...state,
        collapse: action.collapse
      }
    case Type.MODIFY_MENUTREE:
    // 初始化菜单信息
      return {
        ...state,
        menuTree: action.menuTree
      }
    case Type.MODIFY_MAINMENU:
    // 切换主菜单
      return {
        ...state,
        selectedMainMenu: action.selectedMainMenu
        mainMenu: action.mainMenu
      }
    case Type.MODIFY_TABVIEW:
    // tab页改变
@@ -66,7 +73,7 @@
      return {
        ...state,
        ...{
          selectedMainMenu: '',
          mainMenu: null,
          tabviews: [],
          collapse: false,
          isiframe: false
@@ -80,18 +87,9 @@
      }
    case Type.RESET_EDITSTATE:
    // 重置编辑状态
      if (action.editState) {
        state.tabviews = []
      } else {
        state.tabviews = [{
          MenuID: 'home_page_id',
          MenuName: '首页',
          selected: true,
          type: 'Home'
        }]
      }
      return {
        ...state,
        tabviews: [],
        editState: action.editState,
        collapse: false
      }
@@ -99,6 +97,7 @@
    // 重置编辑级别
      return {
        ...state,
        editState: true,
        editLevel: action.editLevel
      }
    case Type.INIT_ROLESPERMISSION:
@@ -146,7 +145,8 @@
      }
    case Type.LOGOUT:
      return {
        selectedMainMenu: '',
        menuTree: null,
        mainMenu: null,
        tabviews: [],
        collapse: localStorage.getItem('collapse') === 'true',
        isiframe: false,
src/tabviews/custom/components/card/cardcellList/index.jsx
@@ -159,7 +159,9 @@
          val = '' + val
        }
        
        if (card.format === 'thdSeparator') {
        if (card.format === 'percent') {
          val = val + '%'
        } else if (card.format === 'thdSeparator') {
          val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
        }
      }
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -178,8 +178,8 @@
  loadmaindata = (params) => {
    const { config } = this.props
    let LText_field = []
    let diffUser = false
    let LText = params.map((item, index) => {
      let _sql = item.sql
      let _script = item.script
      if (index === 0) {
@@ -187,11 +187,14 @@
          ${_script}
        `
      }
      if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) {
        diffUser = true
      }
      item.columns.forEach(cell => {
        LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
      })
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(_sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(item.sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
    })
    let param = {
@@ -206,7 +209,7 @@
    if (config.cacheUseful === 'true') {
      param.time_type = config.timeUnit
      param.time_limit = config.cacheTime
      if (config.diffUser) {
      if (diffUser) {
        param.userid = sessionStorage.getItem('UserID')
      }
      param.data_md5 = md5(JSON.stringify(param))
src/tabviews/custom/index.jsx
@@ -103,7 +103,6 @@
      // 数据缓存设置
      if (config.cacheUseful === 'true') {
        config.diffUser = config.diffUser !== 'false'
        if (!['day', 'hour'].includes(config.timeUnit)) {
          config.timeUnit = 'day'
        }
@@ -156,7 +155,6 @@
        inherit.cacheUseful = config.cacheUseful
        inherit.timeUnit = config.timeUnit
        inherit.cacheTime = config.cacheTime
        inherit.diffUser = config.diffUser
      }
      config.components = this.formatSetting(config.components, params, mainSearch, permAction, inherit)
@@ -375,8 +373,8 @@
  loadmaindata = (params) => {
    const { config } = this.state
    let LText_field = []
    let diffUser = false
    let LText = params.map((item, index) => {
      let _sql = item.sql
      let _script = item.script
      if (index === 0) {
@@ -384,11 +382,14 @@
          ${_script}
        `
      }
      if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) {
        diffUser = true
      }
      item.columns.forEach(cell => {
        LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`)
      })
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(_sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
      return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(item.sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort`
    })
    let param = {
@@ -404,7 +405,7 @@
    if (config.cacheUseful === 'true') {
      param.time_type = config.timeUnit
      param.time_limit = config.cacheTime
      if (config.diffUser) {
      if (diffUser) {
        param.userid = sessionStorage.getItem('UserID')
      }
      param.data_md5 = md5(JSON.stringify(param))
src/templates/comtableconfig/menuform/index.jsx
@@ -33,7 +33,7 @@
    if (key === 'fstMenuId') {
      let _menu = menulist.filter(cell => cell.MenuID === value)[0]
      let options = _menu ? _menu.options : []
      let options = _menu ? _menu.children : []
      let ParentId = options[0] ? options[0].MenuID : ''
      this.setState({
@@ -111,7 +111,7 @@
                <Select onChange={(value) => {this.selectChange('fstMenuId', value)}}>
                  {this.state.menulist.map(option =>
                    <Select.Option key={option.MenuID} value={option.MenuID}>
                      {option.text}
                      {option.text || option.MenuName}
                    </Select.Option>
                  )}
                </Select>
@@ -132,7 +132,7 @@
                <Select onChange={(value) => {this.selectChange('ParentId', value)}}>
                  {this.state.submenulist.map(option =>
                    <Select.Option key={option.MenuID} value={option.MenuID}>
                      {option.text}
                      {option.text || option.MenuName}
                    </Select.Option>
                  )}
                </Select>
src/templates/menuconfig/editfirstmenu/dragelement/card.jsx
File was renamed from src/templates/headerconfig/dragelement/card.jsx
@@ -14,9 +14,9 @@
  })
  const [, drop] = useDrop({
    accept: ItemTypes.CARD,
    canDrop: () => false,
    hover({ id: draggedId }) {
      if (draggedId !== id) {
    canDrop: () => true,
    drop: ({ id: draggedId }) => {
      if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
src/templates/menuconfig/editfirstmenu/dragelement/index.jsx
File was renamed from src/templates/headerconfig/dragelement/index.jsx
@@ -1,6 +1,7 @@
import React, { useState } from 'react'
import { useDrop } from 'react-dnd'
import { Icon, Button } from 'antd'
import { is, fromJS } from 'immutable'
import update from 'immutability-helper'
import Card from './card'
import ItemTypes from './itemtypes'
@@ -15,8 +16,12 @@
    handlePreviewList(_cards)
  }
  if (!is(fromJS(cards), fromJS(list))) {
    setCards(list)
  }
  const findCard = id => {
    const card = cards.filter(c => `${c.id}` === id)[0]
    const card = cards.filter(c => c.MenuID === id)[0]
    return {
      card,
      index: cards.indexOf(card),
@@ -58,23 +63,21 @@
    <div ref={drop} className="dragdashboard">
      {cards.map(card => (
        <Card
          key={card.id}
          id={`${card.id}`}
          text={card.text}
          key={card.MenuID}
          id={`${card.MenuID}`}
          text={card.MenuName}
          moveCard={moveCard}
          editCard={editCard}
          delCard={delCard}
          findCard={findCard}
        />
      ))}
      <div className="btn-group">
        <div className="card-add" onClick={add}>
          <Icon type="plus" />
        </div>
        <Button type="primary" onClick={thawmenu}>{dict['model.thaw'] + dict['model.menu']}</Button>
        <Button type="primary" onClick={confirm}>{dict['model.confirm']}</Button>
        <Button onClick={cancel}>{dict['model.close']}</Button>
      </div>
    </div>
  )
}
src/templates/menuconfig/editfirstmenu/dragelement/index.scss
File was renamed from src/templates/headerconfig/dragelement/index.scss
@@ -1,14 +1,14 @@
.dragdashboard {
  position: relative;
  z-index: 1;
  width: calc(100vw - 400px);
  width: calc(100vw - 350px);
  float: left;
  background: #001529;
  padding-bottom: 5px;
  .card-add {
    border: 1px dashed gray;
    padding: 2px;
    margin-top: 13px;
    padding: 4px;
    margin-top: 9px;
    margin-left: 10px;
    width: 50px;
    float: left;
src/templates/menuconfig/editfirstmenu/dragelement/itemtypes.js
src/templates/menuconfig/editfirstmenu/index.jsx
File was renamed from src/templates/headerconfig/index.jsx
@@ -22,7 +22,6 @@
import card5 from '@/assets/img/card-bg6.jpg'
const { confirm } = Modal
let previewList = null
class EditMenu extends Component {
  static propTpyes = {
@@ -34,6 +33,7 @@
  state = {
    thawmenulist: null, // 已冻结的一级菜单
    addMvisible: null,
    menulist: null,
    editMenu: null, // 编辑菜单
    editMvisible: false, // 编辑菜单模态框
    thawMvisible: false, // 解除冻结模态框
@@ -43,13 +43,13 @@
  handlePreviewList = (List) => {
    // 菜单顺序改变时,保存中间状态
    previewList = List
    this.setState({menulist: List})
  }
  editMenuModal = (Menu) => {
    // 菜单编辑:修改
    const menu = fromJS(Menu).toJS()
    if (previewList && !is(fromJS(previewList), fromJS(this.props.menulist))) {
    if (!is(fromJS(this.state.menulist), fromJS(this.props.menulist))) {
      notification.warning({
        top: 92,
        message: this.state.dict['model.menu.presave'],
@@ -219,7 +219,8 @@
  
  handleButton = (type) => {
    // 菜单编辑:添加,确定,取消
    let _menuchange = previewList && !is(fromJS(previewList), fromJS(this.props.menulist))
    let _menuchange = !is(fromJS(this.state.menulist), fromJS(this.props.menulist))
    if ((type === 'add' || type === 'thawmenu') && _menuchange) {
      notification.warning({
        top: 92,
@@ -234,7 +235,7 @@
      let _this = this
      let param  = {
        func: 'sPC_Menu_SortUpt',
        LText: previewList.map((item, index) => {
        LText: this.state.menulist.map((item, index) => {
          return 'select \'' + item.MenuID + '\' as Menuid,' + (index + 1) * 10 + ' as sort'
        })
      }
@@ -259,6 +260,17 @@
              })
            }
          })
        },
        onCancel() {}
      })
    } else if (type === 'cancel' && _menuchange) {
      let _this = this
      confirm({
        title: '菜单顺序已调整,放弃保存吗?',
        content: '',
        onOk() {
          _this.props.exitEdit()
        },
        onCancel() {}
      })
@@ -294,17 +306,17 @@
  }
  UNSAFE_componentWillMount () {
    previewList = null
    this.setState({menulist: fromJS(this.props.menulist).toJS()})
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (!is(fromJS(this.props.menulist), fromJS(nextProps.menulist))) {
      previewList = null
      this.setState({menulist: fromJS(nextProps.menulist).toJS()})
    }
  }
  render () {
    const { dict } = this.state
    const { dict, menulist } = this.state
    return (
      <div className="header-edit-box">
@@ -328,16 +340,16 @@
            </div>
          </div>
        </div>
        {this.props.menulist && <DndProvider backend={HTML5Backend}>
        <DndProvider backend={HTML5Backend}>
          <DragElement
            dict={dict}
            list={this.props.menulist}
            list={menulist}
            handlePreviewList={this.handlePreviewList}
            handleMenu={this.editMenuModal}
            deleteMemu={this.deleteMemu}
            handleButton={this.handleButton}
          />
        </DndProvider>}
        </DndProvider>
        {/* 新建菜单模态框 */}
        <Modal
          title={dict['model.add'] + dict['model.menu']}
src/templates/menuconfig/editfirstmenu/index.scss
src/templates/menuconfig/editfirstmenu/menuform/index.jsx
File was renamed from src/templates/headerconfig/menuform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select } from 'antd'
import { Form, Row, Col, Input, Select, Radio } from 'antd'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -23,7 +23,7 @@
        readonly: false
      },
      {
        type: 'select',
        type: 'radio',
        key: 'openType',
        label: this.props.dict['model.openway'],
        initVal: 'menu',
@@ -31,44 +31,45 @@
        options: [{
          id: 'menu',
          text: this.props.dict['model.menu']
        // }, {
        //   id: 'newpage',
        //   text: this.props.dict['model.new'] + this.props.dict['model.window']
        }, {
          id: 'outpage',
          text: '外部页面'
        }]
      },
      {
        type: 'select',
        type: 'text',
        key: 'linkUrl',
        label: '页面地址',
        initVal: '',
        hidden: true,
        label: this.props.dict['model.new'] + this.props.dict['model.window'],
        initVal: 'service',
        required: true,
        options: []
        required: true
      }
    ]
  }
  UNSAFE_componentWillMount () {
    const { menu } = this.props
    if (this.props.type === 'add') {
      this.setState({
        formlist: this.state.defaultMenu
      })
    } else {
      this.setState({
        formlist: this.state.defaultMenu.map(menu => {
          if (menu.key === 'menuName') {
            menu.initVal = this.props.menu.MenuName
          } else if (menu.key === 'openType') {
            menu.initVal = this.props.menu.PageParam.OpenType
          } else if (menu.key === 'linkUrl') {
            menu.initVal = this.props.menu.PageParam.linkUrl
            if (this.props.menu.PageParam.OpenType === 'menu') {
              menu.hidden = true
            } else if (this.props.menu.PageParam.OpenType === 'newpage') {
              menu.hidden = false
        formlist: this.state.defaultMenu.map(item => {
          if (item.key === 'menuName') {
            item.initVal = menu.MenuName
          } else if (item.key === 'openType') {
            item.initVal = menu.PageParam.OpenType
          } else if (item.key === 'linkUrl') {
            item.initVal = menu.PageParam.linkUrl
            if (menu.PageParam.OpenType === 'menu') {
              item.hidden = true
            } else if (menu.PageParam.OpenType === 'outpage') {
              item.hidden = false
            }
          }
          return menu
          return item
        })
      })
    }
@@ -77,11 +78,11 @@
  openTypeChange = (key, value) => {
    if (key === 'openType') {
      let formlist = this.state.formlist
      if (value === 'newpage') {
      if (value === 'outpage') {
        formlist.forEach(item => {
          if (item.key === 'linkUrl') {
            item.hidden = false
            item.initVal = 'service'
            item.initVal = ''
          }
        })
      } else {
@@ -91,6 +92,7 @@
          }
        })
      }
      this.setState({formlist})
    }
  }
@@ -137,13 +139,39 @@
                  getPopupContainer={() => document.getElementById('form-box')}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.id} title={option.text} key={option.id} value={option.id}>{option.text}</Select.Option>
                    <Select.Option key={option.id} value={option.id}>{option.text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'radio') { // 下拉搜索
        fields.push(
          <Col span={24} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal || '',
                rules: [
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Radio.Group onChange={(e) => {this.openTypeChange(item.key, e.target.value)}}>
                  {
                    item.options.map(option => {
                      return (
                        <Radio key={option.id} value={option.id}>{option.text}</Radio>
                      )
                    })
                  }
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
        )
      }
    })
    
src/templates/menuconfig/editfirstmenu/menuform/index.scss
src/templates/menuconfig/editsecmenu/index.jsx
@@ -25,7 +25,7 @@
class EditMenu extends Component {
  static propTpyes = {
    menulist: PropTypes.any,      // 二级菜单列表
    supMenuList: PropTypes.array, // 一级菜单列表
    menuTree: PropTypes.array,    // 一级菜单列表
    supMenu: PropTypes.object,    // 二级菜单所对应的一级菜单
    reload: PropTypes.func,       // 刷新二级菜单数据
    exitEdit: PropTypes.func      // 退出编辑
@@ -63,7 +63,7 @@
      })
    } else if (menu.type === 'close') {
      confirm({
        title: dict['model.menu.close'].replace('@M', menu.card.text),
        title: dict['model.menu.close'].replace('@M', menu.card.MenuName),
        content: '',
        onOk() {
          let param = {
@@ -97,13 +97,13 @@
            label: dict['model.super'] + dict['model.menu'],
            initVal: this.props.supMenu.MenuID,
            required: true,
            options: this.props.supMenuList
            options: this.props.menuTree
          },
          { // 菜单名称
            type: 'text',
            key: 'menuName',
            label: dict['model.menu'] + dict['model.name'],
            initVal: menu.card.text,
            initVal: menu.card.MenuName,
            required: true,
            readonly: false
          },
@@ -142,7 +142,7 @@
            label: dict['model.super'] + dict['model.menu'],
            initVal: this.props.supMenu.MenuID,
            required: true,
            options: this.props.supMenuList
            options: this.props.menuTree
          },
          { // 菜单名称
            type: 'text',
@@ -231,7 +231,20 @@
        this.props.exitEdit()
      }
    } else if (type === 'close') { // 退出编辑
      if (!is(fromJS(this.props.menulist), fromJS(this.state.menulist))) {
        let _this = this
        confirm({
          title: '菜单顺序已调整,放弃保存吗?',
          content: '',
          onOk() {
            _this.props.exitEdit()
          },
          onCancel() {}
        })
      } else {
      this.props.exitEdit()
      }
    }
  }
@@ -428,12 +441,12 @@
          confirmLoading={this.state.confirmLoading}
          onCancel={this.memuHandleCancel}
        >
          {this.state.formlist &&
          {this.state.formlist ?
          <MenuForm
            dict={dict}
            formlist={this.state.formlist}
            wrappedComponentRef={(inst) => this.menuFormRef = inst}
          />}
            /> : null}
        </Modal>
        <Modal
          title={dict['model.thaw'] + dict['model.menu']}
src/templates/menuconfig/editthdmenu/index.jsx
@@ -78,8 +78,6 @@
    btnTabConfig: null,     // 打开新标签按钮配置
    handleMVisible: false,  // 添加或修改菜单模态框(角色权限分配等)
    sysMenu: false,         // 添加或编辑菜单(角色权限分配等)
    fstMenuId: null,        // 一级菜单Id
    fstMenuList: null       // 一级菜单列表
  }
  /**
@@ -117,7 +115,7 @@
      })
    } else if (menu.type === 'close') {
      confirm({
        title: this.state.dict['model.menu.close'].replace('@M', menu.card.text),
        title: this.state.dict['model.menu.close'].replace('@M', menu.card.MenuName),
        content: '',
        onOk() {
          let param = {
@@ -141,26 +139,13 @@
    } else if (menu.type === 'edit') {
      let _menu = fromJS(menu.card).toJS()
      delete _menu.id
      delete _menu.src
      delete _menu.text
      if (_menu.PageParam && (_menu.PageParam.Template === 'RolePermission' || _menu.PageParam.Template === 'NewPage')) { // 单页面修改
        _menu.Template = _menu.PageParam.Template
        _menu.url = _menu.PageParam.url
        if (!this.state.fstMenuId) {
          notification.warning({
            top: 92,
            message: '菜单加载中,请稍后重试!',
            duration: 5
          })
          return
        }
        _menu.fstMenuId = _menu.FstId
        _menu.supMenuList = this.props.supMenuList
        _menu.fstMenuId = this.state.fstMenuId || ''
        _menu.fstMenuList = this.state.fstMenuList || []
        _menu.fstMenuList = this.props.menuTree
  
        this.setState({
          handleMVisible: true,
@@ -193,9 +178,9 @@
          }
          _menu.LongParam = _LongParam
          _menu.fstMenuId = _menu.FstId
          _menu.supMenuList = this.props.supMenuList
          _menu.fstMenuId = this.state.fstMenuId || ''
          _menu.fstMenuList = this.state.fstMenuList || []
          _menu.fstMenuList = this.props.menuTree
          _menu.open_edition = res.open_edition || ''
          // 检测模板是否存在
@@ -217,7 +202,7 @@
            }, () => {
              document.getElementById('root').style.overflowY = 'hidden'
            })
          } else if (_menu.fstMenuId) {
          } else {
            this.setState({
              type: 'edit',
              editMenu: _menu,
@@ -225,12 +210,6 @@
              tabview: _menu.PageParam.Template
            }, () => {
              document.getElementById('root').style.overflowY = 'hidden'
            })
          } else {
            _menu.loadingFstMenuId = true
            this.setState({
              type: 'edit',
              editMenu: _menu
            })
          }
        } else {
@@ -259,15 +238,6 @@
        return
      }
      if (!this.state.fstMenuId) {
        notification.warning({
          top: 92,
          message: '菜单加载中,请稍后重试!',
          duration: 5
        })
        return
      }
      this.setState({
        tabview: 'template',
        editMenu: {
@@ -280,8 +250,8 @@
          isSubtable: '', // 是否为主子表
          ParentId: this.props.supMenu.MenuID,
          supMenuList: this.props.supMenuList,
          fstMenuId: this.state.fstMenuId,
          fstMenuList: this.state.fstMenuList,
          fstMenuId: this.props.mainMenu.MenuID,
          fstMenuList: this.props.menuTree,
          menuSort: (this.props.menulist.length + 1) * 10 // 新建菜单设置排序
        }
      }, () => {
@@ -358,7 +328,20 @@
        this.props.exitEdit()
      }
    } else if (type === 'close') {
      if (!is(fromJS(this.props.menulist), fromJS(this.state.menulist))) {
        let _this = this
        confirm({
          title: '菜单顺序已调整,放弃保存吗?',
          content: '',
          onOk() {
            _this.props.exitEdit()
          },
          onCancel() {}
        })
      } else {
      this.props.exitEdit()
      }
    }
  }
@@ -439,19 +422,8 @@
  useTemplate = (template, useType) => {
    let editMenu = fromJS(this.state.editMenu).toJS()
    if (!this.state.fstMenuId) {
      notification.warning({
        top: 92,
        message: '菜单加载中,请稍后重试!',
        duration: 5
      })
      return
    }
    if (!editMenu.fstMenuId) {
      editMenu.fstMenuId = this.state.fstMenuId
      editMenu.fstMenuList = this.state.fstMenuList
    }
    editMenu.fstMenuId = this.props.mainMenu.MenuID
    editMenu.fstMenuList = this.props.menuTree
    if (useType === 'sys' && (template.type === 'RolePermission' || template.type === 'NewPage')) { // 独立页面
      let _menu = {
@@ -722,69 +694,6 @@
    })
  }
  componentDidMount () {
    let _param = {
      func: 's_Get_FSMenusForOpen',
      SndMenuID: this.props.supMenu.MenuID,
      TYPE: 20,
      TypeCharOne: 'PC'
    }
    this.setState({
      loading: true
    })
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        this.setState({
          loading: false,
          fstMenuId: result.FstIDSeleted,
          fstMenuList: result.data.map(smenu => {
            let _smenu = {
              MenuID: smenu.FstID,
              text: smenu.FstName,
              options: smenu.SndData.map(menu => {
                return {
                  MenuID: menu.SndID,
                  text: menu.SndName,
                }
              })
            }
            return _smenu
          })
        }, () => {
          let _menu = this.state.editMenu ? fromJS(this.state.editMenu).toJS() : null
          if (!_menu || !_menu.loadingFstMenuId) {
            return
          }
          delete _menu.loadingFstMenuId
          _menu.fstMenuId = this.state.fstMenuId
          _menu.fstMenuList = this.state.fstMenuList
          this.setState({
            type: 'edit',
            editMenu: _menu,
            loading: false,
            tabview: _menu.PageParam.Template
          }, () => {
            document.getElementById('root').style.overflowY = 'hidden'
          })
        })
      } else {
        this.setState({
          loading: false
        })
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
      }
    })
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    if (!is(fromJS(this.props.menulist), fromJS(nextProps.menulist))) {
      this.setState({
@@ -821,7 +730,7 @@
        }
        <div className="cus-submenu-title">
          <Icon type={this.props.supMenu.PageParam.Icon} />
          <span>{this.props.supMenu.text}</span>
          <span>{this.props.supMenu.MenuName}</span>
        </div>
        <DndProvider backend={HTML5Backend}>
          <DragElement
@@ -985,6 +894,8 @@
const mapStateToProps = (state) => {
  return {
    mainMenu: state.mainMenu,
    menuTree: state.menuTree,
    memberLevel: state.memberLevel
  }
}
src/templates/menuconfig/editthdmenu/menuform/index.jsx
@@ -28,9 +28,9 @@
    if (submenu) {
      this.setState({
        menu: {...menu, supMenuList: submenu.options}
        menu: {...menu, supMenuList: submenu.children}
      }, () => {
        this.props.form.setFieldsValue({ParentID: submenu.options[0] ? submenu.options[0].MenuID : ''})
        this.props.form.setFieldsValue({ParentID: submenu.children[0] ? submenu.children[0].MenuID : ''})
      })
    }
  }
@@ -82,7 +82,7 @@
                  onChange={this.changeMenu}
                >
                  {menu.fstMenuList.map(option =>
                    <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}>{option.text}</Select.Option>
                    <Select.Option key={option.MenuID} value={option.MenuID}>{option.text || option.MenuName}</Select.Option>
                  )}
                </Select>
              )}
@@ -104,7 +104,7 @@
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {menu.supMenuList.map(option =>
                    <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}>{option.text}</Select.Option>
                    <Select.Option key={option.MenuID} value={option.MenuID}>{option.text || option.MenuName}</Select.Option>
                  )}
                </Select>
              )}
@@ -144,6 +144,10 @@
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '页面地址!'
                  },
                  {
                    max: 1024,
                    message: '地址最长为1024个字符!'
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
src/templates/menuconfig/menuelement/card.jsx
@@ -14,8 +14,8 @@
  })
  const [, drop] = useDrop({
    accept: ItemTypes.CARD,
    canDrop: () => false,
    hover({ id: draggedId }) {
    canDrop: () => true,
    drop({ id: draggedId }) {
      if (draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
@@ -48,7 +48,7 @@
    <div className="side-card" style={{ opacity }}>
      <div ref={node => drag(drop(node))}>
        {card.PageParam && card.PageParam.Icon && <Icon type={card.PageParam.Icon} />}
        {card.text}
        {card.MenuName}
      </div>
      {/* 自定义模板,在新页面编辑 */}
      {!card.forbidden && card.type !== 'CustomPage' ? <Icon className="edit" type="edit" onClick={edit} /> : null}
src/templates/menuconfig/menuelement/index.jsx
@@ -19,7 +19,7 @@
  }
  const findCard = id => {
    const card = cards.filter(c => `${c.id}` === id)[0]
    const card = cards.filter(c => c.MenuID === id)[0]
    return {
      card,
      index: cards.indexOf(card),
@@ -49,8 +49,8 @@
    <div ref={drop} className="sidemenu-dragboard">
      {cards.map(card => (
        <Card
          key={card.id}
          id={card.id}
          key={card.MenuID}
          id={card.MenuID}
          card={card}
          moveCard={moveCard}
          editCard={editCard}
src/templates/menuconfig/menuform/index.jsx
@@ -70,8 +70,8 @@
                  getPopupContainer={() => document.getElementById('form-box')}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.MenuID} title={option.text} key={option.MenuID} value={option.MenuID}>
                      {item.key === 'icon' && <Icon type={option.text} />} {option.text}
                    <Select.Option id={option.MenuID} key={option.MenuID} value={option.MenuID}>
                      {item.key === 'icon' && <Icon type={option.text} />} {option.text || option.MenuName}
                    </Select.Option>
                  )}
                </Select>
src/templates/sharecomponent/actioncomponent/actionform/index.jsx
@@ -4,8 +4,6 @@
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Cascader } from 'antd'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -629,11 +627,7 @@
                  }
                ]
              })(
                <Cascader
                  options={this.state.menulist}
                  loadData={this.loadData}
                  placeholder=""
                />
                <Cascader options={this.state.menulist} placeholder="" />
              )}
            </Form.Item>
          </Col>
@@ -641,57 +635,6 @@
      }
    })
    return fields
  }
  loadData = selectedOptions => {
    const { MenuID } = this.props
    const targetOption = selectedOptions[selectedOptions.length - 1]
    targetOption.loading = true
    let _param = {
      func: 'sPC_Get_FunMenu',
      ParentID: targetOption.value,
      systemType: options.sysType,
      debug: 'Y'
    }
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        targetOption.loading = false
        targetOption.children = result.data.map(item => {
          let submenu = {
            value: item.ParentID,
            label: item.MenuNameP,
            children: item.FunMenu.map(cell => {
              return {
                value: cell.MenuID,
                label: cell.MenuName,
                MenuID: cell.MenuID,
                MenuName: cell.MenuName,
                MenuNo: cell.MenuNo,
                Ot: cell.Ot,
                PageParam: cell.PageParam,
                LinkUrl: cell.LinkUrl,
                disabled: cell.MenuID === MenuID
              }
            })
          }
          return submenu
        })
        this.setState({
          menulist: [...this.state.menulist]
        })
      } else {
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
        targetOption.loading = false
      }
    })
  }
  handleConfirm = () => {
src/templates/sharecomponent/actioncomponent/index.jsx
@@ -5,7 +5,6 @@
import moment from 'moment'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import DevUtils from '@/utils/devutils.js'
import zhCN from '@/locales/zh-CN/model.js'
@@ -146,57 +145,27 @@
    </div>
    let menulist = []
    if (menu.fstMenuList) {
      menulist = menu.fstMenuList.map(item => {
        return {
          value: item.MenuID,
          label: item.text,
          isLeaf: false
        }
      })
    }
      let trees = fromJS(menu.fstMenuList).toJS()
    if (menu.fstMenuList && card.linkmenu && card.linkmenu.length > 0) {
      let _param = {
        func: 'sPC_Get_FunMenu',
        ParentID: card.linkmenu[0],
        systemType: options.sysType,
        debug: 'Y'
      }
      menulist = trees.map(fst => {
        fst.value = fst.MenuID
        fst.label = fst.MenuName
        fst.isLeaf = false
        fst.children = fst.children.map(snd => {
          snd.value = snd.MenuID
          snd.label = snd.MenuName
  
      Api.getSystemConfig(_param).then(result => {
        if (result.status) {
          menulist = menulist.map(item => {
            if (item.value === card.linkmenu[0]) {
              item.children = result.data.map(item => {
                let submenu = {
                  value: item.ParentID,
                  label: item.MenuNameP,
                  children: item.FunMenu.map(cell => {
                    return {
                      value: cell.MenuID,
                      label: cell.MenuName,
                      MenuID: cell.MenuID,
                      MenuName: cell.MenuName,
                      MenuNo: cell.MenuNo,
                      Ot: cell.Ot,
                      PageParam: cell.PageParam,
                      LinkUrl: cell.LinkUrl,
                      disabled: cell.MenuID === menu.MenuID
                    }
          snd.children = snd.children.map(thd => {
            thd.value = thd.MenuID
            thd.label = thd.MenuName
            thd.disabled = thd.MenuID === menu.MenuID
            return thd
                  })
                }
                return submenu
          return snd
              })
            }
            return item
          })
        } else {
          notification.warning({
            top: 92,
            message: result.message,
            duration: 5
        return fst
          })
        }
@@ -205,14 +174,6 @@
          card: card,
          formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps)
        })
      })
    } else {
      this.setState({
        visible: true,
        card: card,
        formlist: getActionForm(card, functip, this.props.config, this.props.usefulFields, this.props.type, menulist, this.state.printTemps)
      })
    }
  }
  /**
src/templates/sharecomponent/columncomponent/columnform/index.jsx
@@ -1,10 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon, Cascader, notification } from 'antd'
import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon, Cascader } from 'antd'
import { formRule } from '@/utils/option.js'
import options from '@/store/options.js'
import Api from '@/api'
import './index.scss'
const columnTypeOptions = {
@@ -289,7 +287,6 @@
              })(
                <Cascader
                  options={this.state.menulist}
                  loadData={this.loadData}
                  placeholder=""
                  getPopupContainer={() => document.getElementById('columnwinter')}
                />
@@ -300,57 +297,6 @@
      }
    })
    return fields
  }
  loadData = selectedOptions => {
    const { MenuID } = this.props
    const targetOption = selectedOptions[selectedOptions.length - 1]
    targetOption.loading = true
    let _param = {
      func: 'sPC_Get_FunMenu',
      ParentID: targetOption.value,
      systemType: options.sysType,
      debug: 'Y'
    }
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        targetOption.loading = false
        targetOption.children = result.data.map(item => {
          let submenu = {
            value: item.ParentID,
            label: item.MenuNameP,
            children: item.FunMenu.map(cell => {
              return {
                value: cell.MenuID,
                label: cell.MenuName,
                MenuID: cell.MenuID,
                MenuName: cell.MenuName,
                MenuNo: cell.MenuNo,
                Ot: cell.Ot,
                PageParam: cell.PageParam,
                LinkUrl: cell.LinkUrl,
                disabled: cell.MenuID === MenuID
              }
            })
          }
          return submenu
        })
        this.setState({
          menulist: [...this.state.menulist]
        })
      } else {
        notification.warning({
          top: 92,
          message: result.message,
          duration: 5
        })
        targetOption.loading = false
      }
    })
  }
  handleConfirm = () => {
src/templates/sharecomponent/columncomponent/index.jsx
@@ -3,8 +3,6 @@
import { is, fromJS } from 'immutable'
import { Icon, Tooltip, Modal, notification, Switch, message, Spin } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { getColumnForm } from '@/templates/zshare/formconfig'
@@ -91,76 +89,36 @@
    const { menu } = this.props
    if (card.type !== 'colspan') {
      let menulist = menu.fstMenuList.map(item => {
        return {
          value: item.MenuID,
          label: item.text,
          isLeaf: false
        }
      let menulist = []
      if (menu.fstMenuList) {
        let trees = fromJS(menu.fstMenuList).toJS()
        menulist = trees.map(fst => {
          fst.value = fst.MenuID
          fst.label = fst.MenuName
          fst.isLeaf = false
          fst.children = fst.children.map(snd => {
            snd.value = snd.MenuID
            snd.label = snd.MenuName
            snd.children = snd.children.map(thd => {
              thd.value = thd.MenuID
              thd.label = thd.MenuName
              thd.disabled = thd.MenuID === menu.MenuID
              return thd
      })
      if ((card.type === 'text' || card.type === 'number') && card.linkmenu && card.linkmenu.length > 0) {
        let _param = {
          func: 'sPC_Get_FunMenu',
          ParentID: card.linkmenu[0],
          systemType: options.sysType,
          debug: 'Y'
        }
        this.setState({
          loading: true
            return snd
        })
        Api.getSystemConfig(_param).then(result => {
          if (result.status) {
            menulist = menulist.map(item => {
              if (item.value === card.linkmenu[0]) {
                item.children = result.data.map(item => {
                  let submenu = {
                    value: item.ParentID,
                    label: item.MenuNameP,
                    children: item.FunMenu.map(cell => {
                      return {
                        value: cell.MenuID,
                        label: cell.MenuName,
                        MenuID: cell.MenuID,
                        MenuName: cell.MenuName,
                        MenuNo: cell.MenuNo,
                        Ot: cell.Ot,
                        PageParam: cell.PageParam,
                        LinkUrl: cell.LinkUrl,
                        disabled: cell.MenuID === menu.MenuID
                      }
          return fst
                    })
                  }
                  return submenu
                })
              }
              return item
            })
          } else {
            notification.warning({
              top: 92,
              message: result.message,
              duration: 5
            })
          }
          this.setState({
            loading: false,
            modaltype: 'columns',
            card: card,
            formlist: getColumnForm(card, this.props.sysRoles, menulist)
          })
        })
      } else {
        this.setState({
          modaltype: 'columns',
          card: card,
          formlist: getColumnForm(card, this.props.sysRoles, menulist)
        })
      }
    } else {
      this.setState({
        modaltype: 'colspan',
src/utils/utils.js
@@ -642,9 +642,7 @@
    } else {
      baseurl = window.GLOB.location + window.GLOB.service
    }
    // if (!/Content\/images\/upload\//.test(url)) {
    //   baseurl = baseurl + 'Content/images/upload/'
    // }
    let realurl = url.match(/^http/) || url.match(/^\/\//) ? url : baseurl + url
    return realurl
  }
src/views/billprint/index.jsx
@@ -107,29 +107,39 @@
        }
        config.style = config.style || {}
        config.zoom = 1
        config.pageSize = ['A4', 'A3', 'A5'].includes(config.pageSize) ? config.pageSize : 'A4'
        config.pageLayout = config.pageLayout !== 'horizontal' ? 'vertical' : 'horizontal'
        config.pagePadding = config.pagePadding !== 'without' ? 'default' : 'without'
        if (config.pageSize === 'A3') {
          if (config.pageLayout === 'horizontal') {
            config.zoom = 1.35
            config.style.height = 845
          } else {
            config.style.height = 1695
          }
        } else if (config.pageSize === 'A5') {
          config.zoom = 0.7
          if (config.pageLayout === 'horizontal') {
            config.style.height = 840
          } else {
            config.style.height = 1700
          }
        } else {
          if (config.pageLayout === 'horizontal') {
            config.style.height = 845
          } else {
            config.style.height = 1680
        let pageParam = {
          A4: {
            vertical: 1000,
            horizontal: 1200,
            verticaldefault: 1.45789,
            verticalwithout: 1.41428,
            horizontaldefault: 0.685,
            horizontalwithout: 0.705,
          },
          A3: {
            vertical: 1200,
            horizontal: 1600,
            verticaldefault: 1.44404,
            verticalwithout: 1.41414,
            horizontaldefault: 0.6923,
            horizontalwithout: 0.707,
          },
          A5: {
            vertical: 700,
            horizontal: 1000,
            verticaldefault: 1.482,
            verticalwithout: 1.417,
            horizontaldefault: 0.6736,
            horizontalwithout: 0.7047,
          }
        }
        config.width = pageParam[config.pageSize][config.pageLayout]
        config.style.height = Math.floor(config.width * pageParam[config.pageSize][config.pageLayout + config.pagePadding])
        let params = []
        let _pars = []
@@ -457,55 +467,35 @@
  print = () => {
    const { config } = this.state
    let jubuData = document.getElementById('bill-print').innerHTML
    window.document.body.innerHTML = jubuData
    document.getElementsByTagName('body')[0].style.width = '1200px'
    document.getElementsByTagName('body')[0].style.margin = '0 auto'
    document.getElementsByTagName('body')[0].style.zoom = config.zoom
    try {
      if (window.ActiveXObject) {
        let hkeyRoot
        let hkeyPath
        let hkeyKey
        // eslint-disable-next-line
        let RegWsh = new ActiveXObject('WScript.Shell')
      let iframe = document.createElement('IFRAME')
      let linkList = document.getElementsByTagName('link')     // 获取父窗口link标签对象列表
      let styleList = document.getElementsByTagName('style')   // 获取父窗口style标签对象列表
        hkeyRoot = 'HKEY_CURRENT_USER'
        hkeyPath = '\\Software\\Microsoft\\Internet Explorer\\PageSetup\\'
      document.body.appendChild(iframe)
      let doc = iframe.contentWindow.document
        // 设置页眉/脚的字体样式
        hkeyKey = 'font'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, 'font-size: 12px; font-family: 黑体; line-height: 24px')
        // 设置页眉
        hkeyKey = 'header'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '打印编号')
        // 设置页脚
        hkeyKey = 'footer'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '&b第 &p 页/共 &P 页')
        // 设置页边距(0.6 要乘以 2.5为实际打印的尺寸)
        hkeyKey = 'margin_bottom'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '0.6')
        hkeyKey = 'margin_left'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '0.6')
        hkeyKey = 'margin_right'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '0.6')
        hkeyKey = 'margin_top'
        RegWsh.RegWrite(hkeyRoot + hkeyPath + hkeyKey, '0.6')
        window.print()
      } else {
        window.print()
      doc.open()
      doc.write(`<!DOCTYPE html><html lang="en"><head>`)
      for (let i = 0;i < linkList.length;i++) {
        if (linkList[i].type === 'text/css') {
          doc.write(`<LINK rel="stylesheet" type="text/css" href="${linkList[i].href}">`)
      }
      }
      doc.write(`<style>body{width: ${config.width}px!important;}</style>`)
      for (let i = 0;i < styleList.length;i++) {
        doc.write('<style>' + styleList[i].innerHTML + '</style>')
      }
      doc.write(`</head><body>`)
      doc.write(jubuData)
      doc.write(`</body></html>`)
      doc.close()
      iframe.contentWindow.focus()
      iframe.contentWindow.print()
      document.getElementsByTagName('body')[0].style.zoom = 1
      document.body.removeChild(iframe)
      setTimeout(() => {
        window.close()
src/views/menudesign/homeform/index.jsx
@@ -17,8 +17,6 @@
    if (key === 'cacheUseful') {
      this.props.updateConfig({...config, cacheUseful: value})
    } else if (key === 'diffUser') {
      this.props.updateConfig({...config, diffUser: value})
    } else if (key === 'timeUnit') {
      this.props.updateConfig({...config, timeUnit: value})
    }
@@ -65,23 +63,6 @@
              )}
            </Form.Item>
          </Col>
          {config.cacheUseful === 'true' ? <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="对于不同用户,查询信息是否存在差异。">
                <Icon type="question-circle" />
                区分用户
              </Tooltip>
            }>
              {getFieldDecorator('diffUser', {
                initialValue: config.diffUser || 'true'
              })(
                <Radio.Group onChange={(e) => {this.selectChange('diffUser', e.target.value)}}>
                  <Radio value="true">是</Radio>
                  <Radio value="false">否</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          {config.cacheUseful === 'true' ? <Col span={24}>
            <Form.Item label="单位">
              {getFieldDecorator('timeUnit', {
src/views/menudesign/menuform/index.jsx
@@ -4,6 +4,7 @@
import { Form, Row, Col, Input, Select, notification, Radio, Icon, Tooltip, InputNumber } from 'antd'
import Api from '@/api'
import options from '@/store/options.js'
import './index.scss'
class CustomMenuForm extends Component {
@@ -25,48 +26,72 @@
  }
  UNSAFE_componentWillMount () {
    const { parentId } = this.props
    let param = {
      func: 's_Get_FSMenusForOpen',
      SndMenuID: parentId,
      TYPE: 20,
      TypeCharOne: 'PC'
    const { MenuId } = this.props
    let _param = {func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}
    if (options.sysType !== 'cloud' && window.GLOB.systemType !== 'production') {
      _param.linkurl = window.GLOB.linkurl
    }
    _param.pro_sys = window.GLOB.systemType === 'production' ? 'Y' : ''
    Api.getSystemConfig(_param).then(result => {
      if (result.status) {
        let thdMenu = null
        let menulist = result.fst_menu.map(fst => {
          let fstItem = {
            MenuID: fst.MenuID,
            MenuName: fst.MenuName,
            children: []
    }
    Api.getSystemConfig(param).then(result => {
      if (result.status) {
        let menulist = result.data.map(smenu => {
          let _smenu = {
            value: smenu.FstID,
            text: smenu.FstName,
            options: smenu.SndData.map(menu => {
              return {
                value: menu.SndID,
                text: menu.SndName,
          if (fst.snd_menu) {
            fstItem.children = fst.snd_menu.map(snd => {
              let sndItem = {
                ParentId: fst.MenuID,
                MenuID: snd.MenuID,
                MenuName: snd.MenuName,
                children: []
              }
              if (snd.trd_menu) {
                sndItem.children = snd.trd_menu.map(trd => {
                  let trdItem = {
                    FstId: fst.MenuID,
                    ParentId: snd.MenuID,
                    MenuID: trd.MenuID,
                    MenuName: trd.MenuName,
                    MenuNo: trd.MenuNo,
                    EasyCode: trd.EasyCode
                  }
                  if (MenuId === trd.MenuID) {
                    thdMenu = trdItem
                  }
                  return trdItem
            })
          }
          return _smenu
              return sndItem
            })
          }
          return fstItem
        })
        let smenulist = []
        menulist.forEach(item => {
          if (item.value === result.FstIDSeleted) {
            smenulist = item.options
          if (thdMenu && (item.MenuID === thdMenu.FstId)) {
            smenulist = item.children
          }
        })
        this.props.initMenuList({fstMenuList: fromJS(menulist).toJS(), fstMenuId: result.FstIDSeleted})
        this.props.initMenuList({fstMenuList: fromJS(menulist).toJS(), fstMenuId: thdMenu ? thdMenu.FstId : ''})
        this.setState({
          fstMenuId: result.FstIDSeleted,
          fstMenuId: thdMenu ? thdMenu.FstId : '',
          menulist,
          smenulist
        }, () => {
          this.props.form.setFieldsValue({
            fstMenuId: result.FstIDSeleted,
            parentId: parentId
            fstMenuId: thdMenu ? thdMenu.FstId : '',
            parentId: thdMenu ? thdMenu.ParentId : ''
          })
        })
      } else {
@@ -94,15 +119,15 @@
    if (key === 'fstMenuId') {
      let smenulist = []
      menulist.forEach(item => {
        if (item.value === value) {
          smenulist = item.options
        if (item.MenuID === value) {
          smenulist = item.children
        }
      })
      this.setState({
        smenulist
      }, () => {
        let _id = smenulist[0] ? smenulist[0].value : ''
        let _id = smenulist[0] ? smenulist[0].MenuID : ''
        this.props.form.setFieldsValue({parentId: _id})
        this.props.updateConfig({...config, fstMenuId: value, parentId: _id})
      })
@@ -110,8 +135,6 @@
      this.props.updateConfig({...config, parentId: value})
    } else if (key === 'cacheUseful') {
      this.props.updateConfig({...config, cacheUseful: value})
    } else if (key === 'diffUser') {
      this.props.updateConfig({...config, diffUser: value})
    } else if (key === 'timeUnit') {
      this.props.updateConfig({...config, timeUnit: value})
    }
@@ -170,8 +193,8 @@
              })(
                <Select onChange={(value) => {this.selectChange('fstMenuId', value)}}>
                  {menulist.map(option =>
                    <Select.Option key={option.value} value={option.value}>
                      {option.text}
                    <Select.Option key={option.MenuID} value={option.MenuID}>
                      {option.MenuName}
                    </Select.Option>
                  )}
                </Select>
@@ -191,8 +214,8 @@
              })(
                <Select onChange={(value) => {this.selectChange('parentId', value)}}>
                  {smenulist.map(option =>
                    <Select.Option key={option.value} value={option.value}>
                      {option.text}
                    <Select.Option key={option.MenuID} value={option.MenuID}>
                      {option.MenuName}
                    </Select.Option>
                  )}
                </Select>
@@ -242,23 +265,6 @@
              )}
            </Form.Item>
          </Col>
          {config.cacheUseful === 'true' ? <Col span={24}>
            <Form.Item label={
              <Tooltip placement="topLeft" title="对于不同用户,查询信息是否存在差异。">
                <Icon type="question-circle" />
                区分用户
              </Tooltip>
            }>
              {getFieldDecorator('diffUser', {
                initialValue: config.diffUser || 'true'
              })(
                <Radio.Group onChange={(e) => {this.selectChange('diffUser', e.target.value)}}>
                  <Radio value="true">是</Radio>
                  <Radio value="false">否</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col> : null}
          {config.cacheUseful === 'true' ? <Col span={24}>
            <Form.Item label="单位">
              {getFieldDecorator('timeUnit', {
src/views/menudesign/printmenuform/index.jsx
@@ -83,7 +83,7 @@
                rules: [
                  {
                    required: true,
                    message: dict['mob.required.input'] + '打印布局!'
                    message: dict['mob.required.select'] + '打印布局!'
                  }
                ]
              })(
@@ -95,6 +95,24 @@
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="打印边距">
              {getFieldDecorator('pagePadding', {
                initialValue: config.pagePadding || 'default',
                rules: [
                  {
                    required: true,
                    message: dict['mob.required.select'] + '打印边距!'
                  }
                ]
              })(
                <Radio.Group onChange={(e) => {this.onRadioChange(e.target.value)}}>
                  <Radio value="default">默认</Radio>
                  <Radio value="without">无</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="首页数(条)">
              {getFieldDecorator('firstCount', {
                initialValue: config.firstCount,