feat(web): update Vue components and composables
- PersonalWorkbench.vue: update personal workbench component - useAppShell.js: update app shell composable - useChat.js: update chat composable with new features - AppShellRouteView.vue: update route view - ChatView.vue: update chat view with enhanced UI - TravelReimbursementCreateView.vue: update travel reimbursement form - ChatView.js: update chat view script logic - TravelReimbursementCreateView.js: update travel form script logic
This commit is contained in:
@@ -19,16 +19,24 @@
|
||||
<p>自动识别报销类别、核对附件完整性,并生成可继续提交的报销草稿。</p>
|
||||
|
||||
<div class="assistant-input">
|
||||
<input
|
||||
ref="fileInputRef"
|
||||
class="assistant-file-input"
|
||||
type="file"
|
||||
multiple
|
||||
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx"
|
||||
@change="handleWorkbenchFilesChange"
|
||||
/>
|
||||
<textarea
|
||||
v-model="assistantDraft"
|
||||
rows="1"
|
||||
placeholder="例如:我昨天请客户吃饭花了 860 元,还打车去了客户公司"
|
||||
@keydown.ctrl.enter.prevent="openAssistantWithDraft"
|
||||
@keydown.enter.prevent="handleWorkbenchEnter"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="assistant-tools">
|
||||
<button type="button" class="ghost-action" @click="emit('openAssistant', { prompt: '', source: 'upload' })">
|
||||
<button type="button" class="ghost-action" @click="triggerFileUpload">
|
||||
<i class="mdi mdi-upload-outline"></i>
|
||||
<span>上传票据</span>
|
||||
</button>
|
||||
@@ -130,6 +138,7 @@ defineProps({
|
||||
|
||||
const emit = defineEmits(['openAssistant'])
|
||||
const assistantDraft = ref('')
|
||||
const fileInputRef = ref(null)
|
||||
|
||||
function openAssistantWithDraft() {
|
||||
emit('openAssistant', {
|
||||
@@ -138,6 +147,31 @@ function openAssistantWithDraft() {
|
||||
})
|
||||
}
|
||||
|
||||
function handleWorkbenchEnter(event) {
|
||||
if (event.isComposing) {
|
||||
return
|
||||
}
|
||||
|
||||
openAssistantWithDraft()
|
||||
}
|
||||
|
||||
function triggerFileUpload() {
|
||||
fileInputRef.value?.click()
|
||||
}
|
||||
|
||||
function handleWorkbenchFilesChange(event) {
|
||||
const files = Array.from(event.target.files ?? [])
|
||||
if (!files.length) return
|
||||
|
||||
emit('openAssistant', {
|
||||
prompt: assistantDraft.value.trim(),
|
||||
source: 'upload',
|
||||
files
|
||||
})
|
||||
|
||||
event.target.value = ''
|
||||
}
|
||||
|
||||
const todoItems = [
|
||||
{
|
||||
title: '业务招待报销建议补参与人员',
|
||||
@@ -371,6 +405,10 @@ const policyItems = [
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.assistant-file-input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.assistant-input textarea {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user