成绩管理联调

Branch_d40a2540
yujialong 1 year ago
parent 2f18b9e99c
commit 2ab291e7bd
  1. 8
      src/api/index.js
  2. 1
      src/layouts/navbar/index.vue
  3. 737
      src/pages/achievement/info/course.vue
  4. 142
      src/pages/achievement/info/project.vue
  5. 275
      src/pages/achievement/list/course.vue
  6. 438
      src/pages/achievement/list/index.vue
  7. 432
      src/pages/achievement/list/project.vue
  8. 8
      src/pages/product/list/index.vue
  9. 9
      src/router/modules/achivement.js
  10. 2
      src/setting.js
  11. 17
      src/store/modules/achievement.js

@ -112,8 +112,16 @@ export default {
exportBankExperimentReport: `occupationlab/occupationlab/achievement/exportBankExperimentReport`,
editExperimentalData: 'occupationlab/occupationlab/experimentalReport/editExperimentalData',
practiceActivity: 'occupationlab/occupationlab/achievement/practiceActivity',
practiceByProduct: `occupationlab/occupationlab/achievement/practiceByProduct`,
allClassesInOurSchool: `occupationlab/occupationlab/achievement/allClassesInOurSchool`,
productReadScore: `occupationlab/occupationlab/achievement/productReadScore`,
productReadGradeDetails: `occupationlab/occupationlab/achievement/productReadGradeDetails`,
exportAllActivity: `${host}occupationlab/occupationlab/achievement/exportAllData`,
exportActivity: `${host}occupationlab/occupationlab/achievement/exportDataInBatches`,
exportDetailsOfStudentPracticeScores: `${host}occupationlab/occupationlab/achievement/exportDetailsOfStudentPracticeScores`,
exportDetailsOfStudentAssessmentResults: `${host}occupationlab/occupationlab/achievement/exportDetailsOfStudentAssessmentResults`,
exportProductPracticeResults: `${host}occupationlab/occupationlab/achievement/exportProductPracticeResults`,
exportProductAssessResults: `${host}occupationlab/occupationlab/achievement/exportProductAssessResults`,
// 项目管理
getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统

@ -188,6 +188,7 @@ export default {
this.setTabsName('1')
this.setColumnId('')
this.$store.commit('match/setCache', null)
this.$store.commit('achievement/setRow', null)
if (path === '/screen') {
let arr = this.$route.path.split("/");
let name = `/${arr[1]}/list`

@ -0,0 +1,737 @@
<template>
<div>
<el-card shadow="hover"
class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="$router.back()"
:content="goodsName"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-tabs v-model="curTab"
@tab-click="tabChange">
<el-tab-pane v-for="(item) in tabs"
:label="item.name"
:name="item.id"
:key="item.id"></el-tab-pane>
</el-tabs>
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">实验总人数</p>
<p class="val">{{ peopleNum }}</p>
</div>
<div class="item item2">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
</div>
<div class="item item3">
<p class="name">实验最高分</p>
<p class="val">{{ maxScore }}</p>
</div>
<div class="item item4">
<p class="name">实验最低分</p>
<p class="val">{{ minScore }}</p>
</div>
</div>
<div class="chart"
id="chart"></div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<h6 style="font-size: 16px">错误率分析</h6>
<div class="wrong">
<div class="line">
<span class="jud-name">错误率最高{{ max.projectName }}</span>
<span>参加考试{{ max.itemErrorCount }}&emsp;&emsp;{{ permissions ? `${max.errorTotal}人做错,` : '' }}错误率{{ max.errorRate }}%</span>
</div>
<div class="line">
<span class="jud-name">错误率最低{{ min.projectName }}</span>
<span>参加考试{{ min.itemErrorCount }}&emsp;&emsp;{{ permissions ? `${min.errorTotal}人做错,` : '' }}错误率{{ min.errorRate }}%</span>
</div>
</div>
<div class="chart"
id="chart1"></div>
</el-card>
<el-card shadow="hover">
<div class="flex-between m-b-20">
<div>
<el-input placeholder="请输入姓名/学号"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</div>
<div>
<el-button type="primary"
@click="exportData">导出成绩列表</el-button>
<!-- <el-button type="primary"
@click="exportReport">导出成绩详情</el-button> -->
</div>
</div>
<el-table :data="listData"
class="table"
ref="table"
:key="curTab"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="reportId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="userName"
label="姓名"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="学号"
align="center"></el-table-column>
<template v-if="curTab == 0">
<el-table-column label="练习项目数"
align="center">
<template slot-scope="scope">
{{ scope.row.totalNumberOfPractices }}
</template>
</el-table-column>
<el-table-column prop="numberOfExercises"
label="练习次数"
width="90"
align="center"></el-table-column>
<el-table-column label="累计练习时长"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column prop="totalNumberOfParticipants"
label="参加考核次数"
align="center">
</el-table-column>
<el-table-column prop="averageTimeSpent"
label="平均用时"
align="center">
<template slot-scope="scope">
{{ scope.row.averageTimeSpent }}min
</template>
</el-table-column>
</template>
<el-table-column prop="avgScore"
label="平均分"
align="center">
<template slot-scope="scope">
{{ curTab == 0 ? scope.row.avgScore : scope.row.averageScore }}
</template>
</el-table-column>
<el-table-column prop="maxScore"
label="最高分"
align="center"></el-table-column>
<el-table-column prop="minScore"
label="最低分"
align="center"></el-table-column>
<el-table-column label="操作"
align="center"
width="140">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看成绩详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</el-card>
<el-dialog title="成绩详情"
:visible.sync="detailVisible"
width="900px"
:key="curTab"
:close-on-click-modal="false">
<div class="m-b-10 text-right">
<el-button type="primary"
@click="exportDetail">导出</el-button>
</div>
<el-table :data="details"
stripe
:key="curTab"
header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (pageDetail - 1) * pageSizeDetail + 1 }}
</template>
</el-table-column>
<el-table-column prop="userName"
label="姓名"
width="100"
align="center">
</el-table-column>
<el-table-column prop="workNumber"
label="学号"
width="100"
align="center"></el-table-column>
<template v-if="curTab == 0">
<el-table-column prop="projectName"
label="项目名称"
min-width="200"
align="center"></el-table-column>
<el-table-column prop="averageDuration"
label="平均练习时长"
width="110"
align="center">
<template slot-scope="scope">
{{ scope.row.averageDuration }}min
</template>
</el-table-column>
<el-table-column prop="averageScore"
label="平均分"
min-width="100"
align="center"></el-table-column>
</template>
<template v-else>
<el-table-column prop="experimentalName"
label="考核名称"
min-width="200"
align="center"></el-table-column>
<el-table-column prop="averageDuration"
label="用时"
width="100"
align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
</template>
</el-table-column>
<el-table-column prop="score"
label="分数"
min-width="100"
align="center"></el-table-column>
</template>
<el-table-column label="成绩报告"
align="center"
width="90">
<template slot-scope="scope">
<el-button type="text"
@click="toReport(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="totalDetail"
:page-size="pageSizeDetail"
@current-change="handleCurrentDetailChange"
:current-page="pageDetail">
</el-pagination>
</div>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="detailVisible = false">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data () {
return {
tabs: [
{
id: '0',
name: '练习成绩'
},
{
id: '1',
name: '考核成绩'
}
],
curTab: this.$route.query.permissions || '0',
permissions: +this.$route.query.permissions,
goodsName: this.$route.query.curriculumName,
accountId: this.$route.query.accountId,
id: +this.$route.query.id,
cid: +this.$route.query.cid,
keyword: "",
searchTimer: null,
listDataAll: [],
listData: [],
multipleSelection: [],
page: 1,
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0, //
maxScore: 0,
minScore: 0,
errorAnalysis: {},
max: {},
min: {},
token: util.local.get(Setting.tokenKey),
detailVisible: false,
details: [],
multipleSelectionActivation: [],
pageDetail: 1,
pageSizeDetail: 5,
totalDetail: 0,
curRow: {},
stageNumber: []
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
// this.getClass()
this.getData()
},
methods: {
//
async getData () {
const per = +this.curTab
const res = await this.$post(this.api.productReadScore, {
pageNum: this.page,
pageSize: 10000,
keyWord: this.keyword,
mallId: this.id,
cid: this.cid,
permissions: per
})
this.listDataAll = per ? res.listOfAssessmentResults.records : res.userScoreList.records
this.total = per ? res.listOfAssessmentResults.total : res.userScoreList.total
const stat = res.experimentalStatistics
this.avgScore = stat.averageScore
this.peopleNum = stat.experimentalPopulation
this.maxScore = stat.maxScore
this.minScore = stat.minScore
const err = per ? res.testErrorRateUnderProduct : res.projectErrorRateAnalysisUnderProduct
err.forEach(e => {
e.errorRate = (+e.errorRate).toFixed(2)
})
this.errorAnalysis = err
this.max = err[0]
this.min = err[err.length - 1]
const { row } = this.$store.state.achievement
row && this.$nextTick(() => {
window.scrollTo(0, document.documentElement.scrollHeight)
this.show(row)
this.$store.commit('achievement/setRow', null)
})
this.handlePage()
this.getChart()
this.errorChart()
},
initData () {
this.page = 1
this.getData()
},
//
handlePage () {
const list = this.listDataAll
this.listData = list.slice((this.page - 1) * this.pageSize, this.page * this.pageSize)
},
//
tabChange () {
this.$router.push({
path: 'course',
query: {
...this.$route.query,
permissions: this.curTab
}
})
this.initData()
},
// ()
async exportData () {
let list = this.multipleSelection
const practice = this.curTab == 0 //
//
if (!list.length) {
const res = await this.$post(this.api.productReadScore, {
pageNum: 1,
pageSize: 10000,
mallId: this.id,
cid: this.cid,
permissions: +this.curTab,
})
list = practice ? res.userScoreList.records : res.listOfAssessmentResults.records
}
list.forEach(e => {
e.goodsName = this.goodsName
e.cid = this.cid
})
axios.post(this.api[practice ? 'exportProductPracticeResults' : 'exportProductAssessResults'], list, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`${practice ? '练习' : '考核'}成绩列表.xlsx`, new Blob([res.data]))
}).catch(res => { })
},
//
exportReport () {
//
const list = this.multipleSelection.length ? this.multipleSelection : this.listDataAll
list.forEach(async e => {
const { report, userScores } = await this.$get(`${this.api.reportDetail}?reportId=${e.reportId}`)
userScores.map((e, i) => {
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
})
for (const i in report) {
if (report[i] && typeof report[i] === 'string') report[i] = report[i].replace(/<[^>]+>/g, '')
}
report.purpose = report.purpose.replace(/<[^>]+>/g, '')
this.$post(this.api[userScores.find(e => e.lcRuleRecords) ? 'exportBankExperimentReport' : 'exportLabReport'], {
...report,
experimentalData: userScores
}).then(res => {
util.downloadFileDirect(`${e.userName}的实验报告.docx`, new Blob([res]))
}).catch(res => { })
})
},
handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteExperimentalReport, [row.reportId]).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData () { //
if (this.multipleSelection.length) {
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
this.$post(this.api.deleteExperimentalReport, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.page = val
this.handlePage()
},
//
async show (row) {
this.curRow = row
this.detailVisible = true
this.initDetailData()
},
//
async getDetail () {
const { data } = await this.$post(this.api.productReadGradeDetails, {
pageNum: this.pageDetail,
pageSize: this.pageSizeDetail,
mallId: this.id,
permissions: +this.curTab,
studentAccountId: this.curRow.accountId
})
this.details = data.records
this.totalDetail = data.total
},
initDetailData () {
this.pageDetail = 1
this.getDetail()
},
//
handleCurrentDetailChange (val) {
this.pageDetail = val
this.getDetail()
},
//
async exportDetail () {
const practice = this.curTab == 0 //
if (this.details.length) {
const res = await axios.post(this.api[practice ? 'exportDetailsOfStudentPracticeScores' : 'exportDetailsOfStudentAssessmentResults'], {
pageNum: 1,
pageSize: 1000,
mallId: this.id,
permissions: +this.curTab,
studentAccountId: this.curRow.accountId,
goodsName: this.curriculumgoodsNameName
}, {
headers: {
token: this.token
},
responseType: 'blob'
})
util.downloadFileDirect(`${this.curRow.userName}_${practice ? '练习' : '考核'}成绩详情.xlsx`, new Blob([res.data]))
}
},
//
toReport (row) {
this.$store.commit('achievement/setRow', this.curRow)
//
this.$router.push(this.curTab == 1 ? `show?reportId=${row.reportId}` : `project?id=${row.projectId}&projectName=${row.goodsName}&classId=${this.curRow.classId || ''}&workNumber=${row.workNumber || row.userName}`)
},
getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0)
const list = this.listDataAll
const prop = this.curTab == 0 ? 'avgScore' : 'averageScore'
list.map(n => {
yData[n[prop]]++
})
return console.log(333, xData, yData)
const nums = this.stageNumber
for (const i in this.stageNumber) {
data.push(nums[i])
}
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
boundaryGap: false,
interval: 10,
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
},
yAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
interval: 1
},
series: [{
data,
type: "line",
areaStyle: {},
color: ["#8191fd"]
}]
});
},
//
errorChart () {
const data = this.errorAnalysis
const maxFontLength = data.length > 13 ? 6 : 10
const option = {
tooltip: {
trigger: 'axis',
},
grid: {
left: '5%',
right: '5%',
top: '10%',
bottom: '30%'
},
dataZoom: [//
{
// xAxisIndex: 0,//X0
show: true,
type: 'slider',
start: 0,
end: 150,
xAxisIndex: [0],
bottom: -10,
}
],
xAxis: [{
type: 'category',
axisLine: {
lineStyle: {
color: '#57617B'
}
},
axisLabel: {
interval: 0,
textStyle: {
color: '#333',
},
formatter: function (value, index) {
value = value.substring(0, maxFontLength) + (value.length > maxFontLength ? '...' : '')
// if (index % 2 != 0) {
// return '\n\n' + value;
// } else {
// return value;
// }
return value
}
// rotate: 45
},
data: data.map(e => e.projectName)
}],
yAxis: [
{
type: 'value',
name: '错误率',
nameGap: 10,
axisLine: {
lineStyle: {
color: '#333'
}
},
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12,
color: '#333'
},
formatter: '{value}%'
},
}
],
series: [{
name: '错误率',
type: 'bar',
barWidth: 25,
axisLabel: {
margin: 10,
textStyle: {
fontSize: 12,
color: '#333'
},
formatter: '{value}%'
},
itemStyle: {
normal: {
barBorderRadius: [10, 10, 0, 0],
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
offset: 0,
color: "#009AFD"
}, {
offset: 0.8,
color: "#33DAFF"
}], false),
shadowColor: 'rgba(0, 0, 0, 0.1)',
}
},
data: data.map(e => e.errorRate)
}
]
}
echarts.init(document.querySelector(`#chart1`)).setOption(option)
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .head-card {
.el-card__body {
padding-bottom: 0px;
.el-tabs__header {
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__item {
font-size: 18px;
}
}
}
}
.chart {
height: 300px;
}
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
flex-wrap: wrap;
width: 640px;
margin-right: 20px;
.item {
width: 300px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background: url('../../../assets/img/total.png') 0 0/100% 100% no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item:nth-child(3) {
background-image: url('../../../assets/img/ach1.png');
}
.item:nth-child(4) {
background-image: url('../../../assets/img/ach2.png');
}
}
.chart {
width: calc(100% - 660px);
}
}
.wrong {
.line {
display: flex;
width: 920px;
margin: 0 auto 10px;
.jud-name {
width: 500px;
margin-right: 100px;
}
}
}
</style>

