baggageMessage.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="baggageMessage">
  3. <template v-if="messageList.length">
  4. <el-row :gutter="24" type="flex">
  5. <el-col v-for="(message, index) in messageList" :key="index" :span="6">
  6. <div class="card">
  7. <div class="message-date">{{ message.flightDate }}</div>
  8. <div class="message-content">
  9. {{ message.sourceData.replaceAll(/[\r\n]{2,}/g, '\n').replaceAll('\\', '') }}
  10. </div>
  11. </div>
  12. </el-col>
  13. </el-row>
  14. </template>
  15. <template v-else>
  16. <el-empty :image-size="1" description="暂无数据" />
  17. </template>
  18. </div>
  19. </template>
  20. <script>
  21. import pf from '@/layout/mixin/publicFunc'
  22. export default {
  23. name: 'BaggageMessage',
  24. mixins: [pf],
  25. props: {
  26. query: {
  27. type: Object,
  28. default: () => { }
  29. },
  30. tagObj: {
  31. type: Object,
  32. default: () => { }
  33. }
  34. },
  35. data () {
  36. return {
  37. messageList: [],
  38. }
  39. },
  40. mounted () {
  41. this.queryDetails()
  42. },
  43. methods: {
  44. async queryDetails () {
  45. try {
  46. const { code, returnData } = await this.getQueryList(SERVICE_ID.bagDetailId, this.query)
  47. if (code == 0 && returnData && returnData.length) {
  48. this.messageList = [...returnData]
  49. }
  50. } catch (error) {
  51. console.log(error)
  52. this.$message.error('失败')
  53. }
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .baggageMessage {
  60. height: 100%;
  61. .card {
  62. width: 100%;
  63. min-height: 440px;
  64. padding: 20px;
  65. background: #ffffff;
  66. box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, 0.29);
  67. margin-bottom: 24px;
  68. > .message-date {
  69. width: 180px;
  70. height: 26px;
  71. line-height: 14px;
  72. font-size: 14px;
  73. font-family: Helvetica;
  74. color: #afb4bf;
  75. border-bottom: 1px solid #afb4bf;
  76. margin-bottom: 18px;
  77. }
  78. > .message-content {
  79. white-space: pre-line;
  80. line-height: 24px;
  81. font-size: 14px;
  82. color: #303133;
  83. word-break: break-all;
  84. }
  85. }
  86. }
  87. </style>