|
|
@@ -2,18 +2,45 @@
|
|
|
<el-card shadow="hover" class="margin">
|
|
|
<div class="full-width flex flex-center flex-justify-start">
|
|
|
<el-button-group>
|
|
|
- <el-button type="primary" icon="el-icon-edit">全部任务</el-button>
|
|
|
- <el-button type="primary" plain icon="el-icon-share"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :plain="type !== 1"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="changeType(1)"
|
|
|
+ >全部任务
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :plain="type !== 2"
|
|
|
+ icon="el-icon-share"
|
|
|
+ @click="changeType(2)"
|
|
|
>我创建的
|
|
|
</el-button>
|
|
|
- <el-button type="primary" plain icon="el-icon-delete"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :plain="type !== 3"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="changeType(3)"
|
|
|
>我执行的
|
|
|
</el-button>
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
- <div class="flex flex-center flex-justify-start flex-col full-width">
|
|
|
+ <div class="flex flex-center flex-justify-end flex-col full-width mt-20">
|
|
|
<div class="full-width flex flex-justify-start">
|
|
|
- <span>按时间排序</span>
|
|
|
+ <el-dropdown @command="dropDown">
|
|
|
+ <span class="flex flex-center">
|
|
|
+ 按时间排序
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
+ <arrow-down />
|
|
|
+ </el-icon>
|
|
|
+ </span>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="info">按时间排序</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="logout">按项目排序</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</div>
|
|
|
<div class="full-width">
|
|
|
<task-table
|
|
|
@@ -24,6 +51,16 @@
|
|
|
@refresh="getTaskList"
|
|
|
></task-table>
|
|
|
</div>
|
|
|
+ <el-divider />
|
|
|
+ <div class="flex flex-center flex-justify-end full-width">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ v-model:current-page="page.curren"
|
|
|
+ @current-change="pageChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<task type="view" ref="task" :task="task"></task>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -44,6 +81,11 @@ export default {
|
|
|
components: { Task, TaskTable },
|
|
|
data() {
|
|
|
return {
|
|
|
+ page: {
|
|
|
+ current: 1,
|
|
|
+ size: 10
|
|
|
+ },
|
|
|
+ type: 1,
|
|
|
data: [],
|
|
|
task: [],
|
|
|
taskId: '',
|
|
|
@@ -83,8 +125,13 @@ export default {
|
|
|
this.getTaskList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeType(type) {
|
|
|
+ this.type = type
|
|
|
+ this.getTaskList()
|
|
|
+ },
|
|
|
getTaskList() {
|
|
|
- this.$api.task.taskList({}).then(res => {
|
|
|
+ const data = { type: this.type, ...this.page }
|
|
|
+ this.$api.task.taskList(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
|
this.total = res.data.total
|
|
|
@@ -93,6 +140,10 @@ export default {
|
|
|
},
|
|
|
rowClick(res) {
|
|
|
this.taskId = res.id
|
|
|
+ },
|
|
|
+ pageChange(current) {
|
|
|
+ this.page.current = current
|
|
|
+ this.getTaskList()
|
|
|
}
|
|
|
}
|
|
|
}
|