From 57da72c823fab94a3ec6fadab2bc75173c8a03b1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 01 十二月 2020 13:45:25 +0800 Subject: [PATCH] 2020-12-01 --- src/tabviews/zshare/mutilform/index.jsx | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 0fcddd3..2767199 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -85,7 +85,7 @@ formlist = action.fields } - let _inputfields = formlist.filter(item => item.type === 'text' || item.type === 'number') // 鐢ㄤ簬杩囨护涓嬫媺鑿滃崟鍏宠仈琛ㄥ崟 + let _inputfields = formlist.filter(item => (item.type === 'text' || item.type === 'number') && item.field) // 鐢ㄤ簬杩囨护涓嬫媺鑿滃崟鍏宠仈琛ㄥ崟 formlist = formlist.map(item => { if (item.type === 'title') return item @@ -135,9 +135,15 @@ item.oriOptions = fromJS(item.options).toJS() // 涓嬬骇琛ㄥ崟鎺у埗-瀛楁鍐欏叆 - if (item.linkSubField && item.linkSubField.length > 0) { - let _fields = _inputfields.map(_item => _item.field) - item.linkSubField = item.linkSubField.filter(_item => _fields.includes(_item)) + if (item.type === 'select' || item.type === 'radio') { + if (item.linkSubField && item.linkSubField.length > 0) { + item.linkSubField = item.linkSubField.filter(_item => _inputfields.includes(_item)) + } + if (item.linkSubField && item.linkSubField.length === 0) { + item.linkSubField = null + } + } else { + item.linkSubField = null } } @@ -422,7 +428,7 @@ if (item.type === 'link') { _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField] - } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { + } else if (item.linkSubField) { item.linkSubField.forEach(_field => { _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : '' }) @@ -519,7 +525,7 @@ if (item.type === 'link') { _cell.ParentID = cell[item.linkField] === undefined ? '' : cell[item.linkField] - } else if ((item.type === 'select' || item.type === 'radio') && item.linkSubField && item.linkSubField.length > 0) { + } else if (item.linkSubField) { item.linkSubField.forEach(_field => { _cell[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : '' }) @@ -600,7 +606,7 @@ }) // 琛ㄥ崟鍒囨崲鏃讹紝鏇存柊鍏宠仈瀛楁 - if ((_field.type === 'select' || _field.type === 'radio') && _field.linkSubField && _field.linkSubField.length > 0) { + if (_field.linkSubField) { let _data = _field.options.filter(op => op.Value === value)[0] if (_data) { -- Gitblit v1.8.0