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.

247 lines
7.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div
  3. class="image_container"
  4. v-if="cameraStore?.cameraState || imageStore.showImage"
  5. >
  6. <img
  7. v-if="
  8. (cameraStore?.cameraState && !imageStore.showImage) ||
  9. !imageStore?.coreInfo?.resultImg ||
  10. imageStore?.coreInfo?.result == 0
  11. "
  12. :src="photoUrl"
  13. alt="图像"
  14. class="img"
  15. />
  16. <img v-else :src="imageStore?.coreInfo?.resultImg" alt="图像" class="img" />
  17. <div class="top_info">
  18. <p class="title">{{ imageStore.nuclearCoreName }}</p>
  19. <div class="title_left">
  20. <p class="sign">
  21. {{ handleSerialNumber(imageStore?.coreInfo?.serialNumber) }}
  22. </p>
  23. <div class="tag_wrap">
  24. <p>{{ imageStore?.coreInfo?.firstSign?.substr(-4) }}</p>
  25. <p>{{ imageStore?.coreInfo?.secondSign?.substr(-4) }}</p>
  26. </div>
  27. </div>
  28. </div>
  29. <div :class="getIdentifyClass()">
  30. <div class="left_wrap">
  31. <svg
  32. xmlns="http://www.w3.org/2000/svg"
  33. xmlns:xlink="http://www.w3.org/1999/xlink"
  34. fill="none"
  35. v-if="imageStore?.coreInfo?.result != 1"
  36. version="1.1"
  37. width="30"
  38. height="29.999998092651367"
  39. viewBox="0 0 30 29.999998092651367"
  40. >
  41. <g>
  42. <path
  43. d="M15,0C6.74916,0,0,6.74916,0,15C0,23.2508,6.74916,30,15,30C23.2508,30,30,23.2508,30,15C30,6.74916,23.2508,0,15,0ZM22.1672,20.1672C22.6689,20.6689,22.6689,21.5853,22.1672,22.0836C21.9164,22.3344,21.5853,22.5017,21.1672,22.5017C20.8328,22.5017,20.4181,22.3344,20.1672,22.0836L15.3344,17.2508L10.5017,22.0836C10,22.5853,9.08361,22.5853,8.58528,22.0836C8.08696,21.5819,8.08361,20.6656,8.58528,20.1672L13.4181,15.3344L8.58528,10.5017C8.33445,10.2508,8.16722,9.91973,8.16722,9.50167C8.16722,9.16722,8.33445,8.75251,8.58528,8.50167C9.08696,8,10.0033,8,10.5017,8.50167L15.3344,13.3344L20.1672,8.50167C20.4181,8.25084,20.7492,8.08361,21.1672,8.08361C21.5017,8.08361,21.9164,8.25084,22.1672,8.50167C22.4181,8.75251,22.5853,9.08361,22.5853,9.50167C22.5853,9.83612,22.4181,10.2508,22.1672,10.5017L17.3344,15.3344L22.1672,20.1672Z"
  44. fill="#FFFFFF"
  45. fill-opacity="1"
  46. />
  47. </g>
  48. </svg>
  49. <svg
  50. v-else
  51. xmlns="http://www.w3.org/2000/svg"
  52. xmlns:xlink="http://www.w3.org/1999/xlink"
  53. fill="none"
  54. version="1.1"
  55. width="30"
  56. height="30.000120162963867"
  57. viewBox="0 0 30 30.000120162963867"
  58. >
  59. <g>
  60. <path
  61. d="M15,30.0001C6.71625,30.0001,0,23.2838,0,15.0001C0,6.71628,6.71625,0,15,0C23.2838,0,30,6.71628,30,15.0001C30,23.2838,23.2838,30.0001,15,30.0001ZM11.655,20.8901C12.2652,21.5005,13.2548,21.5005,13.865,20.8901L23.3375,11.4175C23.9478,10.8073,23.9478,9.81781,23.3375,9.20754C22.7272,8.59726,21.7378,8.59726,21.1275,9.20754L12.6925,17.5076L8.9175,13.7326C8.30736,13.1215,7.31725,13.1211,6.70665,13.7317C6.09604,14.3423,6.09642,15.3324,6.7075,15.9426L11.655,20.8901Z"
  62. fill="#FFFFFF"
  63. fill-opacity="1"
  64. />
  65. </g>
  66. </svg>
  67. <!-- <p>A-8</p> -->
  68. </div>
  69. <div class="tag_wrap">
  70. <p>
  71. {{
  72. imageStore?.coreInfo?.resultSerial?.split('-')[0]?.substr(-4)
  73. ? imageStore?.coreInfo?.resultSerial?.split('-')[0]?.substr(-4)
  74. : '空结果'
  75. }}
  76. </p>
  77. <p>
  78. {{ imageStore?.coreInfo?.resultSerial?.split('-')[1]?.substr(-4) }}
  79. </p>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="no_image" v-else>
  84. <!-- 根据相机是否开启切换不同的icon -->
  85. <svg
  86. xmlns="http://www.w3.org/2000/svg"
  87. xmlns:xlink="http://www.w3.org/1999/xlink"
  88. fill="none"
  89. version="1.1"
  90. width="85.90400695800781"
  91. height="76.7254638671875"
  92. viewBox="0 0 85.90400695800781 76.7254638671875"
  93. >
  94. <g>
  95. <path
  96. d="M6.91322,0L78.9908,0C82.8088,0,85.904,3.2252,85.904,7.20367L85.904,69.6923C85.8151,73.6041,82.7458,76.7266,78.9908,76.7255L6.91322,76.7255C3.15816,76.7266,0.0888908,73.6041,0,69.6923L0,7.20367C0,3.22519,3.09515,0,6.91322,0ZM63.5689,38.8742C64.784,37.9363,66.4446,37.9363,67.6596,38.8742L78.9908,43.7761L78.9908,7.20367L6.91322,7.20367L6.91322,38.107L22.3351,21.7815C23.6974,20.2285,26.0451,20.2285,27.4074,21.7815L48.6381,49.3601L63.5689,38.8742ZM51.0912,24.6798C51.0912,19.1005,55.4317,14.5776,60.7861,14.5776C66.1404,14.5777,70.4809,19.1005,70.481,24.6798C70.481,30.2591,66.1404,34.7821,60.7861,34.7821C55.4317,34.7821,51.0912,30.2591,51.0912,24.6798ZM58.0045,24.4667C58.0045,26.0675,59.2498,27.3652,60.7861,27.3652L60.7861,27.5357C62.3886,27.5387,63.6621,26.1337,63.5678,24.4667C63.5678,22.8658,62.3224,21.5681,60.7862,21.5681C59.2499,21.5681,58.0045,22.8658,58.0045,24.4667Z"
  97. fill-rule="evenodd"
  98. fill="#5E5C5C"
  99. fill-opacity="1"
  100. />
  101. </g>
  102. </svg>
  103. </div>
  104. </template>
  105. <script setup>
  106. import { onMounted, ref } from 'vue'
  107. import { transNumberToEn } from '@/utils/common'
  108. import { useTaskStore, useImageStore, useCameraStore } from '@/store'
  109. const taskStore = useTaskStore()
  110. const imageStore = useImageStore()
  111. const cameraStore = useCameraStore()
  112. const photoUrl = ref('')
  113. setInterval(
  114. () => {
  115. photoUrl.value = `${
  116. import.meta.env.VITE_HOST_URL
  117. }app/core/realtime_photo/now.png?${Math.random()}`
  118. },
  119. 500,
  120. 500,
  121. )
  122. const handleSerialNumber = serialNumber => {
  123. if (serialNumber) {
  124. const arr = serialNumber.split('-')
  125. if (arr && arr.length == 2) {
  126. return `${transNumberToEn(arr[0])} - ${arr[1]}`
  127. }
  128. }
  129. return ''
  130. }
  131. const getIdentifyClass = () => {
  132. const res = imageStore?.coreInfo?.result
  133. if (res == 1) {
  134. return 'identify_info success'
  135. } else {
  136. return 'identify_info'
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .no_image {
  142. width: 100%;
  143. height: 100%;
  144. border-radius: 6px;
  145. overflow: hidden;
  146. background: #ebebeb;
  147. display: flex;
  148. align-items: center;
  149. justify-content: center;
  150. }
  151. .image_container {
  152. width: 100%;
  153. height: 100%;
  154. border-radius: 6px;
  155. overflow: hidden;
  156. position: relative;
  157. background: #ddd;
  158. .top_info {
  159. display: flex;
  160. align-items: center;
  161. justify-content: space-between;
  162. position: absolute;
  163. left: 20px;
  164. top: 20px;
  165. right: 20px;
  166. box-sizing: border-box;
  167. padding: 10px 34px;
  168. border-radius: 28px;
  169. background: rgba(76, 90, 224, 0.2);
  170. .title {
  171. font-size: 20px;
  172. font-weight: normal;
  173. letter-spacing: 0.03em;
  174. color: #ffffff;
  175. background: none;
  176. }
  177. .title_left {
  178. display: flex;
  179. align-items: center;
  180. .sign {
  181. font-size: 26px;
  182. font-weight: 900;
  183. letter-spacing: 0.04em;
  184. margin-right: 22px;
  185. color: #ffffff;
  186. }
  187. .tag_wrap {
  188. display: flex;
  189. flex-direction: column;
  190. align-items: center;
  191. font-size: 20px;
  192. font-weight: 500;
  193. line-height: 19px;
  194. letter-spacing: 0.03em;
  195. color: #ffffff;
  196. }
  197. }
  198. }
  199. .identify_info {
  200. position: absolute;
  201. right: 28px;
  202. bottom: 22px;
  203. border-radius: 6px;
  204. background: #fe0a0a;
  205. font-size: 26px;
  206. font-weight: 900;
  207. letter-spacing: 0.04em;
  208. color: #ffffff;
  209. padding: 13px 20px;
  210. box-sizing: border-box;
  211. display: flex;
  212. align-items: center;
  213. .left_wrap {
  214. display: flex;
  215. flex-direction: column;
  216. align-items: center;
  217. font-size: 26px;
  218. font-weight: 900;
  219. letter-spacing: 0.04em;
  220. color: #ffffff;
  221. }
  222. .tag_wrap {
  223. display: flex;
  224. flex-direction: column;
  225. align-items: center;
  226. font-size: 26px;
  227. font-weight: 900;
  228. letter-spacing: 0.04em;
  229. color: #ffffff;
  230. margin-left: 25px;
  231. justify-content: space-between;
  232. }
  233. }
  234. .success {
  235. background: #01ff82;
  236. }
  237. .img {
  238. object-fit: cover;
  239. width: 100%;
  240. height: 100%;
  241. }
  242. }
  243. </style>