feat(web): update layout and business components
- PersonalWorkbench.vue: update personal workbench component - SidebarRail.vue: update sidebar rail component - TopBar.vue: update top bar component
This commit is contained in:
@@ -146,34 +146,30 @@
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<Teleport to="body">
|
||||
<Transition name="session-confirm">
|
||||
<div v-if="confirmDialogOpen" class="session-confirm-mask" @click.self="closeConfirmDialog">
|
||||
<section class="session-confirm-card">
|
||||
<span class="session-confirm-badge">新建会话</span>
|
||||
<h4>开始新会话会清空当前历史对话</h4>
|
||||
<p>检测到你还有未清除的会话记录。确认后会删除当前用户的全部历史对话,再开启新的智能体会话。</p>
|
||||
|
||||
<div class="session-confirm-actions">
|
||||
<button type="button" class="ghost-action confirm-cancel" :disabled="confirmDialogBusy" @click="closeConfirmDialog">
|
||||
<span>取消</span>
|
||||
</button>
|
||||
<button type="button" class="hero-action confirm-submit" :disabled="confirmDialogBusy" @click="confirmStartNewConversation">
|
||||
<i :class="confirmDialogBusy ? 'mdi mdi-loading mdi-spin' : 'mdi mdi-delete-sweep-outline'"></i>
|
||||
<span>{{ confirmDialogBusy ? '清空中...' : '确认删除并新建' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
<ConfirmDialog
|
||||
:open="confirmDialogOpen"
|
||||
badge="新建会话"
|
||||
badge-tone="info"
|
||||
title="开始新会话会清空当前历史对话"
|
||||
description="检测到你还有未清除的会话记录。确认后会删除当前用户的全部历史对话,再开启新的智能体会话。"
|
||||
cancel-text="取消"
|
||||
confirm-text="确认删除并新建"
|
||||
busy-text="清空中..."
|
||||
confirm-tone="primary"
|
||||
confirm-icon="mdi mdi-delete-sweep-outline"
|
||||
:busy="confirmDialogBusy"
|
||||
@close="closeConfirmDialog"
|
||||
@confirm="confirmStartNewConversation"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import PanelHead from '../shared/PanelHead.vue'
|
||||
import ConfirmDialog from '../shared/ConfirmDialog.vue'
|
||||
import robotAssistant from '../../assets/robot-helper.png'
|
||||
import { useSystemState } from '../../composables/useSystemState.js'
|
||||
import { useToast } from '../../composables/useToast.js'
|
||||
import { clearUserConversations, fetchLatestConversation } from '../../services/orchestrator.js'
|
||||
|
||||
defineProps({
|
||||
@@ -182,6 +178,7 @@ defineProps({
|
||||
|
||||
const emit = defineEmits(['openAssistant'])
|
||||
const { currentUser } = useSystemState()
|
||||
const { toast } = useToast()
|
||||
const assistantDraft = ref('')
|
||||
const fileInputRef = ref(null)
|
||||
const selectedFiles = ref([])
|
||||
@@ -313,7 +310,7 @@ async function confirmStartNewConversation() {
|
||||
pendingAction.value = ''
|
||||
emitAssistant(nextPayload)
|
||||
} catch (error) {
|
||||
window.alert(error?.message || '清空历史会话失败,请稍后重试。')
|
||||
toast(error?.message || '清空历史会话失败,请稍后重试。')
|
||||
} finally {
|
||||
confirmDialogBusy.value = false
|
||||
}
|
||||
@@ -728,83 +725,6 @@ const policyItems = [
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.session-confirm-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 24px;
|
||||
background: rgba(15, 23, 42, 0.32);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.session-confirm-card {
|
||||
width: min(480px, 100%);
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
padding: 24px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.14);
|
||||
border-radius: 24px;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 36%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
|
||||
box-shadow: 0 28px 56px rgba(15, 23, 42, 0.18);
|
||||
}
|
||||
|
||||
.session-confirm-badge {
|
||||
display: inline-flex;
|
||||
width: fit-content;
|
||||
align-items: center;
|
||||
min-height: 28px;
|
||||
padding: 0 10px;
|
||||
border-radius: 999px;
|
||||
background: rgba(59, 130, 246, 0.12);
|
||||
color: #1d4ed8;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.session-confirm-card h4 {
|
||||
color: #0f172a;
|
||||
font-size: 22px;
|
||||
line-height: 1.35;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.session-confirm-card p {
|
||||
color: #5b6b83;
|
||||
font-size: 14px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.session-confirm-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.confirm-cancel,
|
||||
.confirm-submit {
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.session-confirm-enter-active,
|
||||
.session-confirm-leave-active {
|
||||
transition: opacity 0.18s ease, transform 0.18s ease;
|
||||
}
|
||||
|
||||
.session-confirm-enter-from,
|
||||
.session-confirm-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.session-confirm-enter-from .session-confirm-card,
|
||||
.session-confirm-leave-to .session-confirm-card {
|
||||
transform: translateY(8px) scale(0.98);
|
||||
}
|
||||
|
||||
.workbench-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
@@ -1176,15 +1096,6 @@ const policyItems = [
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.session-confirm-actions {
|
||||
justify-content: stretch;
|
||||
}
|
||||
|
||||
.confirm-cancel,
|
||||
.confirm-submit {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.todo-row,
|
||||
.progress-row {
|
||||
grid-template-columns: 48px minmax(0, 1fr);
|
||||
|
||||
Reference in New Issue
Block a user