info8.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <wt-card title="任务列表" class="mt-10">
  3. <div
  4. class="flex flex-center full-width flex-justify-between mb-10 flex-col"
  5. >
  6. <span class="full-width text-left bold mb-10">编制任务</span>
  7. <div style="width: 100%" class="mt-10">
  8. <task-table
  9. :option="option"
  10. :data="data"
  11. :project-id="projectId"
  12. :total="total"
  13. @refresh="list"
  14. ></task-table>
  15. </div>
  16. </div>
  17. </wt-card>
  18. </template>
  19. <script>
  20. import wtCard from '@/components/wt-card/index.vue'
  21. import TaskTable from '@/views/task/component/task-table.vue'
  22. export default {
  23. name: 'info8',
  24. components: { wtCard, TaskTable },
  25. props: {
  26. projectId: {
  27. required: true,
  28. type: String,
  29. default: ''
  30. }
  31. },
  32. watch: {
  33. projectId: {
  34. handler(val) {
  35. if (val !== null && val !== undefined) {
  36. this.list()
  37. }
  38. },
  39. immediate: true
  40. }
  41. },
  42. data() {
  43. return {
  44. data: [],
  45. task: {},
  46. total: 0,
  47. option: {
  48. showCheckBox: false,
  49. folderChecked: true,
  50. column: [
  51. {
  52. label: '共20个任务',
  53. prop: 'title',
  54. display: false,
  55. width: 300
  56. },
  57. {
  58. label: '标签',
  59. prop: 'createUserName'
  60. },
  61. {
  62. label: '时间',
  63. prop: 'createUserName'
  64. },
  65. {
  66. label: '执行人',
  67. prop: 'createTime'
  68. }
  69. ]
  70. }
  71. }
  72. },
  73. methods: {
  74. list() {
  75. this.$api.task
  76. .taskListByProject({ projectId: this.projectId, level: 1 })
  77. .then(res => {
  78. if (res.code === 200) {
  79. this.data = res.data.records
  80. this.total = res.data.total
  81. }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style scoped></style>