index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <el-card shadow="hover" class="margin">
  3. <div class="full-width flex flex-center flex-justify-start">
  4. <el-button-group>
  5. <el-button type="primary" icon="el-icon-edit">全部任务</el-button>
  6. <el-button type="primary" plain icon="el-icon-share"
  7. >我创建的
  8. </el-button>
  9. <el-button type="primary" plain icon="el-icon-delete"
  10. >我执行的
  11. </el-button>
  12. </el-button-group>
  13. </div>
  14. <div class="flex flex-center flex-justify-start flex-col full-width">
  15. <div class="full-width flex flex-justify-start">
  16. <span>按时间排序</span>
  17. </div>
  18. <div class="full-width">
  19. <task-table
  20. :option="option"
  21. :data="data"
  22. @rowClick="rowClick"
  23. ></task-table>
  24. </div>
  25. <task ref="task" :task="task"></task>
  26. </div>
  27. </el-card>
  28. </template>
  29. <route>
  30. {
  31. path: '/task',
  32. name: '任务列表',
  33. meta: {keepAlive: true,show: false}
  34. }
  35. </route>
  36. <script>
  37. import TaskTable from '@/views/task/component/task-table.vue'
  38. import Task from '@/views/task/component/task.vue'
  39. export default {
  40. name: 'index',
  41. components: { Task, TaskTable },
  42. data() {
  43. return {
  44. data: [
  45. {
  46. title: '项目建议书编1写,需要快点'
  47. },
  48. {
  49. title: '项目建议书编写,需要快点'
  50. }
  51. ],
  52. task: [],
  53. option: {
  54. showCheckBox: false,
  55. folderChecked: true,
  56. column: [
  57. {
  58. label: '共20个任务',
  59. prop: 'title',
  60. display: false,
  61. width: 400
  62. },
  63. {
  64. label: '标签',
  65. prop: 'createUserName'
  66. },
  67. {
  68. label: '时间',
  69. prop: 'createUserName'
  70. },
  71. {
  72. label: '执行人',
  73. prop: 'createTime'
  74. }
  75. ]
  76. }
  77. }
  78. },
  79. created() {
  80. this.getTaskList()
  81. },
  82. methods: {
  83. getTaskList() {
  84. this.$api.task.taskList({ level: 1 }).then(res => {
  85. console.log('hhhh')
  86. console.log(res)
  87. })
  88. },
  89. rowClick(item) {
  90. this.task = item
  91. this.$refs.task.show()
  92. }
  93. }
  94. }
  95. </script>
  96. <style scoped></style>