king
2021-04-15 47b60c427d8b72e250b551ec857c0631b5857224
2021-04-15
5个文件已修改
140 ■■■■ 已修改文件
src/menu/bgcontroller/index.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/chart/antv-scatter/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/normal-table/columns/editColumn/index.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/bgcontroller/index.jsx 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/group/normal-group/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/bgcontroller/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form } from 'antd'
import { Form, Select } from 'antd'
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
@@ -10,6 +10,7 @@
const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
const { Option } = Select
class MobController extends Component {
  static propTpyes = {
@@ -21,6 +22,8 @@
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    backgroundColor: '',
    backgroundImage: '',
    backgroundSize: '',
    backgroundRepeat: '',
  }
  UNSAFE_componentWillMount () {
@@ -35,7 +38,9 @@
    this.setState({
      backgroundColor: config.style.backgroundColor,
      backgroundImage: bgImg
      backgroundImage: bgImg,
      backgroundSize: config.style.backgroundSize || '100%',
      backgroundRepeat: config.style.backgroundRepeat || 'repeat',
    })
  }
@@ -72,8 +77,30 @@
    this.props.updateConfig(config)
  }
  backgroundSizeChange = (val) => {
    this.setState({
      backgroundSize: val
    })
    let config = fromJS(this.props.config).toJS()
    config.style.backgroundSize = val
    this.props.updateConfig(config)
  }
  backgroundRepeatChange = (val) => {
    this.setState({
      backgroundRepeat: val
    })
    let config = fromJS(this.props.config).toJS()
    config.style.backgroundRepeat = val
    this.props.updateConfig(config)
  }
  render () {
    const { backgroundColor, backgroundImage } = this.state
    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -94,6 +121,23 @@
          <Form.Item colon={false} label="图片">
            <SourceComponent value={backgroundImage} type="" placement="right" onChange={this.imgChange}/>
          </Form.Item>
          <Form.Item colon={false} label="比例">
            <Select defaultValue={backgroundSize} onChange={this.backgroundSizeChange}>
              <Option value="100%">100%</Option>
              <Option value="100% 100%">100% 100%</Option>
              <Option value="auto 100%">auto 100%</Option>
              <Option value="contain">contain</Option>
              <Option value="cover">cover</Option>
            </Select>
          </Form.Item>
          <Form.Item colon={false} label="重复">
            <Select defaultValue={backgroundRepeat} onChange={this.backgroundRepeatChange}>
              <Option value="repeat">repeat</Option>
              <Option value="no-repeat">no-repeat</Option>
              <Option value="repeat-x">repeat-x</Option>
              <Option value="repeat-y">repeat-y</Option>
            </Select>
          </Form.Item>
        </Form>
      </div>
    )
src/menu/components/chart/antv-scatter/index.jsx
@@ -163,12 +163,12 @@
      if (i % 2 === 0) {
        item.gender = 'male'
        item.height = 160 + Math.floor(n * 35)
        item.weight = 50 + Math.floor(m * 55)
        item.height = 160 + Math.floor(n * 35 * 10) / 10
        item.weight = 50 + Math.floor(m * 55 * 10) / 10
      } else {
        item.gender = 'female'
        item.height = 140 + Math.floor(n * 40)
        item.weight = 41 + Math.floor(m * 45)
        item.height = 140 + Math.floor(n * 40 * 10) / 10
        item.weight = 41 + Math.floor(m * 45 * 10) / 10
      }
      data.push(item)
