feat(web): 对齐和信后台页壳并落地工业 UI 评审与 Skills 盘点

统一控制台列表/表单页壳与 Hexin 样式,补充 industrial-ui-review、管理员评审证据,以及 Skills 资产盘点与 test-strategy 消歧。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
unknownandCursor committed 2026-11-19 17:44:26 +08:00
1 parent 48d1735c17
commit c7a23837f4
74 files changed
+3839 -601

No files matched your search

+9 -13
View File
@@ -24,6 +24,7 @@ import {
type FormInstance,
type FormRules,
} from "element-plus";
import FormPageShell from "../shared/components/FormPageShell.vue";
import { useAuthStore } from "../stores/auth";
import {
ALARM_PERMISSION,
@@ -350,8 +351,7 @@ onMounted(() => {
</script>
<template>
<div class="flex h-full min-h-0 flex-col" data-testid="alarm-detail">
<div class="min-h-0 flex-1 overflow-y-auto p-5" data-testid="alarm-scroll">
<FormPageShell test-id="alarm-detail" body-test-id="alarm-scroll" footer-test-id="alarm-footer">
<p v-if="phase === 'loading'" data-testid="alarm-detail-loading">{{ t("alarm.detail.loading") }}</p>
<ElAlert
v-else-if="phase === 'missing'"
@@ -390,7 +390,7 @@ onMounted(() => {
:closable="false"
/>
<section class="mb-4 rounded-lg border border-[var(--border-subtle)] bg-white px-[18px] py-4" data-testid="alarm-summary">
<section class="wm-form-section" data-testid="alarm-summary">
<h3 class="mb-3 text-[14.5px] font-semibold">{{ t("alarm.detail.summary") }}</h3>
<dl class="grid grid-cols-1 gap-x-6 gap-y-3 sm:grid-cols-2">
<div>
@@ -478,7 +478,7 @@ onMounted(() => {
</dl>
</section>
<section class="mb-4 rounded-lg border border-[var(--border-subtle)] bg-white px-[18px] py-4" data-testid="alarm-occurrences">
<section class="wm-form-section" data-testid="alarm-occurrences">
<h3 class="mb-1 text-[14.5px] font-semibold">{{ t("alarm.detail.occurrences") }}</h3>
<p class="mb-2.5 text-[var(--text-muted)]">{{ t("alarm.detail.occurrencesHint") }}</p>
<ElTable :data="occurrences" row-key="id" :empty-text="t('alarm.detail.occurrencesEmpty')">
@@ -493,7 +493,7 @@ onMounted(() => {
</ElTable>
</section>
<section class="mb-4 rounded-lg border border-[var(--border-subtle)] bg-white px-[18px] py-4" data-testid="alarm-evidence">
<section class="wm-form-section" data-testid="alarm-evidence">
<h3 class="mb-3 text-[14.5px] font-semibold">{{ t("alarm.detail.evidence") }}</h3>
<h4 class="mb-2 font-semibold">{{ t("alarm.detail.revisionEvidence") }}</h4>
<ElTable
@@ -525,7 +525,7 @@ onMounted(() => {
</ElTable>
</section>
<section class="mb-4 rounded-lg border border-[var(--border-subtle)] bg-white px-[18px] py-4" data-testid="alarm-history">
<section class="wm-form-section" data-testid="alarm-history">
<h3 class="mb-3 text-[14.5px] font-semibold">{{ t("alarm.detail.history") }}</h3>
<ElTable :data="history" row-key="id" :empty-text="t('alarm.detail.historyEmpty')">
<ElTableColumn prop="seq" :label="t('alarm.historyCols.seq')" width="72" />
@@ -554,12 +554,8 @@ onMounted(() => {
</ElTable>
</section>
</template>
</div>
<footer
data-testid="alarm-footer"
class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-t border-[var(--border-subtle)] bg-white px-5 py-3"
>
<template #footer>
<ElButton data-testid="footer-back" :disabled="commandBusy" @click="backToList">
{{ t("alarm.actions.back") }}
</ElButton>
@@ -591,7 +587,8 @@ onMounted(() => {
{{ t("alarm.actions.close") }}
</ElButton>
</template>
</footer>
</template>
</FormPageShell>
<ElDialog
v-model="progressOpen"
@@ -702,5 +699,4 @@ onMounted(() => {
</ElButton>
</template>
</ElDialog>
</div>
</template>
+113 -128
View File
@@ -21,6 +21,7 @@ import {
ElTag,
vLoading,
} from "element-plus";
import ListPageShell from "../shared/components/ListPageShell.vue";
import { LIST_DEFAULT_PAGE_SIZE, LIST_PAGE_SIZES, actionsColumnWidth } from "../tableLayout";
import { useAuthStore } from "../stores/auth";
import { ALARM_PERMISSION, alarmListEmptyKind, hasAlarmSubject } from "./actions";
@@ -185,119 +186,106 @@ onMounted(() => {
</script>
<template>
<div class="flex h-full min-h-0 flex-col overflow-hidden" data-testid="alarm-list">
<div class="flex shrink-0 flex-wrap items-center gap-2 px-5 pb-3 pt-5" data-testid="alarm-list-toolbar">
<div class="w-[140px]" data-testid="alarm-filter-module">
<ElInput v-model="draft.moduleKey" clearable :placeholder="t('alarm.list.filterModule')" />
<ListPageShell test-id="alarm-list">
<template #filters>
<div data-testid="alarm-list-toolbar" class="contents">
<div class="w-[9rem]" data-testid="alarm-filter-module">
<ElInput v-model="draft.moduleKey" clearable :placeholder="t('alarm.list.filterModule')" />
</div>
<div class="w-[12rem]" data-testid="alarm-filter-scenario">
<ElInput v-model="draft.scenarioName" clearable :placeholder="t('alarm.list.filterScenario')" />
</div>
<div class="w-[14rem]" data-testid="alarm-filter-object">
<ElInput v-model="draft.objectId" clearable :placeholder="t('alarm.list.filterObject')" />
</div>
<div class="w-[12.5rem]" data-testid="alarm-filter-from">
<ElDatePicker
v-model="draft.from"
style="width: 100%"
type="datetime"
:placeholder="t('alarm.list.filterFrom')"
/>
</div>
<div class="w-[12.5rem]" data-testid="alarm-filter-to">
<ElDatePicker
v-model="draft.to"
style="width: 100%"
type="datetime"
:placeholder="t('alarm.list.filterTo')"
/>
</div>
<div class="w-[7.5rem]" data-testid="alarm-filter-status">
<ElSelect v-model="draft.status" clearable class="w-full" :placeholder="t('alarm.list.filterStatus')">
<ElOption :label="t('alarm.status.pending')" value="pending" />
<ElOption :label="t('alarm.status.processing')" value="processing" />
<ElOption :label="t('alarm.status.closed')" value="closed" />
</ElSelect>
</div>
<ElButton type="primary" data-testid="alarm-filter-search" @click="applyFilters">
{{ t("alarm.list.filterSearch") }}
</ElButton>
<ElButton data-testid="alarm-filter-reset" @click="resetFilters">
{{ t("alarm.list.filterReset") }}
</ElButton>
</div>
<div class="w-[180px]" data-testid="alarm-filter-scenario">
<ElInput v-model="draft.scenarioName" clearable :placeholder="t('alarm.list.filterScenario')" />
</div>
<div class="w-[220px]" data-testid="alarm-filter-object">
<ElInput v-model="draft.objectId" clearable :placeholder="t('alarm.list.filterObject')" />
</div>
<div class="w-[200px]" data-testid="alarm-filter-from">
<ElDatePicker
v-model="draft.from"
style="width: 100%"
type="datetime"
:placeholder="t('alarm.list.filterFrom')"
/>
</div>
<div class="w-[200px]" data-testid="alarm-filter-to">
<ElDatePicker
v-model="draft.to"
style="width: 100%"
type="datetime"
:placeholder="t('alarm.list.filterTo')"
/>
</div>
<div class="w-[120px]" data-testid="alarm-filter-status">
<ElSelect v-model="draft.status" clearable class="w-full" :placeholder="t('alarm.list.filterStatus')">
<ElOption :label="t('alarm.status.pending')" value="pending" />
<ElOption :label="t('alarm.status.processing')" value="processing" />
<ElOption :label="t('alarm.status.closed')" value="closed" />
</ElSelect>
</div>
<ElButton type="primary" data-testid="alarm-filter-search" @click="applyFilters">
{{ t("alarm.list.filterSearch") }}
</ElButton>
<ElButton data-testid="alarm-filter-reset" @click="resetFilters">
{{ t("alarm.list.filterReset") }}
</ElButton>
</div>
</template>
<div class="flex min-h-0 flex-1 flex-col px-5">
<ElAlert
v-if="filterIssue"
class="mb-3"
type="warning"
data-testid="alarm-filter-issue"
:title="filterIssue === 'object' ? t('alarm.list.objectInvalid') : t('alarm.list.timeOrder')"
show-icon
:closable="false"
/>
<ElAlert
v-if="phase === 'error'"
type="error"
data-testid="alarm-load-error"
:title="loadError"
show-icon
:closable="false"
/>
<div v-if="phase === 'error'" class="mt-3">
<ElButton data-testid="alarm-retry" @click="load">{{ t("alarm.list.retry") }}</ElButton>
<ElAlert
v-if="filterIssue"
class="mx-8 mt-4 mb-0"
type="warning"
data-testid="alarm-filter-issue"
:title="filterIssue === 'object' ? t('alarm.list.objectInvalid') : t('alarm.list.timeOrder')"
show-icon
:closable="false"
/>
<ElAlert
v-if="phase === 'error'"
class="m-4 mx-8"
type="error"
data-testid="alarm-load-error"
:title="loadError"
show-icon
:closable="false"
/>
<div v-if="phase === 'error'" class="mx-8 mb-4">
<ElButton data-testid="alarm-retry" @click="load">{{ t("alarm.list.retry") }}</ElButton>
</div>
<div v-else-if="phase === 'forbidden'" data-testid="alarm-forbidden" class="wm-list-empty">
<div>
<h3 class="wm-list-empty__title">{{ t("alarm.list.forbidden") }}</h3>
<p class="wm-list-empty__hint">{{ loadError }}</p>
</div>
<div
v-else-if="phase === 'forbidden'"
data-testid="alarm-forbidden"
class="flex flex-1 items-center justify-center rounded-lg border border-dashed border-[var(--border-default)] bg-white px-5 py-14 text-center"
</div>
<div v-else-if="emptyKind === 'no-scope'" data-testid="alarm-no-scope" class="wm-list-empty">
<div>
<h3 class="wm-list-empty__title">{{ t("alarm.list.noScope") }}</h3>
<p class="wm-list-empty__hint">{{ t("alarm.list.noScopeHint") }}</p>
</div>
</div>
<div v-else-if="emptyKind === 'empty'" data-testid="alarm-empty" class="wm-list-empty">
<div>
<h3 class="wm-list-empty__title">{{ t("alarm.list.empty") }}</h3>
<p class="wm-list-empty__hint">{{ t("alarm.list.emptyHint") }}</p>
</div>
</div>
<div v-else-if="emptyKind === 'no-match'" data-testid="alarm-no-match" class="wm-list-empty">
<div>
<h3 class="wm-list-empty__title">{{ t("alarm.list.noMatch") }}</h3>
<p class="wm-list-empty__hint">{{ t("alarm.list.noMatchHint") }}</p>
</div>
</div>
<div v-else-if="showTable" class="min-h-0 flex-1" data-testid="alarm-table-wrap">
<ElTable
v-loading="phase === 'loading'"
class="wm-admin-table"
height="100%"
:data="items"
row-key="id"
data-testid="alarm-table"
:default-sort="{ prop: 'last_occurred_at', order: 'descending' }"
@sort-change="onSortChange"
>
<div>
<h3 class="mb-1.5 text-[15px] font-semibold">{{ t("alarm.list.forbidden") }}</h3>
<p class="text-[var(--text-secondary)]">{{ loadError }}</p>
</div>
</div>
<div
v-else-if="emptyKind === 'no-scope'"
data-testid="alarm-no-scope"
class="flex flex-1 items-center justify-center rounded-lg border border-dashed border-[var(--border-default)] bg-white px-5 py-14 text-center"
>
<div>
<h3 class="mb-1.5 text-[15px] font-semibold">{{ t("alarm.list.noScope") }}</h3>
<p class="text-[var(--text-secondary)]">{{ t("alarm.list.noScopeHint") }}</p>
</div>
</div>
<div
v-else-if="emptyKind === 'empty'"
data-testid="alarm-empty"
class="flex flex-1 items-center justify-center rounded-lg border border-dashed border-[var(--border-default)] bg-white px-5 py-14 text-center"
>
<div>
<h3 class="mb-1.5 text-[15px] font-semibold">{{ t("alarm.list.empty") }}</h3>
<p class="text-[var(--text-secondary)]">{{ t("alarm.list.emptyHint") }}</p>
</div>
</div>
<div
v-else-if="emptyKind === 'no-match'"
data-testid="alarm-no-match"
class="flex flex-1 items-center justify-center rounded-lg border border-dashed border-[var(--border-default)] bg-white px-5 py-14 text-center"
>
<div>
<h3 class="mb-1.5 text-[15px] font-semibold">{{ t("alarm.list.noMatch") }}</h3>
<p class="text-[var(--text-secondary)]">{{ t("alarm.list.noMatchHint") }}</p>
</div>
</div>
<div v-else-if="showTable" class="min-h-0 flex-1" data-testid="alarm-table-wrap">
<ElTable
v-loading="phase === 'loading'"
height="100%"
:data="items"
row-key="id"
data-testid="alarm-table"
:default-sort="{ prop: 'last_occurred_at', order: 'descending' }"
@sort-change="onSortChange"
>
<ElTableColumn
prop="module_key"
:label="t('alarm.columns.module')"
@@ -338,25 +326,22 @@ onMounted(() => {
</div>
</template>
</ElTableColumn>
</ElTable>
</div>
</ElTable>
</div>
<footer
v-if="showPager"
data-testid="alarm-pagination"
class="flex shrink-0 items-center justify-end border-t border-[var(--border-subtle)] bg-white px-5 py-3"
>
<ElPagination
background
layout="total, sizes, prev, pager, next"
:total="total"
:page-size="pageSize"
:page-sizes="[...LIST_PAGE_SIZES]"
:current-page="page"
@current-change="onPageChange"
@size-change="onSizeChange"
/>
</footer>
</div>
<template v-if="showPager" #pagination>
<div data-testid="alarm-pagination">
<ElPagination
background
layout="total, sizes, prev, pager, next"
:total="total"
:page-size="pageSize"
:page-sizes="[...LIST_PAGE_SIZES]"
:current-page="page"
@current-change="onPageChange"
@size-change="onSizeChange"
/>
</div>
</template>
</ListPageShell>
</template>