checkReportItem.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <script>
  2. export default {
  3. name: "checkReportItem",
  4. props: {
  5. /**
  6. * 报告项的说明标签
  7. */
  8. reportLabel: {
  9. type: String,
  10. default: "label",
  11. },
  12. /**
  13. * 报告项的内容
  14. */
  15. reportContent: {
  16. type: String,
  17. default: "content",
  18. },
  19. /**
  20. * 占位空项的标志,值为true时报告项的说明标签和内容都被隐藏
  21. */
  22. itemHide: {
  23. type: Boolean,
  24. required: false,
  25. },
  26. /**
  27. * 报告项总体宽度
  28. */
  29. itemWidth: {
  30. type: String,
  31. },
  32. },
  33. };
  34. </script>
  35. <template>
  36. <div
  37. class="check-report-item"
  38. :class="{ 'check-report-item-hidden': itemHide }"
  39. :style="`width: ${itemWidth};`"
  40. >
  41. <div class="check-report-item-label">
  42. {{ reportLabel }}
  43. </div>
  44. <div class="check-report-item-content">
  45. {{ reportContent }}
  46. </div>
  47. </div>
  48. </template>
  49. <style scoped>
  50. .check-report-item {
  51. display: flex;
  52. min-height: 45px;
  53. line-height: 45px;
  54. }
  55. .check-report-item-label,
  56. .check-report-item-content {
  57. border: 1px solid #afafaf;
  58. /* 防止边框重叠 */
  59. margin-right: -1px;
  60. margin-bottom: -1px;
  61. box-sizing: border-box;
  62. }
  63. .check-report-item-label {
  64. width: 45%;
  65. text-align: left;
  66. background-color: #e1e1e1;
  67. font-size: 14px;
  68. padding-left: 2%;
  69. overflow-x: hidden;
  70. }
  71. .check-report-item-content {
  72. flex: 1;
  73. text-align: center;
  74. background-color: #fff;
  75. }
  76. .check-report-item-hidden {
  77. color: transparent;
  78. }
  79. </style>