风险测评小程序前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

205 lines
4.9 KiB

  1. <template>
  2. <view class="page__view">
  3. <navbar title="报告" leftClick @leftClick="$utils.navigateBack" />
  4. <template v-if="detail">
  5. <view class="title">{{ detail.title }}</view>
  6. <view class="section">
  7. <view class="flex section-header">
  8. <view class="line"></view>
  9. <view>总概述</view>
  10. </view>
  11. <view class="section-content">
  12. <view class="summary">
  13. <view class="text">
  14. 经过本次问答信息收集的综合分析检测出风险点共<text class="highlight">{{ detail.levelAllNum }}</text>其中极高风险{{ detail.level3Num }}高风险{{ detail.level2Num }}中风险{{ detail.level1Num }}低风险{{ detail.level0Num }}
  15. </view>
  16. <view class="flex charts">
  17. <progressCircle label="极高风险" :value="detail.level3Num" color="#B81C1C"></progressCircle>
  18. <progressCircle label="高风险" :value="detail.level2Num" color="#FF0000"></progressCircle>
  19. <progressCircle label="中风险" :value="detail.level1Num" color="#FFA800"></progressCircle>
  20. <progressCircle label="低风险" :value="detail.level0Num" color="#014FA2"></progressCircle>
  21. </view>
  22. </view>
  23. <view class="table">
  24. <reportTableView :list="tableList"></reportTableView>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="flex flex-column contact">
  29. <view>扫下方二维码联系我们给你1V1解决方案</view>
  30. <image class="qr" :src="configList.company_qrcode" :show-menu-by-longpress="true" mode="widthFix"></image>
  31. </view>
  32. <view>
  33. <image class="img" :src="configList.company_info" mode="widthFix"></image>
  34. <view class="logo">
  35. <image class="img" :src="configList.company_logo" mode="widthFix"></image>
  36. </view>
  37. </view>
  38. </template>
  39. </view>
  40. </template>
  41. <script>
  42. import progressCircle from './progressCircle.vue';
  43. import reportTableView from './reportTableView.vue';
  44. export default {
  45. components: {
  46. progressCircle,
  47. reportTableView,
  48. },
  49. data() {
  50. return {
  51. detail: null,
  52. tableList: [],
  53. }
  54. },
  55. onLoad(arg) {
  56. const { batchNo } = arg
  57. this.getData(batchNo)
  58. },
  59. methods: {
  60. async getData(batchNo) {
  61. try {
  62. const result = await this.$fetch('queryReportById', { batchNo })
  63. const {
  64. title,
  65. level0Num, // 低风险
  66. level1Num, // 中风险
  67. level2Num, // 高风险
  68. level3Num, // 极高风险
  69. levelAllNum,
  70. pageList,
  71. } = result
  72. this.tableList = pageList.reduce((arr, item) => {
  73. const { id, risk, reason, level, consequence } = item
  74. const obj = {
  75. id,
  76. reason,
  77. level,
  78. result: consequence,
  79. }
  80. const index = arr.findIndex(row => row.title === risk)
  81. if (index === -1) {
  82. arr.push({
  83. id: arr.length,
  84. title: risk,
  85. children: [obj]
  86. })
  87. } else {
  88. arr[index].children.push(obj)
  89. }
  90. return arr
  91. }, [])
  92. this.detail = {
  93. title,
  94. level0Num, // 低风险
  95. level1Num, // 中风险
  96. level2Num, // 高风险
  97. level3Num, // 极高风险
  98. levelAllNum,
  99. }
  100. } catch (err) {
  101. }
  102. },
  103. },
  104. }
  105. </script>
  106. <style scoped lang="scss">
  107. .title {
  108. width: 100%;
  109. padding: 42rpx 0 40rpx 0;
  110. box-sizing: border-box;
  111. text-align: center;
  112. font-size: 30rpx;
  113. font-weight: 600;
  114. color: #000000;
  115. }
  116. .section {
  117. padding: 0 12rpx;
  118. &-header {
  119. justify-content: flex-start;
  120. column-gap: 9rpx;
  121. padding: 0 17rpx;
  122. font-size: 28rpx;
  123. font-weight: 600;
  124. color: #014FA2;
  125. .line {
  126. width: 9rpx;
  127. height: 33rpx;
  128. background: #014FA2;
  129. border-radius: 6rpx;
  130. }
  131. }
  132. &-content {
  133. margin-top: 30rpx;
  134. }
  135. }
  136. .summary {
  137. .text {
  138. padding: 20rpx 10rpx;
  139. font-size: 26rpx;
  140. color: #014FA2;
  141. background: rgba($color: #014FA2, $alpha: 0.16);
  142. .highlight {
  143. color: #DB5742;
  144. }
  145. }
  146. .charts {
  147. margin-top: 54rpx;
  148. justify-content: space-between;
  149. padding: 0 42rpx;
  150. }
  151. }
  152. .table {
  153. margin-top: 49rpx;
  154. }
  155. .contact {
  156. margin-top: 53rpx;
  157. row-gap: 40rpx;
  158. width: 100%;
  159. padding: 30rpx 0 22rpx 0;
  160. box-sizing: border-box;
  161. font-size: 28rpx;
  162. color: #014FA2;
  163. border: 1rpx dashed #014FA2;
  164. .qr {
  165. width: 157rpx;
  166. height: auto;
  167. }
  168. }
  169. .img {
  170. width: 100%;
  171. height: auto;
  172. }
  173. .logo {
  174. width: 100%;
  175. padding: 42rpx 127rpx 46rpx 127rpx;
  176. box-sizing: border-box;
  177. }
  178. </style>