From e9e8b1c7b481415714fff9a0d83099fd5a7d6ff0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 18 五月 2023 17:25:11 +0800 Subject: [PATCH] 2023-05-18 --- src/menu/components/table/base-table/columns/editColumn/formconfig.jsx | 67 ++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx index fb51dad..e139d76 100644 --- a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx @@ -58,11 +58,9 @@ text: '搴忓彿' }] - if (!card.isSub) { - options.push({ - value: 'action', - text: '鎿嶄綔' - }) + let decimal = card.decimal === undefined ? 0 : card.decimal + if (card.type === 'formula' && typeof(card.decimal) !== 'number') { + decimal = '' } return [ @@ -71,7 +69,11 @@ key: 'label', label: '鍒楀ご鏂囧瓧', initVal: card.label, - required: true + required: true, + rules: [{ + max: 100, + message: '鏈�澶�100涓瓧绗︺��' + }] }, { type: 'select', @@ -87,14 +89,25 @@ label: '瀛楁', initVal: card.field, required: true, - options: card.isSub ? fields : [] + options: card.isSub ? fields : [], + rules: [{ + pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, + message: '瀛楁鍚嶅彧鍏佽鍖呭惈鏁板瓧銆佸瓧姣嶃�佹眽瀛椾互鍙奯' + }, { + max: 100, + message: '鏈�澶�100涓瓧绗︺��' + }] }, { type: 'text', key: 'nameField', label: '鍚嶇О瀛楁', initVal: card.nameField || '', - required: false + required: false, + rules: [{ + max: 100, + message: '鏈�澶�100涓瓧绗︺��' + }] }, { type: 'number', @@ -147,6 +160,18 @@ value: 'false', text: '鍚�' }] + }, + { + type: 'radio', + key: 'eval', + label: '瑙f瀽', + initVal: card.eval || 'false', + tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', + required: false, + options: [ + { value: 'true', text: '鏄�' }, + { value: 'false', text: '鍚�' } + ] }, { type: 'radio', @@ -231,7 +256,7 @@ max: 18, decimal: 0, label: '灏忔暟浣�', - initVal: card.decimal === undefined ? 0 : card.decimal, + initVal: decimal, required: !card.isSub }, { @@ -280,7 +305,11 @@ label: '鍓嶇紑', initVal: card.prefix || '', required: false, - readonly: false + readonly: false, + rules: [{ + max: 100, + message: '鏈�澶�100涓瓧绗︺��' + }] }, { type: 'text', @@ -288,7 +317,11 @@ label: '鍚庣紑', initVal: card.postfix || '', required: false, - readonly: false + readonly: false, + rules: [{ + max: 100, + message: '鏈�澶�100涓瓧绗︺��' + }] }, { type: 'number', @@ -390,18 +423,6 @@ initVal: card.linkfields || [], required: false, options: fields, - }, - { - type: 'radio', - key: 'eval', - label: '瑙f瀽', - initVal: card.eval || 'false', - tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', - required: false, - options: [ - { value: 'true', text: '鏄�' }, - { value: 'false', text: '鍚�' } - ] }, { type: 'textarea', -- Gitblit v1.8.0