index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <uni-list>
  4. <uni-list-item v-for="(item,index) in dataList" :key='item.taskId' :title="item.taskTitle"
  5. :note="item.taskCode" link :to="'/views/entRiskPointCheck/table?taskId='+item.taskId +'&riskPointId='+item.riskPointId"
  6. :rightText=" getStatus(item.status)">
  7. <view slot="header" class="slot-box">
  8. <text class="zhcx-iconfont zhcx-icon-caidan"></text>
  9. </view>
  10. </uni-list-item>
  11. </uni-list>
  12. </view>
  13. </template>
  14. <script>
  15. import { getCheckTaskByPage } from '@/api/task.js';
  16. export default {
  17. data() {
  18. return {
  19. dataList: [],
  20. queryConditions: {
  21. page: 1,
  22. limit: 10,
  23. total: 0,
  24. keywords: '',
  25. }
  26. }
  27. },
  28. onLoad() {
  29. this.getData();
  30. },
  31. onShow() {
  32. this.getData();
  33. },
  34. methods: {
  35. getData() {
  36. console.log("初始化方法")
  37. getCheckTaskByPage(this.queryConditions).then((res) => {
  38. const { code, msg, data } = res;
  39. if (code === 0) {
  40. console.log("任务列表有数据!", data);
  41. this.dataList = data
  42. }
  43. }).catch((error) => {
  44. console.log(error)
  45. })
  46. },
  47. getStatus(status) {
  48. if (status == 1) {
  49. return "处理中"
  50. } else if (status == 2) {
  51. return "已取消"
  52. } else if (status == 3) {
  53. return "已完成"
  54. } else {
  55. return "未开始"
  56. }
  57. }
  58. },
  59. }
  60. </script>
  61. <style>
  62. .chat-custom-right {
  63. flex: 1;
  64. /* #ifndef APP-NVUE */
  65. display: flex;
  66. /* #endif */
  67. flex-direction: column;
  68. justify-content: space-between;
  69. align-items: flex-end;
  70. }
  71. .chat-custom-text {
  72. font-size: 12px;
  73. color: #999;
  74. }
  75. .slot-box {
  76. display: flex;
  77. justify-content: center;
  78. align-items: center;
  79. padding-right: 10upx;
  80. color: #00A0FF;
  81. }
  82. </style>