123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554 |
- <template>
- <div>
- <el-table
- :default-expand-all="true"
- border
- :data="tabledata"
- style="width: 100%; border-radius: 4px; overflow: hidden"
- :header-cell-style="{
- 'background-color': '#F5F5F5',
- padding: '8px',
- color: '#666',
- }"
- >
- <el-table-column label="节/卷" type="expand" width="70px">
- <template slot-scope="scope">
- <div
- class="dis_flexs"
- :class="{ exceedStyle: exceed(scope.row.userStudyRecordPhotoList) }"
- >
- <ul
- style="flex: 1"
- v-if="
- scope.row.userStudyRecordPhotoList &&
- scope.row.userStudyRecordPhotoList.length
- "
- >
- <li
- v-for="(its, inds) in scope.row.userStudyRecordPhotoList"
- :key="inds"
- class="liImgs"
- >
- <el-image
- style="width: 100%; height: 100%"
- :src="$methodsTools.splitImgHost(its.photo)"
- :preview-src-list="
- returnImgUrl(scope.row.userStudyRecordPhotoList)
- "
- >
- </el-image>
- <div
- class="abos"
- @click="
- imgChange(
- scope.row.userStudyRecordPhotoList[inds],
- 'photo',
- its.photo
- )
- "
- >
- {{ $methodsTools.onlyForma(its.createTime) }}
- </div>
- </li>
- <div style="clear: both"></div>
- </ul>
- <p v-else style="text-align: center; width: 100%">暂无拍照数据</p>
- <div
- class="styFlex"
- v-if="
- (periodStatus === 0 ||
- periodStatus === 2 ||
- periodStatus === 3) &&
- scope.row.periodStatus === 1
- "
- >
- <div>
- <el-checkbox
- class="checkboxList"
- :label="scope.row.periodStatusId"
- :disabled="
- periodStatus === 3
- ? false
- : scope.row.status !== 2
- ? true
- : false
- "
- ><br
- /></el-checkbox>
- </div>
- <el-button
- :disabled="scope.row.status !== 2"
- class="btnstyles"
- size="small"
- type="success"
- :loading="disabledBtn"
- @click="changeStatus(scope.row.periodStatusId, 1)"
- >通过</el-button
- >
- <el-button
- :disabled="scope.row.status !== 2"
- class="btnstyles"
- size="small"
- type="danger"
- @click="changeStatus(scope.row.periodStatusId, 0)"
- >作弊</el-button
- >
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- v-for="(item, index) in tableSet"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- >
- <template slot-scope="scope2">
- <span v-if="item.scope === 'select'">
- <span
- v-for="(k, ds) in item.options"
- :key="ds"
- :style="
- scope2.row[item.prop] === 0
- ? 'color:red;'
- : scope2.row[item.prop] === 2
- ? 'color:#0047D0;'
- : scope2.row[item.prop] === 1
- ? 'color:#67C23A;'
- : ''
- "
- >
- {{ k.value == scope2.row[item.prop] ? k.label : "" }}
- </span>
- </span>
- <div v-else-if="item.scope === 'activeNum'">
- <el-select
- v-model="scope2.row[item.prop]"
- placeholder="请选择"
- @change="getNewListchapt(scope2.$index, $event, scope2.row)"
- >
- <el-option
- v-for="(items, indexs) in scope2.row['numList']"
- :key="indexs"
- :label="`第${items}次审核记录${indexs > 0 ? '(重修)' : ''}`"
- :value="items"
- >
- </el-option>
- </el-select>
- </div>
- <span v-else-if="item.scope === 'typeOptions'">
- <span v-for="(is, ds) in item.options" :key="ds">
- <span v-if="is.value === scope2.row[item.prop]">{{
- is.label
- }}</span>
- </span>
- </span>
- <span v-else-if="item.scope === 'aTime'">
- {{ $methodsTools.onlyForma(scope2.row[item.prop]) }}
- </span>
- <span v-else-if="item.scope === 'durTime' && scope2.row.type !== 5">
- {{
- scope2.row["type"] == 3
- ? $methodsTools.secondToDate(scope2.row[item.prop], false)
- : "分数:" + scope2.row["performance"]
- }}
- </span>
- <div v-else-if="item.scope === 'aTimeSE'">
- <div
- v-if="
- scope2.row['type'] === 3 &&
- scope2.row['durationTime'] &&
- scope2.row['studyStartTime'] &&
- scope2.row['studyEndTime']
- "
- :style="comput(scope2.row)"
- >
- <div
- v-if="
- scope2.row['numIndex'] === scope2.row['numList'] &&
- scope2.row['numIndex'] !== 1
- "
- >
- <div>
- 上次时间:{{
- $methodsTools.onlyForma(scope2.row["preStartTime"]) +
- " - " +
- $methodsTools.onlyForma(scope2.row["preEndTime"])
- }}
- </div>
- <div>
- 重学时间:{{
- $methodsTools.onlyForma(scope2.row[item.prop1]) +
- " - " +
- $methodsTools.onlyForma(scope2.row[item.prop2])
- }}
- </div>
- </div>
- <div v-else>
- 学习时间:{{
- $methodsTools.onlyForma(scope2.row[item.prop1]) +
- " - " +
- $methodsTools.onlyForma(scope2.row[item.prop2])
- }}
- </div>
- <!-- {{ $methodsTools.onlyForma(scope2.row[item.prop]) }} -->
- </div>
- <div
- v-if="
- (scope2.row['type'] === 4 || scope2.row['type'] === 5) &&
- scope2.row['studyStartTime'] &&
- scope2.row['studyEndTime']
- "
- >
- 学习时间:{{
- $methodsTools.onlyForma(scope2.row[item.prop1]) +
- " - " +
- $methodsTools.onlyForma(scope2.row[item.prop2])
- }}
- </div>
- </div>
- <div v-else-if="item.scope === 'aTimeSEComputer'">
- <div
- v-if="
- scope2.row['type'] === 3 &&
- scope2.row['durationTime'] &&
- scope2.row['studyStartTime'] &&
- scope2.row['studyEndTime']
- "
- >
- <div
- v-if="
- scope2.row['numIndex'] === scope2.row['numList'] &&
- scope2.row['numIndex'] !== 1
- "
- >
- <div>
- 上次时间:{{
- (
- (scope2.row["preEndTime"] - scope2.row["preStartTime"]) /
- 60
- ).toFixed(0) || 0
- }}分钟
- </div>
- <div>
- 重学时间:
- {{
- (
- (scope2.row[item.prop2] - scope2.row[item.prop1]) /
- 60
- ).toFixed(0) || 0
- }}分钟
- </div>
- </div>
- <div v-else>
- 学习时间:
- {{
- (
- (scope2.row[item.prop2] - scope2.row[item.prop1]) /
- 60
- ).toFixed(0) || 0
- }}分钟
- </div>
- </div>
- </div>
- <span v-else> {{ scope2.row[item.prop] }} </span>
- </template>
- </el-table-column>
- </el-table>
- <Cheat-dialog
- :vidBoxHours.sync="vidBoxHours"
- @submit="submit"
- ></Cheat-dialog>
- </div>
- </template>
- <script>
- import CheatDialog from "./CheatDialog.vue";
- export default {
- props: {
- setData: {
- type: Object,
- default: () => {
- return {};
- },
- },
- tabledata: {
- type: Array,
- default: () => {
- return [];
- },
- },
- erJianErZao:{
- type:Boolean,
- default:()=>{
- return false
- }
- }
- },
- inject: ["getPeriodStatus", "getUserInfo", "getAllIds"],
- data() {
- return {
- tableSet: [
- {
- label: "选择",
- prop: "numIndex",
- scope: "activeNum",
- width: "210px",
- },
- {
- label: "姓名",
- prop: "realName",
- },
- {
- label: "标题",
- prop: "typeName",
- },
- {
- label: "类型",
- prop: "type",
- scope: "typeOptions",
- width: "90px",
- options: [
- {
- label: "节",
- value: 3,
- },
- {
- label: "试卷",
- value: 4,
- },
- {
- label: "模块卷",
- value: 5,
- },
- ],
- },
- {
- label: "节时长",
- prop: "durationTime",
- width: "120px",
- scope: "durTime",
- },
- {
- label: "学习时间",
- prop1: "studyStartTime",
- prop2: "studyEndTime",
- scope: "aTimeSE",
- width: "420px",
- },
- {
- label: "学习用时",
- prop1: "studyStartTime",
- prop2: "studyEndTime",
- scope: "aTimeSEComputer",
- width: "170px",
- },
- {
- label: "审核状态",
- prop: "status",
- scope: "select",
- width: "100px",
- options: [
- {
- label: "待审核",
- value: 2,
- },
- {
- label: "通过",
- value: 1,
- },
- {
- label: "作弊",
- value: 0,
- },
- {
- label: "待重修",
- value: 3,
- },
- ],
- },
- {
- label: "审核人",
- prop: "auditUserName",
- width: "100px",
- },
- {
- label: "审核时间",
- prop: "auditTime",
- scope: "aTime",
- },
- ],
- disabledBtn: false,
- vidBoxHours: false,
- formData: {
- status: "",
- id: "",
- },
- };
- },
- methods: {
- exceed(list) {
- if (list && list.length > 1 && this.erJianErZao) {
- let status = false;
- for (let i = 0; i < list.length - 1; i++) {
- if (list[i + 1].createTime - list[i].createTime > 1200) {
- status = true;
- break;
- }
- }
- return status;
- } else {
- return false;
- }
- },
- imgChange(list, name, url) {
- return;
- this.$api
- .imgChange({
- imageUrl: url,
- })
- .then((res) => {
- if (res.code == 200) {
- this.$set(list, name, url + `?v=${Math.random()}`);
- this.$message.success("操作成功");
- }
- });
- },
- submit(text) {
- this.formData.auditReason = text;
- this.$api
- .editGradeUsereditPeriode(this.formData)
- .then((res) => {
- this.$message.success("修改成功");
- this.vidBoxHours = false;
- if (this.allIds.length == 1) {
- this.$router.push({
- name: "ListOfhoursToBeReviewed",
- });
- }
- this.getUserInfo(true);
- })
- .finally(() => {
- this.disabledBtn = false;
- });
- },
- loadingClose() {
- this.disabledBtn = false;
- },
- comput(item) {
- var ast = item.studyEndTime - item.studyStartTime;
- let status = item.durationTime - ast;
- if (status > 25) {
- return "color:red;";
- } else {
- return "";
- }
- },
- getNewListchapt(index, int, item) {
- let { courseId, moduleId, chapterId, userId, goodsId, gradeId } = item;
- let data = {
- courseId: courseId,
- moduleId,
- chapterId,
- numIndex: int,
- userId,
- goodsId,
- gradeId,
- orderGoodsId: this.setData.orderGoodsId,
- };
- if (item.type === 3) {
- data.sectionId = item.id;
- }
- if (item.type === 4) {
- data.examId = item.id;
- }
- this.$api.inquireGradegradelistPeriodAuditStatus(data).then((res) => {
- this.$set(this.tabledata, index, res.data);
- });
- },
- changeStatus(id, status) {
- this.formData = {
- status,
- id,
- };
- if (status == 0) {
- this.vidBoxHours = true;
- } else {
- this.submit();
- }
- },
- },
- computed: {
- periodStatus() {
- return this.getPeriodStatus();
- },
- allIds() {
- return this.getAllIds();
- },
- returnImgUrl: function () {
- return function (ary) {
- return (
- (ary && ary.map((i) => this.$methodsTools.splitImgHost(i.photo))) ||
- []
- );
- };
- },
- },
- components: {
- CheatDialog,
- },
- };
- </script>
- <style lang="less" scoped>
- .exceedStyle {
- background-color: rgb(255, 224, 224);
- }
- .liImgs {
- float: left;
- width: 210px;
- // height: 280px;
- margin-right: 16px;
- margin-bottom: 16px;
- position: relative;
- border-radius: 8px;
- overflow: hidden;
- .abos {
- position: absolute;
- bottom: 0px;
- width: 100%;
- height: 32px;
- line-height: 32px;
- font-size: 14px;
- color: #fff;
- text-align: center;
- background-color: rgba(51, 51, 51, 0.7);
- }
- }
- .dis_flexs {
- display: flex;
- align-items: center;
- padding: 10px 18px;
- ul {
- margin-bottom: 0px;
- max-height: 588px;
- overflow: auto;
- }
- }
- .styFlex {
- width: 80px;
- text-align: center;
- }
- .checkboxList {
- margin-bottom: 6px;
- &/deep/.el-checkbox__label {
- display: none;
- }
- }
- .btnstyles {
- margin-left: 0px;
- margin-bottom: 10px;
- }
- </style>
|