taskBoard.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="taskBoard">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
  4. leftIcon="" @leftClick="handlerToggle"> </u-navbar>
  5. <u-list :height="708" v-if="isShow">
  6. <u-list-item v-for="(item, index) in indexList" :key="index">
  7. <u-cell icon="share" @click="getBorad(item)">
  8. <view slot="title" class="u-slot-title">
  9. <text class="u-cell-text">{{ item.name }}</text>
  10. </view>
  11. <view slot="value" class="u-slot-title">
  12. <u-tag :text="item.classType_dictText" plain size="mini"
  13. :type="item.classType_dictText == '早班' ? 'success' : item.classType_dictText == '中班' ? 'warning' : 'error'">
  14. </u-tag>
  15. </view>
  16. </u-cell>
  17. </u-list-item>
  18. </u-list>
  19. <component v-else :is="loadComponent" :taskId="taskId" @getBackBoard="getBackBoard"></component>
  20. </view>
  21. </template>
  22. <script>
  23. import api from "@/api/api";
  24. import taskBoardAddress from './taskBoardAddress.vue'
  25. export default {
  26. name: 'taskBoard',
  27. components: {
  28. taskBoardAddress
  29. },
  30. props: {},
  31. data() {
  32. return {
  33. isShow: true,
  34. loadComponent: '',
  35. taskId: '',
  36. indexList: [],
  37. gasTitle: '巡检任务',//标题
  38. backPic0: "url(/static/topnavbar0.png)",
  39. backPic: "url(../../static/topnavbar.png)",
  40. }
  41. },
  42. computed: {},
  43. mounted() {
  44. this.getTimeList()
  45. },
  46. methods: {
  47. //点击返回上一级
  48. getBackBoard() {
  49. let that=this
  50. that.isShow = true
  51. that.loadComponent = ''
  52. },
  53. //点击跳转到识别看板
  54. getBorad(item) {
  55. let that = this
  56. that.isShow = false
  57. that.taskId = item.id
  58. that.loadComponent = 'taskBoardAddress'
  59. },
  60. //获取任务管理列表数据
  61. getTimeList() {
  62. let that = this
  63. new Promise((resolve, reject) => {
  64. api
  65. .teamList({ pageNo: 1, pageSize: 100 })
  66. .then((response) => {
  67. if (response.data.code == 200) {
  68. that.indexList = response.data.result.records
  69. } else {
  70. reject(response);
  71. }
  72. })
  73. .catch((error) => {
  74. console.log("catch===>response", response);
  75. reject(error);
  76. });
  77. });
  78. }
  79. }
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .taskBoard {
  84. position: relative;
  85. width: 100%;
  86. height: 100%;
  87. background-color: #fff;
  88. }
  89. ::v-deep .u-slot-title {
  90. display: flex;
  91. }
  92. </style>