auxiliary.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="auxiliary">
  3. <el-collapse>
  4. <el-collapse-item :title="i.label" v-for="(i,index) in data" :key='i.label' :name="index">
  5. <ul>
  6. <li v-for="(j,jindex) in i.data" :key="jindex">
  7. <div class="list-box" v-for="n in j" :key='n.label' :style="n.num ? `width:${100/n.num}%` : ''">
  8. <div class="label">{{n.label}}:</div>
  9. <div
  10. class="value"
  11. :class="n.fn ? 'color-bl' : ''"
  12. @click="n.fn ? n.fn() : ''"
  13. :style="n.style || ''">
  14. {{n.value}}
  15. </div>
  16. </div>
  17. </li>
  18. </ul>
  19. </el-collapse-item>
  20. </el-collapse>
  21. </div>
  22. </template>
  23. <script setup>
  24. import { defineProps } from 'vue'
  25. const { proxy } = getCurrentInstance()
  26. defineProps({
  27. data: {
  28. type: Array,
  29. default: [],
  30. },
  31. })
  32. console.log(proxy.data)
  33. </script>
  34. <style lang="scss">
  35. .auxiliary {
  36. ul {
  37. padding: 0;
  38. margin: 0;
  39. li {
  40. list-style: none;
  41. padding: 15px 15px;
  42. background: #f1f1f1;
  43. overflow: hidden;
  44. margin-bottom: 10px;
  45. .list-box {
  46. float: left;
  47. width: 50%;
  48. padding: 0 5px;
  49. box-sizing: border-box;
  50. .label {
  51. width: 70px;
  52. text-align: right;
  53. color: #666;
  54. font-size: 14px;
  55. float: left;
  56. line-height: 30px;
  57. }
  58. .value {
  59. flex: 1;
  60. float: left;
  61. font-size: 14px;
  62. line-height: 30px;
  63. color: #333;
  64. width: calc(100% - 70px);
  65. }
  66. .color-bl{
  67. color: #0084FF;
  68. cursor: pointer;
  69. }
  70. }
  71. }
  72. }
  73. }
  74. </style>