From e5605fc3af350edf6c61d9ec956cfe72dce22af7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 18 十月 2022 11:46:36 +0800 Subject: [PATCH] 2022-10-18 --- public/options.json | 10 +++++----- src/tabviews/zshare/mutilform/index.jsx | 24 ++++++++++++++++++++---- src/templates/zshare/modalform/index.jsx | 12 ++++++++++++ src/templates/zshare/formconfig.jsx | 9 +++++++++ 4 files changed, 46 insertions(+), 9 deletions(-) diff --git a/public/options.json b/public/options.json index ea0061e..32085f0 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", + "appId": "202108312122504607B107A83F55B40C98CCF", + "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "false", "lineColor": "", "filter": "false", - "defaultApp": "mk", + "defaultApp": "mkindustry", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -17,6 +17,6 @@ "transfer": "false", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "http://demo.mk9h.cn", + "service": "erp_new/" } \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index daa91b3..9555b03 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -258,23 +258,39 @@ if (item.regular) { if (item.regular === 'number') { + let reg = /^[0-9.-]*$/ + if (item.regularExtra) { + reg = new RegExp('^[0-9.-' + item.regularExtra.replace(/\.|-/g, '') + ']*$') + } _rules.push({ - pattern: /^[0-9.-]*$/, + pattern: reg, message: item.regularText || formRule.input.numbermsg }) } else if (item.regular === 'letter') { + let reg = /^[a-zA-Z]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z' + item.regularExtra + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z]*$/, + pattern: reg, message: item.regularText || formRule.input.lettermsg }) } else if (item.regular === 'letter_number') { + let reg = /^[a-zA-Z0-9]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z0-9' + item.regularExtra + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z0-9]*$/, + pattern: reg, message: item.regularText || '璇疯緭鍏ユ暟瀛楁垨瀛楁瘝' }) } else if (item.regular === 'letter&number') { + let reg = /^[a-zA-Z0-9@_.]*$/ + if (item.regularExtra) { + reg = new RegExp('^[a-zA-Z0-9@_.' + item.regularExtra.replace(/\.|_|@/g, '') + ']*$') + } _rules.push({ - pattern: /^[a-zA-Z0-9@_.]*$/, + pattern: reg, message: item.regularText || '璇疯緭鍏ユ暟瀛椼�佸瓧姣嶄互鍙夽_.' }) } else if (item.regular === 'phone') { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index d380c82..4065d94 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3665,6 +3665,15 @@ }, { type: 'text', + key: 'regularExtra', + label: '姝e垯鎵╁睍绗�', + initVal: card.regularExtra || '', + tooltip: '姝e垯楠岃瘉鏃剁殑鑷畾涔夊瓧绗︼紝鍖呮嫭~!@#$%^&*()_+:;{}<>,.-', + required: false, + readonly: false + }, + { + type: 'text', key: 'regularText', label: '姝e垯鎻愮ず', initVal: card.regularText || '', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 74ed039..7b0eb1f 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -141,6 +141,9 @@ } if (this.record.regular !== '') { shows.push('regularText') + if (this.record.regular !== 'phone' && this.record.regular !== 'email') { + shows.push('regularExtra') + } } } else if (type === 'number') { reTypes.initval = 'number' @@ -593,6 +596,11 @@ max: formRule.field.max, message: formRule.field.maxMessage }) + } else if (item.key === 'regularExtra') { + rules.push({ + pattern: /^[~!@#$%^&*()_+:;{}<>,.-]*$/, + message: '鎵╁睍绗﹀寘鎷瑍!@#$%^&*()_+:;{}<>,.-' + }) } else if (item.max) { rules.push({ max: item.max, @@ -875,6 +883,10 @@ values.initval = '' } else if (values.type === 'split') { values.span = 24 + } else if (values.type === 'text') { + if (values.regularExtra) { + values.regularExtra = Array.from(new Set(values.regularExtra.split(''))).join('') + } } ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => { -- Gitblit v1.8.0