king
2020-05-07 69db12287a007990de956bef9cef6c2dec65ace7
2020-05-07
10个文件已修改
222 ■■■■ 已修改文件
src/tabviews/commontable/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.scss 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/chartcomponent/index.jsx 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.scss 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/chartcomponent/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/createinterface/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx
@@ -1329,7 +1329,7 @@
              if (item.chartType === 'table') {
                return (
                  <Col span={item.width || 24} key={item.uuid}>
                    {config.charts.length > 1 ? <p className="chart-table chart-title">{item.title}</p> : null}
                    {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
                    <div style={{minHeight: '25px'}}>
                      <MainAction
                        BID=""
src/tabviews/commontable/index.scss
@@ -107,18 +107,15 @@
    .chart-title {
      position: relative;
      top: -20px;
      margin-bottom: 0px;
      color: rgba(0, 0, 0, 0.85);
      font-weight: 400;
      font-size: 16px;
      line-height: 25px;
      height: 35px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      max-width: 50%;
      padding-top: 10px;
      padding-left: 30px;
      margin: 0 20px;
      padding: 10px 5px 5px;
      border-bottom: 1px solid #e8e8e8;
    }
    .chart-table.chart-title {
      position: absolute;
src/tabviews/zshare/chartcomponent/index.jsx
@@ -36,10 +36,110 @@
  }
  getdata = () => {
    const { data } = this.props
    // let _data = []
    const { data, plot, config } = this.props
    let vFields = plot.Yaxis && typeof(plot.Yaxis) === 'string' ? [plot.Yaxis] : plot.Yaxis
    let _columns = config.columns.filter(col => vFields.includes(col.field))
    return data || []
    if (!data) return []
    let _data = []
    let _cdata = fromJS(data).toJS()
    if (plot.repeat === 'average') {
      let _mdata = new Map()
      _cdata.forEach(item => {
        _columns.forEach(col => {
          if (typeof(item[col.field]) !== 'number') {
            item[col.field] = parseFloat(item[col.field])
            if (isNaN(item[col.field])) {
              item[col.field] = 0
            }
          }
          if (col.format === 'percent') {
            item[col.field] = item[col.field] * 100
          }
        })
        if (item[plot.Xaxis] && !_mdata.has(item[plot.Xaxis])) {
          item.$count = 1
          _mdata.set(item[plot.Xaxis], item)
        } else if (item[plot.Xaxis]) {
          let _item = _mdata.get(item[plot.Xaxis])
          _item.$count++
          vFields.forEach(field => {
            _item[field] += item[field]
          })
        }
      })
      _data = [..._mdata.values()]
      _data = _data.map(item => {
        _columns.forEach(col => {
          item[col.field] = item[col.field] / item.$count
          item[col.field] = item[col.field].toFixed(col.decimal)
          item[col.field] = +item[col.field]
        })
        return item
      })
    } else if (plot.repeat === 'cumsum') {
      let _mdata = new Map()
      _cdata.forEach(item => {
        _columns.forEach(col => {
          if (typeof(item[col.field]) !== 'number') {
            item[col.field] = parseFloat(item[col.field])
            if (isNaN(item[col.field])) {
              item[col.field] = 0
            }
          }
          if (col.format === 'percent') {
            item[col.field] = item[col.field] * 100
          }
        })
        if (item[plot.Xaxis] && !_mdata.has(item[plot.Xaxis])) {
          _mdata.set(item[plot.Xaxis], item)
        } else if (item[plot.Xaxis]) {
          let _item = _mdata.get(item[plot.Xaxis])
          vFields.forEach(field => {
            _item[field] += item[field]
          })
        }
      })
      _data = [..._mdata.values()]
      _data = _data.map(item => {
        _columns.forEach(col => {
          item[col.field] = item[col.field].toFixed(col.decimal)
          item[col.field] = +item[col.field]
        })
        return item
      })
    } else { // plot.repeat === 'unrepeat'
      let _mdata = new Map()
      _cdata.forEach(item => {
        if (item[plot.Xaxis] && !_mdata.has(item[plot.Xaxis])) {
          _columns.forEach(col => {
            if (typeof(item[col.field]) !== 'number') {
              item[col.field] = parseFloat(item[col.field])
              if (isNaN(item[col.field])) {
                item[col.field] = 0
              }
            }
            if (col.format === 'percent') {
              item[col.field] = item[col.field] * 100
            }
            item[col.field] = item[col.field].toFixed(col.decimal)
            item[col.field] = +item[col.field]
          })
          _mdata.set(item[plot.Xaxis], item)
        }
      })
      _data = [..._mdata.values()]
    }
    return _data
  }
  viewrender = () => {
@@ -267,6 +367,10 @@
    let data = this.getdata()
    if (data.length === 0) {
      return
    }
    const ds = new DataSet()
    const dv = ds.createView().source(data)
@@ -395,7 +499,7 @@
    return (
      <div className="line-chart-edit-box" style={{minHeight: plot.height ? plot.height + 50 : 450}}>
        <p className="chart-title">{plot.title}</p>
        {plot.title ? <p className="chart-title">{plot.title}</p> : null}
        <div className="canvas" id={plot.uuid}></div>
      </div>
    )
src/templates/comtableconfig/index.jsx
@@ -1375,7 +1375,7 @@
                  if (item.chartType === 'table') {
                    return (
                      <Col span={item.width || 24} key={item.uuid}>
                        {config.charts.length > 1 ? <p className="chart-title">{item.title}</p> : null}
                        {config.charts.length > 1 && item.title ? <p className="chart-title">{item.title}</p> : null}
                        <ActionComponent
                          type="main"
                          menu={{ MenuID: this.props.menu.MenuID, MenuName: this.props.menu.MenuName, MenuNo: this.props.menu.MenuNo }}
src/templates/comtableconfig/index.scss
@@ -174,18 +174,30 @@
        margin-bottom: 70px;
        .chart-title {
          margin-bottom: 15px;
          position: relative;
          // top: -20px;
          color: rgba(0, 0, 0, 0.85);
          font-weight: 400;
          font-size: 16px;
          line-height: 25px;
          height: 35px;
          text-overflow: ellipsis;
          white-space: nowrap;
          overflow: hidden;
          max-width: 50%;
          padding-top: 10px;
          padding-left: 30px;
          margin: 0 20px;
          padding: 10px 5px 5px;
          border-bottom: 1px solid #e8e8e8;
          // margin-bottom: 15px;
          // color: rgba(0, 0, 0, 0.85);
          // font-weight: 400;
          // font-size: 16px;
          // line-height: 25px;
          // height: 35px;
          // text-overflow: ellipsis;
          // white-space: nowrap;
          // overflow: hidden;
          // max-width: 50%;
          // padding-top: 10px;
          // padding-left: 30px;
        }
      }
    }
src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { is, fromJS } from 'immutable'
import { fromJS } from 'immutable'
import { Drawer, Form, Button, Col, Row, Select, Icon, Radio, Tooltip, Input, InputNumber } from 'antd'
import { getChartOptionForm } from '@/templates/zshare/formconfig'
@@ -15,7 +15,9 @@
  }
  state = {
    view: 'normal',
    visible: false,
    plot: null,
    formlist: null
  }
@@ -24,18 +26,12 @@
    this.setState({
      visible: true,
      plot: fromJS(plot).toJS(),
      formlist: getChartOptionForm(plot, config.columns, config.setting)
    })
  }
  onClose = (type) => {
    if (type !== 'submit') {
      this.setState({
        visible: false
      })
      return
    }
  onSubmit = () => {
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        this.setState({
@@ -181,7 +177,26 @@
    return fields
  }
  changeView = () => {
    let _view = this.state.view === 'normal' ? 'custom' : 'normal'
    if (_view === 'custom') {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          let _plot = {...this.state.plot, ...values}
          this.setState({
            plot: _plot,
            view: _view
          })
        }
      })
    }
    this.setState({view: _view})
  }
  render() {
    const { view } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -200,13 +215,21 @@
          title="图表编辑"
          className="chart-drawer-form"
          width={720}
          onClose={this.onClose}
          onClose={() => this.setState({ visible: false })}
          visible={this.state.visible}
          bodyStyle={{ paddingBottom: 80 }}
        >
          <Form {...formItemLayout}>
          {view !== 'custom' ? <Form {...formItemLayout}>
            <Row gutter={16}>{this.getFields()}</Row>
          </Form>
            <Row gutter={16}>
              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset',float: 'right', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}>自定义设置<Icon style={{marginLeft: 5}} type="right" /></Button>
            </Row>
          </Form> : null}
          {/* <Form {...formItemLayout}>
            <Row gutter={16}>
              <Button onClick={this.changeView} style={{border: 0, boxShadow: 'unset',float: 'right', color: '#1890ff', marginRight: 12, cursor: 'pointer'}}>自定义设置<Icon style={{marginLeft: 5}} type="right" /></Button>
            </Row>
          </Form> */}
          <div
            style={{
              position: 'absolute',
@@ -219,10 +242,10 @@
              textAlign: 'right',
            }}
          >
            <Button onClick={this.onClose} style={{ marginRight: 8 }}>
            <Button onClick={() => this.setState({ visible: false })} style={{ marginRight: 8 }}>
              取消
            </Button>
            <Button onClick={() => this.onClose('submit')} type="primary">
            <Button onClick={() => this.onSubmit()} type="primary">
              提交
            </Button>
          </div>
src/templates/sharecomponent/chartcomponent/index.jsx
@@ -6,7 +6,7 @@
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import ChartDrawerForm from './chartcompile'
import ChartCompileForm from './chartcompile'
import './index.scss'
class LineChart extends Component {
@@ -442,9 +442,9 @@
    return (
      <div className="line-chart-edit-box" style={{minHeight: plot.height ? plot.height + 50 : 450}}>
        <p className="chart-title">{plot.title}</p>
        {plot.title ? <p className="chart-title">{plot.title}</p> : null}
        <div className="canvas" id={plot.uuid}></div>
        <ChartDrawerForm
        <ChartCompileForm
          plot={plot}
          type={plot.chartType}
          config={this.props.config}
src/templates/zshare/createinterface/index.jsx
@@ -483,8 +483,8 @@
        param.Ltexttableparam.unshift(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`)
      }
      if (btn.Ot !== 'notRequired' && !_keys.includes(config.setting.primaryKey.toLowerCase())) {
        param.Ltexttableparam.unshift(`select '${config.setting.primaryKey}' as searchfield,'${config.setting.primaryKey}' as label,'1' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`)
      if (btn.Ot !== 'notRequired' && !_keys.includes('id')) {
        param.Ltexttableparam.unshift(`select 'ID' as searchfield,'ID' as label,'1' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`)
      }
      param.Ltexttableparam = param.Ltexttableparam.join(' union all ')
src/templates/zshare/formconfig.jsx
@@ -1086,6 +1086,9 @@
      }, {
        value: 'thdSeparator',
        text: Formdict['header.form.thdSeparator']
      }, {
        value: 'percent',
        text: '百分比'
      }],
      required: false
    },
src/views/login/index.jsx
@@ -277,6 +277,15 @@
    })
  }
  /**
   * @description 组件销毁,清除state更新
   */
  componentWillUnmount () {
    this.setState = () => {
      return
    }
  }
  render () {
    const { lineColor, bgImage, loginlogo, copyRight, webSite, ICP } = this.state