Browse Source

style(admin): B-14 根级管理页迁移 PageHeader + StatusTag/SectionTitle,删死样式(Users/TeacherConsult/TaskTemplates/GuideFamilyTask/GuidePackages/OperationLogs)

liaoxg 1 month ago
parent
commit
76890d912a

+ 9 - 10
cfc-web/src/views/GuideFamilyTask.vue

@@ -1,10 +1,9 @@
 <template>
 <template>
   <div class="page-container">
   <div class="page-container">
     <el-card>
     <el-card>
-      <div slot="header">
-        <span>家庭任务管理</span>
-        <el-button style="float: right" size="small" @click="loadData" :loading="loading">刷新</el-button>
-      </div>
+      <PageHeader slot="header" title="家庭任务管理">
+        <el-button size="small" @click="loadData" :loading="loading">刷新</el-button>
+      </PageHeader>
 
 
       <!-- 搜索 -->
       <!-- 搜索 -->
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
@@ -124,7 +123,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="status" label="状态" width="100">
         <el-table-column prop="status" label="状态" width="100">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="getStatusType(row.status)" size="small">{{ getStatusText(row.status) }}</el-tag>
+            <StatusTag :type="getStatusType(row.status)" :text="getStatusText(row.status)" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
@@ -132,7 +131,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="needReview" label="需审核" width="80">
         <el-table-column prop="needReview" label="需审核" width="80">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="row.needReview === 1 ? 'warning' : 'info'" size="small">{{ row.needReview === 1 ? '是' : '否' }}</el-tag>
+            <StatusTag :type="row.needReview === 1 ? 'warning' : 'info'" :text="row.needReview === 1 ? '是' : '否'" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('needReview', $event)">需审核<span v-if="sortIndex('needReview') !== null" class="sort-index" :class="sortClass('needReview') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('needReview') }}</span>{{ sortIcon('needReview') }}</span>
             <span class="sort-header" @click.stop="onSortClick('needReview', $event)">需审核<span v-if="sortIndex('needReview') !== null" class="sort-index" :class="sortClass('needReview') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('needReview') }}</span>{{ sortIcon('needReview') }}</span>
@@ -451,9 +450,9 @@ taskLoading: false,
   font-weight: bold;
   font-weight: bold;
   color: #333;
   color: #333;
 }
 }
