优化体验: 缓存表单数据
parent
d5f32690a4
commit
b7af5b1cd3
@ -1,16 +1,25 @@
|
||||
import { create } from 'zustand';
|
||||
import { RealTimeAPI } from '@/lib/realTimeAPI';
|
||||
import { olog, isEmpty } from '@/utils/utils';
|
||||
import { receivedMsgTypeMapped, handleNotification } from '@/lib/msgUtils';
|
||||
import { fetchConversationsList, fetchTemplates, fetchMessages } from '@/actions/ConversationActions';
|
||||
import { devtools } from 'zustand/middleware';
|
||||
import { WS_URL } from '@/config';
|
||||
|
||||
export const useFormStore = create(devtools((set, get) => ({
|
||||
// 历史记录页面
|
||||
chatHistoryForm: {},
|
||||
setChatHistoryForm: (chatHistoryForm) => set({ chatHistoryForm, chatHistorySelectChat: {} }),
|
||||
chatHistorySelectChat: {},
|
||||
setChatHistorySelectChat: (chatHistorySelectChat) => set({ chatHistorySelectChat }),
|
||||
})));
|
||||
export const useFormStore = create(
|
||||
devtools((set, get) => ({
|
||||
// 历史记录页面
|
||||
chatHistoryForm: {},
|
||||
setChatHistoryForm: (chatHistoryForm) => set({ chatHistoryForm, chatHistorySelectChat: {} }),
|
||||
chatHistorySelectChat: {},
|
||||
setChatHistorySelectChat: (chatHistorySelectChat) => set({ chatHistorySelectChat }),
|
||||
|
||||
// 订单跟踪页面
|
||||
orderFollowForm: {
|
||||
type: 'today',
|
||||
orderStatus: '新状态',
|
||||
orderNumber: '订单号',
|
||||
orderLabel: '订单标签',
|
||||
startDate: '走团时间',
|
||||
},
|
||||
setOrderFollowForm: (orderFollowForm) => set({ orderFollowForm }),
|
||||
orderFollowAdvanceChecked: false,
|
||||
setOrderFollowAdvanceChecked: (orderFollowAdvanceChecked) => set({ orderFollowAdvanceChecked }),
|
||||
}))
|
||||
);
|
||||
export default useFormStore;
|
||||
|
Loading…
Reference in New Issue