ConfigurableTable.vue 28 KB

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