| | |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | |
| | | this.actionFormRef.handleConfirm().then(res => { |
| | | res.type = card.type |
| | | res.style = card.style || null |
| | | if (card.verify) { |
| | | res.verify = card.verify |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { connect } from 'react-redux' |
| | | import { withRouter } from 'react-router-dom' |
| | | import {Dropdown, Menu, Icon, Modal, Tooltip, Button } from 'antd' |
| | | |
| | | import { logout } from '@/store/action' |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import MainLogo from '@/assets/img/main-logo.png' |
| | | import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | class MobHeader extends Component { |
| | | static propTpyes = { |
| | | view: PropTypes.string, |
| | | saveIng: PropTypes.any, |
| | | triggerSave: PropTypes.func, |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | avatar: sessionStorage.getItem('CloudAvatar') || avatar, |
| | | userName: sessionStorage.getItem('CloudUserName') |
| | | } |
| | | |
| | | logout = () => { |
| | | // 退出登录 |
| | | let _this = this |
| | | confirm({ |
| | | title: this.state.dict['mob.logout.hint'], |
| | | content: '', |
| | | onOk() { |
| | | sessionStorage.clear() |
| | | _this.props.logout() |
| | | _this.props.history.replace('/login') |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | render () { |
| | | const { view } = this.props |
| | | |
| | | return ( |
| | | <header className="mob-header-container"> |
| | | <div className="header-logo"><img src={MainLogo} alt=""/></div> |
| | | {view === 'manage' ? |
| | | <div className="mob-manage-title"> |
| | | 应用管理 |
| | | </div> :null |
| | | } |
| | | {view === 'design' ? |
| | | <Menu |
| | | mode="inline" |
| | | theme="dark" |
| | | inlineCollapsed={this.state.collapsed} |
| | | > |
| | | <Menu.Item key="2"> |
| | | <Tooltip placement="bottom" title="保存"> |
| | | <Button icon="save" loading={this.props.saveIng} onClick={this.props.triggerSave}></Button> |
| | | </Tooltip> |
| | | </Menu.Item> |
| | | </Menu> : null |
| | | } |
| | | <Dropdown className="header-setting" overlay={ |
| | | <Menu> |
| | | <Menu.Item key="2" onClick={this.logout}>{this.state.dict['mob.logout']}</Menu.Item> |
| | | </Menu> |
| | | }> |
| | | <div> |
| | | <img src={this.state.avatar} alt=""/> |
| | | <span> |
| | | <span className="username">{this.state.userName}</span> <Icon type="down" /> |
| | | </span> |
| | | </div> |
| | | </Dropdown> |
| | | <div className="header-user"> |
| | | <img src={this.state.avatar} alt=""/> |
| | | <span> |
| | | <span className="username">{this.state.userName}</span> |
| | | </span> |
| | | </div> |
| | | </header> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | const mapStateToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | logout: () => dispatch(logout()) |
| | | } |
| | | } |
| | | |
| | | export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MobHeader)) |
| | | export default MobHeader |
| | |
| | | .mob-header-container { |
| | | width: 100%; |
| | | height: 48px; |
| | | padding-right: 320px; |
| | | color: rgba(255, 255, 255, 0.65); |
| | | position: fixed; |
| | | top: 0px; |
| | |
| | | max-height: 40px; |
| | | } |
| | | } |
| | | .header-setting { |
| | | .header-user { |
| | | float: right; |
| | | line-height: 48px; |
| | | margin-right: 10px; |
| | |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | } |
| | | .mob-manage-title { |
| | | position: absolute; |
| | | left: calc(50vw - 45px); |
| | | color: #ffffff; |
| | | font-size: 16px; |
| | | line-height: 48px; |
| | | letter-spacing: 2px; |
| | | } |
| | | >.ant-menu { |
| | | float: left; |
| | | width: unset!important; |
| | | .ant-menu-item { |
| | | margin-bottom: 0!important; |
| | | float: left; |
| | | width: unset!important; |
| | | cursor: default; |
| | | .anticon-arrow-left { |
| | | height: 24px; |
| | | cursor: pointer; |
| | | } |
| | | .ant-btn { |
| | | color: #fff; |
| | | width: unset; |
| | | cursor: pointer; |
| | | height: 37px; |
| | | background: transparent; |
| | | border: 0; |
| | | .anticon-save { |
| | | margin-right: 0; |
| | | } |
| | | } |
| | | .ant-btn[ant-click-animating-without-extra-node="true"]::after { |
| | | display: none!important; |
| | | } |
| | | .ant-btn::before { |
| | | display: none!important; |
| | | } |
| | | } |
| | | .ant-menu-item.ant-menu-item-selected { |
| | | background-color: transparent; |
| | | } |
| | | .ant-menu-item:not(:last-child) { |
| | | border-right: 1px solid #353535; |
| | | } |
| | | } |
| | | } |
| | |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | z-index: 2; |
| | | z-index: 3; |
| | | |
| | | .navbar-wrap { |
| | | margin: 0 auto; |
| | |
| | | clear: both; |
| | | } |
| | | .normal-navbar-edit-box:hover { |
| | | z-index: 1; |
| | | box-shadow: 0px 0px 4px #1890ff; |
| | | } |
| | | .top-menu-popover { |
| | |
| | | if (['text', 'select', 'link'].includes(item.type) && param) { |
| | | if (param.searchkey === item.field) { |
| | | item.initval = param.searchval |
| | | } else if (param.BID && item.field.toLowerCase() === 'bid') { |
| | | item.initval = param.BID |
| | | } else if (param.data && param.data[item.field]) { |
| | | item.initval = param.data[item.field] |
| | | } |
| | |
| | | if (['text', 'select', 'link'].includes(item.type) && param) { |
| | | if (param.searchkey === item.field) { |
| | | item.initval = param.searchval |
| | | } else if (param.BID && item.field.toLowerCase() === 'bid') { |
| | | item.initval = param.BID |
| | | } else if (param.data && param.data[item.field]) { |
| | | item.initval = param.data[item.field] |
| | | } |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { |
| | | if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { |
| | | let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] |
| | | if (selectTab && selectTab.MenuID === this.props.MenuID) { |
| | | this.setShortcut() |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | return tab.MenuID !== newtab.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | // import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | // import Utils from '@/utils/utils.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | |
| | | let _data = null |
| | | let _sync = false |
| | | |
| | | if (config.setting && config.wrap.datatype !== 'static') { |
| | | if (config.wrap.datatype !== 'static') { |
| | | _sync = config.setting.sync === 'true' |
| | | |
| | | if (_sync && data && data[config.dataName]) { |
| | |
| | | _data = {} |
| | | } |
| | | |
| | | let roleId = sessionStorage.getItem('role_id') || '' |
| | | |
| | | config.subcards = config.subcards.map(group => { |
| | | group.subButton.uuid = group.uuid |
| | | group.subButton.$menuId = group.uuid |
| | |
| | | group.subButton.OpenType = 'formSubmit' |
| | | group.subButton.execError = 'never' |
| | | |
| | | group.fields = group.fields.map(cell => { |
| | | // 数据源sql语句,预处理,权限黑名单字段设置为隐藏表单 |
| | | if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { |
| | | let _option = Utils.getSelectQueryOptions(cell) |
| | | |
| | | cell.data_sql = Utils.formatOptions(_option.sql) |
| | | cell.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) |
| | | cell.arr_field = _option.field |
| | | } |
| | | |
| | | // 字段权限黑名单 |
| | | if (!cell.blacklist || !roleId || cell.blacklist.length === 0) return cell |
| | | if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | cell.hidden = 'true' |
| | | } |
| | | |
| | | return cell |
| | | }) |
| | | |
| | | return group |
| | | }) |
| | | |
| | |
| | | if (['text', 'select', 'link'].includes(item.type) && param) { |
| | | if (param.searchkey === item.field) { |
| | | item.initval = param.searchval |
| | | } else if (param.BID && item.field.toLowerCase() === 'bid') { |
| | | item.initval = param.BID |
| | | } else if (param.data && param.data[item.field]) { |
| | | item.initval = param.data[item.field] |
| | | } |
| | |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | |
| | | // 外联数据库替换 |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | component.setting.dataresource = component.setting.dataresource.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | | |
| | | component.setting.customScript = _customScript // 整理后自定义脚本 |
| | | |
| | | // floor 组件的层级 |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | const { setting } = this.state |
| | | let param = this.getDefaultParam() |
| | | |
| | | this.setState({ |
| | |
| | | data: result.data.map((item, index) => { |
| | | // item.LongParam = this.UnformatOptions(item.LongParam) |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | import options from '@/store/options.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import NotFount from '@/components/404' |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | menuType: state.editLevel, |
| | | permAction: state.permAction, |
| | | permMenus: state.permMenus, |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) |
| | | } |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(SubTabViewTable) |
| | |
| | | this.setState({ |
| | | data: result.data.map((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | this.setState({ |
| | | data: result.data.map((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = _BID || '' |
| | | return item |
| | | }), |
| | |
| | | if (btn.uuid !== res.menuId) return |
| | | |
| | | this.setState({ |
| | | confirmLoading: true |
| | | loading: true |
| | | }) |
| | | |
| | | this.execSubmit(this.state.tabledata, () => { |
| | | this.setState({ |
| | | confirmLoading: false |
| | | }) |
| | | }, res.form) |
| | | this.execSubmit(this.state.tabledata, () => {}, res.form) |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | componentDidMount () { |
| | | const { data, BData, action } = this.props |
| | | |
| | | |
| | | let datatype = {} |
| | | let readtype = {} |
| | | let readin = {} |
| | |
| | | tabmenu.param = { |
| | | searchkey: item.field, |
| | | searchval: record[item.field] || '', |
| | | BID: record[setting.primaryKey] |
| | | BID: record.$$uuid |
| | | } |
| | | |
| | | tabmenu.selected = true |
| | |
| | | <Select> |
| | | <Select.Option value="="> = </Select.Option> |
| | | <Select.Option value="!="> != </Select.Option> |
| | | <Select.Option value=">"> > </Select.Option> |
| | | <Select.Option value=">"> > </Select.Option> |
| | | <Select.Option value="<"> < </Select.Option> |
| | | <Select.Option value="like"> like </Select.Option> |
| | | </Select> |
| | |
| | | return tab.MenuID !== menu.MenuID |
| | | }) |
| | | |
| | | if (this.props.tabviews.length !== tabs.length) { |
| | | if (this.props.tabviews.length > tabs.length) { |
| | | this.props.modifyTabview(fromJS(tabs).toJS()) |
| | | } |
| | | |
| | |
| | | oriConfig: null, |
| | | parentId: '', |
| | | openEdition: '', |
| | | saveIng: false, |
| | | config: null, |
| | | pageIndex: 0, |
| | | editElem: null |
| | |
| | | |
| | | triggerSave = () => { |
| | | const { config, openEdition, parentId } = this.state |
| | | |
| | | this.setState({ |
| | | saveIng: true |
| | | }) |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | |
| | | this.setState({ |
| | | oriConfig: fromJS(config).toJS(), |
| | | openEdition: response.open_edition || '', |
| | | saveIng: false |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { saveIng, appType, config, editElem } = this.state |
| | | const { appType, config, editElem } = this.state |
| | | |
| | | return ( |
| | | <div className="mobile-view"> |
| | | <Header view="design" jumpToManage={this.jumpToManage} triggerSave={this.triggerSave} saveIng={saveIng} /> |
| | | <Header /> |
| | | <DndProvider backend={HTML5Backend}> |
| | | <div className="mob-body"> |
| | | <div className="mob-tool"> |