CourseStart.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!-- -->
  2. <template>
  3. <div class="Big-Book-sentence" v-if="curQue">
  4. <div
  5. class="Big-Book-Single-content"
  6. style="margin-left: 20px; margin-top: 20px"
  7. >
  8. <div class="adult-book-input-item">
  9. <span class="adult-book-lable">标题字体:</span>
  10. <el-radio-group v-model="curQue.titleType">
  11. <el-radio label="cn">中文</el-radio>
  12. <el-radio label="en">英文</el-radio>
  13. </el-radio-group>
  14. </div>
  15. <div class="adult-book-input-item" v-if="curQue.titleType">
  16. <span class="adult-book-lable">标题:</span>
  17. <el-input
  18. class="adult-book-input"
  19. type="textarea"
  20. :autosize="{ minRows: 2 }"
  21. placeholder="请输入标题"
  22. v-model="curQue.title"
  23. @blur="onBlur(curQue, 'title')"
  24. maxlength="200"
  25. show-word-limit
  26. ></el-input>
  27. </div>
  28. <div>
  29. <SentenceSegwordChs :curQue="curQue.detail" />
  30. </div>
  31. <div class="adult-book-input-item">
  32. <span class="adult-book-lable">英文:</span>
  33. <el-input
  34. class="adult-book-input"
  35. type="textarea"
  36. :autosize="{ minRows: 2 }"
  37. placeholder="请输入英文"
  38. v-model="curQue.en"
  39. @blur="onBlur(curQue, 'en')"
  40. maxlength="200"
  41. show-word-limit
  42. ></el-input>
  43. </div>
  44. <div class="adult-book-input-item">
  45. <span class="adult-book-lable">内容:</span>
  46. <el-input
  47. class="adult-book-input"
  48. type="textarea"
  49. :autosize="{ minRows: 2 }"
  50. placeholder="请输入内容"
  51. v-model="curQue.con"
  52. @blur="onBlur(curQue, 'con')"
  53. maxlength="5000"
  54. show-word-limit
  55. ></el-input>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import Upload from "../common/Upload";
  62. import SentenceSegwordChs from "../common/SentenceSegwordChs/index.vue";
  63. export default {
  64. name: "Single",
  65. props: ["curQue", "fn_data", "changeCurQue", "type"],
  66. components: {
  67. Upload,
  68. SentenceSegwordChs,
  69. },
  70. data() {
  71. return {
  72. data_structure: {
  73. type: "CourseStart_chs",
  74. name: "封面",
  75. title: "",
  76. titleType: "",
  77. en: "",
  78. con: "",
  79. detail: {
  80. type: "detail",
  81. pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
  82. sentence: "", //句子
  83. segList: [], //分词结果
  84. seg_words: "",
  85. wordsList: [],
  86. },
  87. },
  88. };
  89. },
  90. computed: {},
  91. watch: {},
  92. //方法集合
  93. methods: {
  94. onBlur(item, field) {
  95. item[field] = item[field] ? item[field].trim() : "";
  96. },
  97. },
  98. //生命周期 - 创建完成(可以访问当前this实例)
  99. created() {
  100. if (!this.curQue) {
  101. this.changeCurQue(this.data_structure);
  102. }
  103. },
  104. //生命周期 - 挂载完成(可以访问DOM元素)
  105. mounted() {},
  106. beforeCreate() {}, //生命周期 - 创建之前
  107. beforeMount() {}, //生命周期 - 挂载之前
  108. beforeUpdate() {}, //生命周期 - 更新之前
  109. updated() {}, //生命周期 - 更新之后
  110. beforeDestroy() {}, //生命周期 - 销毁之前
  111. destroyed() {}, //生命周期 - 销毁完成
  112. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  113. };
  114. </script>
  115. <style lang='scss' scope>
  116. //@import url(); 引入公共css类
  117. .Big-Book-sentence {
  118. &-content {
  119. &.m {
  120. display: flex;
  121. justify-content: flex-start;
  122. align-items: flex-start;
  123. }
  124. .Big-Book-title {
  125. font-size: 16px;
  126. line-height: 40px;
  127. color: #000;
  128. margin-right: 15px;
  129. }
  130. .Big-Book-main {
  131. > div {
  132. margin-bottom: 10px;
  133. &.Big-Book-pinyin {
  134. display: flex;
  135. justify-content: flex-start;
  136. align-items: center;
  137. }
  138. }
  139. }
  140. }
  141. .Big-Book-addrole {
  142. > div {
  143. width: 300px;
  144. height: 40px;
  145. background: #f3f3f3;
  146. border: 1px dashed rgba(0, 0, 0, 0.15);
  147. box-sizing: border-box;
  148. border-radius: 4px;
  149. text-align: center;
  150. line-height: 40px;
  151. cursor: pointer;
  152. }
  153. }
  154. .Big-Book-more {
  155. .Big-Book-more-text {
  156. position: relative;
  157. text-align: center;
  158. }
  159. .Big-Book-more-text:before,
  160. .Big-Book-more-text:after {
  161. position: absolute;
  162. background: #ccc;
  163. content: "";
  164. height: 1px;
  165. top: 50%;
  166. width: 45%;
  167. }
  168. .Big-Book-more-text:before {
  169. left: 10px;
  170. }
  171. .Big-Book-more-text:after {
  172. right: 10px;
  173. }
  174. .Big-Book-more-main {
  175. display: flex;
  176. > :not(:nth-child(1)) {
  177. margin-left: 30px;
  178. }
  179. }
  180. }
  181. .Big-Book-con {
  182. display: flex;
  183. align-items: center;
  184. }
  185. }
  186. .lrc-box {
  187. display: flex;
  188. justify-content: flex-start;
  189. align-items: center;
  190. > span {
  191. font-size: 14px;
  192. margin-right: 16px;
  193. }
  194. }
  195. .close {
  196. width: 24px;
  197. cursor: pointer;
  198. }
  199. .addoption {
  200. width: 200px;
  201. height: 40px;
  202. margin-bottom: 15px;
  203. background: #f3f3f3;
  204. border: 1px dashed rgba(0, 0, 0, 0.15);
  205. box-sizing: border-box;
  206. border-radius: 4px;
  207. text-align: center;
  208. line-height: 40px;
  209. cursor: pointer;
  210. }
  211. </style>
  212. <style lang="scss">
  213. </style>