Branch_d40a2540 V2.3.1
yujialong 1 year ago
parent 055566f7d9
commit 3ebf81ed6c
  1. 1
      src/api/index.js
  2. 4
      src/layouts/header/index.vue
  3. 724
      src/pages/achievement/list/index.vue
  4. 22
      src/pages/achievement/teach/index.vue
  5. 2
      src/pages/assessment/list/index.vue
  6. 9
      src/pages/expSystem/list/index.vue
  7. 504
      src/pages/match/add/step3.vue
  8. 2
      src/pages/station/list/index.vue
  9. 13
      src/pages/station/preview/index.vue

@ -411,6 +411,7 @@ export default {
listMarketing: `nakadai/nakadai/mall/marketing/promotion/pagingQueryList`,
// 实验系统管理
getSystemByCustomers: `nakadai/nakadai/customer/getSystemByCustomers`,
getAllService: `nakadai/nakadai/serviceConfiguration/getAllService`,
schoolModelClassification: `nakadai/nakadai/model/reference/schoolModelClassification`,
saveAcademyModelDemo: `nakadai/nakadai/model/reference/demo/saveAcademyModelDemo`,

@ -153,8 +153,8 @@ export default {
},
initSocket ({ id, account }) {
// socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`wss://${Setting.isDev ? '192.168.31.51' : location.host}/nakadai/websocket/${id}/${account}`)
// this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket
this.socket.onopen = this.open;
// socket

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

@ -48,11 +48,11 @@
<div class="wrong">
<div class="line">
<span class="jud-name">错误率最高{{ max.judgmentName }}</span>
<span>参加考试{{ max.peopleNum }}&emsp;&emsp;{{ max.errorTotal }}人做错错误率{{ max.errorRate }}%</span>
<span>参加考试{{ permissions ? max.peopleNum : peopleNum }}&emsp;&emsp;{{ permissions ? `${max.errorTotal}人做错,` : '' }}错误率{{ max.errorRate }}%</span>
</div>
<div class="line">
<span class="jud-name">错误率最低{{ min.judgmentName }}</span>
<span>参加考试{{ min.peopleNum }}&emsp;&emsp;{{ min.errorTotal }}人做错错误率{{ min.errorRate }}%</span>
<span>参加考试{{ permissions ? min.peopleNum : peopleNum }}&emsp;&emsp;{{ permissions ? `${min.errorTotal}人做错,` : '' }}错误率{{ min.errorRate }}%</span>
</div>
</div>
<div class="chart"
@ -285,10 +285,6 @@ export default {
id: '0',
name: '成绩报告'
},
{
id: '1',
name: '活跃度'
},
],
activations: [],
multipleSelectionActivation: [],
@ -306,7 +302,13 @@ export default {
}
},
mounted () {
this.permissions && this.getSpliceClass() //
//
this.permissions ?
this.getSpliceClass() :
this.tabs.push({
id: '1',
name: '活跃度'
})
this.getData()
},
methods: {
@ -347,8 +349,8 @@ export default {
this.maxScore = res.maxScore
this.minScore = res.minScore
this.errorAnalysis = res.errorAnalysis
this.max = res.highestErrorRate
this.min = res.minimumErrorRate
this.max = res.highestErrorRate || {}
this.min = res.minimumErrorRate || {}
this.handlePage()
this.getChart()
this.errorChart()
@ -529,7 +531,7 @@ export default {
data: ["0", "10", "20", "30", "40", "50", "60", "70", "80", "90", '100']
},
yAxis: {
name: "人数",
name: this.permissions ? "人数" : '成绩报告数量',
type: "value",
interval: 1
},

@ -57,7 +57,7 @@
value=""></el-option>
<el-option v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:label="item.goodsName"
:value="item.cid"></el-option>
</el-select>
</li>

@ -79,7 +79,6 @@ import Setting from "@/setting";
export default {
data () {
return {
systemAttribution: "",
systemType: "",
systemSearch: "",
searchTimer: null,
@ -129,16 +128,14 @@ export default {
},
getData () {
let data = {
belong: this.systemAttribution,
type: this.systemType,
systemName: this.systemSearch,
pageNum: this.pageNo,
pageSize: this.pageSize,
supplierId: ''
};
this.$post(this.api.getAllService, data).then(res => {
this.systemData = res.serviceList.records;
this.totals = res.serviceList.total;
this.$post(this.api.getSystemByCustomers, data).then(({ data }) => {
this.systemData = data.records;
this.totals = data.total;
}).catch(res => {
});
},

@ -1,158 +1,146 @@
<template>
<div>
<div v-show="!setVisible"
class="page">
<div class="page-content">
<div class="p-title">比赛内容设置</div>
<el-form label-width="170px"
label-suffix=":"
size="small"
:disabled="!editing && id">
<div v-for="(item, i) in form"
:key="i"
class="step">
<div class="title">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span>
<el-button v-if="item.method !== 2"
type="primary"
@click="toSet(i)">设置</el-button>
</div>
<el-form-item class="req"
prop="time"
label="比赛时间">
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' ' + item.endTime }}</span>
<div style="display: flex;align-items: center;"
v-if="item.method === 2">
<el-date-picker v-model="item.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert style="width: auto;padding: 0px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark">
</el-alert>
</div>
</el-form-item>
<template v-if="item.method === 2">
<el-form-item class="req"
label="比赛地点">
<el-input v-model="item.offlineAddress"
style="width: 80%"></el-input>
</el-form-item>
<el-form-item class="req"
label="比赛内容">
<el-input v-model="item.contentDescription"
type="textarea"
style="width: 80%"></el-input>
</el-form-item>
<el-form-item class="req"
label="评分规则">
<el-input v-model="item.scoreRule"
type="textarea"
style="width: 80%"></el-input>
</el-form-item>
</template>
<template v-else>
<el-form-item class="req"
prop="cid"
label="课程系统">
{{ item.systemName }}
</el-form-item>
<el-form-item class="req"
prop="assessmentId"
label="已选择考核">
{{ item.projectName }}
</el-form-item>
<el-form-item class="req"
prop="resultAnnouncementTime"
label="比赛地点">
<div class="line">
<el-checkbox v-model="item.onlineButton">线上</el-checkbox>
<el-input v-model="item.onlineAddress"
clearable
placeholder="请输入比赛网址"
:disabled="!item.onlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
<div class="line">
<el-checkbox v-model="item.offlineButton">线下</el-checkbox>
<el-input v-model="item.offlineAddress"
clearable
placeholder="请输入地址"
:disabled="!item.offlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
</el-form-item>
</template>
<el-card shadow="hover"
class="m-b-20">
<div>
<p class="m-b-20">比赛名称</p>
{{ form.stageName }}
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div>
<p class="m-b-20">比赛时间</p>
<div class="date-inputs">
起止时间
<div style="display: inline-flex;align-items: center;">
<el-date-picker v-model="form.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark">
</el-alert>
</div>
</el-form>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="mgr20 m-b-20">
<div>
<p class="m-b-20">课程</p>
<div class="inline-input">
<el-select v-model="form.cid"
@change="courseChange">
<el-option v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid">
</el-option>
</el-select>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between m-b-20">
<span>实训项目</span>
<div style="display: inline-flex;">
<div>
<el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</div>
<el-button style="margin-left: 5px"
type="primary"
round
@click="toProject">自定义实验项目</el-button>
</div>
</div>
<!-- 实训项目表格 -->
<el-table :data="projects"
class="table"
stripe
header-align="center">
<el-table-column width="60"
label="选择"
align="center">
<template slot-scope="scope">
<el-radio v-model="form.projectId"
:label="scope.row.projectId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="auth"
label="项目权限"
align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="founder"
label="创建人"
align="center">
<template slot-scope="scope">
{{ scope.row.founder ? '老师创建' : '系统内置' }}
</template>
</el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"></el-table-column>
<!-- <el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showProject(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>
</el-card>
<set v-if="setVisible"
:form.sync="form[curStep]"
:step1.sync="step1"
@hideSet="hideSet" />
<div style="text-align: center">
<el-button @click="back">返回</el-button>
<el-button type="primary"
@click="save">保存</el-button>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import set from './set'
import { Loading } from 'element-ui'
export default {
props: ['setupId', 'competitionId', 'editing'],
props: ['form', 'step1'],
data () {
return {
id: this.$route.query.id,
updateTime: 0,
step1: this.$parent.$refs.step1.form,
cache: this.$store.state.match.cache,
nums: ['一', '二', '三'],
methods: [
{
id: 0,
name: '实操'
},
{
id: 1,
name: '理论'
},
{
id: 2,
name: '线下'
}
],
originForm: {
cid: '',
mallId: '',
contentDescription: '',
endTime: '',
scoreRule: '',
stageId: '',
startTime: '',
systemId: '',
offlineAddress: '',
offlineButton: 0,
onlineAddress: '',
onlineButton: 0,
time: []
},
form: [],
setVisible: false,
curStep: 0,
pass: 0
loadIns: null,
curriculumList: [],
keyword: '',
projects: [],
page: 1,
pageSize: 5,
total: 0,
sysId: '',
permissionsKeys: ['练习', '考核', '竞赛'],
timeInvalid: false
};
},
components: {
set
},
watch: {
// ,
form: {
@ -161,55 +149,70 @@ export default {
},
deep: true
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.handleForm()
this.getCourse()
},
methods: {
//
resumeData () {
if (this.cache) {
this.curStep = this.cache.curStep
if (this.cache.form) this.form = this.cache.form
this.setVisible = true
this.$store.commit('match/setCache', null)
}
//
getCourse () {
this.loadIns = Loading.service()
this.$get(this.api.curriculumList).then(({ data }) => {
const list = data
this.curriculumList = data
if (!this.form.cid && list.length) this.form.cid = list[0].cid
this.courseChange()
}).catch(err => {
this.loadIns.close()
});
},
// form
handleForm () {
// id
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => {
res.competitionStages.map(e => {
const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm))
if (form.startTime) {
form.time = [form.startTime, form.endTime]
} else {
form.time = []
}
form.offlineButton = !!form.offlineButton
form.onlineButton = !!form.onlineButton
form.method = e.method
form.stageId = e.stageId
form.stageName = e.stageName
this.form.push(form)
})
this.resumeData()
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(res => { })
//
courseChange (val) {
const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
this.sysId = systemId
if (val) this.loadIns = Loading.service()
this.getProject()
},
//
getProject () {
this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page,
pageSize: this.pageSize,
cid: this.form.cid,
projectName: this.keyword,
systemId: this.sysId,
permissions: 2
}).then(({ data }) => {
this.projects = data.records
this.total = data.total
this.loadIns.close()
}).catch(err => {
this.loadIns.close()
});
},
initData () {
this.page = 1;
this.getProject();
},
//
toSet (i) {
this.curStep = i
this.$parent.showBtns = false
this.setVisible = true
handleCurrentChange (val) {
this.page = val;
this.getProject();
},
//
hideSet (form) {
if (form) this.form[this.curStep] = form
this.setVisible = false
this.$parent.showBtns = true
//
toProject () {
const { form, curStep } = this.$parent
form[curStep] = this.form
this.$store.commit('match/setCache', {
form,
curStep
})
this.$router.push(`/project/list?show=1`)
},
//
timeChange (val) {
@ -217,8 +220,12 @@ export default {
const startTime = new Date(val[0])
const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
const { form, curStep } = this
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) {
this.timeInvalid = true
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
}
this.timeInvalid = false
const { form, curStep } = this.$parent
for (const i in form) {
//
if (i !== curStep) {
@ -232,124 +239,29 @@ export default {
}
}
},
//
publish () {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
},
//
save (status, next = 0, releaseType, cb) {
save () {
const { form } = this
if (!form.length) {
this.$parent.hideLoad()
util.successMsg('保存成功')
this.$emit('next', next)
return
}
//
if (status) {
let invalid = 0
const { playStartTime, playEndTime } = this.step1
for (const e of form) {
if (!e.time.length) {
invalid = 1
util.errorMsg('请选择比赛时间')
break
}
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) {
invalid = 1
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break
}
e.startTime = e.time[0]
e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) {
invalid = 1
util.errorMsg('请选择课程')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
}
if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
}
}
if (invalid) return
}
//
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
}
this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form
}).then(res => {
this.$parent.hideLoad()
//
status && this.publish(status)
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next, cb)
}).catch(err => {
this.$parent.hideLoad()
})
if (!form.time.length) return util.warningMsg('请选择比赛时间')
const { playStartTime, playEndTime } = this.step1
if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName
if (systemName) form.systemName = systemName
form.startTime = form.time[0]
form.endTime = form.time[1]
this.$emit('hideSet', this.form)
},
//
back () {
this.$emit('hideSet')
}
}
};
</script>
<style scoped lang="scss">
.step {
padding-bottom: 10px;
background-color: #f9f9f9;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
margin-bottom: 10px;
background-color: #ededed;
}
}
.line {
margin-bottom: 10px;
}
/deep/.req {
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
}
}
</style>

@ -91,7 +91,7 @@ export default {
});
},
goPreview (item) {
this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.curriculumName}&mallId=${item.mallId || ''}&admin=1`);
this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&admin=1`);
},
// tab
tabChange (item) {

@ -250,7 +250,8 @@
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(item)"></i>
<i v-if="deleteIdentity || item.currentAccountId == item.createAccountId"
<!-- 当前用户是管理员 || 该条评论是学生发的没有createRoleName即是学生 || 当前用户的account==该条评论的创建人accountId -->
<i v-if="item.currentRoleName.includes('管理员') || !item.createRoleName || item.currentAccountId == item.createAccountId"
class="icon el-icon-delete"
@click="delComment(item)"></i>
@ -292,7 +293,7 @@
<div class="texts">
<div class="name">{{reply.createUsername}}</div>
<div class="flex m-v-8">
<template>
<template v-if="reply.level !== 2">
回复
<span class="reply-name">@{{ reply.replyUsername }}</span>
</template>
@ -303,7 +304,8 @@
<div class="action">
<i class="icon el-icon-chat-dot-square"
@click="showReplay(reply)"></i>
<i v-if="deleteIdentity || reply.currentAccountId == reply.createAccountId"
<!-- 当前用户是管理员 || 该条评论是学生发的没有createRoleName即是学生 || 当前用户的account==该条评论的创建人accountId -->
<i v-if="reply.currentRoleName.includes('管理员') || !reply.createRoleName || reply.currentAccountId == reply.createAccountId"
class="icon el-icon-delete"
@click="delComment(reply)"></i>
<!-- <div class="like-wrap"
@ -563,7 +565,7 @@ export default {
},
// 使
addRecord () {
this.$post(`${this.api.recordRecentUsage}?cid=${this.courseId}`).then(res => { }).catch(res => { })
this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}`).then(res => { }).catch(res => { })
},
//
getStatus () {
@ -951,6 +953,7 @@ export default {
util.cookies.set('systemId', id)
util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1)
util.cookies.set('language', '', -1)
// 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8085/#/` :
@ -967,6 +970,8 @@ export default {
if (systemId == 11) {
//
sessionStorage.removeItem('projectId')
sessionStorage.removeItem('submited')
location.href = `${Setting.bankPath}/#/index/list?curriculumName=${this.curriculumName}&token=${token}&cid=${this.courseId}&systemId=${this.systemIds}&projectId=${this.curProject}&assessmentId=&classId=&stopTime=&test=true&manager=1`
} else if (systemId == 12) {
//

Loading…
Cancel
Save