king
2024-06-28 c8804ceb1fe2dea76f9949c5ea04423876ee2c81
src/views/design/header/index.jsx
@@ -16,6 +16,8 @@
const VersionsUp = asyncComponent(() => import('./versions'))
const ThawMenu = asyncComponent(() => import('@/components/thawmenu'))
const MenuForm = asyncComponent(() => import('./editfirstmenu/menuform'))
const TransMenu = asyncComponent(() => import('./transmenu'))
const { confirm } = Modal
class Header extends Component {
@@ -23,7 +25,8 @@
    menulist: null, // 一级菜单
    userName: sessionStorage.getItem('CloudUserName'),
    avatar: Utils.getrealurl(sessionStorage.getItem('CloudAvatar')),
    memberLevel: Utils.getMemberLevel(),
    logo: sessionStorage.getItem('CloudLogo') || MainLogo,
    subLang: sessionStorage.getItem('subLangList') !== null,
    visible: false,
    loading: false
  }
@@ -37,6 +40,7 @@
      onOk() {
        sessionStorage.clear()
        _this.props.history.replace('/login')
        window.location.reload()
      },
      onCancel() {}
    })
@@ -142,6 +146,7 @@
                EasyCode: trd.EasyCode,
                type: 'CommonTable',            // 默认值为常用表
                OpenType: 'newtab',             // 打开方式
                up_action: window.GLOB.upStatus && trd.up_action === 'Y',
                level: 'third'
              }
  
@@ -154,7 +159,7 @@
                trdItem.PageParam = {OpenType: 'newtab'}
              }
              if (trdItem.type === 'CustomPage' && this.state.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限
              if (trdItem.type === 'CustomPage' && window.GLOB.memberLevel < 20) { // 会员等级大于等于20时,有编辑权限
                trdItem.forbidden = true
              }
@@ -298,17 +303,18 @@
        inner join (select openid from sapp where id='${window.GLOB.appkey}') b 
        on a.openid=b.openid`
  
      _sql = Utils.formatOptions(_sql)
      _sql = Utils.formatOptions(_sql, 'x')
  
      let param = {
        func: 'sPC_Get_SelectedList',
        LText: _sql,
        obj_name: 'data',
        arr_field: 'ID,TemplateCode,SignName'
        arr_field: 'ID,TemplateCode,SignName',
        exec_type: 'x'
      }
      
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      param.secretkey = Utils.encrypt('', param.timestamp)
      param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证
      
      Api.getCloudConfig(param).then(res => {
@@ -338,10 +344,6 @@
    window.addEventListener('storage', (e) => {
      if (e.key === 'menuUpdate') {
        this.reload()
      } else if (e.key === 'wxTemplates') {
        if (e.newValue) {
          sessionStorage.setItem('wxTemplates', e.newValue)
        }
      }
    })
    MKEmitter.addListener('mkUpdateMenuList', this.reload)
@@ -407,11 +409,11 @@
  render () {
    const { mainMenu, editLevel } = this.props
    const { menulist, memberLevel, visible, loading } = this.state
    const { menulist, visible, loading, logo, subLang } = this.state
    return (
      <header className={'sys-header-container ant-menu-dark ' + (['level2', 'level3'].includes(editLevel) ? 'mask' : '')} id="main-header-container">
        <div className="header-logo"><img src={MainLogo} alt=""/></div>
        <div className="header-logo"><img src={logo} alt=""/></div>
        <div className="header-collapse">
          <MenuFoldOutlined/>
        </div>
@@ -449,7 +451,7 @@
              <div className="icon"><HomeOutlined /></div>
              <div className="title">首页</div>
              <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div>
              <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}>
              <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}>
                编辑
              </Button>
            </div> : null
@@ -458,7 +460,7 @@
            <div className="icon"><ApiOutlined /></div>
            <div className="title">接口调试</div>
            <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div>
            <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}>
            <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/interface')}}>
              编辑
            </Button>
          </div>
@@ -467,10 +469,10 @@
            <div className="title">应用管理</div>
            <div className="detail">可创建及管理PC、pad及移动端等不同设备的应用,实现明科云APP、微信公众号、小程序等多平台的应用共享。</div>
            {window.GLOB.systemType !== 'production' ? 
              <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appmanage')}}>
              <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/appmanage')}}>
                编辑
              </Button> :
              <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appcheck')}}>
              <Button type="primary" disabled={window.GLOB.memberLevel < 20} title={window.GLOB.memberLevel < 20 ? '会员等级不够,无开发权限。' : ''} onClick={() => {window.open('#/appcheck')}}>
                查看
              </Button>
            }
@@ -491,6 +493,12 @@
              编辑
            </Button>
          </div> : null}
          {window.GLOB.systemType !== 'production' && subLang ? <div className="entrance">
            <div className="icon"><PlusOutlined /></div>
            <div className="title">菜单转换</div>
            <div className="detail">可选择母语系统的菜单,快速转换到当前语言。打印模板请在HS下复制后,在此处选择指定模板进行语言转换。</div>
            <TransMenu reload={this.reload} menulist={menulist}/>
          </div> : null}
        </div>
        {/* 编辑菜单 */}
        {editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null}