ConfigurableTable.vue 28 KB

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