index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="portal-todoList-box-body">
  3. <template v-if="list.length">
  4. <a class="item com-hover" @click="goDetail(item)" v-for="(item, i) in list" :key="i">
  5. <span class="name">{{item.fullName}}</span>
  6. <span class="time">{{$u.timeFormat(item.creatorTime)}}</span>
  7. </a>
  8. </template>
  9. <view v-else class="notData-box u-flex-col">
  10. <view class="u-flex-col notData-inner">
  11. <image :src="icon" mode="" class="iconImg"></image>
  12. <text class="notData-inner-text">{{$t('common.noData')}}</text>
  13. </view>
  14. </view>
  15. </div>
  16. </template>
  17. <script>
  18. import {
  19. checkInfo
  20. } from '@/api/message.js'
  21. import {
  22. getFlowTodo
  23. } from '@/api/home'
  24. import resources from '@/libs/resources.js'
  25. export default {
  26. components: {},
  27. props: {
  28. config: {
  29. type: Object,
  30. default: () => {}
  31. }
  32. },
  33. data() {
  34. return {
  35. list: [],
  36. icon: resources.message.nodata,
  37. }
  38. },
  39. created() {
  40. this.getData()
  41. },
  42. methods: {
  43. getData() {
  44. getFlowTodo(this.config.type || 1).then(res => {
  45. this.list = res.data?.list?.length ? res.data.list.slice(0, 7) : [];
  46. })
  47. },
  48. goDetail(item) {
  49. if (this.config.platform === 'mp') return
  50. let config = {
  51. ...item,
  52. operatorId: item.id,
  53. opType: this.config.type,
  54. }
  55. checkInfo(config.operatorId || config.taskId, config.opType).then(res => {
  56. config.opType = res.data.opType;
  57. setTimeout(() => {
  58. uni.navigateTo({
  59. url: '/pages/workFlow/flowBefore/index?config=' +
  60. this.jnpf.base64.encode(JSON.stringify(config))
  61. });
  62. }, 300)
  63. }).catch((err) => {})
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .portal-todoList-box-body {
  70. padding: 42rpx 10rpx 10rpx;
  71. max-height: 472rpx;
  72. overflow-y: scroll;
  73. .item {
  74. display: block;
  75. line-height: 40rpx;
  76. font-size: 0;
  77. margin-bottom: 24rpx;
  78. cursor: pointer;
  79. .name {
  80. font-size: 28rpx;
  81. display: inline-block;
  82. width: calc(100% - 180rpx);
  83. white-space: nowrap;
  84. text-overflow: ellipsis;
  85. overflow: hidden;
  86. word-break: break-all;
  87. vertical-align: top;
  88. }
  89. .time {
  90. font-size: 28rpx;
  91. display: inline-block;
  92. color: #999;
  93. width: 180rpx;
  94. text-align: right;
  95. }
  96. }
  97. }
  98. .notData-box {
  99. width: 100%;
  100. height: 100%;
  101. justify-content: center;
  102. align-items: center;
  103. .notData-inner {
  104. width: 280rpx;
  105. height: 308rpx;
  106. align-items: center;
  107. .iconImg {
  108. width: 100%;
  109. height: 100%;
  110. }
  111. .notData-inner-text {
  112. padding: 30rpx 0;
  113. color: #909399;
  114. }
  115. }
  116. }
  117. </style>