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_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(),
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()), matchMsgList: parseRenderMessageList((ele.msglist_AsJOSN || [])), // .reverse()),
coli_id: '', coli_id: '',
})); }));
@ -218,14 +218,15 @@ export const fetchConversationsSearch = async (params) => {
*/ */
export const fetchMessagesHistory = async (params) => { export const fetchMessagesHistory = async (params) => {
const defaultParams = { const defaultParams = {
opisn: '', // opisn: '',
whatsappid: '', // whatsappid: '',
conversationid: '',
lasttime: '2024-01-01T00:00:00', lasttime: '2024-01-01T00:00:00',
pagesize: MESSAGE_PAGE_SIZE, pagesize: MESSAGE_PAGE_SIZE,
pagedir: 'next', pagedir: 'next',
}; };
const _params = pick(params, Object.keys(defaultParams)); const _params = pick(params, Object.keys(defaultParams));
if (isEmpty(_params.whatsappid)) { if (isEmpty(_params.conversationid)) {
return []; return [];
} }
const { errcode, result } = await fetchJSON(`${API_HOST}/get_item_messages`, {...defaultParams, ..._params}); const { errcode, result } = await fetchJSON(`${API_HOST}/get_item_messages`, {...defaultParams, ..._params});

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

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

Loading…
Cancel
Save