perf: 历史记录: 修改参数

dev/supplier-email-drawer
Lei OT 9 months ago
parent 151a220dee
commit 1cb938fd0d

@ -205,7 +205,7 @@ export const fetchConversationsSearch = async (params) => {
opi_sn: ele.OPI_SN || ele.opi_sn || 0,
OPI_Name: `${ele.OPI_Name || ele.opi_name || ''}`.trim(),
opi_name: `${ele.OPI_Name || ele.opi_name || ''}`.trim(),
dateText: dayjs((ele.lasttime || ele.lasttime)).format('MM-DD HH:mm'),
dateText: dayjs((ele.lasttime)).format('MM-DD HH:mm'),
matchMsgList: parseRenderMessageList((ele.msglist_AsJOSN || [])), // .reverse()),
coli_id: '',
}));
@ -218,14 +218,15 @@ export const fetchConversationsSearch = async (params) => {
*/
export const fetchMessagesHistory = async (params) => {
const defaultParams = {
opisn: '',
whatsappid: '',
// opisn: '',
// whatsappid: '',
conversationid: '',
lasttime: '2024-01-01T00:00:00',
pagesize: MESSAGE_PAGE_SIZE,
pagedir: 'next',
};
const _params = pick(params, Object.keys(defaultParams));
if (isEmpty(_params.whatsappid)) {
if (isEmpty(_params.conversationid)) {
return [];
}
const { errcode, result } = await fetchJSON(`${API_HOST}/get_item_messages`, {...defaultParams, ..._params});

@ -28,6 +28,6 @@ export const useFormStore = create(
setOrderFollowForm: (orderFollowForm) => set({ orderFollowForm }),
orderFollowAdvanceChecked: false,
setOrderFollowAdvanceChecked: (orderFollowAdvanceChecked) => set({ orderFollowAdvanceChecked }),
}))
}), { name: 'form-store' })
);
export default useFormStore;

@ -8,7 +8,7 @@ import { isEmpty, stringToColour, groupBy, isNotEmpty } from '@/utils/commons';
import { useShallow } from 'zustand/react/shallow';
import MergeConversationTo from './MergeConversationTo';
const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 100;
const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 20;
const MessagesList = ({ ...props }) => {
const { message: appMessage } = App.useApp();
@ -64,7 +64,8 @@ const MessagesList = ({ ...props }) => {
if (isEmpty(selectedConversation.conversationid)) {
return () => {};
}
const firstActionPageParams = { opisn: (selectedConversation.opi_sn || 0), whatsappid: selectedConversation.whatsapp_phone_number, loadNextPage: true };
// opisn: (selectedConversation.opi_sn || 0), whatsappid: selectedConversation.whatsapp_phone_number,
const firstActionPageParams = { conversationid: selectedConversation.conversationid , loadNextPage: true };
// if (isEmpty(selectedConversation.matchMsgList)) {
if (!isEmpty(formValues?.from_date)) {
firstActionPageParams.lasttime = formValues.from_date;

Loading…
Cancel
Save