From f9f60bb0dd17a764ba03faa8041f5b6e9e071553 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 18 一月 2025 23:37:44 +0800 Subject: [PATCH] 2025-01-18 --- src/templates/zshare/formconfig.jsx | 128 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 116 insertions(+), 12 deletions(-) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 6ca893d..2dacf15 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銆傚叕鍏卞�硷細@BID@銆丂Appkey@銆丂UserID@銆丂SessionUid@銆丂LoginUID@銆丂lang@銆�', required: true }, { @@ -443,7 +444,7 @@ text: '鏈湴' }, { value: 'sso', - text: '绯荤粺' + text: '鍗曠偣' }] }, { @@ -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) { @@ -771,6 +767,64 @@ } } else { 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) => { @@ -958,12 +1012,20 @@ let options = card.options || [] if (['select', 'radio', 'link'].includes(card.type) && card.setAll === 'true') { // 鍏煎 - options.unshift({ + let cell = { key: 'empty', Value: '', Text: card.emptyText || '绌�', ParentID: '' - }) + } + + if (card.linkSubField) { + card.linkSubField.forEach(m => { + cell[m] = '' + }) + } + + options.unshift(cell) } let initval = card.initval || '' @@ -1145,7 +1207,7 @@ label: '鏁版嵁婧�', initVal: card.dataSource || '', tooltip: '鏁版嵁鏉冮檺鏇挎崲绗� $@ -> /* 鎴� \'\'銆� @$ -> */ 鎴� \'\'', - placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�硷細@ID@銆丂BID@銆�', + placeholder: '绯荤粺鍙橀噺锛歮k_departmentcode銆乵k_organization銆乵k_user_type銆傚叕鍏卞�硷細@ID@銆丂BID@銆丂Appkey@銆丂UserID@銆丂SessionUid@銆丂LoginUID@銆丂lang@銆�', required: true, readonly: false }, @@ -1794,6 +1856,19 @@ }, { type: 'radio', + key: 'notZero', + label: "涓嶅彲涓�0", + initVal: card.notZero || 'false', + options: [{ + value: 'true', + text: '鏄�' + }, { + value: 'false', + text: '鍚�' + }] + }, + { + type: 'radio', key: 'database', label: '鏁版嵁搴�', initVal: card.database || 'local', @@ -1802,7 +1877,7 @@ text: '鏈湴' }, { value: 'sso', - text: '绯荤粺' + text: '鍗曠偣' }] }, { @@ -1840,7 +1915,7 @@ type: 'radio', key: 'readin', label: '鑷姩濉厖', - tooltip: '灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟涓�傛敞锛氬湪鎵归噺鎿嶄綔鏃讹紝濡傛兂瑕佹墍閫夎锛堝綋鍓嶅瓧娈碉級鍏ㄩ儴淇敼璇疯涓哄惁鎴栭琛屻��', + tooltip: '灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟涓�傛敞锛氬湪鎵归噺鎿嶄綔鏃讹紝濡傛兂瑕佹墍閫夎锛堝綋鍓嶅瓧娈碉級鍏ㄩ儴淇敼璇疯涓哄惁鎴栭琛岋紱浣跨敤鈥滅紦瀛樷�濇椂锛屽皢鍦ㄦ湰鍦颁繚瀛樹笌璇诲彇琛ㄥ崟淇℃伅锛岄�夎鏃朵娇鐢ㄨ淇℃伅濉厖銆�', initVal: card.readin || 'true', options: [{ value: 'true', @@ -1851,6 +1926,9 @@ }, { value: 'top', text: '棣栬' + }, { + value: 'local', + text: '缂撳瓨' }] }, { @@ -1865,6 +1943,20 @@ }, { value: 'false', text: '鍚�' + }] + }, + { + type: 'radio', + key: 'verifyVal', + label: '绌哄�奸獙璇�', + tooltip: '鎸夐挳鎻愪氦鏃堕獙璇佸瓧娈靛�兼槸鍚︿负绌猴紙鎴栨暟鍊间负0锛夈��', + initVal: card.verifyVal || 'false', + options: [{ + value: 'true', + text: '寮�鍚�' + }, { + value: 'false', + text: '鍏抽棴' }] }, { @@ -2448,6 +2540,18 @@ }, { type: 'number', + key: 'contHeidht', + label: '楂樺害', + min: 1, + max: 2000, + precision: 1, + initVal: card.contHeidht, + tooltip: '瀵屾枃鏈紪杈戝尯鐨勯珮搴︼紝灏忎簬100鏃朵负绐楀彛鐨勭櫨鍒嗘瘮銆�', + required: false, + forbid: appType === 'mob' + }, + { + type: 'number', key: 'labelwidth', min: 1, max: 100, -- Gitblit v1.8.0