king
2023-06-22 87845ae8c285399eb70bce517289157544c2aa0d
2023-06-22
17个文件已修改
2个文件已添加
197 ■■■■■ 已修改文件
src/api/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/breadview/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/breadview/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tabview/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/iframe/options.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/iframe/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/iframe/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/newpagebutton/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basedesign/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/sidemenu/editthdmenu/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/sidemenu/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/sidemenu/thdmenuform/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mkiframe/index.jsx 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mkiframe/index.scss 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -197,7 +197,7 @@
      param.thd_party_openid = openid
      param.thd_party_appid = appid
      param.id = scanId
    } else if (binding_type === 'login_check') { // appid 此时为目标
    } else if (binding_type === 'login_check') { // appid 此时为目标地址
      param.v_type = 'login_check'
      param.LoginUID = sessionStorage.getItem('LoginUID') || ''
      url = appid.replace(/\/webapi(.*)/, '/webapi/dologon/s_visitor_login')
src/components/breadview/index.jsx
@@ -15,7 +15,6 @@
const CustomPage = asyncComponent(() => import('@/tabviews/custom'))
const CommonTable = asyncComponent(() => import('@/tabviews/commontable'))
const BaseTable = asyncComponent(() => import('@/tabviews/basetable'))
const CalendarPage = asyncComponent(() => import('@/tabviews/calendar'))
const TreePage = asyncComponent(() => import('@/tabviews/treepage'))
const Iframe = asyncComponent(() => import('@/tabviews/iframe'))
const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage'))
@@ -99,12 +98,10 @@
      return (<CommonTable MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} 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}/>)
    } else if (view.type === 'CalendarPage') {
      return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} 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}/>)
    } else if (view.type === 'iframe') {
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>)
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
    } else {
      return (<NotFount key={view.MenuID} />)
    }
src/components/breadview/index.scss
@@ -30,10 +30,11 @@
  }
  iframe {
    width: 100%;
    height: calc(100vh - 115px);
    height: calc(100vh - 92px);
    overflow-y: scroll;
    border: 0;
    margin-top: 16px;
    margin: 0px;
    vertical-align: top;
  }
  .ant-back-top {
    bottom: 10px;
src/components/header/index.jsx
@@ -80,8 +80,10 @@
  changeMenu (value) {
    // 主菜单切换
    if (value.OpenType === 'outpage') {
      window.open(value.linkUrl)
    if (value.OpenType === 'newpage') {
      window.open(value.src)
    } else if (value.OpenType === 'newtab') {
      MKEmitter.emit('modifyTabs', value)
    } else if (value.OpenType === 'menu') {
      this.props.modifyMainMenu(value)
    }
@@ -188,8 +190,13 @@
          let PageParam = JSON.parse(fst.PageParam)
          if (PageParam.OpenType === 'outpage' && PageParam.linkUrl) {
            fstItem.OpenType = 'outpage'
            fstItem.linkUrl = PageParam.linkUrl
            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.type = 'iframe'
              fstItem.OpenType = 'newtab'
            }
          }
        } catch (e) {}
      }
@@ -237,16 +244,20 @@
                  trdItem.hidden = PageParam.hidden || 'false'
                  if (trdItem.type === 'NewPage') {
                    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.type = 'iframe'
                      trdItem.OpenType = 'newtab'
                    }
                  } else {
                    trdItem.src = '#/tab/' + trd.MenuID
                  }
                } catch (e) {}
              }
              if (trdItem.type !== 'NewPage') {
              } else {
                trdItem.src = '#/tab/' + trd.MenuID
              }
              trdItem.OpenType = trdItem.OpenType.toLowerCase() // NewPage为打开外部页面地址
              if (names.has(trdItem.menu_name)) {
                doublenames.set(trdItem.menu_name, true)
@@ -482,8 +493,10 @@
  changeVerMenu(menu, type) {
    if (type === 'first') {
      if (menu.OpenType === 'outpage') {
        window.open(menu.linkUrl)
      if (menu.OpenType === 'newpage') {
        window.open(menu.src)
      } else if (menu.OpenType === 'newtab') {
        MKEmitter.emit('modifyTabs', menu)
      }
    } else {
      if (menu.OpenType === 'newpage') {
src/components/tabview/index.jsx
@@ -18,7 +18,6 @@
const CustomPage = asyncComponent(() => import('@/tabviews/custom'))
const CommonTable = asyncComponent(() => import('@/tabviews/commontable'))
const BaseTable = asyncComponent(() => import('@/tabviews/basetable'))
const CalendarPage = asyncComponent(() => import('@/tabviews/calendar'))
const TreePage = asyncComponent(() => import('@/tabviews/treepage'))
const Iframe = asyncComponent(() => import('@/tabviews/iframe'))
const RoleManage = asyncComponent(() => import('@/tabviews/rolemanage'))
@@ -204,14 +203,12 @@
      return (<CustomPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} 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}/>)
    } else if (view.type === 'CalendarPage') {
      return (<CalendarPage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
    } else if (view.type === 'RolePermission') {
      return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>)
    } else if (view.type === 'FormTab') {
      return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>)
    } else if (view.type === 'iframe') {
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} MenuNo={view.MenuNo} title={view.MenuName} MenuName={view.MenuName} url={window.GLOB.baseurl + 'zh-CN/' + view.LinkUrl}/>)
      return (<Iframe key={view.MenuID} MenuID={view.MenuID} title={view.MenuName} url={view.src}/>)
    } else {
      return (<NotFount key={view.MenuID} />)
    }
