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

@ -54,7 +54,7 @@ export default {
{
icon: "el-icon-collection",
index: "/achievement/list",
title: "成绩管理"
title: "成绩管理",
},
{
icon: "el-icon-news",
@ -102,7 +102,9 @@ export default {
for (let i in this.actives) {
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() {

@ -36,6 +36,9 @@
</div>
<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-item label="手机号">
<el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
@ -217,7 +220,6 @@ export default {
height: 100%;
background-image: url(../../../assets/img/login-bg.png);
background-size: 100%;
.header {
width: 100%;
height: 60px;
@ -239,7 +241,6 @@ export default {
}
}
}
/deep/ .main {
position: absolute;
left: 50%;

@ -4,17 +4,13 @@
<div class="flex-between m-b-10">
<el-page-header @back="goBack" :content="experimentalName"></el-page-header>
</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 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="nums">
<div class="item">
@ -32,6 +28,14 @@
<el-card shadow="hover" class="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>
<el-button type="primary" @click="delAllData">批量删除</el-button>
@ -76,16 +80,19 @@
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data() {
return {
systemId: this.$route.query.systemId,
id: this.$route.query.id,
classId: this.$route.query.classId,
projectId: this.$route.query.projectId,
projectName: this.$route.query.name,
assessmentId:'',
classInfo: [],
experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class,
keyword: "",
@ -94,32 +101,40 @@ export default {
page: 1,
pageSize: 10,
total: 0,
avg: 0
avg: 0,
activeName:'',
token: util.local.get(Setting.tokenKey),
};
},
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();
},
methods: {
handleClick(tab, event) {
this.getData()
},
getData() {
let data = {
systemId: this.systemId,
page: this.page,
size: this.pageSize,
searchContant: this.keyword,
projectId: this.id
};
this.$get(this.api.queryEvaluationReport, data).then(res => {
let list = res.data.list;
let score = 0;
list.map(n => {
n.class = this.className;
score += n.score;
});
this.listData = list;
this.total = res.data.totalCount;
this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0;
this.getChart();
this.$post(`${this.api.getAssessmentDetail}?assessmentId=${+this.id}&pageNum=${this.page}&pageSize=${this.pageSize}&classId=${this.activeName}`).then(res => {
if (res.status == 200){
this.avg = res.avgScore
this.total = res.peopleNum
let list = res.page.records;
this.assessmentId = res.page.records[0].assessmentId;
let score = 0;
list.map(n => {
n.class = this.className;
score += n.score;
});
this.listData = list;
this.getChart();
}
}).catch(res => {
});
},
@ -145,18 +160,28 @@ export default {
},
exportData() {
if (!this.listData.length) return false;
let selected = this.multipleSelection;
let exportList = [];
if (selected.length) {
exportList = selected.map(item => {
return item.recordId;
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.reportId;
});
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 {
exportList = this.listData.map(item => {
return item.recordId;
});
axios.get(`${this.api.exportAssessmentInfo}?assessmentId=${+this.id}&classId=${this.activeName}&ids=`,{
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) {
this.$confirm("确定要删除吗?", "提示", {

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

@ -21,7 +21,7 @@
</el-table-column>
<el-table-column prop="workNumber" label="学生学号" align="center">
</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 prop="instructor" label="指导老师" align="center">
</el-table-column>
@ -38,7 +38,7 @@
<div class="meta-title-wrap">
<p class="meta-title"><img src="@/assets/img/cup.png" alt=""> 实验项目名称</p>
</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 class="m-b-20">
@ -59,19 +59,30 @@
{{ scope.$index + 1 }}
</template>
</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 prop="userAnswer" label="学生答案" align="center">
<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>
</el-table-column>
<el-table-column prop="answer" label="参考答案" align="center">
<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>
</el-table-column>
<el-table-column prop="codeScore" label="得分" align="center">
<el-table-column prop="score" label="得分" align="center">
</el-table-column>
</el-table>
</div>
@ -157,9 +168,9 @@ export default {
let data = {
recordId: this.id
};
this.$get(this.api.queryVirtualReport, data).then(res => {
this.form = res.data.report;
let expData = res.data.data;
this.$get(this.api.experimentOverview, data).then(res => {
this.form = res.report;
let expData = res.userScores;
let form = this.form;
let score = form.score;
@ -193,12 +204,13 @@ export default {
let data = {
studentId: this.studentId,
projectId: this.projectId,
recordId: this.id,
// recordId: this.id,
reportId: this.reportId
};
this.$get(this.api.queryArchievement, data).then(res => {
this.form = res.data.report ? res.data.report : {};
let expData = res.data.data;
this.$get(this.api.experimentOverview, data).then(res => {
console.log(res)
this.form = res.report ? res.report : {};
let expData = res.userScores;
let form = this.form;
let score = form.score;
@ -311,8 +323,8 @@ export default {
<style lang="scss" scoped>
.box {
padding: 0 50px;
background-color: #fff;
//padding: 0 20px;
//background-color: #fff;
}
/deep/ .el-textarea.is-disabled .el-textarea__inner {
@ -329,7 +341,7 @@ export default {
#pdfDom {
padding: 50px;
background: #fff;
/deep/ .info-table {
margin-bottom: 40px;
border: 0;

@ -77,8 +77,11 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default {
data() {
@ -97,7 +100,8 @@ export default {
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0 //
avgScore: 0, //
token: util.local.get(Setting.tokenKey),
};
},
watch: {
@ -143,6 +147,7 @@ export default {
},
show(row) { //
if (this.permissions) {
// row.recordId row.studentId
this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`);
} else {
this.$router.push(`show?id=${row.recordId}&type=1`);
@ -151,11 +156,25 @@ export default {
exportData() { // ()
if (this.multipleSelection.length) {
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 {
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) { //

@ -62,6 +62,9 @@
</template>
<script>
import { mapState, mapActions } from "vuex";
import axios from 'axios'
import Setting from "@/setting";
import util from "@/libs/util";
import echarts from "echarts";
@ -79,7 +82,8 @@ export default {
pageSize: 10,
total: 0,
peopleNum: 0, //
avgScore: 0 //
avgScore: 0, //
token: util.local.get(Setting.tokenKey),
};
},
watch: {
@ -101,9 +105,11 @@ export default {
},
getData() {
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.total = res.page.total;
this.avgScore = res.avgScore;
let avgScore = +res.avgScore
this.avgScore = avgScore.toFixed(2)
this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum);
}).catch(res => {
@ -111,19 +117,35 @@ export default {
},
show(row) {
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 {
this.$router.push(`show?id=${row.recordId}&type=1`);
this.$router.push(`show?id=${row.projectId}&type=1`);
}
},
exportData() {
if (this.multipleSelection.length) {
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 {
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) {
@ -164,7 +186,7 @@ export default {
},
handleCurrentChange(val) {
this.page = val;
this.handlePage();
this.getData();
},
getChart(num) {
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() {
this.$router.back();
this.$router.push("/achievement/list?per=2");
}
}
};

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

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

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

@ -63,7 +63,8 @@ export default {
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0
totals: 0,
touchTime:0,
};
},
mounted() {
@ -81,12 +82,14 @@ export default {
if (data.title.length) {
if (row.id) {
this.$put(this.api.editContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("修改成功");
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addContestProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("创建成功");
this.getData();
}).catch(res => {
@ -110,18 +113,18 @@ export default {
handleDelete(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
}).then(() => {
this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
addData() {
this.touchTime = this.touchTime+1
if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) {
this.listData.push({
@ -131,6 +134,7 @@ export default {
description: "",
status: 0
});
console.log(this.listData)
} else {
util.warningMsg("请先保存新数据");
}
@ -143,8 +147,50 @@ export default {
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>

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

File diff suppressed because it is too large Load Diff

@ -86,8 +86,8 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button v-if="auth('编辑')" 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="edit(scope.row)">编辑</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-switch
v-if="auth('禁用')"
@ -232,10 +232,15 @@ export default {
]),
getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => {
this.systemList = res.data;
// systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData();
if (res.status == 200){
this.systemList = res.data;
// systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : this.systemList[0].id;
this.getData();
}else{
}
});
},
getData() {

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

@ -14,7 +14,7 @@
</div>
<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 prop="roleName" label="角色名称" align="center" width="100"></el-table-column>
<el-table-column label="角色描述" align="center">
@ -151,6 +151,15 @@ export default {
util.errorMsg("请先选择数据!");
}
},
practiceSelectable(row, index){
let boolean = true;
if(row.roleName == '超级管理员'){
boolean = false
}else{
boolean = true
}
return boolean;
},
closeRole() {
this.isDetail = false;
this.form = {

@ -45,15 +45,15 @@
<el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible"
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-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 prop="userName" label="用户姓名">
<el-input v-model.trim="teacherForm.userName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<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
v-for="item in roleList"
:key="item.id"
@ -66,7 +66,7 @@
<el-input disabled v-model.trim="teacherForm.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input>
</el-form-item>
<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>
<template v-for="item in teacherForm.roleAndDeptList">
<el-form-item :label="`${item.roleName}所属部门`">
@ -127,6 +127,32 @@ import TeacherSide from "./staffSide";
export default {
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 {
exportCode: "",
headers: {
@ -150,12 +176,7 @@ export default {
},
rules: {
account: [
{ required: true, message: "请输入职工账号", trigger: "blur" },
{
pattern: /^[A-Za-z0-9]*$/,
message: "请输入正确的账号",
trigger: "blur"
}
{ validator: accountPass, trigger: 'blur' }
],
userName: [
{ required: true, message: "请输入用户姓名", trigger: "blur" }
@ -164,8 +185,7 @@ export default {
{ required: true, message: "请选择账号角色", trigger: "change" }
],
workNumber: [
{ required: true, message: "请输入职工工号", trigger: "blur" },
// { pattern: /^[0-9]*$/, message: "", trigger: "blur"}
{ validator: workNumberPass , trigger: 'blur' }
],
uniqueIdentification: [
// { required: true, message: '', trigger: 'blur' },
@ -290,8 +310,16 @@ export default {
}).catch(res => {});
},
getRoleData() { //
this.$get(`${this.api.roleList}?page=1&size=100&name=''&platformId=1`).then(res => {
this.roleList = res.rolePage.records;
this.roleList =[];
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 => {});
},
closeTeacher() { // /
@ -320,7 +348,8 @@ export default {
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => {
let { data } = res;
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 => {
i.cascaderValue = [i.staffArchitectureId, i.gradeId]
return i;
@ -421,6 +450,7 @@ export default {
}
},
roleChange(value) { //
console.log(this.teacherForm.roleValue)
if (value.length) {
let ids = this.teacherForm.roleAndDeptList.map(e => e.roleId);
this.roleList.forEach(i => {
@ -430,6 +460,7 @@ export default {
cascaderValue: []
};
if (value.includes(i.id) && !ids.includes(i.id)) {
console.log(i)
obj.roleId = i.id;
obj.roleName = i.roleName;
this.teacherForm.roleAndDeptList.push(obj);
@ -606,4 +637,7 @@ export default {
padding: 24px;
}
}
.el-input__inner{
height: 32px;
}
</style>

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

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

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

Loading…
Cancel
Save