可信代码库-可信开源代码库AI助手跳转按钮及历史列表按钮添加

This commit is contained in:
付民康
2025-05-08 15:04:31 +08:00
parent 59fe23153d
commit be3cc41e65
4 changed files with 57 additions and 3 deletions

View File

@@ -19,7 +19,7 @@
"format": "prettier --write src/"
},
"dependencies": {
"@devui-design/icons": "^1.3.0",
"@devui-design/icons": "^1.4.0",
"@matechat/core": "^1.4.0",
"@micro-zoe/micro-app": "1.0.0-rc.3",
"@sentry/vue": "^7.101.1",

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -14,6 +14,9 @@
<div class="flex-1 flex items-center justify-end" v-if="!isHome">
<Search class="g-toolbar-left-search" v-if="!isMobile" :key="$route.fullPath" />
</div>
<a v-if="!isHome" @click="gotoAI">
<img style="width: 98px;height: 32px;cursor: pointer" src="@/assets/imgs/jyh/ai/ai_zh.png" />
</a>
<div class="g-toolbar-right gap-[12px] flex-grow-0 flex-shrink-0">
<GLink
class="g-toolbar-right-link"
@@ -76,7 +79,7 @@
import { onBeforeUnmount, ref, watchEffect, computed } from 'vue';
import { useElementSize } from '@vueuse/core';
import { storeToRefs } from 'pinia';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { useAccountStore } from '@/stores/user';
import { emitEvent } from '@/utils/eventBus';
@@ -108,6 +111,11 @@ const handleLogin = (type) => {
emitEvent('login', { type, triggerType: '主动注册' });
};
const { isMobile } = usePageResize();
const router = useRouter();
const gotoAI = (row) => {
// 后续请换成params暂时params传参没传过去
router.push({ name: 'aihome' });
};
/* store 用户信息 */
/* @test 后面将清除 */

View File

@@ -62,7 +62,15 @@
<!-- 浮动工具栏移动端不显示 -->
<!-- <ToolsFloat v-if="showToolsFloat" />-->
<!-- d-layout 结束前添加返回按钮 -->
<div class="back-in-btn">
<div class="back-in-time-btn" @click="handleBackInTime">
<i class="icon icon-history" title="查看历史"></i>
</div>
<div class="back-in-time-btn" @click="handleBackInTime">
<i class="icon icon-operation-log" title="查看文档"></i>
</div>
</div>
</d-layout>
</template>
@@ -209,4 +217,42 @@ onUnmounted(() => {
}
}
.back-in-btn {
position: fixed;
left: 20px;
bottom: 20px;
display: flex;
gap: 12px;
.back-in-time-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
background-color: var(--el-color-primary);
//color: white;
border-radius: 20px;
cursor: pointer;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 999;
transition: all 0.3s;
font-size: 18px;
}
.back-in-time-btn:hover {
background-color: var(--el-color-primary-light-3);
transform: translateY(-2px);
}
/* 响应式调整 - 移动端隐藏或调整位置 */
@media (max-width: 768px) {
.back-in-time-btn {
left: 10px;
bottom: 10px;
padding: 6px 12px;
font-size: 14px;
}
}
}
</style>