| | |
| | | {value: '[3, 0]', label: '近三天'}, |
| | | {value: '[7, 0]', label: '近七天'}, |
| | | {value: '[30, 0]', label: '近30天'}, |
| | | {value: '[90, 0]', label: '近90天'}, |
| | | {value: '[7, -7]', label: '前后七天'}, |
| | | {value: '[30, -30]', label: '前后30天'}, |
| | | {value: '[90, -90]', label: '前后90天'}, |
| | | {value: '[180, -180]', label: '前后180天'}, |
| | | {value: '[365, -365]', label: '前后365天'}, |
| | | {value: '[-1, -1]', label: '明天'}, |
| | | {value: '[-2, -2]', label: '后天'} |
| | | ] |
| | |
| | | datemonth: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'], |
| | | daterange: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'precision', 'labelwidth'], |
| | | group: ['label', 'type', 'field', 'datefield', 'initval', 'blacklist', 'ratio', 'items', 'required', 'labelShow', 'query', 'labelwidth'], |
| | | switch: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'openVal', 'closeVal', 'openText', 'closeText', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'], |
| | | check: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'openVal', 'closeVal', 'checkTip', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'], |
| | | range: ['label', 'type', 'field', 'initval', 'match', 'blacklist', 'Hide', 'required', 'maxValue', 'minValue', 'step', 'labelShow', 'query', 'labelwidth'] |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | openType: null, // 搜索条件显示类型 |
| | | resourceType: null, // 下拉搜索时,选项来源类型 |
| | | formlist: null, // 表单 |
| | | cFields: [], |
| | | textTooltip: '字段名可以使用逗号分隔,进行综合搜索', |
| | | formlist: null |
| | | } |
| | | |
| | | record = {} |
| | |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | | shows.push('options', 'fields') |
| | | } else if (this.record.resourceType === '1') { // 数据源 |
| | | shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database') |
| | | shows.push('dataSource', 'cardValField', 'colorField', 'fields', 'orderBy', 'orderType', 'database') |
| | | } |
| | | } else { |
| | | reRequired.fields = true |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | | shows.push('options', 'fields', 'selectStyle') |
| | | shows.push('options', 'fields', 'selectStyle', 'border') |
| | | } else if (this.record.resourceType === '1') { // 数据源 |
| | | shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database', 'selectStyle') |
| | | shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database', 'selectStyle', 'border') |
| | | } |
| | | if (this.record.selectStyle === 'custom') { |
| | | shows.push('backgroundColor') |
| | | } |
| | | if (this.record.multiple === 'dropdown' && this.record.resourceType === '1') { |
| | | shows.push('mark', 'parentField') |
| | | } |
| | | } |
| | | shows.push('linkField') |
| | |
| | | } |
| | | |
| | | if (type === 'text') { |
| | | reOptions.match = matchReg.text |
| | | reOptions.match = matchReg.class1 |
| | | } else if (type === 'multiselect') { |
| | | reOptions.match = matchReg.multiselect |
| | | reOptions.match = matchReg.class3 |
| | | } else if (type === 'select' || type === 'link') { |
| | | reOptions.match = matchReg.select |
| | | reOptions.match = matchReg.class1 |
| | | } else if (type === 'switch' || type === 'check') { |
| | | reOptions.match = matchReg.class2 |
| | | } else if (type === 'date') { |
| | | reOptions.match = matchReg.date |
| | | reOptions.match = matchReg.class4 |
| | | } else if (type === 'datemonth') { |
| | | reOptions.match = matchReg.datemonth |
| | | reOptions.match = matchReg.class5 |
| | | } else if (type === 'dateweek' || type === 'daterange' || type === 'range') { |
| | | reOptions.match = matchReg.daterange |
| | | reOptions.match = matchReg.class5 |
| | | } else if (type === 'checkcard') { |
| | | if (this.record.multiple === 'false') { |
| | | reOptions.match = matchReg.select |
| | | reOptions.match = matchReg.class1 |
| | | } else if (this.record.multiple === 'true') { |
| | | reOptions.match = matchReg.multiselect |
| | | reOptions.match = matchReg.class3 |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let resource = this.props.form.getFieldValue('dataSource') || '' |
| | | |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | if (field === text) { |
| | | resource = `select '' as ${field} union all \n${resource}` |
| | | } else { |
| | | resource = `select '' as ${field},'全部' as ${text} union all \n${resource}` |
| | | } |
| | | |
| | | this.props.form.setFieldsValue({dataSource: resource}) |
| | | } |
| | |
| | | <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | </AutoComplete> |
| | | } else { |
| | | content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | content = <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} onChange={(e) => {this.optionChange(item.key, e.target.value)}}/> |
| | | } |
| | | } else if (item.type === 'number') { |
| | | rules = [ |
| | |
| | | if (this.record.linkField) { |
| | | type = 'link' |
| | | } |
| | | content = <DataTable type={type} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/> |
| | | content = <DataTable type={type} multiple={this.record.multiple} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/> |
| | | } |
| | | } else if (item.type === 'fields') { |
| | | span = 24 |
| | |
| | | values.options = [] |
| | | } |
| | | } else if (values.type === 'checkcard') { |
| | | if (values.multiple === 'dropdown' && values.display !== 'text') { |
| | | values.multiple = 'false' |
| | | } |
| | | |
| | | if (values.resourceType === '0') { |
| | | values.options = values.options || [] |
| | | values.options = values.options.map(m => { |
| | | m.ParentID = m.ParentID || '' |
| | | m.pid = m.pid || '' |
| | | return m |
| | | }) |
| | | |
| | |
| | | }) |
| | | return |
| | | } |
| | | } else if (values.type === 'switch' || values.type === 'check') { |
| | | values.initval = values.initval === values.openVal ? values.openVal : values.closeVal |
| | | } |
| | | |
| | | ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { |