From cd9b8908311094fbcd6c359ed8bf80ba4589375a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 20 十月 2023 22:22:49 +0800 Subject: [PATCH] 2023-10-20 --- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 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 b858fbf..4da1baa 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -433,23 +433,23 @@ if (col.editable === 'true' && !disabled) { if (editing) { if (!col.editType || col.editType === 'text') { - return (<td className="editing_table_cell"> + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <Input className={err ? 'has-error' : ''} title={err} id={col.uuid + record.$$uuid} defaultValue={value} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> </td>) } else if (col.editType === 'date') { - return (<td className="editing_table_cell"> + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <CusDatePicker config={col} value={record[col.field] || null} open={true} onChange={this.onDateChange} blur={() => this.setState({editing: false})}/> </td>) } else if (col.editType === 'switch') { let _value = record[col.field] !== undefined ? record[col.field] : '' - return (<td className="editing_table_cell"> + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <CusSwitch config={col} defaultValue={_value} autoFocus={true} onChange={this.onSwitchChange} onBlur={this.switchBlur}/> </td>) } else { let _value = record[col.field] !== undefined ? record[col.field] : '' - return (<td className="editing_table_cell"> + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <Select showSearch defaultValue={_value} @@ -465,7 +465,7 @@ </td>) } } else { - return (<td className={className + ' pointer'} style={style}> + return (<td onClick={(e) => e.stopPropagation()} className={className + ' pointer'} style={style}> <div className="mk-mask" id={col.uuid + record.$$uuid} onClick={this.focus}></div>{content} </td>) } @@ -536,11 +536,11 @@ if (col.noValue === 'hide' && value === 0) { val = '' } - return (<td className="editing_table_cell"> + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <InputNumber className={err ? 'has-error' : ''} precision={col.decimal || 0} title={err} id={col.uuid + record.$$uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> </td>) } else { - return (<td className={className + ' pointer'} style={style}> + return (<td onClick={(e) => e.stopPropagation()} className={className + ' pointer'} style={style}> <div className="mk-mask" id={col.uuid + record.$$uuid} onClick={this.focus}></div>{content} </td>) } @@ -840,6 +840,7 @@ if (!col) return (<td {...resProps} className={className} style={style}/>) let disabled = false + let editable = false if (col.ctrlField) { disabled = col.ctrlValue.includes(record[col.ctrlField]) } @@ -847,6 +848,7 @@ let children = null if (col.type === 'text') { if (col.editable === 'true' && !disabled) { + editable = true let _value = record[col.field] !== undefined ? record[col.field] : '' if (!col.editType || col.editType === 'text') { @@ -932,6 +934,7 @@ } } else if (col.type === 'number') { if (col.editable === 'true' && !disabled) { + editable = true let _value = record[col.field] !== undefined ? record[col.field] : '' if (col.noValue === 'hide' && _value === 0) { @@ -1105,6 +1108,10 @@ ) } + if (editable) { + return (<td onClick={(e) => e.stopPropagation()} className={'editing_all_table_cell ' + className} style={style}>{children}</td>) + } + return (<td className={'editing_all_table_cell ' + className} style={style}>{children}</td>) } } -- Gitblit v1.8.0