Browse Source

style(admin): B-6 组件铺开 - ProductPpoint/ProductProfitRate/SupplierProduct 页头 PageHeader + 状态 StatusTag + 删死 CSS

liaoxg 1 month ago
parent
commit
b466b6048f

+ 17 - 36
cfc-web/src/views/admin/ProductPpointManage.vue

@@ -1,23 +1,20 @@
 <template>
   <div class="product-ppoint admin-page">
-    <div class="header">
-      <h2>P点(可分配利润)配置</h2>
-      <div class="filters">
-        <el-input v-model="searchText" placeholder="商品名称搜索" prefix-icon="el-icon-search" style="width: 200px;" clearable @keyup.enter.native="loadList" />
-        <el-button type="primary" @click="loadList">查询</el-button>
-        <el-button type="success" @click="openAddDialog">新增配置</el-button>
-        <el-tag
-          v-if="sortState.length > 0"
-          closable
-          size="mini"
-          class="sort-tag"
-          @close="clearSort"
-          @click="clearSort"
-        >
-          {{ sortLabel }}
-        </el-tag>
-      </div>
-    </div>
+    <PageHeader title="P点(可分配利润)配置" subtitle="按商品维护可分配利润基点">
+      <el-input v-model="searchText" placeholder="商品名称搜索" prefix-icon="el-icon-search" style="width: 200px;" clearable @keyup.enter.native="loadList" />
+      <el-button type="primary" @click="loadList">查询</el-button>
+      <el-button type="success" @click="openAddDialog">新增配置</el-button>
+      <el-tag
+        v-if="sortState.length > 0"
+        closable
+        size="mini"
+        class="sort-tag"
+        @close="clearSort"
+        @click="clearSort"
+      >
+        {{ sortLabel }}
+      </el-tag>
+    </PageHeader>
         <div class="adm-table-wrap">
 <el-table height="100%" :data="list" v-loading="loading" border stripe>
       <el-table-column prop="id" label="ID" width="70" />
@@ -69,9 +66,7 @@
       </el-table-column>
       <el-table-column label="状态" width="80">
         <template slot-scope="{ row }">
-          <el-tag v-if="row.startDate" :type="isEffectived(row.startDate) ? 'success' : 'warning'" size="small">
-            {{ isEffectived(row.startDate) ? '生效中' : '待生效' }}
-          </el-tag>
+          <StatusTag v-if="row.startDate" :type="isEffectived(row.startDate) ? 'success' : 'warning'" :text="isEffectived(row.startDate) ? '生效中' : '待生效'" size="small" />
           <span v-else>-</span>
         </template>
       </el-table-column>
@@ -259,20 +254,6 @@ export default {
 .product-ppoint {
   padding: 20px;
 }
-.header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 20px;
-}
-.header h2 {
-  margin: 0;
-}
-.filters {
-  display: flex;
-  gap: 10px;
-  align-items: center;
-}
 .product-thumb {
   width: 50px;
   height: 50px;
@@ -287,7 +268,7 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 .sort-tag {
   margin-left: 8px;

+ 11 - 31
cfc-web/src/views/admin/ProductProfitRate.vue

@@ -1,18 +1,15 @@
 <template>
   <div class="product-profit-rate admin-page">
-    <div class="header">
-      <h2>产品利润率设置</h2>
-      <div class="filters">
-        <el-input v-model="searchText" placeholder="商品名称搜索" prefix-icon="el-icon-search" style="width: 200px;" clearable @keyup.enter.native="loadList" />
-        <el-select v-model="typeFilter" placeholder="商品类型" @change="loadList" style="width: 140px;">
-          <el-option label="全部类型" value="" />
-          <el-option label="实物商品" value="physical" />
-          <el-option label="虚拟商品" value="virtual" />
-          <el-option label="优惠券" value="coupon" />
-        </el-select>
-        <el-button type="primary" @click="loadList">查询</el-button>
-      </div>
-      </div>
+    <PageHeader title="产品利润率设置" subtitle="按商品类型维护利润率基点">
+      <el-input v-model="searchText" placeholder="商品名称搜索" prefix-icon="el-icon-search" style="width: 200px;" clearable @keyup.enter.native="loadList" />
+      <el-select v-model="typeFilter" placeholder="商品类型" @change="loadList" style="width: 140px;">
+        <el-option label="全部类型" value="" />
+        <el-option label="实物商品" value="physical" />
+        <el-option label="虚拟商品" value="virtual" />
+        <el-option label="优惠券" value="coupon" />
+      </el-select>
+      <el-button type="primary" @click="loadList">查询</el-button>
+    </PageHeader>
         <div class="adm-table-wrap">
 <el-table height="100%" :data="list" v-loading="loading" border stripe>
       <el-table-column prop="id" label="ID" width="70">
@@ -177,29 +174,12 @@ export default {
 .product-profit-rate {
   padding: 20px;
 }
-.header {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 20px;
-}
-.header h2 {
-  margin: 0;
-}
-.filters {
-  display: flex;
-  gap: 10px;
-  align-items: center;
-}
 .product-thumb {
   width: 50px;
   height: 50px;
   object-fit: cover;
   border-radius: 4px;
 }
-.text-muted {
-  color: #999;
-}
 .sort-header {
   cursor: pointer;
   user-select: none;
@@ -207,6 +187,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 </style>

+ 3 - 9
cfc-web/src/views/admin/SupplierProductManage.vue

@@ -68,7 +68,7 @@
           <el-table-column prop="salesCount" label="销量" width="70" />
           <el-table-column label="状态" width="90">
             <template slot-scope="{ row }">
-              <el-tag :type="statusType(row.status)" size="mini">{{ statusLabel(row.status) }}</el-tag>
+              <StatusTag :type="statusType(row.status)" :text="statusLabel(row.status)" size="mini" />
             </template>
           </el-table-column>
           <el-table-column prop="createdAt" label="创建时间" width="160">
@@ -136,7 +136,6 @@ export default {
         size: 20,
         total: 0
       },
-      sortableColumns: { id: 'ID', name: '商品名称', createdAt: '创建时间' },
       sortableColumns: { name: '商品名称', createdAt: '创建时间', id: 'ID' }
     }
   },
@@ -250,7 +249,7 @@ export default {
   cursor: pointer;
 }
 .stock-warning {
-  color: #f56c6c;
+  color: var(--adm-error);
   font-weight: bold;
 }
 .header-search {
@@ -263,11 +262,6 @@ export default {
   font-size: 12px;
 }
 .sort-header:hover {
-  color: #409eff;
-}
-.sort-tag {
-  margin-left: 8px;
-  cursor: pointer;
-  white-space: nowrap;
+  color: var(--adm-primary);
 }
 </style>