result.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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="12"
  35. ><img v-if="detail.OR_GRS" :src="detail.OR_GRS" alt=""
  36. /></el-col>
  37. <el-col :span="12"
  38. ><img
  39. v-if="detail.OR_GRS_prob_pre"
  40. :src="detail.OR_GRS_prob_pre"
  41. alt=""
  42. /></el-col>
  43. </el-row>
  44. <el-row>
  45. <el-col :span="12"
  46. ><img v-if="detail.DL_GRS" :src="detail.DL_GRS" alt=""
  47. /></el-col>
  48. <el-col :span="12"
  49. ><img
  50. v-if="detail.DL_GRS_prob_pre"
  51. :src="detail.DL_GRS_prob_pre"
  52. alt=""
  53. /></el-col>
  54. </el-row>
  55. <el-row>
  56. <el-col :span="12"
  57. ><img v-if="detail.t_alt_count" :src="detail.t_alt_count" alt=""
  58. /></el-col>
  59. <el-col :span="12"
  60. ><img v-if="detail.t_depth" :src="detail.t_depth" alt=""
  61. /></el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="12"
  65. ><img v-if="detail.t_ref_count" :src="detail.t_ref_count" alt=""
  66. /></el-col>
  67. <el-col :span="12"
  68. ><img v-if="detail.Variant_Type" :src="detail.Variant_Type" alt=""
  69. /></el-col>
  70. </el-row>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import { createOrder, orderDetail } from "@/api";
  77. export default {
  78. name: "result",
  79. data() {
  80. return {
  81. jobId: "",
  82. detail: {},
  83. };
  84. },
  85. mounted() {
  86. this.jobId = this.$route.query.jobId;
  87. this.getDetailFn();
  88. },
  89. methods: {
  90. async getDetailFn() {
  91. if (!this.jobId) return;
  92. const res = await orderDetail({
  93. id: this.jobId,
  94. });
  95. if (res.code === 200) {
  96. this.detail = res.data;
  97. }
  98. },
  99. getTag(row) {
  100. if (row.status === "success") {
  101. return "success";
  102. }
  103. if (row.status === "waiting") {
  104. return "info";
  105. }
  106. return "danger";
  107. },
  108. getStatus(status) {
  109. if (status === 0) {
  110. return "已创建";
  111. }
  112. if (status === 1) {
  113. return "已创建任务";
  114. }
  115. if (status === 2) {
  116. return "任务运行中";
  117. }
  118. if (status === 3) {
  119. return "已完成";
  120. }
  121. return "正在初始化中";
  122. },
  123. print() {
  124. console.log("82 print");
  125. // 缓存页面内容
  126. const bodyHtml = window.document.body.innerHTML;
  127. // 获取要打印的dom
  128. const printContentHtml = document.getElementById("print").innerHTML;
  129. // 替换页面内容
  130. window.document.body.innerHTML = printContentHtml;
  131. // 全局打印
  132. window.print();
  133. // 还原页面内容
  134. window.document.body.innerHTML = bodyHtml;
  135. },
  136. },
  137. };
  138. </script>
  139. <style lang="less" scoped>
  140. .page-box {
  141. padding: 24px;
  142. position: relative;
  143. .print-box {
  144. position: absolute;
  145. right: 50px;
  146. top: 100px;
  147. }
  148. .card-box {
  149. background-color: rgb(255, 255, 255);
  150. color: rgba(0, 0, 0, 0.87);
  151. transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  152. border-radius: 4px;
  153. box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 3px -2px,
  154. rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px;
  155. min-width: 300px;
  156. margin-top: 16px;
  157. margin-bottom: 16px;
  158. overflow: hidden;
  159. padding-right: 15px;
  160. padding-top: 15px;
  161. padding-bottom: 15px;
  162. .title {
  163. border-left: 6px solid rgb(246, 144, 61);
  164. border-top-color: rgb(246, 144, 61);
  165. border-right-color: rgb(246, 144, 61);
  166. border-bottom-color: rgb(246, 144, 61);
  167. background-color: rgb(16, 126, 100);
  168. color: rgb(255, 255, 255);
  169. padding: 8px 8px 8px 16px;
  170. h5 {
  171. font-size: 24px;
  172. margin: 0px;
  173. font-family: Roboto, Helvetica, Arial, sans-serif;
  174. font-weight: 400;
  175. font-size: 1.5rem;
  176. line-height: 1.334;
  177. letter-spacing: 0em;
  178. display: flex;
  179. -webkit-box-align: center;
  180. align-items: center;
  181. }
  182. }
  183. .content-box {
  184. display: flex;
  185. .base-info {
  186. width: 150px;
  187. padding: 15px;
  188. }
  189. }
  190. }
  191. }
  192. </style>