|
|
@@ -61,19 +61,33 @@
|
|
|
style="width: 100%"
|
|
|
:max-height="tableHeight"
|
|
|
>
|
|
|
- <el-table-column prop="id" label="ID" width="80"></el-table-column>
|
|
|
- <el-table-column prop="title" label="模板名称" min-width="200"></el-table-column>
|
|
|
+ <el-table-column prop="id" label="ID" width="80">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('id', $event)">ID<span v-if="sortIndex('id') !== null" class="sort-index" :class="sortClass('id') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('id') }}</span>{{ sortIcon('id') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="title" label="模板名称" min-width="200">
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('title', $event)">模板名称<span v-if="sortIndex('title') !== null" class="sort-index" :class="sortClass('title') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('title') }}</span>{{ sortIcon('title') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="category" label="分类" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag :type="getCategoryType(scope.row.category)" size="small">
|
|
|
{{ scope.row.category }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="points" label="积分" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag type="success">{{ scope.row.points }}</el-tag>
|
|
|
</template>
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="difficulty" label="难度" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -81,30 +95,45 @@
|
|
|
{{ getDifficultyText(scope.row.difficulty) }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
-<el-table-column prop="recommendedAge" label="推荐年龄" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.recommendedAge">{{ scope.row.recommendedAge }}岁+</span>
|
|
|
- <span v-else>-</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="duration" label="时长" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.duration">{{ scope.row.duration }}分钟</span>
|
|
|
- <span v-else>-</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="taskType" label="性质" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.taskType === 'recurring'" type="warning" size="small">循环</el-tag>
|
|
|
- <el-tag v-else type="info" size="small">一次性</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="needReview" label="需审核" width="80">
|
|
|
+ <el-table-column prop="recommendedAge" label="推荐年龄" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.recommendedAge">{{ scope.row.recommendedAge }}岁+</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('recommendedAge', $event)">推荐年龄<span v-if="sortIndex('recommendedAge') !== null" class="sort-index" :class="sortClass('recommendedAge') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('recommendedAge') }}</span>{{ sortIcon('recommendedAge') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="duration" label="时长" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.duration">{{ scope.row.duration }}分钟</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('duration', $event)">时长<span v-if="sortIndex('duration') !== null" class="sort-index" :class="sortClass('duration') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('duration') }}</span>{{ sortIcon('duration') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="taskType" label="性质" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.taskType === 'recurring'" type="warning" size="small">循环</el-tag>
|
|
|
+ <el-tag v-else type="info" size="small">一次性</el-tag>
|
|
|
+ </template>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('taskType', $event)">性质<span v-if="sortIndex('taskType') !== null" class="sort-index" :class="sortClass('taskType') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('taskType') }}</span>{{ sortIcon('taskType') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="needReview" label="需审核" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
<el-tag v-if="scope.row.needReview === 1" type="warning" size="small">是</el-tag>
|
|
|
<el-tag v-else type="info" size="small">否</el-tag>
|
|
|
</template>
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="isActive" label="状态" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -115,6 +144,9 @@
|
|
|
@change="handleStatusChange(scope.row)"
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
+ <template slot="header">
|
|
|
+ <span class="sort-header" @click.stop="onSortClick('isActive', $event)">状态<span v-if="sortIndex('isActive') !== null" class="sort-index" :class="sortClass('isActive') === 'sort-asc' ? 'sort-asc-badge' : 'sort-desc-badge'">{{ sortIndex('isActive') }}</span>{{ sortIcon('isActive') }}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="createdAt" label="创建时间" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -276,7 +308,7 @@ export default {
|
|
|
loading: false,
|
|
|
submitting: false,
|
|
|
tableData: [],
|
|
|
- sortableColumns: { createdAt: '创建时间' },
|
|
|
+ sortableColumns: { id: 'ID', title: '模板名称', category: '分类', points: '积分', difficulty: '难度', recommendedAge: '推荐年龄', duration: '时长', taskType: '性质', needReview: '需审核', isActive: '状态', createdAt: '创建时间' },
|
|
|
searchForm: {
|
|
|
category: '',
|
|
|
difficulty: '',
|