Commit bec1f713 authored by Sixiang_Zzb's avatar Sixiang_Zzb

用户管理模块搜索bug修复

parent beed4fd8
......@@ -136,20 +136,37 @@ const Users = (props: any) => {
showUploadList: false,
};
// 请求拿取数据
const getList = (CommunityList1: []) => {
if (readyData.communityArray.length === 0) {
readyData.communityArray = CommunityList1;
}
setLoading(true);
// 获取数据
RA(
12,
{
...readyData,
},
module,
dispatch,
);
};
// 监听路由变化更新数据
useEffect(() => {
// 重置数据
readyData = {
pageNum: 1,
owerName: '',
communityArray: [],
};
if (location.query) {
if (JSON.stringify(location.query) !== '{}') {
readyData = {
...readyData,
...location.query,
};
} else {
// 重置数据
readyData = {
pageNum: 1,
owerName: '',
communityArray: [],
};
}
if (CommunityList && flag === false) {
......@@ -167,23 +184,6 @@ const Users = (props: any) => {
}
}, [CommunityList]);
// 请求拿取数据
const getList = (CommunityList: []) => {
if (readyData.communityArray.length === 0) {
readyData.communityArray = CommunityList;
}
setLoading(true);
// 获取数据
RA(
12,
{
...readyData,
},
module,
dispatch,
);
};
// 判断数据是否回来
useEffect(() => {
if (Data != null) {
......@@ -258,7 +258,7 @@ const Users = (props: any) => {
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToAdd}>
<button type="button" className={styles.buttonAdd2} onClick={goToAdd}>
Create New Owner
</button>
<div className={styles.buttonAdd}>
......
......@@ -160,20 +160,21 @@ const ServiceProviderManagement = (props: propsType) => {
// 监听路由url
useEffect(() => {
// 重置数据
readyData = {
pageNum: 1,
serviceCommunityList: [],
serviceScope: '',
providerName: '',
};
if (location.query) {
if (JSON.stringify(location.query) !== '{}') {
readyData = {
...readyData,
...location.query,
};
} else {
// 重置数据
readyData = {
pageNum: 1,
serviceCommunityList: [],
serviceScope: '',
providerName: '',
};
}
if (CommunityList && flag === false) {
flag = true;
setLoading(true);
......@@ -268,17 +269,17 @@ const ServiceProviderManagement = (props: propsType) => {
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToServices}>
<button type="button" className={styles.buttonAdd2} onClick={goToServices}>
Services Available
</button>
<button className={styles.buttonAdd} onClick={goToCreate}>
<button type="button" className={styles.buttonAdd} onClick={goToCreate}>
Create New
</button>
</div>
{/* 列表组件 */}
<Table
rowKey={'id'}
rowKey="id"
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment