From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 八月 2023 18:37:36 +0800 Subject: [PATCH] 2023-08-27 --- src/templates/zshare/modalform/index.jsx | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 27260e3..3aaa932 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -28,11 +28,11 @@ multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'setAll', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'emptyText', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], fileupload: ['readonly', 'required', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], - switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], + switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], 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'], @@ -221,8 +221,8 @@ shows.push('decimal') } } else { - shows.push('fieldlength') - reTooltip.initval = '娣诲姞澶氫釜鍒濆鍊艰浣跨敤閫楀彿鍒嗛殧銆�' + shows.push('fieldlength', 'checkAll') + 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: '寮�'}, @@ -408,6 +416,8 @@ this.record.resourceType = '0' _fieldval.resourceType = '0' } + } else if (this.record.type === 'funcvar' && value !== 'funcvar') { + this.record.readonly = 'false' } if (this.record.options.length > 0) { @@ -588,7 +598,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 +652,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} /> @@ -986,7 +996,7 @@ ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { if (values[item]) { - values[item] = values[item].replace(/\s*|\t*|\v*|\r*/ig, '') + values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '') } }) -- Gitblit v1.8.0