king
2021-07-22 cc23ebd63e2aec82db0a43965f4731789316fb78
2021-07-22
4个文件已修改
4个文件已添加
205 ■■■■■ 已修改文件
src/menu/components/share/normalheader/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/transfer/index.jsx 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/transfer/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/transfer/settingform/index.jsx 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/transfer/settingform/index.scss 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/normalheader/index.jsx
@@ -53,6 +53,7 @@
  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)
  }
src/pc/transfer/index.jsx
New file
@@ -0,0 +1,96 @@
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
src/pc/transfer/index.scss
src/pc/transfer/settingform/index.jsx
New file
@@ -0,0 +1,69 @@
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)
src/pc/transfer/settingform/index.scss
New file
@@ -0,0 +1,11 @@
.model-menu-setting-form {
  position: relative;
  .anticon-question-circle {
    color: #c49f47;
    margin-right: 3px;
  }
  .ant-input-number {
    width: 100%;
  }
}
src/views/menudesign/index.jsx
@@ -68,7 +68,8 @@
    config: null,
    popBtn: null,             // 弹窗标签页
    visible: false,
    customComponents: []
    customComponents: [],
    comloading: false
  }
  UNSAFE_componentWillMount() {
@@ -203,10 +204,11 @@
    })
    this.setState({
      config: {...config, components: []}
      config: {...config, components},
      comloading: true
    }, () => {
      this.setState({
        config: {...config, components: components}
        comloading: false
      })
    })
  }
@@ -656,7 +658,8 @@
        if (res.status) {
          config.open_edition = res.open_edition || ''
          this.setState({
            oriConfig: fromJS(config).toJS()
            config,
            oriConfig: fromJS(config).toJS(),
          })
          if (btnParam.LText) {
@@ -774,10 +777,10 @@
            copyButtons: [],
            thawButtons: [],
            menuloading: false,
            config: {...config, components: []}
            comloading: true
          }, () => {
            this.setState({
              config: {...this.state.config, components: this.state.oriConfig.components}
              comloading: false
            })
          })
          notification.success({
@@ -902,10 +905,11 @@
  resetConfig = (config) => {
    this.setState({
      config: {...config, components: []}
      config,
      comloading: true
    }, () => {
      this.setState({
        config: config
        comloading: false
      })
    })
    window.GLOB.customMenu = config
@@ -921,7 +925,7 @@
  }
  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}>
@@ -990,7 +994,7 @@
                    <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>
src/views/mobdesign/index.jsx
@@ -26,6 +26,7 @@
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'))
@@ -1559,6 +1560,7 @@
              <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' : '')}>
src/views/pcdesign/index.jsx
@@ -23,6 +23,7 @@
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'))
@@ -1561,6 +1562,7 @@
              <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' : '')}>