index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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. createPinyin,
  252. prepareTranscribe,
  253. getWordTime,
  254. compareSenTenceTime,
  255. getContentFile,
  256. textCreadMp3,
  257. } from "@/api/ajax";
  258. const Base64 = require("js-base64").Base64;
  259. import Upload from "../../common/Upload.vue";
  260. import UploadArt from "../../common/UploadArt.vue";
  261. import ArticleChs from "./components/ArticleChs.vue";
  262. import Paragraph from "./components/ParagraphChs.vue";
  263. import Clauseresult from "./components/ClauseresultChs.vue";
  264. import Segbyword from "./components/SegbywordChs.vue";
  265. import Createtimelist from "./components/CreatetimelistChs.vue";
  266. import RoleChs from "./components/RoleChs.vue";
  267. import CompareTime from "../ArticleTemChs/components/CompareTime.vue";
  268. export default {
  269. name: "DialogueAnswerChs",
  270. components: {
  271. Upload,
  272. UploadArt,
  273. ArticleChs,
  274. Paragraph,
  275. Clauseresult,
  276. Segbyword,
  277. Createtimelist,
  278. RoleChs,
  279. CompareTime,
  280. },
  281. props: ["curQue", "changeCurQue", "tmIndex"],
  282. filters: {
  283. handlePinyin(wordsList) {
  284. let str = "";
  285. wordsList.forEach((item, index) => {
  286. if (index < wordsList.length - 1) {
  287. str += item.pinyin + " ";
  288. } else {
  289. str += item.pinyin;
  290. }
  291. });
  292. return str;
  293. },
  294. handleChs(wordsList) {
  295. let str = "";
  296. wordsList.forEach((item, index) => {
  297. if (index < wordsList.length - 1) {
  298. str += item.chs + " ";
  299. } else {
  300. str += item.chs;
  301. }
  302. });
  303. return str;
  304. },
  305. },
  306. data() {
  307. return {
  308. imageNumber: 1000,
  309. mp3Number: 1,
  310. fileCon: {
  311. img_list: [],
  312. mp3_list: [],
  313. },
  314. isPara: false,
  315. isClause: false,
  316. isByWord: false,
  317. paraIndex: 0, //段落索引
  318. cTVisible: false,
  319. roleVisible: false,
  320. roleStatus: 1, //1添加;2是编辑
  321. curRole: null,
  322. loading: false,
  323. segList: null,
  324. data_structure: {
  325. type: "dialogue_article_chs",
  326. name: "课文",
  327. model: 1,
  328. pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
  329. notice: "", //文章提示信息
  330. mp3_list: [],
  331. img_list: [],
  332. article: "",
  333. roleList: [],
  334. detail: [],
  335. wordTime: [],
  336. taskId: "",
  337. checkList: [1, 2, 3],
  338. },
  339. isWordTime: false,
  340. compareType: "", //校对类型
  341. compareShow: false,
  342. compareData: null,
  343. compareloading: false,
  344. CreadMp3loading: false,
  345. };
  346. },
  347. computed: {},
  348. watch: {},
  349. //方法集合
  350. methods: {
  351. // 得到文件流
  352. getfillLiu() {
  353. this.loading = true;
  354. let _this = this;
  355. return new Promise(function (resolve, reject) {
  356. if (
  357. _this.curQue.mp3_list &&
  358. _this.curQue.mp3_list.length > 0 &&
  359. _this.curQue.mp3_list[0].id
  360. ) {
  361. let Mname = "file_store_manager-GetFileByteBase64Text";
  362. let id = _this.curQue.mp3_list[0].id
  363. .replace("[FID##", "")
  364. .replace("##FID]", "");
  365. let data = {
  366. file_id: id,
  367. };
  368. getContentFile(Mname, data).then((res) => {
  369. let taskIddata = {
  370. fileName: _this.curQue.mp3_list[0].name,
  371. speechBase64: res.base64_text,
  372. language: "ch",
  373. };
  374. prepareTranscribe(taskIddata).then((res) => {
  375. _this.$set(_this.curQue, "taskId", res.data.taskId);
  376. _this.loading = false;
  377. resolve();
  378. });
  379. });
  380. } else {
  381. _this.$message.warning("请先上传音频");
  382. }
  383. });
  384. },
  385. // 根据文章生成MP3
  386. CreadMp3() {
  387. let _this = this;
  388. if (_this.curQue.mp3_list.length > 0) {
  389. _this.$message.warning("已有音频,请勿重复生成");
  390. return;
  391. }
  392. if (!_this.curQue.article) {
  393. _this.$message.warning("请先输入内容,在生成音频");
  394. return;
  395. }
  396. _this.CreadMp3loading = true;
  397. textCreadMp3({
  398. text: _this.curQue.article,
  399. }).then((res) => {
  400. res.data.fileInfo.id = "[FID##" + res.data.fileInfo.file_id + "##FID]";
  401. res.data.fileInfo.name = res.data.fileInfo.file_name;
  402. let fileList = [res.data.fileInfo];
  403. _this.$set(_this.curQue, "mp3_list", fileList);
  404. _this.CreadMp3loading = false;
  405. _this.$message.success("生成成功");
  406. });
  407. },
  408. //删除生成的mp3
  409. delMp3() {
  410. this.curQue.mp3_list.splice(0, 1);
  411. },
  412. // 保存校对
  413. saveCompare() {
  414. this.compareloading = true;
  415. console.log(this.compareData);
  416. compareSenTenceTime({ matchList: JSON.stringify(this.compareData) }).then(
  417. (res) => {
  418. console.log(res);
  419. this.compareloading = false;
  420. this.curQue.wordTime = res.data.result;
  421. console.log(this.curQue.wordTime);
  422. }
  423. );
  424. },
  425. // 校对时间
  426. compareTime(type) {
  427. this.compareType = type;
  428. this.compareData = JSON.parse(JSON.stringify(this.curQue.wordTime));
  429. this.compareShow = true;
  430. },
  431. handleClose() {
  432. this.compareShow = false;
  433. this.compareData = null;
  434. this.compareType = "";
  435. },
  436. // 校对每个字的时间
  437. changewordsResultList(index, item) {
  438. this.curQue.wordTime[index].wordsResultList = JSON.parse(
  439. JSON.stringify(item)
  440. );
  441. },
  442. onBlur(item, field) {
  443. item[field] = item[field] ? item[field].trim() : "";
  444. },
  445. changeMp3(fileList) {
  446. const articleImgList = JSON.parse(JSON.stringify(fileList));
  447. const articleImgRes = [];
  448. articleImgList.forEach((item) => {
  449. if (item.response) {
  450. const obj = {
  451. name: item.name,
  452. duration: item.response.file_info_list[0].media_duration,
  453. url: item.response.file_info_list[0].file_url,
  454. id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
  455. media_duration: item.response.file_info_list[0].media_duration, //音频时长
  456. };
  457. articleImgRes.push(obj);
  458. }
  459. });
  460. this.curQue.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
  461. },
  462. changeImage(file) {
  463. console.log(file);
  464. if (file.response) {
  465. const obj = {
  466. name: file.name,
  467. url: file.response.file_info_list[0].file_url,
  468. id: "[FID##" + file.response.file_info_list[0].file_id + "##FID]",
  469. imgNumber: 0,
  470. };
  471. this.curQue.img_list.push(obj);
  472. this.$forceUpdate();
  473. }
  474. },
  475. forceUpdate() {
  476. this.$forceUpdate();
  477. },
  478. delImage(index) {
  479. this.curQue.img_list.splice(index, 1);
  480. this.fileCon.img_list.splice(index, 1);
  481. },
  482. //添加角色
  483. addRole() {
  484. this.roleVisible = true;
  485. this.roleStatus = 1;
  486. let id = Math.random().toString(36).substr(2);
  487. let roleCon = {
  488. id: id,
  489. role: "",
  490. img_list: [],
  491. detail: {
  492. fullName: "",
  493. seg_words: "",
  494. wordsList: [],
  495. },
  496. };
  497. this.curQue.roleList.push(JSON.parse(JSON.stringify(roleCon)));
  498. },
  499. //保存角色
  500. saveRoleList() {
  501. this.roleVisible = false;
  502. this.$message.success("保存成功!");
  503. console.log(this.curQue);
  504. },
  505. //删除角色
  506. delRole(index) {
  507. this.curQue.roleList.splice(index, 1);
  508. },
  509. //点击角色
  510. editRole(item) {
  511. this.roleVisible = true;
  512. this.roleStatus = 2;
  513. this.curRole = item;
  514. },
  515. changeIsPara() {
  516. this.isPara = true;
  517. },
  518. //生成分句
  519. sureSeg() {
  520. let detail = JSON.parse(JSON.stringify(this.curQue.detail));
  521. let leg = detail.length;
  522. let flag = false;
  523. for (let i = 0; i < leg; i++) {
  524. if (!detail[i].para) {
  525. flag = true;
  526. break;
  527. }
  528. }
  529. if (!flag) {
  530. let textList = [];
  531. detail.forEach((item) => {
  532. let str = Base64.encode(item.para);
  533. textList.push(str);
  534. });
  535. this.loading = true;
  536. let data = {
  537. textList: textList,
  538. };
  539. segSentences(data).then((res) => {
  540. this.loading = false;
  541. let result = res.data.result;
  542. result.forEach((item, index) => {
  543. this.$set(this.curQue.detail[index], "sentences", item);
  544. for (let i = 0; i < item.length; i++) {
  545. this.curQue.detail[index].sentencesEn.push("");
  546. }
  547. });
  548. this.isClause = true;
  549. });
  550. } else {
  551. this.$message.warning("段落不能为空");
  552. }
  553. },
  554. changeIsClause(isClause) {
  555. this.isClause = isClause;
  556. },
  557. //生成分词
  558. segByWord(sentences, paraIndex) {
  559. console.log(sentences);
  560. this.loading = true;
  561. let textList = [];
  562. sentences.forEach((item) => {
  563. let str = Base64.encode(item);
  564. textList.push(str);
  565. });
  566. let data = {
  567. textList: textList,
  568. };
  569. BatchSegContent(data).then((res) => {
  570. this.loading = false;
  571. let list = res.data.result.list;
  572. this.$set(this.curQue.detail[paraIndex], "segList", list);
  573. console.log(this.curQue);
  574. this.segList = list;
  575. this.isByWord = true;
  576. this.paraIndex = paraIndex;
  577. });
  578. },
  579. // 上传音频文件
  580. handleChange(file, fileList) {
  581. let _this = this;
  582. _this.getBase64(file.raw).then((res) => {
  583. let base_res = res.split("base64,");
  584. let data = {
  585. fileName: file.raw.name,
  586. speechBase64: base_res[1],
  587. language: "ch",
  588. };
  589. prepareTranscribe(data).then((res) => {
  590. _this.$set(_this.curQue, "taskId", res.data.taskId);
  591. });
  592. });
  593. },
  594. getBase64(file) {
  595. return new Promise(function (resolve, reject) {
  596. let reader = new FileReader();
  597. let imgResult = "";
  598. reader.readAsDataURL(file);
  599. reader.onload = function () {
  600. imgResult = reader.result;
  601. };
  602. reader.onerror = function (error) {
  603. reject(error);
  604. };
  605. reader.onloadend = function () {
  606. resolve(imgResult);
  607. };
  608. });
  609. },
  610. createWordTime() {
  611. this.getfillLiu().then(() => {
  612. if (this.curQue.taskId) {
  613. let verseList = [];
  614. this.curQue.detail.forEach((item) => {
  615. verseList = verseList.concat(item.sentences);
  616. });
  617. console.log(verseList);
  618. if (verseList.length > 0) {
  619. this.isWordTime = true;
  620. let data = {
  621. taskId: this.curQue.taskId,
  622. verseList: JSON.stringify(verseList),
  623. matchType: "chinese",
  624. language: "ch",
  625. };
  626. getWordTime(data).then((res) => {
  627. this.curQue.wordTime = res.data.result;
  628. this.isWordTime = false;
  629. });
  630. }
  631. } else {
  632. this.$message.warning("请先上传音频");
  633. }
  634. });
  635. },
  636. againWordTime() {
  637. this.isWordTime = false;
  638. this.$set(this.curQue, "wordTime", []);
  639. },
  640. uploadLRC() {
  641. this.cTVisible = true;
  642. },
  643. //保存字幕节点
  644. saveTimeList() {
  645. this.cTVisible = false;
  646. let detail = JSON.parse(JSON.stringify(this.$refs.createtimelist.detail));
  647. let detailRes = detail.map((item) => {
  648. let timeList = item.time_str.split("\n");
  649. item.timeList = this.handleTimeReg(timeList);
  650. return item;
  651. });
  652. this.curQue.detail = JSON.parse(JSON.stringify(detailRes));
  653. console.log(this.curQue.detail);
  654. },
  655. handleTimeReg(list) {
  656. list = list.map((item) => {
  657. let regArr = item.split("]");
  658. let reg = regArr[0];
  659. item = reg.replace("[", "");
  660. return item;
  661. });
  662. return list;
  663. },
  664. //点击字幕节点
  665. editTimeList() {
  666. this.cTVisible = true;
  667. },
  668. initCurQueData() {
  669. let res_data = JSON.parse(JSON.stringify(this.data_structure));
  670. this.changeCurQue(res_data);
  671. },
  672. },
  673. //生命周期 - 创建完成(可以访问当前this实例)
  674. created() {},
  675. //生命周期 - 挂载完成(可以访问DOM元素)
  676. mounted() {
  677. console.log("文章保存");
  678. console.log(this.curQue);
  679. if (this.curQue) {
  680. if (!this.curQue.taskId) {
  681. this.curQue.taskId = "";
  682. }
  683. if (!this.curQue.notice) {
  684. this.curQue.notice = "";
  685. }
  686. if (!this.curQue.checkList) {
  687. this.$set(this.curQue, "checkList", [1, 2, 3]);
  688. }
  689. if (this.curQue.detail && this.curQue.detail.length > 0) {
  690. if (this.curQue.detail[0].para) {
  691. this.isPara = true;
  692. }
  693. if (this.curQue.detail[0].sentences.length > 0) {
  694. this.isClause = true;
  695. }
  696. if (this.curQue.detail[0].seg_words.length > 0) {
  697. this.isByWord = true;
  698. }
  699. }
  700. if (!this.curQue.sentencesEn) {
  701. this.curQue.sentencesEn = [];
  702. }
  703. if (!this.curQue.img_list) {
  704. this.curQue.img_list = [];
  705. }
  706. if (!this.curQue.mp3_list) {
  707. this.curQue.mp3_list = [];
  708. }
  709. this.fileCon.img_list = JSON.parse(JSON.stringify(this.curQue.img_list));
  710. let mp3_list = JSON.parse(JSON.stringify(this.curQue.mp3_list));
  711. this.fileCon.mp3_list = mp3_list.filter((item) => item.source !== "tts");
  712. } else {
  713. this.initCurQueData();
  714. }
  715. },
  716. beforeCreate() {}, //生命周期 - 创建之前
  717. beforeMount() {}, //生命周期 - 挂载之前
  718. beforeUpdate() {}, //生命周期 - 更新之前
  719. updated() {}, //生命周期 - 更新之后
  720. beforeDestroy() {}, //生命周期 - 销毁之前
  721. destroyed() {}, //生命周期 - 销毁完成
  722. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  723. };
  724. </script>
  725. <style lang='scss' scoped>
  726. //@import url(); 引入公共css类
  727. .create_mp3_list {
  728. display: flex;
  729. justify-content: flex-start;
  730. align-items: center;
  731. > span {
  732. font-size: 16px;
  733. font-weight: bold;
  734. margin-right: 10px;
  735. }
  736. > img {
  737. width: 24px;
  738. height: 24px;
  739. cursor: pointer;
  740. }
  741. }
  742. p {
  743. margin: 0;
  744. padding: 0;
  745. }
  746. .adult-book-input-role {
  747. clear: both;
  748. overflow: hidden;
  749. > li {
  750. float: left;
  751. display: flex;
  752. justify-content: flex-start;
  753. align-items: center;
  754. padding: 4px 8px;
  755. border: 1px #a7a7a7 solid;
  756. border-radius: 8px;
  757. margin: 0 10px 10px 0px;
  758. .rItem {
  759. display: flex;
  760. justify-content: flex-start;
  761. align-items: center;
  762. .adult-book-input {
  763. &-roleText {
  764. width: 40px;
  765. height: 40px;
  766. background: #a7a7a7;
  767. border-radius: 100%;
  768. text-align: center;
  769. line-height: 40px;
  770. }
  771. &-roleImg {
  772. width: 40px;
  773. height: 40px;
  774. }
  775. }
  776. .pinyin {
  777. font-family: "GB-PINYINOK-B";
  778. font-size: 14px;
  779. line-height: 22px;
  780. color: rgba(0, 0, 0, 0.85);
  781. margin-right: 8px;
  782. margin-left: 8px;
  783. }
  784. .chs {
  785. font-family: "FZJCGFKTK";
  786. font-size: 16px;
  787. line-height: 24px;
  788. color: #000000;
  789. margin-right: 16px;
  790. }
  791. }
  792. > i {
  793. cursor: pointer;
  794. }
  795. }
  796. }
  797. .uploadArt_list {
  798. border: 1px #ccc solid;
  799. border-bottom: 0;
  800. margin-top: 10px;
  801. > li {
  802. display: flex;
  803. justify-content: flex-start;
  804. align-items: center;
  805. border-bottom: 1px #ccc solid;
  806. > span {
  807. width: 320px;
  808. word-wrap: break-word;
  809. font-size: 14px;
  810. color: rgb(112, 110, 110);
  811. border-right: 1px #ccc solid;
  812. padding: 5px 10px;
  813. }
  814. > p {
  815. flex: 1;
  816. padding: 5px 10px;
  817. }
  818. .imgNumber {
  819. width: 80px;
  820. }
  821. .del-close {
  822. width: 24px;
  823. height: 24px;
  824. cursor: pointer;
  825. margin-right: 10px;
  826. }
  827. }
  828. }
  829. .NPC-Book-Article {
  830. > div {
  831. margin-bottom: 20px;
  832. }
  833. }
  834. .NPC-Book-model {
  835. display: flex;
  836. justify-content: flex-start;
  837. align-items: center;
  838. > span {
  839. margin: 0;
  840. }
  841. }
  842. .lrc-box {
  843. display: flex;
  844. justify-content: flex-start;
  845. align-items: center;
  846. > span {
  847. font-size: 14px;
  848. margin-right: 16px;
  849. }
  850. }
  851. </style>