CfStatus.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="cf-status">
  3. <pub-loading-view :loaded="loaded" height="100%">
  4. <view class="status-item" :class="item.isCur?'is-current':''" v-for="item in dataList" :key="item.id">
  5. <view class="status-item-left">
  6. <view class="icon">
  7. <text class="iconfont">{{ item.icon }}</text>
  8. </view>
  9. <view class="line"></view>
  10. </view>
  11. <view class="status-item-right">
  12. <view class="status-item-title">{{item.title}}</view>
  13. <view>{{item.time}}</view>
  14. </view>
  15. </view>
  16. </pub-loading-view>
  17. </view>
  18. </template>
  19. <script lang="ts" setup>
  20. import { ref, PropType, onMounted } from 'vue'
  21. import rest from '@/stores/rest'
  22. import {
  23. formatDate,
  24. filterStateTitle ,
  25. filterStateIcon,
  26. } from '@/lib/util'
  27. import { CfStatusVO } from '../../lib/type';
  28. defineProps({
  29. info: {
  30. type: Object as PropType<any>,
  31. default: () => ({}),
  32. },
  33. })
  34. const loaded = ref(false)
  35. const dataList = ref([])
  36. const getInfo = async () => {
  37. loaded.value = true;
  38. try {
  39. let statusRes = await rest.get('/app-api/bmfw/findCfStatus',{ptwybh:'2024_1857595040975118338'}) as CfStatusVO
  40. let res = statusRes.statusList
  41. for (let i = 0; i < res.length; i++) {
  42. let cflist = { time: '',title:'',icon:'',message:'',createTime:'',isCur: false }
  43. if (res[i].prescriptionOperationType != '22'){
  44. cflist.time = formatDate(res[i].createTime,'{y}-{m}-{d} {h}:{i}')
  45. cflist.title = filterStateTitle(res[i].prescriptionOperationType)
  46. cflist.icon = filterStateIcon(res[i].prescriptionOperationType)
  47. cflist.createTime = res[i].createTime
  48. dataList.value.push(cflist)
  49. }
  50. }
  51. dataList.value.sort((a, b) => b.createTime - a.createTime)
  52. if (dataList.value.length > 0) {
  53. dataList.value[0].isCur = true
  54. }
  55. } catch (e) {
  56. console.log(e);
  57. }
  58. loaded.value = false;
  59. }
  60. onMounted(() => {
  61. getInfo()
  62. })
  63. </script>
  64. <style lang="scss" scoped>
  65. .cf-status {
  66. background: #fff;
  67. padding: $uni-spacing-col-s3 $page-row-spacing;
  68. height: 100%;
  69. box-sizing: border-box;
  70. overflow-y: auto;
  71. .status-item {
  72. color: $uni-text-color-grey;
  73. display: flex;
  74. height: 140rpx;
  75. .status-item-left {
  76. @include flex;
  77. flex-direction: column;
  78. margin-right: 24rpx;
  79. .icon {
  80. width: 64rpx;
  81. height: 64rpx;
  82. background: $uni-bg-icon;
  83. border-radius: 50%;
  84. @include flex-center;
  85. .iconfont {
  86. background: linear-gradient(180deg, #46ACFF 0%, $uni-color-primary 100%);
  87. background-clip: text;
  88. text-fill-color: transparent;
  89. -webkit-background-clip: text;
  90. -webkit-text-fill-color: transparent;
  91. }
  92. }
  93. .line {
  94. flex: 1;
  95. // width: 1px;
  96. border-left: 1px solid $uni-border-color;
  97. margin: 12rpx 0;
  98. }
  99. }
  100. .status-item-right {
  101. .status-item-title {
  102. font-size: $uni-font-size-lg;
  103. line-height: $uni-line-height-lg;
  104. margin-bottom: 8rpx;
  105. }
  106. }
  107. &.is-current {
  108. .status-item-left {
  109. .line {
  110. border-left: 1px dashed $uni-color-primary;
  111. }
  112. }
  113. .status-item-right {
  114. color: $uni-text-color;
  115. .status-item-title {
  116. font-size: 32rpx;
  117. font-weight: 800;
  118. }
  119. }
  120. }
  121. &:last-child {
  122. .status-item-left {
  123. .line {
  124. display: none;
  125. }
  126. }
  127. }
  128. }
  129. }
  130. </style>