king
2020-01-09 f068c617b918fc7817c11724424cb1a9149ec3a2
2020-01-09
27个文件已修改
584 ■■■■■ 已修改文件
src/tabviews/tableshare/actionList/index.jsx 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/mutilform/index.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/settingform/index.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/tabform/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/groupform/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/modalform/index.jsx 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/settingform/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalviewconfig/actionform/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalviewconfig/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalviewconfig/settingform/index.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalviewconfig/tabform/index.jsx 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/settingform/index.jsx 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/colspanform/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/colspanform/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/columnform/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/columnform/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/gridbtnform/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/gridbtnform/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/menuform/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/searchform/index.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx
@@ -154,10 +154,7 @@
          func: 'sPC_TableData_InUpDe',
          BID: this.props.BID
        }
        if (setting.primaryKey) { // 主键值预设,从表格数据第一项选取
          param[setting.primaryKey] = (data[0] && data[0][setting.primaryKey]) || ''
        }
        let primaryId = setting.primaryKey && data[0] ? data[0][setting.primaryKey] : ''
        if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行
          let ID = ''
@@ -170,13 +167,13 @@
            ID = ids.join(',')
          }
          if (setting.primaryKey) {
            param[setting.primaryKey] = ID
          }
          if (btn.innerFunc) { // 使用自定义函数
            param.func = btn.innerFunc
            if (setting.primaryKey) { // 主键存在时,设置主键参数
              param[setting.primaryKey] = ID
            }
          } else if (btn.sql) {
            param.ID = primaryId
            param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, data[0])) // 数据源
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
            param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -185,19 +182,21 @@
          if (btn.innerFunc) {
            param.func = btn.innerFunc
            if (setting.primaryKey) { // 主键存在时,设置主键参数
              param[setting.primaryKey] = primaryId
            }
            formdata.forEach(_data => {
              param[_data.key] = _data.value
            })
          } else if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid
            if (setting.primaryKey) {
              param[setting.primaryKey] = Utils.getguid()
            }
            param.ID = Utils.getguid()
            param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0])) // 数据源
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
            param.secretkey = Utils.encrypt(param.LText, param.timestamp)
          } else if (btn.sql) {
            param.ID = primaryId
            param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0])) // 数据源
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
            param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -219,16 +218,17 @@
            func: 'sPC_TableData_InUpDe',
            BID: this.props.BID
          }
          if (setting.primaryKey) {
            param[setting.primaryKey] = cell[setting.primaryKey] || ''
          }
          let primaryId = setting.primaryKey ? cell[setting.primaryKey] : ''
          if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行
            if (btn.innerFunc) {
              param.func = btn.innerFunc
              if (setting.primaryKey) {
                param[setting.primaryKey] = primaryId
              }
            } else if (btn.sql) {
              param.ID = primaryId
              param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, cell)) // 数据源
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
              param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -236,15 +236,17 @@
          } else if (btn.OpenType === 'pop') { // 表单
            if (btn.innerFunc) {
              param.func = btn.innerFunc
              if (setting.primaryKey) {
                param[setting.primaryKey] = primaryId
              }
              formdata.forEach(_data => {
                param[_data.key] = _data.value
              })
            } else if (btn.sql) {
              if (setting.primaryKey) {
                param[setting.primaryKey] = cell[setting.primaryKey]
              }
              param.ID = primaryId
              param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell)) // 数据源
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000'
              param.secretkey = Utils.encrypt(param.LText, param.timestamp)
