From 55cc4c8bbbd66ce4b33fff8712d4c53e2080b5a0 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期一, 22 七月 2024 16:25:25 +0800 Subject: [PATCH] 提交 --- src/views/onlineEducation/classHourBatch/index.vue | 80 ++++++++++++++++++++++++++++++++++------ 1 files changed, 68 insertions(+), 12 deletions(-) diff --git a/src/views/onlineEducation/classHourBatch/index.vue b/src/views/onlineEducation/classHourBatch/index.vue index 13380d4..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, }, @@ -75,7 +106,25 @@ isAdmin: false, companyName: '', remainPeriod: null, - companyId: null + companyId: null, + levelList: [ + { + id: 1, + name: '公司级 ' + }, + { + id: 2, + name: '部门级' + }, + { + id: 3, + name: '车间级' + }, + { + id: 4, + name: '其他' + }, + ], }); @@ -105,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 @@ -121,7 +171,13 @@ /** 重置新增的表单以及其他数据 */ function reset() { - proxy.resetForm("roleRef"); + data.queryParams = { + name: '', + level: null, + pageNum: 1, + pageSize: 10, + } + getList() } const handleDelete = (val) => { ElMessageBox.confirm( -- Gitblit v1.9.2