Compare commits
52 Commits
@ -1,6 +1,6 @@ |
||||
{ |
||||
"tabWidth": 4, |
||||
"singleQuote": true, |
||||
"trailingComma": "none", |
||||
"printWidth": 140 |
||||
"tabWidth": 2, |
||||
"singleQuote": true, |
||||
"trailingComma": "none", |
||||
"printWidth": 140 |
||||
} |
@ -1,30 +1,52 @@ |
||||
<template> |
||||
<div id="app"> |
||||
<router-view></router-view> |
||||
</div> |
||||
<div id="app"> |
||||
<el-radio-group v-if="Setting.isDev" class="ip" v-model="ip" @change="ipChange"> |
||||
<el-radio :label="0">刘榕ip</el-radio> |
||||
<el-radio :label="1">陈赓ip</el-radio> |
||||
<el-radio :label="2">测试服ip</el-radio> |
||||
</el-radio-group> |
||||
<router-view></router-view> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'App', |
||||
created () { |
||||
//在页面加载时读取sessionStorage里的状态信息 |
||||
if (sessionStorage.getItem("store") ) { |
||||
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store")))) |
||||
} |
||||
|
||||
//在页面刷新时将vuex里的信息保存到sessionStorage里 |
||||
window.addEventListener("beforeunload",()=>{ |
||||
sessionStorage.getItem("token") && sessionStorage.setItem("store",JSON.stringify(this.$store.state)) |
||||
}) |
||||
import Setting from '@/setting' |
||||
export default { |
||||
name: 'App', |
||||
data () { |
||||
return { |
||||
Setting, |
||||
ip: localStorage.getItem('ip') ? +localStorage.getItem('ip') : 0, |
||||
}; |
||||
}, |
||||
created () { |
||||
window.exitSystem = () => { |
||||
sessionStorage.removeItem('token') |
||||
location.reload() |
||||
} |
||||
//在页面加载时读取sessionStorage里的状态信息 |
||||
if (sessionStorage.getItem("store")) { |
||||
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store")))) |
||||
} |
||||
|
||||
//在页面刷新时将vuex里的信息保存到sessionStorage里 |
||||
window.addEventListener("beforeunload", () => { |
||||
sessionStorage.getItem("token") && sessionStorage.setItem("store", JSON.stringify(this.$store.state)) |
||||
}) |
||||
}, |
||||
methods: { |
||||
ipChange (val) { |
||||
localStorage.setItem('ip', val) |
||||
location.reload() |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
@import "./assets/css/main.css"; |
||||
/* @import "./assets/css/color-dark.css"; */ |
||||
/*深色主题*/ |
||||
@import "./assets/css/theme-green/color-green.css"; |
||||
/* 浅绿色主题 */ |
||||
@import "./assets/css/main.css"; |
||||
/* @import "./assets/css/color-dark.css"; */ |
||||
/*深色主题*/ |
||||
@import "./assets/css/theme-green/color-green.css"; |
||||
/* 浅绿色主题 */ |
||||
</style> |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 593 B |
After Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 545 B |
After Width: | Height: | Size: 768 B |
@ -0,0 +1,50 @@ |
||||
export default { |
||||
difficults: [ |
||||
{ |
||||
id: 'basic', |
||||
name: '基础', |
||||
coefficient: 0.2, // 难度系数,试卷里计算试卷难度专用
|
||||
theme: 'success', |
||||
}, |
||||
{ |
||||
id: 'easy', |
||||
name: '普通', |
||||
coefficient: 0.4, |
||||
theme: '', |
||||
}, |
||||
{ |
||||
id: 'medium', |
||||
name: '较难', |
||||
coefficient: 0.6, |
||||
theme: 'warning', |
||||
}, |
||||
{ |
||||
id: 'hard', |
||||
name: '难', |
||||
coefficient: 0.8, |
||||
theme: 'danger', |
||||
}, |
||||
], |
||||
questionTypes: [ |
||||
{ |
||||
id: 'single_choice', |
||||
name: '单选题' |
||||
}, |
||||
{ |
||||
id: 'multiple_choice', |
||||
name: '多选题' |
||||
}, |
||||
{ |
||||
id: 'judgement', |
||||
name: '判断题' |
||||
}, |
||||
{ |
||||
id: 'fill_blank', |
||||
name: '填空题' |
||||
}, |
||||
{ |
||||
id: 'essay', |
||||
name: '问答题' |
||||
}, |
||||
], |
||||
} |
@ -0,0 +1,34 @@ |
||||
export default { |
||||
difficults: [ |
||||
{ |
||||
id: 1, |
||||
name: '简单' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '普通' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '较难' |
||||
}, |
||||
{ |
||||
id: 4, |
||||
name: '难' |
||||
}, |
||||
], |
||||
paperTypes: [ |
||||
{ |
||||
id: 0, |
||||
name: '练习' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '考核' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '竞赛' |
||||
}, |
||||
], |
||||
} |
@ -1,45 +1,45 @@ |
||||
const util = { |
||||
deepCopy(obj) { // 深拷贝
|
||||
if (obj == null) { |
||||
return null; |
||||
} |
||||
if (typeof obj !== "object") return obj; |
||||
let result; |
||||
if (Array.isArray(obj)) { |
||||
result = []; |
||||
obj.forEach(item => { |
||||
result.push( |
||||
typeof item === "object" && !(item instanceof Date) |
||||
? util.deepCopy(item) |
||||
: item |
||||
); |
||||
}); |
||||
} else { |
||||
result = {}; |
||||
Object.keys(obj).forEach(key => { |
||||
result[key] = |
||||
typeof obj[key] === "object" && !(obj[key] instanceof Date) |
||||
? util.deepCopy(obj[key]) |
||||
: obj[key]; |
||||
}); |
||||
} |
||||
return result; |
||||
}, |
||||
// 传入文件名和数据,下载文件
|
||||
downloadFileDirect(fileName,data) { |
||||
if ('download' in document.createElement('a')) { // 非IE下载
|
||||
const elink = document.createElement('a') |
||||
elink.download = fileName |
||||
elink.style.display = 'none' |
||||
elink.href = URL.createObjectURL(data) |
||||
document.body.appendChild(elink) |
||||
elink.click() |
||||
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||
document.body.removeChild(elink) |
||||
} else { // IE10+下载
|
||||
navigator.msSaveBlob(data, fileName) |
||||
} |
||||
}, |
||||
deepCopy (obj) { // 深拷贝
|
||||
if (obj == null) { |
||||
return null; |
||||
} |
||||
if (typeof obj !== "object") return obj; |
||||
let result; |
||||
if (Array.isArray(obj)) { |
||||
result = []; |
||||
obj.forEach(item => { |
||||
result.push( |
||||
typeof item === "object" && !(item instanceof Date) |
||||
? util.deepCopy(item) |
||||
: item |
||||
); |
||||
}); |
||||
} else { |
||||
result = {}; |
||||
Object.keys(obj).forEach(key => { |
||||
result[key] = |
||||
typeof obj[key] === "object" && !(obj[key] instanceof Date) |
||||
? util.deepCopy(obj[key]) |
||||
: obj[key]; |
||||
}); |
||||
} |
||||
return result; |
||||
}, |
||||
// 传入文件名和数据,下载文件
|
||||
downloadFileDirect (fileName, data) { |
||||
if ('download' in document.createElement('a')) { // 非IE下载
|
||||
const elink = document.createElement('a') |
||||
elink.download = fileName |
||||
elink.style.display = 'none' |
||||
elink.href = URL.createObjectURL(data) |
||||
document.body.appendChild(elink) |
||||
elink.click() |
||||
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||
document.body.removeChild(elink) |
||||
} else { // IE10+下载
|
||||
navigator.msSaveBlob(data, fileName) |
||||
} |
||||
}, |
||||
}; |
||||
|
||||
export default util; |
@ -0,0 +1,211 @@ |
||||
<template> |
||||
<!-- 理论考试选择试卷 --> |
||||
<div> |
||||
<el-dialog title="请选择试卷" :visible.sync="listVisible" width="1200px" :close-on-click-modal="false" |
||||
@closed="closeDia"> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>试卷库</label> |
||||
<el-select v-model="filter.libraryId" placeholder="请选择试卷库" @change="initData"> |
||||
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId"> |
||||
</el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>建议用途</label> |
||||
<el-select v-model="filter.paperType" clearable placeholder="请选择状态" @change="initData"> |
||||
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>试卷难度</label> |
||||
<el-select v-model="filter.difficult" clearable multiple placeholder="请选择试卷难度" @change="initData"> |
||||
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>题目类型</label> |
||||
<el-select v-model="questionType" clearable multiple placeholder="请选择题目类型" @change="initData"> |
||||
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>搜索</label> |
||||
<el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model="filter.keyWord" |
||||
clearable /> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<!-- <el-button type="primary" @click="add">自定义理论试卷</el-button> --> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table :data="papers" class="table" stripe header-align="center" @sort-change="sortChange"> |
||||
<el-table-column width="60" label="选择" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-radio v-model="form.paperId" :label="scope.row.paperId"> </el-radio> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="试卷名称" min-width="140" align="center"></el-table-column> |
||||
<el-table-column prop="questionCount" label="试题总数" align="center" min-width="70"></el-table-column> |
||||
<el-table-column prop="score" label="总分" align="center" min-width="70"></el-table-column> |
||||
<el-table-column prop="questionType" label="题型" align="center" min-width="90" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column prop="difficult" label="试卷难度" align="center" min-width="70" sortable="custom"> |
||||
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e => |
||||
e.id === scope.row.difficult).name : '' }}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="suggestTime" label="建议用时" align="center" min-width="70"> |
||||
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template> |
||||
</el-table-column> |
||||
<el-table-column prop="classificationPath" label="试卷分类" align="center" min-width="70" |
||||
show-overflow-tooltip></el-table-column> |
||||
<el-table-column label="建议用途" align="center" min-width="70"> |
||||
<template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e => |
||||
e.id === scope.row.paperType).name : '' }}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="170" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column> |
||||
<el-table-column label="操作" align="center" width="80"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="previewPaper(scope.row)">预览</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange" |
||||
layout="total,prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="listVisible = false">取消</el-button> |
||||
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import Setting from '@/setting' |
||||
import Util from '@/libs/util' |
||||
import _ from 'lodash' |
||||
import QuesConst from '@/const/ques' |
||||
import TestPaperConst from '@/const/testPaper' |
||||
export default { |
||||
props: ['visible', 'form'], |
||||
data () { |
||||
return { |
||||
arabicToChinese: Util.arabicToChinese, |
||||
questionTypes: QuesConst.questionTypes, |
||||
difficults: TestPaperConst.difficults, |
||||
paperTypes: TestPaperConst.paperTypes, |
||||
listVisible: false, |
||||
searchTimer: null, |
||||
|
||||
questionType: [], |
||||
paperLibraries: [], |
||||
filter: { |
||||
libraryId: '', |
||||
paperType: '', |
||||
difficult: [], |
||||
keyWord: '', |
||||
}, |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
paperId: '', |
||||
submiting: false, |
||||
|
||||
}; |
||||
}, |
||||
watch: { |
||||
'filter.keyWord': function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(this.initData, 500) |
||||
}, |
||||
visible () { |
||||
this.listVisible = this.visible |
||||
this.visible && this.getList() |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.originForm = _.cloneDeep(this.form) |
||||
}, |
||||
methods: { |
||||
// 获取试卷列表 |
||||
async getList () { |
||||
try { |
||||
const res = await this.$post(this.api.examPaperList, { |
||||
...this.filter, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
type: 1, |
||||
keyWord: this.keyword, |
||||
libraryId: this.systemId |
||||
}) |
||||
this.papers = res.pageList.records |
||||
this.total = res.pageList.total |
||||
} catch (e) { } |
||||
}, |
||||
// 切换页码 |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
handleCurrentChange (val) { |
||||
this.page = val |
||||
this.getList() |
||||
}, |
||||
initData () { |
||||
this.page = 1 |
||||
this.getList() |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
if (column.prop === 'updateTime') this.filter.updateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : '' |
||||
this.getList() |
||||
}, |
||||
// 新增 |
||||
add () { |
||||
this.form = _.cloneDeep(this.originForm) |
||||
this.detailVisible = true |
||||
}, |
||||
// 预览试卷 |
||||
previewPaper (row) { |
||||
this.$parent.previewPaper(row) |
||||
}, |
||||
// 提交 |
||||
async submit () { |
||||
const { paperId } = this.form |
||||
if (!paperId) return Util.warningMsg('请选择试卷') |
||||
|
||||
const curPaper = this.papers.find(e => e.paperId === paperId) |
||||
if (curPaper) this.form.paperName = curPaper.name |
||||
this.handlePaper() |
||||
}, |
||||
// 复制试卷 |
||||
async handlePaper () { |
||||
const { form } = this |
||||
// 老的试卷名称不等于新的试卷名称,则复制一份试卷,再把新的试卷id替换掉 |
||||
if (form.paperName !== form.originPaperName) { |
||||
const res = await this.$post(this.api.copyExamPaper, { |
||||
associatedID: form.stageId, |
||||
paperId: form.paperId, |
||||
typeId: 1 |
||||
}) |
||||
if (res.examPaper) { |
||||
form.paperId = res.examPaper.paperId |
||||
} |
||||
} |
||||
}, |
||||
// 弹框关闭回调 |
||||
closeDia () { |
||||
this.$emit('update:visible', false) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped></style> |
@ -0,0 +1,630 @@ |
||||
<template> |
||||
<!-- 报名人员 --> |
||||
<div class="page-content" style="padding: 24px"> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>搜索:</label> |
||||
<el-input |
||||
:placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'" |
||||
prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 350px"></el-input> |
||||
</li> |
||||
<li v-if="info.releaseType"> |
||||
<label>参赛人员状态:</label> |
||||
<el-select v-model="isDisable" @change="initData"> |
||||
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button type="primary" round :loading="exporting" @click="exportAll" |
||||
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button> |
||||
<el-button type="primary" @click="batchDel" round v-auth="'/match:管理:报名人员:导出'">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table ref="table" :data="listData" class="table" stripe header-align="center" |
||||
@selection-change="handleSelectionChange" row-key="id" v-loading="loading" @sort-change="sortChange"> |
||||
<el-table-column type="selection" width="80" 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="school" label="学生账号归属" sortable="custom" min-width="180" align="center"></el-table-column> |
||||
<el-table-column prop="realSchool" label="学生所在院校" min-width="180" align="center"></el-table-column> |
||||
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称" |
||||
sortable="custom" min-width="140" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="username" label="队长" min-width="140" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="workNumber" label="队长学号" min-width="140" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="phone" label="队长手机号" min-width="140" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="captain" label="是否为队长" min-width="90" align="center"></el-table-column> |
||||
<el-table-column prop="teachers" label="指导老师" min-width="200" align="center" show-overflow-tooltip> |
||||
<template slot-scope="scope"> |
||||
<template v-if="scope.row.teachers"> |
||||
<el-tooltip placement="top"> |
||||
<div slot="content" style="line-height: 1.8"> |
||||
<div v-for="(item, i) in scope.row.teachers" :key="i"> |
||||
{{ item.name }}{{ item.phone ? ',' + item.phone : '' }}{{ item.position ? ',' + item.position : '' }} |
||||
</div> |
||||
</div> |
||||
<p>{{ scope.row.teachers[0].name }}{{ scope.row.teachers[0].phone ? ',' + scope.row.teachers[0].phone : '' |
||||
}}{{ scope.row.teachers[0].position ? ',' + scope.row.teachers[0].position : '' }}</p> |
||||
</el-tooltip> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="captain" label="团队状态" min-width="80" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-link type="danger" style="font-size: 16px" @click="toInfo(scope.row)">异常</el-link> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="270"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/match:管理:报名人员:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button type="text" @click="del(scope.row)">删除</el-button> |
||||
<template v-if="info.releaseType"> |
||||
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button> |
||||
<el-switch v-auth="'/match:管理:报名人员:禁用'" v-model="scope.row.isDisable" |
||||
:active-text="scope.row.isDisable ? '禁用' : '启用'" :active-value="0" :inactive-value="1" |
||||
style="margin: 0 10px 0 5px" @change="switchOff($event, scope.row, scope.$index)"></el-switch> |
||||
</template> |
||||
</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-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="440px" class="dialog" |
||||
:close-on-click-modal="false" @close="closeAdd"> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style='margin-right: 10px;'> |
||||
<el-form-item v-if="!schoolDisable" prop="schoolId" label="学生账号归属"> |
||||
<el-select v-model="form.schoolId" filterable :disabled="!isAdd" @change="schoolChange" style="width: 100%"> |
||||
<el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName" |
||||
:value="item.schoolId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item prop="studentAffiliatedInstitutionId" label="学生所在院校"> |
||||
<el-select v-model="form.studentAffiliatedInstitutionId" filterable style="width: 100%"> |
||||
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
||||
:value="item.schoolId"></el-option> |
||||
</el-select> |
||||
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校</p> |
||||
</el-form-item> |
||||
<el-form-item prop="workNumber" label="学生学号"> |
||||
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="userName" label="学生姓名"> |
||||
<el-input v-model="form.userName" placeholder="请输入学生姓名" :disabled="isAdd"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="账号角色"> |
||||
学生 |
||||
</el-form-item> |
||||
<el-form-item v-if="info.completeCompetitionSetup.competitionType" prop="teamId" label="所属团队"> |
||||
<div style="display: flex;align-items: center"> |
||||
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable |
||||
style="width: 240px;margin-right: 10px"> |
||||
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option> |
||||
</el-select> |
||||
<el-button v-if="isAdd && !formEnable" type="text" @click="createTeam">创建团队</el-button> |
||||
</div> |
||||
</el-form-item> |
||||
<el-form-item prop="phone" label="手机号"> |
||||
<el-input v-model="form.phone" maxlength="11" placeholder="请输入手机号" :disabled="isAdd"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="email" label="邮箱"> |
||||
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<p v-if="!isAdd" class="tips" style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="addVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="submit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="创建团队" :visible.sync="teamVisible" :close-on-click-modal="false" width="300px"> |
||||
<el-form class="dia-form"> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入团队名称" maxlength="10" v-model="teamForm.teamName"></el-input> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-input placeholder="请设置团队邀请码" maxlength="6" v-model="teamForm.invitationCode"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button> |
||||
<el-button size="small" @click="teamVisible = false">取消</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import axios from 'axios' |
||||
import Setting from "@/setting"; |
||||
export default { |
||||
data () { |
||||
return { |
||||
token: sessionStorage.getItem('token'), |
||||
id: +this.$route.query.id, |
||||
info: { |
||||
completeCompetitionSetup: { |
||||
competitionType: 1, |
||||
} |
||||
}, |
||||
isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '', |
||||
statusList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '已禁用' |
||||
}, |
||||
{ |
||||
id: 0, |
||||
name: '未禁用' |
||||
} |
||||
], |
||||
keyword: this.$route.query.keyword || '', |
||||
listData: [], |
||||
multipleSelection: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
schoolOrder: '', |
||||
teamOrder: '', |
||||
clients: [], |
||||
schools: [], |
||||
addVisible: false, |
||||
formEnable: true, |
||||
isAdd: false, |
||||
form: { |
||||
captain: 0, |
||||
competitionId: this.$route.query.id, |
||||
userName: '', |
||||
workNumber: '', |
||||
schoolId: '', |
||||
studentAffiliatedInstitutionId: '', |
||||
teamId: '', |
||||
whetherSignUp: 0, |
||||
phone: '', |
||||
email: '', |
||||
identification: 1, |
||||
uniqueIdentification: Date.now(), |
||||
password: Setting.initialPassword |
||||
}, |
||||
rules: { |
||||
schoolId: [ |
||||
{ required: true, message: "请选择所属院校", trigger: "change" } |
||||
], |
||||
workNumber: [ |
||||
{ required: true, message: "请输入学号", trigger: "blur" } |
||||
], |
||||
teamId: [ |
||||
{ required: true, message: "请选择所属团队", trigger: "change" } |
||||
] |
||||
}, |
||||
submiting: false, |
||||
|
||||
teamVisible: false, |
||||
teams: [], |
||||
teamNameRepeat: false, |
||||
teamForm: { |
||||
competitionId: this.$route.query.id, |
||||
registrationInvitationCode: '', |
||||
teamName: '', |
||||
invitationCode: '', |
||||
whetherSignUp: 1, |
||||
identification: 1 |
||||
}, |
||||
originForm: {}, |
||||
exitMember: 0, |
||||
notExit: 0, |
||||
schoolDisable: false, |
||||
|
||||
importVisible: false, |
||||
uploadList: [], |
||||
uploadFaild: false, |
||||
uploadTips: '', |
||||
exportCode: '', |
||||
headers: { |
||||
token: sessionStorage.getItem("token") |
||||
}, |
||||
uploading: false, |
||||
isBackstage: 0, |
||||
exporting: false, |
||||
loading: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function (val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
this.getInfo() |
||||
this.getTeam() |
||||
}, |
||||
methods: { |
||||
init () { |
||||
this.initData() |
||||
this.getTeam() |
||||
this.getClient() |
||||
}, |
||||
async getData () { |
||||
this.loading = true |
||||
const { data } = await this.$post(this.api.queryAbnormalTeam, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
keyWord: this.keyword, |
||||
isDisable: this.isDisable, |
||||
schoolOrder: this.schoolOrder, |
||||
teamOrder: this.teamOrder, |
||||
}) |
||||
const list = data.records; |
||||
list.map(e => { |
||||
if (e.teacherDetails) { |
||||
e.teachers = JSON.parse(e.teacherDetails) |
||||
} |
||||
}) |
||||
this.listData = list |
||||
this.total = data.total; |
||||
this.$refs.table.clearSelection(); |
||||
this.loading = false |
||||
}, |
||||
// 获取赛事信息 |
||||
getInfo () { |
||||
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
||||
this.info = competition |
||||
this.getSchool() |
||||
// 非本校内则查询接口获取学校列表 |
||||
if (competition.competitionScope) { |
||||
this.getClient() |
||||
} else { |
||||
this.schoolDisable = true |
||||
this.form.schoolId = competition.schoolId |
||||
} |
||||
}).catch(err => { }) |
||||
}, |
||||
initData () { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange (val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
handleCurrentChange (val) { |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
switchOff (val, row, index) { |
||||
this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { }); |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
// 1上2下 |
||||
if (column.prop === 'school') this.schoolOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' |
||||
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' |
||||
this.getData() |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.notExit = 0 |
||||
this.isAdd = false |
||||
this.addVisible = true |
||||
row.userName = row.username |
||||
this.exitMember = 0 |
||||
row.id = row.accountId |
||||
this.originForm = JSON.parse(JSON.stringify(row)) |
||||
this.form = JSON.parse(JSON.stringify(row)) |
||||
}, |
||||
del (row) { |
||||
this.$confirm(!this.info.completeCompetitionSetup.competitionType || row.captain === '否' ? '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?' : '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?', "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.init() |
||||
}).catch(res => { }); |
||||
}).catch(() => { }); |
||||
}, |
||||
// 学校选择回调 |
||||
schoolChange () { |
||||
if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId |
||||
}, |
||||
// 学号输入完回调。学校和学号都输入完后,调这个接口查询是否有存在的学生,如果有,才能继续输入,如果不能,不让添加 |
||||
workNumberChange () { |
||||
const { form } = this |
||||
if (this.originForm.workNumber !== form.workNumber) { |
||||
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => { |
||||
this.notExit = 0 |
||||
this.exitMember = 0 |
||||
if (account) { |
||||
const { studentAffiliatedInstitutionId } = form |
||||
account.studentAffiliatedInstitutionId = studentAffiliatedInstitutionId |
||||
this.form = account |
||||
} |
||||
this.formEnable = !account |
||||
}).catch(res => { |
||||
if (res.message === '学生不存在') this.notExit = 1 |
||||
if (!this.isAdd) this.exitMember = 1 |
||||
}) |
||||
} else { |
||||
this.exitMember = 0 |
||||
} |
||||
}, |
||||
// 新增编辑人员 |
||||
submitForm () { |
||||
const { form } = this |
||||
if (!this.isAdd) { // 编辑 |
||||
this.$post(this.api.updateUser, { |
||||
hrUserAccount: { |
||||
...form, |
||||
id: form.id, |
||||
lastTimeInstitutionId: this.originForm.studentAffiliatedInstitutionId |
||||
}, |
||||
hrUserInfo: { |
||||
userId: form.userId, |
||||
schoolId: form.schoolId, |
||||
email: form.email, |
||||
userName: form.userName |
||||
} |
||||
}).then(res => { |
||||
// 团队有更换,则调加入团队的接口 |
||||
if (this.originForm.teamId !== form.teamId) { |
||||
this.$post(this.api.joinCompetitionTeam, { |
||||
schoolId: form.schoolId, |
||||
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, |
||||
accountId: form.id, |
||||
competitionId: this.id, |
||||
teamId: form.teamId, |
||||
identification: 1, |
||||
whetherSignUp: 1 |
||||
}).then(res => { |
||||
this.addVisible = false |
||||
this.init() |
||||
this.submiting = false |
||||
util.successMsg('编辑成功!') |
||||
}).catch(res => { |
||||
this.submiting = false |
||||
}) |
||||
} else { |
||||
this.addVisible = false |
||||
this.init() |
||||
this.submiting = false |
||||
util.successMsg('编辑成功!') |
||||
} |
||||
}).catch(res => { |
||||
this.submiting = false |
||||
}) |
||||
} else { |
||||
// 新增人员后再调加入团队的接口 |
||||
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], { |
||||
schoolId: form.schoolId, |
||||
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId, |
||||
accountId: form.id, |
||||
competitionId: this.id, |
||||
teamId: this.form.teamId, |
||||
identification: 1, |
||||
whetherSignUp: 1 |
||||
}).then(res => { |
||||
this.addVisible = false |
||||
this.init() |
||||
this.submiting = false |
||||
util.successMsg('报名成功!') |
||||
}).catch(res => { |
||||
this.submiting = false |
||||
}) |
||||
} |
||||
}, |
||||
// 新增人员 |
||||
submit () { |
||||
this.$refs.form.validate((valid) => { |
||||
if (valid) { |
||||
if (this.submiting) return false |
||||
const { form } = this |
||||
const team = this.teams.find(e => e.teamId == form.teamId) |
||||
if (team && team.invitationCode) form.invitationCode = team.invitationCode |
||||
// 平台id-端id-schoolId-workNumber组成账号 |
||||
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}` |
||||
const { phone, email } = form |
||||
if (phone && !/^1[3456789]\d{9}$/.test(phone)) { |
||||
return util.errorMsg("请输入正确的手机号") |
||||
} else if (email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) { |
||||
return util.errorMsg("请输入正确的邮箱") |
||||
} else if (this.notExit) { |
||||
return util.errorMsg('学生不存在,无法添加!') |
||||
} else if (this.exitMember) { |
||||
return util.errorMsg('学生已存在') |
||||
} else { |
||||
this.submiting = true |
||||
this.submitForm() |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
// 关闭新增员工对话框 |
||||
closeAdd () { |
||||
this.form = { |
||||
captain: 0, |
||||
competitionId: this.id, |
||||
userName: '', |
||||
workNumber: '', |
||||
schoolId: '', |
||||
teamId: '', |
||||
whetherSignUp: 0, |
||||
phone: '', |
||||
email: '', |
||||
identification: 1, |
||||
uniqueIdentification: Date.now(), |
||||
password: Setting.initialPassword |
||||
} |
||||
}, |
||||
// 创建团队 |
||||
createTeam () { |
||||
this.teamForm = { |
||||
competitionId: this.id, |
||||
registrationInvitationCode: '', |
||||
teamName: '', |
||||
invitationCode: '', |
||||
whetherSignUp: 1, |
||||
identification: 1 |
||||
} |
||||
this.teamVisible = true |
||||
}, |
||||
// 学生所属院校固定查询所有学校 |
||||
async getSchool () { |
||||
const { list } = await this.$get(this.api.querySchoolData) |
||||
this.schools = list |
||||
}, |
||||
// 获取客户 |
||||
async getClient () { |
||||
if (this.info.competitionScope === 2) { |
||||
// 选择了指定范围则查询该赛事指定范围的学校 |
||||
this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => { |
||||
this.clients = schools |
||||
}).catch(res => { }) |
||||
} else { |
||||
// 选了全平台则查询客户列表 |
||||
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理') |
||||
this.$post(this.api.queryCustomer, { |
||||
customerType: '', |
||||
page: 1, |
||||
size: 10000, |
||||
supplierId: (sid && !sid.all) ? sid.supplierId : '' |
||||
}).then(res => { |
||||
const { list } = res.message |
||||
list.map(e => { |
||||
e.schoolName = e.customerName |
||||
}) |
||||
this.clients = list |
||||
}).catch(res => { }) |
||||
} |
||||
}, |
||||
// 获取团队列表 |
||||
getTeam () { |
||||
this.$get(this.api.searchTeam, { |
||||
teamName: '', |
||||
competitionId: this.id |
||||
}).then(({ teamList }) => { |
||||
this.teams = teamList |
||||
}).catch(res => { }) |
||||
}, |
||||
// 团队提交 |
||||
teamSubmit () { |
||||
const form = this.teamForm |
||||
if (!form.teamName) return util.errorMsg('请输入团队名称') |
||||
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码') |
||||
form.accountId = this.form.id |
||||
form.schoolId = this.form.schoolId |
||||
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId |
||||
this.$post(this.api.addCompetitionTeam, form).then(res => { |
||||
this.teamVisible = false |
||||
this.addVisible = false |
||||
this.init() |
||||
util.successMsg('报名成功!') |
||||
}).catch(res => { }) |
||||
}, |
||||
// 参赛信息 |
||||
toInfo (row) { |
||||
this.$store.commit('setInnerReferrer', `${this.$route.path}?id=${this.id}&tab=tab6&name=${this.$route.query.name}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`) |
||||
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`) |
||||
}, |
||||
exportAll () { |
||||
if (this.listData.length) { |
||||
this.exporting = true |
||||
const data = this.multipleSelection |
||||
if (data.length) { |
||||
data.map((e, i) => e.id = i + 1) |
||||
axios.post(this.api.exportDataInBatches, data, { |
||||
headers: { |
||||
token: this.token |
||||
}, |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
const name = res.headers['content-disposition'] |
||||
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
||||
this.exporting = false |
||||
}).catch(res => { |
||||
this.exporting = false |
||||
}) |
||||
} else { |
||||
axios.get(`${this.api.exportAbnormalData}?competitionId=${this.id}`, { |
||||
headers: { |
||||
token: this.token |
||||
}, |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
const name = res.headers['content-disposition'] |
||||
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) |
||||
this.exporting = false |
||||
}).catch(res => { |
||||
this.exporting = false |
||||
}) |
||||
} |
||||
} |
||||
}, |
||||
// 批量删除 |
||||
async batchDel () { |
||||
const list = this.multipleSelection |
||||
const tips = list.length ? (this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?' : '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?') : '删除后参赛人员已有的成绩会一并删除,成绩排名将会受影响,<span style="font-size: 15px;color: #f00">是否确定删除全部报名人员?</span>' |
||||
this.$confirm(tips, "提示", { |
||||
type: "warning", |
||||
dangerouslyUseHTMLString: true |
||||
}).then(async () => { |
||||
if (list.length) { |
||||
await this.$post(this.api.batchDeleteApplicants, { registrationVOS: list }) |
||||
} else { |
||||
await this.$post(`${this.api.deleteAllData}?competitionId=${this.id}`) |
||||
} |
||||
this.init() |
||||
this.$message.success("删除成功"); |
||||
this.$refs.table.clearSelection() |
||||
}).catch(() => { }); |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.dia-form { |
||||
.w-100 { |
||||
width: 100%; |
||||
} |
||||
|
||||
.tips { |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
} |
||||
|
||||
.tips { |
||||
font-size: 12px; |
||||
color: #e90000; |
||||
} |
||||
|
||||
/deep/.import-file { |
||||
.el-progress__text, |
||||
.el-progress, |
||||
.el-upload-list__item-status-label { |
||||
display: none !important; |
||||
} |
||||
} |
||||
</style> |
@ -1,447 +0,0 @@ |
||||
<template> |
||||
<div class="wrap"> |
||||
<el-card shadow="hover" |
||||
class="m-b-20"> |
||||
<el-page-header @back="$router.back()" |
||||
content="查看报告"></el-page-header> |
||||
</el-card> |
||||
|
||||
<div class="content"> |
||||
<div class="text-right"> |
||||
<el-button type="primary" |
||||
@click="exportPage">导出报告</el-button> |
||||
</div> |
||||
<h6 class="r-title">标准实验报告</h6> |
||||
<div class="info"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/info1.png" |
||||
alt=""> |
||||
基本信息 |
||||
</h6> |
||||
<ul :class="['info-list', {edit: editing}]"> |
||||
<li> |
||||
<label>学生姓名:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.userName" |
||||
disabled></el-input> |
||||
<span v-else>{{ infoData.userName }}</span> |
||||
</li> |
||||
<li> |
||||
<label>学生学号:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.workNumber" |
||||
disabled></el-input> |
||||
<span v-else>{{ infoData.workNumber }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验时间:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.submitTime" |
||||
disabled></el-input> |
||||
<span v-else>{{ infoData.submitTime }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验成绩:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.score" |
||||
disabled></el-input> |
||||
<div v-else |
||||
class="score-wrap"> |
||||
<em>{{ infoData.score }}</em> |
||||
<img src="@/assets/img/point.png" |
||||
alt=""> |
||||
</div> |
||||
</li> |
||||
<li> |
||||
<label>学生班级:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.className"></el-input> |
||||
<span v-else>{{ infoData.className }}</span> |
||||
</li> |
||||
<li> |
||||
<label>指导老师:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.instructor"></el-input> |
||||
<span v-else>{{ infoData.instructor }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验学时:</label> |
||||
<el-input v-if="editing" |
||||
v-model="infoData.period"></el-input> |
||||
<span v-else>{{ infoData.period }}</span> |
||||
</li> |
||||
</ul> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report2.png" |
||||
alt=""> |
||||
实验项目名称 |
||||
</h6> |
||||
<el-input v-if="editing" |
||||
v-model="form.projectName" |
||||
type="textarea"></el-input> |
||||
<div v-else |
||||
class="pre-wrap" |
||||
v-html="form.projectName"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report3.png" |
||||
alt=""> |
||||
实验目的 |
||||
</h6> |
||||
<div :class="['pre-wrap', {edit: editing}]" |
||||
v-html="form.purpose"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report4.png" |
||||
alt=""> |
||||
实验数据 |
||||
</h6> |
||||
<el-table :data="expData" |
||||
class="table" |
||||
border |
||||
stripe |
||||
header-align="center"> |
||||
<el-table-column type="index" |
||||
label="序号" |
||||
align="center" |
||||
width="60"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentName" |
||||
label="判分点" |
||||
width="270" |
||||
align="center"></el-table-column> |
||||
<el-table-column v-if='project' |
||||
prop="judgmentName" |
||||
label="考核点" |
||||
align="center" |
||||
width="150"> |
||||
<template slot-scope="scope"> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" |
||||
:key="index"> |
||||
<span> |
||||
<span>{{index+1}}. </span>{{item.name}} |
||||
</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="ruleAnswer" |
||||
label="参考答案" |
||||
style='word-wrap: break-word'> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" |
||||
:key="index"> |
||||
<span> |
||||
<span>{{index+1}}. </span>{{item.ruleAnswer}} |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else |
||||
v-html="scope.row.referenceAnswer"></div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" |
||||
label="学生答案"> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" |
||||
:key="index"> |
||||
<span v-if='item.userAnswer'> |
||||
<span>{{index+1}}. </span>{{item.userAnswer}} |
||||
</span> |
||||
<span v-else> |
||||
<span>{{index+1}}. </span>未填写 |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else |
||||
v-html='scope.row.answer' |
||||
style='white-space: pre-wrap'></div> |
||||
<template v-if="scope.row.runThePictureList"> |
||||
<img v-for="(img, i) in scope.row.runThePictureList" |
||||
:key="i" |
||||
width="200" |
||||
class="result-pic" |
||||
:src="img" |
||||
alt=""> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="quesScore" |
||||
label="分值" |
||||
:key="6" |
||||
width="80" |
||||
align="center"></el-table-column> |
||||
<el-table-column prop="score" |
||||
label="得分" |
||||
width="80" |
||||
align="center"></el-table-column> |
||||
</el-table> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report5.png" |
||||
alt=""> |
||||
实验总结与体会 |
||||
</h6> |
||||
<quill v-if="editing" |
||||
:border="true" |
||||
v-model="form.summarize" |
||||
:minHeight="150" |
||||
:height="150" /> |
||||
<div v-else |
||||
class="pre-wrap" |
||||
v-html="form.summarize"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
data () { |
||||
return { |
||||
reportId: this.$route.query.reportId, |
||||
title: "实验报告", |
||||
form: { |
||||
className: "", |
||||
instructor: "", |
||||
period: "", |
||||
projectName: "", |
||||
summarize: "", |
||||
}, |
||||
infoData: {}, |
||||
expData: [], |
||||
editing: false, |
||||
loadIns: null, |
||||
loading: false, |
||||
project: false, |
||||
userScores: [] |
||||
}; |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData () { // 查询详情 |
||||
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => { |
||||
this.form = report |
||||
this.expData = userScores |
||||
this.project = this.expData.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
let form = this.form; |
||||
this.infoData = { |
||||
workNumber: form.workNumber, |
||||
experimentalClassName: form.experimentalClassName, |
||||
instructor: form.instructor, |
||||
period: form.period, |
||||
laboratory: form.laboratory, |
||||
submitTime: form.submitTime, |
||||
score: form.score, |
||||
className: form.className, |
||||
userName: form.userName |
||||
} |
||||
const data = report.data |
||||
this.userScores = userScores |
||||
// 如果没有data,则添加,否则,直接使用 |
||||
if (!data) { |
||||
this.handleList(userScores) |
||||
this.$post(this.api.editExperimentalData, { |
||||
reportId, |
||||
data: JSON.stringify(userScores) |
||||
}).then(res => { }).catch(err => { }) |
||||
} else { |
||||
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data)) |
||||
} |
||||
}).catch(res => { }) |
||||
}, |
||||
// 处理实验数据 |
||||
handleList (list) { |
||||
this.project = list.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
if (this.project) { |
||||
list.map(e => { |
||||
e.assessmentPoint = '' |
||||
e.referenceAnswer = '' |
||||
e.answer = '' |
||||
e.lcRuleRecords.map((n, i) => { |
||||
e.assessmentPoint += `${i + 1}.${n.name}` |
||||
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}` |
||||
e.answer += `${i + 1}.${n.userAnswer}` |
||||
}) |
||||
}) |
||||
} else { // python系统显示图片(从userScores里取) |
||||
list.forEach(e => { |
||||
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
||||
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
||||
}) |
||||
} |
||||
this.expData = list |
||||
}, |
||||
exportPage () { |
||||
const form = Object.assign(this.form, this.infoData) |
||||
const list = JSON.parse(JSON.stringify(this.expData)) |
||||
list.map((e, i) => { |
||||
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
||||
if (item && item.runThePicture) e.runThePicture = item.runThePicture |
||||
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
||||
e.id = i + 1 |
||||
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
}) |
||||
for (const i in form) { |
||||
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '') |
||||
} |
||||
form.purpose = form.purpose.replace(/<[^>]+>/g, '') |
||||
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, { |
||||
...form, |
||||
experimentalData: list |
||||
}).then(res => { |
||||
console.log(res) |
||||
util.downloadFileDirect(`实验报告.docx`, new Blob([res])) |
||||
}).catch(res => { }) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.wrap { |
||||
padding: 12px 300px 20px; |
||||
} |
||||
.text-right { |
||||
text-align: right; |
||||
} |
||||
code, |
||||
kbd, |
||||
samp { |
||||
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; |
||||
word-wrap: break-word; |
||||
white-space: pre-wrap; |
||||
} |
||||
/deep/ pre { |
||||
white-space: pre-wrap; /* css-3 */ |
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ |
||||
white-space: pre-wrap; /* Opera 4-6 */ |
||||
white-space: -o-pre-wrap; /* Opera 7 */ |
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */ |
||||
word-break: break-all; |
||||
overflow: hidden; |
||||
font-size: 12px; |
||||
font-weight: 400; |
||||
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; |
||||
} |
||||
.content { |
||||
padding: 16px 40px; |
||||
background: #fff; |
||||
&.loading { |
||||
padding-top: 30px; |
||||
} |
||||
.r-title { |
||||
margin-bottom: 40px; |
||||
font-size: 24px; |
||||
text-align: center; |
||||
color: #333; |
||||
} |
||||
.info { |
||||
padding: 20px 16px; |
||||
border: 1px solid #e1e6f2; |
||||
} |
||||
.l-title { |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 5px 8px; |
||||
margin-bottom: 12px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
background-color: #f7f5ff; |
||||
} |
||||
.info-list { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
padding: 10px 0 0 20px; |
||||
li { |
||||
display: inline-flex; |
||||
width: 23%; |
||||
padding: 0 10px; |
||||
margin-bottom: 34px; |
||||
} |
||||
&.edit { |
||||
li { |
||||
align-items: center; |
||||
} |
||||
} |
||||
label { |
||||
font-size: 14px; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
} |
||||
span { |
||||
min-width: 150px; |
||||
padding: 0 10px 3px; |
||||
border-bottom: 1px solid #e1e6f2; |
||||
} |
||||
/deep/.el-input { |
||||
width: 174px; |
||||
} |
||||
} |
||||
.score-wrap { |
||||
position: relative; |
||||
min-width: 150px; |
||||
border-bottom: 1px solid #e1e6f2; |
||||
em { |
||||
position: absolute; |
||||
top: -12px; |
||||
left: 30px; |
||||
font-family: din; |
||||
font-size: 30px; |
||||
font-weight: 600; |
||||
color: #0b1d30; |
||||
} |
||||
img { |
||||
position: absolute; |
||||
bottom: -15px; |
||||
left: 0; |
||||
} |
||||
} |
||||
/deep/.el-textarea .el-textarea__inner, |
||||
.pre-wrap { |
||||
min-height: 72px; |
||||
padding: 10px 16px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
&.edit { |
||||
color: #abb3c6; |
||||
border: 1px solid #cacfdb; |
||||
border-radius: 4px; |
||||
background-color: #f6f7f9; |
||||
} |
||||
} |
||||
/deep/ .table th { |
||||
background-color: #e5dfff !important; |
||||
.cell { |
||||
line-height: 35px; |
||||
color: #fff; |
||||
} |
||||
} |
||||
} |
||||
.result-pic { |
||||
margin: 10px 0; |
||||
} |
||||
@media (max-width: 1650px) { |
||||
.wrap { |
||||
padding: 12px 200px 20px; |
||||
} |
||||
} |
||||
@media (max-width: 1430px) { |
||||
.wrap { |
||||
padding: 12px 100px 20px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,675 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20 head-card"> |
||||
<div class="flex-between m-b-20"> |
||||
<el-page-header @back="back" content="成绩管理"></el-page-header> |
||||
</div> |
||||
|
||||
</el-card> |
||||
|
||||
<div v-loading="loading"> |
||||
<el-card v-if="method != 2" shadow="hover" class="m-b-20"> |
||||
<div class="stat"> |
||||
<div class="nums"> |
||||
<div class="item"> |
||||
<p class="name">已参加/应参加人数</p> |
||||
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }} |
||||
</p> |
||||
</div> |
||||
<div class="item"> |
||||
<p class="name">实验平均分</p> |
||||
<p class="val">{{ avgScore }}</p> |
||||
</div> |
||||
</div> |
||||
<div class="chart" id="chart"></div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div v-if="showFile" class="tabs m-b-20"> |
||||
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i === active }" @click="tabChange(i)">{{ |
||||
item }}</a> |
||||
</div> |
||||
|
||||
|
||||
<div class="tool flex-between"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>省份</label> |
||||
<el-select v-model="filter.provinceId" filterable clearable placeholder="请选择省份" @change="provinceChange" |
||||
@clear="clearProvince"> |
||||
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName" |
||||
:value="item.provinceId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>城市</label> |
||||
<el-select v-model="filter.cityId" filterable clearable placeholder="请选择城市" :disabled="!filter.provinceId" |
||||
@change="initData"> |
||||
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>学校</label> |
||||
<el-select v-model="filter.realSchoolId" clearable filterable placeholder="请选择学校" @change="initData"> |
||||
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
||||
:value="item.schoolId"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<el-input size="small" placeholder="请输入学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable |
||||
style="width: 300px"></el-input> |
||||
</li> |
||||
</ul> |
||||
<div v-if="!active"> |
||||
<el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button> |
||||
<el-button type="primary" :disabled="!!multipleSelection.find(e => method != 2 && !e.reportId)" |
||||
@click="delAllData">批量删除</el-button> |
||||
<el-button type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' : '批量导出' |
||||
}}</el-button> |
||||
</div> |
||||
<div v-else> |
||||
<el-button type="primary" :loading="exporting1" @click="exportData1">{{ exporting1 ? '正在导出' : '批量导出' |
||||
}}</el-button> |
||||
</div> |
||||
</div> |
||||
<template v-if="!active"> |
||||
<el-table :data="list" class="table" :key="1" ref="table" stripe header-align="center" |
||||
@selection-change="handleSelectionChange" row-key="id"> |
||||
<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="provinceName" label="省份" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="cityName" label="城市" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" align="center"></el-table-column> |
||||
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" min-width="100" |
||||
align="center"></el-table-column> |
||||
<el-table-column prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="score" label="分数" width="90" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.submitTime ? scope.row.score : '--' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="timeSum" label="耗时" width="90" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.submitTime || '--' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="状态" width="100" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="160"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-if="method != 2 && scope.row.reportId" type="text" |
||||
@click="show(scope.row)">查看成绩报告</el-button> |
||||
<el-button v-if="scope.row.reportId" type="text" @click="handleDelete(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> |
||||
</template> |
||||
<template v-else> |
||||
<el-table :data="list1" class="table" :key="2" stripe header-align="center" |
||||
@selection-change="handleSelectionChange1" row-key="id"> |
||||
<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 + (page1 - 1) * pageSize + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="provinceName" label="省份" align="center"></el-table-column> |
||||
<el-table-column prop="cityName" label="城市" align="center"></el-table-column> |
||||
<el-table-column prop="schoolName" label="学生账号归属" align="center"></el-table-column> |
||||
<el-table-column prop="realSchool" label="学生所在院校" align="center"></el-table-column> |
||||
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" align="center"></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> |
||||
<el-table-column prop="fileName" label="文件名" align="center"></el-table-column> |
||||
<el-table-column prop="fileSize" label="文件大小" align="center"></el-table-column> |
||||
<el-table-column prop="fileType" label="文件类型" align="center"></el-table-column> |
||||
<el-table-column prop="fileFormat" label="文件格式" align="center"></el-table-column> |
||||
<el-table-column prop="createTime" label="提交时间" width="150" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" width="200"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-if="!isCompress(scope.row.fileFormat)" type="text" |
||||
@click="preview(scope.row)">预览文件</el-button> |
||||
<el-button type="primary" size="mini" :loading="scope.row.loading" |
||||
@click="exportFile(scope.row)">导出文件</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total1" |
||||
@current-change="handleCurrentChange1" :current-page="page1"> |
||||
</el-pagination> |
||||
</div> |
||||
</template> |
||||
</el-card> |
||||
</div> |
||||
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false" |
||||
@close="cancelUpload"> |
||||
<div style="text-align: center"> |
||||
<template v-if="!uploadFaild"> |
||||
<div style="margin-bottom: 10px;"> |
||||
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
||||
</div> |
||||
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload" |
||||
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" |
||||
:limit="1" :on-exceed="handleExceed" :action="this.api.batchImportGrades" :file-list="uploadList" |
||||
:headers="headers" :disabled="uploading" :data="{ |
||||
competitionId: this.id, |
||||
stageId: this.stageId, |
||||
systemId: 0 |
||||
}"> |
||||
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i |
||||
class="el-icon-upload2 el-icon--right"></i></el-button> |
||||
</el-upload> |
||||
</template> |
||||
<template v-else> |
||||
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p> |
||||
<p type="primary" |
||||
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;" |
||||
@click="showFaild">部分数据导入失败,查看失败原因</p> |
||||
</template> |
||||
</div> |
||||
<span v-if="uploading" slot="footer" class="dialog-footer"> |
||||
<el-button @click="cancelUpload">停止导入</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import * as echarts from "echarts"; |
||||
import axios from 'axios'; |
||||
import Zip from '@/libs/zip' |
||||
export default { |
||||
data () { |
||||
return { |
||||
id: +this.$route.query.id, |
||||
stageId: +this.$route.query.stageId, |
||||
method: +this.$route.query.method, |
||||
competitionType: +this.$route.query.competitionType, |
||||
showFile: this.$route.query.showFile === 'true', |
||||
isCompress: util.isCompress, |
||||
filter: { |
||||
provinceId: '', |
||||
cityId: '', |
||||
realSchoolId: '', |
||||
reviewStatus: '', |
||||
scoreSortOrder: '', |
||||
submitTimeSortOrder: '', |
||||
}, |
||||
provinces: [], |
||||
cities: [], |
||||
schools: [], |
||||
keyword: this.$route.query.keyword || '', |
||||
searchTimer: null, |
||||
list: [], |
||||
multipleSelection: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
|
||||
list1: [], |
||||
multipleSelection1: [], |
||||
page1: 1, |
||||
total1: 0, |
||||
|
||||
avgScore: 0, // 平均分 |
||||
importVisible: false, |
||||
uploadList: [], |
||||
uploadFaild: false, |
||||
uploading: false, |
||||
faildData: null, |
||||
headers: { |
||||
token: sessionStorage.getItem("token") |
||||
}, |
||||
statData: {}, |
||||
tabs: ['成绩列表', '文件列表'], |
||||
active: 0, |
||||
loading: false, |
||||
exporting: false, |
||||
exporting1: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function (val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.$router.push({ |
||||
path: '/otherArchList', |
||||
query: { |
||||
...this.$route.query, |
||||
keyword: val |
||||
} |
||||
}) |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
this.getProvince() |
||||
this.getSchool() |
||||
}, |
||||
methods: { |
||||
async getData () { |
||||
this.loading = true |
||||
// 文件列表 |
||||
if (this.active) { |
||||
const { data } = await this.$post(this.api.cCompetitionStageFileList, { |
||||
pageNum: this.page1, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
stageId: this.stageId, |
||||
keyWord: this.keyword, |
||||
...this.filter |
||||
}) |
||||
data.records.forEach(e => { |
||||
e.loading = false |
||||
e.fileType = '其他' |
||||
if (util.isVideo(e.fileFormat)) { |
||||
e.fileType = '视频' |
||||
} else if (util.isAudio(e.fileFormat)) { |
||||
e.fileType = '音频' |
||||
} else if (util.isImg(e.fileFormat)) { |
||||
e.fileType = '图片' |
||||
} else if (util.isDoc(e.fileFormat)) { |
||||
e.fileType = '文档' |
||||
} else if (util.isCompress(e.fileFormat)) { |
||||
e.fileType = '压缩包' |
||||
} else if (e.fileType === 'pdf') { |
||||
e.fileType = 'pdf' |
||||
} |
||||
}) |
||||
this.list1 = data.records |
||||
this.total1 = data.total |
||||
this.loading = false |
||||
} else { // 成绩列表 |
||||
const { data, page } = await this.$post(this.api.stageGradeManagementList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
keyWord: this.keyword, |
||||
stageId: this.stageId, |
||||
isNakadai: 1, |
||||
...this.filter |
||||
}) |
||||
this.loading = false |
||||
this.total = page.total |
||||
this.list = page.records |
||||
this.statData = data |
||||
this.avgScore = (+data.avgScore).toFixed(2) |
||||
this.method != 2 && this.getChart() |
||||
} |
||||
}, |
||||
initData () { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
|
||||
// 获取省份 |
||||
async getProvince () { |
||||
const { list } = await this.$get(this.api.queryProvince) |
||||
this.provinces = list |
||||
}, |
||||
// 清除省份 |
||||
clearProvince () { |
||||
this.filter.cityId = '' |
||||
}, |
||||
// 省份选择回调 |
||||
provinceChange () { |
||||
this.clearProvince() |
||||
this.getCity() |
||||
this.initData() |
||||
}, |
||||
// 获取城市 |
||||
async getCity () { |
||||
const id = this.filter.provinceId |
||||
if (id) { |
||||
const { list } = await this.$get(this.api.queryCity, { |
||||
provinceId: id |
||||
}) |
||||
this.cities = list |
||||
} |
||||
}, |
||||
// 获取学校 |
||||
async getSchool () { |
||||
const { list } = await this.$get(this.api.querySchoolData) |
||||
this.schools = list |
||||
}, |
||||
|
||||
// 查看成绩报告 |
||||
show (row) { |
||||
this.$router.push(`/trialReport?reportId=${row.reportId}`) |
||||
}, |
||||
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
||||
async exportData () { |
||||
if (this.list.length) { |
||||
this.exporting = true |
||||
// 有选择数据,则导出已选择的,否则导出全部 |
||||
if (this.multipleSelection.length) { |
||||
const res = await axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, { |
||||
headers: this.headers, |
||||
responseType: 'blob' |
||||
}) |
||||
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
||||
this.exporting = false |
||||
} else if (this.list.length) { |
||||
const res = await axios.post(this.api.allExperimentalResultsAreDerived, { |
||||
pageNum: 1, |
||||
pageSize: 10000, |
||||
competitionId: this.id, |
||||
isNakadai: 1, |
||||
stageId: this.stageId, |
||||
}, { |
||||
headers: this.headers, |
||||
responseType: 'blob' |
||||
}) |
||||
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data])) |
||||
this.exporting = false |
||||
} |
||||
} |
||||
}, |
||||
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
||||
exportData1 () { |
||||
this.exporting1 = true |
||||
let list = this.list1 |
||||
if (this.multipleSelection1.length) { |
||||
list = this.multipleSelection1 |
||||
} |
||||
Zip('批量导出', list, () => { |
||||
this.exporting1 = false |
||||
}) |
||||
}, |
||||
handleDelete (row) { // 删除 |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.$post(this.api.batchDeleteContestGrade, { |
||||
ids: [this.method == 2 ? row.scoreId : row.reportId], |
||||
competitionId: this.id, |
||||
stageId: this.stageId |
||||
}).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}).catch(() => { }); |
||||
}, |
||||
delAllData () { // 批量删除 |
||||
const list = this.multipleSelection |
||||
this.$confirm(list.length ? '该项目下的所有成绩报告将会删除,是否继续?' : '是否确定删除列表所有成绩数据?', "提示", { |
||||
type: "warning" |
||||
}).then(async () => { |
||||
let ids = [] |
||||
if (list.length) { |
||||
ids = list.map(item => { |
||||
return this.method == 2 ? item.scoreId : item.reportId |
||||
}); |
||||
ids = ids.filter(e => e) |
||||
} |
||||
const data = { |
||||
competitionId: this.id, |
||||
stageId: this.stageId |
||||
} |
||||
if (list.length) data.ids = ids |
||||
await this.$post(this.api.batchDeleteContestGrade, data) |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection(); |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(() => { }); |
||||
}, |
||||
handleSelectionChange (val) { // 多选 |
||||
this.multipleSelection = val; |
||||
}, |
||||
handleCurrentChange (val) { // 切换分页 |
||||
this.$router.push({ |
||||
path: '/otherArchList', |
||||
query: { |
||||
...this.$route.query, |
||||
page: val |
||||
} |
||||
}) |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
|
||||
handleSelectionChange1 (val) { // 多选 |
||||
this.multipleSelection1 = val; |
||||
}, |
||||
handleCurrentChange1 (val) { // 切换分页 |
||||
this.page1 = val; |
||||
this.getData(); |
||||
}, |
||||
getChart () { // 初始化折线图 |
||||
const data = [] |
||||
const { statData } = this |
||||
for (let i = 1; i <= 10; i++) { |
||||
data.push(statData['num' + i]) |
||||
} |
||||
let myChart = echarts.init(document.getElementById("chart")); |
||||
myChart.setOption({ |
||||
title: { text: "实验分数分布图" }, |
||||
tooltip: {}, |
||||
xAxis: { |
||||
name: "分数", |
||||
type: "category", |
||||
boundaryGap: false, |
||||
interval: 10, |
||||
data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"] |
||||
}, |
||||
yAxis: { |
||||
name: "人数", |
||||
type: "value", |
||||
minInterval: 10 |
||||
}, |
||||
series: [{ |
||||
data, |
||||
type: "line", |
||||
areaStyle: {}, |
||||
label: { |
||||
show: true, |
||||
position: 'top' |
||||
}, |
||||
color: ["#8191fd"] |
||||
}] |
||||
}); |
||||
}, |
||||
// 批量导入 |
||||
batchImport () { |
||||
this.importVisible = true |
||||
this.uploadList = [] |
||||
this.uploadFaild = false |
||||
}, |
||||
// 模板下载 |
||||
download () { |
||||
axios.get(`${this.api.gradeDownloadExcel}?competitionId=${this.id}&stageId=${this.stageId}`, { |
||||
headers: this.headers, |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data])) |
||||
}).catch(res => { }) |
||||
}, |
||||
// 上传文件 |
||||
handleExceed (files, fileList) { |
||||
util.warningMsg( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
) |
||||
}, |
||||
// 下载失败文件 |
||||
showFaild () { |
||||
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.faildData.exportCode}&competitionType=${this.faildData.competitionType}`, { |
||||
headers: this.headers, |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data])) |
||||
}).catch(res => { }) |
||||
}, |
||||
uploadSuccess (res) { |
||||
this.uploading = false |
||||
this.uploadFaild = false |
||||
if (res.status === 200) { |
||||
this.initData() |
||||
const { data } = res |
||||
if (data.exportCode) { |
||||
this.faildData = data |
||||
this.uploadFaild = true |
||||
} else { |
||||
util.successMsg(data.tip, 3000) |
||||
this.importVisible = false |
||||
} |
||||
} else { |
||||
util.errorMsg(res.message || '上传失败,请检查数据') |
||||
} |
||||
}, |
||||
uploadError (err, file, fileList) { |
||||
this.uploading = false |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}) |
||||
}, |
||||
beforeUpload (file) { |
||||
this.uploading = true |
||||
}, |
||||
beforeRemove (file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`) |
||||
}, |
||||
handleRemove (file, fileList) { |
||||
this.uploadList = fileList |
||||
this.uploadFaild = false |
||||
}, |
||||
cancelUpload () { |
||||
this.uploading = false |
||||
if (this.$refs.upload) this.$refs.upload.abort() |
||||
this.keyword = '' |
||||
this.initData() |
||||
this.importVisible = false |
||||
}, |
||||
// tab回调 |
||||
tabChange (i) { |
||||
this.active = i |
||||
this.getData() |
||||
}, |
||||
// 预览附件 |
||||
preview (item) { |
||||
window.open((util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath) |
||||
}, |
||||
// 导出文件 |
||||
exportFile (item) { |
||||
item.loading = true |
||||
const url = item.filePath |
||||
var x = new XMLHttpRequest() |
||||
x.open("GET", url, true) |
||||
x.responseType = "blob" |
||||
x.onload = function (e) { |
||||
var url = window.URL.createObjectURL(x.response) |
||||
var a = document.createElement("a") |
||||
a.href = url |
||||
a.download = item.userName + '-' + item.fileName |
||||
a.click() |
||||
item.loading = false |
||||
} |
||||
x.send() |
||||
}, |
||||
back () { |
||||
this.$router.push(this.$store.state.innerReferrer) |
||||
} |
||||
} |
||||
}; |
||||
</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; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.stat { |
||||
display: flex; |
||||
|
||||
.nums { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-right: 20px; |
||||
|
||||
.item:nth-child(1) { |
||||
background-image: url('../../../assets/img/total.png'); |
||||
} |
||||
|
||||
.item:nth-child(2) { |
||||
background-image: url('../../../assets/img/avg.png'); |
||||
} |
||||
|
||||
.item { |
||||
width: 300px; |
||||
min-height: 145px; |
||||
padding: 30px 30px; |
||||
margin: 0 10px; |
||||
box-sizing: border-box; |
||||
border-radius: 8px; |
||||
background-size: 100% 100%; |
||||
background-repeat: no-repeat; |
||||
|
||||
p { |
||||
font-size: 18px; |
||||
color: #ffffff; |
||||
} |
||||
|
||||
.val { |
||||
margin-top: 10px; |
||||
color: #ffffff; |
||||
font-size: 36px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.chart { |
||||
flex: 1; |
||||
height: 300px; |
||||
} |
||||
} |
||||
|
||||
/deep/.import-file { |
||||
.el-progress__text, |
||||
.el-progress, |
||||
.el-upload-list__item-status-label { |
||||
display: none !important; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,413 @@ |
||||
<template> |
||||
<div class="wrap"> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<el-page-header @back="$router.back()" content="查看报告"></el-page-header> |
||||
</el-card> |
||||
|
||||
<div class="content" v-loading="loading"> |
||||
<div class="text-right"> |
||||
<el-button type="primary" @click="exportPage">导出报告</el-button> |
||||
</div> |
||||
<h6 class="r-title">标准实验报告</h6> |
||||
<div class="info"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/info1.png" alt=""> |
||||
基本信息 |
||||
</h6> |
||||
<ul :class="['info-list', { edit: editing }]"> |
||||
<li> |
||||
<label>学生姓名:</label> |
||||
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input> |
||||
<span v-else>{{ infoData.userName }}</span> |
||||
</li> |
||||
<li> |
||||
<label>学生学号:</label> |
||||
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input> |
||||
<span v-else>{{ infoData.workNumber }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验时间:</label> |
||||
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input> |
||||
<span v-else>{{ infoData.submitTime }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验成绩:</label> |
||||
<el-input v-if="editing" v-model="infoData.score" disabled></el-input> |
||||
<div v-else class="score-wrap"> |
||||
<em>{{ infoData.score }}</em> |
||||
<img src="@/assets/img/point.png" alt=""> |
||||
</div> |
||||
</li> |
||||
<li> |
||||
<label>学生班级:</label> |
||||
<el-input v-if="editing" v-model="infoData.className"></el-input> |
||||
<span v-else>{{ infoData.className }}</span> |
||||
</li> |
||||
<li> |
||||
<label>指导老师:</label> |
||||
<el-input v-if="editing" v-model="infoData.instructor"></el-input> |
||||
<span v-else>{{ infoData.instructor }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验学时:</label> |
||||
<el-input v-if="editing" v-model="infoData.period"></el-input> |
||||
<span v-else>{{ infoData.period }}</span> |
||||
</li> |
||||
</ul> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report2.png" alt=""> |
||||
实验项目名称 |
||||
</h6> |
||||
<el-input v-if="editing" v-model="form.projectName" type="textarea"></el-input> |
||||
<div v-else class="pre-wrap" v-html="form.projectName"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report3.png" alt=""> |
||||
实验目的 |
||||
</h6> |
||||
<div :class="['pre-wrap', { edit: editing }]" v-html="form.purpose"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report4.png" alt=""> |
||||
实验数据 |
||||
</h6> |
||||
<el-table :data="expData" class="table" border stripe header-align="center"> |
||||
<el-table-column type="index" label="序号" align="center" width="60"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column> |
||||
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150"> |
||||
<template slot-scope="scope"> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span> |
||||
<span>{{ index + 1 }}. </span>{{ item.name }} |
||||
</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span> |
||||
<span>{{ index + 1 }}. </span>{{ item.ruleAnswer }} |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else v-html="scope.row.referenceAnswer"></div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" label="学生答案"> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span v-if='item.userAnswer'> |
||||
<span>{{ index + 1 }}. </span>{{ item.userAnswer }} |
||||
</span> |
||||
<span v-else> |
||||
<span>{{ index + 1 }}. </span>未填写 |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else class="pre-code">{{ scope.row.answer }}</div> |
||||
<template v-if="scope.row.runThePictureList"> |
||||
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic" |
||||
:src="img" alt=""> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="quesScore" label="分值" :key="6" width="80" align="center"></el-table-column> |
||||
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column> |
||||
</el-table> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report5.png" alt=""> |
||||
实验总结与体会 |
||||
</h6> |
||||
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" /> |
||||
<div v-else class="pre-wrap" v-html="form.summarize"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
data () { |
||||
return { |
||||
reportId: this.$route.query.reportId, |
||||
title: "实验报告", |
||||
form: { |
||||
className: "", |
||||
instructor: "", |
||||
period: "", |
||||
projectName: "", |
||||
summarize: "", |
||||
}, |
||||
infoData: {}, |
||||
expData: [], |
||||
editing: false, |
||||
loadIns: null, |
||||
loading: false, |
||||
project: false, |
||||
userScores: [] |
||||
}; |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData () { // 查询详情 |
||||
this.loading = true |
||||
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => { |
||||
this.form = report |
||||
this.project = this.expData.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
let form = this.form; |
||||
this.infoData = { |
||||
workNumber: form.workNumber, |
||||
experimentalClassName: form.experimentalClassName, |
||||
instructor: form.instructor, |
||||
period: form.period, |
||||
laboratory: form.laboratory, |
||||
submitTime: form.submitTime, |
||||
score: form.score, |
||||
className: form.className, |
||||
userName: form.userName |
||||
} |
||||
const { data } = report |
||||
// 如果没有data,则添加,否则,直接使用 |
||||
if (!data) { |
||||
this.userScores = userScores |
||||
this.handleList(userScores) |
||||
this.$post(this.api.editExperimentalData, { |
||||
reportId, |
||||
data: JSON.stringify(userScores) |
||||
}).then(res => { }).catch(err => { }) |
||||
} else { |
||||
this.handleList(JSON.parse(data)) |
||||
} |
||||
}).catch(res => { |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
// 处理实验数据 |
||||
handleList (list) { |
||||
this.project = list.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
if (this.project) { |
||||
list.map(e => { |
||||
e.assessmentPoint = '' |
||||
e.referenceAnswer = '' |
||||
e.answer = '' |
||||
e.lcRuleRecords && e.lcRuleRecords.map((n, i) => { |
||||
e.assessmentPoint += `${i + 1}.${n.name}` |
||||
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}` |
||||
e.answer += `${i + 1}.${n.userAnswer}` |
||||
}) |
||||
}) |
||||
} else { // python系统显示图片(从userScores里取) |
||||
list.forEach(e => { |
||||
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
||||
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
||||
}) |
||||
} |
||||
this.expData = list |
||||
this.loading = false |
||||
}, |
||||
exportPage () { |
||||
const form = Object.assign(this.form, this.infoData) |
||||
const list = JSON.parse(JSON.stringify(this.expData)) |
||||
list.map((e, i) => { |
||||
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
||||
if (item && item.runThePicture) e.runThePicture = item.runThePicture |
||||
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
||||
e.id = i + 1 |
||||
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
}) |
||||
for (const i in form) { |
||||
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '') |
||||
} |
||||
form.purpose = form.purpose.replace(/<[^>]+>/g, '') |
||||
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, { |
||||
...form, |
||||
experimentalData: list |
||||
}).then(res => { |
||||
console.log(res) |
||||
util.downloadFileDirect(`实验报告.docx`, new Blob([res])) |
||||
}).catch(res => { }) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.wrap { |
||||
padding: 12px 300px 20px; |
||||
} |
||||
|
||||
.pre-code { |
||||
white-space: pre-wrap; |
||||
} |
||||
|
||||
.text-right { |
||||
text-align: right; |
||||
} |
||||
|
||||
code, |
||||
kbd, |
||||
samp { |
||||
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; |
||||
word-wrap: break-word; |
||||
white-space: pre-wrap; |
||||
} |
||||
|
||||
/deep/ pre { |
||||
white-space: pre-wrap; |
||||
/* css-3 */ |
||||
white-space: -moz-pre-wrap; |
||||
/* Mozilla, since 1999 */ |
||||
white-space: pre-wrap; |
||||
/* Opera 4-6 */ |
||||
white-space: -o-pre-wrap; |
||||
/* Opera 7 */ |
||||
word-wrap: break-word; |
||||
/* Internet Explorer 5.5+ */ |
||||
word-break: break-all; |
||||
overflow: hidden; |
||||
font-size: 12px; |
||||
font-weight: 400; |
||||
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; |
||||
} |
||||
|
||||
.content { |
||||
padding: 16px 40px; |
||||
background: #fff; |
||||
|
||||
.r-title { |
||||
margin-bottom: 40px; |
||||
font-size: 24px; |
||||
text-align: center; |
||||
color: #333; |
||||
} |
||||
|
||||
.info { |
||||
padding: 20px 16px; |
||||
border: 1px solid #e1e6f2; |
||||
} |
||||
|
||||
.l-title { |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 5px 8px; |
||||
margin-bottom: 12px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
background-color: #f7f5ff; |
||||
} |
||||
|
||||
.info-list { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
padding: 10px 0 0 20px; |
||||
|
||||
li { |
||||
display: inline-flex; |
||||
width: 23%; |
||||
padding: 0 10px; |
||||
margin-bottom: 34px; |
||||
} |
||||
|
||||
&.edit { |
||||
li { |
||||
align-items: center; |
||||
} |
||||
} |
||||
|
||||
label { |
||||
font-size: 14px; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
span { |
||||
min-width: 150px; |
||||
padding: 0 10px 3px; |
||||
border-bottom: 1px solid #e1e6f2; |
||||
} |
||||
|
||||
/deep/.el-input { |
||||
width: 174px; |
||||
} |
||||
} |
||||
|
||||
.score-wrap { |
||||
position: relative; |
||||
min-width: 150px; |
||||
border-bottom: 1px solid #e1e6f2; |
||||
|
||||
em { |
||||
position: absolute; |
||||
top: -12px; |
||||
left: 30px; |
||||
font-family: din; |
||||
font-size: 30px; |
||||
font-weight: 600; |
||||
color: #0b1d30; |
||||
} |
||||
|
||||
img { |
||||
position: absolute; |
||||
bottom: -15px; |
||||
left: 0; |
||||
} |
||||
} |
||||
|
||||
/deep/.el-textarea .el-textarea__inner, |
||||
.pre-wrap { |
||||
min-height: 72px; |
||||
padding: 10px 16px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
|
||||
&.edit { |
||||
color: #abb3c6; |
||||
border: 1px solid #cacfdb; |
||||
border-radius: 4px; |
||||
background-color: #f6f7f9; |
||||
} |
||||
} |
||||
|
||||
/deep/ .table th { |
||||
background-color: #e5dfff !important; |
||||
|
||||
.cell { |
||||
line-height: 35px; |
||||
color: #fff; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.result-pic { |
||||
margin: 10px 0; |
||||
} |
||||
|
||||
@media (max-width: 1650px) { |
||||
.wrap { |
||||
padding: 12px 200px 20px; |
||||
} |
||||
} |
||||
|
||||
@media (max-width: 1430px) { |
||||
.wrap { |
||||
padding: 12px 100px 20px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,50 @@ |
||||
<template> |
||||
<div> |
||||
<iframe :src="url" frameborder="0" width="100%"></iframe> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
export default { |
||||
data () { |
||||
return { |
||||
url: '' |
||||
}; |
||||
}, |
||||
mounted () { |
||||
const token = sessionStorage.getItem('token') |
||||
const cache = localStorage.getItem('reviewPath') // 理论考试平台每次跳转都会往localStorage存路径 |
||||
let url = `${location.origin}/reviewCenter/` |
||||
if (Setting.isDev) url = `http://192.168.31.125:8099/` |
||||
if (cache) { |
||||
url += '#' + this.replaceParam(cache, Date.now()) |
||||
} else { |
||||
url += `#/myReview?nakadai=1${Setting.isDev ? `&token=${token}` : ''}&v=${Date.now()}` |
||||
} |
||||
console.log("🚀 ~ mounted ~ url:", url) |
||||
localStorage.setItem('review_token', token) |
||||
this.url = url |
||||
}, |
||||
methods: { |
||||
replaceParam (url, newVValue) { |
||||
const vParamRegex = /v=[^&]+/g |
||||
|
||||
let newUrl = url.replace(vParamRegex, `v=${newVValue}`) |
||||
|
||||
const [baseUrl, hash] = newUrl.split('#'); |
||||
if (hash) { |
||||
newUrl = `${baseUrl}#${hash.replace(vParamRegex, `v=${newVValue}`)}` |
||||
} |
||||
|
||||
return newUrl |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
iframe { |
||||
height: calc(100vh - 167px); |
||||
} |
||||
</style> |
@ -0,0 +1,39 @@ |
||||
<template> |
||||
<div> |
||||
<iframe :src="url" frameborder="0" width="100%"></iframe> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Util from '@/libs/util' |
||||
import Setting from '@/setting' |
||||
export default { |
||||
data () { |
||||
return { |
||||
url: '' |
||||
}; |
||||
}, |
||||
mounted () { |
||||
const cache = localStorage.getItem('examPath') // 理论考试平台每次跳转都会往localStorage存路径 |
||||
let url = `${location.origin}/examination/` |
||||
if (Setting.isDev) url = `http://192.168.31.125:8098/` |
||||
if (cache) { |
||||
url += `#${cache}${cache.includes('?') ? `&` : '?'}token=${sessionStorage.getItem('token')}` |
||||
} else { |
||||
url += `#/quesBankType?token=${sessionStorage.getItem('token')}` |
||||
} |
||||
url += `&v=${Date.now()}` |
||||
localStorage.setItem('exam_token', sessionStorage.getItem('token')) |
||||
this.url = url |
||||
}, |
||||
methods: { |
||||
|
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
iframe { |
||||
height: calc(100vh - 167px); |
||||
} |
||||
</style> |
@ -0,0 +1,57 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between"> |
||||
<el-page-header @back="back" content="理论考试系统程序"></el-page-header> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<div class="page"> |
||||
<div class="tabs m-b-20"> |
||||
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{ |
||||
item |
||||
}}</a> |
||||
</div> |
||||
|
||||
<System v-if="active == 'tab1'" /> |
||||
<Program v-if="active == 'tab2'" /> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import System from './system' |
||||
import Program from './program' |
||||
export default { |
||||
components: { |
||||
System, |
||||
Program, |
||||
}, |
||||
data () { |
||||
return { |
||||
active: 'tab1', |
||||
tabs: { |
||||
tab1: '系统列表', |
||||
tab2: '程序后台', |
||||
}, |
||||
}; |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
tabChange (i) { |
||||
this.active = i |
||||
}, |
||||
back () { |
||||
this.$router.back() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.card { |
||||
min-height: calc(100vh - 300px); |
||||
} |
||||
</style> |
@ -0,0 +1,139 @@ |
||||
<template> |
||||
<div> |
||||
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="curriculumName" label="程序名称" align="center"></el-table-column> |
||||
<el-table-column prop="curriculumType" label="供应商" align="center"></el-table-column> |
||||
<el-table-column prop="userName" label="程序类型" align="center"></el-table-column> |
||||
<el-table-column prop="orderVolume" label="程序归属" align="center"></el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" |
||||
layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import qs from 'qs' |
||||
export default { |
||||
data () { |
||||
return { |
||||
list: [], |
||||
form: { |
||||
curriculumName: this.$route.query.curriculumName || '' |
||||
}, |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
loading: false, |
||||
searchTimer: null |
||||
}; |
||||
}, |
||||
watch: { |
||||
"form.curriculumName": function (val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 获取列表数据 |
||||
getData () { |
||||
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') |
||||
let data = { |
||||
...this.form, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
supplierId: sid ? sid.supplierId : '' |
||||
}; |
||||
this.$post(this.api.curriculumList, data).then(res => { |
||||
this.list = res.page.records |
||||
this.total = res.page.total |
||||
this.loading = false |
||||
}).catch(err => { }) |
||||
}, |
||||
initData () { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 缓存当前页面和参数,详情页返回到列表的时候直接取该url |
||||
setReferrer () { |
||||
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) |
||||
}, |
||||
// 新建课程 |
||||
addcourse () { |
||||
this.setReferrer() |
||||
this.$router.push("/addcurriculum"); |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.setReferrer() |
||||
this.$router.push(`/addcurriculum?cid=${row.cid}`); |
||||
}, |
||||
// 内容设置 |
||||
config (row) { |
||||
this.setReferrer() |
||||
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`); |
||||
}, |
||||
// 删除 |
||||
handleDelete (row) { |
||||
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => { |
||||
if (status === 200) { |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => { |
||||
this.getData(); |
||||
this.$message.success("删除成功"); |
||||
}).catch(err => { }) |
||||
}).catch(() => { |
||||
}); |
||||
} |
||||
}).catch(err => { }) |
||||
}, |
||||
// 批量删除 |
||||
delAllSelection () { |
||||
if (this.multipleSelection.length) { |
||||
let cids = [] |
||||
this.multipleSelection.forEach(i => { |
||||
cids.push('cids=' + i.cid) |
||||
}); |
||||
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => { |
||||
if (status === 200) { |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
let ids = this.multipleSelection.map(i => i.cid); |
||||
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => { |
||||
if (ids.length == this.list.length) { |
||||
if (this.page > 1) { |
||||
this.page = this.page - 1 |
||||
} |
||||
} |
||||
this.getData(); |
||||
this.$message.success("删除成功"); |
||||
this.$refs.table.clearSelection() |
||||
}).catch(err => { }) |
||||
}).catch(() => { }) |
||||
} |
||||
}).catch(err => { }) |
||||
} else { |
||||
this.$message.warning("请先选择课程 !"); |
||||
} |
||||
}, |
||||
// 处理页码切换 |
||||
handleCurrentChange (val) { |
||||
this.page = val; |
||||
this.$router.push(`/curriculum?page=${val}`) |
||||
this.getData(); |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped></style> |
@ -0,0 +1,321 @@ |
||||
<template> |
||||
<div> |
||||
<div class="tool"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>搜索:</label> |
||||
<el-input placeholder="请输入系统名称" suffix-icon="el-icon-search" v-model="curriculumName" clearable |
||||
size="small"></el-input> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button type="primary" round @click="add">新增系统</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="curriculumName" label="系统名称" align="center"></el-table-column> |
||||
<el-table-column prop="curriculumType" label="系统分类" align="center"></el-table-column> |
||||
<el-table-column prop="userName" label="系统描述" align="center"></el-table-column> |
||||
<el-table-column label="创建时间" align="center"></el-table-column> |
||||
<el-table-column prop="orderVolume" label="创建人" align="center"></el-table-column> |
||||
<el-table-column prop="expectedCourse" label="系统后台" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="edit(scope.row)">进入</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" |
||||
layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
|
||||
<!-- 新增编辑系统 --> |
||||
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '系统'" :visible.sync="systemVisible" width="400px" |
||||
:close-on-click-modal="false"> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
<el-form-item prop="workNumber" label="关联程序"> |
||||
<el-input value="理论考试系统程序" disabled class="m-r-10" style="width: 240px;" /> |
||||
<el-button type="text" @click="showProgram">查看</el-button> |
||||
</el-form-item> |
||||
<el-form-item prop="userName" label="系统名称"> |
||||
<el-input v-model.trim="form.userName" placeholder="请输入系统名称"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="account" label="系统分类"> |
||||
<el-select v-model="form.operator" class="m-r-10" style="width: 230px;"> |
||||
<!-- <el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option> --> |
||||
</el-select> |
||||
<el-button type="text" @click="customType">自定义</el-button> |
||||
</el-form-item> |
||||
<el-form-item prop="email" label="系统描述"> |
||||
<el-input v-model.trim="form.email" type="textarea" :rows="4" placeholder="请输入系统描述"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="systemVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="submitSystem">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<!-- 程序列表 --> |
||||
<el-dialog title="程序列表" :visible.sync="programVisible" width="600px" :close-on-click-modal="false"> |
||||
<Program /> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="programVisible = false">关闭</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<!-- 系统分类设置 --> |
||||
<el-dialog title="系统分类设置" :visible.sync="typeVisible" width="600px" :close-on-click-modal="false" |
||||
class="manage-dia"> |
||||
<div class="plus"> |
||||
<i class="el-icon-circle-plus-outline" @click="addClass"></i> |
||||
</div> |
||||
<el-table :data="types" ref="table" header-align="center" row-key="id"> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130"> |
||||
<template slot-scope="scope"> |
||||
<el-input v-if="scope.row.edit" placeholder="请输入分类名称" v-model="scope.row.classificationName" clearable |
||||
maxlength="30"></el-input> |
||||
<span v-else>{{ scope.row.classificationName }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="updateTime1" label="已引用系统数量" align="center" min-width="60">否</el-table-column> |
||||
<el-table-column label="操作" align="center" min-width="60"> |
||||
<template slot-scope="scope"> |
||||
<i v-if="scope.row.edit" class="el-icon-check action m-r-10" @click="submitClass(scope.row)"></i> |
||||
<i v-else class="el-icon-edit action m-r-10" @click="editClass(scope.row)"></i> |
||||
<i class="el-icon-delete action" @click="delClass(scope.row, scope.$index)"></i> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<span slot="footer"> |
||||
<el-button @click="closeClass">返回</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Program from './program' |
||||
export default { |
||||
components: { |
||||
Program, |
||||
}, |
||||
data () { |
||||
return { |
||||
list: [], |
||||
curriculumName: this.$route.query.curriculumName || '', |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
loading: false, |
||||
searchTimer: null, |
||||
|
||||
systemVisible: false, |
||||
form: {}, |
||||
rules: { |
||||
roleList: [ |
||||
{ required: true, message: '请输入系统名称', trigger: 'blur' } |
||||
], |
||||
type: [ |
||||
{ required: true, message: '请选择系统分类', trigger: 'change' } |
||||
], |
||||
}, |
||||
|
||||
programVisible: false, |
||||
|
||||
types: [], |
||||
typeVisible: false, |
||||
}; |
||||
}, |
||||
watch: { |
||||
curriculumName: function (val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted () { |
||||
// this.getData() |
||||
}, |
||||
methods: { |
||||
// 获取列表数据 |
||||
getData () { |
||||
let data = { |
||||
curriculumName: this.curriculumName, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
}; |
||||
this.$post(this.api.curriculumList, data).then(res => { |
||||
this.list = res.page.records |
||||
this.total = res.page.total |
||||
this.loading = false |
||||
}).catch(err => { }) |
||||
}, |
||||
initData () { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 新建 |
||||
add () { |
||||
this.systemVisible = true |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.$router.push(`/addcurriculum?cid=${row.cid}`); |
||||
}, |
||||
// 内容设置 |
||||
config (row) { |
||||
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`); |
||||
}, |
||||
// 删除 |
||||
handleDelete (row) { |
||||
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => { |
||||
if (status === 200) { |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => { |
||||
this.getData(); |
||||
this.$message.success("删除成功"); |
||||
}).catch(err => { }) |
||||
}).catch(() => { |
||||
}); |
||||
} |
||||
}).catch(err => { }) |
||||
}, |
||||
// 批量删除 |
||||
delAllSelection () { |
||||
if (this.multipleSelection.length) { |
||||
let cids = [] |
||||
this.multipleSelection.forEach(i => { |
||||
cids.push('cids=' + i.cid) |
||||
}); |
||||
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => { |
||||
if (status === 200) { |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
let ids = this.multipleSelection.map(i => i.cid); |
||||
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => { |
||||
if (ids.length == this.list.length) { |
||||
if (this.page > 1) { |
||||
this.page = this.page - 1 |
||||
} |
||||
} |
||||
this.getData(); |
||||
this.$message.success("删除成功"); |
||||
this.$refs.table.clearSelection() |
||||
}).catch(err => { }) |
||||
}).catch(() => { }) |
||||
} |
||||
}).catch(err => { }) |
||||
} else { |
||||
this.$message.warning("请先选择课程 !"); |
||||
} |
||||
}, |
||||
// 处理页码切换 |
||||
handleCurrentChange (val) { |
||||
this.page = val; |
||||
this.$router.push(`/curriculum?page=${val}`) |
||||
this.getData(); |
||||
}, |
||||
|
||||
// 查看关联程序 |
||||
showProgram () { |
||||
this.programVisible = true |
||||
}, |
||||
|
||||
// 自定义系统分类 |
||||
customType () { |
||||
this.typeVisible = true |
||||
}, |
||||
// 获取所属分类 |
||||
getType (detail) { |
||||
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => { |
||||
this.types = data |
||||
// 如果所选分类被删除,则清空分类id |
||||
if (detail) { |
||||
const id = this.form.classificationId |
||||
if (!data.find(e => e.id == id)) this.form.classificationId = '' |
||||
setTimeout(() => { |
||||
this.updateTime = 0 |
||||
}, 500) |
||||
} |
||||
}).catch(err => { }) |
||||
}, |
||||
// 新增分类 |
||||
addClass () { |
||||
this.types.find(e => e.edit) ? |
||||
Util.errorMsg('请先保存分类!') : |
||||
this.types.push({ |
||||
edit: true, |
||||
id: '', |
||||
classificationName: '' |
||||
}) |
||||
}, |
||||
// 编辑分类 |
||||
editClass (row) { |
||||
this.types.find(e => e.edit) ? |
||||
Util.errorMsg('请先保存分类!') : |
||||
this.$set(row, 'edit', 1) |
||||
}, |
||||
// 删除分类 |
||||
delClass (row, i) { |
||||
if (row.id) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => { |
||||
Util.successMsg('删除成功') |
||||
this.getType() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
} else { |
||||
this.types.splice(i, 1) |
||||
} |
||||
}, |
||||
// 提交所属分类 |
||||
submitClass (row, showMsg = 1) { |
||||
if (!row.classificationName) return Util.errorMsg('请输入分类名称') |
||||
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => { |
||||
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { |
||||
classificationName: row.classificationName, |
||||
typeId: this.typeId, // 类型(1.学习2.资讯) |
||||
id: row.id, |
||||
}).then(res => { |
||||
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
||||
this.getType() |
||||
}).catch(res => { }) |
||||
}).catch(res => { }) |
||||
}, |
||||
|
||||
// 系统提交 |
||||
submitSystem () { |
||||
|
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.plus { |
||||
margin-bottom: 10px; |
||||
font-size: 18px; |
||||
color: #9278ff; |
||||
text-align: right; |
||||
cursor: pointer; |
||||
} |
||||
|
||||
.action { |
||||
cursor: pointer; |
||||
} |
||||
</style> |