Abnormal.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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: 12px" />
  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: absolute;
  40. top: 0;
  41. left: 0;
  42. z-index: 1;
  43. width: 50%;
  44. // :deep(.ant-alert-warning) {
  45. // padding-left: 30px;
  46. // }
  47. .text-box {
  48. padding-left: 30px;
  49. background: rgba(0, 0, 0, 0.7);
  50. color: #fff;
  51. line-height: 1.4;
  52. height: 30vh;
  53. font-size: 20px;
  54. overflow: auto;
  55. }
  56. .collapse-btn {
  57. position: absolute;
  58. left: 5px;
  59. top: 4px;
  60. z-index: 1;
  61. width: 20px;
  62. height: 20px;
  63. border-radius: 50%;
  64. background: #fff;
  65. color: var(--app-primary-button-bg-color);
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. cursor: pointer;
  70. border: 1px solid var(--app-primary-button-bg-color);
  71. transition: all 0.5s;
  72. &.rotate {
  73. transform: rotate(180deg);
  74. }
  75. }
  76. }
  77. </style>