MailTable.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div>
  3. <table
  4. border="1"
  5. style="
  6. border-collapse: collapse;
  7. font-size: 14px;
  8. table-layout: fixed;
  9. width: 100%;
  10. min-width: 800px;
  11. "
  12. bordercolor="#000">
  13. <tbody>
  14. <tr
  15. v-for="(items, key, i) in mailData"
  16. :key="key">
  17. <td
  18. style="
  19. padding: 18px 0;
  20. width: 40%;
  21. text-align: center;
  22. color: #000;
  23. "
  24. :style="(i == 1 || i == 10) && objStyle">
  25. {{ key }}
  26. </td>
  27. <td style="padding: 18px 10px">
  28. <div v-if="typeof items == 'string'">
  29. <a
  30. v-if="items.indexOf('@') != -1 || items.indexOf('http') != -1"
  31. :href="items"
  32. style="color: #6495ed; text-decoration: none"
  33. ><span>{{ items }}</span></a
  34. >
  35. <span v-else>{{ items }}</span>
  36. </div>
  37. <template v-else>
  38. <div
  39. v-if="$utils.checkType(items) == 'Object'"
  40. style="
  41. width: 100%;
  42. display: flex;
  43. justify-content: space-between;
  44. ">
  45. <div
  46. v-for="(item, i) in items"
  47. :key="i"
  48. style="text-align: left; width: 100%">
  49. <span v-if="key == 'QTY'">{{ item }}</span>
  50. <span v-else>${{ item }}</span>
  51. </div>
  52. </div>
  53. <div
  54. v-for="(item, i) in items"
  55. :key="i"
  56. style="line-height: 20px"
  57. v-else>
  58. <span>{{ item }}</span>
  59. </div>
  60. </template>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td colspan="2" style="padding: 20px">
  65. <slot></slot>
  66. </td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. </div>
  71. </template>
  72. <script>
  73. export default {
  74. props: {
  75. mailData: {},
  76. buyData: {},
  77. },
  78. data() {
  79. return {
  80. objStyle: {
  81. fontWeight: 'bold',
  82. backgroundColor: '#efefef',
  83. },
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. </style>