mirror of https://github.com/openspug/spug
F 修复账户所属角色某些情况下未正确展示的问题
parent
48a0348427
commit
4ba9e11674
|
@ -22,7 +22,12 @@ class ComTable extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
store.fetchRecords()
|
if (rStore.records.length === 0) {
|
||||||
|
rStore.fetchRecords()
|
||||||
|
.then(() => store.fetchRecords())
|
||||||
|
} else {
|
||||||
|
store.fetchRecords()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
columns = [{
|
columns = [{
|
||||||
|
|
|
@ -10,15 +10,8 @@ import { SearchForm, AuthDiv, Breadcrumb } from 'components';
|
||||||
import ComTable from './Table';
|
import ComTable from './Table';
|
||||||
import ComForm from './Form';
|
import ComForm from './Form';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import rStore from '../role/store';
|
|
||||||
|
|
||||||
export default observer(function () {
|
export default observer(function () {
|
||||||
useEffect(() => {
|
|
||||||
if (rStore.records.length === 0) {
|
|
||||||
rStore.fetchRecords()
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthDiv auth="system.account.view">
|
<AuthDiv auth="system.account.view">
|
||||||
<Breadcrumb>
|
<Breadcrumb>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import http from 'libs/http';
|
||||||
class Store {
|
class Store {
|
||||||
@observable records = [];
|
@observable records = [];
|
||||||
@observable record = {};
|
@observable record = {};
|
||||||
@observable isFetching = false;
|
@observable isFetching = true;
|
||||||
@observable formVisible = false;
|
@observable formVisible = false;
|
||||||
|
|
||||||
@observable f_name;
|
@observable f_name;
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Store {
|
||||||
|
|
||||||
fetchRecords = () => {
|
fetchRecords = () => {
|
||||||
this.isFetching = true;
|
this.isFetching = true;
|
||||||
http.get('/api/account/role/')
|
return http.get('/api/account/role/')
|
||||||
.then(res => this.records = res)
|
.then(res => this.records = res)
|
||||||
.finally(() => this.isFetching = false)
|
.finally(() => this.isFetching = false)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue