dev_2022-05-11
yujialong 3 years ago
commit 5b6ab91ffa
  1. 3
      src/api/index.js
  2. 6
      src/layouts/navbar/index.vue
  3. 5
      src/pages/account/login/index.vue
  4. 101
      src/pages/achievement/ass/index.vue
  5. 65
      src/pages/achievement/list/index.vue
  6. 44
      src/pages/achievement/show/index.vue
  7. 27
      src/pages/achievement/teach/index.vue
  8. 40
      src/pages/achievement/vir/index.vue
  9. 68
      src/pages/assessment/add/index.vue
  10. 213
      src/pages/assessment/list/index.vue
  11. 141
      src/pages/match/manage/matchDetail.vue
  12. 68
      src/pages/match/manage/matchProgress.vue
  13. 3
      src/pages/project/add/index.vue
  14. 1080
      src/pages/project/add/index.vue.copy
  15. 17
      src/pages/project/list/index.vue
  16. 53
      src/pages/student/list/index.vue
  17. 11
      src/pages/system/list/role.vue
  18. 64
      src/pages/system/list/staff.vue
  19. 4
      src/setting.js
  20. 2
      src/store/modules/user.js
  21. 2
      src/styles/common.scss

@ -52,10 +52,10 @@ export default {
pageByCondition: `${host}occupationlab/assessment/pageByCondition`, // 考核管理列表 pageByCondition: `${host}occupationlab/assessment/pageByCondition`, // 考核管理列表
saveAssessment: `${host}occupationlab/assessment/saveAssessment`, // 创建考核 saveAssessment: `${host}occupationlab/assessment/saveAssessment`, // 创建考核
modifyAssessment: `${host}occupationlab/assessment/modifyAssessment`, // 编辑考核 modifyAssessment: `${host}occupationlab/assessment/modifyAssessment`, // 编辑考核
enableAssessment: `${host}occupationlab/assessment/enableAssessment`, // 修改考核状态
getDetailById: `${host}occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情 getDetailById: `${host}occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情
deleteAssessment: `${host}occupationlab/assessment/deleteAssessment`, // 单个、批量删除 deleteAssessment: `${host}occupationlab/assessment/deleteAssessment`, // 单个、批量删除
collectPaper: `${host}occupationlab/assessment/collectPaper`, // 收卷(提前结束) collectPaper: `${host}occupationlab/assessment/collectPaper`, // 收卷(提前结束)
schoolCourse: `${host}nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程 schoolCourse: `${host}nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程
projectListByCourseId: `${host}nakadai/nakadai/curriculum/projectListByCourseId`, // 根据课程id获取实训项目列表 projectListByCourseId: `${host}nakadai/nakadai/curriculum/projectListByCourseId`, // 根据课程id获取实训项目列表
@ -68,6 +68,7 @@ export default {
getPracticeDetail: `${host}occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情 getPracticeDetail: `${host}occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
myClass: `${host}occupationlab/achievement/myClass`, // 教师端:我的班级 myClass: `${host}occupationlab/achievement/myClass`, // 教师端:我的班级
deleteReportById: `${host}occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核 deleteReportById: `${host}occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核
experimentOverview: `${host}occupationlab/achievement/reportDetail`, // 查看实验报告
// 项目管理 // 项目管理
getSystemIdBySchool: `${host}occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统 getSystemIdBySchool: `${host}occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统

@ -54,7 +54,7 @@ export default {
{ {
icon: "el-icon-collection", icon: "el-icon-collection",
index: "/achievement/list", index: "/achievement/list",
title: "成绩管理" title: "成绩管理",
}, },
{ {
icon: "el-icon-news", icon: "el-icon-news",
@ -102,7 +102,9 @@ export default {
for (let i in this.actives) { for (let i in this.actives) {
if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`; if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`;
} }
this.active = this.$route.path; let arr=this.$route.path.split("/");
let name = `/${arr[1]}/list`
this.active = name;
} }
}, },
created() { created() {

@ -36,6 +36,9 @@
</div> </div>
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="30%"> <el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="30%">
<div style='padding: 0 13px 20px 13px;'>
依据国家政策法规需绑定手机号进行实网络实名才可登录使用本平台
</div>
<el-form ref="form" label-width="60px"> <el-form ref="form" label-width="60px">
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
@ -217,7 +220,6 @@ export default {
height: 100%; height: 100%;
background-image: url(../../../assets/img/login-bg.png); background-image: url(../../../assets/img/login-bg.png);
background-size: 100%; background-size: 100%;
.header { .header {
width: 100%; width: 100%;
height: 60px; height: 60px;
@ -239,7 +241,6 @@ export default {
} }
} }
} }
/deep/ .main { /deep/ .main {
position: absolute; position: absolute;
left: 50%; left: 50%;

@ -4,17 +4,13 @@
<div class="flex-between m-b-10"> <div class="flex-between m-b-10">
<el-page-header @back="goBack" :content="experimentalName"></el-page-header> <el-page-header @back="goBack" :content="experimentalName"></el-page-header>
</div> </div>
<el-form label-width="100px">
<div class="flex-between">
<div></div>
<div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in classInfo" :label="item.className" :name="item.id"></el-tab-pane>
</el-tabs>
<div class="stat"> <div class="stat">
<div class="nums"> <div class="nums">
<div class="item"> <div class="item">
@ -32,6 +28,14 @@
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-form label-width="100px">
<div class="flex-between">
<div></div>
<div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
<div></div> <div></div>
<div> <div>
<el-button type="primary" @click="delAllData">批量删除</el-button> <el-button type="primary" @click="delAllData">批量删除</el-button>
@ -76,16 +80,19 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
import axios from 'axios';
export default { export default {
data() { data() {
return { return {
systemId: this.$route.query.systemId,
id: this.$route.query.id, id: this.$route.query.id,
classId: this.$route.query.classId,
projectId: this.$route.query.projectId, projectId: this.$route.query.projectId,
projectName: this.$route.query.name, assessmentId:'',
classInfo: [],
experimentalName: this.$route.query.experimentalName, experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class, className: this.$route.query.class,
keyword: "", keyword: "",
@ -94,32 +101,40 @@ export default {
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
avg: 0 avg: 0,
activeName:'',
token: util.local.get(Setting.tokenKey),
}; };
}, },
mounted() { mounted() {
this.classInfo = JSON.parse(this.$route.query.classInfo)
for(var i=0;i<this.classInfo.length;i++){
let id = this.classInfo[i].id
this.classInfo[i].id = id.toString()
}
this.activeName= this.classInfo[0].id
this.id = this.$route.query.id
this.getData(); this.getData();
}, },
methods: { methods: {
handleClick(tab, event) {
this.getData()
},
getData() { getData() {
let data = { this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => {
systemId: this.systemId, if (res.status == 200){
page: this.page, this.avg = res.avgScore
size: this.pageSize, this.total = res.peopleNum
searchContant: this.keyword, let list = res.page.records;
projectId: this.id this.assessmentId = res.page.records[0].assessmentId;
}; let score = 0;
this.$get(this.api.queryEvaluationReport, data).then(res => { list.map(n => {
let list = res.data.list; n.class = this.className;
let score = 0; score += n.score;
list.map(n => { });
n.class = this.className; this.listData = list;
score += n.score; this.getChart();
}); }
this.listData = list;
this.total = res.data.totalCount;
this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0;
this.getChart();
}).catch(res => { }).catch(res => {
}); });
}, },
@ -145,18 +160,28 @@ export default {
}, },
exportData() { exportData() {
if (!this.listData.length) return false; if (!this.listData.length) return false;
let selected = this.multipleSelection; if (this.multipleSelection.length) {
let exportList = []; let ids = this.multipleSelection.map(item => {
if (selected.length) { return item.reportId;
exportList = selected.map(item => {
return item.recordId;
}); });
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} else { } else {
exportList = this.listData.map(item => { axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=`,{
return item.recordId; headers: {
}); token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} }
window.open(`${this.api.exportAchievement}?ids=${exportList.join(",")}&projectId=${this.projectId}&source=2`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {

@ -18,8 +18,8 @@
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable clearable
style="width: 300px" style="width: 300px">
></el-date-picker> </el-date-picker>
</li> </li>
<li> <li>
<label>实验项目分类</label> <label>实验项目分类</label>
@ -34,8 +34,8 @@
v-for="item in classList" v-for="item in classList"
:key="item.id" :key="item.id"
:label="item.className" :label="item.className"
:value="item.id" :value="item.id">
></el-option> </el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
@ -46,8 +46,8 @@
v-for="item in curriculumList" v-for="item in curriculumList"
:key="item.cid" :key="item.cid"
:label="item.curriculumName" :label="item.curriculumName"
:value="item.cid" :value="item.cid">
></el-option> </el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
@ -56,14 +56,11 @@
</ul> </ul>
</div> </div>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter"></ul>
</ul>
<div style="margin-bottom: 24px"> <div style="margin-bottom: 24px">
<el-button v-if="auth('批量删除')" type="primary" @click="delAllData">批量删除</el-button> <el-button v-if="auth('批量删除')" type="primary" @click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <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="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
@ -72,22 +69,23 @@
</template> </template>
</el-table-column> </el-table-column>
<template v-if="projectPermissions == 1"> <template v-if="projectPermissions == 1">
<el-table-column prop="className" label="班级" align="center"></el-table-column> <el-table-column prop="className" label="班级" align="center" min-width="100"></el-table-column>
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column> <el-table-column prop="experimentalName" label="实验名称" align="center" min-width="100"></el-table-column>
</template> </template>
<el-table-column prop="projectName" label="项目名称" align="center" min-width="400"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center" min-width="400"></el-table-column>
<el-table-column prop="projectPermissions" label="分类" align="center"> <el-table-column prop="projectPermissions" label="分类" align="center" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.permissions == 2 ? "竞赛" : projectType.find(n => n.id === scope.row.permissions).name }} {{ scope.row.permissions == 2 ? "竞赛" : projectType.find(n => n.id === scope.row.permissions).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="experimentalNumber" label="成绩报告数量" align="center"></el-table-column> <el-table-column prop="experimentalNumber" label="成绩报告数量" align="center" min-width="100"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"> <el-table-column prop="createTime" label="创建时间" align="center" min-width="200">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center" min-width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="auth('练习成绩管理') || auth('考核成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button> <el-button v-if="auth('练习成绩管理') || auth('考核成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button>
<el-button v-if="auth('删除')" type="text" :disabled="scope.row.isDel !== 0" @click="handleDelete(scope.row)" >删除</el-button> <el-button type="text" v-if="scope.row.isDel == 1" @click="handleDelete(scope.row)" >删除</el-button>
<el-button type="text" v-else style='color:#999' >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -100,7 +98,6 @@
<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() {
@ -109,7 +106,7 @@ export default {
classList: [], classList: [],
curriculumId: "", curriculumId: "",
curriculumList: [], curriculumList: [],
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0, projectPermissions: 0,
keyword: "", keyword: "",
searchTimer: null, searchTimer: null,
startingtime: "", startingtime: "",
@ -121,12 +118,10 @@ export default {
{ {
id: "", id: "",
name: "不限" name: "不限"
}, }, {
{
id: 1, id: 1,
name: "近一个月" name: "近一个月"
}, }, {
{
id: 6, id: 6,
name: "近六个月" name: "近六个月"
} }
@ -135,8 +130,7 @@ export default {
{ {
id: 0, id: 0,
name: "练习" name: "练习"
}, }, {
{
id: 1, id: 1,
name: "考核" name: "考核"
} }
@ -175,6 +169,14 @@ export default {
} }
}, },
mounted() { mounted() {
let per = this.$route.query.per
console.log(per)
if(per == '1'){
per = 1
}else{
per = 0
}
this.projectPermissions = per
this.getschoolCourse(); this.getschoolCourse();
this.getClassData(); this.getClassData();
}, },
@ -186,7 +188,6 @@ export default {
this.getData(); this.getData();
} }
}).catch(err => { }).catch(err => {
console.log(err);
}); });
}, },
getClassData() { // getClassData() { //
@ -210,10 +211,14 @@ export default {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize pageSize: this.pageSize
}; };
this.$post(this.api.getAchievementInfo, data).then(res => { this.$post(this.api.getAchievementInfo, data).then(res => {
this.listData = res.page.records; if(this.projectPermissions == 0){
this.total = res.page.total; this.listData = res.page;
this.total = res.total;
}else{
this.listData = res.page.records;
this.total = res.page.total;
}
this.$nextTick(() => { this.$nextTick(() => {
this.loadIns.close(); this.loadIns.close();
}); });
@ -227,7 +232,7 @@ export default {
this.getData(); this.getData();
}, },
disabledSelection(row, index) { // disabledSelection(row, index) { //
if (row.isDel === 1) return false; if (row.isDel == 0) return false;
return true; return true;
}, },
entry(row) { // entry(row) { //

@ -21,7 +21,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center"> <el-table-column prop="workNumber" label="学生学号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentalClassName" label="学生班级" align="center"> <el-table-column prop="className" label="学生班级" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="instructor" label="指导老师" align="center"> <el-table-column prop="instructor" label="指导老师" align="center">
</el-table-column> </el-table-column>
@ -38,7 +38,7 @@
<div class="meta-title-wrap"> <div class="meta-title-wrap">
<p class="meta-title"><img src="@/assets/img/cup.png" alt=""> 实验项目名称</p> <p class="meta-title"><img src="@/assets/img/cup.png" alt=""> 实验项目名称</p>
</div> </div>
<el-input v-model="form.proName" type="textarea" :disabled="true" rows="5"></el-input> <el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input>
</div> </div>
<div class="m-b-20"> <div class="m-b-20">
@ -59,19 +59,30 @@
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="judgmentPointsName" label="任务名称" align="center"> <el-table-column prop="judgmentName" label="任务名称" align="center">
</el-table-column>
<el-table-column prop="userAnswer" label="考核点" align="center">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords">
<span>{{index+1}}. </span>{{item.name}}
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="userAnswer" label="学生答案" align="center"> <el-table-column prop="userAnswer" label="学生答案" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<pre v-html="scope.row.userAnswer" style="white-space: pre-wrap"></pre> <div v-for="(item, index) in scope.row.lcRuleRecords">
<span>{{index+1}}. </span>{{item.ruleAnswer}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="answer" label="参考答案" align="center"> <el-table-column prop="answer" label="参考答案" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<pre v-html="scope.row.answer" style="white-space: pre-wrap"></pre> <div v-for="(item, index) in scope.row.lcRuleRecords">
<span>{{index+1}}. </span>{{item.ruleAnswer}}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="codeScore" label="得分" align="center"> <el-table-column prop="score" label="得分" align="center">
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@ -157,9 +168,9 @@ export default {
let data = { let data = {
recordId: this.id recordId: this.id
}; };
this.$get(this.api.queryVirtualReport, data).then(res => { this.$get(this.api.experimentOverview, data).then(res => {
this.form = res.data.report; this.form = res.report;
let expData = res.data.data; let expData = res.userScores;
let form = this.form; let form = this.form;
let score = form.score; let score = form.score;
@ -193,12 +204,13 @@ export default {
let data = { let data = {
studentId: this.studentId, studentId: this.studentId,
projectId: this.projectId, projectId: this.projectId,
recordId: this.id, // recordId: this.id,
reportId: this.reportId reportId: this.reportId
}; };
this.$get(this.api.queryArchievement, data).then(res => { this.$get(this.api.experimentOverview, data).then(res => {
this.form = res.data.report ? res.data.report : {}; console.log(res)
let expData = res.data.data; this.form = res.report ? res.report : {};
let expData = res.userScores;
let form = this.form; let form = this.form;
let score = form.score; let score = form.score;
@ -311,8 +323,8 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.box { .box {
padding: 0 50px; //padding: 0 20px;
background-color: #fff; //background-color: #fff;
} }
/deep/ .el-textarea.is-disabled .el-textarea__inner { /deep/ .el-textarea.is-disabled .el-textarea__inner {
@ -329,7 +341,7 @@ export default {
#pdfDom { #pdfDom {
padding: 50px; padding: 50px;
background: #fff;
/deep/ .info-table { /deep/ .info-table {
margin-bottom: 40px; margin-bottom: 40px;
border: 0; border: 0;

@ -77,8 +77,11 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
import axios from 'axios';
export default { export default {
data() { data() {
@ -97,7 +100,8 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
peopleNum: 0, // peopleNum: 0, //
avgScore: 0 // avgScore: 0, //
token: util.local.get(Setting.tokenKey),
}; };
}, },
watch: { watch: {
@ -143,6 +147,7 @@ export default {
}, },
show(row) { // show(row) { //
if (this.permissions) { if (this.permissions) {
// row.recordId row.studentId
this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`); this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`);
} else { } else {
this.$router.push(`show?id=${row.recordId}&type=1`); this.$router.push(`show?id=${row.recordId}&type=1`);
@ -151,11 +156,25 @@ export default {
exportData() { // () exportData() { // ()
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.projectId; return item.reportId;
}); });
location.href = `${this.api.exportAssessmentInfo}?ids=${ids.toString()}`; axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} else { } else {
location.href = `${this.api.exportAssessmentInfo}?ids=`; axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${this.assessmentId}&classId=${this.classId}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
} }
}, },
handleDelete(row) { // handleDelete(row) { //

@ -62,6 +62,9 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import echarts from "echarts"; import echarts from "echarts";
@ -79,7 +82,8 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
peopleNum: 0, // peopleNum: 0, //
avgScore: 0 // avgScore: 0, //
token: util.local.get(Setting.tokenKey),
}; };
}, },
watch: { watch: {
@ -101,9 +105,11 @@ export default {
}, },
getData() { getData() {
this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => { this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => {
// this.multipleSelection = res.page.records;
this.listData = res.page.records; this.listData = res.page.records;
this.total = res.page.total; this.total = res.page.total;
this.avgScore = res.avgScore; let avgScore = +res.avgScore
this.avgScore = avgScore.toFixed(2)
this.peopleNum = res.peopleNum; this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum); this.getChart(res.getFractionalSegmentNum);
}).catch(res => { }).catch(res => {
@ -111,19 +117,35 @@ export default {
}, },
show(row) { show(row) {
if (this.permissions) { if (this.permissions) {
this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`); this.$router.push(`show?id=${row.projectId}&projectId=${this.projectId}&reportId=${row.reportId}`);
} else { } else {
this.$router.push(`show?id=${row.recordId}&type=1`); this.$router.push(`show?id=${row.projectId}&type=1`);
} }
}, },
exportData() { exportData() {
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.projectId; return item.reportId;
}); });
location.href = `${this.api.exportPracticeInfo}?ids=${ids.toString()}`; axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=${ids.toString()}`;
} else { } else {
location.href = `${this.api.exportPracticeInfo}?ids=`; axios.get(`${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`,{
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`按数据库统计使用概况导出.xls`,new Blob([res.data]))
}).catch(res => {})
// location.href = `${this.api.exportPracticeInfo}?projectId=${this.projectId}&ids=`;
} }
}, },
handleDelete(row) { handleDelete(row) {
@ -164,7 +186,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;
this.handlePage(); this.getData();
}, },
getChart(num) { getChart(num) {
let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10]; let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10];
@ -191,7 +213,7 @@ export default {
}); });
}, },
goBack() { goBack() {
this.$router.back(); this.$router.push("/achievement/list?per=2");
} }
} }
}; };

@ -23,7 +23,6 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<p class="m-b-20">发布方式</p> <p class="m-b-20">发布方式</p>
@ -47,7 +46,6 @@
<el-input v-model.trim="duration.minute" placeholder></el-input> <el-input v-model.trim="duration.minute" placeholder></el-input>
</div> </div>
<!-- 定时发布显示 --> <!-- 定时发布显示 -->
<div v-if="form.type==2" class="addAssess"> <div v-if="form.type==2" class="addAssess">
<span class="mgr10">开始时间:</span> <span class="mgr10">开始时间:</span>
@ -63,7 +61,6 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgr20 m-b-20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="m-b-20">课程</p> <p class="m-b-20">课程</p>
@ -73,13 +70,12 @@
v-for="item in curriculumList" v-for="item in curriculumList"
:key="item.cid" :key="item.cid"
:label="item.curriculumName" :label="item.curriculumName"
:value="item.cid" :value="item.cid">
></el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 实训项目模块 --> <!-- 实训项目模块 -->
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
@ -123,7 +119,6 @@
></el-pagination> ></el-pagination>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgr20 m-b-20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="m-b-20">考核发布</p> <p class="m-b-20">考核发布</p>
@ -131,35 +126,30 @@
<el-radio :label="1">指定范围</el-radio> <el-radio :label="1">指定范围</el-radio>
<el-radio :label="0">无指定范围</el-radio> <el-radio :label="0">无指定范围</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-show="form.isSpecify === 1" style="padding-top: 24px;"> <div v-show="form.isSpecify == 1" style="padding-top: 24px;">
<p class="m-b-20">班级名称</p> <p class="m-b-20">班级名称</p>
<el-input <el-input
placeholder="请输入班级名称" placeholder="请输入班级名称"
v-model.trim="filterClassName" v-model.trim="filterClassName"
class="inline-input m-b-20" class="inline-input m-b-20"
clearable clearable>
>
<el-button slot="append" icon="el-icon-search"></el-button> <el-button slot="append" icon="el-icon-search"></el-button>
</el-input> </el-input>
<div v-show="tagList.length" class="m-b-20"> <div v-show="tagList.length" class="m-b-20">
<el-tag <el-tag
v-for="(tag, index) in tagList" v-for="(tag, index) in tagList"
:key="index" :key="index"
closable closable
@close="handleCloseTag(tag)" @close="handleCloseTag(tag)"
style="margin-right: 10px" style="margin-right: 10px">
>
{{ tag.organizationName }} {{ tag.organizationName }}
</el-tag> </el-tag>
</div> </div>
<div class="tree-con"> <div class="tree-con">
<student-tree <student-tree
ref="tree" ref="tree"
node-key="nodeKey" node-key="id"
show-checkbox show-checkbox
highlight-current highlight-current
default-expand-all default-expand-all
@ -168,23 +158,21 @@
:default-checked-keys="defaultCheckedKeys" :default-checked-keys="defaultCheckedKeys"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}" :props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@check="handleCheck" @check="handleCheck">
>
</student-tree> </student-tree>
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 邀请码 --> <!-- 邀请码 -->
<el-card v-if="form.isSpecify === 0" shadow="hover" class="m-b-20"> <el-card v-if="form.isSpecify == 0" shadow="hover" class="m-b-20">
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<p class="m-b-20">设置邀请码</p> <p class="m-b-20">设置邀请码</p>
<el-radio-group v-model="form.isEnableCode"> <el-radio-group v-model="form.isEnableCode">
<el-radio :label="0"></el-radio> <el-radio :label="1"></el-radio>
<el-radio :label="1"></el-radio> <el-radio :label="0"></el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-if="form.isEnableCode === 0"> <div v-if="form.isEnableCode == 1">
<el-input style="display: inline-block;width: auto;margin-right: 10px" type="number" v-model.trim="form.invitationCode" maxlength="6" placeholder="请设置6个数字"></el-input> <el-input style="display: inline-block;width: auto;margin-right: 10px" type="number" v-model.trim="form.invitationCode" maxlength="6" placeholder="请设置6个数字"></el-input>
<el-button type="text" @click="createInv">随机</el-button> <el-button type="text" @click="createInv">随机</el-button>
</div> </div>
@ -213,7 +201,7 @@ export default {
experimentDuration: "0d0h0m", experimentDuration: "0d0h0m",
curriculumId: "", curriculumId: "",
projectId: "", projectId: "",
isSpecify: 1, // (1 2) isSpecify: 1, // (1 0)
isEnableCode: 0, // isEnableCode: 0, //
invitationCode: "", invitationCode: "",
status: 0, // (0 1 2) status: 0, // (0 1 2)
@ -229,19 +217,14 @@ export default {
startTime: "0000-00-00 00:00:00", // startTime: "0000-00-00 00:00:00", //
stopTime: "0000-00-00 00:00:00", // stopTime: "0000-00-00 00:00:00", //
expNameRepeat: false, // expNameRepeat: false, //
curriculumList: [], // curriculumList: [], //
filterClassName: "", // filterClassName: "", //
tagList: [], // tagList: [], //
defaultCheckedKeys: [], // defaultCheckedKeys: [], //
allCheckedNodes: [], // allCheckedNodes: [], //
keyword: "", // keyword: "", //
searchTimer: null, searchTimer: null,
surplusTime: "", surplusTime: "",
projectDataAll: [], projectDataAll: [],
projectData: [], projectData: [],
pickerOptions: { pickerOptions: {
@ -299,7 +282,6 @@ export default {
]), ]),
handleCloseTag(tag) { // handleCloseTag(tag) { //
this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes()); this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
let tagIndex = this.tagList.findIndex(i => i.id === tag.id); let tagIndex = this.tagList.findIndex(i => i.id === tag.id);
this.tagList.splice(tagIndex, 1); this.tagList.splice(tagIndex, 1);
// //
@ -311,18 +293,15 @@ export default {
this.allCheckedNodes = this.allCheckedNodes.filter(i => (i.level === 3 && i.id !== tag.id) || (i.level === 4 && i.parentId !== tag.id)); this.allCheckedNodes = this.allCheckedNodes.filter(i => (i.level === 3 && i.id !== tag.id) || (i.level === 4 && i.parentId !== tag.id));
}, },
handleCheck(data, checked) { // handleCheck(data, checked) { //
// console.log(checked);
// //
let checkedClass = checked.checkedNodes.filter(i => i.level === 3); let checkedClass = checked.checkedNodes.filter(i => i.level === 3);
let halfCheckedClass = checked.halfCheckedNodes.filter(i => i.level === 3); let halfCheckedClass = checked.halfCheckedNodes.filter(i => i.level === 3);
this.tagList = [...checkedClass, ...halfCheckedClass].map(i => { this.tagList = [...checkedClass, ...halfCheckedClass].map(i => {
return { id: i.id, organizationName: i.organizationName }; return { id: i.id, organizationName: i.organizationName };
}); });
// //
this.allCheckedNodes = [...checked.checkedNodes, ...checked.halfCheckedNodes]; this.allCheckedNodes = [...checked.checkedNodes, ...checked.halfCheckedNodes];
console.log(this.allCheckedNodes)
}, },
filterNode(value, data) { // filterNode(value, data) { //
if (!value) return true; if (!value) return true;
@ -355,14 +334,13 @@ export default {
i.nodeKey = `${i.id}-${new Date().getTime()}`; i.nodeKey = `${i.id}-${new Date().getTime()}`;
i.leaf = false; i.leaf = false;
} }
// console.log(JSON.stringify(i));
result.push(i); result.push(i);
}); });
this.$nextTick(() => { this.$nextTick(() => {
// //
if (this.form.stuInfo && this.form.stuInfo.length) { if (this.form.classInfo && this.form.classInfo.length) {
let keys = this.form.stuInfo.map(i => { let keys = this.form.classInfo.map(i => {
return `${i.classId}-${i.stuAccountId}`; return i.id;
}); });
this.defaultCheckedKeys = keys; this.defaultCheckedKeys = keys;
} }
@ -371,7 +349,6 @@ export default {
this.allCheckedNodes = nodes; this.allCheckedNodes = nodes;
this.tagList = nodes.filter(i => i.level === 3); this.tagList = nodes.filter(i => i.level === 3);
}); });
return resolve(result); return resolve(result);
} else { } else {
return resolve([]); return resolve([]);
@ -402,7 +379,6 @@ export default {
this.handlePage(); this.handlePage();
} }
}).catch(err => { }).catch(err => {
console.log(err);
}); });
}, },
handlePage() { handlePage() {
@ -428,16 +404,14 @@ export default {
if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长"); if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长");
if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间"); if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间");
if (!this.form.projectId) return util.warningMsg("请选择实训项目"); if (!this.form.projectId) return util.warningMsg("请选择实训项目");
if (this.form.isSpecify === 0 && this.form.isEnableCode == 0) { if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) {
if (!this.form.invitationCode) return util.warningMsg("请设置邀请码"); if (!this.form.invitationCode) return util.warningMsg("请设置邀请码");
if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码"); if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码");
} }
if (this.form.type == 2) { if (this.form.type == 2) {
this.form.startTime = this.startTime; this.form.startTime = this.startTime;
this.form.stopTime = this.stopTime; this.form.stopTime = this.stopTime;
} }
let classId = []; let classId = [];
let stuInfo = []; let stuInfo = [];
this.allCheckedNodes.forEach(i => { this.allCheckedNodes.forEach(i => {
@ -447,7 +421,7 @@ export default {
stuInfo.push({ classId: i.parentId, stuAccountId: i.id }); stuInfo.push({ classId: i.parentId, stuAccountId: i.id });
} }
}); });
if (this.isSpecify === 1 && !stuInfo.length) { if (this.isSpecify == 1 && !stuInfo.length) {
util.warningMsg("请选择学生"); util.warningMsg("请选择学生");
return; return;
} else { } else {
@ -475,7 +449,6 @@ export default {
this.form = res.data; this.form = res.data;
this.formatDuration(); this.formatDuration();
}).catch(err => { }).catch(err => {
console.log(err);
}); });
}, },
formatDuration() { // formatDuration() { //
@ -505,7 +478,6 @@ export default {
this.form.stuInfo.push({ classId: i.parentId, stuAccountId: i.id }); this.form.stuInfo.push({ classId: i.parentId, stuAccountId: i.id });
} }
}); });
let data = { let data = {
form: this.form, form: this.form,
date: this.date, // date: this.date, //
@ -554,13 +526,11 @@ export default {
.inline-input { .inline-input {
width: 500px; width: 500px;
} }
.date-inputs { .date-inputs {
.el-input { .el-input {
width: 100px; width: 100px;
} }
} }
.tree-con { .tree-con {
height: 400px; height: 400px;
max-height: 400px; max-height: 400px;
@ -569,7 +539,6 @@ export default {
border-radius: 4px; border-radius: 4px;
padding: 10px 10px 10px 40px; padding: 10px 10px 10px 40px;
overflow: auto; overflow: auto;
/deep/ .el-tree-node__content{ /deep/ .el-tree-node__content{
height: 30px; height: 30px;
.el-tree-node__expand-icon{ .el-tree-node__expand-icon{
@ -602,5 +571,4 @@ export default {
} }
} }
} }
</style> </style>

@ -4,8 +4,8 @@
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>考核时间</label> <label>创建时间</label>
<el-radio-group v-model="form.month"> <el-radio-group v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> <el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
@ -64,7 +64,7 @@
<el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column> <el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column>
<el-table-column label="邀请码" align="center"> <el-table-column label="邀请码" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 0 ? scope.row.invitationCode : "" }}</span> <span>{{ scope.row.isEnableCode == 1 ? scope.row.invitationCode : "" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" label="发布类型" align="center"> <el-table-column prop="type" label="发布类型" align="center">
@ -86,12 +86,14 @@
</el-table-column> </el-table-column>
<el-table-column label="倒计时" align="center"> <el-table-column label="倒计时" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.countDown | timeFilter }}</span> <span>{{ timeFilter(scope.row) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="实验状态" align="center"> <el-table-column label="实验状态" align="center">
<template slot-scope="scope" v-if="scope.row.show"> <template slot-scope="scope" v-if="scope.row.show">
<span>{{ status[scope.row.status] }}</span> <span>
{{ status[scope.row.status] }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
@ -126,12 +128,10 @@ export default {
{ {
value: "", value: "",
name: "不限" name: "不限"
}, }, {
{
value: 1, value: 1,
name: "手动发布" name: "手动发布"
}, }, {
{
value: 2, value: 2,
name: "定时发布" name: "定时发布"
} }
@ -141,17 +141,14 @@ export default {
{ {
value: "", value: "",
name: "不限" name: "不限"
}, }, {
{ value: 0,
value: 1,
name: "待开始" name: "待开始"
}, }, {
{ value: 1,
value: 2,
name: "进行中" name: "进行中"
}, }, {
{ value: 2,
value: 3,
name: "已结束" name: "已结束"
} }
], ],
@ -160,16 +157,13 @@ export default {
{ {
id: "", id: "",
name: "不限" name: "不限"
}, }, {
{
id: 1, id: 1,
name: "近一个月" name: "近一个月"
}, }, {
{
id: 3, id: 3,
name: "近三个月" name: "近三个月"
}, }, {
{
id: 6, id: 6,
name: "近六个月" name: "近六个月"
} }
@ -192,7 +186,9 @@ export default {
listData: [], // listData: [], //
multipleSelection: [], // multipleSelection: [], //
listLoading:false,// listLoading:false,//
ticker: null // ticker: null, //
sss:1,
datassdata:0,
}; };
}, },
watch: { watch: {
@ -208,6 +204,7 @@ export default {
if (val) { if (val) {
this.form.startTime = val[0]; this.form.startTime = val[0];
this.form.endTime = val[1]; this.form.endTime = val[1];
// this.form.month = ''
} else { } else {
this.form.startTime = ""; this.form.startTime = "";
this.form.endTime = ""; this.form.endTime = "";
@ -224,50 +221,57 @@ export default {
mounted() { mounted() {
// //
this.$once("hook:beforeDestroy", function() { this.$once("hook:beforeDestroy", function() {
clearInterval(this.ticker); this.sss = 0
this.ticker = null; // clearInterval(this.ticker);
// this.ticker = null;
}); });
this.getData(); this.getData();
this.getschoolCourse(); this.getschoolCourse();
}, },
filters: {
timeFilter(countDown) {
if (countDown > 0) {
let h = Math.floor(countDown / (60 * 60));
let m = Math.floor(countDown % (60 * 60) / 60);
let s = Math.floor(countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
return "00:00:00";
}
}
},
methods: { methods: {
beginTimer() { beginTimer() {
this.ticker = setInterval(() => { this.ticker = setInterval(() => {
for (let i = 0; i < this.listData.length; i++) { if(this.sss == 0){
const item = this.listData[i]; this.ticker = null;
if (item.countDown > 0) { clearInterval(this.ticker);
item.countDown--; }else{
} else { for (let i = 0; i < this.listData.length; i++) {
if (item.status === 0 && item.type === 2) { // - const item = this.listData[i];
item.status = 1; if (item.countDown > 0) {
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; item.countDown--;
} else if (item.status === 1) { } else {
item.status = 2; if (item.status == 0 && item.type == 2) { // -
item.status = 1;
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000;
// }
} else if (item.status == 1) {
// item.status = 2;
}
} }
item.show = true;
this.$set(this.listData, i, item);
} }
item.show = true;
this.$set(this.listData, i, item);
} }
}, 1000); }, 1000);
}, },
timeFilter(countDown) {
if (countDown.countDown > 0) {
let h = Math.floor(countDown.countDown / (60 * 60));
let m = Math.floor(countDown.countDown % (60 * 60) / 60);
let s = Math.floor(countDown.countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
if(countDown.status == 1){
countDown.status = 2
}
return "00:00:00";
}
},
getData() { getData() {
this.datassdata = this.datassdata+1
this.listLoading = true; this.listLoading = true;
this.listData.splice(0); this.listData.splice(0);
if (this.ticker) { this.sss = 0
clearInterval(this.ticker);
}
let data = { let data = {
...this.form, ...this.form,
keyWord: this.keyWord, keyWord: this.keyWord,
@ -280,29 +284,33 @@ export default {
this.total = res.total; this.total = res.total;
this.listData.forEach(i => { this.listData.forEach(i => {
i.show = false; i.show = false;
if (i.status === 2) { // if (i.status == 2) { //
i.countDown = 0; i.countDown = 0;
} else { } else {
if (i.type === 2) { // if (i.type == 2) { //
if (i.status === 0) { if (i.status == 0) {
// //
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status === 1) { } else if (i.status == 1) {
// //
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
} }
} else if (i.type === 1) { // } else if (i.type == 1) { //
if (i.status === 0) { if (i.status == 0) {
// //
i.countDown = 0; i.countDown = 0;
} else if (i.status === 1) { } else if (i.status == 1) {
// //
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
} }
} }
} }
}); });
this.beginTimer(); this.sss = 1;
if(this.datassdata == 1){
this.beginTimer()
}
// setTimeout(,3000)
this.listLoading = false; this.listLoading = false;
}).catch(err => { }).catch(err => {
this.listLoading = false; this.listLoading = false;
@ -311,6 +319,7 @@ export default {
initData() { initData() {
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
this.pageNum = 1; this.pageNum = 1;
this.sss = 0
this.getData(); this.getData();
}, },
getschoolCourse() { // getschoolCourse() { //
@ -327,16 +336,13 @@ export default {
this.$router.push(`add?id=${row.id}`); this.$router.push(`add?id=${row.id}`);
}, },
show(row) { show(row) {
this.$router.push(`/achievement/ass?curriculumId=${this.curriculumId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`); console.log(row)
this.$router.push(`/achievement/ass?id=${row.id}&classId=${row.classId}&projectId=${row.projectId}&classInfo=${JSON.stringify(row.classInfo)}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`);
}, },
start(row) { start(row) {
let data = { this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => {
id: row.id,
startTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 1
};
this.$post(this.api.modifyAssessment, data).then(res => {
util.successMsg("启动成功!"); util.successMsg("启动成功!");
this.sss = 0
this.getData(); this.getData();
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
@ -345,36 +351,34 @@ export default {
finish(row) { finish(row) {
this.$confirm("确定要提前结束吗?", "提示", { this.$confirm("确定要提前结束吗?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { let data = {
let data = { id: row.id,
id: row.id, endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()), status: 2
status: 2 };
}; this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => {
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { util.successMsg("提前结束成功!");
util.successMsg("提前结束成功!"); this.sss = 0
this.getData(); this.getData();
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
});
})
.catch(() => {
}); });
}).catch(() => {
});
}, },
delData(row) { delData(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$post(this.api.deleteAssessment, [row.id]).then(res => {
this.$post(this.api.deleteAssessment, [row.id]).then(res => { util.successMsg("删除成功");
util.successMsg("删除成功"); this.sss = 0
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
});
})
.catch(() => {
}); });
}).catch(() => {
});
}, },
delAllData() { delAllData() {
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
@ -383,18 +387,17 @@ export default {
}); });
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$post(this.api.deleteAssessment, ids).then(res => {
this.$post(this.api.deleteAssessment, ids).then(res => { this.multipleSelection = [];
this.multipleSelection = []; this.$refs.table.clearSelection();
this.$refs.table.clearSelection(); util.successMsg("删除成功");
util.successMsg("删除成功"); this.sss = 0
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
});
})
.catch(() => {
}); });
}).catch(() => {
});
} else { } else {
util.errorMsg("请先选择数据 !"); util.errorMsg("请先选择数据 !");
} }
@ -404,10 +407,12 @@ export default {
}, },
onSearch() { onSearch() {
this.pageNum = 1; this.pageNum = 1;
this.sss = 0
this.getData(); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNum = val; this.pageNum = val;
this.sss = 0
this.getData(); this.getData();
}, },
transferTime(date) { transferTime(date) {

@ -132,7 +132,8 @@ export default {
playTime: "", playTime: "",
playStartTime: "", playStartTime: "",
playEndTime: "", playEndTime: "",
description: "" description: "",
touchTime:0,
}; };
}, },
components: { components: {
@ -167,9 +168,9 @@ export default {
"setMatchId" "setMatchId"
]), ]),
save(status) { save(status) {
this.touchTime = 0
this.sponsor = this.sponsorList.filter(d => d).join(); this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join(); this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg("请填写竞赛名称"); if (!this.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) { if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方"); if (!this.sponsor) return util.warningMsg("请填写主办方");
@ -183,7 +184,6 @@ export default {
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情"); if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = { let data = {
id: this.id, id: this.id,
coverUrl: this.coverUrl, coverUrl: this.coverUrl,
@ -203,51 +203,47 @@ export default {
this.$put(this.api.editContest, data).then(res => { this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功"); util.successMsg("修改成功");
this.$router.back(); this.$router.back();
}) }).catch(err => {
.catch(err => { });
});
} else { } else {
this.$post(this.api.addContest, data).then(res => { this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功"); util.successMsg("创建成功");
this.$router.back(); this.$router.back();
}) }).catch(err => {
.catch(err => { });
});
} }
}, },
getData() { getData() {
this.$get(this.api.getContest + "/" + this.id) this.$get(this.api.getContest + "/" + this.id).then(res => {
.then(res => { let data = res.contest;
let data = res.contest; this.coverUrl = data.coverUrl;
this.coverUrl = data.coverUrl; this.carouselUrl = data.carouselUrl;
this.carouselUrl = data.carouselUrl; this.description = data.description;
this.description = data.description; this.name = data.name;
this.name = data.name; this.playEndTime = data.playEndTime;
this.playEndTime = data.playEndTime; this.playStartTime = data.playStartTime;
this.playStartTime = data.playStartTime; this.publishStatus = data.publishStatus;
this.publishStatus = data.publishStatus; this.signUpEndTime = data.signUpEndTime;
this.signUpEndTime = data.signUpEndTime; this.signUpStartTime = data.signUpStartTime;
this.signUpStartTime = data.signUpStartTime; this.sponsor = data.sponsor;
this.sponsor = data.sponsor; this.undertaker = data.undertaker;
this.undertaker = data.undertaker; this.signupTime = [data.signUpStartTime, data.signUpEndTime];
this.playTime = [data.playStartTime, data.playEndTime];
this.signupTime = [data.signUpStartTime, data.signUpEndTime]; this.sponsorList = data.sponsor.split(",");
this.playTime = [data.playStartTime, data.playEndTime]; this.undertakerList = data.undertaker.split(",");
this.sponsorList = data.sponsor.split(","); }).catch(err => {
this.undertakerList = data.undertaker.split(","); });
})
.catch(err => {
});
}, },
commitId() { commitId() {
this.setMatchId(this.id); this.setMatchId(this.id);
// this.$store.commit("setMatchId", { matchId: this.id }); // this.$store.commit("setMatchId", { matchId: this.id });
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.touchTime = this.touchTime+1
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.coverUrl) { if (this.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -257,6 +253,7 @@ export default {
this.coverUrl = res.data.filesResult.fileUrl; this.coverUrl = res.data.filesResult.fileUrl;
}, },
uploadLgSuccess(res, file, fileList) { uploadLgSuccess(res, file, fileList) {
this.touchTime = this.touchTime+1
if (this.carouselUrl) { if (this.carouselUrl) {
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
@ -266,6 +263,7 @@ export default {
this.carouselUrl = res.data.filesResult.fileUrl; this.carouselUrl = res.data.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.touchTime = this.touchTime+1
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
@ -273,9 +271,11 @@ export default {
}); });
}, },
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
this.touchTime = this.touchTime+1
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ""; this.coverUrl = "";
@ -283,6 +283,7 @@ export default {
}); });
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
this.touchTime = this.touchTime+1
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = ""; this.carouselUrl = "";
@ -290,6 +291,7 @@ export default {
}); });
}, },
uploadSure() { uploadSure() {
this.touchTime = this.touchTime+1
this.BatchUpload = false; this.BatchUpload = false;
this.pageNo = 1; this.pageNo = 1;
this.keyword = ""; this.keyword = "";
@ -298,27 +300,86 @@ export default {
goback() { goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$router.push("/match");
this.$router.push("/match"); }).catch(() => {
}) });
.catch(() => {
});
}, },
addSponsor() { addSponsor() {
this.touchTime = this.touchTime+1
this.sponsorList.push(""); this.sponsorList.push("");
}, },
delSponsor(index) { delSponsor(index) {
this.touchTime = this.touchTime+1
this.sponsorList.splice(index, 1); this.sponsorList.splice(index, 1);
}, },
addOrganizer() { addOrganizer() {
this.touchTime = this.touchTime+1
this.undertakerList.push(""); this.undertakerList.push("");
}, },
delOrganizer(index) { delOrganizer(index) {
this.touchTime = this.touchTime+1
this.undertakerList.splice(index, 1); this.undertakerList.splice(index, 1);
} }
},
} beforeDestroy() {
if (this.touchTime>0){
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) {
if (!this.sponsor) return util.warningMsg("请填写主办方");
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().getTime();
let signUpStartTime = new Date(this.signUpStartTime).getTime();
let signUpEndTime = new Date(this.signUpEndTime).getTime();
let playStartTime = new Date(this.playStartTime).getTime();
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('')
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = {
id: this.id,
coverUrl: this.coverUrl,
carouselUrl: this.carouselUrl,
description: this.description,
founderId: 1,
name: this.name,
playEndTime: this.playEndTime,
playStartTime: this.playStartTime,
publishStatus: status ? this.publishStatus : 0,
signUpEndTime: this.signUpEndTime,
signUpStartTime: this.signUpStartTime,
sponsor: this.sponsor,
undertaker: this.undertaker
};
if (this.id) {
this.$put(this.api.editContest, data).then(res => {
util.successMsg("修改成功");
this.$router.back();
}).catch(err => {
});
} else {
this.$post(this.api.addContest, data).then(res => {
util.successMsg("创建成功");
this.$router.back();
}).catch(err => {
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
});
}
},
}; };
</script> </script>

@ -63,7 +63,8 @@ export default {
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
totals: 0 totals: 0,
touchTime:0,
}; };
}, },
mounted() { mounted() {
@ -81,12 +82,14 @@ export default {
if (data.title.length) { if (data.title.length) {
if (row.id) { if (row.id) {
this.$put(this.api.editContestProgress, data).then(res => { this.$put(this.api.editContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("修改成功"); util.successMsg("修改成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(this.api.addContestProgress, data).then(res => { this.$post(this.api.addContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("创建成功"); util.successMsg("创建成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -110,18 +113,18 @@ export default {
handleDelete(row) { handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => { this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
});
})
.catch(() => {
}); });
}).catch(() => {
});
}, },
addData() { addData() {
this.touchTime = this.touchTime+1
if (this.listData.length) { if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) { if (this.listData[this.listData.length - 1].id) {
this.listData.push({ this.listData.push({
@ -131,6 +134,7 @@ export default {
description: "", description: "",
status: 0 status: 0
}); });
console.log(this.listData)
} else { } else {
util.warningMsg("请先保存新数据"); util.warningMsg("请先保存新数据");
} }
@ -143,8 +147,50 @@ export default {
status: 0 status: 0
}); });
} }
},
},
beforeDestroy() {
if (this.touchTime>0){
this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let num = 0;
for(var i=0;i<this.listData.length;i++){
let data = this.listData[i];
if (data.title) {
if (this.listData[i].id) {
this.$put(this.api.editContestProgress, data).then(res => {
}).catch(res => {
});
}else{
num = num+1
}
}else{
num = num+1
}
}
if (num >0){
this.$message({
type: 'error',
message: '保存失败,有未填项目'
});
}else{
this.$message({
type: 'success',
message: '保存成功!'
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消保存'
});
});
} }
} },
}; };
</script> </script>

@ -194,7 +194,7 @@ export default {
return { return {
projectId: this.$route.query.projectId, projectId: this.$route.query.projectId,
systemList: [], systemList: [],
token: btoa(util.local.get(Setting.tokenKey)), token: util.local.get(Setting.tokenKey),
isDetail: Boolean(this.$route.query.show), isDetail: Boolean(this.$route.query.show),
projectManage: { projectManage: {
@ -510,6 +510,7 @@ export default {
this.$refs.judgementTable.clearSelection(); this.$refs.judgementTable.clearSelection();
}); });
let params = { let params = {
enable:0,
name: this.judgementpointsquery, name: this.judgementpointsquery,
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,

File diff suppressed because it is too large Load Diff

@ -86,8 +86,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="auth('编辑')" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-if="scope.row.founder != 0" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="auth('删除')" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button> <el-button v-if="scope.row.founder != 0" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button> <el-button v-if="auth('复制')" type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch <el-switch
v-if="auth('禁用')" v-if="auth('禁用')"
@ -232,10 +232,15 @@ export default {
]), ]),
getSystemData() { getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => { this.$get(this.api.getSystemIdBySchool).then(res => {
this.systemList = res.data; if (res.status == 200){
// systemIdsystemIdsystemId this.systemList = res.data;
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id; // systemIdsystemIdsystemId
this.getData(); this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData();
}else{
}
}); });
}, },
getData() { getData() {

@ -151,7 +151,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="workNumber" label="学生学号"> <el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="" @blur="worknumberChange"></el-input> <el-input v-model="form.workNumber" placeholder="学生学号"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="学生姓名"> <el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input> <el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input>
@ -214,8 +214,8 @@
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button type="primary" @click="saveData(0)">保存</el-button> <el-button type="primary" :disabled='disableds' @click="saveData(0)">保存</el-button>
<el-button v-if="isAdd" type="primary" @click="saveData(1)">保存并继续添加</el-button> <el-button v-if="isAdd" type="primary" :disabled='disableds' @click="saveData(1)">保存并继续添加</el-button>
<el-button size="small" @click="closeStudent">取消</el-button> <el-button size="small" @click="closeStudent">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -266,7 +266,7 @@ export default {
} else { } else {
var pattern = /^[A-Za-z0-9]*$/; var pattern = /^[A-Za-z0-9]*$/;
if(pattern.test(value)){ if(pattern.test(value)){
this.accountChange() this.accountChange();
callback(); callback();
}else{ }else{
callback(new Error('请输入正确账号格式')); callback(new Error('请输入正确账号格式'));
@ -279,7 +279,7 @@ export default {
} else { } else {
var pattern = /^[A-Za-z0-9]*$/; var pattern = /^[A-Za-z0-9]*$/;
if(pattern.test(value)){ if(pattern.test(value)){
this.worknumberChange() this.worknumberChange();
callback(); callback();
}else{ }else{
callback(new Error('请输入正确学生学号格式')); callback(new Error('请输入正确学生学号格式'));
@ -346,7 +346,7 @@ export default {
{ required: true, message: "请输入名称", trigger: "blur" } { required: true, message: "请输入名称", trigger: "blur" }
], ],
account: [ account: [
{ validator: accountPass, trigger: 'blur' } { required: true,validator: accountPass, trigger: 'blur' }
// { required: true, message: "", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
// { // {
// pattern: /^[A-Za-z0-9]*$/, // pattern: /^[A-Za-z0-9]*$/,
@ -358,7 +358,7 @@ export default {
{ required: true, message: "请输入学生姓名", trigger: "blur" } { required: true, message: "请输入学生姓名", trigger: "blur" }
], ],
workNumber: [ workNumber: [
{ validator: workNumberPass, trigger: 'blur' } { required: true,validator: workNumberPass, trigger: 'blur' }
// { required: true, message: "", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
// { // {
// pattern: /^[A-Za-z0-9]*$/, // pattern: /^[A-Za-z0-9]*$/,
@ -405,7 +405,8 @@ export default {
exportCode: "", exportCode: "",
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
} },
disableds:false
}; };
}, },
mounted() { mounted() {
@ -741,6 +742,7 @@ export default {
url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&account=${this.form.account}&workNumber=`; url = `${this.api.checkWorkNumOrAccount}?platformId=${Setting.platformId}&type=1&accountId=${this.form.accountId}&account=${this.form.account}&workNumber=`;
} }
this.$post(url).then(res => { this.$post(url).then(res => {
this.disableds = false
if (this.isAdd && this.form.accountId) { if (this.isAdd && this.form.accountId) {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
this.form = { this.form = {
@ -758,17 +760,9 @@ export default {
} }
this.accountReapeat = false; this.accountReapeat = false;
}).catch(err => { }).catch(err => {
if (this.isAdd) { if (this.isAdd) {
this.showTree = false; this.showTree = false;
this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => {
this.form = res.data;
let classId = res.data.classList.map(e => e.id);
this.form.classId = classId.toString();
delete this.form.classList;
this.showTree = true;
this.accountReapeat = false;
this.$refs.form.clearValidate();
}).catch(res => {});
} else { } else {
this.accountReapeat = true; this.accountReapeat = true;
} }
@ -788,6 +782,15 @@ export default {
this.workNumberReapeat = false; this.workNumberReapeat = false;
} }
}).catch(err => { }).catch(err => {
this.$post(`${this.api.getDetailByAccount}?workNumber=${this.form.workNumber}&platformId=${Setting.platformId}&type=1`).then(res => {
this.showTree = true;
let classId = res.data.classList.map(e => e.id);
this.form.classId = classId.toString();
delete this.form.classList;
// this.showTree = true;
this.accountReapeat = false;
this.$refs.form.clearValidate();
}).catch(res => {});
this.workNumberReapeat = true; this.workNumberReapeat = true;
}); });
} }
@ -855,7 +858,6 @@ export default {
// console.log(this.form.classId); // console.log(this.form.classId);
treeList.forEach(i => { treeList.forEach(i => {
i.disabled = i.level < 3; i.disabled = i.level < 3;
if (i.level === 3) { if (i.level === 3) {
i.leaf = true; i.leaf = true;
// propschecked // propschecked
@ -881,11 +883,6 @@ export default {
saveData(type) { // / saveData(type) { // /
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.accountReapeat) return util.warningMsg("该账号已存在");
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在");
if (this.phoneRepeat) return util.warningMsg("该手机号已存在");
if (this.emailRepeat) return util.warningMsg("该邮箱已存在");
let nodes = this.$refs.classTree.getCheckedNodes(); let nodes = this.$refs.classTree.getCheckedNodes();
if (nodes.length) { if (nodes.length) {
let tempArr = []; let tempArr = [];
@ -912,6 +909,10 @@ export default {
}).catch(res => { }).catch(res => {
}); });
} else { } else {
if (this.accountReapeat) return util.warningMsg("该账号已存在");
if (this.workNumberReapeat) return util.warningMsg("该学生学号已存在");
if (this.phoneRepeat) return util.warningMsg("该手机号已存在");
if (this.emailRepeat) return util.warningMsg("该邮箱已存在");
this.form.uniqueIdentification = new Date().getTime(); this.form.uniqueIdentification = new Date().getTime();
this.$post(this.api.addStudent, this.form).then(res => { this.$post(this.api.addStudent, this.form).then(res => {
util.successMsg("新增成功!"); util.successMsg("新增成功!");
@ -985,6 +986,7 @@ export default {
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false; this.uploadFaild = false;
console.log(res)
if (res.status === 200) { if (res.status === 200) {
if (res.data.exportCode) { if (res.data.exportCode) {
this.exportCode = res.data.exportCode; this.exportCode = res.data.exportCode;
@ -992,6 +994,9 @@ export default {
} }
util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`); util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`);
this.handleRefresh(); this.handleRefresh();
util.successMsg(`本次上传有${res.data.failureNum}个失败`);
this.getClassTreeData('','1','')
} else { } else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据");
} }
@ -1014,6 +1019,8 @@ export default {
this.importVisible = false; this.importVisible = false;
this.studentType = 1; this.studentType = 1;
this.keyWord = ""; this.keyWord = "";
this.handleClose();
this.handleRefresh();
this.initData(); this.initData();
} }
} }

@ -14,7 +14,7 @@
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :selectable="practiceSelectable" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" width="100"></el-table-column> <el-table-column prop="roleName" label="角色名称" align="center" width="100"></el-table-column>
<el-table-column label="角色描述" align="center"> <el-table-column label="角色描述" align="center">
@ -151,6 +151,15 @@ export default {
util.errorMsg("请先选择数据!"); util.errorMsg("请先选择数据!");
} }
}, },
practiceSelectable(row, index){
let boolean = true;
if(row.roleName == '超级管理员'){
boolean = false
}else{
boolean = true
}
return boolean;
},
closeRole() { closeRole() {
this.isDetail = false; this.isDetail = false;
this.form = { this.form = {

@ -45,15 +45,15 @@
<el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" <el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible"
width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="140px" :disabled="isDetail"> <el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'>
<el-form-item prop="account" label="账号"> <el-form-item prop="account" label="账号">
<el-input v-model.trim="teacherForm.account" placeholder="请输入职工账号" @blur="accountChange"></el-input> <el-input v-model.trim="teacherForm.account" placeholder="请输入职工账号"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="用户姓名"> <el-form-item prop="userName" label="用户姓名">
<el-input v-model.trim="teacherForm.userName" placeholder="请输入员工姓名"></el-input> <el-input v-model.trim="teacherForm.userName" placeholder="请输入员工姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="roleValue" label="账号角色"> <el-form-item prop="roleValue" label="账号角色">
<el-select v-model="teacherForm.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%"> <el-select v-model="teacherForm.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%;height: 32px">
<el-option <el-option
v-for="item in roleList" v-for="item in roleList"
:key="item.id" :key="item.id"
@ -66,7 +66,7 @@
<el-input disabled v-model.trim="teacherForm.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input> <el-input disabled v-model.trim="teacherForm.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" label="工号"> <el-form-item prop="workNumber" label="工号">
<el-input v-model.trim="teacherForm.workNumber" placeholder="请输入职工工号" @blur="workNumberChange"></el-input> <el-input v-model.trim="teacherForm.workNumber" placeholder="请输入职工工号"></el-input>
</el-form-item> </el-form-item>
<template v-for="item in teacherForm.roleAndDeptList"> <template v-for="item in teacherForm.roleAndDeptList">
<el-form-item :label="`${item.roleName}所属部门`"> <el-form-item :label="`${item.roleName}所属部门`">
@ -127,6 +127,32 @@ import TeacherSide from "./staffSide";
export default { export default {
data() { data() {
var accountPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入账号'));
} else {
var pattern = /^[A-Za-z0-9]*$/;
if(pattern.test(value)){
this.accountChange();
callback();
}else{
callback(new Error('请输入正确账号格式'));
}
}
};
var workNumberPass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入职工工号'));
} else {
var pattern = /^[a-zA-Z0-9]*$/;
if(pattern.test(value)){
this.workNumberChange();
callback();
}else{
callback(new Error('职工工号必须为数字或英文'));
}
}
};
return { return {
exportCode: "", exportCode: "",
headers: { headers: {
@ -150,12 +176,7 @@ export default {
}, },
rules: { rules: {
account: [ account: [
{ required: true, message: "请输入职工账号", trigger: "blur" }, { validator: accountPass, trigger: 'blur' }
{
pattern: /^[A-Za-z0-9]*$/,
message: "请输入正确的账号",
trigger: "blur"
}
], ],
userName: [ userName: [
{ required: true, message: "请输入用户姓名", trigger: "blur" } { required: true, message: "请输入用户姓名", trigger: "blur" }
@ -164,8 +185,7 @@ export default {
{ required: true, message: "请选择账号角色", trigger: "change" } { required: true, message: "请选择账号角色", trigger: "change" }
], ],
workNumber: [ workNumber: [
{ required: true, message: "请输入职工工号", trigger: "blur" }, { validator: workNumberPass , trigger: 'blur' }
// { pattern: /^[0-9]*$/, message: "", trigger: "blur"}
], ],
uniqueIdentification: [ uniqueIdentification: [
// { required: true, message: '', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
@ -290,8 +310,16 @@ export default {
}).catch(res => {}); }).catch(res => {});
}, },
getRoleData() { // getRoleData() { //
this.$get(`${this.api.roleList}?page=1&size=100&name=''&platformId=1`).then(res => { this.roleList =[];
this.roleList = res.rolePage.records; this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1`).then(res => {
for(var i=0;i<res.rolePage.records.length;i++){
if (res.rolePage.records[i].roleName == '超级管理员'){
}else{
this.roleList.push(res.rolePage.records[i])
}
}
// this.roleList = res.rolePage.records;
}).catch(res => {}); }).catch(res => {});
}, },
closeTeacher() { // / closeTeacher() { // /
@ -320,7 +348,8 @@ export default {
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => {
let { data } = res; let { data } = res;
this.teacherForm = data; this.teacherForm = data;
this.teacherForm.roleValue = data.roleAndDeptList.map(i => i.roleId); // this.roleList = data.roleAndDeptList
this.teacherForm.roleValue = data.roleAndDeptList.map(i => i.roleName);
this.teacherForm.roleAndDeptList = data.roleAndDeptList.map(i => { this.teacherForm.roleAndDeptList = data.roleAndDeptList.map(i => {
i.cascaderValue = [i.staffArchitectureId, i.gradeId] i.cascaderValue = [i.staffArchitectureId, i.gradeId]
return i; return i;
@ -421,6 +450,7 @@ export default {
} }
}, },
roleChange(value) { // roleChange(value) { //
console.log(this.teacherForm.roleValue)
if (value.length) { if (value.length) {
let ids = this.teacherForm.roleAndDeptList.map(e => e.roleId); let ids = this.teacherForm.roleAndDeptList.map(e => e.roleId);
this.roleList.forEach(i => { this.roleList.forEach(i => {
@ -430,6 +460,7 @@ export default {
cascaderValue: [] cascaderValue: []
}; };
if (value.includes(i.id) && !ids.includes(i.id)) { if (value.includes(i.id) && !ids.includes(i.id)) {
console.log(i)
obj.roleId = i.id; obj.roleId = i.id;
obj.roleName = i.roleName; obj.roleName = i.roleName;
this.teacherForm.roleAndDeptList.push(obj); this.teacherForm.roleAndDeptList.push(obj);
@ -606,4 +637,7 @@ export default {
padding: 24px; padding: 24px;
} }
} }
.el-input__inner{
height: 32px;
}
</style> </style>

@ -4,7 +4,7 @@
const url = location.host; const url = location.host;
const isDev = process.env.NODE_ENV === "development"; // 开发环境 const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isHh = url.includes("10.196.131.73"); //是否河海版本 const isHh = url.includes("10.196.131.73"); //是否河海版本
const isCH = url.includes("120.78.127.12"); //是否巢湖版本 const isCH = url.includes("124.71.12.62"); //是否巢湖版本
const isBeta = url.includes("120.78.198.231"); //是否职站测试 const isBeta = url.includes("120.78.198.231"); //是否职站测试
const isPro = url.includes("occupationlab.com"); //是否职站生产 const isPro = url.includes("occupationlab.com"); //是否职站生产
const isTest = url.includes('39.108.250.202'); //是否中台测试服 const isTest = url.includes('39.108.250.202'); //是否中台测试服
@ -19,7 +19,7 @@ if (isHh) {
title = "教师管理端"; title = "教师管理端";
} else if (isCH) { } else if (isCH) {
// 巢湖 // 巢湖
host = "http://120.78.127.12/"; host = "http://124.71.12.62/";
title = "教师管理端"; title = "教师管理端";
} else if (isBeta) { } else if (isBeta) {
// 职站测试 // 职站测试

@ -66,7 +66,9 @@ export default {
commit("SET_INFO", data); commit("SET_INFO", data);
resolve(); resolve();
} else { } else {
console.log(res.message)
util.errorMsg(res.message); util.errorMsg(res.message);
reject(res); reject(res);
} }
}).catch(error => { }).catch(error => {

@ -38,6 +38,7 @@
font-size: 14px !important; font-size: 14px !important;
background-color: $--color-primary !important; background-color: $--color-primary !important;
border-radius: 4px !important; border-radius: 4px !important;
border: none;
} }
.el-input { .el-input {
@ -188,6 +189,7 @@
.el-message { .el-message {
padding: 11px 20px; padding: 11px 20px;
top:1.2rem!important;
.el-message__icon { .el-message__icon {
font-size: 16px; font-size: 16px;

Loading…
Cancel
Save