From f1a4a2e83a5a3a3f8636c0d85a3a02471c5b07e7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 05 三月 2025 15:39:52 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/tabviews/zshare/mutilform/index.jsx | 52 ++++++++++++++++++++++++++++++++++------------------ 1 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 7838109..b604438 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -193,12 +193,21 @@ if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type)) { item.options = item.options || [] - item.options = item.options.filter(cell => { - cell.value = cell.Value - cell.label = cell.Text - - return !cell.Hide - }) + item.$select = true + if (item.type === 'checkcard') { + item.options = item.options.filter(cell => { + cell.$value = cell.$value + '' + return !cell.Hide + }) + } else { + item.options = item.options.filter(cell => { + cell.value = cell.Value + '' + cell.label = cell.Text + + return !cell.Hide + }) + } + if (item.setAll === 'true' && ['select', 'link', 'radio'].includes(item.type)) { // 娣诲姞绌哄�� item.options.unshift({ key: Utils.getuuid(), @@ -309,6 +318,8 @@ newval = '' } } + } else if (item.$select && item.resourceType === '0') { + newval = newval + '' } if (newval !== '$empty') { @@ -321,7 +332,7 @@ if (isNaN(item.initval) || item.initval === '') { item.initval = 0 } - } else if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && item.resourceType === '1') { + } else if (item.$select && item.resourceType === '1') { deForms.push(item) } else if (item.type === 'rate') { item.rateCount = item.rateCount || 5 @@ -412,7 +423,7 @@ }) } else if (item.regular === 'phone') { item.rules.push({ - pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, + pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\s?\d{4}\s?\d{4}$/, message: item.regularText || dict['phone_error'] || '璇锋纭緭鍏ユ墜鏈哄彿' }) } else if (item.regular === 'email') { @@ -1559,10 +1570,10 @@ } else if (item.declare === 'decimal') { _item.type = 'number' _item.fieldlen = item.decimal || 0 - } else if (['text', 'textarea', 'linkMain'].includes(item.type)) { + } else if (['text', 'textarea', 'linkMain', 'brafteditor'].includes(item.type)) { _item.value = _item.value + '' _item.value = _item.value.replace(/\t+|\v+/g, '') // 鍘婚櫎鍒惰〃绗� - + if (item.interception !== 'false') { // 鍘婚櫎棣栧熬绌烘牸 if (item.interception === 'func') { try { @@ -1592,14 +1603,19 @@ _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') } } - if (item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲 - _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) - } - if (item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { - if (item.lenControl === 'left') { - _item.value = _item.value.substr(0, item.fieldlength) - } else { - _item.value = _item.value.slice(-item.fieldlength) + if (item.type === 'text') { + if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 鐗规畩瀛楁鏇挎崲 + _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) + } + if (item.lenControl && item.lenControl !== 'limit') { + if (item.lenControl === 'left') { + _item.value = _item.value.substr(0, item.fieldlength) + } else { + _item.value = _item.value.slice(-item.fieldlength) + } + } + if (item.regular === 'phone') { + _item.value = _item.value.replace(/\s+/g, '') } } } else if (item.type === 'datemonth') { -- Gitblit v1.8.0