index.vue 24 KB

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