index.vue 28 KB

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