@ -5,19 +5,28 @@
<div class="flex-between m-b-20">
<el-page-header @back="$router.back()"
:content="experimentalName"></el-page-header>
<div>
<span class="m-r-10">班级</span>
<el-select v-model="classId"
clearable
@change="initData">
<el-option label="不限"
value="">
</el-option>
<el-option v-for="item in classes"
:key="item.id"
:label="item.className"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-tabs v-model="activeName"
@tab-click="handleClick">
<el-tab-pane v-for="(item) in classList"
:label="item.className"
:name="item.id"
:key="item.id"></el-tab-pane>
</el-tabs>
<div class="stat">
<div class="nums">
<div class="item">
@ -59,19 +68,25 @@
id="chart1"></div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between m-b-20">
<el-card shadow="hover">
<div class="flex-between m-b-10">
<div>
<el-tabs v-model="curTab"
@tab-click="tabChange">
@tab-click="initData">
<el-tab-pane v-for="(item) in tabs"
:label="item.name"
:name="item.id"
:key="item.id"></el-tab-pane>
</el-tabs>
</div>
</div>
<div class="flex-between m-b-20">
<div>
<el-input placeholder="请输入班级/姓名/学号"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</div>
<div v-if="curTab == 0">
<el-button type="primary"
@click="delAllData">批量删除</el-button>
@ -257,12 +272,12 @@ import axios from 'axios';
export default {
data () {
return {
activeName: "", //
classId: "", // id
classList: [], //
permissions: Number(this.$route.query.permissions),
classId: +this.$route.query.classId || '', // id
classes: [], //
permissions: +this.$route.query.permissions,
experimentalName: this.$route.query.projectName,
id: this.$route.query.id,
workNumber: this.$route.query.workNumber,
keyword: "",
searchTimer: null,
listDataAll: [],
@ -302,46 +317,32 @@ export default {
}
},
mounted () {
//
this.permissions ?
this.getSpliceClass() :
this.tabs.push({
this.permissions || this.tabs.push({
id: '1',
name: '活跃度'
})
this.getData()
},
methods: {
handleClick (tab, event) { //
if (this.classId === tab.name) return;
this.classId = tab.name;
sessionStorage.setItem('activeName', tab.name)
this.getData();
},
//
getSpliceClass () {
this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`).then(res => {
this.classList = res.list
const activeName = sessionStorage.getItem('activeName')
if (activeName && this.classList.some(item => item.id === activeName)) {
this.classId = activeName
this.activeName = activeName
this.getClass()
if (this.workNumber) {
this.keyword = this.workNumber
window.scrollTo(0, document.documentElement.scrollHeight)
} else {
this.classId = this.classList[0].id;
this.activeName = this.classList[0].id;
this.getData()
}
}).catch(err => { })
},
// tab
tabChange () {
this.curTab == 1 && this.getActivity()
},
//
methods: {
//
async getClass () {
const { list } = this.permissions ?
await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) :
await this.$post(this.api.myClass)
this.classes = list
},
//
async getData () {
//
const res = this.permissions ?
await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}`) :
await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyword=${this.keyword}`)
await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`)
this.listDataAll = res.page.records
this.total = res.page.total
this.avgScore = (+res.avgScore).toFixed(2)
@ -358,14 +359,14 @@ export default {
//
async getActivity () {
//
const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}`)
const { message } = await this.$post(`${this.api.practiceActivity}?pageNum=${this.pageActivation}&pageSize=${this.pageSizeActivation}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}`)
this.activations = message.records
this.totalActivation = message.total
},
initData () {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
this.page = 1
this.pageActivation = 1
this.curTab == 0 ? this.getData() : this.getActivity()
},
//
handlePage () {
@ -374,6 +375,7 @@ export default {
},
//
show (row) {
this.$store.commit('achievement/setRow', null)
this.$router.push(`show?reportId=${row.reportId}`)
},
// ()
@ -491,34 +493,13 @@ export default {
util.downloadFileDirect(`活跃度.xls`, new Blob([res.data]))
},
getChart () { // 线
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0)
const list = this.listDataAll
list.map(n => {
n.score;
if (n.score === 0) {
data[0]++;
} else if (n.score > 0 && n.score <= 10) {
data[1]++;
} else if (n.score > 10 && n.score <= 20) {
data[2]++;
} else if (n.score > 20 && n.score <= 30) {
data[3]++;
} else if (n.score > 30 && n.score <= 40) {
data[4]++;
} else if (n.score > 40 && n.score <= 50) {
data[5]++;
} else if (n.score > 50 && n.score <= 60) {
data[6]++;
} else if (n.score > 60 && n.score <= 70) {
data[7]++;
} else if (n.score > 70 && n.score <= 80) {
data[8]++;
} else if (n.score > 80 && n.score <= 90) {
data[9]++;
} else if (n.score > 90 && n.score <= 100) {
data[10]++;
}
yData[n.score]++
})
console.log(333, xData, yData)
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
@ -527,16 +508,19 @@ export default {
name: "分数",
type: "category",
boundaryGap: false,
interval: 10,
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
interval: 5,
axisLabel: {
interval: 9,
},
data: xData
},
yAxis: {
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
interval: 1
interval: 5
},
series: [{
data,
data: yData,
type: "line",
areaStyle: {},
color: ["#8191fd"]

@ -0,0 +1,275 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>课程</label>
<el-select v-model="mallId"
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item, i) in curs"
:key="i"
:label="item.curriculumName"
:value="item.mallId"
@change="curChange"></el-option>
</el-select>
</li>
<li>
<label>班级</label>
<el-select v-model="classId"
@change="classChange">
<el-option label="不限"
value=""></el-option>
<el-option v-for="item in classList"
:key="item.id"
:label="item.className"
:value="item.id">
</el-option>
</el-select>
</li>
</ul>
</div>
<el-table :data="list"
class="table"
ref="table"
stripe
header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="curriculumName"
label="课程"
align="center"
min-width="200"></el-table-column>
<el-table-column prop="className"
label="班级"
align="center"
min-width="130"></el-table-column>
<el-table-column prop="numberOfPracticeItems"
label="练习项目数"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="numberOfAssessmentItems"
label="考核项目数"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="classSize"
label="班级人数"
align="center"
min-width="100"></el-table-column>
<el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-button v-auth="'练习成绩管理'"
type="text"
@click="entry(scope.row)">成绩管理</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui";
import util from "@/libs/util";
export default {
data () {
return {
classId: this.$route.query.class ? +this.$route.query.class : '',
classList: [],
mallId: this.$route.query.mallId ? +this.$route.query.mallId : '',
curriculumList: [],
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0,
mallIds: [],
curs: [],
keyword: "",
searchTimer: null,
startingtime: "",
endTime: "",
month: "",
list: [],
multipleSelection: [],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 6,
name: "近六个月"
}
],
projectType: [
{
id: 0,
name: "练习"
}, {
id: 1,
name: "考核"
}
],
date: "",
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loadIns: null
};
},
watch: {
month: function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
},
date: function (val) {
if (val) {
this.startingtime = val[0];
this.endTime = val[1];
} else {
this.startingtime = "";
this.endTime = "";
this.month = '';
}
this.initData();
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getClassData()
this.getCourse()
},
methods: {
//
async getCourse () {
const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curs = data
this.initData();
},
//
curChange (id) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
mallId: id
}
})
this.initData()
},
getClassData () { //
this.$post(this.api.allClassesInOurSchool).then(res => {
this.classList = res.data
}).catch(res => { })
},
getData () {
this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)"
});
this.$post(this.api.practiceByProduct, {
classId: this.classId,
mallId: this.mallId,
keyWord: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
}).then(res => {
this.list = res.data
this.total = res.total
this.$nextTick(() => {
this.loadIns.close()
});
}).catch(res => {
this.loadIns.close()
});
},
//
perChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
per: val
}
})
this.getData()
},
//
classChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
class: val
}
})
this.getData()
},
//
curriculumChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
curriculum: val
}
})
this.getData()
},
initData () {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
//
entry (row) {
this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}`)
},
handleCurrentChange (val) { //
this.page = val
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData();
}
}
};
</script>
<style lang="scss" scoped>
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.el-radio-group {
white-space: nowrap;
}
</style>