-.overview-value.warning { color: #e6a23c; }
-.overview-value.success { color: #67c23a; }
-.overview-value.danger { color: #f56c6c; }
+.overview-value.warning { color: var(--adm-warning-text); }
+.overview-value.success { color: var(--adm-success-text); }
+.overview-value.danger { color: var(--adm-error-text); }
 .overview-label {
 .overview-label {
   font-size: 14px;
   font-size: 14px;
   color: #999;
   color: #999;
@@ -481,6 +480,6 @@ taskLoading: false,
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 </style>
 </style>

+ 8 - 11
cfc-web/src/views/GuidePackages.vue

@@ -1,12 +1,9 @@
 <template>
 <template>
   <div class="page-container">
   <div class="page-container">
     <el-card>
     <el-card>
-      <div slot="header">
-        <span>任务模板管理</span>
-        <el-button style="float: right" type="primary" size="small" icon="el-icon-plus" @click="handleCreate">
-          创建任务模板
-        </el-button>
-      </div>
+      <PageHeader slot="header" title="任务模板管理">
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="handleCreate">创建任务模板</el-button>
+      </PageHeader>
 
 
       <!-- 搜索 -->
       <!-- 搜索 -->
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
@@ -57,7 +54,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="status" label="状态" width="100">
         <el-table-column prop="status" label="状态" width="100">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="getStatusType(row.status)" size="small">{{ getStatusText(row.status) }}</el-tag>
+            <StatusTag :type="getStatusType(row.status)" :text="getStatusText(row.status)" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
@@ -158,7 +155,7 @@
         <el-table-column prop="duration" label="时长(分)" width="80"></el-table-column>
         <el-table-column prop="duration" label="时长(分)" width="80"></el-table-column>
         <el-table-column prop="isRequired" label="必选" width="60">
         <el-table-column prop="isRequired" label="必选" width="60">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="row.isRequired ? 'danger' : 'info'" size="small">{{ row.isRequired ? '是' : '否' }}</el-tag>
+            <StatusTag :type="row.isRequired ? 'danger' : 'info'" :text="row.isRequired ? '是' : '否'" size="small" />
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="操作" width="120">
         <el-table-column label="操作" width="120">
@@ -458,7 +455,7 @@ export default {
 
 
 <style scoped>
 <style scoped>
 
 
-.code-text { font-family: monospace; color: #409EFF; }
+.code-text { font-family: monospace; color: var(--adm-primary); }
 .avatar-uploader .el-upload {
 .avatar-uploader .el-upload {
   border: 1px dashed #d9d9d9;
   border: 1px dashed #d9d9d9;
   border-radius: 6px;
   border-radius: 6px;
@@ -467,7 +464,7 @@ export default {
   overflow: hidden;
   overflow: hidden;
 }
 }
 .avatar-uploader .el-upload:hover {
 .avatar-uploader .el-upload:hover {
-  border-color: #409EFF;
+  border-color: var(--adm-primary);
 }
 }
 .avatar-uploader-icon {
 .avatar-uploader-icon {
   font-size: 28px;
   font-size: 28px;
@@ -491,6 +488,6 @@ export default {
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 </style>
 </style>

+ 6 - 9
cfc-web/src/views/OperationLogs.vue

@@ -35,7 +35,8 @@
 
 
     <!-- 日志列表 -->
     <!-- 日志列表 -->
     <el-card>
     <el-card>
-            <div class="adm-table-wrap">
+      <PageHeader slot="header" title="操作日志" />
+      <div class="adm-table-wrap">
 <el-table height="100%" :data="logs" v-loading="loading" stripe>
 <el-table height="100%" :data="logs" v-loading="loading" stripe>
         <el-table-column prop="id" label="ID" width="80">
         <el-table-column prop="id" label="ID" width="80">
           <template slot="header">
           <template slot="header">
@@ -49,9 +50,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="operationType" label="操作类型" width="100">
         <el-table-column prop="operationType" label="操作类型" width="100">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag :type="getOperationTypeTag(scope.row.operationType)" size="small">
-              {{ scope.row.operationType }}
-            </el-tag>
+            <StatusTag :type="getOperationTypeTag(scope.row.operationType)" :text="scope.row.operationType" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('operationType', $event)">操作类型<span v-if="sortIndex('operationType') !== null" class="sort-index" :class="sortClass('operationType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('operationType') }}</span>{{ sortIcon('operationType') }}</span>
             <span class="sort-header" @click.stop="onSortClick('operationType', $event)">操作类型<span v-if="sortIndex('operationType') !== null" class="sort-index" :class="sortClass('operationType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('operationType') }}</span>{{ sortIcon('operationType') }}</span>
@@ -74,9 +73,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="responseStatus" label="状态" width="80">
         <el-table-column prop="responseStatus" label="状态" width="80">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag :type="scope.row.responseStatus === 200 ? 'success' : 'danger'" size="small">
-              {{ scope.row.responseStatus }}
-            </el-tag>
+            <StatusTag :type="scope.row.responseStatus === 200 ? 'success' : 'danger'" :text="String(scope.row.responseStatus)" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('responseStatus', $event)">状态<span v-if="sortIndex('responseStatus') !== null" class="sort-index" :class="sortClass('responseStatus') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('responseStatus') }}</span>{{ sortIcon('responseStatus') }}</span>
             <span class="sort-header" @click.stop="onSortClick('responseStatus', $event)">状态<span v-if="sortIndex('responseStatus') !== null" class="sort-index" :class="sortClass('responseStatus') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('responseStatus') }}</span>{{ sortIcon('responseStatus') }}</span>
@@ -223,7 +220,7 @@ export default {
         delete: 'danger',
         delete: 'danger',
         query: ''
         query: ''
       }
       }
-      return tags[type] || ''
+      return tags[type] || 'primary'
     },
     },
 
 
   }
   }
@@ -254,6 +251,6 @@ export default {
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 </style>
 </style>

+ 10 - 30
cfc-web/src/views/TaskTemplates.vue

@@ -1,26 +1,10 @@
 <template>
 <template>
   <div class="page-container">
   <div class="page-container">
     <el-card>
     <el-card>
-      <div slot="header">
-        <span>任务模板管理</span>
-        <div style="float: right">
-          <el-button
-            type="primary"
-            size="small"
-            icon="el-icon-plus"
-            @click="handleCreate"
-          >
-            新建模板
-          </el-button>
-          <el-button
-            size="small"
-            @click="handleRefresh"
-            :loading="loading"
-          >
-            刷新
-          </el-button>
-        </div>
-      </div>
+      <PageHeader slot="header" title="任务模板管理">
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="handleCreate">新建模板</el-button>
+        <el-button size="small" @click="handleRefresh" :loading="loading">刷新</el-button>
+      </PageHeader>
 
 
       <!-- 搜索和筛选 -->
       <!-- 搜索和筛选 -->
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
@@ -74,9 +58,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="category" label="分类" width="100">
         <el-table-column prop="category" label="分类" width="100">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag :type="getCategoryType(scope.row.category)" size="small">
-              {{ scope.row.category }}
-            </el-tag>
+            <StatusTag :type="getCategoryType(scope.row.category)" :text="scope.row.category" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('category', $event)">分类<span v-if="sortIndex('category') !== null" class="sort-index" :class="sortClass('category') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('category') }}</span>{{ sortIcon('category') }}</span>
             <span class="sort-header" @click.stop="onSortClick('category', $event)">分类<span v-if="sortIndex('category') !== null" class="sort-index" :class="sortClass('category') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('category') }}</span>{{ sortIcon('category') }}</span>
@@ -84,7 +66,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="points" label="积分" width="80">
         <el-table-column prop="points" label="积分" width="80">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag type="success">{{ scope.row.points }}</el-tag>
+            <StatusTag type="success" :text="String(scope.row.points || 0)" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('points', $event)">积分<span v-if="sortIndex('points') !== null" class="sort-index" :class="sortClass('points') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('points') }}</span>{{ sortIcon('points') }}</span>
             <span class="sort-header" @click.stop="onSortClick('points', $event)">积分<span v-if="sortIndex('points') !== null" class="sort-index" :class="sortClass('points') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('points') }}</span>{{ sortIcon('points') }}</span>
@@ -92,9 +74,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="difficulty" label="难度" width="100">
         <el-table-column prop="difficulty" label="难度" width="100">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag :type="getDifficultyType(scope.row.difficulty)" size="small">
-              {{ getDifficultyText(scope.row.difficulty) }}
-            </el-tag>
+            <StatusTag :type="getDifficultyType(scope.row.difficulty)" :text="getDifficultyText(scope.row.difficulty)" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('difficulty', $event)">难度<span v-if="sortIndex('difficulty') !== null" class="sort-index" :class="sortClass('difficulty') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('difficulty') }}</span>{{ sortIcon('difficulty') }}</span>
             <span class="sort-header" @click.stop="onSortClick('difficulty', $event)">难度<span v-if="sortIndex('difficulty') !== null" class="sort-index" :class="sortClass('difficulty') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('difficulty') }}</span>{{ sortIcon('difficulty') }}</span>
