chioseSoundList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div>
  3. <div class="soundWrap">
  4. <el-checkbox-group v-model.trim="activeSoundList">
  5. <div class="itemList">
  6. <div class="categroy"
  7. v-for="(item,index) in soundList"
  8. :key="index">
  9. <p>{{item.name}}</p>
  10. <el-checkbox :label="sound.id"
  11. @change="changeCheck"
  12. :disabled="activeSound.includes(sound.id)"
  13. v-for="(sound,indexs) in item.subjects"
  14. :key="indexs">{{sound.name}}</el-checkbox>
  15. </div>
  16. </div>
  17. </el-checkbox-group>
  18. </div>
  19. <p class="soundSubP">当前选择声部数:{{activeSoundList.length}}</p>
  20. <div class="btnWraps">
  21. <el-button @click="generates"
  22. type="primary">
  23. 确定
  24. </el-button>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. props: ['soundList', 'childSoundList', 'activeSound'],
  31. data () {
  32. return {
  33. chioseSoundNum: '',
  34. activeSoundList: this.activeSound || [],
  35. }
  36. },
  37. mounted () {
  38. console.log(this.soundList)
  39. },
  40. activated () {
  41. console.log(this.soundList)
  42. },
  43. methods: {
  44. generates () {
  45. this.$emit('chioseSound', this.activeSoundList)
  46. },
  47. changeCheck () {
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .soundWrap {
  54. width: 100%;
  55. overflow: auto;
  56. .itemList {
  57. display: flex;
  58. flex-direction: row;
  59. justify-content: flex-start;
  60. flex-wrap: nowrap;
  61. flex-grow: 1;
  62. height: 300px;
  63. max-height: 300px;
  64. overflow: auto;
  65. .categroy {
  66. z-index: 100;
  67. width: 150px;
  68. min-width: 150px;
  69. color: #606266;
  70. .el-checkbox {
  71. height: 30px;
  72. line-height: 30px;
  73. display: block;
  74. padding-left: 20px;
  75. }
  76. p {
  77. height: 40px;
  78. line-height: 40px;
  79. background-color: #edeef0;
  80. margin-bottom: 15px;
  81. text-align: center;
  82. }
  83. }
  84. }
  85. }
  86. .soundSubP {
  87. height: 40px;
  88. line-height: 40px;
  89. background-color: #edeef0;
  90. padding-left: 25px;
  91. margin-bottom: 20px;
  92. }
  93. .btnWraps {
  94. display: flex;
  95. flex-direction: row;
  96. justify-content: flex-end;
  97. }
  98. </style>