@@ -690,14 +692,14 @@
    if (execAction.groups.length > 0) {
      execAction.groups.forEach(group => {
        group.sublist.forEach(field => {
          if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) {
          if ((field.type === 'select' || field.type === 'link' || field.type === 'multiselect') && field.resourceType === '1' && field.dataSource) {
            subfields.push(field)
          }
        })
      })
    } else {
      execAction.fields.forEach(field => {
        if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) {
        if ((field.type === 'select' || field.type === 'link' || field.type === 'multiselect') && field.resourceType === '1' && field.dataSource) {
          subfields.push(field)
        }
      })
@@ -716,6 +718,8 @@
      if (item.type === 'link') {
        arrfield = arrfield + ',' + item.linkField
      } else if (item.type === 'select' && item.linkSubField && item.linkSubField.length > 0) {
        arrfield = arrfield + ',' + item.linkSubField.join(',')
      }
      let _sql = Utils.getSelectQuerySql(item)
@@ -753,6 +757,10 @@
            if (res.search.type === 'link') {
              item.parentId = cell[res.search.linkField]
            } else if (res.search.type === 'select' && res.search.linkSubField && res.search.linkSubField.length > 0) {
              res.search.linkSubField.forEach(_field => {
                item[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : ''
              })
            }
            return item
src/tabviews/tableshare/mutilform/index.jsx
@@ -2,6 +2,7 @@
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, InputNumber, Select, DatePicker, notification } from 'antd'
import moment from 'moment'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import FileUpload from '../fileupload'
import './index.scss'
@@ -57,6 +58,8 @@
      })
    }
    let _inputfields = formlist.filter(item => item.type === 'text' || item.type === 'number') // 用于过滤下拉菜单关联表单
    formlist = formlist.map(item => {
      if (item.type === 'select' || item.type === 'link') {
        if (item.setAll === 'true') {
@@ -72,6 +75,11 @@
        }
        item.oriOptions = JSON.parse(JSON.stringify(item.options))
        if (item.linkSubField && item.linkSubField.length > 0) {
          let _fields = _inputfields.map(_item => _item.field)
          item.linkSubField = item.linkSubField.filter(_item => _fields.includes(_item))
        }
      }
      if (!/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) {
@@ -154,7 +162,7 @@
    }
  }
  selectChange = (_field, value) => {
  selectChange = (_field, value, option) => {
    let formlist = JSON.parse(JSON.stringify(this.state.formlist))
    let subfields = []
@@ -168,6 +176,16 @@
      }
      return item
    })
    // 表单切换时,更新关联字段
    if (_field.type === 'select' && _field.linkSubField && _field.linkSubField.length > 0 && option.props.data) {
      let _data = option.props.data
      let fieldVal = {}
      _field.linkSubField.forEach(subfield => {
        fieldVal[subfield] = _data[subfield]
      })
      this.props.form.setFieldsValue(fieldVal)
    }
    if (subfields.length === 0) return
