This commit is contained in:
ival 2021-03-19 17:14:22 +08:00
commit c2a9a73f28
3 changed files with 61 additions and 44 deletions

View File

@ -58,23 +58,16 @@
<div style="width: 100%;">
<div style="display: flex;flex-wrap:wrap;width: 100%;">
<div style="width: 50%;padding: 20px;">
<el-tag>学习时长</el-tag>
<el-table :data="learningTimeData" style="margin-top: 10px;" border>
<el-table-column prop="lessonIds" label="学习课程">
<template slot-scope="scope">
<template v-for="lessonId in scope.row.lessonIds">
<el-tag>{{ getLessonName(lessonId) }}</el-tag>
</template>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" />
<el-table-column prop="endTime" label="截止时间" />
<el-table-column prop="duration4FullMarks" label="学习时长" />
<el-table-column prop="weight" label="权重占比(%)" width="100" />
<el-tag>考勤</el-tag>
<el-table :data="attendanceData" style="margin-top: 10px;" border>
<el-table-column prop="startDate" label="开始日期" />
<el-table-column prop="endDate" label="截止日期" />
<el-table-column prop="days4FullMarks" label="考勤天数" />
<el-table-column prop="weight" label="权重占比(%)" />
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'learningTime')">编辑</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'learningTime')">删除</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'attendance')">编辑</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'attendance')">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -96,17 +89,24 @@
</el-table-column>
</el-table>
</div>
<div style="width: 50%;padding: 20px;">
<el-tag>考勤</el-tag>
<el-table :data="attendanceData" style="margin-top: 10px;" border>
<el-table-column prop="startDate" label="开始日期" />
<el-table-column prop="endDate" label="截止日期" />
<el-table-column prop="days4FullMarks" label="考勤天数" />
<el-table-column prop="weight" label="权重占比(%)" />
<div style="width: 100%;padding: 20px;">
<el-tag>学习时长</el-tag>
<el-table :data="learningTimeData" style="margin-top: 10px;" border>
<el-table-column prop="lessonIds" label="学习课程">
<template slot-scope="scope">
<template v-for="lessonId in scope.row.lessonIds">
<el-tag :key="lessonId">{{ getLessonName(lessonId) }}</el-tag>
</template>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" />
<el-table-column prop="endTime" label="截止时间" />
<el-table-column prop="duration4FullMarks" label="学习时长" />
<el-table-column prop="weight" label="权重占比(%)" width="100" />
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'attendance')">编辑</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'attendance')">删除</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="editUsual(scope.row,scope.$index, 'learningTime')">编辑</el-button>
<el-button :disabled="isDetail" type="text" size="small" @click="deleteUsual(scope.row, scope.$index, 'learningTime')">删除</el-button>
</template>
</el-table-column>
</el-table>

View File

@ -1,16 +1,14 @@
<template>
<div style="width: 100%;height: 100%">
<div style="display: flex; justify-content: space-between;width: 80%;margin: 0 auto;">
<QueryListPage
ref="ruleQueryListPage"
:query-form="ruleQueryForm"
:pager-config="pagerConfig"
:query-list="ruleQueryList"
style="width:90%;margin: 0 auto;"
/>
</div>
</div></template>
<QueryListPage
ref="ruleQueryListPage"
:query-form="ruleQueryForm"
:pager-config="pagerConfig"
:query-list="ruleQueryList"
style="width:90%;margin: 0 auto;"
/>
</div>
</template>
<script>
import { getClassListUnPageSelf, getRuleListSelfPaged, deleteRuleSelf } from '@/api/company';
export default {
@ -28,6 +26,13 @@ export default {
textAlign: 'right',
reset: true,
queryObject: {
orgId:{
type: 'select',
label: '班级:',
config: {
data: []
}
},
schoolYear: {
type: 'select',
label: '学年:',
@ -123,6 +128,9 @@ export default {
}
getClassListUnPageSelf().then(resp => {
this.classList = resp.data;
this.classList.forEach(item => {
this.ruleQueryForm.queryObject.orgId.config.data.push({ label: item.name, value: item.id });
});
});
},
methods: {

View File

@ -64,9 +64,18 @@
label="学号"
/>
<el-table-column
prop="finalScore"
label="评价结果"
prop="usualScore"
label="平时成绩"
/>
<el-table-column
prop="finalScore"
label="期末成绩"
/>
<el-table-column label="评价结果">
<template slot-scope="scope">
<span> {{ (scope.row.usualScore ||0) + ( scope.row.finalScore || 0 ) }} </span>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
@ -119,17 +128,17 @@ export default {
methods: {
exportGrade() {
const wb = XLSX.utils.book_new();
const data = [{A: '学号', B:'姓名', C: '评价结果'}];
const data = [{A: '学号', B:'姓名', C: '平时成绩', D: '期末成绩', E: '评价结果'}];
if (this.tableData && this.tableData.length) {
this.tableData.forEach(item => {
data.push({ A: item.account, B: item.username, C:item.finalScore });
data.push({ A: item.account, B: item.username, C:item.usualScore, D: item.finalScore, E: (item.usualScore || 0) + (item.finalScore || 0) });
});
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
ws['!cols'] = [
{width: 20},
{width: 20},
{width: 20}
];
// ws['!cols'] = [
// {width: 20},
// {width: 20},
// {width: 20}
// ];
XLSX.utils.book_append_sheet(wb, ws, 'file');
const classEle = this.classList.find(cla => { return cla.id == this.form.orgId; });
const className = classEle.name;