LessonTable.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <template>
  2. <div>
  3. <el-table
  4. :default-expand-all="true"
  5. border
  6. :data="tabledata"
  7. style="width: 100%; border-radius: 4px; overflow: hidden"
  8. :header-cell-style="{
  9. 'background-color': '#F5F5F5',
  10. padding: '8px',
  11. color: '#666',
  12. }"
  13. >
  14. <el-table-column label="节/卷" type="expand" width="70px">
  15. <template slot-scope="scope">
  16. <div class="dis_flexs">
  17. <ul
  18. style="flex: 1"
  19. v-if="
  20. scope.row.userStudyRecordPhotoList &&
  21. scope.row.userStudyRecordPhotoList.length
  22. "
  23. >
  24. <li class="liImgs">
  25. <el-image
  26. style="width: 100%; height: 100%"
  27. :src="$methodsTools.splitImgHost(getUserImg)"
  28. :preview-src-list="[$methodsTools.splitImgHost(getUserImg)]"
  29. >
  30. </el-image>
  31. <div class="abos">一寸头像图</div>
  32. </li>
  33. <li
  34. v-for="(its, inds) in scope.row.userStudyRecordPhotoList"
  35. :key="inds"
  36. class="liImgs"
  37. >
  38. <el-image
  39. style="width: 100%; height: 100%"
  40. :src="$methodsTools.splitImgHost(its.photo)"
  41. :preview-src-list="[$methodsTools.splitImgHost(its.photo)]"
  42. >
  43. </el-image>
  44. <div class="abos">
  45. {{ $methodsTools.onlyForma(its.createTime) }}
  46. </div>
  47. </li>
  48. <div style="clear: both"></div>
  49. </ul>
  50. <p v-else style="text-align: center; width: 100%">暂无拍照数据</p>
  51. <div
  52. class="styFlex"
  53. v-if="
  54. (periodStatus === 0 ||
  55. periodStatus === 2 ||
  56. periodStatus === 3) &&
  57. scope.row.periodStatus === 1 &&
  58. !dontControls
  59. "
  60. >
  61. <div>
  62. <el-checkbox
  63. class="checkboxList"
  64. :label="scope.row.periodStatusId"
  65. :disabled="
  66. periodStatus === 3
  67. ? false
  68. : scope.row.status !== 2
  69. ? true
  70. : false
  71. "
  72. ><br
  73. /></el-checkbox>
  74. </div>
  75. <el-button
  76. :disabled="scope.row.status !== 2"
  77. class="btnstyles"
  78. size="small"
  79. type="success"
  80. :loading="disabledBtn"
  81. @click="changeStatus(scope.row.periodStatusId, 1)"
  82. >通过</el-button
  83. >
  84. <el-button
  85. :disabled="scope.row.status !== 2"
  86. class="btnstyles"
  87. size="small"
  88. type="danger"
  89. @click="changeStatus(scope.row.periodStatusId, 0)"
  90. >作弊</el-button
  91. >
  92. </div>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. v-for="(item, index) in setSableSet(dontControls)"
  98. :width="item.width"
  99. :key="index"
  100. :label="item.label"
  101. align="center"
  102. >
  103. <template slot-scope="scope2">
  104. <span v-if="item.scope === 'select'">
  105. <span
  106. v-for="(k, ds) in item.options"
  107. :key="ds"
  108. :style="
  109. scope2.row[item.prop] === 0
  110. ? 'color:red;'
  111. : scope2.row[item.prop] === 2
  112. ? 'color:#0047D0;'
  113. : scope2.row[item.prop] === 1
  114. ? 'color:#67C23A;'
  115. : ''
  116. "
  117. >
  118. {{ k.value == scope2.row[item.prop] ? k.label : "" }}
  119. </span>
  120. </span>
  121. <div v-else-if="item.scope === 'activeNum'">
  122. <el-select
  123. v-model="scope2.row[item.prop]"
  124. placeholder="请选择"
  125. @change="getNewListchapt(scope2.$index, $event, scope2.row)"
  126. >
  127. <el-option
  128. v-for="(items, indexs) in scope2.row['numList']"
  129. :key="indexs"
  130. :label="`第${items}次审核记录${indexs > 0 ? '(重修)' : ''}`"
  131. :value="items"
  132. >
  133. </el-option>
  134. </el-select>
  135. </div>
  136. <span v-else-if="item.scope === 'typeOptions'">
  137. <span v-for="(is, ds) in item.options" :key="ds">
  138. <span v-if="is.value === scope2.row[item.prop]">{{
  139. is.label
  140. }}</span>
  141. </span>
  142. </span>
  143. <span v-else-if="item.scope === 'aTime'">
  144. {{ $methodsTools.onlyForma(scope2.row[item.prop]) }}
  145. </span>
  146. <span
  147. v-else-if="item.scope === 'durationTime' && scope2.row.type !== 5"
  148. >
  149. {{ (scope2.row[item.prop] / 60 / 45).toFixed(2) }}
  150. </span>
  151. <span v-else-if="item.scope === 'durTime' && scope2.row.type !== 5">
  152. <span v-if="scope2.row['type'] == 3">
  153. {{ (scope2.row[item.prop] / 60).toFixed(0) + "分钟" || "0分钟0" }}
  154. {{ scope2.row[item.prop] % 60 || 0 }}秒
  155. </span>
  156. <span v-else>
  157. {{ "分数:" + scope2.row["performance"] }}
  158. </span>
  159. </span>
  160. <span
  161. v-else-if="
  162. item.scope === 'performance' &&
  163. (scope2.row.type === 4 || scope2.row.type === 5)
  164. "
  165. >
  166. {{ scope2.row[item.prop] }}
  167. </span>
  168. <div v-else-if="item.scope === 'aTimeSE'">
  169. <div
  170. v-if="
  171. scope2.row['type'] === 3 &&
  172. scope2.row['durationTime'] &&
  173. scope2.row['studyStartTime'] &&
  174. scope2.row['studyEndTime']
  175. "
  176. :style="comput(scope2.row)"
  177. >
  178. <div
  179. v-if="
  180. scope2.row['numIndex'] === scope2.row['numList'] &&
  181. scope2.row['numIndex'] !== 1
  182. "
  183. >
  184. <div>
  185. 上次时间:{{
  186. $methodsTools.onlyForma(scope2.row["preStartTime"]) +
  187. " - " +
  188. $methodsTools.onlyForma(scope2.row["preEndTime"])
  189. }}
  190. </div>
  191. <div>
  192. 重学时间:{{
  193. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  194. " - " +
  195. $methodsTools.onlyForma(scope2.row[item.prop2])
  196. }}
  197. </div>
  198. </div>
  199. <div v-else>
  200. 学习时间:{{
  201. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  202. " - " +
  203. $methodsTools.onlyForma(scope2.row[item.prop2])
  204. }}
  205. </div>
  206. <!-- {{ $methodsTools.onlyForma(scope2.row[item.prop]) }} -->
  207. </div>
  208. <div
  209. v-if="
  210. (scope2.row['type'] === 4 || scope2.row['type'] === 5) &&
  211. scope2.row['studyStartTime'] &&
  212. scope2.row['studyEndTime']
  213. "
  214. >
  215. 学习时间:{{
  216. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  217. " - " +
  218. $methodsTools.onlyForma(scope2.row[item.prop2])
  219. }}
  220. </div>
  221. </div>
  222. <div v-else-if="item.scope === 'aTimeSEComputer'">
  223. <div
  224. v-if="
  225. scope2.row['type'] === 3 &&
  226. scope2.row['durationTime'] &&
  227. scope2.row['studyStartTime'] &&
  228. scope2.row['studyEndTime']
  229. "
  230. >
  231. <div
  232. v-if="
  233. scope2.row['numIndex'] === scope2.row['numList'] &&
  234. scope2.row['numIndex'] !== 1
  235. "
  236. >
  237. <!-- <div>
  238. 上次时间:{{
  239. $methodsTools.secondToDate(
  240. scope2.row["preEndTime"] - scope2.row["preStartTime"]
  241. )
  242. }}
  243. </div>
  244. <div>
  245. 重学时间:{{
  246. $methodsTools.secondToDate(
  247. scope2.row[item.prop2] - scope2.row[item.prop1]
  248. )
  249. }}
  250. </div> -->
  251. <div>
  252. 上次时间:{{
  253. (
  254. (scope2.row["preEndTime"] - scope2.row["preStartTime"]) /
  255. 60
  256. ).toFixed(0) || 0
  257. }}分钟
  258. </div>
  259. <div>
  260. 重学时间:
  261. {{
  262. (
  263. (scope2.row[item.prop2] - scope2.row[item.prop1]) /
  264. 60
  265. ).toFixed(0) || 0
  266. }}分钟
  267. </div>
  268. </div>
  269. <div v-else>
  270. <!-- 学习时间:{{
  271. $methodsTools.secondToDate(
  272. scope2.row[item.prop2] - scope2.row[item.prop1]
  273. )
  274. }} -->
  275. 学习时间:
  276. {{
  277. (
  278. (scope2.row[item.prop2] - scope2.row[item.prop1]) /
  279. 60
  280. ).toFixed(0) || 0
  281. }}分钟{{
  282. (scope2.row[item.prop2] - scope2.row[item.prop1]) % 60
  283. }}秒
  284. </div>
  285. </div>
  286. </div>
  287. <span v-else> {{ scope2.row[item.prop] }} </span>
  288. </template>
  289. </el-table-column>
  290. </el-table>
  291. <Cheat-dialog
  292. :vidBoxHours.sync="vidBoxHours"
  293. @submit="submit"
  294. ></Cheat-dialog>
  295. </div>
  296. </template>
  297. <script>
  298. import CheatDialog from "./CheatDialog.vue";
  299. export default {
  300. props: {
  301. dontControls: {
  302. type: Boolean,
  303. default: () => {
  304. return false;
  305. },
  306. },
  307. setData: {
  308. type: Object,
  309. default: () => {
  310. return {};
  311. },
  312. },
  313. tabledata: {
  314. type: Array,
  315. default: () => {
  316. return [];
  317. },
  318. },
  319. },
  320. inject: ["getPeriodStatus", "getUserInfo", "getAllIds", "getUserImgPhoto"],
  321. data() {
  322. return {
  323. tableSet: [
  324. {
  325. label: "选择",
  326. prop: "numIndex",
  327. scope: "activeNum",
  328. width: "210px",
  329. },
  330. {
  331. label: "姓名",
  332. prop: "realName",
  333. },
  334. {
  335. label: "标题",
  336. prop: "typeName",
  337. },
  338. {
  339. label: "类型",
  340. prop: "type",
  341. scope: "typeOptions",
  342. width: "90px",
  343. options: [
  344. {
  345. label: "节",
  346. value: 3,
  347. },
  348. {
  349. label: "试卷",
  350. value: 4,
  351. },
  352. {
  353. label: "模块卷",
  354. value: 5,
  355. },
  356. ],
  357. },
  358. {
  359. label: "学时",
  360. prop: "durationTime",
  361. width: "120px",
  362. scope: "durationTime",
  363. },
  364. {
  365. label: "时长",
  366. prop: "durationTime",
  367. width: "120px",
  368. scope: "durTime",
  369. },
  370. {
  371. label: "分数",
  372. prop: "performance",
  373. width: "120px",
  374. scope: "performance",
  375. },
  376. {
  377. label: "学习时间",
  378. prop1: "studyStartTime",
  379. prop2: "studyEndTime",
  380. scope: "aTimeSE",
  381. width: "420px",
  382. },
  383. {
  384. label: "学习用时",
  385. prop1: "studyStartTime",
  386. prop2: "studyEndTime",
  387. scope: "aTimeSEComputer",
  388. width: "170px",
  389. },
  390. // {
  391. // label: "结束时间",
  392. // prop: "studyEndTime",
  393. // scope: "aTimeSE",
  394. // },
  395. // {
  396. // label: "审核状态",
  397. // prop: "status",
  398. // scope: "select",
  399. // width: "100px",
  400. // options: [
  401. // {
  402. // label: "待审核",
  403. // value: 2,
  404. // },
  405. // {
  406. // label: "通过",
  407. // value: 1,
  408. // },
  409. // {
  410. // label: "作弊",
  411. // value: 0,
  412. // },
  413. // {
  414. // label: "待重修",
  415. // value: 3,
  416. // },
  417. // ],
  418. // },
  419. // {
  420. // label: "审核人",
  421. // prop: "auditUserName",
  422. // width: "100px",
  423. // },
  424. // {
  425. // label: "审核时间",
  426. // prop: "auditTime",
  427. // scope: "aTime",
  428. // },
  429. ],
  430. disabledBtn: false,
  431. vidBoxHours: false,
  432. formData: {
  433. status: "",
  434. id: "",
  435. },
  436. };
  437. },
  438. methods: {
  439. submit(text) {
  440. this.formData.auditReason = text;
  441. this.$api
  442. .editGradeUsereditPeriode(this.formData)
  443. .then((res) => {
  444. this.$message.success("修改成功");
  445. this.vidBoxHours = false;
  446. if (this.allIds.length == 1) {
  447. this.$router.push({
  448. name: "ListOfhoursToBeReviewed",
  449. });
  450. }
  451. this.getUserInfo(true);
  452. })
  453. .finally(() => {
  454. this.disabledBtn = false;
  455. });
  456. },
  457. loadingClose() {
  458. this.disabledBtn = false;
  459. },
  460. comput(item) {
  461. var ast = item.studyEndTime - item.studyStartTime;
  462. let status = item.durationTime - ast;
  463. if (status > 90) {
  464. return "color:red;";
  465. } else {
  466. return "";
  467. }
  468. },
  469. getNewListchapt(index, int, item) {
  470. let { courseId, moduleId, chapterId, userId, goodsId, gradeId } = item;
  471. let data = {
  472. courseId: courseId,
  473. moduleId,
  474. chapterId,
  475. numIndex: int,
  476. userId,
  477. goodsId,
  478. gradeId,
  479. orderGoodsId: this.setData.orderGoodsId,
  480. tenantIdReplace: this.setData.tenantId,
  481. };
  482. if (item.type === 3) {
  483. data.sectionId = item.id;
  484. }
  485. if (item.type === 4) {
  486. data.examId = item.id;
  487. }
  488. this.$api.inquireGradegradelistPeriodAuditStatus(data).then((res) => {
  489. this.$set(this.tabledata, index, res.data);
  490. });
  491. },
  492. changeStatus(id, status) {
  493. this.formData = {
  494. status,
  495. id,
  496. };
  497. if (status == 0) {
  498. this.vidBoxHours = true;
  499. } else {
  500. this.submit();
  501. }
  502. },
  503. },
  504. computed: {
  505. setSableSet: function () {
  506. return function (i) {
  507. let array = JSON.parse(JSON.stringify(this.tableSet));
  508. if (i) {
  509. let ary = [
  510. {
  511. label: "审核状态",
  512. prop: "status",
  513. scope: "select",
  514. width: "100px",
  515. options: [
  516. {
  517. label: "待审核",
  518. value: 2,
  519. },
  520. {
  521. label: "通过",
  522. value: 1,
  523. },
  524. {
  525. label: "作弊",
  526. value: 0,
  527. },
  528. {
  529. label: "待重修",
  530. value: 3,
  531. },
  532. ],
  533. },
  534. {
  535. label: "审核人",
  536. prop: "auditUserName",
  537. width: "100px",
  538. },
  539. {
  540. label: "审核时间",
  541. prop: "auditTime",
  542. scope: "aTime",
  543. },
  544. ];
  545. array = array.concat(ary);
  546. }
  547. return array;
  548. };
  549. },
  550. periodStatus() {
  551. return this.getPeriodStatus();
  552. },
  553. getUserImg() {
  554. return this.getUserImgPhoto();
  555. },
  556. allIds() {
  557. return this.getAllIds();
  558. },
  559. },
  560. components: {
  561. CheatDialog,
  562. },
  563. };
  564. </script>
  565. <style lang="less" scoped>
  566. .liImgs {
  567. float: left;
  568. width: 168px;
  569. height: 224px;
  570. margin-right: 16px;
  571. margin-bottom: 16px;
  572. position: relative;
  573. border-radius: 8px;
  574. overflow: hidden;
  575. .abos {
  576. position: absolute;
  577. bottom: 0px;
  578. width: 100%;
  579. height: 32px;
  580. line-height: 32px;
  581. font-size: 14px;
  582. color: #fff;
  583. text-align: center;
  584. background-color: rgba(51, 51, 51, 0.7);
  585. }
  586. }
  587. .dis_flexs {
  588. display: flex;
  589. align-items: center;
  590. padding: 10px 18px;
  591. ul {
  592. margin-bottom: 0px;
  593. }
  594. }
  595. .styFlex {
  596. width: 80px;
  597. text-align: center;
  598. }
  599. .checkboxList {
  600. margin-bottom: 6px;
  601. &/deep/.el-checkbox__label {
  602. display: none;
  603. }
  604. }
  605. .btnstyles {
  606. margin-left: 0px;
  607. margin-bottom: 10px;
  608. }
  609. </style>