king
2022-07-14 49d0886f6855f1fb1c628b8205a8ae299aa3db09
2022-07-14
14个文件已修改
3个文件已添加
13652 ■■■■■ 已修改文件
src/locales/en-US/model.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/model.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/formdragelement/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/modalconfig/source.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/cardcomponent/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkCascader/data.json 13293 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkCascader/index.jsx 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkCascader/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/mkCheckCard/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/calendarconfig/source.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/source.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/source.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/source.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/model.js
@@ -88,7 +88,6 @@
  'model.form.text': 'Text',
  'header.form.description': '描述',
  'model.form.textarea': 'Multiline text',
  'header.form.fileupload': '文件上传',
  'header.form.funcvar': '函数变量',
  'model.form.picture': 'Picture',
  'model.form.number': 'Number',
@@ -99,8 +98,6 @@
  'model.form.href': 'Link',
  'model.form.link': 'Linkage menu',
  'model.form.linkform': 'Linkage form',
  'model.form.dateday': 'Date(Day)',
  'model.form.dateweek': 'Date(Week)',
  'model.form.datemonth': 'Date(Month)',
  'model.form.daterange': 'Date(Range)',
  'model.form.dategroup': 'Date(Group)',
src/locales/zh-CN/model.js
@@ -88,7 +88,6 @@
  'model.form.text': '文本',
  'header.form.description': '描述',
  'model.form.textarea': '多行文本',
  'header.form.fileupload': '文件上传',
  'header.form.funcvar': '函数变量',
  'model.form.picture': '图片',
  'model.form.number': '数字',
@@ -99,8 +98,6 @@
  'model.form.href': '链接',
  'model.form.link': '联动菜单',
  'model.form.linkform': '关联表单',
  'model.form.dateday': '日期(天)',
  'model.form.dateweek': '日期(周)',
  'model.form.datemonth': '日期(月)',
  'model.form.daterange': '日期(区间)',
  'model.form.dategroup': '日期(组合)',
src/mob/components/formdragelement/card.jsx
@@ -81,7 +81,7 @@
    formItem = (<div className={'am-list-item input ' + (card.place || '')}><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval ? card.initval : <span style={{color: '#bcbcbc'}}><span style={{color: 'transparent'}}>input</span></span> }</div>{card.placeholder ? <div className="am-list-extra" style={{color: '#999999', width: 'auto', lineHeight: 1.5}}>{card.placeholder}</div> : null}</div></div>)
  } else if (card.type === 'number') {
    formItem = (<div className="am-list-item input"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className={'am-input-control ' + card.cursor}>{card.initval || <span style={{color: 'transparent'}}>input</span>}</div></div></div>)
  } else if (card.type === 'select' || card.type === 'link') {
  } else if (card.type === 'select' || card.type === 'link' || card.type === 'cascader') {
    formItem = (<div className="am-list-item"><div className="am-list-line"><div className="am-input-label">{card.label}</div><div className="am-input-control">{selectval || '请选择'}</div><div className="am-list-extra"><RightOutlined /></div></div></div>)
  } else if (card.type === 'date') {
    let format = 'YYYY-MM-DD'
src/mob/modalconfig/source.jsx
@@ -54,13 +54,13 @@
  },
  {
    type: 'form',
    label: CommonDict['header.form.fileupload'],
    label: '文件上传',
    subType: 'fileupload',
    url: ''
  },
  {
    type: 'form',
    label: CommonDict['model.form.dateday'],
    label: '日期(天)',
    subType: 'date',
    url: ''
  },
