diff --git a/src/actions/ConversationActions.js b/src/actions/ConversationActions.js index d278abe..1d0bec5 100644 --- a/src/actions/ConversationActions.js +++ b/src/actions/ConversationActions.js @@ -12,9 +12,9 @@ import dayjs from 'dayjs'; export const fetchTemplates = async (params) => { const data = await fetchJSON(`${API_HOST}/listtemplates`, params); const canUseTemplates = (data?.result?.items || []) - .filter((_t) => _t.status === 'APPROVED') + .filter((_t) => _t.status === 'APPROVED' && _t.name !== 'say_hello_from_trip_advisor') .map((ele) => ({ ...ele, components_origin: ele.components, components: groupBy(ele.components, (_c) => _c.type.toLowerCase()) })); - const topName = ['free_style_7', 'say_hello_from_trip_advisor', 'free_style_2', 'free_style_1', 'free_style_3', 'free_style_4']; + const topName = ['free_style_7', 'online_inquiry_received','say_hello_again', 'first_message_for_not_reply', 'free_style_2', 'free_style_1', 'free_style_3', 'free_style_4']; const top = sortArrayByOrder( canUseTemplates.filter((_t) => topName.includes(_t.name)), 'name', topName); const raw = canUseTemplates.filter((_t) => !topName.includes(_t.name)); return [...top, ...raw]; diff --git a/src/views/Conversations/Online/Input/Template.jsx b/src/views/Conversations/Online/Input/Template.jsx index 60f9551..5ff08dd 100644 --- a/src/views/Conversations/Online/Input/Template.jsx +++ b/src/views/Conversations/Online/Input/Template.jsx @@ -1,5 +1,5 @@ import { useState, useRef, useEffect, memo, useMemo, useCallback } from 'react'; -import { App, Popover, Flex, Button, List, Input, Tabs, Tag, Alert } from 'antd'; +import { App, Popover, Flex, Button, List, Input, Tabs, Tag, Alert, Divider } from 'antd'; import { MessageOutlined, SendOutlined } from '@ant-design/icons'; import useAuthStore from '@/stores/AuthStore'; import useConversationStore from '@/stores/ConversationStore'; @@ -26,6 +26,7 @@ const splitTemplate = (template) => { // UTILITY // MARKETING const templateCaterogyText = { 'UTILITY': '跟进', 'MARKETING': '营销' } +const templateCaterogyTipText = { 'UTILITY': '触达率高', 'MARKETING': '' } const CategoryList = ({ dataSource, handleSendTemplate, valueMapped, onInput, activeInput }) => { const currentConversation = useConversationStore((state) => state.currentConversation); @@ -115,7 +116,10 @@ const CategoryList = ({ dataSource, handleSendTemplate, valueMapped, onInput, ac className=' ' title={ - {item.components.header?.[0]?.text || item.name}{item.language.toUpperCase()}{templateCaterogyText[item.category]} + {item.components.header?.[0]?.text || item.name}{item.language.toUpperCase()} + {/* {templateCaterogyText[item.category]} */} + {templateCaterogyTipText[item.category] && {templateCaterogyTipText[item.category]}} + @@ -248,9 +252,25 @@ const InputTemplate = ({ disabled = false, invokeSendMessage }) => { fresh forceRender destroyTooltipOnHide={true} + title={ +
+ { + setSearchContent(e.target.value); + handleSearchTemplates(e.target.value); + }} + placeholder='搜索名称' + /> + +
+ } content={ <> -
+ {/*
{ placeholder='搜索名称' /> -
+
*/} {isEmpty(dataSource) && isEmpty(searchContent) ? ( }, - { key: 'utility', label: '持续跟进', children: }, + // { key: 'marketing', label: '首次问候', children: }, + // { key: 'utility', label: '再次沟通', children: }, ...(Object.keys(templateLangMapped).map(lang => ({ key: lang, label: lang.toUpperCase(), children: }))) - ]} defaultActiveKey='utility' tabBarExtraContent={{right: }} size='small' /> + ]} defaultActiveKey='utility' tabBarExtraContent={{right: , }} size='small' /> ) : ( // Search result