@@ -225,6 +243,10 @@
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />)}
@@ -264,6 +286,11 @@
          </Col>
        )
      } else if (item.type === 'select' || item.type === 'link') { // 下拉搜索
        let hasSubField = false
        if (item.linkSubField && item.linkSubField.length > 0) { // 存在关联字段,数据存储
          hasSubField = true
        }
        fields.push(
          <Col span={24 / cols} key={index}>
            <Form.Item label={item.label}>
@@ -279,11 +306,10 @@
                <Select
                  showSearch
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  onChange={(value) => {this.selectChange(item, value)}}
                  // getPopupContainer={() => document.getElementById('form-box')}
                  onChange={(value, option) => {this.selectChange(item, value, option)}}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.key} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
                    <Select.Option id={option.key} data={hasSubField ? option : ''} title={option.Text} key={option.key} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
src/templates/comtableconfig/actionform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -327,13 +327,26 @@
        let _rules = []
        if (item.key === 'innerFunc') {
          let str = '^(' + item.fields.join('|') + ')'
          let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
          let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
          _rules = [{
            pattern: _patten,
            message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
            message: formRule.func.innerMessage
          }, {
            max: 50,
            message: '内部函数名称不超过50个字符。'
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
          _rules = [{
            pattern: formRule.func.pattern,
            message: formRule.func.message
          }, {
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else {
          _rules = [{
            max: formRule.input.max,
            message: formRule.input.message
          }]
        }
        fields.push(
src/templates/comtableconfig/index.jsx
@@ -366,13 +366,6 @@
          tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效',
          tooltipClass: 'middle',
          required: true,
          rules: [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_-]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_-'
          }, {
            max: 50,
            message: '字段名最多50个字符!'
          }],
          readonly: false
        },
        {
@@ -675,14 +668,6 @@
          readonly: false
        },
        {
          type: 'text',
          key: 'callbackFunc',
          label: this.state.dict['header.form.callbackFunc'],
          initVal: card.callbackFunc,
          required: false,
          readonly: false
        },
        {
          type: 'select',
          key: 'position',
          label: this.state.dict['header.form.position'],
@@ -695,6 +680,14 @@
            value: 'grid',
            text: this.state.dict['header.form.grid']
          }]
        },
        {
          type: 'text',
          key: 'callbackFunc',
          label: this.state.dict['header.form.callbackFunc'],
          initVal: card.callbackFunc,
          required: false,
          readonly: false
        },
        {
          type: 'select',
@@ -813,13 +806,6 @@
            label: this.state.dict['header.form.field'],
            initVal: card.field,
            required: true,
            rules: [{
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
              message: '字段名只允许包含数字、字母、汉字以及_-'
            }, {
              max: 50,
              message: '字段名最多50个字符!'
            }],
            readonly: false
          },
          {
src/templates/comtableconfig/settingform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
@@ -114,7 +115,7 @@
    }
    let str = '^(' + usefulFields.join('|') + ')'
    let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
    let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form" id="commontable-setting-form">
@@ -127,6 +128,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '表名!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -167,15 +172,12 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + dict['header.form.interface'] + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || ''
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
@@ -191,10 +193,10 @@
                rules: [
                  {
                    pattern: _patten,
                    message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
                    message: formRule.func.innerMessage
                  }, {
                    max: 50,
                    message: '内部函数名称不超过50个字符。'
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -224,6 +226,22 @@
              )}
            </Form.Item>
          </Col>
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || '',
                rules: [
                  {
                    pattern: formRule.func.pattern,
                    message: formRule.func.message
                  }, {
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="固定列">
              {getFieldDecorator('columnfixed', {
@@ -264,6 +282,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '默认排序字段!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="ID asc, UID desc" autoComplete="off" />)}
src/templates/comtableconfig/tabform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Tooltip } from 'antd'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -84,18 +85,6 @@
          })
        })
      })
      // this.setState({
      //   formlist: this.state.formlist.map(form => {
      //     return form
      //   })
      // }, () => {
      //   this.setState({
      //     formlist: this.state.formlist.map(form => {
      //       return form
      //     })
      //   })
      // })
    }
  }
@@ -116,6 +105,10 @@
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
src/templates/modalconfig/groupform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, InputNumber } from 'antd'
import { formRule } from '@/utils/option.js'
import TransferForm from '../transferform'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -97,6 +98,10 @@
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + '分组名称!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off"/>)}
src/templates/modalconfig/index.jsx
@@ -314,6 +314,23 @@
   * 3、设置编辑参数项-formlist
   */
  handleForm = (card) => {
    const { config } = this.state
    let _inputfields = []
    // 设置下拉菜单可关联字段
    if (config.groups.length > 0) {
      config.groups.forEach(group => {
        let sublist = group.sublist.filter(item => item.type === 'text' || item.type === 'number')
        _inputfields = [..._inputfields, ...sublist]
      })
    } else {
      _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number')
    }
    if (card.linkSubField && card.linkSubField.length > 0) {
      let fields = _inputfields.map(item => item.field)
      card.linkSubField = card.linkSubField.filter(item => fields.includes(item))
    }
    this.setState({
      visible: true,
      card: card,
@@ -513,6 +530,13 @@
            value: 'false',
            text: this.state.dict['header.form.false']
          }]
        },
        {
          type: 'multiselect',
          key: 'linkSubField',
          label: '关联表单',
          initVal: card.linkSubField || [],
          options: _inputfields
        }
      ]
    })
