diff --git a/spug_web/src/pages/system/role/RoleUsers.js b/spug_web/src/pages/system/role/RoleUsers.js new file mode 100644 index 0000000..952f023 --- /dev/null +++ b/spug_web/src/pages/system/role/RoleUsers.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) OpenSpug Organization. https://github.com/openspug/spug + * Copyright (c) + * Released under the AGPL-3.0 License. + */ +import React from 'react'; +import { observer } from 'mobx-react'; +import { Badge, Table } from 'antd'; +import uStore from '../account/store'; + + +export default observer(function (props) { + const users = uStore.records.filter(x => x.role_ids.includes(props.id)) + return ( + + + v ? : }/> + +
+ ) +}) \ No newline at end of file diff --git a/spug_web/src/pages/system/role/Table.js b/spug_web/src/pages/system/role/Table.js index d8682ae..07b6334 100644 --- a/spug_web/src/pages/system/role/Table.js +++ b/spug_web/src/pages/system/role/Table.js @@ -5,16 +5,22 @@ */ import React from 'react'; import { observer } from 'mobx-react'; -import { Modal, message } from 'antd'; +import { Modal, Popover, Button, message } from 'antd'; import { PlusOutlined } from '@ant-design/icons'; import { TableCard, AuthButton, Action } from 'components'; +import RoleUsers from './RoleUsers'; import http from 'libs/http'; import store from './store'; +import uStore from '../account/store'; +import styles from './index.module.css'; @observer class ComTable extends React.Component { componentDidMount() { store.fetchRecords() + if (uStore.records.length === 0) { + uStore.fetchRecords() + } } columns = [{ @@ -22,7 +28,11 @@ class ComTable extends React.Component { dataIndex: 'name', }, { title: '关联账户', - dataIndex: 'used', + render: info => info.used ? ( + }> + + + ) : }, { title: '描述信息', dataIndex: 'desc', @@ -58,7 +68,7 @@ class ComTable extends React.Component { render() { return (