@ -1,431 +1,69 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li v-if="projectPermissions">
<label>时间</label>
<el-radio-group v-model="month"
@change="initData">
<el-radio v-for="(item,index) in dateList"
<div class="tabs">
<a class="item"
v-for="(item,index) in tabs"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
<el-date-picker v-model="date"
@blur='pickerInput'
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
style="width: 300px">
</el-date-picker>
</li>
<li>
<label>实验项目分类</label>
<el-radio-group v-model="projectPermissions"
@change="perChange">
<el-radio v-for="(item,index) in projectType"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
</li>
<li v-show="projectPermissions === 1">
<label>班级</label>
<el-select v-model="classId"
@change="classChange">
<el-option v-for="item in classList"
:key="item.id"
:label="item.className"
:value="item.id">
</el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="mallId"
@change="initData">
<el-option v-for="(item, i) in curs"
:key="i"
:label="item.curriculumName"
:value="item.mallId"
@change="curChange"></el-option>
</el-select>
</li>
<li>
<el-input placeholder="请输入考核或项目名称"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter"></ul>
<div style="margin-bottom: 24px">
<el-button v-auth
type="primary"
@click="delAllData">批量删除</el-button>
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div>
</div>
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<template v-if="projectPermissions == 1">
<el-table-column prop="className"
label="班级"
align="center"
width="140"></el-table-column>
<el-table-column prop="experimentalName"
label="考核名称"
align="center">
<template slot-scope="scope">
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span>
</template>
</el-table-column>
</template>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="projectPermissions"
label="分类"
align="center"
width="100">
<template slot-scope="scope">
{{ projectPermissions ? '考核' : '练习' }}
</template>
</el-table-column>
<el-table-column prop="experimentalNumber"
label="成绩报告数量"
align="center"
:width="projectPermissions ? 120 : 230"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"
:width="projectPermissions ? 160 : 230">
</el-table-column>
<el-table-column label="操作"
align="center"
:width="projectPermissions ? 150 : 230">
<template slot-scope="scope">
<el-button v-auth="'练习成绩管理'"
type="text"
@click="entry(scope.row)">成绩管理</el-button>
<el-button v-auth
type="text"
v-if="scope.row.canDel"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth
type="text"
v-else
style='color:#999'>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"></el-pagination>
<div class="page-content">
<Course v-if="active == 'tab1'" />
<Project v-if="active == 'tab2'" />
</div>
</div>
</template>
<script>
import { Loading } from "element-ui";
import util from "@/libs/util";
import Setting from "@/setting";
import { mapState } from "vuex";
import Course from "./course";
import Project from "./project";
export default {
name: "achievement",
name: "course",
components: {
Course,
Project
},
data () {
return {
classId: this.$route.query.class ? +this.$route.query.class : '',
classList: [],
mallId: this.$route.query.mallId ? +this.$route.query.mallId : '',
curriculumList: [],
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0,
mallIds: [],
curs: [],
keyword: "",
searchTimer: null,
startingtime: "",
endTime: "",
month: "",
listData: [],
multipleSelection: [],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 6,
name: "近六个月"
}
],
projectType: [
{
id: 0,
name: "练习"
}, {
id: 1,
name: "考核"
}
],
date: "",
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loadIns: null
};
},
watch: {
month: function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
active: this.$route.query.tab || "tab1", //
tabs: {
tab1: '课程维度',
tab2: '项目维度',
// tab3: '',
},
date: function (val) {
if (val) {
this.startingtime = val[0];
this.endTime = val[1];
} else {
this.startingtime = "";
this.endTime = "";
this.month = '';
}
this.initData();
};
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
computed: {
...mapState("auth", [
"btns"
])
},
mounted () {
this.getClassData()
this.getCourse()
// Setting.dynamicRoute && this.initTabs();
},
methods: {
pickerInput () {
this.month = '6'
},
//
async getCourse () {
const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curs = data
this.mallId = this.mallId || data[0].mallId
this.initData();
},
//
curChange (id) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
mallId: id
}
})
this.initData()
},
getClassData () { //
this.$post(this.api.myClass).then(res => {
this.classList = res.list;
}).catch(res => {
});
},
getData () {
this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)"
});
const per = this.projectPermissions
const { mallId } = this
const cur = this.curs.find(e => e.mallId == mallId) || {}
let data = {
classId: this.classId,
permissions: per,
curriculumId: cur.cid,
mallId,
keyWord: this.keyword,
startTime: this.startingtime,
endTime: this.endTime,
month: this.month,
pageNum: this.page,
pageSize: this.pageSize,
systemId: cur.systemId
};
this.$post(this.api.getAchievementInfo, data).then(res => {
let list = []
if (per == 0) {
list = res.page
this.total = res.total
} else {
list = res.page.records
this.total = res.page.total
}
console.log(33, per)
list.map(e => {
// isAdmin1 isdel=1courseDel=1 (1. 2.3)isAdmin0isDel1
e.canDel = per ?
e.isDel :
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1)
})
this.listData = list
this.$nextTick(() => {
this.loadIns.close()
});
}).catch(res => {
this.loadIns.close()
});
},
//
perChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
per: val
}
})
this.getData()
},
//
classChange (val) {
tabChange (i) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
class: val
tab: i
}
})
this.getData()
this.active = i
},
//
curriculumChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
curriculum: val
}
})
this.getData()
},
initData () {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
disabledSelection (row, index) { //
if (row.canDel) return true
return false
},
//
entry (row) {
this.$router.push(`teach?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}`)
},
handleDelete (row) { //
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let url = "";
if (this.projectPermissions === 0) {
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
} else {
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
}
this.$get(url).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData () { //
if (this.multipleSelection.length) {
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let url = "";
let ids = [];
ids = this.multipleSelection.map(item => item.assessmentId);
let projectIds = [];
projectIds = this.multipleSelection.map(item => item.projectId);
if (this.projectPermissions === 0) {
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
} else {
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
}
this.$get(url).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
if (this.multipleSelection.length === this.listData.length && this.pageNum > 1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.page = val
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData();
initTabs () {
const { btns } = this
const tab1 = btns.includes('/course/list:课程管理')
const tab2 = btns.includes('/course/list:分类管理')
tab1 || delete this.tabs.first
tab2 || delete this.tabs.second
}
}
};
</script>
<style lang="scss" scoped>
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.el-radio-group {
white-space: nowrap;
}
</style>

@ -0,0 +1,432 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li v-if="projectPermissions">
<label>时间</label>
<el-radio-group v-model="month"
@change="initData">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
<el-date-picker v-model="date"
@blur='pickerInput'
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable
style="width: 300px">
</el-date-picker>
</li>
<li>
<label>实验项目分类</label>
<el-radio-group v-model="projectPermissions"
@change="perChange">
<el-radio v-for="(item,index) in projectType"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group>
</li>
<li v-show="projectPermissions === 1">
<label>班级</label>
<el-select v-model="classId"
@change="classChange">
<el-option v-for="item in classList"
:key="item.id"
:label="item.className"
:value="item.id">
</el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="mallId"
@change="initData">
<el-option v-for="(item, i) in curs"
:key="i"
:label="item.curriculumName"
:value="item.mallId"
@change="curChange"></el-option>
</el-select>
</li>
<li>
<el-input placeholder="请输入考核或项目名称"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter"></ul>
<div style="margin-bottom: 24px">
<el-button v-auth
type="primary"
@click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<template v-if="projectPermissions == 1">
<el-table-column prop="className"
label="班级"
align="center"
min-width="140"></el-table-column>
<el-table-column prop="experimentalName"
label="考核名称"
align="center"
min-width="180">
<template slot-scope="scope">
<span class="mul-ellipsis2">{{ scope.row.experimentalName }}</span>
</template>
</el-table-column>
</template>
<el-table-column prop="projectName"
label="项目名称"
align="center"
min-width="180"></el-table-column>
<el-table-column prop="projectPermissions"
label="分类"
align="center"
width="100">
<template slot-scope="scope">
{{ projectPermissions ? '考核' : '练习' }}
</template>
</el-table-column>
<el-table-column prop="experimentalNumber"
label="成绩报告数量"
align="center"
:width="projectPermissions ? 120 : 230"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"
:width="projectPermissions ? 160 : 230">
</el-table-column>
<el-table-column label="操作"
align="center"
:width="projectPermissions ? 150 : 230">
<template slot-scope="scope">
<el-button v-auth="'练习成绩管理'"
type="text"
@click="entry(scope.row)">成绩管理</el-button>
<el-button v-auth
type="text"
v-if="scope.row.canDel"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth
type="text"
v-else
style='color:#999'>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui";
import util from "@/libs/util";
export default {
name: "achievement",
data () {
return {
classId: this.$route.query.class ? +this.$route.query.class : '',
classList: [],
mallId: this.$route.query.mallId ? +this.$route.query.mallId : '',
curriculumList: [],
projectPermissions: this.$route.query.per ? +this.$route.query.per : 0,
mallIds: [],
curs: [],
keyword: "",
searchTimer: null,
startingtime: "",
endTime: "",
month: "",
listData: [],
multipleSelection: [],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 6,
name: "近六个月"
}
],
projectType: [
{
id: 0,
name: "练习"
}, {
id: 1,
name: "考核"
}
],
date: "",
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loadIns: null
};
},
watch: {
month: function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
},
date: function (val) {
if (val) {
this.startingtime = val[0];
this.endTime = val[1];
} else {
this.startingtime = "";
this.endTime = "";
this.month = '';
}
this.initData();
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getClassData()
this.getCourse()
},
methods: {
pickerInput () {
this.month = '6'
},
//
async getCourse () {
const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curs = data
this.mallId = this.mallId || data[0].mallId
this.initData();
},
//
curChange (id) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
mallId: id
}
})
this.initData()
},
getClassData () { //
this.$post(this.api.myClass).then(res => {
this.classList = res.list;
}).catch(res => { })
},
getData () {
this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)"
});
const per = this.projectPermissions
const { mallId } = this
const cur = this.curs.find(e => e.mallId == mallId) || {}
let data = {
classId: this.classId,
permissions: per,
curriculumId: cur.cid,
mallId,
keyWord: this.keyword,
startTime: this.startingtime,
endTime: this.endTime,
month: this.month,
pageNum: this.page,
pageSize: this.pageSize,
systemId: cur.systemId
};
this.$post(this.api.getAchievementInfo, data).then(res => {
let list = []
if (per == 0) {
list = res.page
this.total = res.total
} else {
list = res.page.records
this.total = res.page.total
}
console.log(33, per)
list.map(e => {
// isAdmin1 isdel=1courseDel=1 (1. 2.3)isAdmin0isDel1
e.canDel = per ?
e.isDel :
(e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1)
})
this.listData = list
this.$nextTick(() => {
this.loadIns.close()
});
}).catch(res => {
this.loadIns.close()
});
},
//
perChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
per: val
}
})
this.getData()
},
//
classChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
class: val
}
})
this.getData()
},
//
curriculumChange (val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
curriculum: val
}
})
this.getData()
},
initData () {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
disabledSelection (row, index) { //
if (row.canDel) return true
return false
},
//
entry (row) {
this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}`)
},
handleDelete (row) { //
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let url = "";
if (this.projectPermissions === 0) {
url = `${this.api.deleteReportById}?ids=&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
} else {
url = `${this.api.deleteReportById}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`;
}
this.$get(url).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData () { //
if (this.multipleSelection.length) {
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning"
}).then(() => {
let url = "";
let ids = [];
ids = this.multipleSelection.map(item => item.assessmentId);
let projectIds = [];
projectIds = this.multipleSelection.map(item => item.projectId);
if (this.projectPermissions === 0) {
url = `${this.api.deleteReportById}?ids=&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
} else {
url = `${this.api.deleteReportById}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
}
this.$get(url).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
if (this.multipleSelection.length === this.listData.length && this.pageNum > 1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.page = val
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData();
}
}
};
</script>
<style lang="scss" scoped>
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
.el-radio-group {
white-space: nowrap;
}
</style>

