king
2019-12-26 e47f5f999cb20283ad99c00c5e771d44501cf3c9
2019-12-26
18个文件已修改
450 ■■■■ 已修改文件
src/components/header/resetpwd/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/comtable.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/comtable.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/topSearch/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/topSearch/index.scss 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.scss 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.scss 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/source.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/dragelement/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/resetpwd/index.jsx
@@ -87,11 +87,11 @@
                message: this.props.dict['header.password.new.required']
              },
              {
                min: 6,
                message: this.props.dict['header.password.minlen']
                pattern: /^[0-9a-zA-Z!@#$%^&*()_]*$/ig,
                message: '密码只允许包含数字、字母以及!@#$%&*()_。'
              },
              {
                max: 12,
                max: 50,
                message: this.props.dict['header.password.maxlen']
              },
              {
src/locales/en-US/comtable.js
@@ -63,6 +63,8 @@
  'header.form.position': 'Position',
  'header.form.execSuccess': 'Success',
  'header.form.execError': 'Failure',
  'header.form.messageTip': '信息提示',
  'header.form.errorTime': '停留时间',
  'header.form.refresh.never': 'Don\'t refresh',
  'header.form.refresh.view': 'Refresh the page',
  'header.form.refresh.grid': 'Refresh the table',
src/locales/zh-CN/comtable.js
@@ -63,6 +63,8 @@
  'header.form.position': '显示位置',
  'header.form.execSuccess': '执行成功',
  'header.form.execError': '执行失败',
  'header.form.messageTip': '信息提示',
  'header.form.errorTime': '停留时间',
  'header.form.refresh.never': '不刷新',
  'header.form.refresh.view': '刷新页面',
  'header.form.refresh.grid': '刷新表格',
src/tabviews/commontable/index.jsx
@@ -310,18 +310,24 @@
    const { arr_field, pageIndex, pageSize, orderColumn, orderType, search, setting } = this.state
    let _search = Utils.joinMainSearchkey(search)
    _search = _search ? 'where ' + _search : ''
    _search = _search ? 'where ' + _search : ''
    let param = {
      func: 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field
    }
    let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order
    let _dataresource = setting.dataresource
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${setting.dataresource} ${_search}`
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${_dataresource} ${_search}`
    console.log(LText)
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
@@ -459,8 +465,13 @@
    }
    let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order
    let _dataresource = setting.dataresource
    let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable order by tmptable.rows`
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
    console.log(LText)
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
src/tabviews/subtable/index.jsx
@@ -309,9 +309,14 @@
    }
    let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order
    let _dataresource = setting.dataresource
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${setting.dataresource} ${_search}`
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    let LText = `select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows`
    let DateCount = `select count(1) as total from ${_dataresource} ${_search}`
    console.log(LText)
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
@@ -432,8 +437,13 @@
    }
    let orderBy = orderColumn ? (orderColumn + ' ' + orderType) : setting.order
    let _dataresource = setting.dataresource
    let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${setting.dataresource} ${_search}) tmptable order by tmptable.rows`
    if (/\s/.test(_dataresource)) {
      _dataresource = '(' + _dataresource + ') tb'
    }
    let LText = `select ${_arr_label_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows`
    console.log(LText)
    param.LText = Utils.formatOptions(LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
src/tabviews/subtable/index.scss
@@ -2,6 +2,12 @@
  position: relative;
  min-height: 200px;
  padding-top: 16px;
  > .top-search {
    padding: 0 0px 20px;
  }
  > .button-list {
    padding: 10px 0px 5px;
  }
  .box404 {
    padding-top: 30px;
  }
src/tabviews/tableshare/actionList/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import moment from 'moment'
import { Button, Affix, Modal, notification, Spin } from 'antd'
import { Button, Affix, Modal, notification, Spin, message } from 'antd'
import MutilForm from '@/tabviews/tableshare/mutilform'
import Utils from '@/utils/utils.js'
import Api from '@/api'
@@ -30,14 +30,13 @@
    configMap: {}
  }
  UNSAFE_componentWillMount() {
    console.log(this.props.type)
  }
  refreshdata = (item, type) => {
    this.props.refreshdata(item, type)
  }
  
  /**
   * @description 触发按钮操作
   */
  actionTrigger = (item, record) => {
    const { setting } = this.props
@@ -181,7 +180,7 @@
        Api.genericInterface(param).then((res) => {
          if (res.status) {
            this.execSuccess(btn)
            this.execSuccess(btn, res)
          } else {
            this.execError(res, btn)
          }
@@ -236,21 +235,16 @@
          let errorMsg = ''
          result.forEach(res => {
            if (res.status) {
              errorMsg = res
            } else {
              iserror = true
              errorMsg = res.message
              errorMsg = res
            }
          })
          if (!iserror) {
            this.execSuccess(btn)
            this.execSuccess(btn, errorMsg)
          } else {
            notification.error({
              top: 92,
              message: errorMsg,
              duration: 15
            })
            this.refreshdata(btn, 'error')
            this.execError(errorMsg, btn)
          }
          _resolve()
        })
@@ -333,7 +327,7 @@
              response.func = btn.callbackFunc
              return Api.genericInterface(response)
            } else {
              this.execSuccess(btn)
              this.execSuccess(btn, response)
              _resolve()
            }
          } else {
@@ -344,7 +338,7 @@
          if (!res) return
  
          if (res.status) {
            this.execSuccess(btn)
            this.execSuccess(btn, res)
          } else {
            this.execError(res, btn)
          }
@@ -429,16 +423,13 @@
          result.forEach(res => {
            if (!res.status) {
              iserror = true
              errorMsg = res.message
              errorMsg = res
            } else {
              errorMsg = res
            }
          })
          if (iserror) {
            notification.error({
              top: 92,
              message: errorMsg,
              duration: 15
            })
            this.refreshdata(btn, 'error')
            this.execError(errorMsg, btn)
            _resolve()
            return
          }
@@ -461,7 +452,7 @@
            return Promise.all(deffers)
          } else {
            _resolve()
            this.execSuccess(btn)
            this.execSuccess(btn, errorMsg)
          }
        }).then(result => {
          if (!result) return
@@ -471,19 +462,16 @@
          result.forEach(res => {
            if (!res.status) {
              iserror = true
              errorMsg = res.message
              errorMsg = res
            } else {
              errorMsg = res
            }
          })
          if (iserror) {
            notification.error({
              top: 92,
              message: errorMsg,
              duration: 15
            })
            this.refreshdata(btn, 'error')
            this.execError(errorMsg, btn)
            return
          } else {
            this.execSuccess(btn)
            this.execSuccess(btn, errorMsg)
          }
          _resolve()
        })
@@ -501,17 +489,27 @@
    }
  }
  execSuccess = (btn) => {
  /**
   * @description 操作成功后处理
   * 1、excel导出,成功后取消导出按钮加载中状态
   * 2、状态码为 S 时,显示成功信息后系统默认信息
   * 3、状态码为 -1 时,不显示任何信息
   * 4、模态框执行成功后是否关闭
   * 5、通知主列表刷新
   */
  execSuccess = (btn, res) => {
    if (btn.OpenType === 'excelOut') {
      this.setState({
        loadingUuid: ''
      })
    } else {
    } else if (res && res.ErrCode === 'S') {
      notification.success({
        top: 92,
        message: this.props.dict['main.action.confirm.success'],
        message: res.ErrMesg || this.props.dict['main.action.confirm.success'],
        duration: 2
      })
    } else if (res && res.ErrCode === '-1') {
    }
    
    if (btn.OpenType === 'pop' && btn.setting && btn.setting.finish !== 'unclose') {
@@ -522,17 +520,32 @@
    this.refreshdata(btn, 'success')
  }
  /**
   * @description 操作失败后处理
   * 1、状态码为 E、N、F、NM 时,显示相应提示信息
   * 2、excel导出,失败后取消导出按钮加载中状态
   * 3、通知主列表刷新
   */
  execError = (res, btn) => {
    if (!res.ErrCode || res.ErrCode === 'E') {
    if (res.ErrCode === 'E') {
      Modal.error({
        title: res.message || res.ErrMesg,
      })
    } else if (res.ErrCode === 'N') {
      notification.error({
        top: 92,
        message: res.message || res.ErrMesg,
        duration: 15
        duration: btn.errorTime || 15
      })
    } else if (res.ErrCode === 'E') {
      Modal.error({
        title: res.message || res.ErrMesg
    } else if (res.ErrCode === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: res.message || res.ErrMesg,
        duration: btn.errorTime || 15
      })
    } else if (res.ErrCode === 'NM') {
      message.error(res.message || res.ErrMesg)
    }
    
    if (btn.OpenType === 'excelOut') {
@@ -544,6 +557,9 @@
    this.refreshdata(btn, 'error')
  }
  /**
   * @description 按钮配置信息错误提示
   */
  actionSettingError = () => {
    notification.warning({
      top: 92,
@@ -552,6 +568,9 @@
    })
  }
  /**
   * @description 获取按钮配置信息
   */
  improveAction = (action) => {
    const { configMap, execAction } = this.state
@@ -613,6 +632,9 @@
    }
  }
  /**
   * @description 获取下拉表单选项信息
   */
  improveActionForm = () => {
    const { configMap, execAction } = this.state
    let subfields = []
@@ -710,6 +732,9 @@
    })
  }
  /**
   * @description 模态框(表单),确认
   */
  handleOk = () => {
    this.formRef.handleConfirm().then(res => {
      this.setState({
@@ -723,12 +748,18 @@
    }, () => {})
  }
  /**
   * @description 模态框(表单),取消
   */
  handleCancel = () => {
    this.setState({
      visible: false
    })
  }
  /**
   * @description 显示模态框
   */
  getModels = () => {
    const { execAction } = this.state
src/tabviews/tableshare/topSearch/index.jsx
@@ -250,7 +250,7 @@
  render() {
    return (
      <Form className="ant-advanced-search-form subtable-main-search" onSubmit={this.handleSearch}>
      <Form className="ant-advanced-search-form top-search" onSubmit={this.handleSearch}>
        <Row gutter={24}>{this.getFields()}</Row>
      </Form>
    )
src/tabviews/tableshare/topSearch/index.scss
@@ -1,5 +1,5 @@
.ant-advanced-search-form.subtable-main-search {
  padding: 0px 0px 20px;
.ant-advanced-search-form.top-search {
  padding: 0px 24px 20px;
  border-bottom: 1px solid #efefef;
  .ant-form-item {
    display: flex;
src/templates/comtableconfig/actionform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Button, Modal, message } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import './index.scss'
@@ -16,6 +16,7 @@
  state = {
    formlist: null,
    openType: null,
    errorType: 'E',
    interType: null,
    position: null,
    reqOptionSgl: [{
@@ -66,10 +67,24 @@
  
  UNSAFE_componentWillMount () {
    let _opentype = this.props.formlist.filter(form => form.key === 'OpenType')[0].initVal
    let _intertype = this.props.formlist.filter(form => form.key === 'intertype')[0].initVal
    let _position = this.props.formlist.filter(form => form.key === 'position')[0].initVal
    let _opentype = ''
    let _intertype = ''
    let _position = ''
    let _errorType = ''
    let _options = null
    this.props.formlist.forEach(form => {
      if (form.key === 'OpenType') {
        _opentype = form.initVal
      } else if (form.key === 'intertype') {
        _intertype = form.initVal
      } else if (form.key === 'position') {
        _position = form.initVal
      } else if (form.key === 'errorTip') {
        _errorType = form.initVal
      }
    })
    if (_opentype === 'innerpage') { // 新页面(内部),可选模板
      _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
    } else if (_opentype === 'outerpage') { // 新页面(外部),需要页面地址
@@ -84,15 +99,16 @@
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'method']
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
      }
    }
    this.setState({
      openType: _opentype,
      interType: _intertype,
      position: _position,
      errorType: _errorType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -137,9 +153,9 @@
        }
      } else {
        if (this.state.interType === 'inner') {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
        } else {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method']
        }
      }
      this.setState({
@@ -216,6 +232,10 @@
          })
        })
      })
    } else if (key === 'errorTip') {
      this.setState({
        errorType: value
      })
    }
  }
@@ -228,6 +248,9 @@
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
      }
      if (['pop', 'prompt', 'exec'].includes(this.state.openType)) {
        _options.push('errorTip', 'errorTime')
      }
      this.setState({
        interType: value,
        formlist: this.state.formlist.map(item => {
@@ -235,6 +258,37 @@
          return item
        })
      })
    }
  }
  showError = () => {
    const { errorType } = this.state
    if (errorType === 'S') {
      notification.success({
        top: 92,
        message: '执行成功!',
        duration: 2
      })
    } else if (errorType === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'N') {
      notification.error({
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'E') {
      Modal.error({
        title: '执行失败!'
      })
    } else if (errorType === 'NM') {
      message.error('执行失败!')
    }
  }
@@ -278,9 +332,24 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
      } else if (item.type === 'number') { // 文本搜索
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal
              })(<InputNumber min={1} max={10000} precision={0} />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index} className={item.key === 'errorTip' ? 'with-button' : ''}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
@@ -310,6 +379,7 @@
                </Select>
              )}
            </Form.Item>
            {item.key === 'errorTip' ? <Button onClick={this.showError}>查看</Button> : null}
          </Col>
        )
      } else if (item.type === 'radio') {
src/templates/comtableconfig/actionform/index.scss
@@ -12,9 +12,22 @@
      width: 86%;
    }
  }
  .ant-input-number {
    width: 100%;
  }
  .anticon-question-circle {
    color: #c49f47;
    position: relative;
    left: -3px;
  }
  .with-button {
    .ant-form-item-control-wrapper {
      padding-right: 63px;
    }
    .ant-btn {
      position: absolute;
      right: 12px;
      top: 4.5px;
    }
  }
}
src/templates/comtableconfig/index.jsx
@@ -684,6 +684,42 @@
        },
        {
          type: 'select',
          key: 'errorTip',
          label: this.state.dict['header.form.messageTip'],
          initVal: card.errorTip || 'E',
          tooltip: '该选项为提示效果展示,选择提示类型后,可点击按钮查看,自定义函数中设置 ErrCode 为(S、-1、E、N、F、NM)时,会以对应方式展示提示信息。',
          tooltipClass: 'middle',
          required: false,
          options: [{
            MenuID: 'S',
            text: 'S(提醒框-0)'
          }, {
            MenuID: '-1',
            text: '-1(不提示)'
          }, {
            MenuID: 'N',
            text: 'N(提醒框-1)'
          }, {
            MenuID: 'F',
            text: 'F(提醒框-2)'
          }, {
            MenuID: 'E',
            text: 'E(确认框)'
          }, {
            MenuID: 'NM',
            text: 'NM(顶部提示)'
          }]
        },
        {
          type: 'number',
          key: 'errorTime',
          label: this.state.dict['header.form.errorTime'],
          initVal: card.errorTime || 15,
          tooltip: '执行结果中设置 ErrCode 为 N 或 F 时有效',
          required: false
        },
        {
          type: 'select',
          key: 'icon',
          label: this.state.dict['header.form.icon'],
          initVal: card.icon,
src/templates/comtableconfig/source.jsx
@@ -98,6 +98,7 @@
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        pageTemplate: '',
        url: '',
@@ -119,6 +120,7 @@
        position: 'grid',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        pageTemplate: '',
        url: '',
@@ -140,6 +142,7 @@
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'prompt',
        pageTemplate: '',
        url: '',
src/templates/subtableconfig/actionform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber, Button, Modal, message } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import './index.scss'
@@ -16,6 +16,7 @@
  state = {
    formlist: null,
    openType: null,
    errorType: 'E',
    interType: null,
    position: null,
    reqOptionSgl: [{
@@ -59,10 +60,24 @@
  
  UNSAFE_componentWillMount () {
    let _opentype = this.props.formlist.filter(form => form.key === 'OpenType')[0].initVal
    let _intertype = this.props.formlist.filter(form => form.key === 'intertype')[0].initVal
    let _position = this.props.formlist.filter(form => form.key === 'position')[0].initVal
    let _opentype = ''
    let _intertype = ''
    let _position = ''
    let _errorType = ''
    let _options = null
    this.props.formlist.forEach(form => {
      if (form.key === 'OpenType') {
        _opentype = form.initVal
      } else if (form.key === 'intertype') {
        _intertype = form.initVal
      } else if (form.key === 'position') {
        _position = form.initVal
      } else if (form.key === 'errorTip') {
        _errorType = form.initVal
      }
    })
    if (_opentype === 'excelIn' || _opentype === 'excelOut') {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method']
@@ -71,15 +86,16 @@
      }
    } else {
      if (_intertype === 'outer') {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'method']
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
      }
    }
    this.setState({
      openType: _opentype,
      interType: _intertype,
      position: _position,
      errorType: _errorType,
      formlist: this.props.formlist.map(item => {
        if (item.key === 'class') {
          item.options = btnClasses
@@ -112,9 +128,9 @@
        }
      } else {
        if (this.state.interType === 'inner') {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'sql', 'sqlType']
        } else {
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
          _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'errorTip', 'errorTime', 'interface', 'outerFunc', 'callbackFunc', 'method']
        }
      }
      this.setState({
@@ -186,6 +202,10 @@
          })
        })
      })
    } else if (key === 'errorTip') {
      this.setState({
        errorType: value
      })
    }
  }
@@ -198,6 +218,9 @@
      } else {
        _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method']
      }
      if (['pop', 'prompt', 'exec'].includes(this.state.openType)) {
        _options.push('errorTip', 'errorTime')
      }
      this.setState({
        interType: value,
        formlist: this.state.formlist.map(item => {
@@ -205,6 +228,37 @@
          return item
        })
      })
    }
  }
  showError = () => {
    const { errorType } = this.state
    if (errorType === 'S') {
      notification.success({
        top: 92,
        message: '执行成功!',
        duration: 2
      })
    } else if (errorType === 'F') {
      notification.error({
        className: 'notification-custom-error',
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'N') {
      notification.error({
        top: 92,
        message: '执行失败!',
        duration: 15
      })
    } else if (errorType === 'E') {
      Modal.error({
        title: '执行失败!'
      })
    } else if (errorType === 'NM') {
      message.error('执行失败!')
    }
  }
@@ -248,9 +302,24 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
      } else if (item.type === 'number') { // 文本搜索
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal
              })(<InputNumber min={1} max={10000} precision={0} />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={12} key={index} className={item.key === 'errorTip' ? 'with-button' : ''}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}>
                <Icon type="question-circle" />
@@ -280,6 +349,7 @@
                </Select>
              )}
            </Form.Item>
            {item.key === 'errorTip' ? <Button onClick={this.showError}>查看</Button> : null}
          </Col>
        )
      } else if (item.type === 'radio') {
src/templates/subtableconfig/actionform/index.scss
@@ -17,4 +17,14 @@
    position: relative;
    left: -3px;
  }
  .with-button {
    .ant-form-item-control-wrapper {
      padding-right: 63px;
    }
    .ant-btn {
      position: absolute;
      right: 12px;
      top: 4.5px;
    }
  }
}
src/templates/subtableconfig/index.jsx
@@ -613,6 +613,42 @@
        },
        {
          type: 'select',
          key: 'errorTip',
          label: this.state.dict['header.form.messageTip'],
          initVal: card.errorTip || 'E',
          tooltip: '该选项为提示效果展示,选择提示类型后,可点击按钮查看,自定义函数中设置 ErrCode 为(S、-1、E、N、F、NM)时,会以对应方式展示提示信息。',
          tooltipClass: 'middle',
          required: false,
          options: [{
            MenuID: 'S',
            text: 'S(提醒框-0)'
          }, {
            MenuID: '-1',
            text: '-1(不提示)'
          }, {
            MenuID: 'N',
            text: 'N(提醒框-1)'
          }, {
            MenuID: 'F',
            text: 'F(提醒框-2)'
          }, {
            MenuID: 'E',
            text: 'E(确认框)'
          }, {
            MenuID: 'NM',
            text: 'NM(顶部提示)'
          }]
        },
        {
          type: 'number',
          key: 'errorTime',
          label: this.state.dict['header.form.errorTime'],
          initVal: card.errorTime || 15,
          tooltip: '执行结果中设置 ErrCode 为 N 或 F 时有效',
          required: false
        },
        {
          type: 'select',
          key: 'icon',
          label: this.state.dict['header.form.icon'],
          initVal: card.icon,
src/templates/subtableconfig/source.jsx
@@ -99,6 +99,7 @@
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        icon: 'plus',
        class: 'green'
@@ -118,6 +119,7 @@
        position: 'grid',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'pop',
        icon: 'form',
        class: 'purple'
@@ -137,6 +139,7 @@
        position: 'toolbar',
        execSuccess: 'grid',
        execError: 'never',
        errorTime: 15,
        OpenType: 'prompt',
        icon: 'delete',
        class: 'red'
src/templates/tableshare/dragelement/index.jsx
@@ -101,6 +101,7 @@
        newcard.position = 'toolbar'
        newcard.execSuccess = 'grid'
        newcard.execError = 'never'
        newcard.errorTime = 15
        newcard.callbackFunc = ''
        newcard.pageTemplate = ''
        newcard.url = ''