src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -103,13 +103,34 @@
        }
      })
    } else if (key === 'field') {
      this.props.form.setFieldsValue({label: option.props.children})
      if (this.state.type === 'number') {
      let values = {label: option.props.children}
      if (/Decimal|int/ig.test(option.props.datatype)) {
        let decimal = 0
        if (/Decimal/ig.test(option.props.datatype)) {
          decimal = +option.props.datatype.replace(/Decimal\(18,/ig, '').replace(')', '')
        }
        this.props.form.setFieldsValue({decimal})
        values.type = 'number'
        values.decimal = decimal
      } else if (/nvarchar/ig.test(option.props.datatype)) {
        values.type = 'text'
      }
      if (values.type !== this.state.type) {
        values.perspective = ''
        let _options = fromJS(columnTypeOptions[values.type]).toJS()
        this.setState({
          type: values.type,
          formlist: this.state.formlist.map(item => {
            item.hidden = !_options.includes(item.key)
            return item
          })
        }, () => {
          this.props.form.setFieldsValue(values)
        })
      } else {
        this.props.form.setFieldsValue(values)
      }
    } else if (key === 'format' && value === 'percent') {
      this.props.form.setFieldsValue({postfix: '%'})
src/pc/bgcontroller/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Form, Icon } from 'antd'
import { Form, Icon, Select } from 'antd'
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
@@ -11,6 +11,7 @@
const ColorSketch = asyncComponent(() => import('@/mob/colorsketch'))
const StyleInput = asyncComponent(() => import('@/menu/stylecontroller/styleInput'))
const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent'))
const { Option } = Select
class MobController extends Component {
  static propTpyes = {
@@ -22,6 +23,9 @@
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    backgroundColor: '',
    backgroundImage: '',
    backgroundSize: '',
    backgroundRepeat: '',
    opacity: '',
  }
  UNSAFE_componentWillMount () {
@@ -36,7 +40,9 @@
    this.setState({
      backgroundColor: config.style.backgroundColor,
      backgroundImage: bgImg
      backgroundImage: bgImg,
      backgroundSize: config.style.backgroundSize || '100%',
      backgroundRepeat: config.style.backgroundRepeat || 'repeat'
    })
  }
@@ -84,9 +90,31 @@
    this.props.updateConfig(config)
  }
  backgroundSizeChange = (val) => {
    this.setState({
      backgroundSize: val
    })
    let config = fromJS(this.props.config).toJS()
    config.style.backgroundSize = val
    this.props.updateConfig(config)
  }
  backgroundRepeatChange = (val) => {
    this.setState({
      backgroundRepeat: val
    })
    let config = fromJS(this.props.config).toJS()
    config.style.backgroundRepeat = val
    this.props.updateConfig(config)
  }
  render () {
    const { config } = this.props
    const { backgroundColor, backgroundImage } = this.state
    const { backgroundColor, backgroundImage, backgroundSize, backgroundRepeat } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -113,6 +141,23 @@
          <Form.Item colon={false} label="背景图">
            <SourceComponent value={backgroundImage} type="" placement="right" onChange={this.imgChange}/>
          </Form.Item>
          <Form.Item colon={false} label="比例">
            <Select defaultValue={backgroundSize} onChange={this.backgroundSizeChange}>
              <Option value="100%">100%</Option>
              <Option value="100% 100%">100% 100%</Option>
              <Option value="auto 100%">auto 100%</Option>
              <Option value="contain">contain</Option>
              <Option value="cover">cover</Option>
            </Select>
          </Form.Item>
          <Form.Item colon={false} label="重复">
            <Select defaultValue={backgroundRepeat} onChange={this.backgroundRepeatChange}>
              <Option value="repeat">repeat</Option>
              <Option value="no-repeat">no-repeat</Option>
              <Option value="repeat-x">repeat-x</Option>
              <Option value="repeat-y">repeat-y</Option>
            </Select>
          </Form.Item>
          <p style={{borderBottom: '1px solid #eaeaea', color: '#40a9ff'}}>内边距</p>
          <Form.Item
            colon={false}
src/tabviews/custom/components/group/normal-group/index.jsx
@@ -2,7 +2,7 @@
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { Col, Empty, notification, Button } from 'antd'
import { Col, Empty, notification, Button, Row } from 'antd'
import moment from 'moment'
import md5 from 'md5'
@@ -387,7 +387,7 @@
    return (
      <div className="normal-group-wrap" id={config.uuid} style={config.style}>
        {config.setting && config.setting.print === 'true' ? <Button className="print-button" icon="printer" loading={printing} onClick={this.print}></Button> : null}
        {this.getComponents()}
        <Row>{this.getComponents()}</Row>
      </div>
    )
  }