feat(workbench): show progress update time first
This commit is contained in:
@@ -96,7 +96,7 @@
|
||||
}
|
||||
|
||||
.progress-row {
|
||||
grid-template-columns: minmax(126px, 0.9fr) minmax(270px, 1.35fr) minmax(86px, auto);
|
||||
grid-template-columns: minmax(72px, 0.42fr) minmax(126px, 0.86fr) minmax(270px, 1.32fr) minmax(86px, auto);
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
@@ -325,15 +325,24 @@
|
||||
/* 重点优化:费用进度行的网格区域(Grid Area)双行重构 */
|
||||
.progress-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: minmax(70px, auto) 1fr minmax(74px, auto);
|
||||
grid-template-areas:
|
||||
"identity result"
|
||||
"steps steps";
|
||||
"time identity result"
|
||||
"steps steps steps";
|
||||
gap: 8px;
|
||||
padding: 10px 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.progress-time {
|
||||
grid-area: time;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.progress-time time {
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.progress-identity {
|
||||
grid-area: identity;
|
||||
width: 100%;
|
||||
|
||||
@@ -554,7 +554,7 @@
|
||||
|
||||
.progress-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(138px, 0.9fr) minmax(300px, 1.5fr) minmax(92px, auto);
|
||||
grid-template-columns: minmax(78px, 0.44fr) minmax(138px, 0.86fr) minmax(300px, 1.46fr) minmax(92px, auto);
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
@@ -563,6 +563,7 @@
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.progress-time,
|
||||
.progress-identity,
|
||||
.progress-result {
|
||||
min-width: 0;
|
||||
@@ -570,6 +571,28 @@
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.progress-time {
|
||||
color: var(--workbench-muted);
|
||||
}
|
||||
|
||||
.progress-time time {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: var(--workbench-ink);
|
||||
font-size: 12px;
|
||||
font-weight: 850;
|
||||
line-height: 1.2;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.progress-time small {
|
||||
color: var(--workbench-muted);
|
||||
font-size: 10px;
|
||||
font-weight: 750;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.progress-result {
|
||||
justify-items: end;
|
||||
}
|
||||
|
||||
@@ -205,6 +205,11 @@
|
||||
class="progress-row"
|
||||
@click="openWorkbenchTarget(item)"
|
||||
>
|
||||
<span class="progress-time">
|
||||
<time :datetime="item.updatedAt || ''">{{ item.displayTime }}</time>
|
||||
<small>更新</small>
|
||||
</span>
|
||||
|
||||
<span class="progress-identity">
|
||||
<strong>{{ item.id }}</strong>
|
||||
<small>{{ item.title }}</small>
|
||||
@@ -459,9 +464,26 @@ const visibleProgressItems = computed(() => {
|
||||
const rows = Array.isArray(props.workbenchSummary.progressItems)
|
||||
? props.workbenchSummary.progressItems
|
||||
: []
|
||||
return rows.slice(0, 5)
|
||||
return rows.slice(0, 5).map((item) => ({
|
||||
...item,
|
||||
displayTime: formatProgressTime(item?.updatedAt)
|
||||
}))
|
||||
})
|
||||
|
||||
function formatProgressTime(value) {
|
||||
const text = String(value || '').trim()
|
||||
if (!text) {
|
||||
return '最近更新'
|
||||
}
|
||||
|
||||
const match = /^(\d{4})-(\d{2})-(\d{2})(?:[T\s](\d{2}):(\d{2}))?/.exec(text)
|
||||
if (match) {
|
||||
return match[4] ? `${match[2]}-${match[3]} ${match[4]}:${match[5]}` : `${match[2]}-${match[3]}`
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
function buildSelectedFileKey(file) {
|
||||
return [file?.name, file?.size, file?.lastModified, file?.type].join('__')
|
||||
}
|
||||
|
||||
@@ -142,3 +142,13 @@ test('workbench submit shows intent recognition feedback before assistant opens'
|
||||
assert.match(workbench, /if \(open\) \{\s*clearPendingAction\(\)/)
|
||||
assert.match(workbench, /:readonly="isComposerPending"/)
|
||||
})
|
||||
|
||||
test('workbench progress rows show update time first', () => {
|
||||
assert.match(workbench, /class="progress-time"/)
|
||||
assert.match(workbench, /<time :datetime="item\.updatedAt \|\| ''">\{\{ item\.displayTime \}\}<\/time>/)
|
||||
assert.match(workbench, /displayTime: formatProgressTime\(item\?\.updatedAt\)/)
|
||||
assert.match(workbench, /function formatProgressTime\(value\)/)
|
||||
assert.match(workbenchStyles, /\.progress-row\s*\{[\s\S]*grid-template-columns:\s*minmax\(78px,\s*0\.44fr\)/)
|
||||
assert.match(workbenchStyles, /\.progress-time\s*\{[\s\S]*color:\s*var\(--workbench-muted\);/)
|
||||
assert.match(workbenchResponsiveStyles, /grid-template-areas:[\s\S]*"time identity result"[\s\S]*"steps steps steps"/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user