index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. <!-- -->
  2. <template>
  3. <div
  4. class="NPC-Book-Article Big-Book-Maxwidth"
  5. v-if="curQue"
  6. v-loading="loading"
  7. >
  8. <div class="adult-book-input-item">
  9. <span class="adult-book-lable">序号:</span>           
  10. <el-input
  11. style="width: 300px"
  12. placeholder="请输入序号"
  13. v-model="curQue.title"
  14. @blur="onBlur(curQue, 'number')"
  15. class="adult-book-input"
  16. ></el-input>
  17. </div>
  18. <div class="Big-Book-img">
  19. <UploadArt
  20. :change-fill-id="changeImage"
  21. :datafile-list="fileCon.img_list"
  22. upload-type="image"
  23. class="article_pdf"
  24. :filleNumber="imageNumber"
  25. />
  26. <ul
  27. class="uploadArt_list"
  28. v-if="curQue.img_list && curQue.img_list.length > 0"
  29. >
  30. <li
  31. v-for="(artItem, artIndex) in curQue.img_list"
  32. :key="'articleImgList' + artIndex"
  33. >
  34. <img :src="artItem.url" style="width: 26px" />
  35. <span class="art_name">{{ artItem.name }}</span>
  36. <p>
  37. 图片放到第<el-input
  38. class="imgNumber"
  39. type="number"
  40. v-model="artItem.imgNumber"
  41. size="mini"
  42. @input="forceUpdate"
  43. ></el-input
  44. >段落的后面
  45. </p>
  46. <img
  47. src="@/assets/adult/del-close.png"
  48. class="del-close"
  49. @click="delImage(artIndex)"
  50. />
  51. </li>
  52. </ul>
  53. </div>
  54. <div class="Big-Book-mp3">
  55. <Upload
  56. type="mp3"
  57. :changeFillId="changeMp3"
  58. :datafileList="fileCon.mp3_list"
  59. :filleNumber="mp3Number"
  60. :uploadType="'mp3'"
  61. :handleMp3Base64="handleChange"
  62. />
  63. </div>
  64. <div class="adult-book-input-item">
  65. <span class="adult-book-lable">功能配置:</span>
  66. <div class="adult-book-main" v-if="curQue.checkList">
  67. <el-checkbox-group v-model="curQue.checkList">
  68. <el-checkbox :label="1">显示生词功能</el-checkbox>
  69. <el-checkbox :label="2">语音练习模式</el-checkbox>
  70. <el-checkbox :label="3">取词功能</el-checkbox>
  71. </el-checkbox-group>
  72. </div>
  73. </div>
  74. <div class="adult-book-input-item">
  75. <span class="adult-book-lable">文章提示:</span>
  76. <el-input
  77. class="adult-book-input"
  78. type="textarea"
  79. :autosize="{ minRows: 2 }"
  80. placeholder="请输入文章提示"
  81. v-model="curQue.notice"
  82. @blur="onBlur(curQue, 'notice')"
  83. ></el-input>
  84. </div>
  85. <div class="NPC-Book-role">
  86. <ul class="adult-book-input-role" v-if="curQue.roleList.length > 0">
  87. <li
  88. v-for="(rItem, rIndex) in curQue.roleList"
  89. :key="'roleList' + rIndex"
  90. >
  91. <div class="rItem" @click="editRole(rItem)">
  92. <span v-if="rItem.role" class="adult-book-input-roleText">{{
  93. rItem.role
  94. }}</span>
  95. <img
  96. v-else
  97. :src="rItem.img_list[0] && rItem.img_list[0].url"
  98. class="adult-book-input-roleImg"
  99. />
  100. <template v-if="rItem.detail.wordsList.length > 0">
  101. <span class="pinyin">{{
  102. rItem.detail.wordsList | handlePinyin
  103. }}</span>
  104. <span class="chs">{{ rItem.detail.wordsList | handleChs }}</span>
  105. </template>
  106. </div>
  107. <i class="el-icon-circle-close" @click="delRole(rIndex)"></i>
  108. </li>
  109. </ul>
  110. <el-button type="primary" @click="addRole">添加角色</el-button>
  111. </div>
  112. <div class="NPC-Book-article">
  113. <ArticleChs
  114. :curQue="curQue"
  115. :isPara="isPara"
  116. :changeIsPara="changeIsPara"
  117. />
  118. </div>
  119. <template
  120. v-if="
  121. curQue.mp3_list &&
  122. curQue.mp3_list.length > 0 &&
  123. curQue.mp3_list[0].source
  124. "
  125. >
  126. <div class="create_mp3_list">
  127. <span>引擎音频:</span>
  128. <span class="mp3_file_name">{{ curQue.mp3_list[0].name }}</span>
  129. <img
  130. src="../../../../assets/adult/del-close.png"
  131. class="mp3_del"
  132. @click="delMp3"
  133. />
  134. </div>
  135. </template>
  136. <template v-else>
  137. <el-button :loading="CreadMp3loading" size="small" @click="CreadMp3"
  138. >生成音频</el-button
  139. >
  140. </template>
  141. <div class="NPC-Book-Paragraph" v-if="isPara">
  142. <Paragraph :curQue="curQue" :isClause="isClause" :sureSeg="sureSeg" />
  143. </div>
  144. <div class="NPC-Book-model">
  145. <span class="adult-book-input-lable">拼音位置:</span>
  146. <el-radio-group v-model="curQue.pyPosition">
  147. <el-radio :label="'top'">字上面</el-radio>
  148. <el-radio :label="'bottom'">字下面</el-radio>
  149. </el-radio-group>
  150. </div>
  151. <!---上传rlc文件-->
  152. <!-- <div class="NPC-Book-Paragraph" v-if="isClause">
  153. <el-button
  154. type="warning"
  155. size="small"
  156. @click="uploadLRC"
  157. v-if="curQue.detail[0].timeList.length == 0"
  158. >上传lrc文件</el-button
  159. >
  160. <div v-else class="lrc-box">
  161. <span>已有字幕时间节点</span>
  162. <el-button type="text" @click="editTimeList">去编辑</el-button>
  163. </div>
  164. </div> -->
  165. <!---分句-->
  166. <div class="NPC-Book-Paragraph" v-if="isClause">
  167. <Clauseresult :curQue="curQue" :segByWord="segByWord" />
  168. </div>
  169. <div class="lrc-box">
  170. <div
  171. v-if="this.curQue.wordTime && this.curQue.wordTime.length > 0"
  172. class="lrc-box"
  173. >
  174. <span>已有字幕时间节点</span>
  175. <el-button type="text" @click="againWordTime">重新生成</el-button>
  176. <el-button @click="compareTime('句子')" size="medium"
  177. >校对句子字幕时间</el-button
  178. >
  179. <el-button @click="compareTime('文字')" size="medium"
  180. >校对文字字幕时间</el-button
  181. >
  182. </div>
  183. <template v-else>
  184. <el-button v-if="!isWordTime" size="medium" @click="createWordTime"
  185. >自动生成字幕节点</el-button
  186. >
  187. <p v-else>字幕节点生成中...请等待</p>
  188. </template>
  189. </div>
  190. <!---分词-->
  191. <div class="NPC-Book-Word" v-if="isByWord">
  192. <Segbyword :curQue="curQue" :paraIndex="paraIndex" :segList="segList" />
  193. </div>
  194. <el-dialog title="段落分句字幕打点" :visible.sync="cTVisible" width="30%">
  195. <Createtimelist ref="createtimelist" :curQue="curQue" />
  196. <span slot="footer" class="dialog-footer">
  197. <el-button @click="cTVisible = false">取 消</el-button>
  198. <el-button type="primary" @click="saveTimeList">保 存</el-button>
  199. </span>
  200. </el-dialog>
  201. <el-dialog
  202. :title="roleStatus == 1 ? '添加角色' : '编辑角色'"
  203. :visible.sync="roleVisible"
  204. width="60%"
  205. >
  206. <template v-if="roleStatus == 1">
  207. <RoleChs
  208. ref="createRolelist"
  209. :curRole="curQue.roleList[curQue.roleList.length - 1]"
  210. />
  211. </template>
  212. <template v-else>
  213. <RoleChs ref="createRolelist" :curRole="curRole" />
  214. </template>
  215. <span slot="footer" class="dialog-footer">
  216. <el-button @click="roleVisible = false">取 消</el-button>
  217. <el-button type="primary" @click="saveRoleList">保 存</el-button>
  218. </span>
  219. </el-dialog>
  220. <el-dialog
  221. title="校对字幕时间"
  222. :visible.sync="compareShow"
  223. width="50%"
  224. :before-close="handleClose"
  225. top="0"
  226. >
  227. <CompareTime
  228. :data="compareData"
  229. :type="compareType"
  230. :changewordsResultList="changewordsResultList"
  231. />
  232. <span slot="footer" class="dialog-footer">
  233. <el-button @click="handleClose">取 消</el-button>
  234. <el-button :loading="compareloading" type="primary" @click="saveCompare"
  235. >确 定</el-button
  236. >
  237. </span>
  238. </el-dialog>
  239. </div>
  240. </template>
  241. <script>
  242. import {
  243. segSentences,
  244. BatchSegContent,
  245. createPinyin,
  246. prepareTranscribe,
  247. getWordTime,
  248. compareSenTenceTime,
  249. getContentFile,
  250. textCreadMp3,
  251. } from "@/api/ajax";
  252. const Base64 = require("js-base64").Base64;
  253. import Upload from "../../common/Upload.vue";
  254. import UploadArt from "../../common/UploadArt.vue";
  255. import ArticleChs from "./components/ArticleChs.vue";
  256. import Paragraph from "./components/ParagraphChs.vue";
  257. import Clauseresult from "./components/ClauseresultChs.vue";
  258. import Segbyword from "./components/SegbywordChs.vue";
  259. import Createtimelist from "./components/CreatetimelistChs.vue";
  260. import RoleChs from "./components/RoleChs.vue";
  261. import CompareTime from "../ArticleTemChs/components/CompareTime.vue";
  262. export default {
  263. name: "DialogueAnswerChs",
  264. components: {
  265. Upload,
  266. UploadArt,
  267. ArticleChs,
  268. Paragraph,
  269. Clauseresult,
  270. Segbyword,
  271. Createtimelist,
  272. RoleChs,
  273. CompareTime,
  274. },
  275. props: ["curQue", "changeCurQue", "tmIndex"],
  276. filters: {
  277. handlePinyin(wordsList) {
  278. let str = "";
  279. wordsList.forEach((item, index) => {
  280. if (index < wordsList.length - 1) {
  281. str += item.pinyin + " ";
  282. } else {
  283. str += item.pinyin;
  284. }
  285. });
  286. return str;
  287. },
  288. handleChs(wordsList) {
  289. let str = "";
  290. wordsList.forEach((item, index) => {
  291. if (index < wordsList.length - 1) {
  292. str += item.chs + " ";
  293. } else {
  294. str += item.chs;
  295. }
  296. });
  297. return str;
  298. },
  299. },
  300. data() {
  301. return {
  302. imageNumber: 1000,
  303. mp3Number: 1,
  304. fileCon: {
  305. img_list: [],
  306. mp3_list: [],
  307. },
  308. isPara: false,
  309. isClause: false,
  310. isByWord: false,
  311. paraIndex: 0, //段落索引
  312. cTVisible: false,
  313. roleVisible: false,
  314. roleStatus: 1, //1添加;2是编辑
  315. curRole: null,
  316. loading: false,
  317. segList: null,
  318. data_structure: {
  319. type: "dialogue_article_chs",
  320. name: "课文",
  321. model: 1,
  322. pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
  323. notice: "", //文章提示信息
  324. mp3_list: [],
  325. img_list: [],
  326. article: "",
  327. roleList: [],
  328. detail: [],
  329. wordTime: [],
  330. taskId: "",
  331. checkList: [1, 2, 3],
  332. },
  333. isWordTime: false,
  334. compareType: "", //校对类型
  335. compareShow: false,
  336. compareData: null,
  337. compareloading: false,
  338. CreadMp3loading: false,
  339. };
  340. },
  341. computed: {},
  342. watch: {},
  343. //方法集合
  344. methods: {
  345. // 得到文件流
  346. getfillLiu() {
  347. this.loading = true;
  348. let _this = this;
  349. return new Promise(function (resolve, reject) {
  350. if (
  351. _this.curQue.mp3_list &&
  352. _this.curQue.mp3_list.length > 0 &&
  353. _this.curQue.mp3_list[0].id
  354. ) {
  355. let Mname = "file_store_manager-GetFileByteBase64Text";
  356. let id = _this.curQue.mp3_list[0].id
  357. .replace("[FID##", "")
  358. .replace("##FID]", "");
  359. let data = {
  360. file_id: id,
  361. };
  362. getContentFile(Mname, data).then((res) => {
  363. let taskIddata = {
  364. fileName: _this.curQue.mp3_list[0].name,
  365. speechBase64: res.base64_text,
  366. language: "ch",
  367. };
  368. prepareTranscribe(taskIddata).then((res) => {
  369. _this.$set(_this.curQue, "taskId", res.data.taskId);
  370. _this.loading = false;
  371. resolve();
  372. });
  373. });
  374. } else {
  375. _this.$message.warning("请先上传音频");
  376. }
  377. });
  378. },
  379. // 根据文章生成MP3
  380. CreadMp3() {
  381. let _this = this;
  382. if (_this.curQue.mp3_list.length > 0) {
  383. _this.$message.warning("已有音频,请勿重复生成");
  384. return;
  385. }
  386. if (!_this.curQue.article) {
  387. _this.$message.warning("请先输入内容,在生成音频");
  388. return;
  389. }
  390. _this.CreadMp3loading = true;
  391. textCreadMp3({
  392. text: _this.curQue.article,
  393. }).then((res) => {
  394. res.data.fileInfo.id = "[FID##" + res.data.fileInfo.file_id + "##FID]";
  395. res.data.fileInfo.name = res.data.fileInfo.file_name;
  396. let fileList = [res.data.fileInfo];
  397. _this.$set(_this.curQue, "mp3_list", fileList);
  398. _this.CreadMp3loading = false;
  399. _this.$message.success("生成成功");
  400. });
  401. },
  402. //删除生成的mp3
  403. delMp3() {
  404. this.curQue.mp3_list.splice(0, 1);
  405. },
  406. // 保存校对
  407. saveCompare() {
  408. this.compareloading = true;
  409. console.log(this.compareData);
  410. compareSenTenceTime({ matchList: JSON.stringify(this.compareData) }).then(
  411. (res) => {
  412. console.log(res);
  413. this.compareloading = false;
  414. this.curQue.wordTime = res.data.result;
  415. console.log(this.curQue.wordTime);
  416. }
  417. );
  418. },
  419. // 校对时间
  420. compareTime(type) {
  421. this.compareType = type;
  422. this.compareData = JSON.parse(JSON.stringify(this.curQue.wordTime));
  423. this.compareShow = true;
  424. },
  425. handleClose() {
  426. this.compareShow = false;
  427. this.compareData = null;
  428. this.compareType = "";
  429. },
  430. // 校对每个字的时间
  431. changewordsResultList(index, item) {
  432. this.curQue.wordTime[index].wordsResultList = JSON.parse(
  433. JSON.stringify(item)
  434. );
  435. },
  436. onBlur(item, field) {
  437. item[field] = item[field] ? item[field].trim() : "";
  438. },
  439. changeMp3(fileList) {
  440. const articleImgList = JSON.parse(JSON.stringify(fileList));
  441. const articleImgRes = [];
  442. articleImgList.forEach((item) => {
  443. if (item.response) {
  444. const obj = {
  445. name: item.name,
  446. duration: item.response.file_info_list[0].media_duration,
  447. url: item.response.file_info_list[0].file_url,
  448. id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
  449. media_duration: item.response.file_info_list[0].media_duration, //音频时长
  450. };
  451. articleImgRes.push(obj);
  452. }
  453. });
  454. this.curQue.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
  455. },
  456. changeImage(file) {
  457. console.log(file);
  458. if (file.response) {
  459. const obj = {
  460. name: file.name,
  461. url: file.response.file_info_list[0].file_url,
  462. id: "[FID##" + file.response.file_info_list[0].file_id + "##FID]",
  463. imgNumber: 0,
  464. };
  465. this.curQue.img_list.push(obj);
  466. this.$forceUpdate();
  467. }
  468. },
  469. forceUpdate() {
  470. this.$forceUpdate();
  471. },
  472. delImage(index) {
  473. this.curQue.img_list.splice(index, 1);
  474. this.fileCon.img_list.splice(index, 1);
  475. },
  476. //添加角色
  477. addRole() {
  478. this.roleVisible = true;
  479. this.roleStatus = 1;
  480. let id = Math.random().toString(36).substr(2);
  481. let roleCon = {
  482. id: id,
  483. role: "",
  484. img_list: [],
  485. detail: {
  486. fullName: "",
  487. seg_words: "",
  488. wordsList: [],
  489. },
  490. };
  491. this.curQue.roleList.push(JSON.parse(JSON.stringify(roleCon)));
  492. },
  493. //保存角色
  494. saveRoleList() {
  495. this.roleVisible = false;
  496. this.$message.success("保存成功!");
  497. console.log(this.curQue);
  498. },
  499. //删除角色
  500. delRole(index) {
  501. this.curQue.roleList.splice(index, 1);
  502. },
  503. //点击角色
  504. editRole(item) {
  505. this.roleVisible = true;
  506. this.roleStatus = 2;
  507. this.curRole = item;
  508. },
  509. changeIsPara() {
  510. this.isPara = true;
  511. },
  512. //生成分句
  513. sureSeg() {
  514. let detail = JSON.parse(JSON.stringify(this.curQue.detail));
  515. let leg = detail.length;
  516. let flag = false;
  517. for (let i = 0; i < leg; i++) {
  518. if (!detail[i].para) {
  519. flag = true;
  520. break;
  521. }
  522. }
  523. if (!flag) {
  524. let textList = [];
  525. detail.forEach((item) => {
  526. let str = Base64.encode(item.para);
  527. textList.push(str);
  528. });
  529. this.loading = true;
  530. let data = {
  531. textList: textList,
  532. };
  533. segSentences(data).then((res) => {
  534. this.loading = false;
  535. let result = res.data.result;
  536. result.forEach((item, index) => {
  537. this.$set(this.curQue.detail[index], "sentences", item);
  538. for (let i = 0; i < item.length; i++) {
  539. this.curQue.detail[index].sentencesEn.push("");
  540. }
  541. });
  542. this.isClause = true;
  543. });
  544. } else {
  545. this.$message.warning("段落不能为空");
  546. }
  547. },
  548. changeIsClause(isClause) {
  549. this.isClause = isClause;
  550. },
  551. //生成分词
  552. segByWord(sentences, paraIndex) {
  553. console.log(sentences);
  554. this.loading = true;
  555. let textList = [];
  556. sentences.forEach((item) => {
  557. let str = Base64.encode(item);
  558. textList.push(str);
  559. });
  560. let data = {
  561. textList: textList,
  562. };
  563. BatchSegContent(data).then((res) => {
  564. this.loading = false;
  565. let list = res.data.result.list;
  566. this.$set(this.curQue.detail[paraIndex], "segList", list);
  567. console.log(this.curQue);
  568. this.segList = list;
  569. this.isByWord = true;
  570. this.paraIndex = paraIndex;
  571. });
  572. },
  573. // 上传音频文件
  574. handleChange(file, fileList) {
  575. let _this = this;
  576. _this.getBase64(file.raw).then((res) => {
  577. let base_res = res.split("base64,");
  578. let data = {
  579. fileName: file.raw.name,
  580. speechBase64: base_res[1],
  581. language: "ch",
  582. };
  583. prepareTranscribe(data).then((res) => {
  584. _this.$set(_this.curQue, "taskId", res.data.taskId);
  585. });
  586. });
  587. },
  588. getBase64(file) {
  589. return new Promise(function (resolve, reject) {
  590. let reader = new FileReader();
  591. let imgResult = "";
  592. reader.readAsDataURL(file);
  593. reader.onload = function () {
  594. imgResult = reader.result;
  595. };
  596. reader.onerror = function (error) {
  597. reject(error);
  598. };
  599. reader.onloadend = function () {
  600. resolve(imgResult);
  601. };
  602. });
  603. },
  604. createWordTime() {
  605. this.getfillLiu().then(() => {
  606. if (this.curQue.taskId) {
  607. let verseList = [];
  608. this.curQue.detail.forEach((item) => {
  609. verseList = verseList.concat(item.sentences);
  610. });
  611. console.log(verseList);
  612. if (verseList.length > 0) {
  613. this.isWordTime = true;
  614. let data = {
  615. taskId: this.curQue.taskId,
  616. verseList: JSON.stringify(verseList),
  617. matchType: "chinese",
  618. language: "ch",
  619. };
  620. getWordTime(data).then((res) => {
  621. this.curQue.wordTime = res.data.result;
  622. this.isWordTime = false;
  623. });
  624. }
  625. } else {
  626. this.$message.warning("请先上传音频");
  627. }
  628. });
  629. },
  630. againWordTime() {
  631. this.isWordTime = false;
  632. this.$set(this.curQue, "wordTime", []);
  633. },
  634. uploadLRC() {
  635. this.cTVisible = true;
  636. },
  637. //保存字幕节点
  638. saveTimeList() {
  639. this.cTVisible = false;
  640. let detail = JSON.parse(JSON.stringify(this.$refs.createtimelist.detail));
  641. let detailRes = detail.map((item) => {
  642. let timeList = item.time_str.split("\n");
  643. item.timeList = this.handleTimeReg(timeList);
  644. return item;
  645. });
  646. this.curQue.detail = JSON.parse(JSON.stringify(detailRes));
  647. console.log(this.curQue.detail);
  648. },
  649. handleTimeReg(list) {
  650. list = list.map((item) => {
  651. let regArr = item.split("]");
  652. let reg = regArr[0];
  653. item = reg.replace("[", "");
  654. return item;
  655. });
  656. return list;
  657. },
  658. //点击字幕节点
  659. editTimeList() {
  660. this.cTVisible = true;
  661. },
  662. initCurQueData() {
  663. let res_data = JSON.parse(JSON.stringify(this.data_structure));
  664. this.changeCurQue(res_data);
  665. },
  666. },
  667. //生命周期 - 创建完成(可以访问当前this实例)
  668. created() {},
  669. //生命周期 - 挂载完成(可以访问DOM元素)
  670. mounted() {
  671. console.log("文章保存");
  672. console.log(this.curQue);
  673. if (this.curQue) {
  674. if (!this.curQue.taskId) {
  675. this.curQue.taskId = "";
  676. }
  677. if (!this.curQue.notice) {
  678. this.curQue.notice = "";
  679. }
  680. if (!this.curQue.checkList) {
  681. this.$set(this.curQue, "checkList", [1, 2, 3]);
  682. }
  683. if (this.curQue.detail && this.curQue.detail.length > 0) {
  684. if (this.curQue.detail[0].para) {
  685. this.isPara = true;
  686. }
  687. if (this.curQue.detail[0].sentences.length > 0) {
  688. this.isClause = true;
  689. }
  690. if (this.curQue.detail[0].seg_words.length > 0) {
  691. this.isByWord = true;
  692. }
  693. }
  694. if (!this.curQue.sentencesEn) {
  695. this.curQue.sentencesEn = [];
  696. }
  697. if (!this.curQue.img_list) {
  698. this.curQue.img_list = [];
  699. }
  700. if (!this.curQue.mp3_list) {
  701. this.curQue.mp3_list = [];
  702. }
  703. this.fileCon.img_list = JSON.parse(JSON.stringify(this.curQue.img_list));
  704. let mp3_list = JSON.parse(JSON.stringify(this.curQue.mp3_list));
  705. this.fileCon.mp3_list = mp3_list.filter((item) => item.source !== "tts");
  706. } else {
  707. this.initCurQueData();
  708. }
  709. },
  710. beforeCreate() {}, //生命周期 - 创建之前
  711. beforeMount() {}, //生命周期 - 挂载之前
  712. beforeUpdate() {}, //生命周期 - 更新之前
  713. updated() {}, //生命周期 - 更新之后
  714. beforeDestroy() {}, //生命周期 - 销毁之前
  715. destroyed() {}, //生命周期 - 销毁完成
  716. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  717. };
  718. </script>
  719. <style lang='scss' scoped>
  720. //@import url(); 引入公共css类
  721. .create_mp3_list {
  722. display: flex;
  723. justify-content: flex-start;
  724. align-items: center;
  725. > span {
  726. font-size: 16px;
  727. font-weight: bold;
  728. margin-right: 10px;
  729. }
  730. > img {
  731. width: 24px;
  732. height: 24px;
  733. cursor: pointer;
  734. }
  735. }
  736. p {
  737. margin: 0;
  738. padding: 0;
  739. }
  740. .adult-book-input-role {
  741. clear: both;
  742. overflow: hidden;
  743. > li {
  744. float: left;
  745. display: flex;
  746. justify-content: flex-start;
  747. align-items: center;
  748. padding: 4px 8px;
  749. border: 1px #a7a7a7 solid;
  750. border-radius: 8px;
  751. margin: 0 10px 10px 0px;
  752. .rItem {
  753. display: flex;
  754. justify-content: flex-start;
  755. align-items: center;
  756. .adult-book-input {
  757. &-roleText {
  758. width: 40px;
  759. height: 40px;
  760. background: #a7a7a7;
  761. border-radius: 100%;
  762. text-align: center;
  763. line-height: 40px;
  764. }
  765. &-roleImg {
  766. width: 40px;
  767. height: 40px;
  768. }
  769. }
  770. .pinyin {
  771. font-family: "GB-PINYINOK-B";
  772. font-size: 14px;
  773. line-height: 22px;
  774. color: rgba(0, 0, 0, 0.85);
  775. margin-right: 8px;
  776. margin-left: 8px;
  777. }
  778. .chs {
  779. font-family: "FZJCGFKTK";
  780. font-size: 16px;
  781. line-height: 24px;
  782. color: #000000;
  783. margin-right: 16px;
  784. }
  785. }
  786. > i {
  787. cursor: pointer;
  788. }
  789. }
  790. }
  791. .uploadArt_list {
  792. border: 1px #ccc solid;
  793. border-bottom: 0;
  794. margin-top: 10px;
  795. > li {
  796. display: flex;
  797. justify-content: flex-start;
  798. align-items: center;
  799. border-bottom: 1px #ccc solid;
  800. > span {
  801. width: 320px;
  802. word-wrap: break-word;
  803. font-size: 14px;
  804. color: rgb(112, 110, 110);
  805. border-right: 1px #ccc solid;
  806. padding: 5px 10px;
  807. }
  808. > p {
  809. flex: 1;
  810. padding: 5px 10px;
  811. }
  812. .imgNumber {
  813. width: 80px;
  814. }
  815. .del-close {
  816. width: 24px;
  817. height: 24px;
  818. cursor: pointer;
  819. margin-right: 10px;
  820. }
  821. }
  822. }
  823. .NPC-Book-Article {
  824. > div {
  825. margin-bottom: 20px;
  826. }
  827. }
  828. .NPC-Book-model {
  829. display: flex;
  830. justify-content: flex-start;
  831. align-items: center;
  832. > span {
  833. margin: 0;
  834. }
  835. }
  836. .lrc-box {
  837. display: flex;
  838. justify-content: flex-start;
  839. align-items: center;
  840. > span {
  841. font-size: 14px;
  842. margin-right: 16px;
  843. }
  844. }
  845. </style>