src/components/tabview/index.scss
@@ -68,10 +68,11 @@
    }
    iframe {
      width: 100%;
      height: calc(100vh - 115px);
      height: calc(100vh - 92px);
      overflow-y: scroll;
      border: 0;
      margin-top: 16px;
      margin: 0px;
      vertical-align: top;
    }
  }
  .ant-back-top {
src/menu/components/iframe/options.jsx
@@ -63,7 +63,7 @@
      field: 'height',
      label: '高度',
      initval: wrap.height || '',
      tooltip: 'ifram高度。',
      tooltip: 'ifram高度。注:高度100vh时会根据标签页窗口进行调整',
      required: true,
      options: ['px', 'vh', 'vw']
    },
@@ -99,6 +99,7 @@
      field: 'linkUrl',
      label: '地址链接',
      initval: wrap.linkUrl || '',
      tooltip: '地址中的@userid@与@loginuid@会自动替换为当前系统的登录信息。',
      required: true,
      span: 24
    },
src/router/index.js
@@ -24,6 +24,7 @@
const RoleManage = asyncLoadComponent(() => import('@/views/rolemanage'))
const SystemFunc = asyncLoadComponent(() => import('@/views/systemfunc'))
const SystemProc = asyncLoadComponent(() => import('@/views/systemproc'))
const MkIframe = asyncLoadComponent(() => import('@/views/mkiframe'))
const routers = [
  {path: '/login', name: 'login', component: Login},
@@ -47,6 +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: '/interface', name: 'interface', component: Interface}
]
src/tabviews/custom/components/iframe/index.jsx
@@ -65,6 +65,10 @@
      }
    }
    if (_config.wrap.height === '100vh') {
      _config.wrap.height = 'calc(100vh - 92px)'
    }
    this.setState({
      linkUrl: linkUrl,
      sync: _sync,
@@ -257,7 +261,7 @@
        </div> : null}
        <div className="iframe-wrap" style={{height: config.wrap.height}}>
          {loading ? <div className="mask"><Spin size="large" /></div> : null}
          {linkUrl ? <iframe title="mk" className="iframe" src={linkUrl} frameBorder="0"></iframe> : <Empty description={false}/>}
          {linkUrl ? <iframe title="mk" className="iframe" src={linkUrl.replace(/@userid@/ig, sessionStorage.getItem('UserID')).replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))} frameBorder="0"></iframe> : <Empty description={false}/>}
        </div>
      </div>
    )
src/tabviews/iframe/index.jsx
@@ -6,7 +6,6 @@
  static propTypes = {
    title: PropTypes.string,
    MenuID: PropTypes.string,    // 菜单Id
    MenuNo: PropTypes.string,    // 菜单参数
    url: PropTypes.string
  }
src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -192,6 +192,19 @@
      })
      window.open(url)
    } else if (btn.pageTemplate === 'custom') {
      if (/#\/iframe\//.test(btn.url)) {
        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'))
        }
        MKEmitter.emit('modifyTabs', menu)
        return
      }
      let url = btn.url
      let con = '?'
