|
|
@@ -344,48 +344,12 @@
|
|
|
|
|
|
<!-- 底栏:输入区(对话前垂直居中,发出第一条消息后回到底部) -->
|
|
|
<div class="composer" :class="{ 'composer--center': !messages.length }">
|
|
|
- <!-- 首登检查清单:当前会话无消息且尚未全部完成时展示(完成状态由服务端推导) -->
|
|
|
- <div v-if="showOnboarding" class="onboarding-card">
|
|
|
- <div class="onboarding-card__head">
|
|
|
- <div class="onboarding-card__heading">
|
|
|
- <span class="onboarding-card__title">开始使用数剑</span>
|
|
|
- <span class="onboarding-card__progress">
|
|
|
- 已完成 {{ onboarding?.doneCount }}/{{ onboarding?.requiredCount }} 项
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <Icon class="onboarding-card__close" icon="i-mdi:close" title="暂时隐藏" @click="dismissOnboarding" />
|
|
|
- </div>
|
|
|
- <div class="onboarding-card__list">
|
|
|
- <div
|
|
|
- v-for="item in onboarding?.items"
|
|
|
- :key="item.key"
|
|
|
- class="onboarding-item"
|
|
|
- :class="{ 'is-done': item.done }"
|
|
|
- role="button"
|
|
|
- tabindex="0"
|
|
|
- @click="handleOnboardingItem(item)"
|
|
|
- @keydown.enter.prevent="handleOnboardingItem(item)"
|
|
|
- >
|
|
|
- <Icon
|
|
|
- class="onboarding-item__status"
|
|
|
- :icon="item.done ? 'i-mdi:check-circle' : 'i-mdi:check-circle-outline'"
|
|
|
- />
|
|
|
- <div class="onboarding-item__body">
|
|
|
- <div class="onboarding-item__title">{{ item.title }}</div>
|
|
|
- <div class="onboarding-item__desc">{{ item.description }}</div>
|
|
|
- </div>
|
|
|
- <Icon v-if="!item.done" class="onboarding-item__arrow" icon="i-mdi:chevron-right" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="onboarding-card__links">
|
|
|
- <a-button type="link" size="small" @click="openOnboardingPage('/workbench/audit/health')">
|
|
|
- 运行平台健康自检
|
|
|
- </a-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<!-- 对话前欢迎区:输入框上方展示品牌标识与标题;发出第一条消息后移除 -->
|
|
|
<div v-if="!messages.length" class="composer__hero">
|
|
|
- <img class="composer__hero-logo" :src="logo" alt="数剑" />
|
|
|
+ <div class="composer__hero-logo" aria-hidden="true">
|
|
|
+ <Icon icon="i-mdi:chat-processing-outline" class="composer__hero-icon" />
|
|
|
+ <Icon icon="i-mdi:star-four-points-outline" class="composer__hero-spark" />
|
|
|
+ </div>
|
|
|
<div class="composer__title">数剑,我帮您</div>
|
|
|
</div>
|
|
|
<div class="composer-box">
|
|
|
@@ -868,8 +832,8 @@
|
|
|
openChatStream,
|
|
|
type ChatStreamHandle,
|
|
|
} from '@/workbench/api/chatSse';
|
|
|
+ import logo from '@/assets/images/logo.png';
|
|
|
import { getDocumentChunkContext, getDocumentContent } from '@/workbench/api/kb';
|
|
|
- import { getOnboardingChecklist } from '@/workbench/api/audit';
|
|
|
import { aiUpload } from '@/workbench/api/http';
|
|
|
import {
|
|
|
downloadArtifact,
|
|
|
@@ -882,10 +846,8 @@
|
|
|
import { scenarioPackMcpOptions, scenarioPackOptions } from '@/workbench/api/pack';
|
|
|
import { visibleSkillOptions } from '@/workbench/api/skill';
|
|
|
import { BasicModal } from '@/core/components/Modal';
|
|
|
- import { useAccountStore } from '@/core/store/modules/account';
|
|
|
import { useUserStore } from '@/core/store/modules/case';
|
|
|
import { Icon } from '@/core/components/Icon';
|
|
|
- import logo from '@/workbench/assets/logo.png';
|
|
|
import AiMarkdown from '@/workbench/components/AiMarkdown.vue';
|
|
|
import PromptModal from '@/workbench/components/PromptModal.vue';
|
|
|
|
|
|
@@ -894,8 +856,6 @@
|
|
|
type ScenarioPackMcpOptionVO = Record<string, any>;
|
|
|
type SkillOptionVO = Record<string, any>;
|
|
|
type ChunkContextVO = Record<string, any>;
|
|
|
- type OnboardingItem = Record<string, any>;
|
|
|
- type OnboardingReport = Record<string, any>;
|
|
|
type ChatStreamEvent = Record<string, any>;
|
|
|
|
|
|
/** 兼容 Element Plus 的 Tag type 类型:迁移后用 Ant Tag color,统一为 string */
|
|
|
@@ -1055,10 +1015,6 @@
|
|
|
const inputText = ref('');
|
|
|
const streaming = ref(false);
|
|
|
const sending = ref(false);
|
|
|
- /** 首登检查清单:仅具备健康自检权限的管理员可见(完成状态全部由服务端推导) */
|
|
|
- const onboarding = ref<OnboardingReport | null>(null);
|
|
|
- const onboardingDismissed = ref(false);
|
|
|
- const accountStore = useAccountStore();
|
|
|
/** 案件上下文:会话 / 资源 / 附件均按当前案件隔离 */
|
|
|
const userStore = useUserStore();
|
|
|
/** 当前案件 ID(字符串,避免雪花 Long 精度丢失;空串表示未打开案件) */
|
|
|
@@ -1090,50 +1046,6 @@
|
|
|
const promptRef = ref<{ open: (options: any) => Promise<string | null> }>();
|
|
|
const promptDialog = (options: any): Promise<string | null> =>
|
|
|
promptRef.value ? promptRef.value.open(options) : Promise.resolve(null);
|
|
|
- /** 首登卡片展示条件:当前会话无消息 + 未全部完成 + 未被手动隐藏 */
|
|
|
- const showOnboarding = computed(
|
|
|
- () => !onboardingDismissed.value && !!onboarding.value && !onboarding.value.allDone && !messages.value.length,
|
|
|
- );
|
|
|
- const onboardingDismissKey = () => `bizbuddy:onboarding:dismissed:${accountStore.getUserInfo?.id || 'anonymous'}`;
|
|
|
- const loadOnboarding = async () => {
|
|
|
- onboardingDismissed.value = localStorage.getItem(onboardingDismissKey()) === '1';
|
|
|
- try {
|
|
|
- const res = await getOnboardingChecklist();
|
|
|
- onboarding.value = res ?? null;
|
|
|
- } catch {
|
|
|
- // 权限不足 / 接口异常时静默隐藏,不影响对话主路径
|
|
|
- onboarding.value = null;
|
|
|
- }
|
|
|
- };
|
|
|
- const dismissOnboarding = () => {
|
|
|
- onboardingDismissed.value = true;
|
|
|
- localStorage.setItem(onboardingDismissKey(), '1');
|
|
|
- };
|
|
|
- const openOnboardingPage = (path: string) => {
|
|
|
- void router.push(path);
|
|
|
- };
|
|
|
- const focusComposer = () => {
|
|
|
- const textarea = workbenchRef.value?.querySelector('.composer textarea') as HTMLTextAreaElement | null;
|
|
|
- textarea?.focus();
|
|
|
- };
|
|
|
- const handleOnboardingItem = (item: OnboardingItem) => {
|
|
|
- if (item.done) {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (item.key === 'first-chat') {
|
|
|
- focusComposer();
|
|
|
- return;
|
|
|
- }
|
|
|
- const targets: Record<string, string> = {
|
|
|
- 'chat-model': '/workbench/model/config',
|
|
|
- 'embedding-model': '/workbench/model/config',
|
|
|
- document: '/workbench/kb/doc',
|
|
|
- };
|
|
|
- const target = targets[item.key];
|
|
|
- if (target) {
|
|
|
- void router.push(target);
|
|
|
- }
|
|
|
- };
|
|
|
/** 最后一轮重新生成预检结果(null 表示尚未检查或检查失败) */
|
|
|
const regenerateCheck = ref<ChatRegenerateCheckVO | null>(null);
|
|
|
/** 预检结果对应的用户消息主键,避免切换会话后误用旧结果 */
|
|
|
@@ -1475,8 +1387,6 @@
|
|
|
|
|
|
onActivated(() => {
|
|
|
syncWorkbenchHeight();
|
|
|
- // 从「模型配置 / 文档与切片」等页面返回时刷新首登状态
|
|
|
- void loadOnboarding();
|
|
|
});
|
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
@@ -2984,8 +2894,6 @@
|
|
|
regenerateBackup = null;
|
|
|
void refreshRegenerateCheck();
|
|
|
getSessions();
|
|
|
- // 首登清单:首轮完成后刷新,下一次打开空会话时即可反映最新状态
|
|
|
- void loadOnboarding();
|
|
|
// 编排轨迹回填:异步补齐专家原始结论,不阻塞本轮收尾
|
|
|
void syncExpertConclusions(msg);
|
|
|
break;
|
|
|
@@ -3361,7 +3269,6 @@
|
|
|
loadAgents();
|
|
|
loadResourceOptions();
|
|
|
getSessions();
|
|
|
- void loadOnboarding();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
@@ -3555,125 +3462,6 @@
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
|
|
|
- /* 首登检查清单:对话前的可关闭卡片 */
|
|
|
- .onboarding-card {
|
|
|
- width: 100%;
|
|
|
- margin-bottom: 20px;
|
|
|
- padding: 14px 16px;
|
|
|
- border: 1px solid var(--app-surface-border);
|
|
|
- border-radius: var(--app-radius-base, 12px);
|
|
|
- background: var(--app-surface-bg);
|
|
|
- box-shadow: var(--app-shadow-sm);
|
|
|
- text-align: left;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__head {
|
|
|
- display: flex;
|
|
|
- align-items: flex-start;
|
|
|
- justify-content: space-between;
|
|
|
- gap: 12px;
|
|
|
- margin-bottom: 8px;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__heading {
|
|
|
- display: flex;
|
|
|
- align-items: baseline;
|
|
|
- gap: 10px;
|
|
|
- flex-wrap: wrap;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__title {
|
|
|
- font-size: 15px;
|
|
|
- font-weight: 600;
|
|
|
- color: var(--el-text-color-primary, #303133);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__progress {
|
|
|
- font-size: 12px;
|
|
|
- color: var(--el-text-color-secondary, #909399);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__close {
|
|
|
- cursor: pointer;
|
|
|
- color: var(--el-text-color-secondary, #909399);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__close:hover {
|
|
|
- color: var(--el-text-color-primary, #303133);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__list {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- gap: 2px;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- gap: 10px;
|
|
|
- padding: 7px 8px;
|
|
|
- border-radius: 8px;
|
|
|
- cursor: pointer;
|
|
|
- outline: none;
|
|
|
- transition: background-color 0.15s ease;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item:hover,
|
|
|
- .onboarding-item:focus-visible {
|
|
|
- background: var(--el-fill-color-light, #f5f7fa);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item.is-done {
|
|
|
- cursor: default;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item.is-done:hover {
|
|
|
- background: transparent;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item__status {
|
|
|
- flex: 0 0 auto;
|
|
|
- font-size: 17px;
|
|
|
- color: var(--el-color-warning, #e6a23c);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item.is-done .onboarding-item__status {
|
|
|
- color: var(--el-color-success, #67c23a);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item__body {
|
|
|
- min-width: 0;
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item__title {
|
|
|
- font-size: 13px;
|
|
|
- color: var(--el-text-color-primary, #303133);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item.is-done .onboarding-item__title {
|
|
|
- color: var(--el-text-color-secondary, #909399);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item__desc {
|
|
|
- margin-top: 2px;
|
|
|
- font-size: 12px;
|
|
|
- color: var(--el-text-color-secondary, #909399);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item__arrow {
|
|
|
- flex: 0 0 auto;
|
|
|
- color: var(--el-text-color-placeholder, #c0c4cc);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__links {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
- gap: 4px;
|
|
|
- margin-top: 6px;
|
|
|
- }
|
|
|
-
|
|
|
.msg-row {
|
|
|
display: flex;
|
|
|
margin-bottom: 18px;
|
|
|
@@ -5043,16 +4831,31 @@
|
|
|
}
|
|
|
|
|
|
.composer__hero-logo {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
width: 56px;
|
|
|
height: 56px;
|
|
|
- padding: 3px;
|
|
|
- object-fit: cover;
|
|
|
- background: #fff;
|
|
|
- border: 1px solid #e7ebf3;
|
|
|
+ color: #2a50ec;
|
|
|
+ background: linear-gradient(145deg, #eef3ff 0%, #fff 65%);
|
|
|
+ border: 1px solid #dbe5ff;
|
|
|
border-radius: 16px;
|
|
|
box-shadow: 0 8px 22px rgb(42 80 236 / 14%);
|
|
|
}
|
|
|
|
|
|
+ .composer__hero-icon {
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .composer__hero-spark {
|
|
|
+ position: absolute;
|
|
|
+ top: 7px;
|
|
|
+ right: 7px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #5b7cff;
|
|
|
+ }
|
|
|
+
|
|
|
.composer__title {
|
|
|
margin-bottom: 0;
|
|
|
color: #111827;
|
|
|
@@ -5150,28 +4953,6 @@
|
|
|
border-radius: 999px;
|
|
|
}
|
|
|
|
|
|
- .onboarding-card {
|
|
|
- padding: 14px 16px;
|
|
|
- background: #fff;
|
|
|
- border-color: #e7ebf3;
|
|
|
- border-radius: 14px;
|
|
|
- box-shadow: 0 2px 8px rgb(15 23 42 / 3%);
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-card__title {
|
|
|
- color: #111827;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item {
|
|
|
- padding: 8px 10px;
|
|
|
- border-radius: 8px;
|
|
|
- }
|
|
|
-
|
|
|
- .onboarding-item:hover {
|
|
|
- background: #f6f8fc;
|
|
|
- }
|
|
|
-
|
|
|
.msg-meta {
|
|
|
margin-top: 6px;
|
|
|
}
|