Browse Source

style(admin): B-5 组件铺开 - ProductEdit/ReportTemplateManage 分区 SectionTitle + 状态 StatusTag + 页头 PageHeader

liaoxg 1 month ago
parent
commit
37c0aba31c

+ 2 - 10
cfc-web/src/views/admin/ProductEdit.vue

@@ -81,7 +81,7 @@
 
         <!-- 套餐商品扩展信息 -->
         <template v-if="form.productType === 'bundle'">
-          <el-divider content-position="left">套餐组成</el-divider>
+          <SectionTitle title="套餐组成" />
           <el-form-item label="组成商品">
             <div v-for="(item, idx) in bundleItems" :key="'bi' + idx" style="display:flex; align-items:center; margin-bottom:8px; gap:8px; flex-wrap:wrap;">
               <el-select v-model="item.childProductId" filterable remote placeholder="搜索子商品" :remote-method="(q) => searchBundleProduct(q, idx)" style="width:220px;" @change="(pid) => onBundleProductChange(pid, idx)">
@@ -99,7 +99,7 @@
         </template>
 
         <!-- 关联成长档案 -->
-        <el-divider content-position="left">关联成长档案</el-divider>
+        <SectionTitle title="关联成长档案" />
         <el-form-item label="关联成长档案">
           <el-switch
             v-model="growthArchive.enabled"
@@ -1423,12 +1423,4 @@ async loadGiftRule(productId) {
   font-weight: 500;
   color: rgba(0, 0, 0, 0.65);
 }
-.product-edit /deep/ .el-divider__text {
-  font-size: 14px;
-  font-weight: 500;
-  color: rgba(0, 0, 0, 0.88);
-}
-.product-edit /deep/ .el-divider--horizontal {
-  margin: 24px 0;
-}
 </style>

+ 7 - 18
cfc-web/src/views/admin/ReportTemplateManage.vue

@@ -2,10 +2,9 @@
   <div class="report-template-page admin-page">
     <!-- Tab 1: 模板列表 -->
     <el-card v-show="activeTab === 'list'">
-      <div slot="header">
-        <span>报告模板管理</span>
+      <PageHeader slot="header" title="报告模板管理">
         <el-button size="small" type="primary" @click="openEditor(null)">+ 新增模板</el-button>
-      </div>
+      </PageHeader>
             <div class="adm-table-wrap">
 <el-table :data="templates" v-loading="loading" border stripe height="100%">
         <el-table-column prop="id" label="ID" width="60">
@@ -23,9 +22,7 @@
         </el-table-column>
         <el-table-column label="状态" width="80">
           <template slot-scope="{ row }">
-            <el-tag :type="row.isActive === 1 ? 'success' : 'info'" size="small">
-              {{ row.isActive === 1 ? '启用' : '停用' }}
-            </el-tag>
+            <StatusTag :type="row.isActive === 1 ? 'success' : 'info'" :text="row.isActive === 1 ? '启用' : '停用'" size="small" />
           </template>
         </el-table-column>
         <el-table-column prop="updatedAt" label="更新时间" width="170">
@@ -46,10 +43,9 @@
 
     <!-- Tab 2: 模板编辑器 -->
     <el-card v-show="activeTab === 'editor'">
-      <div slot="header">
-        <span>{{ isEdit ? '编辑模板' : '新增模板' }}</span>
+      <PageHeader slot="header" :title="isEdit ? '编辑模板' : '新增模板'">
         <el-button size="small" @click="activeTab = 'list'">返回列表</el-button>
-      </div>
+      </PageHeader>
 
       <div class="report-template-form-wrap">
       <el-form ref="form" :model="form" label-width="110px" style="max-width:900px">
@@ -72,7 +68,7 @@
         </el-row>
 
         <!-- 固定块编辑区 -->
-        <el-divider content-position="left">固定展示块(按顺序渲染)</el-divider>
+        <SectionTitle title="固定展示块(按顺序渲染)" />
         <div class="block-list">
           <div v-for="(block, bIdx) in form.fixedBlocks" :key="bIdx" class="block-item">
             <div class="block-header">
@@ -138,7 +134,7 @@
         <el-button size="small" type="dashed" @click="addBlock" style="margin-top:8px">+ 添加固定块</el-button>
 
         <!-- 自由显示配置 -->
-        <el-divider content-position="left">自由显示配置</el-divider>
+        <SectionTitle title="自由显示配置" />
         <el-form-item label="启用自由显示">
           <el-switch v-model="form.freeDisplay.enabled" :active-value="true" :inactive-value="false" />
           <span class="hint-text">开启后,未配置在固定块的指标将追加到末尾</span>
@@ -419,13 +415,6 @@ export default {
 .block-title-display { color: #333; font-size: 14px; }
 .block-del { margin-left: auto; }
 .hint-text { margin-left: 12px; color: var(--adm-text-45); font-size: 12px; }
-.block-list { border: 1px solid #ebeef5; border-radius: 4px; margin-bottom: 12px; }
-.block-item { border-bottom: 1px solid var(--adm-border-split); padding: 12px 16px; }
-.block-item:last-child { border-bottom: none; }
-.block-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
-.block-type-tag { background: #f0f9ff; color: #2c7be5; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
-.block-title-display { color: #333; font-size: 14px; }
-.block-del { margin-left: auto; }
 .block-move-up, .block-move-dn { color: var(--adm-text-45); }
 .preview-block { background: var(--adm-bg-container); border: 1px solid #eee; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
 .preview-block-title { font-weight: bold; font-size: 15px; margin-bottom: 10px; color: var(--adm-text-88); }