QuestionBase.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="question">
  3. <div class="question-container">
  4. <div class="question-content">
  5. <slot name="content"></slot>
  6. </div>
  7. <div class="property">
  8. <slot name="property"></slot>
  9. </div>
  10. </div>
  11. <slot name="question-footer">
  12. <slot name="footer"></slot>
  13. </slot>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'QuestionBase',
  19. };
  20. </script>
  21. <style lang="scss" scoped>
  22. .question {
  23. width: 100%;
  24. &-container {
  25. display: flex;
  26. width: 100%;
  27. padding: 24px;
  28. background-color: #fff;
  29. border: $border;
  30. border-radius: 0 0 8px 8px;
  31. .question-content {
  32. flex: 1;
  33. .stem {
  34. padding-bottom: 8px;
  35. margin-bottom: 8px;
  36. border-bottom: 1px solid $border-color;
  37. .el-textarea {
  38. margin-top: 8px;
  39. }
  40. }
  41. .content {
  42. > ul {
  43. display: flex;
  44. flex-direction: column;
  45. row-gap: 8px;
  46. width: 100%;
  47. .content-item {
  48. display: flex;
  49. column-gap: 4px;
  50. align-items: center;
  51. .question-number {
  52. min-width: 40px;
  53. height: 32px;
  54. padding: 4px 0;
  55. color: $text-color;
  56. text-align: center;
  57. cursor: default;
  58. background-color: $fill-color;
  59. border-radius: 2px;
  60. }
  61. .option-content {
  62. display: flex;
  63. flex: 1;
  64. align-items: center;
  65. padding-left: 16px;
  66. background-color: $fill-color;
  67. .rich-wrapper {
  68. flex: 1;
  69. min-height: 32px;
  70. :deep .rich-text {
  71. &.mce-content-body {
  72. padding-top: 4px;
  73. }
  74. &:not(.mce-edit-focus) {
  75. p {
  76. margin: 0;
  77. }
  78. }
  79. &.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {
  80. top: 6px;
  81. }
  82. }
  83. }
  84. }
  85. .delete {
  86. margin-left: 12px;
  87. }
  88. }
  89. }
  90. }
  91. .footer {
  92. display: flex;
  93. justify-content: center;
  94. margin-top: 14px;
  95. color: $main-color;
  96. .add-option {
  97. display: flex;
  98. column-gap: 8px;
  99. align-items: center;
  100. font-size: 14px;
  101. cursor: pointer;
  102. }
  103. }
  104. .analysis {
  105. &-title {
  106. margin: 8px 0;
  107. font-size: 14px;
  108. color: $font-light-color;
  109. }
  110. }
  111. }
  112. .property {
  113. display: flex;
  114. &::before {
  115. display: inline-block;
  116. width: 2px;
  117. height: 100%;
  118. margin: 0 24px;
  119. content: '';
  120. background-color: $border-color;
  121. }
  122. .el-form {
  123. .el-input {
  124. width: 250px;
  125. }
  126. }
  127. }
  128. }
  129. }
  130. </style>