AudioControlModule.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-ligatureModule">
  4. <div class="Big-Book-content m">
  5. <div class="Big-Book-con-main">
  6. <div class="adult-book-input-item" v-if="type == 'audio_control_easy'">
  7. <span class="adult-book-lable">序号:</span>
  8. <el-input
  9. type="textarea"
  10. class="adult-book-input"
  11. :autosize="{ minRows: 2 }"
  12. placeholder="请输入序号"
  13. v-model="curQueItem.Number"
  14. ></el-input>
  15. <img
  16. @click="romveoptionCon"
  17. class="close"
  18. src="../../../assets/adult/del-close.png"
  19. alt=""
  20. />
  21. <div class="adult-book-input-item">
  22. <Upload
  23. :changeFillId="changeMp3"
  24. :datafileList="curQueItem.mp3_list"
  25. :filleNumber="mp3Number"
  26. :uploadType="'mp3'"
  27. />
  28. </div>
  29. </div>
  30. </div>
  31. <div v-if="curQue.ChildType == 'record_control_mini'">
  32. <img src="../../../assets/adult/mini.png" alt="" />
  33. </div>
  34. <div v-if="curQue.ChildType == 'record_control_normal'">
  35. <img src="../../../assets/adult/normal.png" alt="" />
  36. </div>
  37. <div v-if="curQue.ChildType == 'record_control_pro'">
  38. <img src="../../../assets/adult/pro.png" alt="" />
  39. </div>
  40. <div v-if="curQue.ChildType == 'record_control_promax'">
  41. <img src="../../../assets/adult/pro-max.png" alt="" />
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import Upload from "./Upload.vue";
  48. import "@/utils/pinyin_dict_withtone";
  49. import "@/utils/pinyinUtil";
  50. export default {
  51. components: {
  52. Upload,
  53. },
  54. props: ["curQueItem", "index", "deleteOptionOne", "type", "curQue"],
  55. data() {
  56. return {
  57. imgNumber: 1,
  58. mp3Number: 1,
  59. fileCon: {
  60. img_list: [],
  61. mp3_list: [],
  62. },
  63. };
  64. },
  65. computed: {},
  66. watch: {},
  67. //方法集合
  68. methods: {
  69. // 删除当前选项
  70. romveoptionCon() {
  71. this.$confirm(`确定要删除此音频吗?`, "提示", {
  72. confirmButtonText: "确定",
  73. cancelButtonText: "取消",
  74. type: "warning",
  75. }).then(() => {
  76. this.deleteOptionOne(this.index);
  77. });
  78. },
  79. changeMp3(fileList) {
  80. console.log(fileList);
  81. const articleImgList = JSON.parse(JSON.stringify(fileList));
  82. const articleImgRes = [];
  83. articleImgList.forEach((item) => {
  84. if (item.response) {
  85. const obj = {
  86. name: item.name,
  87. url: item.response.file_info_list[0].file_url,
  88. id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
  89. media_duration: item.response.file_info_list[0].media_duration, //音频时长
  90. };
  91. articleImgRes.push(obj);
  92. }
  93. });
  94. //this.articleImgList = articleImgRes;
  95. this.curQueItem.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
  96. },
  97. },
  98. //生命周期 - 创建完成(可以访问当前this实例)
  99. created() {},
  100. //生命周期 - 挂载完成(可以访问DOM元素)
  101. mounted() {
  102. if (this.curQueItem) {
  103. this.fileCon.img_list = this.curQueItem.img_list;
  104. this.fileCon.mp3_list = this.curQueItem.mp3_list;
  105. }
  106. },
  107. beforeCreate() {}, //生命周期 - 创建之前
  108. beforeMount() {}, //生命周期 - 挂载之前
  109. beforeUpdate() {}, //生命周期 - 更新之前
  110. updated() {}, //生命周期 - 更新之后
  111. beforeDestroy() {}, //生命周期 - 销毁之前
  112. destroyed() {}, //生命周期 - 销毁完成
  113. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  114. };
  115. </script>
  116. <style lang='scss' scoped>
  117. //@import url(); 引入公共css类
  118. .Big-Book-ligatureModule {
  119. .Big-Book-content {
  120. .Big-Book-con {
  121. display: flex;
  122. align-items: center;
  123. }
  124. .Big-Book-title {
  125. font-size: 16px;
  126. line-height: 40px;
  127. color: #000;
  128. margin-right: 15px;
  129. }
  130. .Big-Book-con-main {
  131. > div {
  132. display: flex;
  133. align-items: center;
  134. margin-bottom: 16px;
  135. img {
  136. width: 24px;
  137. height: 24px;
  138. }
  139. .close {
  140. cursor: pointer;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>