From 19cb1984b05ccd86245d139deadfbc10fb1405e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Mon, 28 Jun 2021 21:35:07 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E7=BB=86=E8=8A=82=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/query-table-actions/index.jsx | 35 +++++++++---- .../src/pages/business/house/member/index.jsx | 49 ++++++++++++------- .../src/views/main/_layout/header/user.jsx | 2 +- 3 files changed, 57 insertions(+), 29 deletions(-) diff --git a/web-react/src/components/query-table-actions/index.jsx b/web-react/src/components/query-table-actions/index.jsx index 7298fe5..d509d3f 100644 --- a/web-react/src/components/query-table-actions/index.jsx +++ b/web-react/src/components/query-table-actions/index.jsx @@ -5,24 +5,41 @@ function renderActions() { const { children } = this.props const actions = [] - Array.isArray(children) ? children - .filter(action => action) - .forEach((action, i) => { - actions.push(action) - if (i < this.props.children.length - 1) { - actions.push() - } - }) : (actions.push(children)) + Array.isArray(children) + ? children + .filter(action => action) + .forEach((action, i) => { + actions.push(action, ) + }) + : actions.push(children) return actions } export default class QueryTableActions extends Component { + componentDidMount() { + // 删除多余的间隔线 + const className = 'ant-divider ant-divider-vertical' + let series = false + for (const node of this.refs.inner.childNodes) { + if ( + (series && node.className == className) || + (!node.nextElementSibling && node.className == className) + ) { + node.remove() + series = false + } else if (node.className == className) { + series = true + } else { + series = false + } + } + } render() { return (
-
+
{renderActions.call(this)}
diff --git a/web-react/src/pages/business/house/member/index.jsx b/web-react/src/pages/business/house/member/index.jsx index e273110..26b6261 100644 --- a/web-react/src/pages/business/house/member/index.jsx +++ b/web-react/src/pages/business/house/member/index.jsx @@ -13,7 +13,16 @@ import { Switch, Tag, } from 'antd' -import { AntIcon, Auth, Container, Image, ModalForm, QueryList, QueryTreeLayout } from 'components' +import { + AntIcon, + Auth, + Container, + Image, + ModalForm, + QueryList, + QueryTableActions, + QueryTreeLayout, +} from 'components' import { api } from 'common/api' import { toCamelCase } from 'util/format' import { isEqual } from 'lodash' @@ -203,24 +212,26 @@ export default class index extends Component { - this.onOpen(this.editForm, id)}>编辑 - , - - this.onDelete(id)} - > - 删除 - - , - - this.onResetPassword(id)}>重置密码 - , - - this.onOpen(this.dataForm, id)}>授权额外数据 - , + + + this.onOpen(this.editForm, id)}>编辑 + + + this.onDelete(id)} + > + 删除 + + + + this.onResetPassword(id)}>重置密码 + + + this.onOpen(this.dataForm, id)}>授权额外数据 + + , ]} > ( - + {role.name} ))}