From 4cc738e535d1a20701d206e12cf9de8cc5a01170 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 01 六月 2024 15:24:12 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/formconfig.jsx | 65 +++++++++++++++++++++++++++++--- 1 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 50071ac..621dd29 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -731,13 +731,8 @@ /** * @description 鑾峰彇琛ㄥ崟閰嶇疆淇℃伅 - * @param {*} card // 琛ㄥ崟瀵硅薄 - * @param {*} inputfields // 鍙啓鍏ヨ〃鍗� - * @param {*} tabfields // 鍙垏鎹㈣〃鍗� - * @param {*} linkableFields // 鍙叧鑱旇〃鍗� - * @param {*} linksupFields // 涓婄骇琛ㄥ崟 */ -export function getModalForm (card, inputfields = [], tabfields = [], linkableFields, linksupFields, columns = []) { +export function getModalForm (card, fields, columns = []) { let appType = sessionStorage.getItem('appType') let roleList = sessionStorage.getItem('sysRoles') if (roleList) { @@ -774,6 +769,64 @@ msgTemps = [] } + let inputfields = [] + let tabfields = [] + let linkableFields = [] + let linksupFields = [] + + fields.forEach(item => { + if (!item.field || card.field === item.field) return + + if (['text', 'number', 'textarea', 'select'].includes(item.type)) { + inputfields.push({ + field: item.field, + label: item.label + }) + } + if (item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) { + tabfields.push({ + field: item.field, + label: item.label + }) + } + + if (['switch', 'check', 'popSelect'].includes(item.type)) { + linksupFields.push({ + field: item.field, + label: item.label + }) + } + + if (['select', 'link', 'radio', 'checkcard', 'multiselect'].includes(item.type)) { + linksupFields.push({ + field: item.field, + label: item.label + }) + } + + if (['select', 'link', 'radio', 'popSelect'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) { + linkableFields.push({ + field: item.field, + label: item.label + '-琛ㄥ崟' + }) + } + }) + + let _fields = linkableFields.map(cell => cell.field) + columns.forEach(col => { + if (col.field && !_fields.includes(col.field)) { + linkableFields.push({ + field: col.field, + label: col.label + '-鏄剧ず鍒�' + }) + } + }) + + if (card.linkSubField && card.linkSubField.length > 0) { + let fields = inputfields.map(item => item.field) + card.linkSubField = card.linkSubField.filter(item => fields.includes(item)) + } + inputfields = inputfields.map((item, index) => { item.label = `${index + 1}銆�${item.field || ''}锛�${item.label}锛塦 return item -- Gitblit v1.8.0