generateList.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="gbox">
  3. <u-list @scrolltolower="scrolltolower" height="100%">
  4. <u-list-item v-for="(item, index) in list" :key="item.id">
  5. <view class="gbox-item">
  6. <view class="gbox-item-top adf">
  7. <view class="gbox-item-top-type">{{typeCfg[item.type]||'基础版'}}</view>
  8. <view class="gbox-item-top-title">{{item.title||''}}</view>
  9. </view>
  10. <view class="gbox-item-p adf">
  11. <view class="gbox-item-p-left">团队名称:</view>
  12. <view class="gbox-item-p-right">{{item.teamName||''}}</view>
  13. </view>
  14. <view class="gbox-item-p adf">
  15. <view class="gbox-item-p-left">报告状态:</view>
  16. <view class="gbox-item-p-right" :style="{'color':stateColor[item.state]}">{{stateDict[item.state]}}</view>
  17. </view>
  18. <!-- <view class="gbox-item-p adfac">
  19. <view class="gbox-item-p-left">报告进度:</view>
  20. <view class="gbox-item-p-progress adfacjb">
  21. <view class="gbox-item-p-progress-l">
  22. <view class="gbox-item-p-progress-l-current" :style="{'width':(80)+'%'}"></view>
  23. </view>
  24. <view class="gbox-item-p-progress-r">{{80}}%</view>
  25. </view>
  26. </view> -->
  27. <view class="gbox-item-bottom adfacjb">
  28. <view class="gbox-item-bottom-left adfac">
  29. <view class="gbox-item-bottom-left-text">创建时间:</view>
  30. <view class="gbox-item-bottom-left-time">{{item.createDate||''}}</view>
  31. </view>
  32. <view class="gbox-item-bottom-right" @click="sendReport(item)" v-if="item.state!=-1">发送报告</view>
  33. <view class="gbox-item-bottom-right" @click="reSendReport(item)" v-else>重新生成</view>
  34. </view>
  35. </view>
  36. </u-list-item>
  37. </u-list>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. props:{
  43. list:{
  44. typeof:Array,
  45. default:[]
  46. }
  47. },
  48. data(){
  49. return {
  50. typeCfg:{
  51. 1:'基础版',
  52. 2:'专业版',
  53. 3:'专家版'
  54. },
  55. stateDict:{
  56. '0':'生成中',
  57. '1':'生成成功',
  58. '-1':'生成失败'
  59. },
  60. stateColor:{
  61. '0':'#FFD750',
  62. '1':'#33A7A7',
  63. '-1':'#F4657A'
  64. }
  65. }
  66. },
  67. methods:{
  68. scrolltolower(){
  69. this.$emit('scrolltolower')
  70. },
  71. sendReport(item){
  72. if(!item.fileUrl) return this.$showModal('该报告尚未生成PDF文件,请等待生成后发送。')
  73. this.$api.get(`/core/report/sendReport/${item.reportId}`).then(({data:res})=>{
  74. uni.navigateTo({
  75. url:'/pagesHome/reportResult?result='+res.code+'&info='+encodeURIComponent(JSON.stringify(item))
  76. })
  77. })
  78. },
  79. reSendReport(item){
  80. this.$api.get(`/core/report/regenerateReport/${item.reportId}`).then(({data:res})=>{
  81. if(res.code!==0) return this.$showToast(res.msg)
  82. this.$emit('reSendReport')
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. .gbox{
  90. height: 100%;
  91. &-item{
  92. margin-top: 20rpx;
  93. background: #FFFFFF;
  94. border-radius: 24rpx;
  95. padding: 40rpx 24rpx 10rpx;
  96. position: relative;
  97. &-top{
  98. &-type{
  99. width: 98rpx;
  100. height: 36rpx;
  101. padding: 2rpx 13rpx;
  102. box-sizing: border-box;
  103. background: #FFF7DC;
  104. border-radius: 6rpx;
  105. font-family: PingFangSC, PingFang SC;
  106. font-weight: 400;
  107. font-size: 24rpx;
  108. color: #BA9B31;
  109. line-height: 33rpx;
  110. }
  111. &-title{
  112. width: calc(100% - 98rpx);
  113. font-family: PingFang-SC, PingFang-SC;
  114. font-weight: bold;
  115. font-size: 32rpx;
  116. color: #002846;
  117. line-height: 32rpx;
  118. text-indent: 17rpx;
  119. }
  120. }
  121. &-p{
  122. margin-top: 36rpx;
  123. &>view{
  124. font-family: PingFangSC, PingFang SC;
  125. font-weight: 400;
  126. font-size: 24rpx;
  127. color: #667E90;
  128. line-height: 24rpx;
  129. }
  130. &-left{
  131. width: 134rpx;
  132. }
  133. &-right{
  134. width: calc(100% - 134rpx);
  135. }
  136. &-progress{
  137. width: calc(100% - 134rpx);
  138. &-l{
  139. width: 410rpx;
  140. height: 12rpx;
  141. background: #F0F2F8;
  142. border-radius: 6rpx;
  143. position: relative;
  144. &-current{
  145. height: 12rpx;
  146. background: #FFDF73;
  147. border-radius: 6rpx;
  148. position: absolute;
  149. left: 0;
  150. top: 0;
  151. }
  152. }
  153. &-r{
  154. width: calc(100% - 410rpx);
  155. font-family: PingFangSC, PingFang SC;
  156. font-weight: 400;
  157. font-size: 24rpx;
  158. color: #002846;
  159. line-height: 24rpx;
  160. text-align: right;
  161. }
  162. }
  163. }
  164. &-bottom{
  165. margin-top: 30rpx;
  166. border-top: 1rpx solid #EFEFEF;
  167. padding-top: 18rpx;
  168. &-left{
  169. &>view{
  170. font-family: PingFangSC, PingFang SC;
  171. font-weight: 400;
  172. font-size: 24rpx;
  173. color: #667E90;
  174. line-height: 24rpx;
  175. }
  176. }
  177. &-right{
  178. padding: 17rpx 20rpx;
  179. background: linear-gradient( 90deg, #33A7A7 0%, #4DB2B2 100%);
  180. border-radius: 30rpx;
  181. font-family: PingFang-SC, PingFang-SC;
  182. font-weight: bold;
  183. font-size: 24rpx;
  184. color: #FFFFFF;
  185. line-height: 26rpx;
  186. letter-spacing: 2rpx;
  187. }
  188. }
  189. }
  190. }
  191. </style>