king
2023-06-23 50821207863ae07b0ab36a604fcbad200a055af9
2023-06-23
12个文件已修改
230 ■■■■■ 已修改文件
src/components/breadview/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/basetable/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/rolemanage/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/newpagebutton/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/sidemenu/thdmenuform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mkiframe/index.jsx 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/breadview/index.jsx
@@ -87,23 +87,23 @@
  selectcomponent = (view) => {
    // 根据tab页中菜单信息,选择所需的组件
    if (view.type === 'BaseTable') {
      return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<BaseTable MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'CustomPage') {
      return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<CustomPage MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'Home') {
      return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
      return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>)
    } else if (view.type === 'RolePermission') {
      return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
      return (<RoleManage MenuID={view.MenuID}/>)
    } else if (view.type === 'CommonTable') {
      return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'TreePage') {
      return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
      return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>)
    } else if (view.type === 'FormTab') {
      return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
      return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>)
    } else if (view.type === 'iframe') {
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
      return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
    } else {
      return (<NotFount key={view.MenuID} />)
      return (<NotFount />)
    }
  }
src/components/header/index.jsx
@@ -193,7 +193,7 @@
            fstItem.OpenType = 'newpage'
            fstItem.src = PageParam.linkUrl
            if (/#\/iframe\//.test(fstItem.src)) {
              fstItem.src = fstItem.src.replace(/@userid@/ig, sessionStorage.getItem('UserID')).replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
              fstItem.src = fstItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
              fstItem.type = 'iframe'
              fstItem.OpenType = 'newtab'
            }
@@ -247,7 +247,7 @@
                    trdItem.OpenType = 'newpage'
                    trdItem.src = PageParam.url || ''
                    if (/#\/iframe\//.test(trdItem.src)) {
                      trdItem.src = trdItem.src.replace(/@userid@/ig, sessionStorage.getItem('UserID')).replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
                      trdItem.src = trdItem.src.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
                      trdItem.type = 'iframe'
                      trdItem.OpenType = 'newtab'
                    }
src/components/tabview/index.jsx
@@ -194,23 +194,23 @@
  selectcomponent = (view) => {
    // 根据tab页中菜单信息,选择所需的组件
    if (view.type === 'Home') {
      return (<Home MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
    } else if (view.type === 'CommonTable') {
      return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<Home MenuID={view.MenuID} MenuName={view.MenuName}/>)
    } else if (view.type === 'BaseTable') {
      return (<BaseTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<BaseTable MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'CustomPage') {
      return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param} changeTemp={this.changeTemp}/>)
      return (<CustomPage MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'CommonTable') {
      return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param} changeTemp={this.changeTemp}/>)
    } else if (view.type === 'TreePage') {
      return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
      return (<TreePage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>)
    } else if (view.type === 'RolePermission') {
      return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
      return (<RoleManage MenuID={view.MenuID}/>)
    } else if (view.type === 'FormTab') {
      return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
      return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} param={view.param}/>)
    } else if (view.type === 'iframe') {
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
      return (<Iframe MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
    } else {
      return (<NotFount key={view.MenuID} />)
      return (<NotFount />)
    }
  }
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -424,6 +424,7 @@
      key: 'url',
      label: '页面地址',
      initVal: card.url || '',
      tooltip: appType === '' ? '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。' : '',
      required: true
    },
    {
@@ -1467,6 +1468,7 @@
      key: 'url',
      label: '页面地址',
      initVal: card.url || '',
      tooltip: '地址格式为:http://******/admin/index.html#/iframe/menuId/loginuid/BID 会打开标签页。注:使用@loginuid@时自动替换为当前系统的loginuid;选择单行且拼接参数时会拼接BID。',
      required: true
    },
    {
src/router/index.js
@@ -48,8 +48,8 @@
  {path: '/role/:param', name: 'role', component: RoleManage},
  {path: '/hs', name: 'hs', component: SystemFunc},
  {path: '/proc', name: 'proc', component: SystemProc},
  {path: '/iframe/:menuId/:userId/:loginUid', name: 'iframe', component: MkIframe},
  {path: '/iframe/:menuId/:userId/:loginUid/:bid', name: 'iframe', component: MkIframe},
  {path: '/iframe/:menuId/:loginUid', name: 'iframe', component: MkIframe},
  {path: '/iframe/:menuId/:loginUid/:bid', name: 'iframe', component: MkIframe},
  {path: '/interface', name: 'interface', component: Interface}
]
src/tabviews/basetable/index.jsx
@@ -25,7 +25,6 @@
    param: PropTypes.any,        // 其他页面传递的参数
    Tab: PropTypes.string,       // 弹窗标签
    MenuID: PropTypes.string,    // 菜单Id
    MenuNo: PropTypes.string,    // 菜单参数
    MenuName: PropTypes.string,  // 菜单名称
    changeTemp: PropTypes.func
  }
