From 6ed4e1dc4b9575a22f74f57fbf90abe02b315de7 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十一月 2024 10:10:33 +0800 Subject: [PATCH] 2024-11-21 --- src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 2 +- src/tabviews/custom/components/card/cardcellList/index.jsx | 15 +++++++++++++-- src/menu/components/share/markcomponent/index.jsx | 9 +++++++-- src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 25 ++++++++++++++----------- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 2bee5ee..1c1b983 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -241,7 +241,7 @@ _style_ = {float: 'right'} } - let mark = ['text', 'number', 'slider', 'sequence', 'formula'].includes(card.eleType) + let mark = ['text', 'number', 'slider', 'sequence', 'formula', 'icon'].includes(card.eleType) if (parent.setting && parent.setting.cardRole === 'header') { mark = false } else if (card.eleType === 'formula' && card.eval === 'func') { diff --git a/src/menu/components/share/markcomponent/index.jsx b/src/menu/components/share/markcomponent/index.jsx index 160c1dd..4173b5b 100644 --- a/src/menu/components/share/markcomponent/index.jsx +++ b/src/menu/components/share/markcomponent/index.jsx @@ -112,7 +112,7 @@ options: [], render: text => { let sign = { - 'font': '鏂囧瓧', + 'font': '瀛椾綋棰滆壊', 'background': '鑳屾櫙', 'underline': '涓嬪垝绾�', 'line-through': '涓垝绾�', @@ -267,7 +267,7 @@ let signs = [ { value: 'font', - label: '鏂囧瓧' + label: '瀛椾綋棰滆壊' }, { value: 'background', @@ -324,6 +324,11 @@ signs.pop() signs.pop() signs.pop() + } else if (type === 'icon') { + signs = [{ + value: 'font', + label: '瀛椾綋棰滆壊' + }] } else if (type === 'slider') { markColumns = markColumns.filter(col => { col.width = '20%' diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 3a130e8..2924236 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -649,10 +649,21 @@ } } + let _style = {...card.style} + + if (card.marks) { + let _s = {} + getMark(card.marks, data, _s) + + if (_s.color) { + _style.color = _s.color + } + } + if (card.tipType === 'text') { contents.push( <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> - <div style={card.style}> + <div style={_style}> {val ? <Tooltip title={val}> <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight}}>{icon}</div> </Tooltip> : <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight}}>{icon}</div>} @@ -662,7 +673,7 @@ } else { contents.push( <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> - <div style={card.style}> + <div style={_style}> {val ? <Tooltip title={val}> <MkIcon className="ant-mk-icon" style={{height: card.innerHeight}} type={icon}/> </Tooltip> : <MkIcon className="ant-mk-icon" style={{height: card.innerHeight}} type={icon}/>} 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 87534fd..28d8931 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -20,7 +20,6 @@ class MkSwitch extends Component { static propTpyes = { - autoFocus: PropTypes.bool, defaultValue: PropTypes.any, config: PropTypes.object, onChange: PropTypes.func @@ -78,12 +77,10 @@ if (config.$ctrl) { MKEmitter.emit('colBlur' + config.tableId, lineId, config.uuid) } - - this.props.onBlur && this.props.onBlur() } render() { - const { config, autoFocus } = this.props + const { config } = this.props const { status } = this.state return ( @@ -91,7 +88,6 @@ ref={ref => this.node = ref} checkedChildren={config.openText} checked={status} - autoFocus={autoFocus} onFocus={this.onFocus} onBlur={this.onBlur} unCheckedChildren={config.closeText} @@ -820,16 +816,17 @@ } if (col.editable === 'true' && !disabled) { - if (editing) { + if (col.editType === 'switch') { + let _value = record[col.field] !== undefined ? record[col.field] : '' + return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> + <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} onChange={this.onColChange}/> + </td>) + } else if (editing) { let _value = record[col.field] !== undefined ? record[col.field] : '' if (!col.editType || col.editType === 'text') { return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> <MkInput config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/> - </td>) - } else if (col.editType === 'switch') { - return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> - <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={true} onChange={this.onColChange} onBlur={() => this.setState({editing: false})}/> </td>) } else if (col.editType === 'date') { return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell"> @@ -1099,7 +1096,7 @@ ) } else if (col.editType === 'switch') { children = ( - <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} autoFocus={false} onChange={this.onColChange}/> + <MkSwitch config={col} lineId={record.$$uuid} defaultValue={_value} onChange={this.onColChange}/> ) } else if (col.editType === 'date') { children = ( @@ -2140,6 +2137,12 @@ delete result.message delete result.status + this.props.columns.forEach(item => { + if (item.arr_field && result[item.arr_field]) { + result[item.uuid] = result[item.arr_field] + } + }) + this.resetFormList(result) }) } -- Gitblit v1.8.0