king
2019-11-24 7d206112a4ca1930639907a7cb131d0c1e6525a6
2019-11-24-01
6 文件已重命名
10个文件已修改
204 ■■■■■ 已修改文件
src/components/sidemenu/editthdmenu/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.scss 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainAction/index.jsx 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainAction/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainSearch/index.jsx 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainSearch/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainTable/index.jsx 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/mainTable/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/dragelement/card.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/editcard/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.scss 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/searchform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/sidemenu/editthdmenu/index.jsx
@@ -316,7 +316,7 @@
        usedTemplates: res.UserTemp.map(temp => {
          let _config = ''
          if (temp.LongParam) {
            _config = window.atob(temp.LongParam)
            _config = window.decodeURIComponent(window.atob(temp.LongParam))
            try {
              _config = JSON.parse(_config)
            } catch (e) {
src/locales/en-US/comtable.js
@@ -48,6 +48,7 @@
  'header.form.dateweek': '日期(周)',
  'header.form.datemonth': '日期(月)',
  'header.form.dateyear': '日期(年)',
  'header.form.daterange': '日期(区间)',
  'header.form.initval': 'Initial Value',
  'header.form.isRequired': '行设置',
  'header.form.notRequired': '不选择行',
src/locales/zh-CN/comtable.js
@@ -48,6 +48,7 @@
  'header.form.dateweek': '日期(周)',
  'header.form.datemonth': '日期(月)',
  'header.form.dateyear': '日期(年)',
  'header.form.daterange': '日期(区间)',
  'header.form.initval': '初始值',
  'header.form.isRequired': '行设置',
  'header.form.notRequired': '不选择行',
src/tabviews/commontable/index.jsx
@@ -1,11 +1,12 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { BackTop } from 'antd'
import { BackTop, notification} from 'antd'
import Api from '@/api'
import MainSearch from './modules/mainSearch'
import MainAction from './modules/mainAction'
import MainTable from './modules/mainTable'
import MainSearch from './mainSearch'
// import MainAction from './mainAction'
// import MainTable from './mainTable'
import NotFount from '@/components/404'
import Loading from '@/components/loading'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
@@ -19,6 +20,9 @@
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    loadingview: true,
    viewlost: false,
    config: {},
    searchlist: null,
    actions: null,
    columns: null,
@@ -43,31 +47,36 @@
      MenuID: this.props.MenuID
    }
    let result = await Api.getSystemConfig(param)
    if (result.status) {
      let newconfig = {}
      if (result.searches && result.searches.length > 0) {
        newconfig.searchlist = result.searches.map(search => {
          search.DynOptions = search.DynOptions ? JSON.parse(search.DynOptions) : ''
          return search
    if (result.status && result.LongParam) {
      let config = window.decodeURIComponent(window.atob(result.LongParam))
      try {
        config = JSON.parse(config)
        this.setState({
          loadingview: false
        })
      } catch (e) {
        this.setState({
          loadingview: false,
          viewlost: true
        })
        notification.warning({
          top: 92,
          message: result.message || '页面配置错误',
          duration: 10
        })
      }
      if (result.actions && result.actions.length > 0) {
        newconfig.actions = result.actions.map(action => {
          return action
        })
      }
      if (result.columns && result.columns.length > 0) {
        newconfig.columns = result.columns.map(column => {
          return column
        })
        newconfig.columns.length = 3
      }
      newconfig.fixed = {
        fixaction: true,
        fixtable: true
      }
      newconfig.select = result.select
      this.setState(newconfig)
      this.setState({config})
    } else {
      this.setState({
        loadingview: false,
        viewlost: true
      })
      notification.warning({
        top: 92,
        message: result.message || '页面配置错误',
        duration: 10
      })
    }
  }
@@ -143,7 +152,7 @@
  UNSAFE_componentWillMount () {
    // 组件加载时,获取菜单数据
    this.loadconfig()
    this.loadmaindata()
    // this.loadmaindata()
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -151,17 +160,19 @@
  }
  render() {
    const { config, loadingview, viewlost } = this.state
    return (
      <div className="commontable">
        {!this.state.searchlist && <Loading />}
        {this.state.searchlist &&
        {loadingview && <Loading />}
        {config.search && config.search.length > 0 ?
          <MainSearch
            refreshdata={this.refreshbysearch}
            searchlist={this.state.searchlist}
            searchlist={config.search}
            dict={this.state.dict}
          />
          /> : null
        }
        {this.state.actions &&
        {/* {this.state.actions &&
          <MainAction
            MenuNo={this.props.MenuNo}
            fixed={this.state.fixed.fixaction}
@@ -184,7 +195,7 @@
            loading={this.state.loading}
            dict={this.state.dict}
          />
        }
        } */}
        <BackTop>
          <div className="ant-back-top">
            <div className="ant-back-top-content">
@@ -192,6 +203,7 @@
            </div>
          </div>
        </BackTop>
        {viewlost ? <NotFount /> : null}
      </div>
    )
  }
src/tabviews/commontable/index.scss
@@ -1,6 +1,9 @@
.commontable {
  min-height: calc(100vh - 94px);
  padding-top: 16px;
  .box404 {
    padding-top: 30px;
  }
}
.ant-back-top {
  bottom: 30px;
src/tabviews/commontable/mainAction/index.jsx
src/tabviews/commontable/mainAction/index.scss
src/tabviews/commontable/mainSearch/index.jsx
File was renamed from src/tabviews/commontable/modules/mainSearch/index.jsx
@@ -23,21 +23,22 @@
  }
  UNSAFE_componentWillMount () {
    let formats = {}
    let match = {}
    this.props.searchlist.forEach(item => {
      if (item.Type === 'date') {
        // formats[item.FieldName] = dateFormat
        formats[item.FieldName] = weekFormat
      } else if (item.ID === 'WHE1400200905') {
        formats[item.FieldName] = monthFormat
      }
      match[item.FieldName] = item.Op
    })
    this.setState({
      formats: formats,
      match: match
    })
    console.log(this.props.searchlist)
    // let formats = {}
    // let match = {}
    // this.props.searchlist.forEach(item => {
    //   if (item.Type === 'date') {
    //     // formats[item.FieldName] = dateFormat
    //     formats[item.FieldName] = weekFormat
    //   } else if (item.ID === 'WHE1400200905') {
    //     formats[item.FieldName] = monthFormat
    //   }
    //   match[item.FieldName] = item.Op
    // })
    // this.setState({
    //   formats: formats,
    //   match: match
    // })
  }
  // shouldComponentUpdate (nextProps, nextState) {
@@ -48,39 +49,39 @@
    const { getFieldDecorator } = this.props.form
    const fields = []
    this.props.searchlist.forEach((item, index) => {
      if (item.Type === 'text' || item.Type === 'string') { // 文本搜索
      if (item.type === 'text') { // 文本搜索
        fields.push(
          <Col span={6} key={index}>
            <Form.Item label={item.Label}>
              {getFieldDecorator(item.FieldName)(<Input placeholder="" autoComplete="off" />)}
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {initialValue: item.initval })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col>
        )
      } else if (item.Type === 'select') { // 下拉搜索
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={6} key={index}>
            <Form.Item label={item.Label}>
              {getFieldDecorator(item.FieldName, {initialValue: item.DynOptions[0].id })(
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {initialValue: item.initval })(
                <Select
                  showSearch
                  onChange={(val) => {this.selectChange(item.FieldName, val)}}
                  onChange={(val) => {this.selectChange(item.field, val)}}
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {item.DynOptions.map(option =>
                    <Select.Option id={option.id} title={option.text} key={option.id} value={option.id}>{option.text}</Select.Option>
                  {item.options.map(option =>
                    <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.Type === 'date') { // 时间搜索
      } else if (item.type === 'date') { // 时间搜索
        if (item.ID === 'WHE14002009024') {
          fields.push(
            <Col span={6} key={index}>
              <Form.Item label={item.Label}>
                {getFieldDecorator(item.FieldName, {initialValue: moment('2019-09-14', dateFormat) })(
                  <DatePicker format={dateFormat} onChange={(val) => {this.timeChange(item.FieldName, val)}} />
              <Form.Item label={item.label}>
                {getFieldDecorator(item.field, {initialValue: moment('2019-09-14', dateFormat) })(
                  <DatePicker format={dateFormat} onChange={(val) => {this.timeChange(item.field, val)}} />
                )}
              </Form.Item>
            </Col>
@@ -88,8 +89,8 @@
        } else if (item.ID === 'WHE1400200905') {
          fields.push(
            <Col span={6} key={index}>
              <Form.Item label={item.Label}>
                {getFieldDecorator(item.FieldName, {initialValue: moment('2019-09', monthFormat) })(
              <Form.Item label={item.label}>
                {getFieldDecorator(item.field, {initialValue: moment('2019-09', monthFormat) })(
                  <MonthPicker format={monthFormat} onChange={(val) => {this.timeChange(item.FieldName, val)}} />
                )}
              </Form.Item>
src/tabviews/commontable/mainSearch/index.scss
src/tabviews/commontable/mainTable/index.jsx
src/tabviews/commontable/mainTable/index.scss
src/templates/comtableconfig/dragelement/card.jsx
@@ -5,7 +5,7 @@
import ItemTypes from './itemtypes'
import './index.scss'
const { MonthPicker, WeekPicker } = DatePicker
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
const Card = ({ id, type, card, moveCard, findCard, editCard, copyCard, hasDrop }) => {
  const originalIndex = findCard(id).index
@@ -41,6 +41,20 @@
    copyCard(id)
  }
  let selectval = ''
  if (type === 'search' && card.type === 'select') {
    if (card.initval) {
      let _option = card.options.filter(option => option.Value === card.initval)[0]
      if (_option) {
        selectval = _option.Text || ''
      } else {
        selectval = ''
      }
    } else if (card.setAll === 'true') {
      selectval = '全部'
    }
  }
  return (
    <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}>
      <div ref={node => drag(drop(node))}>
@@ -53,7 +67,7 @@
              <Input style={{marginTop: '4px'}} defaultValue={card.initval} /> : null
            }
            {(card.type === 'select' || card.type === 'link') ?
              <Select defaultValue={card.initval}></Select> : null
              <Select defaultValue={selectval}></Select> : null
            }
            {card.type === 'date' ?
              <DatePicker defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> : null
@@ -64,8 +78,12 @@
            {card.type === 'datemonth' ?
              <MonthPicker defaultValue={card.initval ? moment().subtract(card.initval, 'month') : null} /> : null
            }
            {card.type === 'datetime' ?
              <DatePicker showTime defaultValue={card.initval ? moment(card.initval, 'YYYY-MM-DD HH:mm:ss') : null} /> : null
            {card.type === 'daterange' ?
              <RangePicker
                placeholder={['开始日期', '结束日期']}
                renderExtraFooter={() => 'extra footer'}
                defaultValue={card.initval ? [moment().subtract(card.initval, 'days'), moment().subtract(card.initval === 1 ? 1 : 0, 'days')] : [null, null]}
              /> : null
            }
            <div className="input-mask"></div>
          </div>
src/templates/comtableconfig/editcard/index.jsx
@@ -52,7 +52,7 @@
          <Radio.Group onChange={this.changeType} value={card.type} disabled={!card.selected}>
            <Radio value="text">text</Radio>
            <Radio value="select">select</Radio>
            <Radio value="date">date</Radio>
            <Radio value="daterange">daterange</Radio>
          </Radio.Group> : null
        }
        {type === 'columns' ?
src/templates/comtableconfig/index.jsx
@@ -64,11 +64,14 @@
   * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单
   */
  UNSAFE_componentWillMount () {
    const { menu } = this.props
    const { menu, type } = this.props
    let _LongParam = menu.LongParam
    let _config = ''
    if (this.props.type === 'add' || !_LongParam) {
    let _type = type
    if (_type === 'add' || !_LongParam) {
      _type = 'add'
      _config = JSON.parse(JSON.stringify((Source.baseConfig)))
    } else {
      let _setting = Source.baseConfig.setting
@@ -81,7 +84,7 @@
    this.setState({
      config: _config,
      operaType: this.props.type,
      operaType: _type,
      originMenu: JSON.parse(JSON.stringify({...menu})),
      selectedTables: _config.tables || [],
      menuformlist: [
@@ -292,8 +295,8 @@
            value: 'datemonth',
            text: this.state.dict['header.form.datemonth']
          }, {
            value: 'dateyear',
            text: this.state.dict['header.form.dateyear']
            value: 'daterange',
            text: this.state.dict['header.form.daterange']
          }]
        },
        {
@@ -693,7 +696,7 @@
            return item
          }
        })
        _config[res.type] = _config[res.type].filter(item => !item.origin)
        // _config[res.type] = _config[res.type].filter(item => !item.origin)
      }
      this.setState({
@@ -1017,9 +1020,11 @@
              item.match = textmatch[cell.datatype]
            } else if (cell.type === 'select') {
              item.match = selectmatch[cell.datatype]
            } else if (cell.type === 'date') {
            } else if (cell.type === 'daterange') {
              item.match = datematch[cell.datatype]
            }
            item.type = cell.type
            item.initval = ''
            items.push(item)
          }
@@ -1040,7 +1045,7 @@
            _match = textmatch[item.datatype]
          } else if (item.type === 'select') {
            _match = selectmatch[item.datatype]
          } else if (item.type === 'date') {
          } else if (item.type === 'daterange') {
            _match = datematch[item.datatype]
          }
src/templates/comtableconfig/index.scss
@@ -181,6 +181,11 @@
                right: 0;
                bottom: 0;
                opacity: 0;
                z-index: 2;
              }
              .ant-calendar-picker-input {
                padding: 4px 20px 4px 5px;
                font-size: 13px;
              }
            }
          }
src/templates/comtableconfig/searchform/index.jsx
@@ -22,7 +22,7 @@
      date: [{value: '', text: '空'}, {value: '0', text: '当天'}, {value: 1, text: '前一天'}, {value: 3, text: '前三天'}, {value: 7, text: '前七天'}, {value: 30, text: '前30天'}],
      dateweek: [{value: '', text: '空'}, {value: '0', text: '本周'}, {value: 1, text: '上周'}, {value: 3, text: '前三周'}, {value: 7, text: '前七周'}],
      datemonth: [{value: '', text: '空'}, {value: '0', text: '本月'}, {value: 1, text: '上月'}, {value: 3, text: '前三月'}, {value: 7, text: '前七月'}],
      dateyear: [{value: '', text: '空'}, {value: '0', text: '当年'}, {value: 1, text: '去年'}, {value: 3, text: '前年'}],
      daterange: [{value: '', text: '空'}, {value: '0', text: '今天'}, {value: 1, text: '昨天'}, {value: 3, text: '前三天'}, {value: 7, text: '前七天'}, {value: 30, text: '前30天'}],
    }
  }