From 1e4a7720c748bc0206b02b30f4a2e0b3dafb54f3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 19 二月 2024 13:31:13 +0800 Subject: [PATCH] 2024-02-19 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 84 +++++++++++++++++++++++++++++++++-------- 1 files changed, 67 insertions(+), 17 deletions(-) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index fcdad35..ee270d7 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -55,7 +55,7 @@ this.node.blur() - if (config.enter === '$noAct') return + if (/\$noAct/.test(config.enter)) return if (/\$next/.test(config.enter)) { MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) @@ -191,7 +191,7 @@ this.props.onChange(values) - if (config.enter === '$noAct') return + if (/\$noAct/.test(config.enter)) return if (/\$next/.test(config.enter)) { MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) @@ -283,9 +283,11 @@ this.props.onChange(values, val) + if (config.enter === '$noActX') return + this.node.blur() - if (config.enter === '$noAct') return + if (/\$noAct/.test(config.enter)) return setTimeout(() => { if (/\$next/.test(config.enter)) { @@ -308,7 +310,7 @@ const { config, lineId } = this.props if (config.$ctrl) { - MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) + MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid, true) } setTimeout(() => { @@ -408,7 +410,7 @@ this.node.blur() - if (config.enter === '$noAct') return + if (/\$noAct/.test(config.enter)) return if (/\$next/.test(config.enter)) { MKEmitter.emit('nextLine' + config.tableId, lineId, config.enter.replace('$next_', '')) @@ -536,7 +538,7 @@ this.node.blur() - if (config.enter === '$noAct') return + if (/\$noAct/.test(config.enter)) return setTimeout(() => { if (/\$next/.test(config.enter)) { @@ -750,6 +752,10 @@ } else if (content === config.closeVal) { content = config.closeText } + } else if (col.editType === 'popSelect') { + if (col.showField) { + content = record[col.showField] || content + } } if (content !== '') { @@ -807,8 +813,13 @@ <MkDatePicker config={col} lineId={record.$$uuid} defaultValue={_value || null} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/> </td>) } else if (col.editType === 'popSelect') { + let showValue = '' + if (col.showField) { + showValue = record[col.showField] || '' + } + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> - <MKPopSelect config={col} lineId={record.$$uuid} defaultValue={_value} BID={record.$$BID} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/> + <MKPopSelect config={col} lineId={record.$$uuid} defaultValue={_value} showValue={showValue} BID={record.$$BID} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/> </td>) } else { return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> @@ -1054,8 +1065,13 @@ <MkDatePicker config={col} lineId={record.$$uuid} defaultValue={_value || null} autoFocus={false} onChange={this.onColChange}/> ) } else if (col.editType === 'popSelect') { + let showValue = '' + if (col.showField) { + showValue = record[col.showField] || '' + } + children = ( - <MKPopSelect config={col} lineId={record.$$uuid} defaultValue={_value} BID={record.$$BID} autoFocus={false} onChange={this.onColChange}/> + <MKPopSelect config={col} lineId={record.$$uuid} defaultValue={_value} showValue={showValue} BID={record.$$BID} autoFocus={false} onChange={this.onColChange}/> ) } else { children = ( @@ -1075,6 +1091,10 @@ content = config.openText } else if (content === config.closeVal) { content = config.closeText + } + } else if (col.editType === 'popSelect') { + if (col.showField) { + content = record[col.showField] || content } } @@ -1471,6 +1491,10 @@ pageOptions = pageOptions.sort((a, b) => a - b) } + if (setting.maxPageSize) { + pageOptions = pageOptions.filter(item => item <= setting.maxPageSize) + } + let allColumns = null if (colsCtrls) { allColumns = [..._columns] @@ -1550,7 +1574,11 @@ MKEmitter.removeListener('changeRecord' + tableId, this.changeRecord) } - colBlur = (lineId) => { + colBlur = (lineId, colId, defer) => { + if (defer && this.focusId === lineId && this.colId !== colId) { + return + } + this.blurId = lineId this.focusId = '' @@ -1672,6 +1700,9 @@ result = originVal === contrastVal } else if (item.match === '!=') { result = originVal !== contrastVal + } else if (item.match === 'regexp') { + let reg = new RegExp(item.contrastValue, 'ig') + result = reg.test(originVal) } else { originVal = isNaN(originVal) ? originVal : +originVal contrastVal = isNaN(contrastVal) ? contrastVal : +contrastVal @@ -1860,9 +1891,13 @@ } if (param.LText) { - param.LText = Utils.formatOptions(param.LText) + if (window.GLOB.execType === 'x') { + param.exec_type = 'x' + } + + param.LText = Utils.formatOptions(param.LText, param.exec_type) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt(param.LText, param.timestamp) + param.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : param.LText, param.timestamp) deffers.push( new Promise(resolve => { @@ -1891,9 +1926,13 @@ } if (mainparam.LText) { - mainparam.LText = Utils.formatOptions(mainparam.LText) + if (window.GLOB.execType === 'x') { + mainparam.exec_type = 'x' + } + + mainparam.LText = Utils.formatOptions(mainparam.LText, mainparam.exec_type) mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) + mainparam.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : mainparam.LText, mainparam.timestamp) if (window.GLOB.mainSystemApi) { mainparam.rduri = window.GLOB.mainSystemApi @@ -2017,7 +2056,7 @@ setTimeout(() => { this.plusLine(colId) }, 10) - } else if (edData[index] && setting.commit !== 'change') { + } else if (edData[index] && (setting.commit === 'all' || setting.commit === 'amend')) { setTimeout(() => { this.submit() }, 10) @@ -2158,7 +2197,7 @@ checkData = () => { const { setting } = this.props - const { edData, forms, checkForms } = this.state + const { edData, forms, checkForms, selectedRowKeys } = this.state let data = fromJS(edData).toJS() @@ -2166,6 +2205,17 @@ if (setting.commit === 'amend') { data = data.filter(item => !item.$origin) + } else if (setting.commit === 'check') { + data = data.filter(item => selectedRowKeys.includes(item.$$uuid)) + + if (data.length === 0) { + notification.warning({ + top: 92, + message: '璇烽�夋嫨闇�瑕佹彁浜ょ殑鏁版嵁锛�', + duration: 5 + }) + return null + } } if (data.length === 0) { @@ -2307,8 +2357,8 @@ delete param.excel_in - param.exec_type = 'y' - param.LText = Utils.formatOptions(result.sql) + param.exec_type = window.GLOB.execType || 'y' + param.LText = Utils.formatOptions(result.sql, param.exec_type) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) -- Gitblit v1.8.0