@@ -70,12 +70,6 @@
    subType: 'datemonth',
    url: ''
  },
  // {
  //   type: 'form',
  //   label: '日期(分/秒)',
  //   subType: 'datetime',
  //   url: ''
  // },
  {
    type: 'form',
    label: CommonDict['model.form.textarea'],
@@ -84,6 +78,11 @@
  },
  {
    type: 'form',
    label: '级联菜单',
    subType: 'cascader',
  },
  {
    type: 'form',
    label: '评分',
    subType: 'rate',
    url: ''
src/tabviews/zshare/cardcomponent/index.jsx
@@ -694,7 +694,7 @@
    card.switch = plot.switch !== 'false'
    if (!insertAction.icon) {
    if (insertAction && !insertAction.icon) {
      insertAction.icon = 'plus'
    }
src/tabviews/zshare/mutilform/index.jsx
@@ -26,6 +26,7 @@
const MKFileUpload = asyncComponent(() => import('../fileupload'))
const MKColor = asyncComponent(() => import('./mkColor'))
const MkFormula = asyncComponent(() => import('./mkFormula'))
const MkCascader = asyncComponent(() => import('./mkCascader'))
const MKEditor = asyncComponent(() => import('@/components/editor'))
class MainSearch extends Component {
@@ -99,7 +100,7 @@
        item.precision = 'second'
      }
      if (!item.field || !['text', 'number', 'switch', 'rate', 'select', 'link', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color'].includes(item.type)) return false
      if (!item.field || !['text', 'number', 'switch', 'rate', 'select', 'link', 'cascader', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color'].includes(item.type)) return false
      if (/^\s+$/.test(item.label)) {
        item.style = item.style || {}
@@ -124,7 +125,7 @@
        item.initval = item.initval || 0
      }
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) {
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type)) {
        item.options = item.options || []
        item.options = item.options.filter(cell => {
          cell.value = cell.Value
@@ -206,7 +207,7 @@
        item.initval = ''
      }
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type) && item.resourceType === '1') {
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && item.resourceType === '1') {
        deForms.push(item)
      } else if (item.type === 'rate') {
        item.rateCount = item.rateCount || 5
@@ -236,8 +237,13 @@
          pattern: /^[^']*$/ig,
          message: '不可使用英文状态的单引号!'
        }, {
          pattern: /^[^--]*$/ig,
          message: '不可使用 -- !'
          validator: (rule, value, callback) => {
            if (/--/ig.test(value)) {
              callback('不可使用 -- !')
            } else {
              callback()
            }
          }
        }, {
          required: item.required === 'true',
          message: item.label + '不可为空!'
@@ -308,8 +314,13 @@
            pattern: /^[^']*$/ig,
            message: '不可使用英文状态的单引号!'
          }, {
            pattern: /^[^--]*$/ig,
            message: '不可使用 -- !'
            validator: (rule, value, callback) => {
              if (/--/ig.test(value)) {
                callback('不可使用 -- !')
              } else {
                callback()
              }
            }
          })
        }
        item.rules = _rules
@@ -407,6 +418,9 @@
          item.options = fromJS(item.oriOptions).toJS()
        }
        item.linkSubField = null
      } else if (item.type === 'cascader' && item.fillField) {
        let n = fieldMap.get(item.fillField)
        item.fillFieldId = n ? n.uuid : ''
      }
      // if (item.type === 'link') {
@@ -422,7 +436,7 @@
        item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '')
      }
      if (['select', 'link', 'radio'].includes(item.type) && item.resourceType !== '1') { // 选中第一项
      if (['select', 'link', 'radio'].includes(item.type) && item.resourceType === '0') { // 选中第一项
        if (typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) {
          item.initval = item.options[0] ? item.options[0].value : ''
        }
@@ -457,6 +471,23 @@
          item.subFields.forEach(n => {
            reFieldsVal[n.field] = option[n.field]
          })
        }
      } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
        let initvals = item.initval.split(item.separator)
        let label = []
        initvals.forEach(m => {
          // eslint-disable-next-line
          let option = item.options.filter(cell => m == cell.value)[0]
          if (option) {
            label.push(option.label)
          }
        })
        label = label.join(item.separator)
        if (label) {
          reFieldsVal = reFieldsVal || {}
          reFieldsVal[item.fillField] = label
        }
      }
      
@@ -660,7 +691,7 @@
  resetFormList = (result) => {
    let reFieldsVal = null
    let _formlist = fromJS(this.state.formlist).toJS().map(item => {
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
        let options = []
        result[item.field].forEach(cell => {
          let _cell = { key: Utils.getuuid() }
@@ -715,6 +746,23 @@
              reFieldsVal[n.field] = option[n.field]
            })
          }
        } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
          let initvals = item.initval.split(item.separator)
          let label = []
          initvals.forEach(m => {
            // eslint-disable-next-line
            let option = item.options.filter(cell => m == cell.value)[0]
            if (option) {
              label.push(option.label)
            }
          })
          label = label.join(item.separator)
          if (label) {
            reFieldsVal = reFieldsVal || {}
            reFieldsVal[item.fillField] = label
          }
        }
      }
      
@@ -749,9 +797,12 @@
        callback(item.label + '最小值为 ' + item.min)
      } else if (typeof(item.max) === 'number' && val > item.max) {
        callback(item.label + '最大值为 ' + item.max)
      } else {
        callback()
      }
    } else {
      callback()
    }
    callback()
  }
  recordChange = (values, item) => {
@@ -840,6 +891,8 @@
          content = (<MKNumberInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />)
        } else if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') {
          content = (<MKSelect config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} onSubmit={this.props.inputSubmit} />)
        } else if (item.type === 'cascader') {
          content = (<MkCascader config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>)
        } else if (item.type === 'color') {
          content = (<MKColor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>)
        } else if (item.type === 'checkcard') {
src/tabviews/zshare/mutilform/mkCascader/data.json
New file
Diff too large
src/tabviews/zshare/mutilform/mkCascader/index.jsx
New file
@@ -0,0 +1,129 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import { Cascader } from 'antd'
import MKEmitter from '@/utils/events.js'
const provinces = require('./data.json')
class MKSelect extends Component {
  constructor(props) {
    super(props)
    const config = props.config
    let value = config.initval
    let options = fromJS(config.options).toJS()
    if (value && config.separator) {
      value = value.split(config.separator)
    } else {
      value = value ? [value] : []
    }
    if (config.resourceType === '2') {
      options = provinces
    } else if (options.length > 0) {
      options = this.getOptionTree(options)
    }
    this.state = {
      config: fromJS(config).toJS(),
      options: options,
      value,
    }
  }
  componentDidMount () {
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { config } = this.state
    if (config.resourceType === '1' && !is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) {
      let options = fromJS(nextProps.config.options).toJS()
      this.setState({
        options: this.getOptionTree(options)
      })
    }
  }
  componentWillUnmount () {
    this.setState = () => {
      return
    }
  }
  getOptionTree = (options) => {
    const { config } = this.props
    let _options = []
    options = options.filter(option => {
      if (option.ParentID === config.topmark) {
        _options.push({
          label: option.label,
            value: option.value
        })
        return false
      }
      return true
    })
    return this.getTree(_options, options)
  }
  getTree = (parents, options) => {
    parents.forEach(parent => {
      parent.children = []
      options = options.filter(option => {
        if (option.ParentID === parent.value) {
          parent.children.push({
            label: option.label,
            value: option.value
          })
          return false
        }
        return true
      })
      if (parent.children.length === 0) {
        parent.children = null
      } else {
        parent.children = this.getTree(parent.children, options)
      }
    })
    return parents
  }
  selectChange = (val, option) => {
    const { config } = this.state
    let other = {}
    let _value = val.join(config.separator)
    if (config.fillFieldId) {
      let _label = option.map(m => m.label).join(config.separator)
      other[config.fillField] = _label
      MKEmitter.emit('mkFC', 'input', config.fillFieldId, _label)
    }
    this.props.onChange(_value, other)
    this.setState({value: val})
  }
  render() {
    const { value, options } = this.state
    return (<Cascader defaultValue={value} options={options} onChange={this.selectChange} placeholder="请选择" />)
  }
}
export default MKSelect
src/tabviews/zshare/mutilform/mkCascader/index.scss
src/tabviews/zshare/mutilform/mkCheckCard/index.jsx
@@ -60,11 +60,11 @@
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { config } = this.props
    const { config } = this.state
    if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) {
      this.setState({
        config: fromJS(nextProps.config).toJS(),
        config: {...config, oriOptions: nextProps.config.oriOptions},
        options: fromJS(nextProps.config.options).toJS()
      })
    }
