Browse Source

style(admin): B-16 报告/维度/画像类页面接入 PageHeader + StatusTag 并令牌化

- 10 页: ButlerAssignments/CategoryManage/GrowthTaskManagement/InnatePortraitConfig/KnowledgeTag/NumSoulDetailConfig/ReportAutoLearn/ReportParserImport/dimension-config/dimension
- el-card header → PageHeader(带操作按钮)
- 状态/类型/维度/级别/排除正向 el-tag → StatusTag, 空串型值改 primary
- 成功弹窗图标 #67C23A → --adm-success, #f56c6c 文本 → --adm-error-text
- .sort-header:hover #409eff → --adm-primary, .detail-pre/.script-preview 底色/描边令牌化
- 删除页面级重复 text-muted/adm-num 死样式
- 构建 dist_verify 通过
liaoxg 1 month ago
parent
commit
1b2a571b3f

+ 3 - 5
cfc-web/src/views/admin/ButlerAssignments.vue

@@ -1,9 +1,7 @@
 <template>
   <div class="app-container">
     <el-card shadow="never">
-      <div slot="header">
-        <span>管家分配管理</span>
-      </div>
+      <PageHeader slot="header" title="管家分配管理" />
             <div class="adm-table-wrap">
 <el-table v-loading="loading" :data="records" border stripe height="100%">
         <el-table-column prop="id" label="ID" width="80">
@@ -31,7 +29,7 @@
             <span class="sort-header" @click.stop="onSortClick('level', $event)">订阅级别<span v-if="sortIndex('level') !== null" class="sort-index" :class="sortClass('level') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('level') }}</span>{{ sortIcon('level') }}</span>
           </template>
           <template slot-scope="{ row }">
-            <el-tag :type="row.level === 'L2' ? 'warning' : 'info'" size="small">{{ row.level }}</el-tag>
+            <StatusTag :type="row.level === 'L2' ? 'warning' : 'info'" :text="row.level" size="small" />
           </template>
         </el-table-column>
         <el-table-column label="绑定时间" width="170">
@@ -124,6 +122,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 </style>

+ 4 - 7
cfc-web/src/views/admin/CategoryManage.vue

@@ -1,13 +1,10 @@
 <template>
   <div class="category-manage admin-page">
     <el-card>
-      <div slot="header">
-        <span>商品分类管理</span>
-        <div style="float: right; display: flex; gap: 10px;">
-          <el-input v-model="keyword" placeholder="搜索分类名称..." prefix-icon="el-icon-search" size="small" clearable style="width: 200px;" />
-          <el-button type="primary" size="mini" icon="el-icon-plus" @click="handleCreate">新增分类</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="商品分类管理">
+        <el-input v-model="keyword" placeholder="搜索分类名称..." prefix-icon="el-icon-search" size="small" clearable style="width: 200px;" />
+        <el-button type="primary" size="mini" icon="el-icon-plus" @click="handleCreate">新增分类</el-button>
+      </PageHeader>
 
       <div class="category-layout">
         <div class="category-tree-panel">

+ 13 - 25
cfc-web/src/views/admin/GrowthTaskManagement.vue

@@ -1,25 +1,15 @@
 <template>
   <div class="growth-task admin-page">
     <el-card>
-      <div slot="header">
-        <span>成长任务管理</span>
-        <div style="float:right">
-          <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" style="width:200px;margin-right:12px" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" />
-          <el-select
-            v-model="filter.status"
-            placeholder="状态筛选"
-            size="mini"
-            style="margin-right:12px;width:130px"
-            clearable
-            @change="loadTasks"
-          >
-            <el-option label="全部状态" value="" />
-            <el-option label="开启" value="enabled" />
-            <el-option label="关闭" value="disabled" />
-          </el-select>
-          <el-button type="primary" size="mini" @click="openCreate">创建任务</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="成长任务管理">
+        <el-input v-model="keyword" placeholder="搜索..." prefix-icon="el-icon-search" style="width:200px" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" />
+        <el-select v-model="filter.status" placeholder="状态筛选" size="small" style="width:130px" clearable @change="loadTasks">
+          <el-option label="全部状态" value="" />
+          <el-option label="开启" value="enabled" />
+          <el-option label="关闭" value="disabled" />
+        </el-select>
+        <el-button type="primary" size="small" @click="openCreate">创建任务</el-button>
+      </PageHeader>
             <div class="adm-table-wrap">
 <el-table height="100%" :data="tasks" v-loading="loading" border stripe>
         <el-table-column prop="id" label="ID" width="80">
