From f9180a3ab8813c3937c7ba30750763cd693d1d37 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 05 十月 2021 12:06:36 +0800 Subject: [PATCH] 2021-10-05 --- src/components/normalform/modalform/mkInput/index.jsx | 2 src/tabviews/zshare/mutilform/mkInput/index.scss | 30 ++------- src/tabviews/zshare/mutilform/mkNumberInput/index.scss | 27 --------- src/tabviews/zshare/mutilform/mkInput/index.jsx | 5 + src/tabviews/zshare/mutilform/mkNumberInput/index.jsx | 2 src/components/normalform/modalform/mkNumberInput/index.jsx | 2 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 5 + src/components/normalform/modalform/mkInput/index.scss | 27 --------- src/components/normalform/modalform/mkNumberInput/index.scss | 27 --------- src/menu/components/table/edit-table/columns/index.jsx | 43 ++----------- 10 files changed, 26 insertions(+), 144 deletions(-) diff --git a/src/components/normalform/modalform/mkInput/index.jsx b/src/components/normalform/modalform/mkInput/index.jsx index 74165f9..393832f 100644 --- a/src/components/normalform/modalform/mkInput/index.jsx +++ b/src/components/normalform/modalform/mkInput/index.jsx @@ -4,7 +4,7 @@ import MKEmitter from '@/utils/events.js' -import './index.scss' +// import './index.scss' /** * @description 鑷畾涔夋枃鏈緭鍏� diff --git a/src/components/normalform/modalform/mkInput/index.scss b/src/components/normalform/modalform/mkInput/index.scss index 93dcc24..e69de29 100644 --- a/src/components/normalform/modalform/mkInput/index.scss +++ b/src/components/normalform/modalform/mkInput/index.scss @@ -1,27 +0,0 @@ -.am-list-item.am-input-item { - .am-input-control { - height: 100%; - input { - height: 100%; - } - } - .am-input-label { - width: 28%; - max-width: 120px; - text-overflow: ellipsis; - } - .am-input-extra { - max-height: 40px; - .anticon-scan { - font-size: 22px; - padding: 8px 5px; - } - } -} -.am-input-item.right { - .am-input-control { - input { - text-align: right; - } - } -} \ No newline at end of file diff --git a/src/components/normalform/modalform/mkNumberInput/index.jsx b/src/components/normalform/modalform/mkNumberInput/index.jsx index ae5e040..a5b9850 100644 --- a/src/components/normalform/modalform/mkNumberInput/index.jsx +++ b/src/components/normalform/modalform/mkNumberInput/index.jsx @@ -4,7 +4,7 @@ import MKEmitter from '@/utils/events.js' -import './index.scss' +// import './index.scss' class MKNumberInput extends Component { constructor(props) { diff --git a/src/components/normalform/modalform/mkNumberInput/index.scss b/src/components/normalform/modalform/mkNumberInput/index.scss index 93dcc24..e69de29 100644 --- a/src/components/normalform/modalform/mkNumberInput/index.scss +++ b/src/components/normalform/modalform/mkNumberInput/index.scss @@ -1,27 +0,0 @@ -.am-list-item.am-input-item { - .am-input-control { - height: 100%; - input { - height: 100%; - } - } - .am-input-label { - width: 28%; - max-width: 120px; - text-overflow: ellipsis; - } - .am-input-extra { - max-height: 40px; - .anticon-scan { - font-size: 22px; - padding: 8px 5px; - } - } -} -.am-input-item.right { - .am-input-control { - input { - text-align: right; - } - } -} \ No newline at end of file diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index 34d33ea..10a6f8c 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -43,6 +43,7 @@ this.setState({ visible: true, + editable: column.editable || 'false', type: column.type, formlist: formlist.map(item => { item.hidden = !_options.includes(item.key) @@ -108,6 +109,8 @@ } } else if (key === 'format' && value === 'percent') { this.props.form.setFieldsValue({postfix: '%'}) + } else if (key === 'editable') { + } } @@ -219,7 +222,7 @@ } ] })( - <Radio.Group> + <Radio.Group onChange={(e) => {this.typeChange(item.key, e.target.value)}}> { item.options.map(option => { return ( diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index 2acb634..05b9c7b 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -56,7 +56,7 @@ connectDropTarget(<th {...restProps} index={index} style={{ cursor: 'move', textAlign: align }} onDoubleClick={() => column && this.props.editColumn(column)}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - {column && ['custom', 'colspan', 'action'].includes(column.type) ? + {column && ['custom', 'action'].includes(column.type) ? <Icon className="plus" title="娣诲姞" type="plus" onClick={() => this.props.addElement(column)} /> : null } <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.props.editColumn(column)} /> @@ -74,7 +74,7 @@ <th {...restProps} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - {column && ['custom', 'colspan'].includes(column.type) ? + {column && ['custom'].includes(column.type) ? <Icon className="plus" title="娣诲姞" type="plus" onClick={() => this.props.addElement(column)} /> : null } <Icon className="edit" title="缂栬緫" type="edit" onClick={() => this.props.editColumn(column)} /> @@ -257,21 +257,14 @@ }) } - loopCol = (columns, col) => { - return columns.map(column => { - if (column.type === 'colspan') { - column.subcols = this.loopCol(column.subcols, col) - } + updateCol = (col, btn) => { + let _columns = fromJS(this.state.columns).toJS() + _columns = _columns.map(column => { if (column.uuid === col.uuid) { return col } return column }) - } - - updateCol = (col, btn) => { - let _columns = fromJS(this.state.columns).toJS() - _columns = this.loopCol(_columns, col) this.setState({ columns: _columns, @@ -295,16 +288,7 @@ const { config } = this.props let column = fromJS(col).toJS() - if (column.type === 'colspan') { - column.subcols = column.subcols || [] - let subcol = { isSub: true, focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' } - column.subcols.push(subcol) - - this.setState({ - card: subcol - }) - this.updateCol(column) - } else if (column.type === 'custom') { + if (column.type === 'custom') { let newcard = {uuid: Utils.getuuid(), focus: true, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌 @@ -336,9 +320,7 @@ col.isSub = card.isSub === true col.marks = card.marks || [] - if (col.type === 'colspan') { - col.subcols = card.subcols || [] - } else if (col.type === 'custom') { + if (col.type === 'custom') { col.elements = card.type === 'custom' ? (card.elements || []) : [] } else if (col.type === 'action') { col.elements = card.type === 'action' ? (card.elements || []) : [] @@ -376,20 +358,11 @@ this.setState({card: null}) } - loopDelCol = (columns, col) => { - return columns.filter(column => { - if (column.type === 'colspan') { - column.subcols = this.loopDelCol(column.subcols, col) - } - return column.uuid !== col.uuid - }) - } - deleteCol = (col) => { const { appType } = this.state let _columns = fromJS(this.state.columns).toJS() - _columns = this.loopDelCol(_columns, col) + _columns = _columns.filter(column => column.uuid !== col.uuid) this.setState({ columns: _columns diff --git a/src/tabviews/zshare/mutilform/mkInput/index.jsx b/src/tabviews/zshare/mutilform/mkInput/index.jsx index 41d6a49..fd313ea 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.jsx +++ b/src/tabviews/zshare/mutilform/mkInput/index.jsx @@ -53,6 +53,9 @@ if (!/\n/ig.test(val)) { this.props.onChange(val) this.setState({value: val}) + if (!val) { + this.inputRef.current.focus() + } } else { val = val.replace(/\n/ig, '') @@ -79,7 +82,7 @@ const { config } = this.props const { value } = this.state - return <Input ref={this.inputRef} placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> + return <Input ref={this.inputRef} className="mk-form-input" allowClear placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> } } diff --git a/src/tabviews/zshare/mutilform/mkInput/index.scss b/src/tabviews/zshare/mutilform/mkInput/index.scss index 93dcc24..21a1344 100644 --- a/src/tabviews/zshare/mutilform/mkInput/index.scss +++ b/src/tabviews/zshare/mutilform/mkInput/index.scss @@ -1,27 +1,11 @@ -.am-list-item.am-input-item { - .am-input-control { - height: 100%; - input { - height: 100%; - } - } - .am-input-label { - width: 28%; - max-width: 120px; - text-overflow: ellipsis; - } - .am-input-extra { - max-height: 40px; - .anticon-scan { - font-size: 22px; - padding: 8px 5px; - } +.mk-form-input { + .ant-input-suffix { + opacity: 0; + transition: opacity 0.3s; } } -.am-input-item.right { - .am-input-control { - input { - text-align: right; - } +.mk-form-input:hover { + .ant-input-suffix { + opacity: 1; } } \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/mkNumberInput/index.jsx b/src/tabviews/zshare/mutilform/mkNumberInput/index.jsx index 8002ecd..4b690c8 100644 --- a/src/tabviews/zshare/mutilform/mkNumberInput/index.jsx +++ b/src/tabviews/zshare/mutilform/mkNumberInput/index.jsx @@ -4,7 +4,7 @@ import MKEmitter from '@/utils/events.js' -import './index.scss' +// import './index.scss' class MKNumberInput extends Component { constructor(props) { diff --git a/src/tabviews/zshare/mutilform/mkNumberInput/index.scss b/src/tabviews/zshare/mutilform/mkNumberInput/index.scss index 93dcc24..e69de29 100644 --- a/src/tabviews/zshare/mutilform/mkNumberInput/index.scss +++ b/src/tabviews/zshare/mutilform/mkNumberInput/index.scss @@ -1,27 +0,0 @@ -.am-list-item.am-input-item { - .am-input-control { - height: 100%; - input { - height: 100%; - } - } - .am-input-label { - width: 28%; - max-width: 120px; - text-overflow: ellipsis; - } - .am-input-extra { - max-height: 40px; - .anticon-scan { - font-size: 22px; - padding: 8px 5px; - } - } -} -.am-input-item.right { - .am-input-control { - input { - text-align: right; - } - } -} \ No newline at end of file -- Gitblit v1.8.0