From ba7c54e0029456e6b1bf7f0e0d31af69a3d74db3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 02 三月 2020 15:34:51 +0800 Subject: [PATCH] 2020-03-02 --- src/templates/formtabconfig/index.jsx | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 3e2d38d..31b1c27 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -2111,6 +2111,26 @@ }) } + handleTabGroup = (index, type) => { + let config = JSON.parse(JSON.stringify(this.state.config)) + + if (type === 'up') { + config.tabgroups.splice(index, 0, config.tabgroups.splice(index - 1, 1)[0]) + } else { + config.tabgroups.splice(index, 0, config.tabgroups.splice(index + 1, 1)[0]) + } + + this.setState({ + config: config + }) + + notification.success({ + top: 92, + message: '璋冩暣鎴愬姛', + duration: 2 + }) + } + render () { const { config, modaltype } = this.state let _length = config.groups.length @@ -2286,6 +2306,10 @@ {index === 0 ? <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃爣绛鹃〉銆嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬爣绛鹃〉鎷栬嚦姝ゅ娣诲姞銆�"> <Icon type="question-circle" /> </Tooltip> : null} + {index !== (this.state.config.tabgroups.length - 1) ? + <Icon type="arrow-down" onClick={() => {this.handleTabGroup(index, 'down')}} /> : null + } + {index !== 0 ? <Icon type="arrow-up" onClick={() => {this.handleTabGroup(index, 'up')}} /> : null} {index === 0 ? <Icon type="plus" onClick={this.addTabGroup} /> : null} {index !== 0 ? <Icon type="delete" onClick={() => {this.delTabGroup(groupId)}} /> : null} <TabDragElement -- Gitblit v1.8.0