| | |
| | | |
| | | 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_', '')) |
| | |
| | | |
| | | 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_', '')) |
| | |
| | | |
| | | 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)) { |
| | |
| | | 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(() => { |
| | |
| | | |
| | | 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_', '')) |
| | |
| | | |
| | | this.node.blur() |
| | | |
| | | if (config.enter === '$noAct') return |
| | | if (/\$noAct/.test(config.enter)) return |
| | | |
| | | setTimeout(() => { |
| | | if (/\$next/.test(config.enter)) { |
| | |
| | | } else if (content === config.closeVal) { |
| | | content = config.closeText |
| | | } |
| | | } else if (col.editType === 'popSelect') { |
| | | if (col.showField) { |
| | | content = record[col.showField] || content |
| | | } |
| | | } |
| | | |
| | | if (content !== '') { |
| | |
| | | content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}` |
| | | } else if (col.textFormat === 'encryption') { |
| | | content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> |
| | | } |
| | | |
| | | if (col.noValue === 'hide' && content < '1949-10-02') { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.textFormat !== 'encryption') { |
| | |
| | | <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"> |
| | |
| | | <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 = ( |
| | |
| | | } else if (content === config.closeVal) { |
| | | content = config.closeText |
| | | } |
| | | } else if (col.editType === 'popSelect') { |
| | | if (col.showField) { |
| | | content = record[col.showField] || content |
| | | } |
| | | } |
| | | |
| | | if (content !== '') { |
| | |
| | | content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}` |
| | | } else if (col.textFormat === 'encryption') { |
| | | content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> |
| | | } |
| | | |
| | | if (col.noValue === 'hide' && content < '1949-10-02') { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.textFormat !== 'encryption') { |
| | |
| | | pageOptions = pageOptions.sort((a, b) => a - b) |
| | | } |
| | | |
| | | if (setting.maxPageSize) { |
| | | pageOptions = pageOptions.filter(item => item <= setting.maxPageSize) |
| | | } |
| | | |
| | | let allColumns = null |
| | | if (colsCtrls) { |
| | | allColumns = [..._columns] |
| | |
| | | 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 = '' |
| | | |
| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | 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 => { |
| | |
| | | } |
| | | |
| | | 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 |
| | |
| | | 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) |
| | |
| | | |
| | | checkData = () => { |
| | | const { setting } = this.props |
| | | const { edData, forms, checkForms } = this.state |
| | | const { edData, forms, checkForms, selectedRowKeys } = this.state |
| | | |
| | | let data = fromJS(edData).toJS() |
| | | |
| | |
| | | |
| | | 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) { |
| | |
| | | |
| | | 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) |
| | | |