2025-08-20 10:16:59 +08:00
|
|
|
|
<script lang="tsx">
|
2025-08-19 18:01:30 +08:00
|
|
|
|
import HistoryConversationDrawer from './components/history-conversation-drawer';
|
|
|
|
|
|
import { Sender } from 'ant-design-x-vue';
|
|
|
|
|
|
import { message } from 'ant-design-vue';
|
2025-08-20 10:16:59 +08:00
|
|
|
|
import ExpandableTags from '@/components/expandable-tags';
|
2025-08-19 18:01:30 +08:00
|
|
|
|
|
|
|
|
|
|
import { useSharedDataStore } from '@/stores/modules/share-data';
|
|
|
|
|
|
|
2025-08-14 14:46:51 +08:00
|
|
|
|
export default {
|
2025-08-16 17:01:06 +08:00
|
|
|
|
setup(props, { emit, expose }) {
|
2025-08-19 18:01:30 +08:00
|
|
|
|
const historyConversationDrawerRef = ref(null);
|
2025-08-20 11:30:15 +08:00
|
|
|
|
const senderRef = ref(null);
|
2025-08-19 18:01:30 +08:00
|
|
|
|
const searchValue = ref('');
|
|
|
|
|
|
const sharedDataStore = useSharedDataStore();
|
|
|
|
|
|
|
|
|
|
|
|
const handleSubmit = () => {
|
|
|
|
|
|
handleSearch();
|
|
|
|
|
|
searchValue.value = '';
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
2025-08-20 10:16:59 +08:00
|
|
|
|
message.info('handleSearch----' + searchValue.value);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const tagList = [
|
|
|
|
|
|
'人工智能',
|
|
|
|
|
|
'人工智能与应用',
|
|
|
|
|
|
'行业分析与市场数据',
|
|
|
|
|
|
'标签标签标签标签标签标签标签',
|
|
|
|
|
|
'标签标签标签标签标签标签标签',
|
|
|
|
|
|
'标签标签标签标签标签标签标签',
|
|
|
|
|
|
'标签标签标签标签标签标签标签',
|
|
|
|
|
|
'标签A',
|
|
|
|
|
|
'啊啊啊',
|
|
|
|
|
|
'宝宝贝贝',
|
|
|
|
|
|
'微信',
|
|
|
|
|
|
'吧啊啊',
|
|
|
|
|
|
'哦哦哦哦哦哦哦哦',
|
|
|
|
|
|
'人工智能',
|
|
|
|
|
|
'人工智能与应用',
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const handleTagClick = (tag: string) => {
|
|
|
|
|
|
searchValue.value = tag;
|
|
|
|
|
|
handleSearch();
|
2025-08-20 11:30:15 +08:00
|
|
|
|
senderRef.value?.focus();
|
2025-08-19 18:01:30 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
const params = sharedDataStore.routeParams;
|
|
|
|
|
|
if (params) {
|
|
|
|
|
|
searchValue.value = params.keyWord;
|
|
|
|
|
|
sharedDataStore.clearRouteParams();
|
|
|
|
|
|
|
2025-08-20 11:30:15 +08:00
|
|
|
|
handleSearch();
|
|
|
|
|
|
senderRef.value?.focus();
|
2025-08-19 18:01:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return () => (
|
|
|
|
|
|
<div class="home-wrap rounded-12px w-full h-full">
|
|
|
|
|
|
<div class="w-full h-full flex justify-center ">
|
|
|
|
|
|
<div class="main-chat-wrap w-600px pt-120px">
|
|
|
|
|
|
<p class="title mb-16px">
|
|
|
|
|
|
<span>营小智,7x24小时</span>
|
|
|
|
|
|
<span class="s1">AI营销</span>
|
|
|
|
|
|
<span>团队</span>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<p class="cts text-center mb-104px">AI 辅助账号托管账号 | 自动生成爆款内容 | 定时任务发布</p>
|
|
|
|
|
|
<Sender
|
|
|
|
|
|
v-model:value={searchValue.value}
|
2025-08-20 11:30:15 +08:00
|
|
|
|
ref={senderRef}
|
2025-08-19 18:01:30 +08:00
|
|
|
|
onSubmit={handleSubmit}
|
|
|
|
|
|
class="h-120px w-full mb-24px"
|
|
|
|
|
|
placeholder="随时告诉我你想做什么,比如查数据、发任务、写内容,我会立刻帮你完成。"
|
|
|
|
|
|
actions={() => (
|
|
|
|
|
|
<div
|
|
|
|
|
|
onClick={handleSubmit}
|
|
|
|
|
|
class={`submit-btn w-32px h-32px p-6px flex justify-center items-center rounded-50% cursor-pointer ${
|
|
|
|
|
|
!searchValue.value ? 'opacity-50' : ''
|
|
|
|
|
|
}`}
|
|
|
|
|
|
>
|
|
|
|
|
|
<icon-arrow-right size={20} class="color-#FFFFFF" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
)}
|
|
|
|
|
|
/>
|
2025-08-20 10:16:59 +08:00
|
|
|
|
<p class="cts mb-6px">可以试试这样下发任务:</p>
|
|
|
|
|
|
<ExpandableTags tags={tagList} clickable onTagClick={handleTagClick} />
|
2025-08-19 18:01:30 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/**历史对话入口 */}
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="history-conversation-btn cursor-pointer bg-#fff flex flex-col justify-center w-28px px-10px py-8px"
|
|
|
|
|
|
onClick={() => historyConversationDrawerRef.value.showDrawer()}
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="s1">历史对话</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<HistoryConversationDrawer ref={historyConversationDrawerRef} />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
2025-08-16 17:01:06 +08:00
|
|
|
|
},
|
|
|
|
|
|
};
|
2025-08-14 14:46:51 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
@import './style.scss';
|
2025-08-16 17:01:06 +08:00
|
|
|
|
</style>
|