Commit bec1f713 authored by Sixiang_Zzb's avatar Sixiang_Zzb

用户管理模块搜索bug修复

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