@@ -178,7 +178,7 @@
  getCards = () => {
    const { selectKeys, options, config } = this.state
    const { display, width, fields, picratio, multiple, backgroundColor, selectStyle, selectClass } = config
    if (options.length === 0) {
      return null
    } else if (display === 'color') {
src/templates/calendarconfig/source.jsx
@@ -106,13 +106,13 @@
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateday'],
      label: '日期(天)',
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateweek'],
      label: '日期(周)',
      subType: 'dateweek',
      url: ''
    },
src/templates/comtableconfig/source.jsx
@@ -225,13 +225,13 @@
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateday'],
      label: '日期(天)',
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateweek'],
      label: '日期(周)',
      subType: 'dateweek',
      url: ''
    },
src/templates/modalconfig/dragelement/card.jsx
@@ -78,7 +78,7 @@
    formItem = (<Input style={{marginTop: '4px'}} placeholder={card.placeholder || ''} value={card.initval} />)
  } else if (card.type === 'number') {
    formItem = (<InputNumber value={card.initval} precision={card.decimal} />)
  } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') {
  } else if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link' || card.type === 'cascader') {
    formItem = (<Select value={selectval}></Select>)
  } else if (card.type === 'color') {
    formItem = (<ColorSketch value={card.initval || 'transparent'}/>)
src/templates/modalconfig/source.jsx
@@ -121,12 +121,12 @@
  },
  {
    type: 'form',
    label: CommonDict['header.form.fileupload'],
    label: '文件上传',
    subType: 'fileupload',
  },
  {
    type: 'form',
    label: CommonDict['model.form.dateday'],
    label: '日期(天)',
    subType: 'date',
  },
  {
@@ -134,11 +134,6 @@
    label: CommonDict['model.form.datemonth'],
    subType: 'datemonth',
  },
  // {
  //   type: 'form',
  //   label: '日期(分/秒)',
  //   subType: 'datetime',
  // },
  {
    type: 'form',
    label: CommonDict['model.form.textarea'],
@@ -146,6 +141,11 @@
  },
  {
    type: 'form',
    label: '级联菜单',
    subType: 'cascader',
  },
  {
    type: 'form',
    label: '评分',
    subType: 'rate',
  },
src/templates/subtableconfig/source.jsx
@@ -203,13 +203,13 @@
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateday'],
      label: '日期(天)',
      subType: 'date',
      url: ''
    },
    {
      type: 'search',
      label: CommonDict['model.form.dateweek'],
      label: '日期(周)',
      subType: 'dateweek',
      url: ''
    },
src/templates/zshare/formconfig.jsx
@@ -321,7 +321,7 @@
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
@@ -348,10 +348,10 @@
      text: '选项卡'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'dateweek',
      text: Formdict['model.form.dateweek']
      text: '日期(周)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
@@ -2381,10 +2381,10 @@
    text: '选项卡'
  }, {
    value: 'fileupload',
    text: Formdict['header.form.fileupload']
    text: '文件上传'
  }, {
    value: 'date',
    text: Formdict['model.form.dateday']
    text: '日期(天)'
  }, {
    value: 'datemonth',
    text: Formdict['model.form.datemonth']
@@ -2394,6 +2394,9 @@
  }, {
    value: 'textarea',
    text: Formdict['model.form.textarea']
  }, {
    value: 'cascader',
    text: '级联菜单'
  }, {
    value: 'rate',
    text: '评分'
@@ -2449,10 +2452,10 @@
      text: '选项卡'
    }, {
      value: 'fileupload',
      text: Formdict['header.form.fileupload']
      text: '文件上传'
    }, {
      value: 'date',
      text: Formdict['model.form.dateday']
      text: '日期(天)'
    }, {
      value: 'datemonth',
      text: Formdict['model.form.datemonth']
@@ -2462,6 +2465,9 @@
    }, {
      value: 'textarea',
      text: Formdict['model.form.textarea']
    }, {
      value: 'cascader',
      text: '级联菜单'
    }, {
      value: 'rate',
      text: '评分'
@@ -2589,10 +2595,10 @@
      required: true,
      options: [{
        value: '0',
        text: Formdict['header.form.custom']
        text: '自定义'
      }, {
        value: '1',
        text: Formdict['header.form.datasource']
        text: '数据源'
      }]
    },
    {
@@ -2719,6 +2725,14 @@
      readonly: false,
      allowClear: true,
      options: linkableFields
    },
    {
      type: 'text',
      key: 'topmark',
      label: '顶级标识',
      initVal: card.topmark || '',
      tooltip: '关联字段值与顶级标识相同时,视为顶级节点。',
      required: false
    },
    {
      type: 'text',
@@ -2912,6 +2926,15 @@
        value: 'nvarchar(50)',
        text: 'nvarchar(50)'
      }]
    },
    {
      type: 'text',
      key: 'separator',
      label: '连接符',
      initVal: card.separator || card.separator === undefined ? '/' : '',
      tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。',
      required: false,
      readonly: false
    },
    {
      type: 'radio',
@@ -3567,6 +3590,14 @@
      initVal: card.linkSubField || [],
      options: inputfields
    },
    {
      type: 'select',
      key: 'fillField',
      label: '填充表单',
      tooltip: '在切换选项时会把级联菜单的文本自动填入关联的表单中。',
      initVal: card.fillField || '',
      options: inputfields
    },
    // {
    //   type: 'number',
    //   key: 'marginTop',
