From 34e39c2c9c2b3f93153ad1a83d47dbd712e515dd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 25 九月 2024 22:55:58 +0800 Subject: [PATCH] 2024-09-25 --- src/utils/utils-custom.js | 71 +++++++++++++++++++++++++++-------- 1 files changed, 54 insertions(+), 17 deletions(-) diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 734009d..3d88af4 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -1950,6 +1950,33 @@ } if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { + if (cell.Ot !== 'requiredOnce' && ['pop', 'form'].includes(cell.OpenType) && cell.verify && cell.verify.uniques && cell.verify.uniques.length > 0) { + let forms = ['BID'] + + if (cell.OpenType === 'form') { + forms.push(cell.field) + } else if (cell.modal && cell.modal.fields.length > 0) { + cell.modal.fields.forEach(n => { + if (!n.field) return + forms.push(n.field) + }) + } + let emptys = [] + cell.verify.uniques.forEach(m => { + if (m.status === 'false') return + + m.field.split(',').forEach(n => { + if (!forms.includes(n)) { + emptys.push(n) + } + }) + }) + + if (emptys.length) { + errors.push({ level: 0, detail: `鎸夐挳鈥�${cell.label}鈥濆敮涓�鎬ч獙璇佸瓧娈�${emptys.join('銆�')}锛屽湪琛ㄥ崟涓笉瀛樺湪锛乣}) + } + } + if (cell.OpenType === 'form' && cell.formType === 'count_line') return if (cell.intertype === 'system') { @@ -3056,7 +3083,7 @@ if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(cell.type) && cell.resourceType === '1' && cell.dataSource) { let msg = getFormSql(cell, '鎼滅储') - sqls.push({uuid: cell.uuid, type: 'sForm', ...msg}) + sqls.push({uuid: md5(item.uuid + cell.uuid), type: 'sForm', ...msg}) } }) } @@ -3428,7 +3455,7 @@ type: item.type, isconst: item.constant === 'true' } - + if (_item.type === 'datemonth') { _item.type = 'text' } else if (_item.type === 'number' || _item.type === 'rate') { @@ -3698,6 +3725,7 @@ item.field.split(',').forEach((_field, index) => { let _key = _field.toLowerCase() let _val = '' + let _val2 = '' arr.push(_key) if (_key === 'bid') { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺 @@ -3707,7 +3735,14 @@ } _fieldValue.push(`${_key}=${_val}`) - _value.push(`${_labels[index] || ''}锛�${_val || ''}`) + + if (_key === 'bid') { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺 + _val2 = `' + ${BID} + '` + } else { + _val2 = `@mk_${_key}_mk@` + } + + _value.push(`${_labels[index] || ''}锛�${_val2}`) }) if (!arr.includes(primaryKey.toLowerCase())) { @@ -3797,7 +3832,7 @@ let _key = item.key.toLowerCase() keys.push(_key) - values.push('@mk_' + _key + '_mk@') + values.push('@' + _key) }) if (!keys.includes(primaryKey.toLowerCase())) { @@ -3841,7 +3876,7 @@ let _key = item.key.toLowerCase() _arr.push(_key) - _form.push(_key + '=@mk_' + _key + '_mk@') + _form.push(_key + '=@' + _key) }) if (_actionType === 'audit') { @@ -4190,8 +4225,8 @@ columns.forEach(col => { let _key = col.field.toLowerCase() - if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_]', 'ig').test(_sql)) return - if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(_sql)) return + if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_@]', 'ig').test(_sql)) return + // if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(_sql)) return colreps.push(col.field) @@ -4301,6 +4336,7 @@ return true }) + colreps = Array.from(new Set(colreps)) reps = [...reps, ...colreps] return { LText: _sql, md5: md5(_sql), reps } @@ -4447,7 +4483,7 @@ ` } - let testSql = _prev + _back + let testSql = _prev + _back + (btn.output || '') // 娣诲姞鏁版嵁涓瓧娈碉紝琛ㄥ崟鍊间紭鍏�(鎸夐挳涓嶉�夎鎴栧琛屾嫾鎺ユ椂璺宠繃) if (btn.Ot !== 'notRequired' && columns.length > 0) { @@ -4455,8 +4491,8 @@ columns.forEach(col => { let _key = col.field.toLowerCase() - if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_]', 'ig').test(testSql)) return - if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(testSql)) return + if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_@]', 'ig').test(testSql)) return + // if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(testSql)) return colreps.push(col.field) @@ -4772,7 +4808,7 @@ arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' ` - _tailScript += `${_tailScript} + _tailScript = `${_tailScript} select @ErrorCode as ErrorCode,@retmsg as retmsg ${callback} ` @@ -4782,8 +4818,9 @@ arr_field='${arr_field}',tabid='${tabid}',parid='${parid}',sub_name='${sub_name}',sub_field='${sub_field}' ` - _tailScript += `${_tailScript} - select @ErrorCode as ErrorCode,@retmsg as retmsg + _tailScript = `${_tailScript} + aaa: + select @ErrorCode as ErrorCode,@retmsg as retmsg ` } @@ -5544,8 +5581,8 @@ component.columns.forEach(col => { let _key = col.field.toLowerCase() - if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_]', 'ig').test(msg.LText)) return - if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(msg.LText)) return + if (formkeys.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_@]', 'ig').test(msg.LText)) return + // if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(msg.LText)) return colreps.push(col.field) @@ -5631,8 +5668,8 @@ component.columns.forEach(col => { let _key = col.field.toLowerCase() - if (syses.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_]', 'ig').test(_sql)) return - if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(_sql)) return + if (syses.includes(_key) || !new RegExp('@' + _key + '[^0-9a-z_@]', 'ig').test(_sql)) return + // if (_key === 'id' && !/@id[^0-9a-z_@]/ig.test(_sql)) return colreps.push(col.field) -- Gitblit v1.8.0