refactor: refactor smart entry as standalone modal overlay

- Convert TravelReimbursementCreateView from page to modal overlay
- Simplify App.vue navigation flow with smartEntryOpen state
- Add create-request button in RequestsView

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-05 23:47:20 +08:00
parent 2d2ed27861
commit 9a7b0794a1
7 changed files with 1437 additions and 646 deletions

View File

@@ -20,12 +20,17 @@
<p>自动识别报销类别核对附件完整性并生成可继续提交的报销草稿</p>
<div class="assistant-input">
<span>例如我昨天请客户吃饭花了 860 还打车去了客户公司</span>
<button type="button" class="hero-action" @click="emit('openAssistant')">开始识别</button>
<textarea
v-model="assistantDraft"
rows="2"
placeholder="例如:我昨天请客户吃饭花了 860 元,还打车去了客户公司"
@keydown.ctrl.enter.prevent="openAssistantWithDraft"
/>
<button type="button" class="hero-action" @click="openAssistantWithDraft">开始识别</button>
</div>
<div class="assistant-tools">
<button type="button" class="ghost-action" @click="emit('openAssistant')">
<button type="button" class="ghost-action" @click="emit('openAssistant', { prompt: '', source: 'upload' })">
<i class="mdi mdi-upload-outline"></i>
<span>上传票据</span>
</button>
@@ -117,6 +122,7 @@
</template>
<script setup>
import { ref } from 'vue'
import PanelHead from '../shared/PanelHead.vue'
import robotAssistant from '../../assets/robot-assistant.png'
@@ -125,6 +131,14 @@ defineProps({
})
const emit = defineEmits(['openAssistant'])
const assistantDraft = ref('')
function openAssistantWithDraft() {
emit('openAssistant', {
prompt: assistantDraft.value.trim(),
source: 'workbench'
})
}
const assistantSkills = ['识别报销类别', '检查缺少材料', '生成报销草稿']
@@ -350,22 +364,33 @@ const policyItems = [
display: flex;
align-items: center;
gap: 14px;
min-height: 58px;
padding: 10px 10px 10px 18px;
min-height: 68px;
padding: 10px 10px 10px 14px;
border: 1px solid rgba(148, 163, 184, 0.28);
border-radius: 12px;
background: rgba(255, 255, 255, 0.92);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.assistant-input span {
.assistant-input textarea {
min-width: 0;
flex: 1;
color: #94a3b8;
min-height: 42px;
resize: none;
border: 0;
padding: 4px 0;
background: transparent;
color: #0f172a;
font-size: 15px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.55;
}
.assistant-input textarea::placeholder {
color: #94a3b8;
}
.assistant-input textarea:focus {
outline: none;
}
.hero-action,
@@ -719,8 +744,8 @@ const policyItems = [
padding: 14px;
}
.assistant-input span {
white-space: normal;
.assistant-input textarea {
min-height: 72px;
}
.hero-action,