TaskList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="taskListContainer">
  3. <button @click="showMissionDetailsForm">from test</button>
  4. <div class="taskFunctionBar">
  5. <!-- 后期可以考虑吧 控制台也才抽出来作为组件 -->
  6. <div class="masterFunctionBar">
  7. <div class="taskList-logo">任务</div>
  8. <el-button size="small" type="warning" icon="el-icon-plus" >新建任务</el-button>
  9. </div>
  10. <div class="filterFunctionBar">
  11. <el-select size="small" class="subSelect taskScopeSelect" v-model="value" placeholder="全部">
  12. <el-option
  13. v-for="item in taskScope"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value">
  17. </el-option>
  18. </el-select>
  19. <el-select size="small" class="subSelect taskStatusSelect" v-model="value" placeholder="全部类型">
  20. <el-option
  21. v-for="item in taskStatus"
  22. :key="item.value"
  23. :label="item.label"
  24. :value="item.value">
  25. </el-option>
  26. </el-select>
  27. <el-select size="small" class="subSelect sortOptionsSelect" v-model="value" placeholder="默认排序">
  28. <el-option
  29. v-for="item in sortOptions"
  30. :key="item.value"
  31. :label="item.label"
  32. :value="item.value">
  33. </el-option>
  34. </el-select>
  35. </div>
  36. </div>
  37. <div class="taskTableContainer">
  38. <List
  39. :listData="bugData"
  40. :total="300"
  41. :is-show-checkbox="isShowCheckbox" @current-change="handleCurrentChange">
  42. </List>
  43. <MissionDetailsForm ref="missionDetailsForm"> </MissionDetailsForm>
  44. <!-- 组件,然后 当展示的时候,将筛选的选项传入-->
  45. <!-- buglist和任务list复用-->
  46. <!-- 点击具体项的时候,任务的抽屉也是一个组件-->
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import MissionDetailsForm from '../../components/MissionDetailsForm.vue';
  52. import List from '../../components/List.vue';
  53. export default {
  54. components: { MissionDetailsForm, List },
  55. data() {
  56. return {
  57. taskScope: [{
  58. value: 'all',
  59. label: '全部',
  60. }, {
  61. value: 'my',
  62. label: '分配到我',
  63. }],
  64. selectTaskScope: 'all',
  65. taskStatus: [{
  66. value: 'allStatus',
  67. label: '全部类型',
  68. }, {
  69. value: 'completed',
  70. label: '已完成',
  71. }, {
  72. value: 'ongoing',
  73. label: '进行中',
  74. }],
  75. selectTaskStatus: 'allStatus',
  76. sortOptions: [{
  77. value: 'default',
  78. label: '默认排序',
  79. }, {
  80. value: 'creationTimeFirst',
  81. label: '创建时间',
  82. }, {
  83. value: 'priority',
  84. label: '优先级',
  85. }],
  86. selectSortOptions: 'allStatus',
  87. bugData: [
  88. {
  89. projectCode: 'EXAMPLE-123',
  90. title: 'bug1',
  91. assignment: '经办人1',
  92. status: '进行中',
  93. },
  94. {
  95. projectCode: 'EXAMPLE-124',
  96. title: 'bug2',
  97. assignment: '经办人2',
  98. status: '进行中',
  99. },
  100. {
  101. projectCode: 'EXAMPLE-123',
  102. title: 'bug1',
  103. assignment: '经办人1',
  104. status: '进行中',
  105. },
  106. {
  107. projectCode: 'EXAMPLE-124',
  108. title: 'bug2',
  109. assignment: '经办人2',
  110. status: '进行中',
  111. },
  112. {
  113. projectCode: 'EXAMPLE-123',
  114. title: 'bug1',
  115. assignment: '经办人1',
  116. status: '进行中',
  117. },
  118. {
  119. projectCode: 'EXAMPLE-124',
  120. title: 'bug2',
  121. assignment: '经办人2',
  122. status: '进行中',
  123. },
  124. {
  125. projectCode: 'EXAMPLE-123',
  126. title: 'bug1',
  127. assignment: '经办人1',
  128. status: '进行中',
  129. },
  130. {
  131. projectCode: 'EXAMPLE-124',
  132. title: 'bug2',
  133. assignment: '经办人2',
  134. status: '进行中',
  135. }],
  136. isShowCheckbox: true,
  137. };
  138. },
  139. methods: {
  140. /**
  141. * @param filterObject 用于数据获取请求的参数对象
  142. * @param currentPage 当前页数
  143. */
  144. getBugData(filterObject, currentPage) {
  145. console.log('getBugData');
  146. },
  147. showMissionDetailsForm() {
  148. console.log(this.$refs.missionDetailsForm);
  149. this.$refs.missionDetailsForm.showForm();
  150. },
  151. handleCurrentChange(currentPage) {
  152. this.getBugData({}, currentPage);
  153. },
  154. },
  155. };
  156. </script>
  157. <style scoped>
  158. .taskListContainer{
  159. margin: 70px 30px 0 30px;
  160. }
  161. .taskFunctionBar .masterFunctionBar{
  162. display: flex;
  163. align-items:center;
  164. justify-content:space-between;
  165. }
  166. .taskFunctionBar .filterFunctionBar{
  167. margin-top: 20px;
  168. display: flex;
  169. align-items:center;
  170. }
  171. .subSelect {
  172. width: 130px;
  173. }
  174. .taskScopeSelect{
  175. margin-left: 0px;
  176. }
  177. .taskStatusSelect{
  178. margin-left: 18px;
  179. }
  180. .sortOptionsSelect{
  181. margin-left: auto;
  182. }
  183. .taskTableContainer{
  184. margin-top: 20px;
  185. }
  186. </style>