From c5b6f6cb5bba7268aaa2496bbf21bf2965277f8b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 01 七月 2022 13:29:03 +0800 Subject: [PATCH] 2022-07-01 --- src/templates/zshare/modalform/index.jsx | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 8e2e0a6..605c7a5 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -163,17 +163,28 @@ reRequired.linkField = false } } else if (type === 'checkcard') { + reRequired.fields = false if (this.record.display === 'picture') { if (this.record.resourceType === '0') { // 鑷畾涔夎祫婧� - shows.push('options', 'ratio') + shows.push('options', 'fields', 'picratio') } else if (this.record.resourceType === '1') { // 鏁版嵁婧� - shows.push('dataSource', 'cardValField', 'urlField', 'orderBy', 'orderType', 'disableField', 'database', 'ratio') + shows.push('dataSource', 'cardValField', 'fields', 'urlField', 'orderBy', 'orderType', 'disableField', 'database', 'picratio') + } + } else if (this.record.display === 'color') { + if (this.record.resourceType === '0') { // 鑷畾涔夎祫婧� + shows.push('options', 'fields') + } else if (this.record.resourceType === '1') { // 鏁版嵁婧� + shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'database') } } else { + reRequired.fields = true if (this.record.resourceType === '0') { // 鑷畾涔夎祫婧� - shows.push('options', 'fields', 'backgroundColor', 'borderColor') + shows.push('options', 'fields', 'selectStyle') } else if (this.record.resourceType === '1') { // 鏁版嵁婧� - shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'disableField', 'database', 'backgroundColor', 'borderColor') + shows.push('dataSource', 'cardValField', 'fields', 'orderBy', 'orderType', 'disableField', 'database', 'selectStyle') + } + if (this.record.selectStyle === 'custom') { + shows.push('backgroundColor') } } @@ -537,7 +548,7 @@ ] initVal = item.initVal - content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> + content = <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => {this.optionChange(item.key, e.target.value)}}> {item.options.map(option => { return ( <Radio key={option.value} value={option.value}>{option.text}</Radio> @@ -591,10 +602,16 @@ } else if (item.type === 'fields') { span = 24 className = 'text-area' + rules = [ + { required: item.required, message: '璇锋坊鍔�' + item.label + '!' } + ] content = <FieldsTable dict={this.props.dict} onChange={this.changeField}/> } else if (item.type === 'color') { className = 'color-form-item' + rules = [ + { required: item.required, message: dict['form.required.select'] + item.label + '!' } + ] content = <ColorSketch allowClear={true}/> } else if (item.type === 'icon') { -- Gitblit v1.8.0