result.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <div class="page-box">
  3. <div class="print-box">
  4. <el-button type="primary" icon="el-icon-printer" @click="print"
  5. >打印</el-button
  6. >
  7. </div>
  8. <div class="card-box" id="print">
  9. <div class="title">
  10. <h5>Result Details</h5>
  11. </div>
  12. <div class="content-box">
  13. <div class="base-info">
  14. <div>任务ID:{{ jobId }}</div>
  15. <div>
  16. Status:
  17. <el-tag type="info">{{ getStatus(detail.status) }}</el-tag>
  18. </div>
  19. </div>
  20. </div>
  21. <div>
  22. <el-row>
  23. <el-col :span="12"
  24. ><img v-if="detail.SC_GRS" :src="detail.SC_GRS" alt=""
  25. /></el-col>
  26. <el-col :span="12"
  27. ><img
  28. v-if="detail.SC_GRS_prob_pre"
  29. :src="detail.SC_GRS_prob_pre"
  30. alt=""
  31. /></el-col>
  32. </el-row>
  33. <el-row>
  34. <el-col :span="24" class="txt_box">
  35. <div>title: SC_GRS 超过0.5的数据下标</div>
  36. <br />
  37. <div>
  38. <p v-if="detail.SC_GRS_list.length">
  39. {{ detail.SC_GRS_list.toString().replace(/,/g, ",") }}
  40. </p>
  41. <span v-else>暂无预测数据</span>
  42. </div>
  43. </el-col>
  44. </el-row>
  45. <el-row>
  46. <el-col :span="12"
  47. ><img v-if="detail.OR_GRS" :src="detail.OR_GRS" alt=""
  48. /></el-col>
  49. <el-col :span="12"
  50. ><img
  51. v-if="detail.OR_GRS_prob_pre"
  52. :src="detail.OR_GRS_prob_pre"
  53. alt=""
  54. /></el-col>
  55. </el-row>
  56. <el-row>
  57. <el-col :span="24" class="txt_box">
  58. <div>title: OR_GRS 超过0.5的数据下标</div>
  59. <br />
  60. <div>
  61. <p v-if="detail.OR_GRS_list.length">
  62. {{ detail.OR_GRS_list.toString().replace(/,/g, ",") }}
  63. </p>
  64. <span v-else>暂无预测数据</span>
  65. </div>
  66. </el-col>
  67. </el-row>
  68. <el-row>
  69. <el-col :span="12"
  70. ><img v-if="detail.DL_GRS" :src="detail.DL_GRS" alt=""
  71. /></el-col>
  72. <el-col :span="12"
  73. ><img
  74. v-if="detail.DL_GRS_prob_pre"
  75. :src="detail.DL_GRS_prob_pre"
  76. alt=""
  77. /></el-col>
  78. </el-row>
  79. <el-row>
  80. <el-col :span="24" class="txt_box">
  81. <div>title: DL_GRS 超过0.5的数据下标</div>
  82. <br />
  83. <div>
  84. <p v-if="detail.DL_GRS_list.length">
  85. {{ detail.DL_GRS_list.toString().replace(/,/g, ",") }}
  86. </p>
  87. <span v-else>暂无预测数据</span>
  88. </div>
  89. </el-col>
  90. </el-row>
  91. <el-row>
  92. <el-col :span="12"
  93. ><img v-if="detail.t_alt_count" :src="detail.t_alt_count" alt=""
  94. /></el-col>
  95. <el-col :span="12"
  96. ><img v-if="detail.t_depth" :src="detail.t_depth" alt=""
  97. /></el-col>
  98. </el-row>
  99. <el-row>
  100. <el-col :span="12"
  101. ><img v-if="detail.t_ref_count" :src="detail.t_ref_count" alt=""
  102. /></el-col>
  103. <el-col :span="12"
  104. ><img v-if="detail.Variant_Type" :src="detail.Variant_Type" alt=""
  105. /></el-col>
  106. </el-row>
  107. </div>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import { createOrder, orderDetail } from "@/api";
  113. export default {
  114. name: "result",
  115. data() {
  116. return {
  117. jobId: "",
  118. detail: {},
  119. };
  120. },
  121. mounted() {
  122. this.jobId = this.$route.query.jobId;
  123. this.getDetailFn();
  124. },
  125. methods: {
  126. async getDetailFn() {
  127. if (!this.jobId) return;
  128. const res = await orderDetail({
  129. id: this.jobId,
  130. });
  131. if (res.code === 200) {
  132. this.detail = res.data;
  133. }
  134. },
  135. getTag(row) {
  136. if (row.status === "success") {
  137. return "success";
  138. }
  139. if (row.status === "waiting") {
  140. return "info";
  141. }
  142. return "danger";
  143. },
  144. getStatus(status) {
  145. if (status === 0) {
  146. return "已创建";
  147. }
  148. if (status === 1) {
  149. return "已创建任务";
  150. }
  151. if (status === 2) {
  152. return "任务运行中";
  153. }
  154. if (status === 3) {
  155. return "已完成";
  156. }
  157. return "正在初始化中";
  158. },
  159. print() {
  160. console.log("82 print");
  161. // 缓存页面内容
  162. const bodyHtml = window.document.body.innerHTML;
  163. // 获取要打印的dom
  164. const printContentHtml = document.getElementById("print").innerHTML;
  165. // 替换页面内容
  166. window.document.body.innerHTML = printContentHtml;
  167. // 全局打印
  168. window.print();
  169. // 还原页面内容
  170. window.document.body.innerHTML = bodyHtml;
  171. },
  172. },
  173. };
  174. </script>
  175. <style lang="less" scoped>
  176. .page-box {
  177. padding: 24px;
  178. position: relative;
  179. .print-box {
  180. position: absolute;
  181. right: 50px;
  182. top: 100px;
  183. }
  184. .card-box {
  185. background-color: rgb(255, 255, 255);
  186. color: rgba(0, 0, 0, 0.87);
  187. transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  188. border-radius: 4px;
  189. box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 3px -2px,
  190. rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px;
  191. min-width: 300px;
  192. margin-top: 16px;
  193. margin-bottom: 16px;
  194. overflow: hidden;
  195. padding-right: 15px;
  196. padding-top: 15px;
  197. padding-bottom: 15px;
  198. .txt_box {
  199. padding: 40px;
  200. p {
  201. white-space: pre-wrap;
  202. }
  203. }
  204. .title {
  205. border-left: 6px solid rgb(246, 144, 61);
  206. border-top-color: rgb(246, 144, 61);
  207. border-right-color: rgb(246, 144, 61);
  208. border-bottom-color: rgb(246, 144, 61);
  209. background-color: rgb(16, 126, 100);
  210. color: rgb(255, 255, 255);
  211. padding: 8px 8px 8px 16px;
  212. h5 {
  213. font-size: 24px;
  214. margin: 0px;
  215. font-family: Roboto, Helvetica, Arial, sans-serif;
  216. font-weight: 400;
  217. font-size: 1.5rem;
  218. line-height: 1.334;
  219. letter-spacing: 0em;
  220. display: flex;
  221. -webkit-box-align: center;
  222. align-items: center;
  223. }
  224. }
  225. .content-box {
  226. display: flex;
  227. .base-info {
  228. width: 150px;
  229. padding: 15px;
  230. }
  231. }
  232. }
  233. }
  234. </style>