| | |
| | | if (_style.shadow) { |
| | | _style.boxShadow = '0 0 4px ' + _style.shadow |
| | | } |
| | | |
| | | |
| | | if (side === 'back') { |
| | | _style = {...card.backStyle, height: card.style.height} |
| | | _style = { |
| | | ...card.backStyle, |
| | | height: card.style.height, |
| | | marginBottom: card.style.marginBottom, |
| | | marginLeft: card.style.marginLeft, |
| | | marginRight: card.style.marginRight, |
| | | marginTop: card.style.marginTop |
| | | } |
| | | } |
| | | |
| | | return ( |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Radio, Tooltip, Icon, Input, InputNumber } from 'antd' |
| | | import { Form, Row, Col, Radio, Tooltip, Icon, Input, InputNumber, Select } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | {getFieldDecorator('transform', { |
| | | initialValue: setting.transform || 'up' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="up">向上滑动</Radio> |
| | | <Radio value="down">向下滑动</Radio> |
| | | </Radio.Group> |
| | | <Select> |
| | | <Select.Option value="up">向上滑动</Select.Option> |
| | | <Select.Option value="down">向下滑动</Select.Option> |
| | | <Select.Option value="left">向左滑动</Select.Option> |
| | | <Select.Option value="right">向右滑动</Select.Option> |
| | | <Select.Option value="scale">缩放</Select.Option> |
| | | <Select.Option value="opacity">透明度</Select.Option> |
| | | <Select.Option value="rotateX">纵向展开</Select.Option> |
| | | <Select.Option value="rotateY">横向展开</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | | import enUS from '@/locales/en-US/mob.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyCustomMenu } from '@/store/action' |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('delButtons', this.delButtons) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('delButtons', this.delButtons) |
| | | } |
| | | |
| | | delButtons = (items) => { |
| | | this.setState({delButtons: [...this.state.delButtons, ...items]}) |
| | | } |
| | | |
| | | closeView = () => { |
| | |
| | | } |
| | | |
| | | getMenuParam = () => { |
| | | const { MenuId, MenuType } = this.state |
| | | const { btn } = this.props |
| | | const { MenuId } = this.state |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | MenuID: MenuId, |
| | | Template: 'CustomPage', |
| | | enabled: false, |
| | | MenuName: btn.config.MenuName + '-' + btn.label, |
| | | MenuNo: '', |
| | | tables: [], |
| | | components: [], |
| | | viewType: 'popview', |
| | | style: { |
| | | backgroundColor: '#ffffff', backgroundImage: '', |
| | | paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px' |
| | | }, |
| | | MenuType: MenuType |
| | | } |
| | | } else { |
| | | config.uuid = MenuId |
| | | config.MenuID = MenuId |
| | | config.MenuType = config.MenuType || MenuType |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | // const { btn } = this.props |
| | | const { openEdition, delButtons } = this.state |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | | if (config.cacheUseful === 'true' && !config.cacheTime) { |
| | | if ((config.cacheUseful === 'true' && !config.cacheTime) || !config.MenuNo || !config.MenuName) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善菜单基本信息!', |
| | |
| | | let param = { |
| | | func: 'sPC_Tab_AddUpt', |
| | | MenuID: _config.uuid, |
| | | MenuNo: _config.tabNo, |
| | | MenuNo: _config.MenuNo, |
| | | Template: 'CustomPage', |
| | | MenuName: _config.tabName, |
| | | MenuName: _config.MenuName, |
| | | Remark: '', |
| | | Sort: 0, |
| | | PageParam: JSON.stringify({Template: 'CustomPage'}), |
| | |
| | | |
| | | let btnParam = { // 添加菜单按钮 |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 40, // 添加菜单下的按钮type为40,按钮下的按钮type为60 |
| | | Type: 60, // 添加菜单下的按钮type为40,按钮下的按钮type为60 |
| | | ParentID: _config.uuid, |
| | | MenuNo: _config.MenuNo, |
| | | Template: 'CustomPage', |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Radio, Icon, Tooltip, InputNumber } from 'antd' |
| | | import { Form, Row, Col, Radio, Icon, Input, Tooltip, InputNumber } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | // 菜单名称 |
| | | changeName = (e) => { |
| | | this.props.updateConfig({...this.props.config, MenuName: e.target.value}) |
| | | } |
| | | |
| | | // 菜单参数 |
| | | changeNo = (e) => { |
| | | this.props.updateConfig({...this.props.config, MenuNo: e.target.value}) |
| | | } |
| | | |
| | | changeCacheDay = (val) => { |
| | | if (typeof(val) !== 'number') { |
| | | val = '' |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="custom-menu-form"> |
| | | <Row> |
| | | <Col span={24}> |
| | | <Form.Item label={dict['mob.menu'] + dict['mob.name']}> |
| | | {getFieldDecorator('MenuName', { |
| | | initialValue: config.MenuName, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={dict['mob.menu'] + dict['mob.param']}> |
| | | {getFieldDecorator('MenuNo', { |
| | | initialValue: config.MenuNo, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="对于不经常性变动的信息,缓存数据有助于提高查询效率。"> |
| | |
| | | return ( |
| | | <div className="card-item-box" style={card.style}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.elements} updateStatus={this.props.updateStatus}/> |
| | | {card.setting.type === 'multi' ? <div className={'back-side ' + card.setting.transform} style={card.backStyle}> |
| | | <CardCellComponent data={data} cards={cards} cardCell={card} elements={card.backElements} updateStatus={this.props.updateStatus}/> |
| | | </div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .card-item-box { |
| | | position: relative; |
| | | overflow: hidden; |
| | | |
| | | .back-side { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | background-color: #ffffff; |
| | | transition: all 0.3s; |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | } |
| | | .back-side.up { |
| | | transform: translate(0, 100%); |
| | | } |
| | | .back-side.down { |
| | | transform: translate(0, -100%); |
| | | } |
| | | .back-side.left { |
| | | transform: translate(100%, 0); |
| | | } |
| | | .back-side.right { |
| | | transform: translate(-100%, 0); |
| | | } |
| | | .back-side.opacity { |
| | | opacity: 0; |
| | | } |
| | | .back-side.rotateX { |
| | | transform: rotateX(90deg); |
| | | } |
| | | .back-side.rotateY { |
| | | transform: rotateY(90deg); |
| | | } |
| | | .back-side.scale { |
| | | transform: scale(0, 0); |
| | | } |
| | | } |
| | | .card-item-box:hover { |
| | | .back-side.up, .back-side.down, .back-side.left, .back-side.right { |
| | | transform: translate(0, 0); |
| | | } |
| | | .back-side.opacity { |
| | | opacity: 1; |
| | | } |
| | | .back-side.rotateX { |
| | | transform: rotateX(0deg); |
| | | } |
| | | .back-side.rotateY { |
| | | transform: rotateY(0deg); |
| | | } |
| | | .back-side.scale { |
| | | transform: scale(1, 1); |
| | | } |
| | | } |
| | |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.filter(cell => { |
| | | cell.logLabel = item.name + '-' + cell.label |
| | | cell.ContainerId = this.state.ContainerId |
| | | |
| | | return permAction[cell.uuid] |
| | | }) |
| | | } |
| | |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.name + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || permAction[cell.uuid] |
| | | }) |
| | | card.backElements = card.backElements.filter(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.name + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | |
| | | if (cell.eleType === 'button') { |
| | | cell.logLabel = item.name + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { |
| | | cell.innerHeight = 'auto' |
| | | } |
| | |
| | | col.elements = col.elements.filter(cell => { |
| | | cell.logLabel = item.name + '-' + cell.label |
| | | cell.Ot = 'requiredSgl' |
| | | cell.ContainerId = this.state.ContainerId |
| | | return permAction[cell.uuid] |
| | | }) |
| | | return col.elements.length !== 0 |
| | |
| | | * @description 显示模态框 |
| | | */ |
| | | getModels = () => { |
| | | const { setting, BID } = this.props |
| | | const { setting, BID, btn } = this.props |
| | | const { btnconfig } = this.state |
| | | |
| | | if (!this.state.visible || !btnconfig || !btnconfig.setting) return null |
| | |
| | | let clickouter = false |
| | | let container = document.body |
| | | |
| | | if (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) { |
| | | if ( |
| | | (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || |
| | | (btnconfig.setting.container === 'tab' && btn.ContainerId) |
| | | ) { |
| | | width = btnconfig.setting.width + '%' |
| | | container = () => document.getElementById(this.props.ContainerId) |
| | | container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) |
| | | } |
| | | |
| | | if (btnconfig.setting.clickouter === 'close') { |
| | |
| | | * @description 显示模态框 |
| | | */ |
| | | getModels = () => { |
| | | const { setting, BID } = this.props |
| | | const { setting, BID, btn } = this.props |
| | | const { btnconfig } = this.state |
| | | |
| | | if (!this.state.visible || !btnconfig || !btnconfig.setting) return null |
| | |
| | | let clickouter = false |
| | | let container = document.body |
| | | |
| | | if (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) { |
| | | if ( |
| | | (setting.tabType === 'main' && btnconfig.setting.container === 'tab' && this.props.ContainerId) || |
| | | (btnconfig.setting.container === 'tab' && btn.ContainerId) |
| | | ) { |
| | | width = btnconfig.setting.width + '%' |
| | | container = () => document.getElementById(this.props.ContainerId) |
| | | container = () => document.getElementById(this.props.ContainerId || btn.ContainerId) |
| | | } |
| | | |
| | | if (btnconfig.setting.clickouter === 'close') { |
| | |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | oriId: Utils.getuuid(), // 搜索表单Id |
| | | formId: '', // 搜索表单Id |
| | | match: null, // 搜索条件匹配规则 |
| | | style: null, // 搜索条件类型 |
| | |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId}> |
| | | <Form {...formItemLayout} className={`top-search ${float}`} style={searchStyle} id={this.state.formId || this.state.oriId}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | localStorage.removeItem(_url) |
| | | } |
| | | |
| | | // if (this.props.location.state && this.props.location.state.from.pathname) { |
| | | // // 查看是否为其他页面跳转,路径存在时,跳回原页面 |
| | | // this.props.history.replace(this.props.location.state.from.pathname) |
| | | // } |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | | sessionStorage.removeItem('history') |
| | |
| | | MenuNo: MenuNo, |
| | | tables: [], |
| | | components: [], |
| | | viewType: 'menu', |
| | | style: { |
| | | backgroundColor: '#ffffff', backgroundImage: '', |
| | | paddingTop: '16px', paddingBottom: '80px', paddingLeft: '16px', paddingRight: '16px' |