|
|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<a-dropdown trigger="hover" :defaultValue="btn_label_str">
|
|
|
- <a-button v-if="api_status === 1" class="history-type-btn" type="text">{{ btn_label_str }}</a-button>
|
|
|
+ <a-button v-if="api_status === 1" class="history-type-btn" type="text">
|
|
|
+ <img :src="btn_label_icon" class="agent-icon-img" />
|
|
|
+
|
|
|
+ <span class="label-text">{{ btn_label_str }}</span>
|
|
|
+
|
|
|
+ <span class="nav-item-icon arrow-down"><img src="../../assets/arrow-down.png" /></span>
|
|
|
+ </a-button>
|
|
|
<a-button v-if="api_status === 2" class="history-type-btn" type="text"><a-spin :size="16" /></a-button>
|
|
|
<a-button v-if="api_status === 3" class="history-type-btn" type="text">{{ btn_label_str }}</a-button>
|
|
|
|
|
|
@@ -11,8 +17,12 @@
|
|
|
:disabled="disabled_options"
|
|
|
:value="item.name"
|
|
|
@click="handleChatTypeConfirm(item)"
|
|
|
- >{{ item.name }}</a-doption
|
|
|
>
|
|
|
+ <div class="dropdown-container">
|
|
|
+ <img :src="getIconIntelligent(item.icon)" class="agent-icon-img" />
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ </div>
|
|
|
+ </a-doption>
|
|
|
</template>
|
|
|
</a-dropdown>
|
|
|
</template>
|
|
|
@@ -23,6 +33,8 @@ import { ref, computed, onMounted } from 'vue';
|
|
|
import useAgentList4History from '../conversation-board/use-agent-list-4-history';
|
|
|
import { useRecentSearchTypeStore } from '../../base/store/use-recent-history-search-type';
|
|
|
|
|
|
+import { getIconIntelligent } from '../common/icon-map';
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
/**
|
|
|
* api状态
|
|
|
@@ -65,6 +77,14 @@ const btn_label_str = computed(() => {
|
|
|
return recentSearchType?.search_type?.name || '';
|
|
|
});
|
|
|
|
|
|
+const btn_label_icon = computed(() => {
|
|
|
+ if (recentSearchType.search_type && recentSearchType.search_type.icon) {
|
|
|
+ return getIconIntelligent(recentSearchType.search_type.icon);
|
|
|
+ }
|
|
|
+
|
|
|
+ return '';
|
|
|
+});
|
|
|
+
|
|
|
/**
|
|
|
* 是否禁用下拉菜单
|
|
|
* 当列表正在加载时,应该禁用下拉菜单
|
|
|
@@ -92,11 +112,36 @@ onMounted(() => {
|
|
|
.history-type-btn {
|
|
|
font-size: 16px;
|
|
|
|
|
|
- max-width: 100px;
|
|
|
+ max-width: 140px;
|
|
|
+
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.agent-icon-img {
|
|
|
+ width: 20px;
|
|
|
+ display: inline-block;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.label-text {
|
|
|
display: -webkit-box;
|
|
|
-webkit-box-orient: vertical;
|
|
|
-webkit-line-clamp: 1; /* 这里设置显示的行数 */
|
|
|
line-clamp: 1;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
+
|
|
|
+.dropdown-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.nav-item-icon.arrow-down {
|
|
|
+ margin-left: 2px;
|
|
|
+}
|
|
|
+
|
|
|
+.nav-item-icon.arrow-down img {
|
|
|
+ width: 14px;
|
|
|
+}
|
|
|
</style>
|