新增: Phase2 阶段收尾(Sprint 1-20)
重构:删 5 零引用 crate(df-evolve/plugin/stages/task/traceability)+ 清死模块、ai.rs 拆 11 子 module、ai.ts 拆 6 composable、i18n 拆目录 功能:知识库全栈(df-project/scan + CRUD + 时间线 + 前端)、Settings 拆分、appSettings KV 迁移、模型池、LLM 并发 Semaphore 修复:审批持久化根治、ConditionEngine 默认拒绝、NodeRegistry unimplemented 清除、promote 补偿删除、工具结果截断 50KB、路径校验防 symlink 逃逸 文档:B-03 人工审批设计、决策记录三分档、规格契约自检、经验记录、todo 看板、PROGRESS 更新 详见 PROGRESS.md。src-tauri/儿童每日打卡应用/ 与本项目无关,已排除。
This commit is contained in:
96
src/components/ConfirmDialog.vue
Normal file
96
src/components/ConfirmDialog.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<!-- 自建确认弹层:替代 window.confirm(后者在 Tauri webview 带 localhost:port 来源信息,无法去除)。
|
||||
组件自包含:按钮样式内联,不依赖外部 .btn-*,便于在任何视图复用。 -->
|
||||
<Transition name="confirm">
|
||||
<div v-if="visible" class="confirm-mask" @click.self="$emit('result', false)">
|
||||
<div class="confirm-box">
|
||||
<div class="confirm-msg">{{ msg }}</div>
|
||||
<div class="confirm-actions">
|
||||
<button class="confirm-btn confirm-btn--cancel" @click="$emit('result', false)">{{ $t('common.cancel') }}</button>
|
||||
<button class="confirm-btn confirm-btn--danger" @click="$emit('result', true)">{{ dangerLabel || $t('common.delete') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
withDefaults(defineProps<{
|
||||
visible: boolean
|
||||
msg: string
|
||||
/** 危险按钮文案;不传则回退到 common.delete(随语言切换) */
|
||||
dangerLabel?: string
|
||||
}>(), {
|
||||
dangerLabel: '',
|
||||
})
|
||||
|
||||
defineEmits<{
|
||||
result: [ok: boolean]
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.confirm-mask {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
.confirm-box {
|
||||
background: var(--df-bg-card, #fff);
|
||||
border: 0.5px solid var(--df-border, #ddd);
|
||||
border-radius: var(--df-radius-lg, 8px);
|
||||
padding: 20px 24px;
|
||||
min-width: 280px;
|
||||
max-width: 360px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.confirm-msg {
|
||||
font-size: 13px;
|
||||
color: var(--df-text, #333);
|
||||
line-height: 1.5;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.confirm-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
}
|
||||
.confirm-btn {
|
||||
padding: 5px 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
font-family: var(--df-font-sans);
|
||||
border-radius: var(--df-radius-sm, 4px);
|
||||
border: 0.5px solid var(--df-border, #ddd);
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.confirm-btn--cancel {
|
||||
background: transparent;
|
||||
color: var(--df-text-dim, #888);
|
||||
}
|
||||
.confirm-btn--cancel:hover {
|
||||
background: var(--df-bg-card-hover, #f0f0f0);
|
||||
color: var(--df-text, #333);
|
||||
}
|
||||
.confirm-btn--danger {
|
||||
background: var(--df-danger, #e5484d);
|
||||
color: #fff;
|
||||
border-color: var(--df-danger, #e5484d);
|
||||
}
|
||||
.confirm-btn--danger:hover {
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
.confirm-enter-active,
|
||||
.confirm-leave-active {
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.confirm-enter-from,
|
||||
.confirm-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user