From c9e46b9fa50396d4001d8b195dc485d431e8d590 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 14 七月 2022 20:34:09 +0800 Subject: [PATCH] 2022-07-14 --- src/tabviews/zshare/mutilform/index.jsx | 51 +++++++++++---------------------------------------- 1 files changed, 11 insertions(+), 40 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index ca9344d..2c79490 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -393,7 +393,7 @@ let item = fieldMap.get(cell.field) // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 - if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) { + 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) @@ -418,9 +418,6 @@ item.options = fromJS(item.oriOptions).toJS() } item.linkSubField = null - } else if (item.type === 'cascader' && item.fillField) { - let n = fieldMap.get(item.fillField) - item.fillFieldId = n ? n.uuid : '' } // if (item.type === 'link') { @@ -463,31 +460,18 @@ } if (item.subFields && item.options.length > 0) { + let initval = item.initval + if (item.type === 'cascader' && item.separator) { + initval = initval.split(item.separator).pop() + } // eslint-disable-next-line - let option = item.options.filter(cell => item.initval == cell.value)[0] + let option = item.options.filter(cell => initval == cell.value)[0] if (option) { reFieldsVal = reFieldsVal || {} item.subFields.forEach(n => { reFieldsVal[n.field] = option[n.field] }) - } - } else if (item.fillField && item.initval && item.separator && item.options.length > 0) { - let initvals = item.initval.split(item.separator) - let label = [] - initvals.forEach(m => { - // eslint-disable-next-line - let option = item.options.filter(cell => m == cell.value)[0] - if (option) { - label.push(option.label) - } - }) - - label = label.join(item.separator) - - if (label) { - reFieldsVal = reFieldsVal || {} - reFieldsVal[item.fillField] = label } } @@ -737,31 +721,18 @@ } if (item.subFields && item.options.length > 0) { + let initval = item.initval + if (item.type === 'cascader' && item.separator) { + initval = initval.split(item.separator).pop() + } // eslint-disable-next-line - let option = item.options.filter(cell => item.initval == cell.value)[0] + let option = item.options.filter(cell => initval == cell.value)[0] if (option) { reFieldsVal = reFieldsVal || {} item.subFields.forEach(n => { reFieldsVal[n.field] = option[n.field] }) - } - } else if (item.fillField && item.initval && item.separator && item.options.length > 0) { - let initvals = item.initval.split(item.separator) - let label = [] - initvals.forEach(m => { - // eslint-disable-next-line - let option = item.options.filter(cell => m == cell.value)[0] - if (option) { - label.push(option.label) - } - }) - - label = label.join(item.separator) - - if (label) { - reFieldsVal = reFieldsVal || {} - reFieldsVal[item.fillField] = label } } } -- Gitblit v1.8.0