From c7aece35a62b6e91fd98a625bf0e53f64bfbd18d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 17 八月 2023 16:22:15 +0800 Subject: [PATCH] 2023-08-17 --- src/templates/zshare/modalform/index.jsx | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index b49f28b..c6c2a7b 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -32,7 +32,7 @@ check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'], - datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], + // datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], textarea: ['initval', 'readonly', 'required', 'hidden', 'readin', 'fieldlength', 'span', 'labelwidth', 'maxRows', 'encryption', 'interception', 'tooltip', 'extra', 'place', 'count', 'placeholder', 'marginTop', 'marginBottom'], cascader: ['readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'splitline', 'marginTop', 'marginBottom', 'separator'], color: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'colorType', 'extra', 'marginTop', 'marginBottom'], @@ -222,7 +222,7 @@ } } else { shows.push('fieldlength', 'checkAll') - reTooltip.initval = '娣诲姞澶氫釜鍒濆鍊艰浣跨敤閫楀彿鍒嗛殧銆�' + reTooltip.initval = '娣诲姞澶氫釜鍒濆鍊艰浣跨敤閫楀彿鍒嗛殧銆�' } shows.push('linkField') @@ -234,9 +234,17 @@ if (this.record.readonly === 'true' && this.record.hidden !== 'true') { shows.push('unchecked') } - } else if (['date', 'datemonth', 'datetime'].includes(type)) { + } else if (['date', 'datemonth'].includes(type)) { reOptions.initval = dateOptions[type] reTypes.initval = 'select' + if (type === 'date') { + if (this.record.minDate === 'custom') { + shows.push('minDateField') + } + if (this.record.maxDate === 'custom') { + shows.push('maxDateField') + } + } } else if (type === 'switch' || type === 'check') { reOptions.initval = [ {value: true, text: '寮�'}, @@ -588,7 +596,7 @@ this.props.form.setFieldsValue({dataSource: resource}) } - complete = (key, option) => { + complete = (option) => { let label = option.props.label this.props.form.setFieldsValue({label: label}) @@ -642,13 +650,13 @@ }) } - if (item.key === 'field' && item.options && item.options.length > 0) { + if (['field', 'minDateField', 'maxDateField'].includes(item.key) && item.options && item.options.length > 0) { content = <AutoComplete dataSource={item.options.map((cell) => <AutoComplete.Option label={cell.label} value={cell.field} key={cell.uuid}> {cell.field} </AutoComplete.Option>)} filterOption={(input, option) => option.props.children.indexOf(input) > -1} - onSelect={this.complete} + onSelect={(val, option) => item.key === 'field' && this.complete(option)} placeholder="" > <Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} /> -- Gitblit v1.8.0