|
@@ -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>
|