From e3bfce922c47cf8706be6eada6f5edbd38f39316 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 19 Jul 2024 13:48:43 +0800
Subject: [PATCH] bug修改
---
src/views/onlineEducation/classHourBatch/index.vue | 84 +++++++++++++++++++++++++++++++++++------
1 files changed, 71 insertions(+), 13 deletions(-)
diff --git a/src/views/onlineEducation/classHourBatch/index.vue b/src/views/onlineEducation/classHourBatch/index.vue
index af6dc53..8de4403 100644
--- a/src/views/onlineEducation/classHourBatch/index.vue
+++ b/src/views/onlineEducation/classHourBatch/index.vue
@@ -1,12 +1,41 @@
<template>
<div class="app-container">
- <div style="margin-bottom: 10px;display: flex;align-items: center;justify-content: space-between">
- <el-button
- type="primary"
- plain
- icon="Plus"
- @click="openDialog('add',{})"
- >新增批次</el-button>
+ <div style="display: flex;justify-content: space-between">
+ <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
+ <el-form-item>
+ <el-button
+ type="primary"
+ plain
+ icon="Plus"
+ @click="openDialog('add',{})"
+ >新增批次</el-button>
+ </el-form-item>
+ <el-form-item label="批次名称:" >
+ <el-input v-model="data.queryParams.name" placeholder="请输入批次名称"></el-input>
+ </el-form-item>
+ <el-form-item label="批次级别:" >
+ <el-select
+ v-model="data.queryParams.level"
+ class="w100"
+ style="max-width: 180px"
+ clearable
+ size="default"
+ >
+ <el-option v-for="item in data.levelList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item >
+ <el-button
+ type="primary"
+ @click="getList"
+ >查询</el-button>
+ <el-button
+ type="primary"
+ plain
+ @click="reset"
+ >重置</el-button>
+ </el-form-item>
+ </el-form>
<span v-if="!data.isAdmin" style="font-size: 19px;font-weight: 600;margin-right: 20px">
{{data.companyName}},您的企业当前系统可用课时总计
<span style="font-size: 19px;font-weight: 600;color: #1ab394">{{data.remainPeriod}}</span> 分钟。<span @click="openDetail" style="cursor: pointer; font-size: 19px;font-weight: 600;color: #1890ff">[明细]</span>
@@ -26,8 +55,8 @@
<el-table-column label="课程" prop="courseName" align="center" />
<el-table-column label="学习人数" prop="studentCount" align="center" />
<el-table-column label="总课时" prop="coursePeriodNum" align="center" />
- <el-table-column label="已完成人数" prop="" align="center" />
- <el-table-column label="完成率" prop="" align="center" />
+ <el-table-column label="已完成人数" prop="finishCount" align="center" />
+ <el-table-column label="完成率" prop="finishRate" align="center" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template #default="scope">
<el-button link type="primary" @click="toStuChoose(scope.row)">学生数据</el-button>
@@ -67,6 +96,8 @@
const classHourRef = ref();
const data = reactive({
queryParams: {
+ name: '',
+ level: null,
pageNum: 1,
pageSize: 10,
},
@@ -74,7 +105,26 @@
dataList: [],
isAdmin: false,
companyName: '',
- remainPeriod: null
+ remainPeriod: null,
+ companyId: null,
+ levelList: [
+ {
+ id: 1,
+ name: '公司级 '
+ },
+ {
+ id: 2,
+ name: '部门级'
+ },
+ {
+ id: 3,
+ name: '车间级'
+ },
+ {
+ id: 4,
+ name: '其他'
+ },
+ ],
});
@@ -89,6 +139,7 @@
data.remainPeriod = userInfo.remainPeriod ? (userInfo.remainPeriod /60).toFixed(2).replace(/\.00$/, ''):''
data.isAdmin = false;
data.companyName = userInfo.companyName
+ data.companyId = userInfo.companyId
}
await getList()
})
@@ -103,7 +154,8 @@
data.dataList = res.data.list.map(item => {
return {
...item,
- coursePeriodNum: item.coursePeriod ? (item.coursePeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':''
+ coursePeriodNum: item.coursePeriod ? (item.coursePeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':'',
+ finishRate: item.finishCount ? item.finishCount ===0 && item.studentCount ===0 ? '0%': (item.finishCount / item.studentCount).toFixed(2) *100 + '%' : ''
}
})
data.total = res.data.total
@@ -119,7 +171,13 @@
/** 重置新增的表单以及其他数据 */
function reset() {
- proxy.resetForm("roleRef");
+ data.queryParams = {
+ name: '',
+ level: null,
+ pageNum: 1,
+ pageSize: 10,
+ }
+ getList()
}
const handleDelete = (val) => {
ElMessageBox.confirm(
@@ -146,6 +204,6 @@
}
const openDetail = () => {
- classHourRef.value.openDialog()
+ classHourRef.value.openDialog(data.companyId)
}
</script>
--
Gitblit v1.9.2