src/templates/modalconfig/modalform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, InputNumber } from 'antd'
import { formRule } from '@/utils/option.js'
import { dateOptions } from '@/utils/option.js'
import EditTable from '../editable'
import './index.scss'
@@ -37,15 +38,11 @@
      _options = ['label', 'field', 'type', 'readonly', 'required']
    }
    if (type === 'select' || type === 'link') {
      _options.push('setAll')
    }
    if (type === 'link') { // 关联类型、增加关联字段
      _options = [..._options, 'linkField']
    }
    if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息
    if (type === 'select') {
      _options = [..._options, 'setAll', 'linkSubField']
    } else if (type === 'link') {          // 关联类型、增加关联字段
      _options = [..._options, 'setAll', 'linkField']
    } else if (type === 'funcvar') {       // 设置为函数变量时,不需要其他信息
      _options = ['label', 'field', 'type']
    }
    
@@ -93,15 +90,11 @@
        _options = ['label', 'field', 'type', 'readonly', 'required']
      }
      if (value === 'select' || value === 'link') {
        _options.push('setAll')
      }
      if (value === 'link') {
        _options = [..._options, 'linkField']
      }
      if (value === 'funcvar') {
      if (value === 'select') {
        _options = [..._options, 'setAll', 'linkSubField']
      } else if (value === 'link') {
        _options = [..._options, 'setAll', 'linkField']
      } else if (value === 'funcvar') {
        _options = ['label', 'field', 'type']
      }
      
@@ -149,12 +142,10 @@
        _options = [..._options, 'dataSource', 'valueField', 'valueText', 'orderBy', 'orderType']
      }
      if (openType === 'select' || openType === 'link') {
        _options.push('setAll')
      }
      if (openType === 'link') {
        _options = [..._options, 'linkField']
      if (openType === 'select') {
        _options = [..._options, 'setAll', 'linkSubField']
      } else if (openType === 'link') {
        _options = [..._options, 'setAll', 'linkField']
      }
      
      this.setState({
@@ -178,12 +169,19 @@
        let rules = []
        if (item.key === 'field') {
          rules = [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_-]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_-'
            pattern: formRule.field.pattern,
            message: formRule.field.message
          }, {
            max: 50,
            message: '字段名最多50个字符!'
            max: formRule.field.max,
            message: formRule.field.maxMessage
          }]
        } else {
          rules = [
            {
              max: formRule.input.max,
              message: formRule.input.message
            }
          ]
        }
        fields.push(
          <Col span={12} key={index}>
@@ -264,6 +262,26 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'multiselect') { // 多选
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal
              })(
                <Select
                  showSearch
                  mode="multiple"
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {item.options.map(option =>
                    <Select.Option id={option.uuid} key={option.uuid} value={option.field}>{option.label}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'radio') {
        fields.push(
          <Col span={12} key={index}>
src/templates/modalconfig/settingform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, InputNumber, Select } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
class SettingForm extends Component {
@@ -73,7 +74,13 @@
          <Col span={12}>
            <Form.Item label="标题">
              {getFieldDecorator('title', {
                initialValue: config.setting.title
                initialValue: config.setting.title,
                rules: [
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off"/>)}
            </Form.Item>
          </Col>
src/templates/modalviewconfig/actionform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -327,13 +327,26 @@
        let _rules = []
        if (item.key === 'innerFunc') {
          let str = '^(' + item.fields.join('|') + ')'
          let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
          let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
          _rules = [{
            pattern: _patten,
            message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
            message: formRule.func.innerMessage
          }, {
            max: 50,
            message: '内部函数名称不超过50个字符。'
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
          _rules = [{
            pattern: formRule.func.pattern,
            message: formRule.func.message
          }, {
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else {
          _rules = [{
            max: formRule.input.max,
            message: formRule.input.message
          }]
        }
        fields.push(
src/templates/modalviewconfig/index.jsx
@@ -366,13 +366,6 @@
          tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效',
          tooltipClass: 'middle',
          required: true,
          rules: [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_-]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_-'
          }, {
            max: 50,
            message: '字段名最多50个字符!'
          }],
          readonly: false
        },
        {
@@ -813,13 +806,6 @@
            label: this.state.dict['header.form.field'],
            initVal: card.field,
            required: true,
            rules: [{
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
              message: '字段名只允许包含数字、字母、汉字以及_-'
            }, {
              max: 50,
              message: '字段名最多50个字符!'
            }],
            readonly: false
          },
          {
src/templates/modalviewconfig/settingform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
@@ -114,7 +115,7 @@
    }
    let str = '^(' + usefulFields.join('|') + ')'
    let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
    let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form commontable-setting-form" id="commontable-setting-form">
@@ -127,6 +128,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '表名!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -167,15 +172,12 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + dict['header.form.interface'] + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || ''
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
@@ -191,10 +193,10 @@
                rules: [
                  {
                    pattern: _patten,
                    message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
                    message: formRule.func.innerMessage
                  }, {
                    max: 50,
                    message: '内部函数名称不超过50个字符。'
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -224,6 +226,22 @@
              )}
            </Form.Item>
          </Col>
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || '',
                rules: [
                  {
                    pattern: formRule.func.pattern,
                    message: formRule.func.message
                  }, {
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="固定列">
              {getFieldDecorator('columnfixed', {
@@ -264,6 +282,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '默认排序字段!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="ID asc, UID desc" autoComplete="off" />)}
src/templates/modalviewconfig/tabform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Tooltip } from 'antd'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -84,18 +85,6 @@
          })
        })
      })
      // this.setState({
      //   formlist: this.state.formlist.map(form => {
      //     return form
      //   })
      // }, () => {
      //   this.setState({
      //     formlist: this.state.formlist.map(form => {
      //       return form
      //     })
      //   })
      // })
    }
  }
@@ -116,6 +105,10 @@
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
src/templates/subtableconfig/actionform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip, InputNumber } from 'antd'
import { btnIcons, btnClasses } from '@/utils/option.js'
import { btnIcons, btnClasses, formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
@@ -297,13 +297,26 @@
        let _rules = []
        if (item.key === 'innerFunc') {
          let str = '^(' + item.fields.join('|') + ')'
          let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
          let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
          _rules = [{
            pattern: _patten,
            message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
            message: formRule.func.innerMessage
          }, {
            max: 50,
            message: '内部函数名称不超过50个字符。'
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') {
          _rules = [{
            pattern: formRule.func.pattern,
            message: formRule.func.message
          }, {
            max: formRule.func.max,
            message: formRule.func.maxMessage
          }]
        } else {
          _rules = [{
            max: formRule.input.max,
            message: formRule.input.message
          }]
        }
        fields.push(
src/templates/subtableconfig/index.jsx
@@ -318,13 +318,6 @@
          tooltip: '字段名可以使用逗号分隔,进行多字段综合搜索,注:综合搜索仅在文本类型时有效',
          tooltipClass: 'middle',
          required: true,
          rules: [{
            pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_-]*$/ig,
            message: '字段名只允许包含数字、字母、汉字以及_-'
          }, {
            max: 50,
            message: '字段名最多50个字符!'
          }],
          readonly: false
        },
        {
@@ -738,13 +731,6 @@
            label: this.state.dict['header.form.field'],
            initVal: card.field,
            required: true,
            rules: [{
              pattern: /^[\u4E00-\u9FA50-9a-zA-Z_-]*$/ig,
              message: '字段名只允许包含数字、字母、汉字以及_-'
            }, {
              max: 50,
              message: '字段名最多50个字符!'
            }],
            readonly: false
          },
          {
src/templates/subtableconfig/settingform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon, notification } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
const { TextArea } = Input
@@ -83,7 +84,7 @@
    }
    let str = '^(' + usefulFields.join('|') + ')'
    let _patten = new RegExp(str + '[0-9a-zA-Z_]*$', 'g')
    let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g')
    return (
      <Form {...formItemLayout} className="ant-advanced-search-form subtable-setting-form" id="subtable-setting-form">
@@ -96,6 +97,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '表名!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -136,15 +141,12 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + dict['header.form.interface'] + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || ''
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
@@ -160,10 +162,10 @@
                rules: [
                  {
                    pattern: _patten,
                    message: '名称只允许包含数字、字母和下划线,且以指定字符开始。'
                    message: formRule.func.innerMessage
                  }, {
                    max: 50,
                    message: '内部函数名称不超过50个字符。'
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
@@ -201,6 +203,22 @@
              )}
            </Form.Item>
          </Col>
          {interType === 'outer' ? <Col span={12}>
            <Form.Item label={dict['header.form.outerFunc']}>
              {getFieldDecorator('outerFunc', {
                initialValue: data.outerFunc || '',
                rules: [
                  {
                    pattern: formRule.func.pattern,
                    message: formRule.func.message
                  }, {
                    max: formRule.func.max,
                    message: formRule.func.maxMessage
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col> : null}
          <Col span={12}>
            <Form.Item label="默认排序">
              {getFieldDecorator('order', {
@@ -209,6 +227,10 @@
                  {
                    required: true,
                    message: dict['form.required.input'] + '默认排序字段!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="ID asc, UID desc" autoComplete="off" />)}
src/templates/tableshare/colspanform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, InputNumber, Select, Radio } from 'antd'
import { formRule } from '@/utils/option.js'
import TransferForm from '../transferform'
import './index.scss'
@@ -81,6 +82,10 @@
                  {
                    required: true,
                    message: this.props.dict['form.required.input'] + this.props.dict['header.form.name'] + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
src/templates/tableshare/colspanform/index.scss
@@ -1,7 +1,6 @@
.ant-advanced-search-form.commontable-column-form {
  min-height: 190px;
  .ant-form-item {
    margin-bottom: 15px;
    .ant-input-number {
      width: 100%;
    }
src/templates/tableshare/columnform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, InputNumber, Radio, Tooltip, Icon } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
class MainSearch extends Component {
@@ -96,7 +97,21 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let rules = item.rules || []
        let rules = []
        if (item.key === 'field') {
          rules = [{
            pattern: formRule.field.pattern,
            message: formRule.field.message
          }, {
            max: formRule.field.max,
            message: formRule.field.maxMessage
          }]
        } else {
          rules = [{
            max: formRule.input.max,
            message: formRule.input.message
          }]
        }
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
src/templates/tableshare/columnform/index.scss
@@ -1,7 +1,6 @@
.ant-advanced-search-form.commontable-column-form {
  min-height: 190px;
  .ant-form-item {
    margin-bottom: 15px;
    .ant-input-number {
      width: 100%;
    }
src/templates/tableshare/gridbtnform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, InputNumber, Radio } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
class MainSearch extends Component {
@@ -88,6 +89,10 @@
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
src/templates/tableshare/gridbtnform/index.scss
@@ -1,7 +1,6 @@
.ant-advanced-search-form.commontable-column-form {
  min-height: 190px;
  .ant-form-item {
    margin-bottom: 15px;
    .ant-input-number {
      width: 100%;
    }
src/templates/tableshare/menuform/index.jsx
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select } from 'antd'
import { formRule } from '@/utils/option.js'
import './index.scss'
class MainSearch extends Component {
@@ -23,6 +24,10 @@
                  {
                    required: !!item.required,
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  {
                    max: formRule.input.max,
                    message: formRule.input.message
                  }
                ]
              })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)}
src/templates/tableshare/searchform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, Icon, Radio, notification, Tooltip } from 'antd'
import { dateOptions, matchReg } from '@/utils/option.js'
import { dateOptions, matchReg, formRule } from '@/utils/option.js'
import EditTable from '../editable'
import './index.scss'
@@ -201,7 +201,22 @@
      if (item.hidden) return
      if (item.type === 'text') { // 文本搜索
        let rules = item.rules || []
        let rules = []
        if (item.key === 'field') {
          rules = [{
            pattern: formRule.field.pattern,
            message: formRule.field.message
          }, {
            max: formRule.field.max,
            message: formRule.field.maxMessage
          }]
        } else {
          rules = [{
            max: formRule.input.max,
            message: formRule.input.message
          }]
        }
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
src/utils/option.js
@@ -5,6 +5,30 @@
const _dict =  sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
export const formRule = {
  input: {
    max: 100,
    message: '输入框最多100个字符。'
  },
  field: { // 字段名
    max: 50,
    pattern: /^[\u4E00-\u9FA50-9a-zA-Z,_-]*$/ig,
    message: '字段名只允许包含数字、字母、汉字以及_-',
    maxMessage: '字段名最多50个字符。'
  },
  func: { // 函数名
    max: 50,
    pattern: /^[0-9a-zA-Z_]*$/,
    message: '函数名称只允许包含数字、字母和下划线。',
    maxMessage: '函数名称不超过50个字符。',
    innerPattern: '[0-9a-zA-Z_]*',
    innerMessage: '内部函数名称只允许包含数字、字母和下划线,且以指定字符开始。'
  },
  textarea: {
    max: 1024
  }
}
export const sysTemps = [
  {
    title: '基础表格',
src/utils/utils.js
@@ -433,7 +433,11 @@
    if (item.type === 'link') {
      sql = 'select ' + item.valueField + ',' + item.valueText + ',' + item.linkField + ' from ' + _datasource
    } else {
      sql = 'select ' + item.valueField + ',' + item.valueText + ' from ' + _datasource
      let _linkSubField = '' // 下拉菜单关联表单
      if (item.linkSubField && item.linkSubField.length > 0) {
        _linkSubField = ',' + item.linkSubField.join(',')
      }
      sql = 'select ' + item.valueField + ',' + item.valueText + _linkSubField + ' from ' + _datasource
    }
    if (item.orderBy) {
@@ -449,7 +453,7 @@
   * @return {String} table  表名
   */
  static getSysDefaultSql (btn, setting, formdata, param, data) {
    let primaryId = param[setting.primaryKey]
    let primaryId = param.ID
    let BID = param.BID
    let verify = btn.verify
    let _formFieldValue = {}
@@ -496,17 +500,18 @@
      verify.uniques.forEach(item => {
        let _fieldValue = [] // 表单键值对field=value
        let _value = []      // 表单值,用于错误提示
        let _labels = item.fieldlabel.split(',')
        item.field.split(',').forEach(_field => {
        item.field.split(',').forEach((_field, index) => {
          _fieldValue.push(`${_field}='${_formFieldValue[_field]}'`)
          _value.push(_formFieldValue[_field])
          _value.push(`${_labels[index] || ''}:${_formFieldValue[_field] || ''}`)
        })
        _sql += `Select @tbid='', @ErrorCode='',@retmsg=''
          Select @tbid='X' from ${btn.sql} where ${_fieldValue.join(' and ')} and ${primaryKey} !='${_primaryId}'
          If @tbid!=''
          Begin
            select @ErrorCode='${item.errorCode}',@retmsg='${item.fieldlabel || ''}:${_value.join(' ')} 已存在'
            select @ErrorCode='${item.errorCode}',@retmsg='${_value.join(', ')} 已存在'
            goto aaa
          end
          `