@@ -37,7 +27,7 @@
             <span class="sort-header" @click.stop="onSortClick('dimensionCode', $event)">关联维度<span v-if="sortIndex('dimensionCode') !== null" class="sort-index" :class="sortClass('dimensionCode') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('dimensionCode') }}</span>{{ sortIcon('dimensionCode') }}</span>
           </template>
           <template slot-scope="{ row }">
-            <el-tag size="mini" :type="dimensionType(row.dimensionCode)">{{ dimensionLabel(row.dimensionCode) }}</el-tag>
+            <StatusTag size="mini" :type="dimensionType(row.dimensionCode)" :text="dimensionLabel(row.dimensionCode)" />
           </template>
         </el-table-column>
         <el-table-column prop="type" label="任务类型" width="100" />
@@ -55,9 +45,7 @@
         <el-table-column label="奖励" width="160">
           <template slot-scope="{ row }">
             <div v-if="row.rewardItems && row.rewardItems.length">
-              <el-tag size="mini" v-for="(ri, i) in row.rewardItems" :key="i" style="margin:1px">
-                {{ ri.type }}:{{ ri.value }}
-              </el-tag>
+              <StatusTag size="mini" v-for="(ri, i) in row.rewardItems" :key="i" :text="ri.type + ':' + ri.value" style="margin:1px" />
             </div>
             <span v-else style="color:#999">—</span>
           </template>
