index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  1. <template>
  2. <div
  3. v-if="judgeAnswer == 'standardAnswer' ? (userError ? true : false) : true"
  4. class="header-separate"
  5. >
  6. <table
  7. :style="{
  8. width:
  9. curQue.tableData.colsConfig.width.length > 5
  10. ? width_total + 'px'
  11. : '',
  12. fontSize: baseSizePhone + 2 + 'px',
  13. }"
  14. >
  15. <colgroup>
  16. <col
  17. v-for="(item, i) in curQue.tableData.colsConfig.width"
  18. :key="`col-${i}`"
  19. :style="{
  20. width: `${item.val}px`,
  21. }"
  22. />
  23. </colgroup>
  24. <thead>
  25. <tr>
  26. <th
  27. v-for="({ text, english, type }, i) in curQue.tableData.headers"
  28. :key="`th-${i}`"
  29. >
  30. <div class="thead-content" :style="theadStyle">
  31. <span class="chs">{{ text }}</span>
  32. <span :class="[type === 'english' ? 'english' : 'pinyin']">
  33. {{ english }}
  34. </span>
  35. </div>
  36. </th>
  37. </tr>
  38. </thead>
  39. <tbody
  40. :style="{
  41. 'text-align': `${curQue.textAlign}`,
  42. }"
  43. >
  44. <tr v-for="(row, i) in curQue.tableData.body" :key="`tr-${i}`">
  45. <template v-for="(col, j) in row.content">
  46. <td
  47. v-if="tdIsShow(i, j)"
  48. :key="`td-${j}`"
  49. :colspan="col.colspan"
  50. :rowspan="col.rowspan"
  51. :class="[
  52. { underline: col.isUnderline },
  53. `${curQue.firstColAligin === 'center' ? 'col-center' : ''}`,
  54. judgeAnswer == 'standardAnswer' ? 'correct' : '',
  55. judgeAnswer == 'studentAnswer' || judgeAnswer == 'userAnswer'
  56. ? curQue.Bookanswer[i].content[j].userAnswerJudge
  57. ? curQue.Bookanswer[i].content[j].userAnswerJudge ==
  58. '[JUDGE##T##JUDGE]'
  59. ? 'correct'
  60. : 'error'
  61. : ''
  62. : '',
  63. ]"
  64. :style="{
  65. 'background-color':
  66. `${col.background}` === '#fff' ||
  67. `${col.background}` === '#ffffff'
  68. ? 'transparent'
  69. : `${col.background}`,
  70. display: tdHeaderIsNone(i, j),
  71. }"
  72. >
  73. <div
  74. class="cell-wrap"
  75. :class="[
  76. col.isCross ? 'cell-wrap-between' : '',
  77. 'cell-wrap-' + curQue.textAlign,
  78. ]"
  79. >
  80. <template v-if="col.type === 'content'">
  81. <span v-if="col.text.length > 0" class="content">
  82. {{ col.text }}
  83. </span>
  84. <template v-else>
  85. <el-input
  86. v-model="
  87. judgeAnswer == 'standardAnswer'
  88. ? col.answer
  89. : curQue.Bookanswer[i].content[j].answer
  90. "
  91. type="textarea"
  92. :class="[`text-${curQue.textAlign}`]"
  93. :placeholder="`${isAnswerMode ? '' : ''}`"
  94. :disabled="isAnswerMode"
  95. :autosize="{ minRows: 1, maxRows: 6 }"
  96. :style="{ fontSize: baseSizePhone + 2 + 'px' }"
  97. @blur="
  98. judgeAnswer == 'standardAnswer'
  99. ? (col.answer = col.answer.trim())
  100. : (curQue.Bookanswer[i].content[j].answer =
  101. curQue.Bookanswer[i].content[j].answer.trim())
  102. "
  103. @input="enterAnswer(i, j, 'input')"
  104. />
  105. </template>
  106. </template>
  107. <div
  108. v-else-if="col.type === 'pinyin'"
  109. class="sentence"
  110. :style="pinyinStyle"
  111. >
  112. <div>
  113. <span
  114. v-for="({ pinyin, chs }, k) in col.sentence_data
  115. .wordsList"
  116. :key="`${
  117. curQue.pinyinPosition === 'top' ||
  118. curQue.pinyinPosition === 'left'
  119. ? 'pinyin'
  120. : 'chs'
  121. }-${k}`"
  122. :class="[
  123. `${
  124. curQue.pinyinPosition === 'top' ||
  125. curQue.pinyinPosition === 'left'
  126. ? 'pinyin'
  127. : 'chs'
  128. }`,
  129. ]"
  130. >
  131. {{
  132. curQue.pinyinPosition === "top" ||
  133. curQue.pinyinPosition == "left"
  134. ? pinyin
  135. : chs
  136. }}
  137. </span>
  138. </div>
  139. <div>
  140. <span
  141. v-for="({ pinyin, chs }, k) in col.sentence_data
  142. .wordsList"
  143. :key="`${
  144. curQue.pinyinPosition === 'top' ||
  145. curQue.pinyinPosition === 'left'
  146. ? 'chs'
  147. : 'pinyin'
  148. }-${k}`"
  149. :class="[
  150. `${
  151. curQue.pinyinPosition === 'top' ||
  152. curQue.pinyinPosition === 'left'
  153. ? 'chs'
  154. : 'pinyin'
  155. }`,
  156. ]"
  157. >
  158. {{
  159. curQue.pinyinPosition === "top" ||
  160. curQue.pinyinPosition == "left"
  161. ? chs
  162. : pinyin
  163. }}
  164. </span>
  165. </div>
  166. </div>
  167. <div
  168. v-else-if="col.type === 'prePinyin'"
  169. :style="{
  170. 'flex-direction':
  171. col.prefixOrSuffix === 'prefix' ? 'row' : 'row-reverse',
  172. }"
  173. class="pre-pinyin"
  174. >
  175. <span>{{ col.message }}</span>
  176. <div
  177. class="right-pinyin"
  178. :style="{
  179. 'grid-template-columns': `repeat(${col.sentence_data.wordsList.length}, auto)`,
  180. }"
  181. >
  182. <span
  183. v-for="({ pinyin }, k) in col.sentence_data.wordsList"
  184. :key="`pre-pinyin-${k}`"
  185. class="pinyin"
  186. >
  187. {{ pinyin }}
  188. </span>
  189. <span
  190. v-for="({ chs }, k) in col.sentence_data.wordsList"
  191. :key="`pre-chs-${k}`"
  192. class="chs"
  193. >
  194. {{ chs }}
  195. </span>
  196. </div>
  197. </div>
  198. <div v-else-if="col.type === 'mulText'" class="stem-content">
  199. <div
  200. v-for="(sdItem, sdIndex) in col.mulText.detail"
  201. :key="'sent-option-items' + j + sdIndex"
  202. :class="['sent-main']"
  203. >
  204. <div class="sent-que-box">
  205. <div
  206. v-for="(sddItem, sddIndex) in sdItem.detail"
  207. :key="'sent-option-items' + j + sdIndex + sddIndex"
  208. class="sent-que"
  209. :style="{
  210. paddingLeft:
  211. sddItem.config.wordPadding.indexOf('left') > -1
  212. ? '4px'
  213. : '0px',
  214. paddingRight:
  215. sddItem.config.wordPadding.indexOf('right') > -1
  216. ? '4px'
  217. : '0px',
  218. }"
  219. >
  220. <!-- 补全句子 -->
  221. <OneSentenceTemp
  222. :detail="sddItem"
  223. :py-position="curQue.pinyinPosition"
  224. :task-model="TaskModel"
  225. :bookanswer="curQue.Bookanswer[i].content[j]"
  226. :judge-answer="judgeAnswer"
  227. :correct-answer="col.mulText.correct.complateArr"
  228. :is-input="true"
  229. :fn_check_list="[]"
  230. :py-number="col.pyNumber && col.pyNumber[sdIndex]"
  231. :heng-leg="sdItem.hengLeg"
  232. :max-fontsize="baseSizePhone"
  233. />
  234. <template
  235. v-if="
  236. sddItem.img_list &&
  237. sddItem.img_list.length > 0 &&
  238. sddItem.img_list[0].id
  239. "
  240. >
  241. <img
  242. :src="sddItem.img_list[0].id"
  243. class="sddItem_img_list"
  244. :style="[imgStyle(sddItem)]"
  245. />
  246. </template>
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. <CrossTick
  252. v-if="col.isCross"
  253. :index="i"
  254. :indexs="j"
  255. :data="
  256. judgeAnswer == 'standardAnswer'
  257. ? col
  258. : curQue.Bookanswer[i].content[j]
  259. "
  260. :is-answer-mode="isAnswerMode"
  261. @enterAnswer="enterAnswer"
  262. />
  263. </div>
  264. </td>
  265. </template>
  266. </tr>
  267. </tbody>
  268. </table>
  269. </div>
  270. </template>
  271. <script>
  272. import CrossTick from "./CrossTick.vue";
  273. import AnswerTitle from "../../phonePreview/components/AnswerTitle.vue";
  274. import OneSentenceTemp from "../components/OneSentenceTemp.vue";
  275. export default {
  276. components: { CrossTick, AnswerTitle, OneSentenceTemp },
  277. props: {
  278. curQue: {
  279. type: Object,
  280. required: true,
  281. },
  282. themeColor: {
  283. type: String,
  284. required: true,
  285. },
  286. judgeAnswer: {
  287. type: String,
  288. },
  289. TaskModel: {
  290. type: String,
  291. },
  292. baseSizePhone: {
  293. type: Number,
  294. },
  295. },
  296. data() {
  297. return {
  298. isAnswerMode: false,
  299. userError: false,
  300. userAnswer: {
  301. completeInput: [],
  302. },
  303. userBookanswer: [],
  304. chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
  305. width_total: 0, // 总宽度
  306. };
  307. },
  308. computed: {
  309. theadStyle() {
  310. const hp = this.curQue.headerEnglishPosition;
  311. if (hp === "top") {
  312. return {
  313. "flex-direction": "column-reverse",
  314. };
  315. }
  316. if (hp === "right") {
  317. return {
  318. "flex-direction": "row",
  319. "column-gap": "8px",
  320. };
  321. }
  322. if (hp === "bottom") {
  323. return {
  324. "flex-direction": "column",
  325. };
  326. }
  327. if (hp === "left") {
  328. return {
  329. "flex-direction": "row-reverse",
  330. "column-gap": "8px",
  331. };
  332. }
  333. },
  334. pinyinStyle() {
  335. let pyPos = this.curQue.pinyinPosition;
  336. if (pyPos === "left") {
  337. return {
  338. "column-gap": "16px",
  339. };
  340. }
  341. if (pyPos === "top") {
  342. return {
  343. "flex-direction": "column",
  344. };
  345. }
  346. if (pyPos === "right") {
  347. return {
  348. "column-gap": "16px",
  349. };
  350. }
  351. if (pyPos === "bottom") {
  352. return {
  353. "flex-direction": "column",
  354. };
  355. }
  356. },
  357. },
  358. created() {
  359. if (this.judgeAnswer) {
  360. this.isAnswerMode = true;
  361. }
  362. if (!this.curQue.Bookanswer) {
  363. let arr = [];
  364. let flag = false; // 是否含有多个句子类型
  365. this.width_total = 0;
  366. this.curQue.tableData.body.forEach((item, i) => {
  367. arr.push({
  368. content: [],
  369. });
  370. item.content.forEach((items) => {
  371. if (items.type === "mulText") {
  372. flag = true;
  373. }
  374. arr[i].content.push({
  375. answer: "",
  376. CrossAnswer: "",
  377. userAnswerJudge:
  378. items.answer ||
  379. (items.isCross &&
  380. items.CrossAnswer &&
  381. items.CrossAnswer !== "normal")
  382. ? "[JUDGE##F##JUDGE]"
  383. : "",
  384. });
  385. });
  386. });
  387. if (!flag) {
  388. this.$set(this.curQue, "Bookanswer", arr);
  389. }
  390. this.curQue.tableData.colsConfig.width.forEach((width) => {
  391. this.width_total += width.val;
  392. });
  393. } else {
  394. this.curQue.Bookanswer.forEach((item) => {
  395. item.content.forEach((item) => {
  396. if (item.userAnswerJudge == "[JUDGE##F##JUDGE]") {
  397. this.userError = true;
  398. return;
  399. }
  400. });
  401. });
  402. }
  403. },
  404. mounted() {
  405. this.handleData();
  406. },
  407. methods: {
  408. enterAnswer(i, j, type) {
  409. if (type == "input") {
  410. this.$forceUpdate();
  411. if (
  412. this.curQue.Bookanswer[i].content[j].answer.trim() ==
  413. this.curQue.tableData.body[i].content[j].answer
  414. ) {
  415. if (this.curQue.tableData.body[i].content[j].isCross) {
  416. if (
  417. this.curQue.Bookanswer[i].content[j].CrossAnswer ==
  418. this.curQue.tableData.body[i].content[j].CrossAnswer
  419. ) {
  420. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  421. "[JUDGE##T##JUDGE]";
  422. } else {
  423. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  424. "[JUDGE##F##JUDGE]";
  425. }
  426. } else {
  427. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  428. "[JUDGE##T##JUDGE]";
  429. }
  430. } else if (this.curQue.tableData.body[i].content[j].answer) {
  431. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  432. "[JUDGE##F##JUDGE]";
  433. }
  434. } else if (
  435. this.curQue.Bookanswer[i].content[j].CrossAnswer ==
  436. this.curQue.tableData.body[i].content[j].CrossAnswer
  437. ) {
  438. if (this.curQue.tableData.body[i].content[j].answer) {
  439. if (
  440. this.curQue.Bookanswer[i].content[j].answer ==
  441. this.curQue.tableData.body[i].content[j].answer
  442. ) {
  443. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  444. "[JUDGE##T##JUDGE]";
  445. } else {
  446. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  447. "[JUDGE##F##JUDGE]";
  448. }
  449. } else {
  450. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  451. "[JUDGE##T##JUDGE]";
  452. }
  453. } else {
  454. this.curQue.Bookanswer[i].content[j].userAnswerJudge =
  455. "[JUDGE##F##JUDGE]";
  456. }
  457. },
  458. // 控制首尾表格显隐
  459. tdHeaderIsNone(i, j) {
  460. let body = this.curQue.tableData.body;
  461. if (j !== 0 && j !== body[0].content.length - 1) return "table-cell";
  462. let col = 1;
  463. let colIndex = body[i].content.findIndex(({ colspan }, index) => {
  464. if (index > j) return false;
  465. let num = colspan === undefined ? 1 : Number(colspan);
  466. if (num > 1) {
  467. col = num;
  468. return false;
  469. }
  470. if (index === j && col > 1) return true;
  471. if (col > 0) col -= 1;
  472. return false;
  473. });
  474. let row = 1;
  475. let rowIndex = body.findIndex((item, index) => {
  476. let rowspan = item.content[j].rowspan;
  477. let num = rowspan === undefined ? 1 : Number(rowspan);
  478. if (num > 1) {
  479. row = num;
  480. return false;
  481. }
  482. if (index === i && row > 1) return true;
  483. if (row > 0) row -= 1;
  484. return false;
  485. });
  486. return rowIndex === -1 && colIndex === -1 ? "table-cell" : "none";
  487. },
  488. // rowspan colspan 控制td是否生成
  489. tdIsShow(i, j) {
  490. let body = this.curQue.tableData.body;
  491. if (j === 0) return true;
  492. let col = 1;
  493. let colIndex = body[i].content.findIndex(({ colspan }, index) => {
  494. if (index > j) return false;
  495. let num = colspan === undefined ? 1 : Number(colspan);
  496. if (num > 1) {
  497. col = num;
  498. return false;
  499. }
  500. if (index === j && col > 1) return true;
  501. if (col > 0) col -= 1;
  502. return false;
  503. });
  504. let row = 1;
  505. let rowIndex = body.findIndex((item, index) => {
  506. let rowspan = item.content[j].rowspan;
  507. let num = rowspan === undefined ? 1 : Number(rowspan);
  508. if (num > 1) {
  509. row = num;
  510. return false;
  511. }
  512. if (index === i && row > 1) return true;
  513. if (row > 0) row -= 1;
  514. return false;
  515. });
  516. return (
  517. colIndex === -1 && (rowIndex === -1 || j === body[0].content.length - 1)
  518. );
  519. },
  520. handleData() {
  521. let Bookanswer = [];
  522. let itemLeg = 0;
  523. this.totalHasPy = false;
  524. let option = JSON.parse(JSON.stringify(this.curQue.tableData.body));
  525. let completeImage = [];
  526. option.forEach((item, index) => {
  527. Bookanswer.push({ content: [] });
  528. completeImage = [];
  529. itemLeg = item.length > itemLeg ? item.length : itemLeg;
  530. item.content.forEach((items, indexs) => {
  531. if (items.mulText) {
  532. let userAnswer = JSON.parse(JSON.stringify(this.userAnswer));
  533. let correct = JSON.parse(JSON.stringify(items.mulText.correct));
  534. let complateArr = correct.completeInput.split("\n");
  535. complateArr.forEach((itemI, indexI) => {
  536. if (itemI == "??" || itemI == "??") {
  537. complateArr[indexI] = "";
  538. }
  539. });
  540. items.mulText.correct.complateArr = complateArr;
  541. this.curQue.tableData.body[index].content[
  542. indexs
  543. ].mulText.correct.complateArr = complateArr;
  544. Bookanswer[index].content.push(userAnswer);
  545. let hengIndex = 0;
  546. items.pyNumber = [];
  547. items.mulText.detail.forEach((sdItem, sdIndex) => {
  548. let isHasPY = 0;
  549. let maxFontsize = 0;
  550. sdItem.detail.forEach((sddItem) => {
  551. if (sddItem.wordsList.length > 0) {
  552. sddItem.wordsList.forEach((sItem, sIndex) => {
  553. let reg = /_{2,}/g;
  554. if (reg.test(sItem.chs)) {
  555. sItem.index = sIndex;
  556. sItem.isHeng = true;
  557. sItem.hengIndex = hengIndex;
  558. hengIndex++;
  559. }
  560. // 补全句子
  561. if (!this.curQue.Bookanswer) {
  562. let reg = /_{2,}/g;
  563. if (reg.test(sItem.chs)) {
  564. let bool = false;
  565. if (sddItem.hasOwnProperty("input_Isexample")) {
  566. bool = sddItem.input_Isexample;
  567. } else {
  568. bool = items.Isexample;
  569. }
  570. let obj = null;
  571. if (!sddItem.input_tian) {
  572. obj = {
  573. answer:
  574. bool && complateArr[sItem.hengIndex]
  575. ? complateArr[sItem.hengIndex]
  576. : "",
  577. userAnswerJudge:
  578. bool || !complateArr[sItem.hengIndex]
  579. ? ""
  580. : "[JUDGE##F##JUDGE]",
  581. input_Isexample: Boolean(bool),
  582. };
  583. Bookanswer[index].content[indexs].completeInput.push(
  584. JSON.parse(JSON.stringify(obj))
  585. );
  586. } else {
  587. if (sddItem.hengLeg == "-1") {
  588. completeImage.push(obj);
  589. } else {
  590. for (let i = 0; i < Number(sddItem.hengLeg); i++) {
  591. completeImage.push(obj);
  592. }
  593. }
  594. Bookanswer[index].content[indexs].completeInput.push(
  595. JSON.parse(JSON.stringify(completeImage))
  596. );
  597. }
  598. }
  599. }
  600. this.mergeWordSymbol(sItem);
  601. if (sItem.pinyin) {
  602. isHasPY++;
  603. this.totalHasPy = true;
  604. }
  605. let fontSize = JSON.parse(JSON.stringify(sItem.fontSize));
  606. fontSize = Number(fontSize.replace("px", ""));
  607. maxFontsize =
  608. fontSize > maxFontsize ? fontSize : maxFontsize;
  609. });
  610. } else if (sddItem.sentence) {
  611. let fontSize = JSON.parse(
  612. JSON.stringify(sddItem.config.fontSize)
  613. );
  614. fontSize = Number(fontSize.replace("px", ""));
  615. maxFontsize = fontSize > maxFontsize ? fontSize : maxFontsize;
  616. }
  617. });
  618. sdItem.maxFontsize = maxFontsize;
  619. items.pyNumber.push(isHasPY);
  620. });
  621. }
  622. });
  623. });
  624. if (!this.curQue.Bookanswer) {
  625. this.$set(
  626. this.curQue,
  627. "Bookanswer",
  628. JSON.parse(JSON.stringify(Bookanswer))
  629. );
  630. } else {
  631. let BookanswerStr = JSON.stringify(this.curQue.Bookanswer);
  632. let errReg = /\[JUDGE##F##JUDGE\]/g;
  633. if (errReg.test(BookanswerStr)) {
  634. let errorArr = BookanswerStr.match(/\[JUDGE##F##JUDGE\]/g);
  635. this.userErrorNumberTotal = errorArr.length;
  636. }
  637. }
  638. this.$set(this.curQue.tableData, "body", option);
  639. let contentWidth = 780;
  640. if (this.curQue.img_list && this.curQue.img_list.length > 0) {
  641. contentWidth = 780 - this.curQue.img_size;
  642. }
  643. if (itemLeg == 1) {
  644. this.itemsWidth = 780;
  645. } else {
  646. this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;
  647. }
  648. // 把答错的挑出来
  649. if (this.judgeAnswer == "standardAnswer") {
  650. this.userErrorList = [];
  651. this.userBookanswer = [];
  652. this.curQue.tableData.body.forEach((item, index) => {
  653. item.content.forEach((items, indexs) => {
  654. if (items.mulText) {
  655. let flag = false;
  656. // 句子填空
  657. items.mulText.correct.complateArr.forEach((itemI, indexI) => {
  658. if (
  659. itemI &&
  660. itemI !=
  661. this.curQue.Bookanswer[index].content[indexs].completeInput[
  662. indexI
  663. ]
  664. ) {
  665. flag = true;
  666. }
  667. });
  668. if (flag) {
  669. this.userErrorList.push(items);
  670. this.userBookanswer.push(this.curQue.Bookanswer[index][indexs]);
  671. this.userError = true;
  672. }
  673. }
  674. });
  675. });
  676. }
  677. },
  678. // 词和标点合一起
  679. mergeWordSymbol(sItem) {
  680. if (this.chsFhList.indexOf(sItem.chs) > -1) {
  681. sItem.isShow = false;
  682. } else {
  683. sItem.isShow = true;
  684. }
  685. },
  686. },
  687. };
  688. </script>
  689. <style lang="scss" scoped>
  690. .header-separate {
  691. width: 100%;
  692. margin-bottom: 16px;
  693. overflow: auto;
  694. table {
  695. table-layout: fixed;
  696. font-size: 16px;
  697. border-collapse: separate;
  698. border-spacing: 6px 0;
  699. th {
  700. color: #4d4c51;
  701. font-weight: normal;
  702. background-color: #efeff9;
  703. padding: 4px 12px;
  704. border: 2px solid #afb4d1;
  705. .thead-content {
  706. display: flex;
  707. justify-content: center;
  708. .english {
  709. font-family: "robot";
  710. color: #000;
  711. }
  712. }
  713. }
  714. td {
  715. color: #474747;
  716. border-bottom: 1px solid transparent;
  717. padding: 4px 12px;
  718. min-height: 43px;
  719. height: 43px;
  720. .cell-wrap {
  721. display: flex;
  722. align-items: center;
  723. &-center {
  724. justify-content: center;
  725. }
  726. &-right {
  727. justify-content: flex-end;
  728. }
  729. &-between {
  730. justify-content: space-between;
  731. }
  732. .content {
  733. font-family: "FZJCGFKTK", "GB-PINYINOK-B", "robot";
  734. }
  735. @each $type in left, center, right {
  736. .text-#{$type} {
  737. ::v-deep .el-textarea__inner {
  738. text-align: $type;
  739. background-color: transparent;
  740. cursor: text !important;
  741. caret-color: #606266 !important;
  742. }
  743. }
  744. }
  745. }
  746. // 下划线
  747. &.underline {
  748. text-decoration: underline;
  749. }
  750. .sentence {
  751. display: flex;
  752. }
  753. // 前缀 + 拼音
  754. .pre-pinyin {
  755. display: flex;
  756. align-items: flex-end;
  757. .right-pinyin {
  758. margin-left: 4px;
  759. column-gap: 2px;
  760. text-align: center;
  761. display: grid;
  762. }
  763. }
  764. &:first-child {
  765. border-left: 2px solid transparent;
  766. border-bottom-width: 1px;
  767. border-image: linear-gradient(
  768. transparent 6px,
  769. #e7b576 6px,
  770. #e7b576 calc(100% - 6px),
  771. transparent calc(100% - 6px),
  772. transparent calc(100% - 2px),
  773. #cecece calc(100% - 2px)
  774. )
  775. 2;
  776. border-image-outset: 0 4px 0 0;
  777. &.col-center {
  778. text-align: center;
  779. }
  780. }
  781. &:not(:last-child) {
  782. position: relative;
  783. // 用 ::after 模拟中间边框
  784. &::after {
  785. content: "";
  786. position: absolute;
  787. top: 0;
  788. left: calc(100% + 2px);
  789. width: 2px;
  790. height: 100%;
  791. display: inline-block;
  792. background: repeating-linear-gradient(
  793. transparent,
  794. transparent 3px,
  795. #cecece 3px,
  796. #cecece 7px,
  797. transparent 7px
  798. );
  799. }
  800. }
  801. // 中间的底部边框用 ::before 模拟
  802. &:not(:first-child):not(:last-child)::before {
  803. content: "";
  804. position: absolute;
  805. top: 100%;
  806. left: 0;
  807. width: 100%;
  808. height: 1px;
  809. display: inline-block;
  810. background-color: #cecece;
  811. box-shadow: 2px 0 #cecece, -2px 0 #cecece;
  812. }
  813. &:last-child {
  814. border-right: 2px solid transparent;
  815. border-bottom-width: 1px;
  816. border-image: linear-gradient(
  817. transparent 6px,
  818. #e7b576 6px,
  819. #e7b576 calc(100% - 6px),
  820. transparent calc(100% - 6px),
  821. transparent calc(100% - 2px),
  822. #cecece calc(100% - 2px)
  823. )
  824. 2;
  825. border-image-outset: 0 0 0 4px;
  826. }
  827. }
  828. .pinyin {
  829. font-family: "GB-PINYINOK-B";
  830. }
  831. .chs {
  832. // font-family: "FZJCGFKTK";
  833. // font-size: 20px;
  834. }
  835. }
  836. }
  837. // .stem-content {
  838. // flex: 1;
  839. // }
  840. .sent-main {
  841. position: relative;
  842. width: 100%;
  843. display: flex;
  844. flex-wrap: wrap;
  845. box-sizing: border-box;
  846. &-138 {
  847. padding-right: 138px;
  848. }
  849. &-bottom {
  850. margin-bottom: 9px;
  851. }
  852. }
  853. .sent-que-box {
  854. display: flex;
  855. flex-wrap: wrap;
  856. padding: 4px 0;
  857. }
  858. .sent-que {
  859. // font-size: 0;
  860. &-flex {
  861. flex: 1;
  862. display: flex;
  863. justify-content: space-between;
  864. align-items: stretch;
  865. }
  866. .sentence-part {
  867. flex: 1;
  868. }
  869. .sddItem_img_list {
  870. height: 32px;
  871. }
  872. }
  873. </style>
  874. <style lang="scss">
  875. .header-separate {
  876. .correct {
  877. .el-textarea.is-disabled .el-textarea__inner {
  878. color: #2ca767 !important;
  879. }
  880. .cross-tick {
  881. border-color: #2ca767 !important;
  882. .el-icon-check:before {
  883. color: #2ca767 !important;
  884. }
  885. .el-icon-close:before {
  886. color: #2ca767 !important;
  887. }
  888. }
  889. }
  890. .error {
  891. .el-textarea.is-disabled .el-textarea__inner {
  892. color: #ed342d !important;
  893. }
  894. .cross-tick {
  895. border-color: #ed342d !important;
  896. .el-icon-check:before {
  897. color: #ed342d !important;
  898. }
  899. .el-icon-close:before {
  900. color: #ed342d !important;
  901. }
  902. }
  903. }
  904. }
  905. </style>