教师端1期问题修复

This commit is contained in:
赵依梦
2025-12-14 18:22:48 +08:00
parent 07506d0fff
commit bee726ebd2
2 changed files with 186 additions and 65 deletions

View File

@@ -19,6 +19,24 @@ Vue.use(vueKatexEs,{
}
})
Vue.directive('limit-input', {
bind: function (el, binding) {
const max = binding.value || 50;
// 找到input元素
const input = el.querySelector('input');
if (input) {
// 监听input事件在输入时限制长度
input.addEventListener('input', function () {
if (input.value.length > max) {
input.value = input.value.substring(0, max);
// 触发input事件让element-ui的内部处理更新
input.dispatchEvent(new Event('input', { bubbles: true }));
}
});
}
}
});
//import './mock/index'
import xpage from '@/utils/xpage'

View File

@@ -16,7 +16,17 @@
<el-tab-pane label="报名记录" name="second">
<el-row style="margin: 20px 0;" :gutter="20">
<el-col :span="4">
<div class="grid-content bg-purple"><el-input v-model="signup.name" clearable placeholder="姓名" maxlength="50" /></div>
<div class="grid-content bg-purple">
<!-- <el-input v-model="signup.name" clearable placeholder="姓名" maxlength="50" /> -->
<el-select :key="2" style="width:100%" clearable multiple v-model="signup.aid" filterable
placeholder="姓名" v-limit-input="50" remote reserve-keyword :remote-method="initNameList"
:multiple-limit="5" :loading="nameListLoading">
<el-option v-for="item in nameList" :key="item.userId" :label="item.name" :value="item.userId">
<span>{{ item.name }}</span>
<span v-if="item.code" class="option-code">{{ item.code }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple">
@@ -32,7 +42,7 @@
<el-button @click="resetSignupList()"> </el-button>
</div>
</el-col>
<el-col :span="6" :offset="4">
<div class="grid-content bg-purple" style="text-align: right;">
<el-button type="primary" icon="el-icon-upload2" @click="handleExportSignup">导出报名记录</el-button>
@@ -49,12 +59,13 @@
<el-table-column prop="orgInfo" label="部门">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.orgInfo" placement="top-start">
<p class="no-wrap"> {{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
<p class="no-wrap">
{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="signType" label="报名方式">
<template slot-scope="scope">
<template slot-scope="scope">
<p>{{scope.row.signType == '1' ? '自主报名' : '手动加入' }}</p>
</template>
</el-table-column>
@@ -72,22 +83,34 @@
<el-tab-pane label="学习记录" name="third">
<el-row style="margin-bottom: 20px;" :gutter="20">
<el-col :span="4">
<div class="grid-content bg-purple"><el-input clearable v-model="learningRecords.name" maxlength="50"
placeholder="姓名"></el-input></div>
<div class="grid-content bg-purple">
<!-- <el-input clearable v-model="learningRecords.name" maxlength="50"
placeholder="姓名"></el-input> -->
<el-select :key="1" style="width:100%" clearable multiple v-model="learningRecords.aid" filterable
placeholder="姓名" v-limit-input="50" reserve-keyword remote :remote-method="initNameList"
:multiple-limit="5" :loading="nameListLoading">
<el-option v-for="item in nameList" :key="item.userId" :label="item.name" :value="item.userId">
<span>{{ item.name }}</span>
<span v-if="item.code" class="option-code">{{ item.code }}</span>
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple">
<el-select style="width: 100%;" v-model="learningRecords.status" clearable placeholder="全部学习状态">
<el-select style="width: 100%;" v-model="learningRecords.status" clearable placeholder="学习状态">
<el-option label="未开始" :value="1"></el-option>
<el-option label="进行中" :value="2"></el-option>
<el-option label="已完成" :value="9"></el-option>
</el-select>
</div>
</el-col>
<el-col :span="6">
<div :class="['grid-content', 'bg-purple', 'resetDatePicker', !studyDateTime||studyDateTime.length==0?'noSplitDatePicker':'']">
<div
:class="['grid-content', 'bg-purple', 'resetDatePicker', !studyDateTime||studyDateTime.length==0?'noSplitDatePicker':'']">
<el-date-picker value-format="yyyy-MM-dd" v-model="studyDateTime" type="daterange" align="right"
unlink-panels range-separator="" start-placeholder="学习时长" :picker-options="pickerOptions">
</el-date-picker>
@@ -114,7 +137,8 @@
<el-table-column prop="orgInfo" label="部门">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.orgInfo" placement="top-start">
<p class="no-wrap">{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
<p class="no-wrap">
{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
</el-tooltip>
</template>
</el-table-column>
@@ -159,8 +183,8 @@
</el-col>
<el-col :span="5">
<div class="grid-content bg-purple">
<el-button type="primary" @click="getResourseList">搜索</el-button>
<el-button @click="resetResourseList">重置</el-button>
<el-button type="primary" @click="getResourseList">搜索</el-button>
<el-button @click="resetResourseList">重置</el-button>
</div>
</el-col>
<el-col :span="6" :offset="9">
@@ -207,18 +231,18 @@
<el-table max-height="500" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }"
border :data="courseStudyList" style="width: 100%">
<el-table-column label="课程章节">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.contentName" placement="top-start">
<p class="no-wrap">{{scope.row.contentName}}</p>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.contentName" placement="top-start">
<p class="no-wrap">{{scope.row.contentName}}</p>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="status" label="学习状态">
<template slot-scope="scope">
<span>{{ recourseStudyStatusEnum[scope.row.status] }}</span>
</template>
</el-table-column>
<el-table-column prop="studyDuration" label="学习时长">
<el-table-column prop="studyDuration" label="学习时长">
<template slot-scope="scope">
<span> {{ scope.row.learningDuration == 0? '0': (scope.row.learningDuration/60).toFixed(2)}}</span>
</template>
@@ -245,14 +269,26 @@
<el-dialog title="学习详情" v-if="commonResourceStudyPeopleShow" :visible.sync="commonResourceStudyPeopleShow"
width="50%" :append-to-body="true">
<el-row style="margin: 20px 0 20px -10px;" :gutter="20" v-if="rousourceRow.contentType == '60'">
<el-row style="margin: 20px 0 20px -10px;" :gutter="20">
<el-col :span="6">
<div class="grid-content bg-purple"><el-input v-model="commonResourceStudyPeopleQuery.name" clearable maxlength="50"
placeholder="姓名" /></div>
<div class="grid-content bg-purple">
<el-select :key="3" style="width:100%" clearable multiple v-model="commonResourceStudyPeopleQuery.aid"
filterable placeholder="姓名" v-limit-input="50" remote reserve-keyword :remote-method="initNameList"
:multiple-limit="5" :loading="nameListLoading">
<el-option v-for="item in nameList" :key="item.userId" :label="item.name" :value="item.userId">
<span>{{ item.name }}</span>
<span v-if="item.code" class="option-code">{{ item.code }}</span>
</el-option>
</el-select>
<!-- <el-input v-model="commonResourceStudyPeopleQuery.name" clearable
maxlength="50" placeholder="姓名" /> -->
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-select style="width: 100%;" v-model="commonResourceStudyPeopleQuery.status" placeholder="完成状态" clearable>
<el-select style="width: 100%;" v-model="commonResourceStudyPeopleQuery.status"
:placeholder="rousourceRow.contentType == '60' || rousourceRow.contentType == '62' ? '完成状态' : '学习状态'"
clearable>
<el-option label="未开始" :value="1"></el-option>
<el-option label="已完成" :value="2"></el-option>
<el-option label="进行中" :value="3"></el-option>
@@ -273,7 +309,8 @@
<el-table-column prop="orgInfo" label="部门">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.orgInfo" placement="top-start">
<p class="no-wrap">{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
<p class="no-wrap">
{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
</el-tooltip>
</template>
</el-table-column>
@@ -290,7 +327,7 @@
</template>
</el-table-column>
<el-table-column v-if="rousourceRow.contentType == '62'" prop="studyAssesses[0].asScore"
label="满意度分"></el-table-column>
label="满意度分"></el-table-column>
<el-table-column prop="finishTime" width="200" label="完成时间"></el-table-column>
</el-table>
<div style="text-align: center;padding: 10px;">
@@ -309,12 +346,22 @@
:append-to-body="true">
<el-row style="margin: 20px 0 20px -10px;" :gutter="20">
<el-col :span="6">
<div class="grid-content bg-purple"><el-input v-model="examResourceStudyPeopleQuery.name" clearable maxlength="50"
placeholder="姓名" /></div>
<div class="grid-content bg-purple">
<el-select :key="4" style="width:100%" clearable multiple v-model="examResourceStudyPeopleQuery.aid"
filterable placeholder="姓名" v-limit-input="50" remote reserve-keyword :remote-method="initNameList"
:multiple-limit="5" :loading="nameListLoading">
<el-option v-for="item in nameList" :key="item.userId" :label="item.name" :value="item.userId">
<span>{{ item.name }}</span>
<span v-if="item.code" class="option-code">{{ item.code }}</span>
</el-option>
</el-select>
<!-- <el-input v-model="examResourceStudyPeopleQuery.name" clearable
maxlength="50" placeholder="姓名" /> -->
</div>
</el-col>
<el-col :span="6">
<div class="grid-content bg-purple">
<el-select style="width: 100%;" v-model="examResourceStudyPeopleQuery.status" placeholder="完成状态" clearable>
<el-select style="width: 100%;" v-model="examResourceStudyPeopleQuery.status" placeholder="考试状态" clearable>
<el-option label="未开始" :value="1"></el-option>
<el-option label="已完成" :value="2"></el-option>
<el-option label="进行中" :value="3"></el-option>
@@ -324,7 +371,7 @@
<el-col :span="8">
<div class="grid-content bg-purple">
<el-button type="primary" @click="queryExamStudyPeopleList"> </el-button>
<el-button @click="resetExamCommonResourceQuery"> </el-button>
<el-button @click="resetExamCommonResourceQuery"> </el-button>
</div>
</el-col>
</el-row>
@@ -332,16 +379,16 @@
:header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
<el-table-column type="expand">
<template slot-scope="props">
<el-table max-height="500" :border="false" :data="props.row.studyExams" style="width: 80%;margin: 0 auto;"
:header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
<el-table-column prop="aname" label="考试状态">
<template slot-scope="scope">
{{ scope.row.score >= scope.row.passLine ? '已通过' : '未通过' }}
</template>
</el-table-column>
<el-table-column prop="score" label="考试成绩"></el-table-column>
<el-table-column prop="endTime" width="200" label="完成时间"></el-table-column>
</el-table>
<el-table max-height="500" :border="false" :data="props.row.studyExams" style="width: 80%;margin: 0 auto;"
:header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }">
<el-table-column prop="aname" label="考试状态">
<template slot-scope="scope">
{{ scope.row.score >= scope.row.passLine ? '已通过' : '未通过' }}
</template>
</el-table-column>
<el-table-column prop="score" label="考试成绩"></el-table-column>
<el-table-column prop="endTime" width="200" label="完成时间"></el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column prop="aname" label="姓名"></el-table-column>
@@ -349,7 +396,8 @@
<el-table-column prop="orgInfo" label="部门">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" :content="scope.row.orgInfo" placement="top-start">
<p class="no-wrap">{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
<p class="no-wrap">
{{scope.row.orgInfo && scope.row.orgInfo.split('/')[scope.row.orgInfo.split('/').length - 1]}}</p>
</el-tooltip>
</template>
</el-table-column>
@@ -368,7 +416,7 @@
layout="total, sizes, prev, pager, next, jumper" :total="examResourceStudyPeopleQuery.count"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="commonResourceStudyPeopleShow = false"> </el-button>
<el-button @click="examResourceStudyPeopleShow = false"> </el-button>
<!-- <el-button type="primary" @click="study.detailShow = false">提交</el-button> -->
</span>
</el-dialog>
@@ -382,6 +430,7 @@ import {
// sysTypeList,
getType,
} from "../../utils/tools.js";
import apiUserbasic from "@/api/boe/userbasic.js";
import apicourseStudy from "@/api/modules/courseStudy.js";
import apiCoursePortal from "@/api/modules/coursePortal.js";
import { mapGetters, mapActions } from "vuex";
@@ -389,6 +438,7 @@ import apiUser from "@/api/system/user.js";
import apiStudy from "@/api/modules/courseStudy.js";
import { getToken } from "@/utils/token";
import axios from "axios";
export default {
computed: {
...mapGetters(["resOwnerMap", "sysTypeMap"]),
@@ -397,7 +447,7 @@ export default {
return {
pickerOptions: {
shortcuts: [
{
{
text: "今年以来",
onClick(picker) {
const end = new Date();
@@ -423,7 +473,7 @@ export default {
picker.$emit("pick", [start, end]);
},
},
{
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
@@ -441,9 +491,6 @@ export default {
picker.$emit("pick", [start, end]);
},
},
],
},
studyDateTime: [],
@@ -466,6 +513,7 @@ export default {
signup: {
name: "",
signType: "",
aid: [],
},
courseType: courseType,
value: "",
@@ -490,6 +538,7 @@ export default {
status: "",
queryStartTime: "",
queryFinishTime: "",
aid: [],
},
study: {
detailType: "",
@@ -540,6 +589,7 @@ export default {
count: 0,
name: "",
status: "",
aid: [],
},
examResourceStudyPeopleShow: false,
examResourceStudyPeopleList: [],
@@ -549,7 +599,10 @@ export default {
count: 0,
name: "",
status: "",
aid: [],
},
nameList: [],
nameListLoading: false,
};
},
mounted() {
@@ -569,6 +622,40 @@ export default {
loadSysTypes: "sysType/loadSysTypes",
}),
async initNameList(keyword) {
console.log("initNameList", keyword);
if (!keyword) {
return;
}
this.nameListLoading = true;
try {
const res = await apiUserbasic.selectUser(keyword);
this.nameListLoading = false;
if (res && res.status === 200) {
const resultList = res.result || [];
this.nameList = resultList
.map((item) => this.formatCreatorItem(item))
.filter((item) => item.userId);
} else {
this.creatorOptions = [];
}
} catch (error) {
this.nameList = [];
this.nameListLoading = false;
} finally {
this.nameListLoading = false;
}
},
formatCreatorItem(item = {}) {
return {
userId: item.id,
name: item.realName,
code: item.userNo,
};
},
resetCommonResourceQuery() {
this.commonResourceStudyPeopleQuery = {
pageIndex: 1, //第几页
@@ -576,8 +663,9 @@ export default {
count: 0,
name: "",
status: "",
aid: [],
};
this.queryResourceStudyPeopleList()
this.queryResourceStudyPeopleList();
},
resetExamCommonResourceQuery() {
@@ -587,8 +675,9 @@ export default {
count: 0,
name: "",
status: "",
aid: [],
};
this.queryExamStudyPeopleList()
this.queryExamStudyPeopleList();
},
handleShowResourdeDetailList(row) {
@@ -600,6 +689,7 @@ export default {
count: 0,
name: "",
status: "",
aid: [],
};
this.rousourceRow = row;
if (row.contentType == "61") {
@@ -624,8 +714,9 @@ export default {
contentId: this.rousourceRow.contentId,
pageIndex: this.examResourceStudyPeopleQuery.pageIndex,
pageSize: this.examResourceStudyPeopleQuery.pageSize,
name: this.examResourceStudyPeopleQuery.name,
name: '',
status: this.examResourceStudyPeopleQuery.status,
aid: this.examResourceStudyPeopleQuery.aid.join(","),
})
.then((res) => {
if (res.status === 200) {
@@ -650,6 +741,9 @@ export default {
contentId: this.rousourceRow.contentId,
pageIndex: this.commonResourceStudyPeopleQuery.pageIndex,
pageSize: this.commonResourceStudyPeopleQuery.pageSize,
name: "",
status: this.commonResourceStudyPeopleQuery.status,
aid: this.commonResourceStudyPeopleQuery.aid.join(","),
})
.then((res) => {
if (res.status === 200) {
@@ -669,15 +763,16 @@ export default {
queryResourceStudyPeopleList() {
console.log(this.rousourceRow);
console.log(888)
console.log(888);
apicourseStudy
.studyContentRecords({
courseId: this.courseDetail.id,
contentId: this.rousourceRow.contentId,
pageIndex: this.commonResourceStudyPeopleQuery.pageIndex,
pageSize: this.commonResourceStudyPeopleQuery.pageSize,
name: this.commonResourceStudyPeopleQuery.name,
name: "",
status: this.commonResourceStudyPeopleQuery.status,
aid: this.commonResourceStudyPeopleQuery.aid.join(","),
})
.then((res) => {
if (res.status === 200) {
@@ -770,23 +865,25 @@ export default {
},
resetResourseList() {
this.recourseListQuery.contentName = "";
this.getResourseList()
this.getResourseList();
},
resetStudyRecords() {
this.learningRecords.aid = [];
this.learningRecords.name = "";
this.learningRecords.status = "";
this.studyDateTime = [];
this.learningRecords.queryStartTime = "";
this.learningRecords.queryFinishTime = "";
this.getStudyRecords()
this.getStudyRecords();
},
resetSignupList() {
this.signup = {
name: "",
signType: "",
aid: [],
};
this.getSignupList()
this.getSignupList();
},
resOwnerName(code) {
if (code == "") {
@@ -876,7 +973,7 @@ export default {
this.recourseListQuery.pageIndex = 1;
this.getResourseList();
},
handleCurrentChangeRecourseList() {
handleCurrentChangeRecourseList(val) {
this.recourseListQuery.pageIndex = val;
this.getResourseList();
},
@@ -929,13 +1026,14 @@ export default {
courseId: this.courseDetail.id, //课程的id
status: this.learningRecords.status, //状态
// courseType:this.learningRecords.type,//类型
aname: this.learningRecords.name, //学习人的姓名 learningRecords
aname: "", //学习人的姓名 learningRecords
pageIndex: this.learningRecords.pageIndex,
pageSize: this.learningRecords.pageSize,
queryStartTime:
this.studyDateTime.length > 0 ? this.studyDateTime[0] : "",
queryFinishTime:
this.studyDateTime.length > 1 ? this.studyDateTime[1] : "",
aid: this.learningRecords.aid.join(","),
};
apicourseStudy.studyRecords(params).then((res) => {
if (res.status === 200) {
@@ -966,7 +1064,7 @@ export default {
contentName: this.courseDetail.name,
status: this.studyDetailRow.status,
studyDuration: this.studyDetailRow.progress,
learningDuration: this.studyDetailRow.totalDuration,
learningDuration: this.studyDetailRow.totalDuration,
},
];
}
@@ -989,10 +1087,10 @@ export default {
let params = {
courseId: this.courseDetail.id, //课程的id
signType: this.signup.signType, //报名方式
name: this.signup.name, //姓名
name: "", //姓名
pageIndex: this.study.pageIndex,
pageSize: this.study.pageSize,
aid: this.study.aid,
aid: this.signup.aid.join(","),
};
apicourseStudy.findSignup(params).then((res) => {
@@ -1039,6 +1137,7 @@ export default {
},
handleTabClick(tab) {
this.tabName = tab.name;
this.nameList = [];
if (tab.name === "second") {
this.getSignupList();
} else if (tab.name === "third") {
@@ -1063,14 +1162,18 @@ export default {
</script>
<style lang="scss">
.no-wrap {
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
word-break: break-all;
white-space: nowrap;
}
#courseManage {
.no-wrap {
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
word-break: break-all;
white-space: nowrap;
.option-code {
margin-left: 4px;
color: #999;
}
.noSplitDatePicker {
/* 隐藏范围选择器的分隔符和占位符 */