src/templates/zshare/modalform/index.jsx
@@ -33,6 +33,7 @@
  datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'splitline', 'marginTop', 'marginBottom'],
  datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'],
  textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'count', 'placeholder', 'marginTop', 'marginBottom', 'enterReplace'],
  cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'separator', 'fillField'],
  color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom'],
  rate: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'splitline', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'allowHalf', 'rateCount', 'character', 'place'],
  hint: ['label', 'field', 'type', 'blacklist', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'],
@@ -234,6 +235,36 @@
      }
    }
    if (type === 'cascader') {
      if (this.record.resourceType === '0') {        // 自定义资源
        shows.push('options', 'topmark')
      } else if (this.record.resourceType === '1') { // 数据源
        shows.push('dataSource', 'valueField', 'valueText', 'orderBy', 'orderType', 'disableField', 'database', 'topmark', 'linkField')
      }
      reTypes.linkField = 'text'
      reTooltip.linkField = '用于构建数据结构。'
      reOptions.resourceType = [{
        value: '0',
        text: '自定义'
      }, {
        value: '1',
        text: '数据源'
      }, {
        value: '2',
        text: '省市区'
      }]
    } else {
      reTooltip.linkField = ''
      reTypes.linkField = 'select'
      reOptions.resourceType = [{
        value: '0',
        text: '自定义'
      }, {
        value: '1',
        text: '数据源'
      }]
    }
    if (['multiselect', 'checkbox'].includes(type)) {
      reTooltip.initval = '添加多个初始值请使用逗号分隔。'
    } else if (['select', 'link', 'radio'].includes(type)) {
@@ -299,6 +330,16 @@
      if (value === 'linkMain') {
        this.record.hidden = 'true'
        _fieldval.hidden = 'true'
      }
      if (this.record.type === 'cascader' && value !== 'cascader') {
        this.record.linkField = ''
        _fieldval.linkField = ''
        if (this.record.resourceType === '2') {
          this.record.resourceType = '0'
          _fieldval.resourceType = '0'
        }
      }
      if (this.record.options.length > 0) {
@@ -493,7 +534,11 @@
      if (item.type === 'text') {
        rules = [
          { required: item.required, message: dict['form.required.input'] + item.label + '!' }
          { required: item.required, message: dict['form.required.input'] + item.label + '!' },
          {
            pattern: /^[^']*$/ig,
            message: '不可使用英文状态的单引号!'
          }
        ]
        if (item.key === 'field') {
          rules.push({
@@ -601,6 +646,8 @@
          }
          if (type === 'radio' && this.record.linkField) {
            type = 'link'
          } else if (type === 'cascader') {
            type = 'link'
          }
          content = <EditTable type={type} module="form" transfield={transfield} linkSubFields={linkSubFields} onChange={this.changeOptions}/>
        } else {