| | |
| | | |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const FieldsTable = asyncComponent(() => import('@/templates/zshare/modalform/fieldtable')) |
| | | const DataTable = asyncComponent(() => import('@/templates/zshare/modalform/datatable')) |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/modalform/modaleditable')) |
| | | |
| | | const groupOptions = [ |
| | |
| | | } |
| | | } else if (type === 'checkcard') { |
| | | reRequired.fields = false |
| | | reOptions.multiple = [{ |
| | | value: 'false', |
| | | text: '单选' |
| | | }, { |
| | | value: 'true', |
| | | text: '多选' |
| | | }] |
| | | |
| | | if (this.record.display === 'picture') { |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | | shows.push('options', 'fields', 'picratio') |
| | |
| | | shows.push('dataSource', 'cardValField', 'colorField', 'fields', 'orderBy', 'orderType', 'database') |
| | | } |
| | | } else { |
| | | let appType = sessionStorage.getItem('appType') |
| | | if (appType === '') { |
| | | reOptions.multiple = [{ |
| | | value: 'false', |
| | | text: '单选' |
| | | }, { |
| | | value: 'true', |
| | | text: '多选' |
| | | }, { |
| | | value: 'dropdown', |
| | | text: '下拉菜单' |
| | | }] |
| | | } |
| | | |
| | | reRequired.fields = true |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | | shows.push('options', 'fields', 'selectStyle', 'border') |
| | |
| | | this.record.match = 'like' |
| | | _fieldval.match = 'like' |
| | | } |
| | | } else if (key === 'display') { |
| | | this.record.multiple = 'false' |
| | | _fieldval.multiple = 'false' |
| | | } else if (key === 'items') { |
| | | let _initval = this.props.form.getFieldValue('initval') |
| | | if (_initval && !value.includes(_initval[0])) { |
| | |
| | | let type = this.record.type |
| | | |
| | | if (type !== 'checkcard') { |
| | | content = <EditTable type={type} module="search" transfield={{}} linkSubFields={[]} onChange={this.changeOptions}/> |
| | | let columns = [] |
| | | |
| | | if (type === 'link') { |
| | | columns.push({ title: 'ParentID', key: 'ParentID', strict: true }) |
| | | } |
| | | |
| | | columns.push({ title: 'Value', key: 'Value', strict: true }) |
| | | columns.push({ title: 'Text', key: 'Text' }) |
| | | |
| | | content = <EditTable columns={columns} module="search" onChange={this.changeOptions}/> |
| | | } else { |
| | | if (this.record.linkField) { |
| | | type = 'link' |
| | | } |
| | | content = <DataTable type={type} multiple={this.record.multiple} display={this.record.display} linkSubFields={[]} transfield={{}} fields={this.record.fields || []} onChange={this.changeOptions}/> |
| | | |
| | | let columns = [] |
| | | let fields = this.record.fields || [] |
| | | let keys = ['ParentID', 'pid'] |
| | | |
| | | if (type === 'link') { |
| | | columns.push({ title: 'ParentID', key: 'ParentID', strict: true }) |
| | | } else if (this.record.multiple === 'dropdown' && this.record.display === 'text') { |
| | | columns.push({ title: 'pid', key: 'pid', strict: true }) |
| | | } |
| | | columns.push({ title: 'Value', key: '$value', strict: true }) |
| | | |
| | | if (this.record.display === 'picture') { |
| | | columns.push({ title: 'url', key: '$url', type: 'file' }) |
| | | } else if (this.record.display === 'color') { |
| | | columns.push({ title: 'Color', key: '$color' }) |
| | | } |
| | | |
| | | fields.forEach(item => { |
| | | keys.push(item.field) |
| | | columns.push({ title: item.field, key: item.field }) |
| | | }) |
| | | |
| | | content = <EditTable columns={columns} onChange={this.changeOptions}/> |
| | | } |
| | | } else if (item.type === 'fields') { |
| | | span = 24 |