yeg
2026-09-06 1d8b78eef85a3761d9f5484224b00d9ffa4faff4
补充操作日志完整账号提示并稳定验收截图

长账号在原表格悬停显示完整名称,浏览器截图关闭过渡动画;前端构建和删除日志验收复验通过。
2个文件已修改
7 ■■■■■ 已修改文件
src/views/OperationLog.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tests/e2e/compare-delete-with-audit.spec.ts 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/OperationLog.vue
@@ -74,7 +74,7 @@
        <table>
          <thead><tr><th>日志ID</th><th>操作人</th><th>操作内容</th><th>操作时间</th></tr></thead>
          <tbody>
            <tr v-for="item in pagedRecords" :key="item.id"><td class="id-cell">#{{ item.id }}</td><td><span class="operator-avatar">{{ item.operator.slice(0, 1) }}</span><strong>{{ item.operator }}</strong></td><td :title="item.content">{{ item.content }}</td><td class="time-cell">{{ item.operatedAt }}</td></tr>
            <tr v-for="item in pagedRecords" :key="item.id"><td class="id-cell">#{{ item.id }}</td><td :title="item.operator"><span class="operator-avatar">{{ item.operator.slice(0, 1) }}</span><strong>{{ item.operator }}</strong></td><td :title="item.content">{{ item.content }}</td><td class="time-cell">{{ item.operatedAt }}</td></tr>
            <tr v-if="!pagedRecords.length"><td colspan="4" class="empty-cell">{{ loading ? '正在加载操作日志' : loadError ? '操作日志加载失败' : '暂无符合条件的操作日志' }}</td></tr>
          </tbody>
        </table>
tests/e2e/compare-delete-with-audit.spec.ts
@@ -129,7 +129,7 @@
  for (const width of [1440, 390]) {
    await page.setViewportSize({ width, height: 900 })
    await expect(dialog.getByRole('button', { name: '删除', exact: true })).toBeInViewport()
    await page.screenshot({ path: `tests/e2e/.artifacts/compare-delete-confirm-${width}.png`, fullPage: true })
    await page.screenshot({ path: `tests/e2e/.artifacts/compare-delete-confirm-${width}.png`, fullPage: true, animations: 'disabled' })
  }
  await dialog.getByRole('button', { name: '取消', exact: true }).click()
  expect((await api(page, `/system/compare-report/${v1.id}`)).data).toEqual(v2)
@@ -163,7 +163,8 @@
  await page.getByRole('button', { name: '查询', exact: true }).click()
  await expect(page.locator('.operation-log-page .table-wrap tbody tr')).toHaveCount(1)
  await expect(page.locator('.operation-log-page .table-wrap tbody')).toContainText(`#${v1.id}`)
  await page.screenshot({ path: 'tests/e2e/.artifacts/compare-delete-log.png', fullPage: true })
  await expect(page.locator('.operation-log-page td').filter({ hasText: 'delete_operator' })).toHaveAttribute('title', 'delete_operator')
  await page.screenshot({ path: 'tests/e2e/.artifacts/compare-delete-log.png', fullPage: true, animations: 'disabled' })
  await page.route('**/dev-api/monitor/operlog/list?*', route => route.fulfill({ json: { code: 500, msg: '日志查询故障' } }), { times: 1 })
  await page.reload()
  await expect(page.locator('.operation-log-page .el-alert')).toContainText('日志查询故障')