feat(workbench): keep progress detail return context
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
.progress-row {
|
||||
grid-template-columns: minmax(72px, 0.42fr) minmax(126px, 0.86fr) minmax(270px, 1.32fr) minmax(86px, auto);
|
||||
grid-template-columns: minmax(72px, 0.4fr) minmax(122px, 0.72fr) minmax(78px, 0.42fr) minmax(238px, 1.18fr) minmax(86px, auto);
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
@@ -328,6 +328,7 @@
|
||||
grid-template-columns: minmax(70px, auto) 1fr minmax(74px, auto);
|
||||
grid-template-areas:
|
||||
"time identity result"
|
||||
"type type type"
|
||||
"steps steps steps";
|
||||
gap: 8px;
|
||||
padding: 10px 0;
|
||||
@@ -356,6 +357,11 @@
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.progress-type {
|
||||
grid-area: type;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-result {
|
||||
grid-area: result;
|
||||
width: 100%;
|
||||
|
||||
@@ -525,6 +525,38 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.progress-type {
|
||||
min-width: 0;
|
||||
display: grid;
|
||||
justify-items: start;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.progress-type small {
|
||||
color: var(--workbench-muted);
|
||||
font-size: 10px;
|
||||
font-weight: 750;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.progress-type strong {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 22px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.18);
|
||||
border-radius: 4px;
|
||||
background: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.08);
|
||||
color: var(--workbench-primary-active);
|
||||
font-size: 11.5px;
|
||||
font-weight: 850;
|
||||
line-height: 1.2;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.progress-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -555,7 +587,7 @@
|
||||
.progress-row {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(78px, 0.44fr) minmax(138px, 0.86fr) minmax(300px, 1.46fr) minmax(92px, auto);
|
||||
grid-template-columns: minmax(78px, 0.42fr) minmax(132px, 0.74fr) minmax(84px, 0.42fr) minmax(260px, 1.28fr) minmax(92px, auto);
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
@@ -605,6 +637,7 @@
|
||||
|
||||
.progress-time,
|
||||
.progress-identity,
|
||||
.progress-type,
|
||||
.progress-result {
|
||||
min-width: 0;
|
||||
display: grid;
|
||||
|
||||
@@ -215,6 +215,11 @@
|
||||
<small>{{ item.title }}</small>
|
||||
</span>
|
||||
|
||||
<span class="progress-type" :title="item.expenseTypeLabel || '其他费用'">
|
||||
<small>费用类型</small>
|
||||
<strong>{{ item.expenseTypeLabel || '其他费用' }}</strong>
|
||||
</span>
|
||||
|
||||
<span class="progress-steps" aria-hidden="true">
|
||||
<span
|
||||
v-for="step in item.steps"
|
||||
@@ -665,6 +670,8 @@ function openWorkbenchTarget(item) {
|
||||
const target = item?.target || {}
|
||||
if (target.type === 'document' && (target.id || target.claimNo)) {
|
||||
emit('open-document', {
|
||||
source: 'workbench',
|
||||
returnTo: 'workbench',
|
||||
claimId: target.id,
|
||||
id: target.id || target.claimNo,
|
||||
claimNo: target.claimNo
|
||||
|
||||
@@ -95,6 +95,10 @@ export function useAppShell() {
|
||||
})
|
||||
|
||||
const detailMode = computed(() => route.name === 'app-document-detail')
|
||||
const detailReturnTarget = computed(() => String(route.query.returnTo || '').trim())
|
||||
const detailBackLabel = computed(() => (
|
||||
detailReturnTarget.value === 'workbench' ? '返回首页' : '返回单据中心'
|
||||
))
|
||||
const detailAlerts = computed(() => (
|
||||
detailMode.value
|
||||
? buildDetailAlerts(selectedRequest.value, { currentUser: currentUser.value })
|
||||
@@ -398,16 +402,38 @@ export function useAppShell() {
|
||||
)
|
||||
}
|
||||
|
||||
function openRequestDetail(request) {
|
||||
function buildDocumentDetailQuery(options = {}) {
|
||||
const nextQuery = { ...route.query }
|
||||
const returnTo = String(options.returnTo || '').trim()
|
||||
if (returnTo === 'workbench') {
|
||||
nextQuery.returnTo = 'workbench'
|
||||
} else {
|
||||
delete nextQuery.returnTo
|
||||
}
|
||||
return nextQuery
|
||||
}
|
||||
|
||||
function buildDocumentReturnQuery() {
|
||||
const { returnTo, ...nextQuery } = route.query
|
||||
return nextQuery
|
||||
}
|
||||
|
||||
function openRequestDetail(request, options = {}) {
|
||||
selectedRequestSnapshot.value = request || null
|
||||
router.push({
|
||||
name: 'app-document-detail',
|
||||
params: { requestId: request.claimId || request.id }
|
||||
params: { requestId: request.claimId || request.id },
|
||||
query: buildDocumentDetailQuery(options)
|
||||
})
|
||||
}
|
||||
|
||||
function closeRequestDetail() {
|
||||
router.push({ name: 'app-documents' })
|
||||
if (detailReturnTarget.value === 'workbench') {
|
||||
router.push({ name: 'app-workbench' })
|
||||
return
|
||||
}
|
||||
|
||||
router.push({ name: 'app-documents', query: buildDocumentReturnQuery() })
|
||||
}
|
||||
|
||||
async function handleRequestUpdated() {
|
||||
@@ -423,7 +449,7 @@ export function useAppShell() {
|
||||
|
||||
await reloadRequests()
|
||||
selectedRequestSnapshot.value = null
|
||||
router.push({ name: 'app-documents' })
|
||||
router.push({ name: 'app-documents', query: buildDocumentReturnQuery() })
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -465,6 +491,7 @@ export function useAppShell() {
|
||||
smartEntryRevealToken,
|
||||
smartEntrySessionId,
|
||||
detailAlerts,
|
||||
detailBackLabel,
|
||||
toast,
|
||||
topBarView
|
||||
}
|
||||
|
||||
@@ -247,6 +247,7 @@ function buildProgressItems(ownedRequests) {
|
||||
id: requestId,
|
||||
requestId,
|
||||
title,
|
||||
expenseTypeLabel: resolveExpenseCategory(request),
|
||||
amount: formatCurrency(request?.amount),
|
||||
status: normalizeText(request?.approvalStatus || currentStep?.label) || '处理中',
|
||||
statusTone: resolveProgressStatusTone(normalizeText(request?.approvalKey)),
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<TravelRequestDetailView
|
||||
v-else-if="activeView === 'documents' && detailMode && selectedRequest"
|
||||
:request="selectedRequest"
|
||||
back-label="返回单据中心"
|
||||
:back-label="detailBackLabel"
|
||||
@back-to-requests="closeRequestDetail"
|
||||
@open-assistant="openSmartEntry"
|
||||
@request-updated="handleRequestUpdated"
|
||||
@@ -279,6 +279,7 @@ const {
|
||||
closeSmartEntry,
|
||||
customRange,
|
||||
detailAlerts,
|
||||
detailBackLabel,
|
||||
detailMode,
|
||||
documentCenterRefreshToken,
|
||||
filteredRequests,
|
||||
@@ -370,7 +371,14 @@ function openWorkbenchDocument(payload = {}) {
|
||||
|| String(item.id || '').trim() === requestId
|
||||
|| String(item.claimNo || '').trim() === requestId
|
||||
))
|
||||
openRequestDetail(request || payload)
|
||||
const returnTo = (
|
||||
String(payload.returnTo || '').trim() === 'workbench'
|
||||
|| String(payload.source || '').trim() === 'workbench'
|
||||
|| activeView.value === 'workbench'
|
||||
)
|
||||
? 'workbench'
|
||||
: ''
|
||||
openRequestDetail(request || payload, { returnTo })
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
|
||||
Reference in New Issue
Block a user