2
0

Abnormal.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div v-if="store.currentTask?.collationLabelCode" class="abnormal">
  3. <div class="collapse-btn" :class="{ rotate: !show }" @click="show = !show">
  4. <UpOutlined style="font-size: 16px" />
  5. </div>
  6. <Transition
  7. enterActiveClass="animate__animated animate__slideInDown"
  8. leaveActiveClass="animate__animated animate__slideOutUp"
  9. >
  10. <!-- <a-alert v-if="show" :message="result" banner /> -->
  11. <div v-if="show" class="text-box">{{ result }}</div>
  12. </Transition>
  13. </div>
  14. </template>
  15. <script name="Abnormal" lang="ts" setup>
  16. import { computed, ref, watch } from "vue";
  17. import { store } from "@/store/store";
  18. import { UpOutlined } from "@ant-design/icons-vue";
  19. const show = ref(true);
  20. const result = computed(() => {
  21. let collationLabelList = store.setting?.collationLabelList || [];
  22. let name =
  23. collationLabelList.find(
  24. (item: any) => item.code == store.currentTask?.collationLabelCode
  25. )?.name || "";
  26. return `试卷整理异常信息:${
  27. store.currentTask?.collationLabelCode || ""
  28. } - ${name}`;
  29. });
  30. watch(
  31. () => store.currentTask,
  32. () => {
  33. show.value = true;
  34. }
  35. );
  36. </script>
  37. <style lang="less" scoped>
  38. .abnormal {
  39. position: sticky;
  40. top: 0;
  41. left: 0;
  42. z-index: 1;
  43. width: 50%;
  44. height: 0;
  45. // :deep(.ant-alert-warning) {
  46. // padding-left: 30px;
  47. // }
  48. .text-box {
  49. padding-left: 38px;
  50. background: rgba(0, 0, 0, 0.7);
  51. color: #fff;
  52. line-height: 1.4;
  53. height: 30vh;
  54. font-size: 28px;
  55. overflow: auto;
  56. }
  57. .collapse-btn {
  58. position: absolute;
  59. left: 5px;
  60. top: 6px;
  61. z-index: 1;
  62. width: 28px;
  63. height: 28px;
  64. border-radius: 50%;
  65. background: #fff;
  66. color: var(--app-primary-button-bg-color);
  67. display: flex;
  68. justify-content: center;
  69. align-items: center;
  70. cursor: pointer;
  71. border: 1px solid var(--app-primary-button-bg-color);
  72. transition: all 0.5s;
  73. &.rotate {
  74. transform: rotate(180deg);
  75. }
  76. }
  77. }
  78. </style>