From db905ecd14f63dba9337b4f4715584ef2d7e8c7e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Fri, 07 Mar 2025 14:45:00 +0800
Subject: [PATCH] 修改
---
src/views/onlineEducation/classBatch/index.vue | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 109 insertions(+), 10 deletions(-)
diff --git a/src/views/onlineEducation/classBatch/index.vue b/src/views/onlineEducation/classBatch/index.vue
index b2214b8..830361b 100644
--- a/src/views/onlineEducation/classBatch/index.vue
+++ b/src/views/onlineEducation/classBatch/index.vue
@@ -9,6 +9,28 @@
:value="item.id">
</el-option>
</el-select>
+ <el-date-picker
+ v-model="time"
+ size="small"
+ type="daterange"
+ range-separator="至"
+ start-placeholder="开始日期"
+ end-placeholder="结束日期"
+ format="yyyy-MM-dd"
+ style="margin-left: 30px;"
+ >
+ </el-date-picker>
+ <el-cascader
+ v-model="queryParams.subjectCode"
+ ref="classifyRef"
+ @change="changeTree"
+ :options="subjectList"
+ :props="{ checkStrictly: true }"
+ clearable
+ size="small"
+ style="margin-left: 30px;"
+ ></el-cascader>
+ <el-input size="small" style="margin-left: 30px;width: 200px" v-model="queryParams.trainOrgName" placeholder="请输入机构"></el-input>
<el-button
size="small"
type="primary"
@@ -24,9 +46,12 @@
>重置</el-button>
</div>
<el-table v-loading="loading" :data="expertList" style="margin-top: 10px">
- <el-table-column label="UUID" align="center" prop="uuid" />
+ <el-table-column label="ID" align="center" prop="id" />
<el-table-column label="批次名称" align="center" prop="batchName" />
<el-table-column label="推送平台" align="center" prop="institutionName" />
+ <el-table-column label="开始时间" align="center" prop="actualStartTime" />
+ <el-table-column label="计划结束时间" align="center" prop="actualEndTime" />
+ <el-table-column label="类别" align="center" prop="subjectName" />
<el-table-column label="上报时间" align="center" prop="createTime" />
<el-table-column label="所属培训机构" align="center" prop="trainOrgName" />
<el-table-column label="课程" align="center" >
@@ -48,7 +73,7 @@
</el-table-column>
<el-table-column label="已开班" align="center" prop="openStatus" >
<template #default="scope">
- <span>{{scope.row.openStatus == 0 ? '否' : '是'}}</span>
+ <span>{{scope.row.openStatus == 0 ? '未开班' : scope.row.openStatus == 1 ? '开班' : '结束'}}</span>
</template>
</el-table-column>
<el-table-column label="数据更新时间" align="center" prop="updateTime" width="100" />
@@ -71,7 +96,7 @@
<pagination
v-show="total>0"
:total="total"
- :page.sync="queryParams.pageIndex"
+ :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
@@ -88,12 +113,15 @@
import classHour from '@/views/onlineEducation/classBatch/components/classHour.vue'
import { listBatch, listQuestion } from '@/api/onlineEducation/student'
import { listPlatSelect } from '@/api/onlineEducation/plat'
+import moment from 'moment/moment'
+import { getSubject } from '@/api/onlineEducation/count'
export default {
name: "nPeopleManage",
dicts: [],
components: { courseDialog,studentList,classHour},
data() {
return {
+ time: [],
loading: false,
single: true,
multiple: true,
@@ -103,22 +131,88 @@
platformList: [],
expertList: [],
queryParams: {
- pageIndex: 1,
+ pageNum: 1,
pageSize: 10,
- institutionId: ''
+ institutionId: '',
+ startTime: '',
+ endTime: '',
+ subjectCode: null,
+ trainOrgName: ''
},
+ subjectList: [],
+ trainOrgList: []
};
},
created() {
+ this.setDate();
+ this.getSubjectList()
this.getList();
this.getPlat();
},
methods: {
+ setDate(){
+ const end = new Date();
+ const start = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+ const s = moment(start).format('YYYY-MM-DD')
+ const e = moment(end).format('YYYY-MM-DD')
+ this.time = [s,e]
+ },
+ changeTree(val) {
+ console.log("label====",this.$refs.classifyRef.getCheckedNodes()[0].value)
+ this.queryParams.subjectCode = this.$refs.classifyRef.getCheckedNodes()[0].value
+ // 我这里只是打印了一下label的值哦,需要赋值的话自己去赋值哦
+ if (this.$refs.classifyRef) {
+ this.$refs.classifyRef.dropDownVisible = false
+ }
+ },
+ getSubjectList() {
+ getSubject().then(res => {
+ if (res.code == 200) {
+ console.log('res',res)
+ this.subjectList = this.recursion(res.data)
+ }
+ })
+ },
+ recursion(data){
+ let tmp = []
+ for (let i = 0; i < data.length; i++) {
+ let item = data[i]
+ // children为空
+ if (item.children&& item.children.length==0) {
+ tmp.push({
+ value: item.code,
+ label: item.name
+ })
+ // 有children
+ } else {
+ tmp.push({
+ value: item.code,
+ label: item.name,
+ children: this.recursion(item.children)
+ })
+ }
+ }
+ return tmp;
+ },
getList(){
+ if(this.time && this.time.length >0){
+ this.queryParams.startTime = moment(this.time[0]).format('YYYY-MM-DD')
+ this.queryParams.endTime = moment(this.time[1]).format('YYYY-MM-DD')
+ }
+
this.loading = true;
listBatch( this.queryParams).then((res) => {
if (res.code == 200) {
- this.expertList = res.rows
+ this.expertList = res.rows.map(item => {
+ return {
+ ...item,
+ trainOrgName: item.trainOrgName ? item.trainOrgName : '--',
+ startTime: item.startTime ? item.startTime : '--',
+ endTime: item.endTime ? item.endTime : '--',
+ category: item.category ? item.category : '--'
+ }
+ })
this.total = res.total
this.loading = false;
}
@@ -140,17 +234,22 @@
},
resetQuery(){
this.queryParams = {
- pageIndex: 1,
+ pageNum: 1,
pageSize: 10,
- platform: ''
+ institutionId: '',
+ startTime: '',
+ endTime: '',
+ subjectCode: null,
+ trainOrgName: ''
}
+ this.time = [];
this.getList();
},
handleViewCourse(data){
- this.$refs.courseDialogRef.openDialog(data);
+ this.$refs.courseDialogRef.openDialog(data,'batch');
},
openStudent(data) {
- this.$refs.studentDialog.openDialog(data);
+ this.$refs.studentDialog.openDialog(data,'batch');
},
openClassHour(data){
this.$refs.classRef.openDialog(data)
--
Gitblit v1.9.2