index.vue 28 KB

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