You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="task_component">
  3. <t-card>
  4. <template #title>
  5. <t-space direction="vertical">
  6. <t-breadcrumb>
  7. <t-breadcrumbItem>首页</t-breadcrumbItem>
  8. <t-breadcrumbItem>任务管理中心</t-breadcrumbItem>
  9. </t-breadcrumb>
  10. </t-space>
  11. </template>
  12. <t-table
  13. bordered
  14. hover
  15. tableLayout="auto"
  16. row-key="id"
  17. :data="data"
  18. :columns="columns"
  19. resizable
  20. />
  21. </t-card>
  22. </div>
  23. </template>
  24. <script lang="jsx">
  25. import { taskListApi } from '@/api/task'
  26. export default {
  27. data() {
  28. return {
  29. data: [],
  30. columns: [
  31. {
  32. colKey: 'operatorName',
  33. title: '操作员',
  34. },
  35. {
  36. colKey: 'publishTime',
  37. title: '发布时间',
  38. },
  39. {
  40. colKey: 'nuclearStationName',
  41. title: '核电站名称',
  42. ellipsis: true,
  43. },
  44. {
  45. colKey: 'nuclearCoreName',
  46. title: '核反应堆',
  47. },
  48. {
  49. colKey: 'status',
  50. title: '任务状态',
  51. },
  52. {
  53. colKey: 'startTime',
  54. title: '开始时间',
  55. },
  56. {
  57. colKey: 'endTime',
  58. title: '完成时间',
  59. },
  60. {
  61. title: '操作',
  62. cell: (h, { row }) => (
  63. <div>
  64. <t-button theme="danger" onClick={() => this.delTask(row.id)}>
  65. 删除任务
  66. </t-button>
  67. <t-button theme="danger" onClick={() => this.delExcel(row.id)}>
  68. 删除excel
  69. </t-button>
  70. <t-button theme="danger" onClick={() => this.uploadExcel(row.id)}>
  71. 上传Excel
  72. </t-button>
  73. </div>
  74. ),
  75. },
  76. ],
  77. }
  78. },
  79. methods: {
  80. delTask(taskId) {},
  81. delExcel(taskId) {},
  82. uploadExcel(taskId) {},
  83. async getTaskList() {
  84. const res = await taskListApi()
  85. if (res?.code == 200) {
  86. this.data = res?.data
  87. }
  88. },
  89. },
  90. mounted() {
  91. this.getTaskList()
  92. },
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .task_component {
  97. }
  98. </style>