From 569ccb3c1ff82f30ffefa7d3700571448d742662 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 十二月 2020 11:46:28 +0800 Subject: [PATCH] 2020-12-03 --- src/menu/components/table/normal-table/index.jsx | 63 ++++++++----------------------- 1 files changed, 17 insertions(+), 46 deletions(-) diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index 8388216..d3831f8 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -18,8 +18,7 @@ const SearchComponent = asyncComponent(() => import('@/templates/sharecomponent/searchcomponent')) const ActionComponent = asyncComponent(() => import('@/menu/actioncomponent')) const ColumnComponent = asyncComponent(() => import('./columns')) -// const WrapComponent = asyncIconComponent(() => import('../data-card/wrapsetting')) -// const SearchComponent = asyncComponent(() => import('@/menu/searchcomponent')) +const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) const { confirm } = Modal @@ -64,32 +63,13 @@ name: card.name, subtype: card.subtype, setting: { interType: 'system' }, - wrap: { name: card.name, width: 24 }, + wrap: { name: card.name, width: 24, border: 'true', tableType: 'checkbox' }, style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' }, - headerStyle: { fontSize: '16px' }, columns: [], cols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: 'field1', Hide: 'false', type: 'text', Width: 120, subcols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label11', field: 'field11', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label12', field: 'field12', Hide: 'false', type: 'text', Width: 120 }, - ] }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: 'field2', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: 'field3', Hide: 'false', type: 'text', Width: 120, subcols: [ - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label31', field: 'field31', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label32', field: 'field32', Hide: 'false', type: 'text', Width: 120 }, - ] }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label4', field: 'field4', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label5', field: 'field5', Hide: 'false', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label6', field: 'field6', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label7', field: 'field7', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label8', field: 'field8', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label9', field: 'field9', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label10', field: 'field10', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label11', field: 'field11', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label12', field: 'field12', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label13', field: 'field13', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label14', field: 'field14', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, - { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label15', field: 'field15', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 } + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label2', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, + { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 }, ], scripts: [] } @@ -161,12 +141,6 @@ MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) } - changeTitleStyle = () => { - const { card } = this.state - - MKEmitter.emit('changeStyle', [card.uuid, 'header'], ['font', 'border'], card.headerStyle) - } - getStyle = (comIds, style) => { const { card } = this.state @@ -175,8 +149,6 @@ let _card = {} if (comIds.length === 1) { _card = {...card, style} - } else if (comIds.length === 2 && comIds[1] === 'header') { - _card = {...card, headerStyle: style} } else { return } @@ -204,18 +176,18 @@ this.props.updateConfig(card) } + addColumns = () => { + let card = fromJS(this.state.card).toJS() + + card.cols.push({ focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' }) + + this.setState({card}) + } + addSearch = () => { let card = fromJS(this.state.card).toJS() - let newcard = {} - newcard.uuid = Utils.getuuid() - newcard.focus = true - - newcard.label = 'label' - newcard.type = 'text' - newcard.match = '=' - - card.search.push(newcard) + card.search.push({uuid: Utils.getuuid(), focus: true, label: 'label', type: 'text', match: '='}) this.setState({card}) } @@ -261,9 +233,6 @@ setSubConfig = (btn) => { } - updateaction = (config) => { - - } render() { const { menu } = this.props @@ -273,9 +242,10 @@ <div className="menu-normal-table-edit-box" style={{...card.style, height: card.wrap.height}}> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> + <Icon className="plus" title="娣诲姞鍒�" onClick={this.addColumns} type="plus" /> {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎼滅储" onClick={this.addSearch} type="plus-circle" /> : null} {menu && menu.MenuType !== 'billPrint' ? <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> : null} - {/* {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} */} + {menu ? <WrapComponent config={card} MenuType={menu.MenuType} updateConfig={this.updateComponent} /> : null} <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> <SettingComponent config={card} updateConfig={this.updateComponent} /> @@ -287,6 +257,7 @@ <ActionComponent type="normaltable" config={card} + setSubConfig={this.setSubConfig} updateaction={this.updateComponent} /> <ColumnComponent config={card} updatecolumn={this.updateconfig}/> -- Gitblit v1.8.0