askStatic2.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <div class="sjBox" v-if="askJSONC && askJSONC.testJson">
  3. <div class="a_add_title">
  4. <div style="font-size: 25px">{{ askJSONC.testTitle }}</div>
  5. </div>
  6. <div class="a_addBox">
  7. <div
  8. class="a_add_box"
  9. v-for="(item, index) in askJSONC.testJson.testJson"
  10. :key="index"
  11. >
  12. <div class="a_add_head">
  13. <div style="width: calc(100% - 120px)">
  14. <!-- <el-tooltip
  15. effect="light"
  16. :content="item.teststitle"
  17. placement="top"
  18. > -->
  19. <el-tooltip
  20. effect="light"
  21. :content="index + 1 + '、' + item.teststitle"
  22. placement="top"
  23. popper-class="text_tooltip"
  24. >
  25. <div
  26. style="
  27. width: auto;
  28. display: block;
  29. white-space: nowrap;
  30. overflow: hidden;
  31. text-overflow: ellipsis;
  32. word-break: break-word;
  33. cursor: pointer;
  34. "
  35. >
  36. {{ index + 1 + "、" + item.teststitle }}
  37. </div>
  38. </el-tooltip>
  39. <!-- </el-tooltip> -->
  40. <div
  41. class="timuImgBox"
  42. v-if="
  43. askJSONC.testJson.testJson[index].timuList &&
  44. askJSONC.testJson.testJson[index].timuList.length
  45. "
  46. >
  47. <div
  48. v-for="(timg, tIndex) in askJSONC.testJson.testJson[index]
  49. .timuList"
  50. :key="tIndex"
  51. class="timuImg"
  52. @click.stop="previewImg(timg.src)"
  53. >
  54. <img :src="timg.src" alt="" />
  55. </div>
  56. </div>
  57. </div>
  58. <el-button
  59. type="primary"
  60. @click="getA(checkJson[index].checkPerson, item.checkList)"
  61. >查看学生</el-button
  62. >
  63. </div>
  64. <div class="a_add_body">
  65. <div class="a_add_input width100">
  66. <div class="a_add_persent a_add_persent_div a_add_persent_title">
  67. <span>选项</span><span>小计</span><span>比例</span>
  68. </div>
  69. <div class="a_add_persent">
  70. <div
  71. class="a_add_persent_div"
  72. v-for="(item1, checkIndex) in item.testItem"
  73. :key="checkIndex"
  74. >
  75. <span
  76. :class="{
  77. right: item.answer.length
  78. ? item.answer.indexOf(checkIndex) != -1
  79. : item.answer == checkIndex,
  80. }"
  81. >
  82. <div
  83. class="dot"
  84. style="margin-right: 10px;"
  85. v-if="
  86. item.checkList[checkIndex] &&
  87. item.checkList[checkIndex].imgType &&
  88. item.checkList[checkIndex].imgType == 1
  89. "
  90. >
  91. <!-- <div>选项{{checkIndex+1}}:</div> -->
  92. <div
  93. class="inImg"
  94. @click.stop="previewImg(item.checkList[checkIndex].src)"
  95. >
  96. <img :src="item.checkList[checkIndex].src" alt="" />
  97. </div>
  98. </div>
  99. <el-tooltip
  100. effect="light"
  101. :content="item.checkList[checkIndex]"
  102. placement="top"
  103. popper-class="text_tooltip"
  104. v-else
  105. >
  106. <div
  107. class="dot"
  108. style="
  109. max-width: calc(100% - 40px);
  110. overflow: hidden;
  111. width: auto;
  112. cursor: pointer;
  113. "
  114. >
  115. <span>{{ item.checkList[checkIndex] }}</span>
  116. </div>
  117. </el-tooltip>
  118. </span>
  119. <span>{{
  120. checkJson[index].checkCount[checkIndex]
  121. ? checkJson[index].checkCount[checkIndex]
  122. : 0
  123. }}</span>
  124. <span>
  125. <el-progress
  126. :percentage="
  127. checkJson[index].checkPerent[checkIndex]
  128. ? checkJson[index].checkPerent[checkIndex]
  129. : 0
  130. "
  131. :show-text="false"
  132. ></el-progress>
  133. </span>
  134. </div>
  135. <div class="a_add_persent_div">
  136. <span>正确率</span>
  137. <span>{{
  138. (checkJson[index].right ? checkJson[index].right : 0) + "%"
  139. }}</span>
  140. <span> </span>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <el-dialog
  148. title="查看"
  149. :visible.sync="dialogVisible"
  150. :append-to-body="true"
  151. width="900px"
  152. :before-close="handleClose"
  153. class="dialog_diy"
  154. >
  155. <div>
  156. <div v-for="(item, index) in timu" :key="index" class="borderB">
  157. <div v-if="item && item.imgType && item.imgType == 1">
  158. <div class="inImg" @click.stop="previewImg(item.src)">
  159. <img :src="item.src" alt="" />
  160. </div>
  161. </div>
  162. <div v-else v-html="item" class="s_title"></div>
  163. <div class="stuBox" style="margin-top: 20px; align-items: flex-start">
  164. <div style="margin: 0 0 10px 0; min-width: 70px; color: #adadad;font-size:16px;">
  165. 选择同学:
  166. </div>
  167. <div class="stuBox" style="flex-wrap: wrap">
  168. <span
  169. class="studentClass"
  170. v-for="(pe, pi) in person[index]"
  171. :key="index + '-' + pi"
  172. >{{ pe }}</span
  173. >
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <span slot="footer" class="dialog-footer">
  179. <el-button @click="dialogVisible = false"
  180. >关 闭</el-button
  181. >
  182. </span>
  183. </el-dialog>
  184. </div>
  185. </template>
  186. <script>
  187. export default {
  188. props: ["askJSON", "checkJson"],
  189. data() {
  190. return {
  191. askJSONC: {},
  192. dialogVisible: false,
  193. person: [],
  194. timu: [],
  195. checkJson2: [],
  196. };
  197. },
  198. watch: {
  199. askJSON(val) {
  200. this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
  201. },
  202. },
  203. methods: {
  204. handleClose(done) {
  205. done();
  206. },
  207. previewImg(url) {
  208. this.$hevueImgPreview(url);
  209. },
  210. getA(person, timu) {
  211. this.person = person;
  212. this.timu = timu;
  213. this.dialogVisible = true;
  214. },
  215. },
  216. watch: {
  217. checkJson: {
  218. immediate: true,
  219. deep: true,
  220. handler(newValue, oldValue) {
  221. this.askJSONC = this.askJSON ? this.askJSON : {};
  222. for (var i = 0; i < this.checkJson.length; i++) {
  223. // debuggerA
  224. let el = this.checkJson[i];
  225. // console.log(el);
  226. }
  227. this.checkJson2 = this.checkJson;
  228. },
  229. },
  230. },
  231. mounted() {
  232. // this.askJSONC = this.askJSON ? JSON.parse(this.askJSON)[0] : {};
  233. this.askJSONC = this.askJSON ? this.askJSON : {};
  234. for (var i = 0; i < this.checkJson.length; i++) {
  235. let el = this.checkJson[i];
  236. // console.log(el);
  237. }
  238. this.checkJson2 = this.checkJson;
  239. },
  240. };
  241. </script>
  242. <style scoped>
  243. .sjBox {
  244. margin-top: 25px;
  245. /* max-height: 420px; */
  246. overflow: auto;
  247. }
  248. .a_addBox {
  249. margin: 20px 0;
  250. background: #fff;
  251. }
  252. .a_add_box {
  253. border-bottom: 2px solid #eee;
  254. padding-bottom: 10px;
  255. }
  256. .a_add_head {
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-between;
  260. margin: 10px 0;
  261. font-size: 18px;
  262. width: 100%;
  263. }
  264. .a_add_head .a_add_head_input {
  265. width: 300px;
  266. }
  267. .a_add_head .a_add_head_div {
  268. display: flex;
  269. align-items: center;
  270. justify-content: space-between;
  271. }
  272. .a_add_head_div img {
  273. cursor: pointer;
  274. width: 23px;
  275. }
  276. .a_add_head_div img + img {
  277. margin-left: 10px;
  278. }
  279. .a_add_body {
  280. display: flex;
  281. align-items: center;
  282. }
  283. .a_add_input {
  284. display: flex;
  285. align-items: center;
  286. flex-wrap: wrap;
  287. /* flex-direction: column; */
  288. /* width: 100%; */
  289. }
  290. .width100 {
  291. width: 100%;
  292. }
  293. .a_add_input .a_add_persent {
  294. /* display: flex; */
  295. /* flex-direction: column; */
  296. width: 100%;
  297. }
  298. .a_add_persent_div {
  299. width: 100%;
  300. display: flex;
  301. align-items: center;
  302. }
  303. .a_add_persent_div span {
  304. margin: 5px 0;
  305. }
  306. .a_add_persent_div span:nth-child(1) {
  307. width: 30%;
  308. }
  309. .a_add_persent_div span:nth-child(2) {
  310. width: 7%;
  311. }
  312. .a_add_persent_div span:nth-child(3) {
  313. width: 40%;
  314. }
  315. .sjBox::-webkit-scrollbar {
  316. /*滚动条整体样式*/
  317. width: 6px;
  318. /*高宽分别对应横竖滚动条的尺寸*/
  319. height: 6px;
  320. }
  321. /*定义滚动条轨道 内阴影+圆角*/
  322. .sjBox::-webkit-scrollbar {
  323. border-radius: 10px;
  324. background-color: #eee;
  325. }
  326. /*定义滑块 内阴影+圆角*/
  327. .sjBox::-webkit-scrollbar-thumb {
  328. border-radius: 10px;
  329. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  330. background-color: rgba(0, 0, 0, 0.1);
  331. }
  332. .right {
  333. color: rgb(0 123 255);
  334. position: relative;
  335. display: flex;
  336. align-items: center;
  337. flex-wrap: wrap;
  338. }
  339. .right::after {
  340. content: "";
  341. /* position: absolute; */
  342. background-image: url(../../assets/right.png);
  343. min-width: 15px;
  344. min-height: 15px;
  345. background-size: 100% 100%;
  346. margin: 0 10px;
  347. }
  348. .dialog_diy >>> .el-dialog__header,
  349. .dialog_diy1 >>> .el-dialog__header {
  350. background: #454545 !important;
  351. padding: 15px 20px;
  352. }
  353. .dialog_diy >>> .el-dialog__title,
  354. .dialog_diy1 >>> .el-dialog__title {
  355. color: #fff;
  356. }
  357. .dialog_diy >>> .el-dialog__headerbtn,
  358. .dialog_diy1 >>> .el-dialog__headerbtn {
  359. top: 19px;
  360. }
  361. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close,
  362. .dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close {
  363. color: #fff;
  364. }
  365. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover,
  366. .dialog_diy1 >>> .el-dialog__headerbtn .el-dialog__close:hover {
  367. color: #fff;
  368. }
  369. .dialog_diy1 >>> .el-dialog__body {
  370. padding: 0;
  371. }
  372. .dialog_diy >>> .el-dialog__body,
  373. .dialog_diy >>> .el-dialog__footer,
  374. .dialog_diy1 >>> .el-dialog__footer {
  375. background: #fafafa;
  376. }
  377. .s_title {
  378. /* margin-top: 10px; */
  379. font-size: 18px;
  380. margin-bottom: 10px;
  381. word-break: break-word;
  382. /* min-width: calc(100% / 2 - 200px); */
  383. }
  384. .stuBox {
  385. display: flex;
  386. /* flex-wrap: wrap; */
  387. align-items: center;
  388. }
  389. .studentClass {
  390. /* background: #46a1eb;
  391. color: #fff; */
  392. width: 90px;
  393. height: 25px;
  394. text-align: center;
  395. line-height: 25px;
  396. border-radius: 5px;
  397. margin: 0 15px 0 0;
  398. white-space: nowrap;
  399. overflow: hidden;
  400. padding: 5px;
  401. text-overflow: ellipsis;
  402. font-size: 16px;
  403. margin-bottom: 10px;
  404. background: #fff;
  405. color: #0061ff;
  406. border: 1px solid #0061ff;
  407. }
  408. .borderB {
  409. margin-bottom: 10px;
  410. border-bottom: 1px solid #d8d8d8;
  411. }
  412. .inImg {
  413. width: 100px;
  414. height: 100px;
  415. cursor: pointer;
  416. }
  417. .inImg > img {
  418. width: 100%;
  419. height: 100%;
  420. object-fit: cover;
  421. }
  422. .timuImgBox {
  423. margin: 10px 0 10px 20px;
  424. display: flex;
  425. flex-direction: row;
  426. flex-wrap: wrap;
  427. align-items: center;
  428. }
  429. .timuImg {
  430. width: 100px;
  431. margin-right: 10px;
  432. cursor: pointer;
  433. }
  434. .timuImg > img {
  435. width: 100%;
  436. height: 100%;
  437. object-fit: cover;
  438. }
  439. .dot{
  440. display:flex;
  441. align-items: center;
  442. }
  443. .dot > span{
  444. display:block;
  445. max-width: calc(100% - 20px) !important;
  446. width:auto !important;
  447. white-space: nowrap;
  448. text-overflow: ellipsis;
  449. word-break: break-word;
  450. overflow: hidden;
  451. }
  452. .dot::before{
  453. content:'';
  454. min-width: 10px;
  455. width: 10px;
  456. height: 10px;
  457. background: #0061ff;
  458. border-radius: 50%;
  459. margin-right: 10px;
  460. display: block;
  461. }
  462. </style>