ScaleShow.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div class="wrapper">
  3. <div class="content">
  4. <h2>{{ list.scaleName }}</h2>
  5. <div class="result">
  6. <div class="box">
  7. <p class="score">得分:{{ list.score }}分</p>
  8. <p class="title">结果:{{ list.result }}</p>
  9. </div>
  10. </div>
  11. <div class="item" v-for="(item, index) in scaleInfo" :key="index">
  12. <p>{{ item.title }}</p>
  13. <ul>
  14. <li v-for="(it, i) in item.scaleList" :key="i">
  15. <img :src="item.checked == it.score ? check : defaul" />
  16. <span>{{ it.title }}({{ it.score }})</span>
  17. </li>
  18. </ul>
  19. </div>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import api from "@utils/api.js";
  25. export default {
  26. data() {
  27. return {
  28. list: [],
  29. scaleInfo: [],
  30. check: require("../images/radio-check.png"),
  31. defaul: require("../images/radio-default.png"),
  32. };
  33. },
  34. mounted() {
  35. let query = this.$route.query;
  36. this.getScale(query.inquiryId, query.scaleName);
  37. },
  38. methods: {
  39. getScale(inquiryId, scaleName) {
  40. const param = {
  41. inquiryId: inquiryId,
  42. scaleName: scaleName,
  43. };
  44. api.getScale(param).then((res) => {
  45. this.list = res.data.data;
  46. this.scaleInfo = JSON.parse(res.data.data.dataJson);
  47. });
  48. },
  49. },
  50. };
  51. </script>
  52. <style lang="less" scoped>
  53. .wrapper {
  54. height: 100vh;
  55. overflow-y: auto;
  56. background: #e6e6e6;
  57. .content {
  58. height: calc(100vh - 60px);
  59. overflow-y: auto;
  60. margin: 30px;
  61. background: #fff;
  62. & h2 {
  63. font-size: 20px;
  64. text-align: center;
  65. margin-top: 15px;
  66. }
  67. .result {
  68. display: flex;
  69. font-size: 14px;
  70. justify-content: center;
  71. align-items: center;
  72. padding: 0 24px;
  73. .box {
  74. display: flex;
  75. padding: 20px 0;
  76. border-bottom: 1px solid #e6e6e6;
  77. border-top: 1px solid #e6e6e6;
  78. & p {
  79. line-height: 20px;
  80. }
  81. .score {
  82. width: 100px;
  83. margin-right: 15px;
  84. }
  85. .title {
  86. flex: 1;
  87. margin: 0;
  88. color: #666666;
  89. font-weight: 500;
  90. }
  91. }
  92. }
  93. .item {
  94. margin: 15px 24px 0;
  95. font-size: 14px;
  96. padding-bottom: 15px;
  97. border-bottom: 1px solid #e6e6e6;
  98. & p {
  99. margin-bottom: 7px;
  100. }
  101. ul {
  102. display: flex;
  103. flex-flow: wrap;
  104. li {
  105. display: flex;
  106. align-items: center;
  107. margin-right: 15px;
  108. }
  109. }
  110. & img {
  111. width: 16px;
  112. margin-right: 7px;
  113. }
  114. }
  115. .item:last-child {
  116. border-bottom: none;
  117. }
  118. }
  119. }
  120. </style>