From d891a5169bef4e64ca8acd354bfe5eab75dbbb4d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 十月 2023 17:33:14 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/sharecomponent/searchcomponent/searchform/index.jsx | 66 ++++++++++++++++++++++++++++++-- 1 files changed, 61 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx index 400b7d9..2acd0d3 100644 --- a/src/templates/sharecomponent/searchcomponent/searchform/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searchform/index.jsx @@ -11,9 +11,8 @@ import './index.scss' 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 FieldsTable = asyncComponent(() => import('@/templates/zshare/editTable')) 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 @@ -567,7 +623,7 @@ { required: item.required, message: '璇锋坊鍔�' + item.label + '!' } ] - content = <FieldsTable onChange={this.changeField}/> + content = <FieldsTable indexShow={false} actions={['edit', 'move', 'del', 'add']} columns={item.columns} data={this.record.fields || []} onChange={this.changeField}/> } else if (item.type === 'checkbox') { rules = [ { required: item.required, message: '璇烽�夋嫨' + item.label + '!' } -- Gitblit v1.8.0