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`, listMarketing: `nakadai/nakadai/mall/marketing/promotion/pagingQueryList`,
// 实验系统管理 // 实验系统管理
getSystemByCustomers: `nakadai/nakadai/customer/getSystemByCustomers`,
getAllService: `nakadai/nakadai/serviceConfiguration/getAllService`, getAllService: `nakadai/nakadai/serviceConfiguration/getAllService`,
schoolModelClassification: `nakadai/nakadai/model/reference/schoolModelClassification`, schoolModelClassification: `nakadai/nakadai/model/reference/schoolModelClassification`,
saveAcademyModelDemo: `nakadai/nakadai/model/reference/demo/saveAcademyModelDemo`, saveAcademyModelDemo: `nakadai/nakadai/model/reference/demo/saveAcademyModelDemo`,

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

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

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

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

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

@ -1,158 +1,146 @@
<template> <template>
<div> <div>
<div v-show="!setVisible" <el-card shadow="hover"
class="page"> class="m-b-20">
<div class="page-content"> <div>
<div class="p-title">比赛内容设置</div> <p class="m-b-20">比赛名称</p>
<el-form label-width="170px" {{ form.stageName }}
label-suffix=":" </div>
size="small" </el-card>
:disabled="!editing && id"> <el-card shadow="hover"
<div v-for="(item, i) in form" class="m-b-20">
:key="i" <div>
class="step"> <p class="m-b-20">比赛时间</p>
<div class="title"> <div class="date-inputs">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span> 起止时间
<el-button v-if="item.method !== 2" <div style="display: inline-flex;align-items: center;">
type="primary" <el-date-picker v-model="form.time"
@click="toSet(i)">设置</el-button> type="datetimerange"
</div> range-separator="~"
<el-form-item class="req" start-placeholder="开始日期"
prop="time" end-placeholder="结束日期"
label="比赛时间"> format="yyyy-MM-dd HH:mm:ss"
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' ' + item.endTime }}</span> value-format="yyyy-MM-dd HH:mm:ss"
<div style="display: flex;align-items: center;" @change="timeChange">
v-if="item.method === 2"> </el-date-picker>
<el-date-picker v-model="item.time" <el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;"
type="datetimerange" :title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
range-separator="~" type="error"
start-placeholder="开始日期" :closable="false"
end-placeholder="结束日期" effect="dark">
format="yyyy-MM-dd HH:mm:ss" </el-alert>
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>
</div> </div>
</el-form> </div>
</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" <div style="text-align: center">
:form.sync="form[curStep]" <el-button @click="back">返回</el-button>
:step1.sync="step1" <el-button type="primary"
@hideSet="hideSet" /> @click="save">保存</el-button>
</div>
</div> </div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import set from './set' import { Loading } from 'element-ui'
export default { export default {
props: ['setupId', 'competitionId', 'editing'], props: ['form', 'step1'],
data () { data () {
return { return {
id: this.$route.query.id, loadIns: null,
updateTime: 0, curriculumList: [],
step1: this.$parent.$refs.step1.form, keyword: '',
cache: this.$store.state.match.cache, projects: [],
nums: ['一', '二', '三'], page: 1,
methods: [ pageSize: 5,
{ total: 0,
id: 0, sysId: '',
name: '实操' permissionsKeys: ['练习', '考核', '竞赛'],
}, timeInvalid: false
{
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
}; };
}, },
components: {
set
},
watch: { watch: {
// , // ,
form: { form: {
@ -161,55 +149,70 @@ export default {
}, },
deep: true deep: true
}, },
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
}, },
mounted () { mounted () {
this.handleForm() this.getCourse()
}, },
methods: { methods: {
// //
resumeData () { getCourse () {
if (this.cache) { this.loadIns = Loading.service()
this.curStep = this.cache.curStep this.$get(this.api.curriculumList).then(({ data }) => {
if (this.cache.form) this.form = this.cache.form const list = data
this.setVisible = true this.curriculumList = data
this.$store.commit('match/setCache', null) if (!this.form.cid && list.length) this.form.cid = list[0].cid
} this.courseChange()
}).catch(err => {
this.loadIns.close()
});
}, },
// form //
handleForm () { courseChange (val) {
// id const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => { this.sysId = systemId
res.competitionStages.map(e => { if (val) this.loadIns = Loading.service()
const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm)) this.getProject()
if (form.startTime) { },
form.time = [form.startTime, form.endTime] //
} else { getProject () {
form.time = [] this.$post(this.api.getProjectAssessmentByCompetition, {
} pageNum: this.page,
form.offlineButton = !!form.offlineButton pageSize: this.pageSize,
form.onlineButton = !!form.onlineButton cid: this.form.cid,
form.method = e.method projectName: this.keyword,
form.stageId = e.stageId systemId: this.sysId,
form.stageName = e.stageName permissions: 2
this.form.push(form) }).then(({ data }) => {
}) this.projects = data.records
this.resumeData() this.total = data.total
this.$nextTick(() => { this.loadIns.close()
this.updateTime = 0 }).catch(err => {
}) this.loadIns.close()
}).catch(res => { }) });
},
initData () {
this.page = 1;
this.getProject();
}, },
// handleCurrentChange (val) {
toSet (i) { this.page = val;
this.curStep = i this.getProject();
this.$parent.showBtns = false
this.setVisible = true
}, },
// //
hideSet (form) { toProject () {
if (form) this.form[this.curStep] = form const { form, curStep } = this.$parent
this.setVisible = false form[curStep] = this.form
this.$parent.showBtns = true this.$store.commit('match/setCache', {
form,
curStep
})
this.$router.push(`/project/list?show=1`)
}, },
// //
timeChange (val) { timeChange (val) {
@ -217,8 +220,12 @@ export default {
const startTime = new Date(val[0]) const startTime = new Date(val[0])
const endTime = new Date(val[1]) const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) {
const { form, curStep } = this this.timeInvalid = true
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
}
this.timeInvalid = false
const { form, curStep } = this.$parent
for (const i in form) { for (const i in form) {
// //
if (i !== curStep) { 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 const { form } = this
if (!form.length) { if (!form.time.length) return util.warningMsg('请选择比赛时间')
this.$parent.hideLoad() const { playStartTime, playEndTime } = this.step1
util.successMsg('保存成功') if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
this.$emit('next', next) if (!form.cid) return util.warningMsg('请选择课程')
return if (!form.projectId) return util.warningMsg('请选择项目')
} const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
// if (systemId) form.systemId = systemId
if (status) { if (projectName) form.projectName = projectName
let invalid = 0 if (systemName) form.systemName = systemName
const { playStartTime, playEndTime } = this.step1 form.startTime = form.time[0]
for (const e of form) { form.endTime = form.time[1]
if (!e.time.length) { this.$emit('hideSet', this.form)
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()
})
}, },
//
back () {
this.$emit('hideSet')
}
} }
}; };
</script> </script>
<style scoped lang="scss"> <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> </style>

@ -91,7 +91,7 @@ export default {
}); });
}, },
goPreview (item) { 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 // tab
tabChange (item) { tabChange (item) {

@ -250,7 +250,8 @@
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square" <i class="icon el-icon-chat-dot-square"
@click="showReplay(item)"></i> @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" class="icon el-icon-delete"
@click="delComment(item)"></i> @click="delComment(item)"></i>
@ -292,7 +293,7 @@
<div class="texts"> <div class="texts">
<div class="name">{{reply.createUsername}}</div> <div class="name">{{reply.createUsername}}</div>
<div class="flex m-v-8"> <div class="flex m-v-8">
<template> <template v-if="reply.level !== 2">
回复 回复
<span class="reply-name">@{{ reply.replyUsername }}</span> <span class="reply-name">@{{ reply.replyUsername }}</span>
</template> </template>
@ -303,7 +304,8 @@
<div class="action"> <div class="action">
<i class="icon el-icon-chat-dot-square" <i class="icon el-icon-chat-dot-square"
@click="showReplay(reply)"></i> @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" class="icon el-icon-delete"
@click="delComment(reply)"></i> @click="delComment(reply)"></i>
<!-- <div class="like-wrap" <!-- <div class="like-wrap"
@ -563,7 +565,7 @@ export default {
}, },
// 使 // 使
addRecord () { 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 () { getStatus () {
@ -951,6 +953,7 @@ export default {
util.cookies.set('systemId', id) util.cookies.set('systemId', id)
util.cookies.set('fromManager', 1) util.cookies.set('fromManager', 1)
util.cookies.set('isSubmit', '', -1) util.cookies.set('isSubmit', '', -1)
util.cookies.set('language', '', -1)
// 8pythoncookiesystemId // 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ? location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8085/#/` : `http://${location.hostname}:8085/#/` :
@ -967,6 +970,8 @@ export default {
if (systemId == 11) { 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` 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) { } else if (systemId == 12) {
// //

Loading…
Cancel
Save