From 76251922200560a63d0703ce2f936246ce8bc46e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 28 九月 2023 09:42:38 +0800 Subject: [PATCH] 2023-09-28 --- src/tabviews/zshare/mutilform/index.jsx | 86 +++++++++++++++++++++++------------------- 1 files changed, 47 insertions(+), 39 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 9f4ca38..e4f95d3 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -486,47 +486,42 @@ let item = fieldMap.get(cell.field) // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 - if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2')) && item.linkSubField) { - item.subFields = [] - item.linkSubField.forEach(m => { - let n = fieldMap.get(m) - if (n && ['text', 'number', 'textarea'].includes(n.type)) { - item.subFields.push({ - uuid: n.uuid, - field: m - }) - } - }) - - if (item.subFields.length === 0) { - item.subFields = null - } else if (item.oriOptions.length > 0) { - item.oriOptions = item.oriOptions.map(cell => { - item.subFields.forEach(m => { - cell[m.field] = cell[m.field] === undefined ? '' : cell[m.field] - }) - return cell + if (item.linkSubField && item.linkSubField.length > 0) { + if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2'))) { + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } }) - - item.options = fromJS(item.oriOptions).toJS() - } - item.linkSubField = null - } else if (item.type === 'switch' && item.linkSubField) { - item.options = [] - item.subFields = [] - item.linkSubField.forEach(m => { - let n = fieldMap.get(m) - if (n && ['text', 'number', 'textarea'].includes(n.type)) { - item.subFields.push({ - uuid: n.uuid, - field: m + + if (item.oriOptions.length > 0) { + item.oriOptions = item.oriOptions.map(cell => { + item.subFields.forEach(m => { + cell[m.field] = cell[m.field] === undefined ? '' : cell[m.field] + }) + return cell }) + + item.options = fromJS(item.oriOptions).toJS() } - }) - - if (item.subFields.length === 0) { - item.subFields = null - } else { + } else if (item.type === 'switch') { + item.options = [] + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } + }) + reFieldsVal = reFieldsVal || {} let val = item.initval === item.openVal ? item.openText : item.closeText @@ -534,7 +529,20 @@ item.subFields.forEach(n => { reFieldsVal[n.field] = val || '' }) + } else if (item.type === 'fileupload') { + item.options = [] + item.subFields = [] + item.linkSubField.forEach(m => { + let n = fieldMap.get(m) + if (n && ['text', 'number', 'textarea'].includes(n.type)) { + item.subFields.push({ + uuid: n.uuid, + field: m + }) + } + }) } + item.linkSubField = null } @@ -1136,7 +1144,7 @@ } else if (item.type === 'fileupload') { className = item.readonly ? 'readonly' : '' className += item.fileType === 'picture-card' ? ' file-upload' : '' - content = (<MKFileUpload config={item} onChange={(val) => this.recordChange({[item.field]: val})} />) + content = (<MKFileUpload config={item} onChange={(val, other = {}) => this.recordChange({[item.field]: val, ...other})} />) } else if (item.type === 'textarea') { content = (<MKTextArea config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})}/>) } else if (item.type === 'rate') { -- Gitblit v1.8.0