From ab262bbe2c64ba086a14f181e5a27eba4b46b555 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 十月 2023 17:59:53 +0800 Subject: [PATCH] 2023-10-13 --- src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 62 +++++++++++++++++++++++++++++- 1 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 400b7d9..f0139ed 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -12,7 +12,6 @@ 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 = [ @@ -190,6 +189,14 @@ } } 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') @@ -203,6 +210,20 @@ 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') @@ -349,6 +370,9 @@ 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])) { @@ -552,12 +576,44 @@ 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 -- Gitblit v1.8.0