index3.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="li_box">
  3. <view class="lb_title">
  4. {{index+1}}. {{item.question}}
  5. </view>
  6. <view class="lb_card">
  7. <view class="lb_box" v-for="(ua,ui) in item[arrayKey]" :key="ui">
  8. <view class="memo">{{assessmentMethodCfg[ua.assessmentMethod]||''}}</view>
  9. <view class="lb_answers">
  10. <u-radio-group
  11. :value="ua.answer"
  12. placement="column"
  13. @change="e=>radioChange(e,ua.assessmentMethod,item.id)"
  14. >
  15. <view class="la_item" v-for="(pre,idx) in ua.questionOption" :key="idx">
  16. <u-radio
  17. :label="pre.questionOption"
  18. :name="pre.questionOption"
  19. activeColor="#33A7A7"
  20. size="36rpx"
  21. iconSize="32rpx"
  22. labelSize="32rpx"
  23. ></u-radio>
  24. </view>
  25. </u-radio-group>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. name: "QuestionItem",
  34. props: {
  35. item: {
  36. type: Object,
  37. required: true
  38. },
  39. index: {
  40. type: Number,
  41. required: true
  42. },
  43. arrayKey: {
  44. type: String,
  45. default:'userAnswer'
  46. },
  47. },
  48. data(){
  49. return {
  50. assessmentMethodCfg:{
  51. '1':'您对团队当前在此项陈述上所描述的实际表现的同意程度为:',
  52. '2':'此项陈述对该团队当前的重要性: '
  53. }
  54. }
  55. },
  56. methods: {
  57. radioChange(value,assessmentMethod,id) {
  58. this.$emit('change', {
  59. value,
  60. assessmentMethod,
  61. id,
  62. index: this.index
  63. });
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped lang="less">
  69. .li_box{
  70. margin-top: 20rpx;
  71. .lb_title{
  72. font-family: PingFang-SC, PingFang-SC;
  73. font-weight: bold;
  74. font-size: 32rpx;
  75. color: #002846;
  76. line-height: 48rpx;
  77. }
  78. .lb_card{
  79. background: #F2F9F9;
  80. border-radius: 24rpx;
  81. padding: 0 24rpx 40rpx;
  82. overflow: hidden;
  83. margin-top: 32rpx;
  84. }
  85. .lb_box{
  86. margin-top: 40rpx;
  87. .memo{
  88. font-family: PingFangSC, PingFang SC;
  89. font-weight: 400;
  90. font-size: 24rpx;
  91. color: #009191;
  92. line-height: 24rpx;
  93. }
  94. .lb_answers{
  95. width: 100%;
  96. margin-top: 20rpx;
  97. .la_item{
  98. padding: 31rpx 24rpx;
  99. background: #FFFFFF;
  100. border-radius: 24rpx;
  101. margin-top: 10rpx;
  102. }
  103. }
  104. }
  105. }
  106. </style>