From 10f5efae1624c89d9a8f04ac331e07c895ea282a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 25 五月 2024 18:22:58 +0800 Subject: [PATCH] 2024-05-25 --- src/templates/zshare/formconfig.jsx | 66 ++++++++++++++++++++++++++++++--- 1 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index eef8041..621dd29 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -261,6 +261,7 @@ label: '鏁版嵁婧�', initVal: card.dataSource || '', tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'', + placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆�', required: true }, { @@ -730,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) { @@ -773,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