checkListItemTree.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <ul v-if="data">
  3. <li v-for="(item, itemIdx) in data" :key="item.itemCode">
  4. <uni-row class="checklist-item">
  5. <uni-col :span="3">
  6. <template v-if="item.itemType === 1"></template>
  7. <text style="padding-left: 8px;" v-else />
  8. </uni-col>
  9. <uni-col :span="2">
  10. <text>{{ itemIdx + 1 }}</text>
  11. </uni-col>
  12. <uni-col :span="18">
  13. <text>{{ item.itemTitle }}</text>
  14. </uni-col>
  15. </uni-row>
  16. <checklist-item :data="item.children" @change="changePoint" />
  17. <ul class="point-container">
  18. <li v-for="(point, pointIdx) in item.pointList" :key="point.pointCode" class="checklist-point" @click="changePoint(point)">
  19. <uni-row>
  20. <uni-col :span="2">
  21. <text> {{ pointIdx + 1 }}</text>
  22. </uni-col>
  23. <uni-col :span="18">
  24. <text > {{ point.pointContent }} </text>
  25. <view class="uni-rate-container">
  26. <text>评价</text>
  27. <uni-rate v-model="formData.score" />
  28. </view>
  29. </uni-col>
  30. </uni-row>
  31. </li>
  32. </ul>
  33. </li>
  34. </ul>
  35. </template>
  36. <script>
  37. import ChecklistItem from '@/components/ChecklistItem.vue'
  38. export default {
  39. name: 'ChecklistItem',
  40. props: {
  41. value:{
  42. type:[String,Number]
  43. },
  44. data: {
  45. type: Array,
  46. default:()=>[]
  47. }
  48. },
  49. components:{
  50. ChecklistItem
  51. },
  52. methods: {
  53. changePoint(item){
  54. this.$emit("input", item.pointId);
  55. this.$emit("change",item);
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. ul {
  62. padding-left: 20upx!important;
  63. list-style-type: none;
  64. .uni-col-3{
  65. min-height: 1px;
  66. }
  67. }
  68. .checklist-item {
  69. color: #F7F7F7;
  70. padding: 20upx 0;
  71. line-height: 1;
  72. }
  73. .checklist-point {
  74. padding-top: 20upx;
  75. line-height: 1;
  76. }
  77. .uni-rate-container{
  78. display: flex;
  79. justify-content: flex-start;
  80. align-items: center;
  81. padding-top: 16upx;
  82. }
  83. </style>