SelfAssessmentModule.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-single">
  4. <div class="Big-Book-content m">
  5. <div class="Big-Book-main">
  6. <div class="adult-book-input-item">
  7. <span class="adult-book-lable">选项内容:</span>
  8. <el-input
  9. class="adult-book-input"
  10. :autosize="{ minRows: 2 }"
  11. type="textarea"
  12. placeholder="请输入内容"
  13. v-model="curQueItem.con"
  14. @blur="curQueItem.con = curQueItem.con.trim()"
  15. maxlength="200"
  16. show-word-limit
  17. ></el-input>
  18. <el-checkbox
  19. style="margin-left: 7px"
  20. @change="changeIsAnswer"
  21. v-model="curQueItem.isAnswer"
  22. :label="index"
  23. >答案</el-checkbox
  24. >
  25. <!-- <div class=""></div> -->
  26. <img
  27. @click="deleteOption"
  28. class="close"
  29. src="../../../assets/adult/del-close.png"
  30. alt=""
  31. />
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import Upload from "./Upload.vue";
  39. import "@/utils/pinyin_dict_withtone";
  40. import "@/utils/pinyinUtil";
  41. export default {
  42. components: {
  43. Upload,
  44. },
  45. props: ["curQueItem", "index", "changAnswer", "deleteOptionOne", "type"],
  46. data() {
  47. return {
  48. imgNumber: 10,
  49. mp3Number: 10,
  50. fileCon: {
  51. timu_img_list: [],
  52. timu_mp3_list: [],
  53. img_list: [],
  54. mp3_list: [],
  55. },
  56. };
  57. },
  58. computed: {},
  59. watch: {},
  60. //方法集合
  61. methods: {
  62. // 删除当前选项
  63. deleteOption() {
  64. this.$confirm("确定要删除此选项吗?", "提示", {
  65. confirmButtonText: "确定",
  66. cancelButtonText: "取消",
  67. type: "warning",
  68. }).then(() => {
  69. this.deleteOptionOne(this.index);
  70. });
  71. },
  72. // 修改正确答案
  73. changeIsAnswer() {
  74. this.changAnswer(this.index);
  75. },
  76. },
  77. //生命周期 - 创建完成(可以访问当前this实例)
  78. created() {},
  79. //生命周期 - 挂载完成(可以访问DOM元素)
  80. mounted() {
  81. if (this.curQueItem) {
  82. this.fileCon.img_list = this.curQueItem.img_list;
  83. this.fileCon.mp3_list = this.curQueItem.mp3_list;
  84. }
  85. },
  86. beforeCreate() {}, //生命周期 - 创建之前
  87. beforeMount() {}, //生命周期 - 挂载之前
  88. beforeUpdate() {}, //生命周期 - 更新之前
  89. updated() {}, //生命周期 - 更新之后
  90. beforeDestroy() {}, //生命周期 - 销毁之前
  91. destroyed() {}, //生命周期 - 销毁完成
  92. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  93. };
  94. </script>
  95. <style lang='scss' scoped>
  96. //@import url(); 引入公共css类
  97. .Big-Book-single {
  98. .Big-Book-content {
  99. &.m {
  100. display: flex;
  101. justify-content: flex-start;
  102. align-items: flex-start;
  103. }
  104. .Big-Book-con {
  105. display: flex;
  106. align-items: center;
  107. }
  108. .Big-Book-title {
  109. font-size: 16px;
  110. line-height: 40px;
  111. color: #000;
  112. margin-right: 15px;
  113. }
  114. .Big-Book-main {
  115. position: relative;
  116. width: 100%;
  117. > div {
  118. margin-bottom: 10px;
  119. &.Big-Book-pinyin,
  120. &.Big-Book-con,
  121. &.Big-Book-en {
  122. display: flex;
  123. justify-content: flex-start;
  124. align-items: center;
  125. }
  126. }
  127. .close {
  128. position: relative;
  129. top: -4px;
  130. cursor: pointer;
  131. width: 24px;
  132. height: 24px;
  133. }
  134. }
  135. }
  136. }
  137. </style>