@@ -221,7 +209,7 @@ export default {
       return (DIMENSION_CONFIG[code] && DIMENSION_CONFIG[code].label) || code || '—'
     },
     dimensionType(code) {
-      return (DIMENSION_CONFIG[code] && DIMENSION_CONFIG[code].type) || ''
+      return (DIMENSION_CONFIG[code] && DIMENSION_CONFIG[code].type) || 'primary'
     },
     getEmptyTaskForm() {
       return {
@@ -385,7 +373,7 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 .sort-tag {
   margin-left: 8px;

+ 3 - 4
cfc-web/src/views/admin/InnatePortraitConfig.vue

@@ -1,10 +1,9 @@
 <template>
   <div class="app-container">
     <el-card shadow="never">
-      <div slot="header">
-        <span>先天画像来源权重配置</span>
-        <el-button style="float: right" type="primary" size="small" @click="load">刷新</el-button>
-      </div>
+      <PageHeader slot="header" title="先天画像来源权重配置">
+        <el-button type="primary" size="small" @click="load">刷新</el-button>
+      </PageHeader>
             <div class="adm-table-wrap">
 <el-table :data="list" border stripe height="100%">
         <el-table-column prop="sourceName" label="来源" width="120" />

+ 7 - 12
cfc-web/src/views/admin/KnowledgeTag.vue

@@ -1,13 +1,10 @@
 <template>
   <div class="knowledge-tag admin-page">
     <el-card>
-      <div slot="header">
-        <span>知识标签</span>
-        <div style="float: right; display: flex; gap: 10px;">
-          <el-input v-model="keyword" placeholder="搜索标签名称..." prefix-icon="el-icon-search" size="small" clearable style="width: 200px;" />
-          <el-button type="primary" size="small" @click="handleCreate">+ 新增标签</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="知识标签">
+        <el-input v-model="keyword" placeholder="搜索标签名称..." prefix-icon="el-icon-search" size="small" clearable style="width: 200px;" />
+        <el-button type="primary" size="small" @click="handleCreate">+ 新增标签</el-button>
+      </PageHeader>
             <div class="adm-table-wrap">
 <el-table height="100%" :data="filteredTags" v-loading="loading" border stripe>
         <el-table-column prop="id" label="ID" width="70">
@@ -22,9 +19,7 @@
         </el-table-column>
         <el-table-column label="类型" width="140">
           <template slot-scope="{ row }">
-            <el-tag size="small" :type="row.tagType === 'category' ? 'success' : 'info'">
-              {{ row.tagType === 'category' ? '分类标签' : '通用标签' }}
-            </el-tag>
+            <StatusTag size="small" :type="row.tagType === 'category' ? 'success' : 'info'" :text="row.tagType === 'category' ? '分类标签' : '通用标签'" />
           </template>
         </el-table-column>
         <el-table-column prop="createdAt" label="创建时间" width="180">
@@ -69,7 +64,7 @@
 
     <el-dialog title="操作成功" :visible.sync="successDialogVisible" width="400px" :close-on-click-modal="false">
       <div style="text-align:center;padding:10px 0">
-        <i class="el-icon-success" style="color:#67C23A;font-size:32px"></i>
+        <i class="el-icon-success" style="color:var(--adm-success);font-size:32px"></i>
         <p style="margin:12px 0 0;font-size:16px;color:#303133">保存成功</p>
       </div>
       <div slot="footer">
@@ -210,6 +205,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 </style>

+ 10 - 13
cfc-web/src/views/admin/NumSoulDetailConfig.vue

@@ -1,18 +1,15 @@
 <template>
   <div class="app-container">
     <el-card shadow="never">
-      <div slot="header">
-        <span>数字能量配置</span>
-        <div style="float: right">
-          <el-select v-model="filterType" placeholder="筛选类型" clearable size="small" style="width: 160px" @change="load">
-            <el-option label="生命灵数" value="life_path" />
-            <el-option label="天赋数" value="talent" />
-            <el-option label="生日数" value="birthday" />
-            <el-option label="命运数" value="destiny" />
-          </el-select>
-          <el-button type="primary" size="small" style="margin-left: 8px" @click="showCreate">新增</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="数字能量配置">
+        <el-select v-model="filterType" placeholder="筛选类型" clearable size="small" style="width: 160px" @change="load">
+          <el-option label="生命灵数" value="life_path" />
+          <el-option label="天赋数" value="talent" />
+          <el-option label="生日数" value="birthday" />
+          <el-option label="命运数" value="destiny" />
+        </el-select>
+        <el-button type="primary" size="small" @click="showCreate">新增</el-button>
+      </PageHeader>
             <div class="adm-table-wrap">
 <el-table :data="list" border stripe height="100%">
         <el-table-column prop="numberType" label="类型" width="110">
@@ -31,7 +28,7 @@
         <el-table-column label="操作" width="140">
           <template slot-scope="scope">
             <el-button type="text" @click="showEdit(scope.row)">编辑</el-button>
-            <el-button type="text" style="color: #f56c6c" @click="remove(scope.row)">删除</el-button>
+            <el-button type="text" style="color: var(--adm-error)" @click="remove(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>

+ 7 - 12
cfc-web/src/views/admin/ReportAutoLearn.vue

@@ -1,12 +1,9 @@
 <template>
   <div class="report-autolearn admin-page">
     <el-card>
-      <div slot="header">
-        <span>报告自学习</span>
-        <div style="float: right;">
-          <el-button size="small" @click="fetchClusters" icon="el-icon-refresh">刷新</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="报告自学习">
+        <el-button size="small" @click="fetchClusters" icon="el-icon-refresh">刷新</el-button>
+      </PageHeader>
 
       <el-alert title='自学习机制:当同一类型的未知报告积累到3份后,系统自动标记为"可生成"状态,管理员可在此生成报告类型和指纹规则。' type='info' :closable='false' show-icon style='margin-bottom: 16px;' />
 
@@ -29,9 +26,7 @@
         </el-table-column>
         <el-table-column label="状态" width="100">
           <template slot-scope="{ row }">
-            <el-tag :type="row.status === 'ready' ? 'warning' : 'success'" size="small">
-              {{ row.status === 'ready' ? '可生成' : '已生成' }}
-            </el-tag>
+            <StatusTag :type="row.status === 'ready' ? 'warning' : 'success'" :text="row.status === 'ready' ? '可生成' : '已生成'" />
           </template>
         </el-table-column>
         <el-table-column prop="generatedTypeId" label="类型ID" width="140">
@@ -131,8 +126,8 @@ export default {
 
 <style scoped>
 .detail-pre {
-  background: #f5f7fa;
-  border: 1px solid #e4e7ed;
+  background: var(--adm-bg-header);
+  border: 1px solid var(--adm-border-split);
   border-radius: 4px;
   padding: 10px;
   max-height: 300px;
@@ -148,6 +143,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 </style>

+ 8 - 11
cfc-web/src/views/admin/ReportParserImport.vue

@@ -1,12 +1,9 @@
 <template>
   <div class="report-import admin-page">
     <el-card>
-      <div slot="header">
-        <span>解析器导入管理</span>
-        <div style="float: right; display: flex; gap: 10px;">
-          <el-button type="primary" size="small" icon="el-icon-upload2" @click="uploadDialogVisible = true">上传导入包</el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="解析器导入管理">
+        <el-button type="primary" size="small" icon="el-icon-upload2" @click="uploadDialogVisible = true">上传导入包</el-button>
+      </PageHeader>
 
             <div class="adm-table-wrap">
 <el-table :data="imports" v-loading="loading" border stripe height="100%">
@@ -27,7 +24,7 @@
         </el-table-column>
         <el-table-column label="状态" width="100">
           <template slot-scope="{ row }">
-            <el-tag :type="statusType(row.status)" size="small">{{ statusText(row.status) }}</el-tag>
+            <StatusTag :type="statusType(row.status)" :text="statusText(row.status)" />
           </template>
         </el-table-column>
         <el-table-column prop="createdAt" label="导入时间" width="180">
@@ -82,7 +79,7 @@
           <el-table-column prop="weight" label="权重" width="70" />
           <el-table-column label="类型" width="80">
             <template slot-scope="{ row }">
-              <el-tag :type="row.isExclusion ? 'danger' : 'success'" size="mini">{{ row.isExclusion ? '排除' : '正向' }}</el-tag>
+              <StatusTag size="mini" :type="row.isExclusion ? 'danger' : 'success'" :text="row.isExclusion ? '排除' : '正向'" />
             </template>
           </el-table-column>
         <h4>解析脚本</h4>
@@ -189,8 +186,8 @@ export default {
 
 <style scoped>
 .script-preview {
-  background: #f5f7fa;
-  border: 1px solid #e4e7ed;
+  background: var(--adm-bg-header);
+  border: 1px solid var(--adm-border-split);
   border-radius: 4px;
   padding: 10px;
   max-height: 300px;
@@ -206,6 +203,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 </style>

+ 6 - 7
cfc-web/src/views/admin/dimension-config.vue

@@ -1,17 +1,16 @@
 <template>
   <div class="norm-config admin-page">
     <el-card>
-      <div slot="header">
-        <span>健康维度常模配置</span>
-        <el-input v-model="keyword" placeholder="搜索维度/来源..." prefix-icon="el-icon-search" style="width:200px;float:right;margin-right:8px" clearable @keyup.enter.native="loadData" @clear="loadData" />
-        <el-button style="float: right;margin-right:8px" type="primary" size="small" @click="handleCreate">+ 添加常模</el-button>
-    </div>
+      <PageHeader slot="header" title="健康维度常模配置">
+        <el-input v-model="keyword" placeholder="搜索维度/来源..." prefix-icon="el-icon-search" style="width:200px" clearable @keyup.enter.native="loadData" @clear="loadData" />
+        <el-button type="primary" size="small" @click="handleCreate">+ 添加常模</el-button>
+      </PageHeader>
         <div class="adm-table-wrap">
 <el-table :data="filteredNorms" stripe v-loading="loading" height="100%">
         <el-table-column prop="id" label="ID" width="60"></el-table-column>
         <el-table-column prop="dimension" label="维度" width="100">
           <template slot-scope="scope">
-            <el-tag size="mini">{{ scope.row.dimension }}</el-tag>
+            <StatusTag size="mini" :text="scope.row.dimension" />
           </template>
         </el-table-column>
         <el-table-column prop="gender" label="性别" width="80">
@@ -119,7 +118,7 @@
 
     <el-dialog title="操作成功" :visible.sync="successDialogVisible" width="400px" :close-on-click-modal="false">
       <div style="text-align:center;padding:10px 0">
-        <i class="el-icon-success" style="color:#67C23A;font-size:32px"></i>
+        <i class="el-icon-success" style="color:var(--adm-success);font-size:32px"></i>
         <p style="margin:12px 0 0;font-size:16px;color:#303133">保存成功</p>
       </div>
       <div slot="footer">

+ 6 - 11
cfc-web/src/views/admin/dimension/index.vue

@@ -1,11 +1,10 @@
 <template>
   <div class="dimension-manage admin-page">
     <el-card>
-      <div slot="header">
-        <span>维度配置管理</span>
+      <PageHeader slot="header" title="维度配置管理">
         <el-input v-model="keyword" placeholder="搜索维度..." prefix-icon="el-icon-search" style="width:200px" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" />
-        <el-button style="float: right; margin-left: 10px" type="primary" size="small" @click="handleCreate">+ 新增维度</el-button>
-</div>
+        <el-button type="primary" size="small" @click="handleCreate">+ 新增维度</el-button>
+      </PageHeader>
 
             <div class="adm-table-wrap">
 <el-table :data="filteredData" stripe v-loading="loading" height="100%">
@@ -14,17 +13,13 @@
         <el-table-column prop="dimensionName" label="名称" width="160" />
         <el-table-column prop="dimensionType" label="类型" width="100">
           <template slot-scope="scope">
-            <el-tag :type="scope.row.dimensionType === 'five' ? 'primary' : 'success'" size="small">
-              {{ scope.row.dimensionType }}
-            </el-tag>
+            <StatusTag :type="scope.row.dimensionType === 'five' ? 'primary' : 'success'" :text="scope.row.dimensionType" size="small" />
           </template>
         </el-table-column>
         <el-table-column prop="sort" label="排序" width="80" align="center" />
         <el-table-column prop="enabled" label="状态" width="80" align="center">
           <template slot-scope="scope">
-            <el-tag :type="scope.row.enabled === 1 ? 'success' : 'info'" size="small">
-              {{ scope.row.enabled === 1 ? '启用' : '禁用' }}
-            </el-tag>
+            <StatusTag :type="scope.row.enabled === 1 ? 'success' : 'info'" :text="scope.row.enabled === 1 ? '启用' : '禁用'" size="small" />
           </template>
         </el-table-column>
         <el-table-column prop="difyDatasetId" label="Dify Dataset ID" min-width="180" show-overflow-tooltip />
@@ -80,7 +75,7 @@
 
     <el-dialog title="操作成功" :visible.sync="successDialogVisible" width="400px" :close-on-click-modal="false">
       <div style="text-align:center;padding:10px 0">
-        <i class="el-icon-success" style="color:#67C23A;font-size:32px"></i>
+        <i class="el-icon-success" style="color:var(--adm-success);font-size:32px"></i>
         <p style="margin:12px 0 0;font-size:16px;color:#303133">保存成功</p>
       </div>
       <div slot="footer">