From cc53c43e2088ac208d6d7ebbd0b0932fca24916b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 一月 2023 12:52:19 +0800 Subject: [PATCH] 2023-01-13 --- src/tabviews/zshare/mutilform/index.jsx | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index d60164b..e69e00d 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -35,6 +35,7 @@ data: PropTypes.any, // 琛ㄦ牸鏁版嵁 BID: PropTypes.any, // 涓昏〃ID BData: PropTypes.any, // 涓昏〃鏁版嵁 + unload: PropTypes.any, // 涓嬫媺鑿滃崟涓嶅姞杞芥暟鎹� inputSubmit: PropTypes.func // input鍥炶溅鎻愪氦 } @@ -45,7 +46,7 @@ record = {} componentDidMount () { - const { action } = this.props + const { action, unload } = this.props let data = {} let BData = {} @@ -300,7 +301,7 @@ }) } else if (item.regular === 'email') { _rules.push({ - pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, + pattern: /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, message: item.regularText || '璇锋纭緭鍏ラ偖绠卞湴鍧�' }) } @@ -506,6 +507,8 @@ this.record = record this.setState({ formlist }, () => { + if (unload) return + if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) { setTimeout(() => { MKEmitter.emit('mkFC', 'focus', fieldMap.get(action.setting.focus).uuid) @@ -532,12 +535,26 @@ let mainItems = [] // 浜戠鎴栧崟鐐规暟鎹� let localItems = [] // 鏈湴鏁版嵁 let cache = action.setting.cache !== 'false' + let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') + + let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` + let _sso = _sql deForms.forEach(item => { if (item.database === 'sso') { - mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`) + let sql = _sso + item.base_sql + _sso = '' + if (debug) { + console.info(sql) + } + mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } else { - localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`) + let sql = _sql + item.base_sql + _sql = '' + if (debug) { + console.info(sql) + } + localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } }) @@ -635,16 +652,23 @@ */ improveSimpleActionForm = (deForms) => { let cache = this.props.action.setting.cache !== 'false' + let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') + let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` let deffers = deForms.map((form, index) => { let param = { func: 'sPC_Get_SelectedList', - LText: form.data_sql, + LText: _sql + form.base_sql, obj_name: form.field, arr_field: form.arr_field, BID: this.props.BID || '' } + + if (debug) { + console.info(param.LText) + } + param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LText, param.timestamp) @@ -691,6 +715,7 @@ if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) { let options = [] let map = new Map() + let all = false result[item.field].forEach(cell => { let _cell = { key: Utils.getuuid() , ParentID: ''} @@ -701,13 +726,27 @@ if (item.type !== 'checkcard') { _cell.value = cell[item.valueField] _cell.label = cell[item.valueText] + '' - if (!_cell.label || map.has(_cell.ParentID + _cell.value)) return + if (map.has(_cell.ParentID + _cell.value)) return + if (!_cell.label) { + if (!all) { + _cell.label = '鍏ㄩ儴' + all = true + } else { + return + } + } map.set(_cell.ParentID + _cell.value, 0) } else { _cell.$value = cell[item.cardValField] _cell = {..._cell, ...cell} + if (item.urlField) { + _cell.$url = cell[item.urlField] || '' + } else if (item.colorField) { + _cell.$color = cell[item.colorField] || '' + } + if (map.has(_cell.ParentID + _cell.$value)) return map.set(_cell.ParentID + _cell.$value, 0) -- Gitblit v1.8.0