| | |
| | | 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') |
| | |
| | | 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')) |
| | |
| | | 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} />) |
| | | } |
| | |
| | | } |
| | | 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; |
| | |
| | | |
| | | 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) |
| | | } |
| | |
| | | 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) {} |
| | | } |
| | |
| | | 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) |
| | |
| | | |
| | | 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') { |
| | |
| | | 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')) |
| | |
| | | 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} />) |
| | | } |
| | |
| | | } |
| | | 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 { |
| | |
| | | field: 'height', |
| | | label: '高度', |
| | | initval: wrap.height || '', |
| | | tooltip: 'ifram高度。', |
| | | tooltip: 'ifram高度。注:高度100vh时会根据标签页窗口进行调整', |
| | | required: true, |
| | | options: ['px', 'vh', 'vw'] |
| | | }, |
| | |
| | | field: 'linkUrl', |
| | | label: '地址链接', |
| | | initval: wrap.linkUrl || '', |
| | | tooltip: '地址中的@userid@与@loginuid@会自动替换为当前系统的登录信息。', |
| | | required: true, |
| | | span: 24 |
| | | }, |
| | |
| | | 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}, |
| | |
| | | {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} |
| | | ] |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (_config.wrap.height === '100vh') { |
| | | _config.wrap.height = 'calc(100vh - 92px)' |
| | | } |
| | | |
| | | this.setState({ |
| | | linkUrl: linkUrl, |
| | | sync: _sync, |
| | |
| | | </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> |
| | | ) |
| | |
| | | static propTypes = { |
| | | title: PropTypes.string, |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | url: PropTypes.string |
| | | } |
| | | |
| | |
| | | }) |
| | | 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 = '?' |
| | | |
| | |
| | | key: 'icon', |
| | | label: '图标', |
| | | initVal: card.icon || '', |
| | | required: false, |
| | | forbid: type === 'CalendarPage' |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | label: '上级标签', |
| | | initVal: supMenu, |
| | | required: false, |
| | | options: menus, |
| | | forbid: type === 'CalendarPage' |
| | | options: menus |
| | | }, |
| | | { |
| | | type: 'mutilselect', |
| | |
| | | tooltip: '如果子标签中含有刷新同级标签的按钮,在此处添加需要刷新的标签。', |
| | | initVal: equalTab, |
| | | required: false, |
| | | options: equalTabs, |
| | | forbid: type === 'CalendarPage' |
| | | options: equalTabs |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | label: '外键', |
| | | tooltip: '外键旨在标签页中执行默认函数(添加)时,替换BID字段', |
| | | initVal: card.foreignKey || '', |
| | | required: false, |
| | | forbid: type === 'CalendarPage' |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | initVal: card.searchPass || 'false', |
| | | tooltip: '使用主表搜索条件时,主表的搜索条件会传入子表中。', |
| | | required: false, |
| | | forbid: type !== 'CommonTable' && type !== 'CalendarPage', |
| | | forbid: type !== 'CommonTable', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '使用' |
| | |
| | | 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' |
| | |
| | | title: '树形页面', |
| | | type: 'TreePage', |
| | | url: treepage, |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |
| | | { |
| | | title: '日历', |
| | | type: 'CalendarPage', |
| | | url: calendar, |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |
| | |
| | | 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')) |
| | |
| | | <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} |
| | |
| | | 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))) |
| | | |
| | |
| | | } |
| | | _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))) |
| | | |
| | |
| | | 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 |
| | |
| | | <Form {...formItemLayout} style={{paddingRight: '20px'}}> |
| | | <Row gutter={24}> |
| | | <Col span={22}> |
| | | <Form.Item label={'一级菜单'}> |
| | | <Form.Item label="一级菜单"> |
| | | {getFieldDecorator('fstMenuId', { |
| | | initialValue: menu.fstMenuId, |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'二级菜单'}> |
| | | <Form.Item label="二级菜单"> |
| | | {getFieldDecorator('ParentID', { |
| | | initialValue: menu.ParentId, |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'菜单名称'}> |
| | | <Form.Item label="菜单名称"> |
| | | {getFieldDecorator('MenuName', { |
| | | initialValue: menu.MenuName || '', |
| | | rules: [ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={22}> |
| | | <Form.Item label={'菜单参数'}> |
| | | <Form.Item label="菜单参数"> |
| | | {getFieldDecorator('MenuNo', { |
| | | initialValue: menu.MenuNo || '', |
| | | rules: [ |
| | |
| | | </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: [ |
New file |
| | |
| | | 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 |
New file |
| | |
| | | .main-iframe { |
| | | .ant-spin { |
| | | position: absolute; |
| | | left: calc(50vw - 22px); |
| | | top: 45vh; |
| | | } |
| | | } |