src/templates/zshare/formconfig.jsx
@@ -4151,8 +4151,7 @@
      key: 'icon',
      label: '图标',
      initVal: card.icon || '',
      required: false,
      forbid: type === 'CalendarPage'
      required: false
    },
    {
      type: 'select',
@@ -4160,8 +4159,7 @@
      label: '上级标签',
      initVal: supMenu,
      required: false,
      options: menus,
      forbid: type === 'CalendarPage'
      options: menus
    },
    {
      type: 'mutilselect',
@@ -4170,8 +4168,7 @@
      tooltip: '如果子标签中含有刷新同级标签的按钮,在此处添加需要刷新的标签。',
      initVal: equalTab,
      required: false,
      options: equalTabs,
      forbid: type === 'CalendarPage'
      options: equalTabs
    },
    {
      type: 'text',
@@ -4179,8 +4176,7 @@
      label: '外键',
      tooltip: '外键旨在标签页中执行默认函数(添加)时,替换BID字段',
      initVal: card.foreignKey || '',
      required: false,
      forbid: type === 'CalendarPage'
      required: false
    },
    {
      type: 'number',
@@ -4200,7 +4196,7 @@
      initVal: card.searchPass || 'false',
      tooltip: '使用主表搜索条件时,主表的搜索条件会传入子表中。',
      required: false,
      forbid: type !== 'CommonTable' && type !== 'CalendarPage',
      forbid: type !== 'CommonTable',
      options: [{
        value: 'true',
        text: '使用'
src/utils/option.js
@@ -1,7 +1,6 @@
import nortable from '@/assets/img/normaltable.jpg'
// import mainsubtable from '@/assets/img/mainsubtable.jpg'
import treepage from '@/assets/img/treepage.jpg'
import calendar from '@/assets/img/calendar.jpg'
import customImg from '@/assets/img/custom.jpg'
import newpage from '@/assets/img/newpage.jpg'
import rolemanage from '@/assets/img/rolemanage.jpg'
@@ -78,13 +77,6 @@
    title: '树形页面',
    type: 'TreePage',
    url: treepage,
    baseconfig: '',
    isSystem: true
  },
  {
    title: '日历',
    type: 'CalendarPage',
    url: calendar,
    baseconfig: '',
    isSystem: true
  },
src/views/basedesign/index.jsx
@@ -14,7 +14,6 @@
const Header = asyncComponent(() => import('@/menu/header'))
const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig'))
const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig'))
const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig'))
const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig'))
const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig'))
const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig'))
@@ -181,13 +180,6 @@
          <Header/>
          {this.state.tabview === 'TreePage' ?
            <TreePageConfig
              menu={this.state.editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'CalendarPage' ?
            <CalendarPageConfig
              menu={this.state.editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
src/views/design/sidemenu/editthdmenu/index.jsx
@@ -109,7 +109,7 @@
          handleMVisible: true,
          sysMenu: _menu
        })
      } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(_menu.PageParam.Template)) {
      } else if (['CommonTable', 'TreePage'].includes(_menu.PageParam.Template)) {
        sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree))
        let _param = window.btoa(window.encodeURIComponent(JSON.stringify(_menu)))
src/views/design/sidemenu/index.jsx
@@ -121,7 +121,7 @@
      }
      _param = window.btoa(window.encodeURIComponent(JSON.stringify(_param)))
      window.open(`#/menudesign/${_param}`)
    } else if (['CommonTable', 'TreePage', 'CalendarPage'].includes(cell.type)) {
    } else if (['CommonTable', 'TreePage'].includes(cell.type)) {
      sessionStorage.setItem('menuTree', JSON.stringify(this.props.menuTree))
      let _param = window.btoa(window.encodeURIComponent(JSON.stringify(cell)))
src/views/design/sidemenu/thdmenuform/index.jsx
@@ -1,7 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Select } from 'antd'
import { Form, Row, Col, Input, Select, Tooltip } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
// import './index.scss'
const { TextArea } = Input
@@ -74,7 +75,7 @@
      <Form {...formItemLayout} style={{paddingRight: '20px'}}>
        <Row gutter={24}>
          <Col span={22}>
            <Form.Item label={'一级菜单'}>
            <Form.Item label="一级菜单">
              {getFieldDecorator('fstMenuId', {
                initialValue: menu.fstMenuId,
                rules: [
@@ -97,7 +98,7 @@
            </Form.Item>
          </Col>
          <Col span={22}>
            <Form.Item label={'二级菜单'}>
            <Form.Item label="二级菜单">
              {getFieldDecorator('ParentID', {
                initialValue: menu.ParentId,
                rules: [
@@ -119,7 +120,7 @@
            </Form.Item>
          </Col>
          <Col span={22}>
            <Form.Item label={'菜单名称'}>
            <Form.Item label="菜单名称">
              {getFieldDecorator('MenuName', {
                initialValue: menu.MenuName || '',
                rules: [
@@ -132,7 +133,7 @@
            </Form.Item>
          </Col>
          <Col span={22}>
            <Form.Item label={'菜单参数'}>
            <Form.Item label="菜单参数">
              {getFieldDecorator('MenuNo', {
                initialValue: menu.MenuNo || '',
                rules: [
@@ -145,7 +146,9 @@
            </Form.Item>
          </Col>
          {menu.Template === 'NewPage' ? <Col span={22}>
            <Form.Item label={'链接地址'}>
            <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>
            }>
              {getFieldDecorator('url', {
                initialValue: menu.url || '',
                rules: [
src/views/mkiframe/index.jsx
New file
@@ -0,0 +1,58 @@
import React, {Component} from 'react'
import { Spin } from 'antd'
import './index.scss'
class MkIframe extends Component {
  state = {
    loading: true
  }
  UNSAFE_componentWillMount() {
    // const { menuId, userId, loginUid, bid } = this.props.match.params
    // sessionStorage.setItem('LoginUID', loginUid)
  }
  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)
    // }
  }
  render () {
    return (
      <div className="main-iframe">
        <Spin size="large" />
      </div>
    )
  }
}
export default MkIframe
src/views/mkiframe/index.scss
New file
@@ -0,0 +1,7 @@
.main-iframe {
  .ant-spin {
    position: absolute;
    left: calc(50vw - 22px);
    top: 45vh;
  }
}