| | |
| | | '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', |
| | |
| | | '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)', |
| | |
| | | 'model.form.text': '文本', |
| | | 'header.form.description': '描述', |
| | | 'model.form.textarea': '多行文本', |
| | | 'header.form.fileupload': '文件上传', |
| | | 'header.form.funcvar': '函数变量', |
| | | 'model.form.picture': '图片', |
| | | 'model.form.number': '数字', |
| | |
| | | 'model.form.href': '链接', |
| | | 'model.form.link': '联动菜单', |
| | | 'model.form.linkform': '关联表单', |
| | | 'model.form.dateday': '日期(天)', |
| | | 'model.form.dateweek': '日期(周)', |
| | | 'model.form.datemonth': '日期(月)', |
| | | 'model.form.daterange': '日期(区间)', |
| | | 'model.form.dategroup': '日期(组合)', |
| | |
| | | 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' |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['header.form.fileupload'], |
| | | label: '文件上传', |
| | | subType: 'fileupload', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.dateday'], |
| | | label: '日期(天)', |
| | | subType: 'date', |
| | | url: '' |
| | | }, |
| | |
| | | subType: 'datemonth', |
| | | url: '' |
| | | }, |
| | | // { |
| | | // type: 'form', |
| | | // label: '日期(分/秒)', |
| | | // subType: 'datetime', |
| | | // url: '' |
| | | // }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.textarea'], |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '级联菜单', |
| | | subType: 'cascader', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '评分', |
| | | subType: 'rate', |
| | | url: '' |
| | |
| | | |
| | | card.switch = plot.switch !== 'false' |
| | | |
| | | if (!insertAction.icon) { |
| | | if (insertAction && !insertAction.icon) { |
| | | insertAction.icon = 'plus' |
| | | } |
| | | |
| | |
| | | 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 { |
| | |
| | | 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 || {} |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | pattern: /^[^']*$/ig, |
| | | message: '不可使用英文状态的单引号!' |
| | | }, { |
| | | pattern: /^[^--]*$/ig, |
| | | message: '不可使用 -- !' |
| | | validator: (rule, value, callback) => { |
| | | if (/--/ig.test(value)) { |
| | | callback('不可使用 -- !') |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | }, { |
| | | required: item.required === 'true', |
| | | message: item.label + '不可为空!' |
| | |
| | | pattern: /^[^']*$/ig, |
| | | message: '不可使用英文状态的单引号!' |
| | | }, { |
| | | pattern: /^[^--]*$/ig, |
| | | message: '不可使用 -- !' |
| | | validator: (rule, value, callback) => { |
| | | if (/--/ig.test(value)) { |
| | | callback('不可使用 -- !') |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | item.rules = _rules |
| | |
| | | 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') { |
| | |
| | | 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 : '' |
| | | } |
| | |
| | | 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 |
| | | } |
| | | } |
| | | |
| | |
| | | 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() } |
| | |
| | | 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 |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | 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) => { |
| | |
| | | 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') { |
New file |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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() |
| | | }) |
| | | } |
| | |
| | | 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') { |
| | |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateday'], |
| | | label: '日期(天)', |
| | | subType: 'date', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateweek'], |
| | | label: '日期(周)', |
| | | subType: 'dateweek', |
| | | url: '' |
| | | }, |
| | |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateday'], |
| | | label: '日期(天)', |
| | | subType: 'date', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateweek'], |
| | | label: '日期(周)', |
| | | subType: 'dateweek', |
| | | url: '' |
| | | }, |
| | |
| | | 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'}/>) |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['header.form.fileupload'], |
| | | label: '文件上传', |
| | | subType: 'fileupload', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.dateday'], |
| | | label: '日期(天)', |
| | | subType: 'date', |
| | | }, |
| | | { |
| | |
| | | label: CommonDict['model.form.datemonth'], |
| | | subType: 'datemonth', |
| | | }, |
| | | // { |
| | | // type: 'form', |
| | | // label: '日期(分/秒)', |
| | | // subType: 'datetime', |
| | | // }, |
| | | { |
| | | type: 'form', |
| | | label: CommonDict['model.form.textarea'], |
| | |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '级联菜单', |
| | | subType: 'cascader', |
| | | }, |
| | | { |
| | | type: 'form', |
| | | label: '评分', |
| | | subType: 'rate', |
| | | }, |
| | |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateday'], |
| | | label: '日期(天)', |
| | | subType: 'date', |
| | | url: '' |
| | | }, |
| | | { |
| | | type: 'search', |
| | | label: CommonDict['model.form.dateweek'], |
| | | label: '日期(周)', |
| | | subType: 'dateweek', |
| | | url: '' |
| | | }, |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'dateweek', |
| | | text: Formdict['model.form.dateweek'] |
| | | text: '日期(周)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | text: '文件上传' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | |
| | | text: '选项卡' |
| | | }, { |
| | | value: 'fileupload', |
| | | text: Formdict['header.form.fileupload'] |
| | | text: '文件上传' |
| | | }, { |
| | | value: 'date', |
| | | text: Formdict['model.form.dateday'] |
| | | text: '日期(天)' |
| | | }, { |
| | | value: 'datemonth', |
| | | text: Formdict['model.form.datemonth'] |
| | |
| | | }, { |
| | | value: 'textarea', |
| | | text: Formdict['model.form.textarea'] |
| | | }, { |
| | | value: 'cascader', |
| | | text: '级联菜单' |
| | | }, { |
| | | value: 'rate', |
| | | text: '评分' |
| | |
| | | required: true, |
| | | options: [{ |
| | | value: '0', |
| | | text: Formdict['header.form.custom'] |
| | | text: '自定义' |
| | | }, { |
| | | value: '1', |
| | | text: Formdict['header.form.datasource'] |
| | | text: '数据源' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | readonly: false, |
| | | allowClear: true, |
| | | options: linkableFields |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'topmark', |
| | | label: '顶级标识', |
| | | initVal: card.topmark || '', |
| | | tooltip: '关联字段值与顶级标识相同时,视为顶级节点。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | value: 'nvarchar(50)', |
| | | text: 'nvarchar(50)' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'separator', |
| | | label: '连接符', |
| | | initVal: card.separator || card.separator === undefined ? '/' : '', |
| | | tooltip: '表单提交时信息之间的连接符。注:连接符为空时,初始化时填充其他表单无效。', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | initVal: card.linkSubField || [], |
| | | options: inputfields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'fillField', |
| | | label: '填充表单', |
| | | tooltip: '在切换选项时会把级联菜单的文本自动填入关联的表单中。', |
| | | initVal: card.fillField || '', |
| | | options: inputfields |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // key: 'marginTop', |
| | |
| | | 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'], |
| | |
| | | } |
| | | } |
| | | |
| | | 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)) { |
| | |
| | | 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) { |
| | |
| | | |
| | | 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({ |
| | |
| | | } |
| | | 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 { |