@@ -169,7 +149,7 @@
             <el-button
             <el-button
               type="text"
               type="text"
               size="small"
               size="small"
-              style="color: #F56C6C"
+              style="color: var(--adm-error)"
               @click="handleDelete(scope.row)"
               @click="handleDelete(scope.row)"
             >
             >
               删除
               删除
@@ -528,7 +508,7 @@ export default {
         '阅读': 'info',
         '阅读': 'info',
         '生活习惯': 'danger'
         '生活习惯': 'danger'
       }
       }
-      return types[category] || ''
+      return types[category] || 'primary'
     },
     },
     getDifficultyType(difficulty) {
     getDifficultyType(difficulty) {
       const types = {
       const types = {
@@ -560,6 +540,6 @@ export default {
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 </style>
 </style>

+ 6 - 9
cfc-web/src/views/TeacherConsult.vue

@@ -1,10 +1,9 @@
 <template>
 <template>
   <div class="teacher-consult-container page-container">
   <div class="teacher-consult-container page-container">
     <el-card>
     <el-card>
-      <div slot="header">
-        <span>家长咨询管理</span>
-        <el-button style="float: right" size="small" @click="loadMessages" :loading="loading">刷新</el-button>
-      </div>
+      <PageHeader slot="header" title="家长咨询管理">
+        <el-button size="small" @click="loadMessages" :loading="loading">刷新</el-button>
+      </PageHeader>
 
 
       <!-- 搜索筛选 -->
       <!-- 搜索筛选 -->
       <el-form :inline="true" style="margin-bottom: 15px">
       <el-form :inline="true" style="margin-bottom: 15px">
@@ -39,9 +38,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="status" label="状态" width="80">
         <el-table-column prop="status" label="状态" width="80">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="row.status === 'pending' ? 'warning' : 'success'" size="small">
-              {{ row.status === 'pending' ? '待回复' : '已回复' }}
-            </el-tag>
+            <StatusTag :type="row.status === 'pending' ? 'warning' : 'success'" :text="row.status === 'pending' ? '待回复' : '已回复'" size="small" />
           </template>
           </template>
           <template slot="header">
           <template slot="header">
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
             <span class="sort-header" @click.stop="onSortClick('status', $event)">状态<span v-if="sortIndex('status') !== null" class="sort-index" :class="sortClass('status') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('status') }}</span>{{ sortIcon('status') }}</span>
@@ -82,7 +79,7 @@
           <div class="label">咨询内容:</div>
           <div class="label">咨询内容:</div>
           <div class="content">{{ currentMessage.content }}</div>
           <div class="content">{{ currentMessage.content }}</div>
         </div>
         </div>
-        <el-divider></el-divider>
+        <SectionTitle title="我的回复" />
         <div v-if="currentMessage.status === 'replied'" class="reply-content">
         <div v-if="currentMessage.status === 'replied'" class="reply-content">
           <div class="label">我的回复:</div>
           <div class="label">我的回复:</div>
           <div class="content">{{ currentMessage.replyContent }}</div>
           <div class="content">{{ currentMessage.replyContent }}</div>
@@ -213,6 +210,6 @@ export default {
   white-space: nowrap;
   white-space: nowrap;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 </style>
 </style>

+ 9 - 19
cfc-web/src/views/Users.vue

@@ -1,18 +1,9 @@
 <template>
 <template>
   <div class="page-container">
   <div class="page-container">
     <el-card>
     <el-card>
-      <div slot="header">
-        <span>用户管理</span>
-        <el-button 
-          type="primary" 
-          size="small" 
-          style="float: right"
-          @click="handleRefresh"
-          :loading="loading"
-        >
-          刷新
-        </el-button>
-      </div>
+      <PageHeader slot="header" title="用户管理">
+        <el-button type="primary" size="small" @click="handleRefresh" :loading="loading">刷新</el-button>
+      </PageHeader>
 
 
       <!-- 搜索和筛选 -->
       <!-- 搜索和筛选 -->
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
       <el-form :inline="true" :model="searchForm" style="margin-bottom: 20px">
@@ -94,15 +85,14 @@
         </el-table-column>
         </el-table-column>
         <el-table-column label="角色" width="200">
         <el-table-column label="角色" width="200">
           <template slot-scope="scope">
           <template slot-scope="scope">
-            <el-tag
+            <StatusTag
               v-for="r in (scope.row.roles || [scope.row.role])"
               v-for="r in (scope.row.roles || [scope.row.role])"
               :key="r"
               :key="r"
               :type="getRoleType(r)"
               :type="getRoleType(r)"
+              :text="getRoleText(r)"
               size="small"
               size="small"
               style="margin-right:4px"
               style="margin-right:4px"
-            >
-              {{ getRoleText(r) }}
-            </el-tag>
+            />
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="familyId" label="家庭ID" width="100">
         <el-table-column prop="familyId" label="家庭ID" width="100">
@@ -112,7 +102,7 @@
         </el-table-column>
         </el-table-column>
         <el-table-column label="会员级别" width="100">
         <el-table-column label="会员级别" width="100">
           <template slot-scope="{ row }">
           <template slot-scope="{ row }">
-            <el-tag :type="memberLevelType(row.memberLevel)" size="small">{{ memberLevelLabel(row.memberLevel) }}</el-tag>
+            <StatusTag :type="memberLevelType(row.memberLevel)" :text="memberLevelLabel(row.memberLevel)" size="small" />
           </template>
           </template>
         </el-table-column>
         </el-table-column>
         <el-table-column label="推荐人" width="140">
         <el-table-column label="推荐人" width="140">
@@ -722,7 +712,7 @@ const res = await getUserList(params)
   font-size: 12px;
   font-size: 12px;
 }
 }
 .sort-header:hover {
 .sort-header:hover {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 .sort-tag {
 .sort-tag {
   margin-left: 8px;
   margin-left: 8px;
@@ -741,7 +731,7 @@ const res = await getUserList(params)
   color: #303133;
   color: #303133;
 }
 }
 .grant-target .el-icon-user {
 .grant-target .el-icon-user {
-  color: #409eff;
+  color: var(--adm-primary);
 }
 }
 .grant-family {
 .grant-family {
   color: #909399;
   color: #909399;