BaoCunXinXi.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div :style="style" class="main xc_box 小手指">
  3. <div ref="div" class="header">
  4. <div style="flex: 1">上传提示</div>
  5. <div class="circle_close " @click="close">
  6. <el-icon :size="21">
  7. <CircleClose/>
  8. </el-icon>
  9. </div>
  10. </div>
  11. <div class="box">
  12. <div v-for="(value, key) in tips"
  13. class="message"
  14. :class="currentKey === key ? 'current_selected' : '' "
  15. @click="clickToModify(key)">
  16. <div class="name">
  17. {{ value?.data?.orderName }}
  18. </div>
  19. <div v-if="value?.error" class="error">
  20. <div>
  21. 错误信息:
  22. </div>
  23. <div v-for="(item,index) in value?.error">
  24. {{ index + 1 }}、 {{ item }}
  25. </div>
  26. </div>
  27. <div v-if="value?.warning" class="warning">
  28. <div>
  29. 警告信息:
  30. </div>
  31. <div v-for="(item,index) in value?.warning">
  32. {{ index + 1 }}、 {{ item }}
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script setup name='BaoCunXinXi' lang="ts">
  40. import {useDraggable} from '@vueuse/core'
  41. import {delCallback, setCallback} from "@/utils/websocket";
  42. import {$ref} from "vue/macros";
  43. // import {onMounted, onUnmounted, ref} from "vue";
  44. const props = defineProps({
  45. data: Object
  46. })
  47. const div = ref(null)
  48. const {x, y, style} = useDraggable(div, {
  49. initialValue: {x: 77, y: 494},
  50. });
  51. let tips: Object = $ref({})
  52. const close = () => {
  53. console.log('关闭')
  54. }
  55. let currentKey: string = $ref('')
  56. const clickToModify = (key) => {
  57. currentKey = key
  58. }
  59. onMounted(() => {
  60. setCallback('updatedOrder', async (data) => {
  61. tips = data
  62. })
  63. })
  64. onUnmounted(() => {
  65. delCallback('updatedOrder')
  66. })
  67. </script>
  68. <style scoped lang="scss">
  69. .main {
  70. position: fixed;
  71. width: 350px;
  72. z-index: 20;
  73. background-color: white;
  74. border-radius: 5px;
  75. .header {
  76. border-bottom: 1px solid #000;
  77. width: 100%;
  78. line-height: 35px;
  79. text-align: center;
  80. display: flex;
  81. position: relative;
  82. .circle_close {
  83. position: absolute;
  84. display: flex;
  85. right: 0;
  86. justify-content: center;
  87. align-items: center;
  88. width: 35px;
  89. height: 100%;
  90. }
  91. }
  92. .box {
  93. margin: 5px;
  94. padding: 4px;
  95. max-height: 300px;
  96. overflow: auto;
  97. .current_selected {
  98. border: 1px solid #0a84fd !important;
  99. .name {
  100. background-color: #0a84fd !important;
  101. }
  102. }
  103. .message {
  104. border: 1px dashed #000;
  105. padding: 5px;
  106. border-radius: 4px;
  107. margin: 5px 0;
  108. .name {
  109. padding: 5px;
  110. border-radius: 5px;
  111. background-color: #2c3e50;
  112. color: white;
  113. }
  114. .error {
  115. margin: 5px 0;
  116. padding: 4px;
  117. border-radius: 5px;
  118. background-color: #f89b9b;
  119. }
  120. .warning {
  121. margin: 5px 0;
  122. padding: 4px;
  123. border-radius: 5px;
  124. background-color: #f5e1b8;
  125. }
  126. }
  127. }
  128. }
  129. </style>