From 8aef701cff785fbc13da30067cd41b6214e56b11 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 24 十二月 2020 15:24:19 +0800 Subject: [PATCH] 2020-12-24 --- src/menu/components/table/normal-table/index.jsx | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx index a85b644..c83b4c4 100644 --- a/src/menu/components/table/normal-table/index.jsx +++ b/src/menu/components/table/normal-table/index.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' -import { Icon, Popover, Modal } from 'antd' +import { Icon, Popover, Modal, notification } from 'antd' import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' @@ -18,6 +18,7 @@ const SearchComponent = asyncComponent(() => import('@/templates/sharecomponent/searchcomponent')) const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) +const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent')) const ColumnComponent = asyncComponent(() => import('./columns')) const WrapComponent = asyncIconComponent(() => import('./wrapsetting')) @@ -281,6 +282,44 @@ this.props.updateConfig(card) } + handleLog = (type, logs, item) => { + let card = fromJS(this.state.card).toJS() + + if (type === 'revert') { + let done = false + if (item.$parentId) { + card.cols.forEach(col => { + if (col.type !== 'action') return + if (item.$parentId === col.uuid) { + col.elements = col.elements ? [...col.elements, item] : [item] + done = true + } + }) + } + + if (!done) { + card.action = card.action ? [...card.action, item] : [item] + } + + card.btnlog = logs + + this.setState({ card }) + notification.success({ + top: 92, + message: '鎭㈠鎴愬姛锛�', + duration: 2 + }) + } else { + card.btnlog = logs + this.setState({ card }) + notification.success({ + top: 92, + message: '娓呴櫎鎴愬姛锛�', + duration: 2 + }) + } + } + render() { const { card } = this.state @@ -294,6 +333,7 @@ <Icon className="plus" title="娣诲姞鎸夐挳" onClick={this.addButton} type="plus-square" /> <WrapComponent config={card} updateConfig={this.updateComponent} /> <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" /> + <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} /> <SettingComponent config={card} updateConfig={this.updateComponent} /> </div> -- Gitblit v1.8.0