@ -49,9 +49,11 @@
<div class="filter">
<dl v-if="curTab == 1">
<dt>学科专业</dt>
<div class="vals">
<dd :class="{active: categoryId === ''}"
@click="catetoryClick('')">全部</dd>
<dd :class="{active: categoryId === 1}"
style="margin-right: 20px"
@click="catetoryClick(1)">不限</dd>
<div v-for="(item, i) in category"
:key="i"
@ -67,6 +69,7 @@
placeholder=""
@change="id => categoryChange(id, item)"></el-cascader>
</div>
</div>
</dl>
<dl v-if="curTab == 3">
<dt>产品标签</dt>
@ -378,7 +381,7 @@ export default {
async getSubject () {
//
this.$get(this.api.courseDiscipline).then(({ list }) => {
list = list.filter(e => e.level > 1).slice(1)
list = list.filter(e => e.level > 1).slice(1) // level>1
const result = []
const promises = []
list.map((e, i) => {
@ -680,7 +683,7 @@ export default {
color: #333;
cursor: pointer;
& + .el-cascader {
width: 50px;
width: 30px;
}
}
}
@ -703,6 +706,7 @@ export default {
.vals {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
width: 920px;
}
.caret {

@ -19,9 +19,12 @@ export default {
component: () => import("@/pages/achievement/list"),
meta: { title: "成绩管理" }
}, {
name: `${pre}teach`,
path: `teach`,
component: () => import("@/pages/achievement/teach"),
path: `course`,
component: () => import("@/pages/achievement/info/course"),
meta: { title: "成绩管理" }
}, {
path: `project`,
component: () => import("@/pages/achievement/info/project"),
meta: { title: "成绩管理" }
}, {
name: `${pre}show`,

@ -26,7 +26,7 @@ if (isPro) {
uploadURL = `http://121.37.12.51/`
host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服
host = "http://192.168.31.152:9000/"; // 榕
// host = "http://192.168.31.217:9000/"; // 榕
// host = 'http://192.168.31.51:9000/'; // 赓
}

@ -0,0 +1,17 @@
/**
* 赛事相关
* */
export default {
namespaced: true,
state: {
row: null,
},
mutations: {
setRow: (state, row) => {
state.row = row
},
},
actions: {
}
};
Loading…
Cancel
Save