style: 历史记录; 即时聊天页的点击滚动
fix: 从订单进入后没有置顶和选中 优化体验: 缓存表单数据: 订单跟踪-高级查询 emoji font fix:发送引用的消息返回状态时没有原文 获取消息记录 历史记录: 搜索顾问dev/mobile
parent
c73cec8bbc
commit
39f7a35e3d
@ -1,3 +1,10 @@
|
||||
import { fetchJSON } from '@/utils/request';
|
||||
import { API_HOST } from '@/config';
|
||||
|
||||
/**
|
||||
* 顾问列表
|
||||
*/
|
||||
export const fetchSalesAgent = async (q) => {
|
||||
const { errcode, result } = await fetchJSON(`https://p9axztuwd7x8a7.mycht.cn/service-Analyse2/GetOperatorInfo`, { q });
|
||||
return errcode !== 0 ? [] : result.map((ele) => ({ ...ele, label: ele.cn_name, value: ele.op_id }));
|
||||
};
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,46 @@
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
import { Select, Spin } from 'antd';
|
||||
import { debounce } from '@/utils/utils';
|
||||
|
||||
function DebounceSelect({ fetchOptions, debounceTimeout = 800, ...props }) {
|
||||
const [fetching, setFetching] = useState(false);
|
||||
const [options, setOptions] = useState([]);
|
||||
const fetchRef = useRef(0);
|
||||
const debounceFetcher = useMemo(() => {
|
||||
const loadOptions = (value) => {
|
||||
fetchRef.current += 1;
|
||||
const fetchId = fetchRef.current;
|
||||
setOptions([]);
|
||||
setFetching(true);
|
||||
fetchOptions(value).then((newOptions) => {
|
||||
if (fetchId !== fetchRef.current) {
|
||||
// for fetch callback order
|
||||
return;
|
||||
}
|
||||
setOptions(newOptions);
|
||||
setFetching(false);
|
||||
});
|
||||
};
|
||||
return debounce(loadOptions, debounceTimeout);
|
||||
}, [fetchOptions, debounceTimeout]);
|
||||
return (
|
||||
<Select
|
||||
labelInValue
|
||||
filterOption={false}
|
||||
showSearch
|
||||
allowClear
|
||||
{...props}
|
||||
onSearch={debounceFetcher}
|
||||
notFoundContent={fetching ? <Spin size='small' /> : null}
|
||||
optionFilterProp='label'
|
||||
>
|
||||
{options.map((d) => (
|
||||
<Select.Option key={d.value} title={d.label}>
|
||||
{d.label}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
||||
export default DebounceSelect;
|
@ -1,13 +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) => ({
|
||||
chatHistory: {},
|
||||
setChatHistory: (chatHistory) => set({ chatHistory }),
|
||||
})));
|
||||
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