| | |
| | | changeStyle = () => { |
| | | const { config } = this.props |
| | | |
| | | // MKEmitter.emit('changeStyle', [config.uuid, 'header'], ['font', 'height', 'border'], config.headerStyle) |
| | | MKEmitter.emit('changeStyle', [config.uuid, 'header'], ['font', 'border'], config.headerStyle) |
| | | } |
| | | |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification } from 'antd' |
| | | // import moment from 'moment' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | // import Utils from '@/utils/utils.js' |
| | | import SettingForm from './settingform' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | | class TransferWrap extends Component { |
| | | static propTpyes = { |
| | | MenuID: PropTypes.string |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | visible: false, |
| | | loading: false, |
| | | translist: [] |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | verifySubmit = () => { |
| | | this.verifyRef.handleConfirm().then(res => { |
| | | this.setState({ |
| | | // loading: true, |
| | | visible: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | getTransList = () => { |
| | | let param = { |
| | | func: 's_get_sVersion', |
| | | dataM: 'Y', |
| | | PageSize: 9999, |
| | | PageIndex: 1, |
| | | OrderCol: 'ID desc' |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | loading: false |
| | | }) |
| | | |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | this.setState({ |
| | | translist: result.data |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { visible, dict, loading, translist } = this.state |
| | | |
| | | return ( |
| | | <div className="transfer-wrap"> |
| | | <Button icon="pull-request" className="mk-border-green" onClick={this.getTransList}>传输号</Button> |
| | | <Modal |
| | | title="加入传输号" |
| | | visible={visible} |
| | | width={500} |
| | | maskClosable={false} |
| | | okText={dict['model.submit']} |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | | confirmLoading={loading} |
| | | destroyOnClose |
| | | > |
| | | <SettingForm |
| | | dict={dict} |
| | | translist={translist} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default TransferWrap |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, |
| | | translist: PropTypes.array, |
| | | } |
| | | |
| | | state = {} |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { translist } = this.props |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={20}> |
| | | <Form.Item label="传输号"> |
| | | {getFieldDecorator('VersionName', { |
| | | initialValue: '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择传输号!' |
| | | }] |
| | | })( |
| | | <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> |
| | | {translist.map(option => |
| | | <Select.Option key={option.VersionName} value={option.VersionName}>{option.ProgramName}</Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(SettingForm) |
New file |
| | |
| | | .model-menu-setting-form { |
| | | position: relative; |
| | | |
| | | .anticon-question-circle { |
| | | color: #c49f47; |
| | | margin-right: 3px; |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | } |
| | |
| | | config: null, |
| | | popBtn: null, // 弹窗标签页 |
| | | visible: false, |
| | | customComponents: [] |
| | | customComponents: [], |
| | | comloading: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: {...config, components: []} |
| | | config: {...config, components}, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...config, components: components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | } |
| | |
| | | if (res.status) { |
| | | config.open_edition = res.open_edition || '' |
| | | this.setState({ |
| | | oriConfig: fromJS(config).toJS() |
| | | config, |
| | | oriConfig: fromJS(config).toJS(), |
| | | }) |
| | | |
| | | if (btnParam.LText) { |
| | |
| | | copyButtons: [], |
| | | thawButtons: [], |
| | | menuloading: false, |
| | | config: {...config, components: []} |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...this.state.config, components: this.state.oriConfig.components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | notification.success({ |
| | |
| | | |
| | | resetConfig = (config) => { |
| | | this.setState({ |
| | | config: {...config, components: []} |
| | | config, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: config |
| | | comloading: false |
| | | }) |
| | | }) |
| | | window.GLOB.customMenu = config |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { activeKey, MenuType, popBtn, visible, dict, MenuId, config, ParentId, MenuName, MenuNo, menuloading, customComponents } = this.state |
| | | const { activeKey, comloading, MenuType, popBtn, visible, dict, MenuId, config, ParentId, MenuName, MenuNo, menuloading, customComponents } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={_locale}> |
| | |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </Card> |
| | | </div> |
| | | </div> |
| | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const MobShell = asyncComponent(() => import('@/mob/mobshell')) |
| | | const CreateView = asyncComponent(() => import('@/pc/createview')) |
| | | const Transfer = asyncComponent(() => import('@/pc/transfer')) |
| | | const SourceWrap = asyncComponent(() => import('@/mob/modulesource')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | |
| | | <Button className="mk-border-green" icon="home" onClick={this.setHomeView}>设为首页</Button> |
| | | <Button className="mk-border-danger" icon="redo" onClick={this.refreshView}>强制刷新</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? 'saving' : '')}> |
| | |
| | | const { confirm } = Modal |
| | | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const Transfer = asyncComponent(() => import('@/pc/transfer')) |
| | | const MenuShell = asyncComponent(() => import('@/pc/menushell')) |
| | | const SourceWrap = asyncComponent(() => import('@/pc/modulesource')) |
| | | const CreateView = asyncComponent(() => import('@/pc/createview')) |
| | |
| | | <Button className="mk-border-green" icon="home" onClick={this.setHomeView}>设为首页</Button> |
| | | <Button className="mk-border-danger" icon="redo" onClick={this.refreshView}>强制刷新</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? 'saving' : '')}> |