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 = {
...readyData,
...location.query,
};
} else {
// 重置数据 // 重置数据
readyData = { readyData = {
pageNum: 1, pageNum: 1,
owerName: '', owerName: '',
communityArray: [], communityArray: [],
}; };
if (location.query) {
readyData = {
...readyData,
...location.query,
};
} }
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,6 +160,12 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -160,6 +160,12 @@ const ServiceProviderManagement = (props: propsType) => {
// 监听路由url // 监听路由url
useEffect(() => { useEffect(() => {
if (JSON.stringify(location.query) !== '{}') {
readyData = {
...readyData,
...location.query,
};
} else {
// 重置数据 // 重置数据
readyData = { readyData = {
pageNum: 1, pageNum: 1,
...@@ -167,13 +173,8 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -167,13 +173,8 @@ const ServiceProviderManagement = (props: propsType) => {
serviceScope: '', serviceScope: '',
providerName: '', providerName: '',
}; };
if (location.query) {
readyData = {
...readyData,
...location.query,
};
} }
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