@@ -51,7 +50,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { MenuID } = this.props
    const { MenuID, MenuName } = this.props
    let _param = {
      func: 'sPC_Get_LongParam',
@@ -67,6 +66,8 @@
        config = window.decodeURIComponent(window.atob(result.LongParam))
        config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl)
        config = JSON.parse(config)
        config.MenuID = MenuID
        config.MenuName = MenuName || config.MenuName
      } catch (e) {
        console.warn('Parse Failure')
        config = ''
@@ -156,7 +157,7 @@
        })
      }
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName)
      let autoMatic = null
      if (config.autoMatic && config.autoMatic.enable === 'true') {
@@ -263,11 +264,11 @@
    }
  }
  filterComponent = (components, roleId, permAction, skip, urlparam, pageId) => {
  filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName) => {
    return components.filter(item => {
      item.$pageId = pageId
      item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '主表')
      item.$menuname = (MenuName || '') + '-' + (item.name || '主表')
      if (item.type === 'tabs') {
        item.subtabs = item.subtabs.filter(tab => {
@@ -286,13 +287,13 @@
          if (tab.permission !== 'true') { // 权限未开启不做权限控制
            skip = true
          }
          tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId)
          tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName)
          return tab
        })
        return true
      } else {
        item.name = (this.props.MenuName || '')
        item.name = (MenuName || '')
      }
      // 搜索条件初始化
src/tabviews/custom/index.jsx
@@ -52,7 +52,6 @@
    param: PropTypes.any,        // 其他页面传递的参数
    Tab: PropTypes.string,       // 弹窗标签
    MenuID: PropTypes.string,    // 菜单Id
    MenuNo: PropTypes.string,    // 菜单参数
    MenuName: PropTypes.string,  // 菜单名称
    changeTemp: PropTypes.func
  }
@@ -80,7 +79,7 @@
   * @description 获取页面配置信息
   */
  async loadconfig () {
    const { MenuID } = this.props
    const { MenuID, MenuName } = this.props
    let _param = {
      func: 'sPC_Get_LongParam',
@@ -97,6 +96,7 @@
        config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl)
        config = JSON.parse(config)
        config.MenuID = MenuID
        config.MenuName = MenuName || config.MenuName
      } catch (e) {
        console.warn('Parse Failure')
        config = ''
@@ -207,7 +207,7 @@
      let initInters = []
      config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache)
      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.MenuName)
      
      // 获取主搜索条件
      let mainSearch = []
