diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js
index 71de68a..ebaea7a 100644
--- a/src/stores/CustomerServices.js
+++ b/src/stores/CustomerServices.js
@@ -13,12 +13,13 @@ class CustomerServices {
this.startDateString = this.startDate.format(config.DATE_FORMAT);
this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59';
this.dateType = 'startDate';
+ this.inProgress = false;
this.selectedAgent = {VendorName: '请选择地接社'};
makeAutoObservable(this);
}
fetchAgentList() {
-
+ this.inProgress = true;
req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL?DateType=' + this.dateType + '&Date1=' + this.startDateString + '&Date2=' + this.endDateString + '&OldDate1=' + this.startDateString + '&OldDate2=' + this.endDateString)
.then(json => {
if (json.errcode === 0) {
@@ -119,10 +120,14 @@ class CustomerServices {
];
});
}
+ })
+ .then(() => {
+ this.inProgress = false;
});
}
fetchGroupListByAgentId(agentId) {
+ this.inProgress = true;
this.selectedAgent = {VendorName: '...'};
this.groupList = [];
this.groupListColumns = [];
@@ -225,6 +230,9 @@ class CustomerServices {
];
});
}
+ })
+ .then(() => {
+ this.inProgress = false;
});
}
@@ -250,6 +258,7 @@ class CustomerServices {
endDateString;
dateType;
selectedAgent;
+ inProgress;
groupList = [];
diff --git a/src/views/AgentList.js b/src/views/AgentList.js
index 7593c91..70d26da 100644
--- a/src/views/AgentList.js
+++ b/src/views/AgentList.js
@@ -12,10 +12,10 @@ import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
const AgentList = () => {
- const { customerServicesStore } = useContext(stores_Context);
+ const {customerServicesStore} = useContext(stores_Context);
const agentList = customerServicesStore.agentList;
const agentListColumns = customerServicesStore.agentListColumns;
- const { startDate, endDate, dateType } = customerServicesStore;
+ const {startDate, endDate, dateType, inProgress} = customerServicesStore;
const handleSearchClick = () => {
customerServicesStore.fetchAgentList();
@@ -57,7 +57,7 @@ const AgentList = () => {
}
- loading={false}
+ loading={inProgress}
onClick={() => {
handleSearchClick();
}}>
@@ -73,7 +73,7 @@ const AgentList = () => {
columns={agentListColumns}
size="small"
rowKey={(record) => record.key}
- loading={false}
+ loading={inProgress}
pagination={false}
scroll={{ x: "100%" }}
/>
diff --git a/src/views/GroupList.js b/src/views/GroupList.js
index 695dd3e..beaf307 100644
--- a/src/views/GroupList.js
+++ b/src/views/GroupList.js
@@ -22,7 +22,7 @@ const GroupList = () => {
const groupList = customerServicesStore.groupList;
const groupListColumns = customerServicesStore.groupListColumns;
- const {startDate, endDate, dateType} = customerServicesStore;
+ const {startDate, endDate, dateType, inProgress} = customerServicesStore;
return (
<>
@@ -63,7 +63,7 @@ const GroupList = () => {
}
- loading={false}
+ loading={inProgress}
onClick={() => {
customerServicesStore.fetchGroupListByAgentId(agentId);
customerServicesStore.fetchAgentList();
@@ -75,7 +75,7 @@ const GroupList = () => {
{customerServicesStore.selectedAgent.VendorName}
- record.key} loading={false} pagination={false} scroll={{ x: "100%" }} />
+ record.key} loading={inProgress} pagination={false} scroll={{ x: "100%" }} />