@@ -336,7 +336,7 @@
    }
  }
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => {
  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) => {
    return components.filter(item => {
      item.$pageId = pageId
      item.$cache = cache
@@ -348,7 +348,7 @@
        delete item.style.shadowColor
      }
      item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '')
      item.$menuname = (MenuName || '') + '-' + (item.name || '')
      if (item.type === 'tabs') {
        if (
@@ -423,7 +423,7 @@
        item.subtabs = item.subtabs.map(tab => {
          tab.$pageId = pageId
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
          return tab
        })
@@ -436,7 +436,7 @@
          return false
        }
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
        return true
      } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {
src/tabviews/rolemanage/index.jsx
@@ -20,7 +20,6 @@
export default class RoleManage extends Component {
  static propTpyes = {
    MenuNo: PropTypes.string, // 菜单参数
    MenuID: PropTypes.string  // 菜单Id
  }
src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -193,12 +193,18 @@
      window.open(url)
    } else if (btn.pageTemplate === 'custom') {
      if (/#\/iframe\//.test(btn.url)) {
        let url = btn.url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
        if (btn.Ot === 'requiredSgl' && btn.joint !== 'false') {
          url = url + '/' + Id
        }
        let menu = {
          MenuID: btn.uuid,
          MenuName: btn.label,
          type: 'iframe',
          OpenType: 'newtab',
          src: btn.url.replace(/@userid@/ig, sessionStorage.getItem('UserID')).replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
          src: url
        }
        MKEmitter.emit('modifyTabs', menu)
src/views/design/sidemenu/thdmenuform/index.jsx
@@ -147,7 +147,7 @@
          </Col>
          {menu.Template === 'NewPage' ? <Col span={22}>
            <Form.Item label={
              <Tooltip overlayStyle={{minWidth: 500}} placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>使用同一单点系统下的其他业务系统,链接格式为:http://<span style={{color: 'orange'}}>******</span>/admin/index.html#/iframe/<span style={{color: 'orange'}}>menuId</span>/<span style={{color: 'orange'}}>userid</span>/<span style={{color: 'orange'}}>loginuid</span>/<span style={{color: 'orange'}}>BID</span>。注:******为域名+虚拟目录;menuId为菜单ID;userid为用户ID(使用@userid@时自动替换为当前系统的userid);loginuid为登录信息(使用@loginuid@时自动替换为当前系统的loginuid);BID是向菜单中的传参,可为空。</div>}><QuestionCircleOutlined className="mk-form-tip" />链接地址</Tooltip>
              <Tooltip overlayStyle={{minWidth: 500}} placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>使用同一单点系统下的其他业务系统,链接格式为:http://<span style={{color: 'orange'}}>******</span>/admin/index.html#/iframe/<span style={{color: 'orange'}}>menuId</span>/<span style={{color: 'orange'}}>loginuid</span>/<span style={{color: 'orange'}}>BID</span>。注:******为域名+虚拟目录;menuId为菜单ID;loginuid为登录信息(使用@loginuid@时自动替换为当前系统的loginuid);BID是向菜单中的传参,可为空。</div>}><QuestionCircleOutlined className="mk-form-tip" />链接地址</Tooltip>
            }>
              {getFieldDecorator('url', {
                initialValue: menu.url || '',
src/views/login/index.jsx
@@ -149,7 +149,13 @@
        }
      }
      this.props.history.replace('/main')
      let iframe = sessionStorage.getItem('iframe')
      if (iframe) {
        sessionStorage.removeItem('iframe')
        this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
      } else {
        this.props.history.replace('/main')
      }
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
      message.warning('应用尚未创建,请向云端同步应用!')
@@ -203,7 +209,13 @@
      sessionStorage.removeItem('visitorUserID')
      sessionStorage.removeItem('visitorLoginUID')
      this.props.history.replace('/main')
      let iframe = sessionStorage.getItem('iframe')
      if (iframe) {
        sessionStorage.removeItem('iframe')
        this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
      } else {
        this.props.history.replace('/main')
      }
    } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
      message.warning('应用尚未创建,请向云端同步应用!')
@@ -242,7 +254,13 @@
        sessionStorage.removeItem('visitorUserID')
        sessionStorage.removeItem('visitorLoginUID')
  
        this.props.history.replace('/main')
        let iframe = sessionStorage.getItem('iframe')
        if (iframe) {
          sessionStorage.removeItem('iframe')
          this.props.history.replace(iframe.replace(/@loginuid@/, res.LoginUID))
        } else {
          this.props.history.replace('/main')
        }
      } else if (res.ErrCode === 'Need_Get_Appkey' && options.sysType === 'SSO') {
        message.warning('应用尚未创建,请向云端同步应用!')
  
src/views/mkiframe/index.jsx
@@ -1,66 +1,98 @@
import React, {Component} from 'react'
import { Spin } from 'antd'
import { Spin, notification } from 'antd'
import Api from '@/api'
import asyncComponent from '@/utils/asyncLoadComponent'
import './index.scss'
const CustomPage = asyncComponent(() => import('@/tabviews/custom'))
const BaseTable = asyncComponent(() => import('@/tabviews/basetable'))
class MkIframe extends Component {
  state = {
    loading: true
    loading: true,
    BID: '',
    MenuId: '',
    type: 'CustomPage'
  }
  UNSAFE_componentWillMount() {
    const { menuId, userId, loginUid, bid } = this.props.match.params
    const { menuId, loginUid, bid } = this.props.match.params
    sessionStorage.setItem('LoginUID', '202306221645124938E53FE0520A64CE2B486')
    // sessionStorage.setItem('LoginUID', loginUid)
    console.log(userId)
    Api.getTouristMsg('login_check', 'http://demo.mk9h.cn/erp_new/webapi/dostars').then(res => {
      console.log(res)
      if (res.status) {
      } else {
    if (sessionStorage.getItem('UserID')) {
      this.getPermRole()
    } else {
      sessionStorage.setItem('LoginUID', loginUid)
      Api.getTouristMsg('login_check').then(res => {
        if (res.status) {
          sessionStorage.setItem('UserID', res.UserID)
          sessionStorage.setItem('LoginUID', res.LoginUID)
          sessionStorage.setItem('User_Name', res.UserName)
          sessionStorage.setItem('Full_Name', res.FullName)
          sessionStorage.setItem('avatar', res.icon || '')
          sessionStorage.setItem('dataM', res.dataM ? 'true' : '')
          sessionStorage.setItem('debug', res.debug || '')
          sessionStorage.setItem('role_id', res.role_id || '')
          sessionStorage.setItem('departmentcode', res.departmentcode || '')
          sessionStorage.setItem('organization', res.organization || '')
          sessionStorage.setItem('mk_user_type', res.mk_user_type || '')
          this.getPermRole()
        } else {
          sessionStorage.clear()
          sessionStorage.setItem('iframe', `/iframe/${menuId}/@loginuid@/${bid || ''}`)
          this.props.history.replace('/login')
        }
      })
    }
    this.setState({BID: bid || '', MenuId: menuId})
  }
  getPermRole = () => {
    Api.getSystemConfig({
      func: 's_Get_TrdMenu_Role',
      edition_type: 'A',
      pro_sys: window.GLOB.systemType === 'production' ? 'Y' : ''
    }).then(result => {
      if (!result.status) {
        notification.error({
          top: 92,
          message: result.message,
          duration: 10
        })
        return
      }
      let _permAction = {loaded: true} // 按钮权限
      if (result.UserRoles_Menu) {
        result.UserRoles_Menu.forEach(menu => {
          if (!menu.MenuID) return
          _permAction[menu.MenuID] = true
        })
      }
      window.GLOB.mkActions = _permAction
      this.setState({loading: false})
    })
  }
  componentDidMount() {
    // sessionStorage.setItem('ThirdMenu', this.props.match.params.menuId)
    // if (sessionStorage.getItem('UserID')) {
    //   this.props.history.replace('/main')
    // } else {
    //   localStorage.setItem('getSessionStorage', window.GLOB.appkey)
    //   window.addEventListener('storage', function(event) {
    //     if (event.key === 'sessionStorage' && event.newValue && !sessionStorage.getItem('UserID')) {
    //       let values = event.newValue
    //       values = JSON.parse(values)
    //       Object.keys(values).forEach(key => {
    //         sessionStorage.setItem(key, values[key])
    //       })
    //     }
    //   })
    //   setTimeout(() => {
    //     localStorage.removeItem('getSessionStorage')
    //     localStorage.removeItem('sessionStorage')
    //     if (sessionStorage.getItem('UserID')) {
    //       this.props.history.replace('/main')
    //     } else {
    //       this.props.history.replace('/login')
    //     }
    //   }, 20)
    // }
  changeTemp = (MenuID, Template) => {
    this.setState({
      type: Template
    })
  }
  render () {
    const { loading, BID, MenuId, type } = this.state
    return (
      <div className="main-iframe">
        <Spin size="large" />
        {loading ? <Spin size="large" /> : null}
        {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null}
        {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null}
      </div>
    )
  }