Branch_d40a2540 V2.2.8
yujialong 2 years ago
parent d0c11c180c
commit b2e97e87fc
  1. 10
      src/api/index.js
  2. 12
      src/components/quill/index.vue
  3. 1
      src/layouts/navbar/index.vue
  4. 7
      src/pages/achievement/show/index.vue
  5. 9
      src/pages/achievement/teach/index.vue
  6. 51
      src/pages/assessment/add/index.vue
  7. 33
      src/pages/course/add/index.vue
  8. 3
      src/pages/evaluation/list/index.vue
  9. 130
      src/pages/information/addarticle/index.vue
  10. 2
      src/pages/match/add/index.vue
  11. 19
      src/pages/match/add/set.vue
  12. 21
      src/pages/match/add/step2.vue
  13. 4
      src/pages/match/add/step3.vue
  14. 6
      src/pages/match/manage/matchArchList.vue
  15. 50
      src/pages/match/manage/matchInfo.vue
  16. 212
      src/pages/match/manage/matchRank.vue
  17. 50
      src/pages/match/manage/matchSignup.vue
  18. 8
      src/pages/match/manage/noticeDetail.vue
  19. 52
      src/pages/project/add/index.vue
  20. 16
      src/pages/setting/list/index.vue
  21. 57
      src/pages/setting/list/info.vue
  22. 2
      src/pages/station/preview/index.vue
  23. 58
      src/pages/system/list/staffSide.vue
  24. 2
      src/setting.js

@ -11,6 +11,7 @@ export default {
isClient: `users/users/user/isClient`,// 是否为客户
getUserAllRoleByToken : `users/users/role/getUserAllRoleByToken`,
getSchoolIdByToken : `users/users/data/user/getSchoolIdByToken`,
deleteProfile : `users/users/userInfo/deleteProfile`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,
@ -75,7 +76,7 @@ export default {
// 成绩管理
deleteExperimentalReport: `occupationlab/occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告
exportAssessmentInfo: `${host}occupationlab/occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
exportPracticeInfo: `occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
exportPracticeInfo: `${host}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
getAchievementInfo: `occupationlab/occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理
getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情
getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
@ -173,6 +174,7 @@ export default {
updateUser: `users/users/userInfo/updateUser`,
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`,
schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`,
// 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
@ -202,6 +204,12 @@ export default {
manuallyRankTheUploadList: `competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `competition/competition/rank/queryPublicationSource`,
releaseVerification: `competition/competition/rank/releaseVerification`,
totalRankingScoreDetails: `competition/competition/rank/totalRankingScoreDetails`,
batchRelease: `competition/competition/rank/batchRelease`,
manuallyUploadedRankings: `competition/competition/rank/manuallyUploadedRankings`,
toggleTheSortingMode: `competition/competition/rank/toggleTheSortingMode`,
selectTheLastSortStatus: `competition/competition/rank/selectTheLastSortStatus`,
cancelImport: `competition/competition/rank/cancelImport`,
gradeImport: `${host}template/赛事成绩导入模板.xlsx`,
rankImportTeam: `${host}template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `${host}template/赛事排名导入模板(个人赛).xlsx`,

@ -9,7 +9,7 @@
:on-success="editorUploadSuccess"
style="display: none"
>
<el-button class="editorUpload" type="primary">点击上传</el-button>
<el-button :id="'editorUpload' + index" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>
@ -54,9 +54,15 @@ export default {
*/
elseRead: {
type: String, default: "false"
}
},
//
index: {
type: Number,
default: 0
},
},
data() {
const that = this
return {
headers: {
token: util.local.get(Setting.tokenKey)
@ -74,7 +80,7 @@ export default {
"image": function(value) {
if (value) {
// iview
document.querySelector(".editorUpload").click();
document.querySelector("#editorUpload" + that.index).click();
} else {
this.Quill.format("image", false);
}

@ -156,6 +156,7 @@ export default {
menuSelect(path) {
this.setTabsName('1')
this.setColumnId('')
this.$store.commit('match/setCache', null)
if (path === '/screen') {
let arr=this.$route.path.split("/");
let name = `/${arr[1]}/list`

@ -128,7 +128,7 @@
<img src="@/assets/img/report5.png" alt="">
实验总结与体会
</h6>
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" />
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" :index="1" />
<div v-else class="pre-wrap" v-html="form.summarize"></div>
</div>
</div>
@ -207,6 +207,11 @@ export default {
e.answer += `${i + 1}.${n.userAnswer}`
})
})
} else { // pythonuserScores
list.forEach(e => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
})
}
this.expData = list
},

@ -29,13 +29,13 @@
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<div>
<el-input
<!-- <el-input
size="small"
placeholder="请输入学校/学生姓名"
prefix-icon="el-icon-search"
v-model="keyword" clearable
style="width: 300px"
></el-input>
></el-input> -->
</div>
<div>
<el-button type="primary" @click="delAllData">批量删除</el-button>
@ -165,6 +165,11 @@ export default {
}).catch(res => {})
}
},
initData() {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
//
handlePage(){
const list = this.listDataAll

@ -5,7 +5,7 @@
<div class="flex-between">
<el-page-header @back="goBack" :content="isDetail ? '查看' : (form.id ? '更新' : '创建') + '教学实验'"></el-page-header>
<div>
<el-button type="primary" @click="submit" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
<el-button type="primary" @click="save(0)" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
</div>
</div>
</el-card>
@ -264,15 +264,29 @@ export default {
"assFields"
])
},
// ,
beforeRouteLeave(to, from, next) {
if(!this.isToProject && this.updateTime){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(next)
}).catch(() => {
next()
})
}else{
next()
}
},
beforeDestroy() {
if (!this.isToProject) this.setAss({});
},
mounted() {
this.date = [util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000)), util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000))];
this.form.id && this.getData();
this.recoveryData();
this.getschoolCourse();
},
beforeDestroy() {
if (!this.isToProject) this.setAss({});
},
watch: {
// ,
form: {
@ -285,11 +299,13 @@ export default {
if (val[0] != "0000-00-00 00:00:00") {
this.startTime = util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(val[0]));
this.stopTime = util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(val[1]));
this.updateTime++
}
},
duration: {
handler(n, o) {
this.form.experimentDuration = `${n.day ? n.day : 0}d${n.hour ? n.hour : 0}h${n.minute ? n.minute : 0}m`;
this.updateTime++
},
deep: true
},
@ -398,6 +414,9 @@ export default {
this.getProjectData();
}
}
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(err => {
console.log(err);
});
@ -409,7 +428,8 @@ export default {
pageSize:this.pageSize,
cid:this.form.curriculumId,
projectName:this.keyword,
systemId: curItem ? curItem.systemId : 1
systemId: curItem ? curItem.systemId : 1,
permissions: 1
}
this.$post(this.api.projectListByCourseId,data).then(res => {
let { status, data } = res;
@ -428,7 +448,7 @@ export default {
this.page = 1;
this.getProjectData();
},
submit() { //
save(cb) { //
if (this.submiting) return false
if (!this.form.experimentalName) return util.warningMsg("请填写考核名称");
if (this.expNameRepeat) return util.warningMsg("考核名称重复,请重新输入");
@ -479,15 +499,17 @@ export default {
this.submiting = true
if (this.form.id) {
this.$post(this.api.modifyAssessment, this.form).then(res => {
this.updateTime = 0
util.successMsg("修改成功");
this.$router.back();
cb ? cb() : this.$router.back()
}).catch(err => {
this.submiting = false
});
} else {
this.$post(this.api.saveAssessment, this.form).then(res => {
this.updateTime = 0
util.successMsg("创建成功");
this.$router.back();
cb ? cb() : this.$router.back()
}).catch(err => {
this.submiting = false
});
@ -509,6 +531,9 @@ export default {
minute: duration[2]
};
this.date = [this.startTime, this.stopTime];
this.$nextTick(() => {
this.updateTime = 0
})
},
recoveryData() { //
if (JSON.stringify(this.assFields) != "{}") {
@ -542,7 +567,7 @@ export default {
},
toProject() {
this.handleCacheData();
this.$router.push("/project/list/?show=1");
this.$router.push("/project/list?show=1");
},
showProject(row) {
this.handleCacheData();
@ -564,18 +589,18 @@ export default {
this.$router.back()
},
goBack() {
const { id } = this.form
const updateTime = this.updateTime
//
if (updateTime > 1) {
if (this.updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.submit()
this.save()
}).catch(() => {
this.updateTime = 0
this.backPage()
})
} else {
this.updateTime = 0
this.backPage()
}
}

@ -73,7 +73,7 @@
<quill :border="true" :readonly="isDetail" v-model="form.courseIntroduction" :height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="save" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
<el-button type="primary" @click="save(0)" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
</el-form-item>
</el-form>
</el-card>
@ -218,6 +218,20 @@ export default {
deep:true
}
},
// ,
beforeRouteLeave(to, from, next) {
if(this.updateTime){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(next)
}).catch(() => {
next()
})
}else{
next()
}
},
mounted() {
this.getClassification()
this.form.id && this.getData()
@ -259,7 +273,9 @@ export default {
}
this.visibleChange(data.visibleRange)
this.form = data
this.$nextTick(() => {
this.updateTime = 0
})
this.uploadList.push({
name: "cover.jpg",
url: data.coverUrl
@ -304,7 +320,7 @@ export default {
this.form.coverUrl = ''
}).catch(res => {});
},
save() {
save(cb) {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.nameRepeat) return util.errorMsg('当前课程名已存在!')
@ -315,15 +331,17 @@ export default {
form.courseId = form.id
form.platformSource = Setting.platformSource
this.$post(this.api.updateTheoreticalCourse, form).then(res => {
this.updateTime = 0
this.submiting = false;
util.successMsg("修改成功");
this.$router.back();
cb ? cb() : this.$router.back()
}).catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.saveTheoreticalCourse, form).then(({ courseId }) => {
this.submiting = false;
this.updateTime = 0
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: "success",
confirmButtonText: "马上设置",
@ -331,7 +349,7 @@ export default {
}).then(() => {
this.$router.replace(`/course/contentSettings?id=${courseId}`);
}).catch(() => {
this.$router.back();
cb ? cb() : this.$router.back()
});
}).catch(err => {
this.submiting = false;
@ -345,18 +363,19 @@ export default {
this.$router.back()
},
back() {
const { id } = this.form
const updateTime = this.updateTime
//
if ((id && updateTime > 2) || (!id && updateTime)) {
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save()
}).catch(() => {
this.updateTime = 0
this.backPage()
})
} else {
this.updateTime = 0
this.backPage()
}
}

@ -372,7 +372,7 @@ export default {
this.$get(`${this.api.questionsDetail}`, { id }).then(res => {
this.topicForm = res.questions;
this.topicForm.id = id;
this.topicForm.questionType = res.questions.questionTypeName;
this.$set(this.topicForm, 'questionType', res.questions.questionTypeName)
this.NewTopics = true;
}).catch(err => {
console.log(err);
@ -454,6 +454,7 @@ export default {
});
},
questionTypeChange() {
console.log(11, this.topicForm.questionType)
for (let i in this.topicForm) {
if (i.includes("isTrue")) this.topicForm[i] = false;
}

@ -2,7 +2,7 @@
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="'新增文章'"></el-page-header>
<el-page-header @back="back" :content="'新增文章'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
@ -45,7 +45,7 @@
<quill :border="true" v-model="form.content" :uploading.sync="uploading" :height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="saveData">确定</el-button>
<el-button type="primary" @click="save(0)">确定</el-button>
</el-form-item>
</el-form>
</el-card>
@ -61,6 +61,7 @@ export default {
name: "addarticle",
data() {
return {
id: this.$route.query.id,
headers: {
token: util.local.get(Setting.tokenKey)
},
@ -95,7 +96,8 @@ export default {
uploadList: [],
uploadDataList: [],
submiting: false,
uploading: false
uploading: false,
updateTime: 0,
};
},
computed: {
@ -106,50 +108,41 @@ export default {
components: {
quill
},
watch: {
// ,
form: {
handler(val){
this.updateTime++
},
deep:true
}
},
// ,
beforeRouteLeave(to, from, next) {
if(this.updateTime){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(next)
}).catch(() => {
next()
})
}else{
next()
}
},
mounted() {
this.id = this.$route.query.id;
this.id && this.getData();
},
methods: {
//
goBack() {
this.$router.back();
},
getData() {
this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => {
this.form = article
this.$nextTick(() => {
this.updateTime = 0
})
}).catch(err => {})
},
saveData() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
const { form } = this
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true
if (form.id) {
this.$put(this.api.editArticle, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.createUser = this.customerName || this.userName
this.$post(this.api.addArticle, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
}
}
})
},
handleCurrentChange(val) {
this.currPage = val;
},
@ -188,19 +181,6 @@ export default {
this.keyword = "";
this.getData();
},
back() {
this.$router.back();
},
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
})
.then(() => {
this.back();
})
.catch(() => {
});
},
addSponsor() {
this.sponsorList.push("");
},
@ -212,6 +192,54 @@ export default {
},
delOrganizer(index) {
this.organzinerList.splice(index, 1);
},
save(cb) {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
const { form } = this
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true
if (form.id) {
this.$put(this.api.editArticle, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.updateTime = 0
cb ? cb() : this.$router.back()
})
.catch(err => {
this.submiting = false;
});
} else {
this.createUser = this.customerName || this.userName
this.$post(this.api.addArticle, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.updateTime = 0
cb ? cb() : this.$router.back()
})
.catch(err => {
this.submiting = false;
});
}
}
})
},
back() {
//
if (this.updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save()
}).catch(() => {
this.updateTime = 0
this.$router.back()
})
} else {
this.updateTime = 0
this.$router.back()
}
}
}
};

@ -88,7 +88,7 @@ export default {
}
],
publishStatus: 0,
competitionId: '',
competitionId: this.$route.query.id || '',
step: 1,
submiting: false,
updateTime: 0,

@ -71,10 +71,9 @@
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<!-- <el-table-column prop="createUser" label="创建人" align="center"></el-table-column> -->
<el-table-column prop="founder" label="创建人" align="center">
<template slot-scope="scope">
{{ scope.row.createUser }}
{{ scope.row.founder ? '老师创建' : '系统内置' }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
@ -154,9 +153,8 @@ export default {
},
//
courseChange(val) {
const { sysId, sysName } = this.curriculumList.find(e => e.cid == this.form.cid)
this.form.sysName = sysName
this.sysId = sysId
const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
this.sysId = systemId
if (val) this.loadIns = Loading.service()
this.getProject()
},
@ -187,9 +185,11 @@ export default {
},
//
toProject() {
const { form, curStep } = this.$parent
form[curStep] = this.form
this.$store.commit('match/setCache', {
form: this.form,
curStep: this.$parent.curStep
form,
curStep
})
this.$router.push(`/project/list?show=1`)
},
@ -226,11 +226,10 @@ export default {
if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目')
const cur = this.curriculumList.find(e => e.cid == form.cid)
if (cur) form.systemName = cur.sysName
const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId)
const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName
if (systemName) form.systemName = systemName
form.startTime = form.time[0]
form.endTime = form.time[1]
this.$emit('hideSet', this.form)

@ -28,7 +28,7 @@
)
</div>
</el-form-item>
<el-form-item prop="resultCalculationMethod" label="总成绩计算方式">
<el-form-item v-if="!form.rule" prop="resultCalculationMethod" label="总成绩计算方式">
<el-radio v-model="form.resultCalculationMethod" :label="0">各阶段成绩加权求和</el-radio>
<el-radio v-model="form.resultCalculationMethod" :label="1">各阶段成绩直接求和</el-radio>
<el-radio v-model="form.resultCalculationMethod" :label="2">各阶段成绩取平均值</el-radio>
@ -280,13 +280,19 @@ export default {
},
//
stageChange(val) {
const list = []
for (let i = 1; i <= val; i++) {
const form = JSON.parse(JSON.stringify(this.ruleForm))
form.number = i
list.push(form)
const stages = this.form.competitionStageList
const { ruleId } = this.form
if (stages.length < val) {
const list = []
for (let i = 1; i <= val - stages.length; i++) {
const form = JSON.parse(JSON.stringify(this.ruleForm))
form.number = stages.length + i
if (ruleId) form.ruleId = ruleId
this.form.competitionStageList.push(form)
}
} else {
this.form.competitionStageList = stages.slice(0, val)
}
this.form.competitionStageList = list
},
//
save(status, next = 0) {
@ -300,6 +306,7 @@ export default {
const stages = form.competitionStageList
if (form.rule === 2) { //
const e = stages[0]
e.stageName = step1.name
if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') {
return util.errorMsg('请填写成绩公布时间')

@ -134,7 +134,7 @@ export default {
resumeData() {
if (this.cache) {
this.curStep = this.cache.curStep
if (this.cache.form) this.form[this.curStep] = this.cache.form
if (this.cache.form) this.form = this.cache.form
this.setVisible = true
this.$store.commit('match/setCache', null)
}
@ -278,7 +278,7 @@ export default {
}).then(res => {
this.$parent.hideLoad()
//
!form[0].contentId && status && this.publish(status)
status && this.publish(status)
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next)
}).catch(err => {

@ -93,6 +93,7 @@
:data="{
competitionId: this.id,
stageId: this.stageId,
systemId: 0
}"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
@ -133,7 +134,7 @@ export default {
uploadFaild: false,
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
token: util.local.get(Setting.tokenKey)
},
statData: {}
};
@ -173,7 +174,7 @@ export default {
},
//
show(row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
this.$router.push(`/match/report?reportId=${row.reportId}`)
},
// ()
exportData() {
@ -183,6 +184,7 @@ export default {
url += `&ids=${ids.toString()}`
}
axios.post(this.api.exportExperimentalResultsInBatch, this.list, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`赛事成绩.xls`,new Blob([res.data]))

@ -25,18 +25,20 @@
</div>
</div>
<table class="table">
<tr>
<th width="150">姓名</th>
<td>{{ info.person.userName }}</td>
</tr>
<tr>
<th>学号</th>
<td>{{ info.person.workNumber }}</td>
</tr>
<tr>
<th>学校</th>
<td>{{ info.person.schoolName }}</td>
</tr>
<template v-if="form.completeCompetitionSetup.competitionType === 0">
<tr>
<th width="150">姓名</th>
<td>{{ info.person.userName }}</td>
</tr>
<tr>
<th>学号</th>
<td>{{ info.person.workNumber }}</td>
</tr>
<tr>
<th>学校</th>
<td>{{ info.person.schoolName }}</td>
</tr>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<template>
<tr>
@ -79,8 +81,8 @@
<template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th>
<th>允许参赛人员</th>
<th v-if="form.rule === 0">总分</th>
</template>
<th v-if="form.rule === 0">总分</th>
<th>竞赛成绩</th>
</tr>
<template v-if="info.stages.length">
@ -103,10 +105,10 @@
<span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i>
</td>
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
</template>
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
<td>
<span v-if="item.score > 0" class="m-r-10">分数{{item.score}}</span>
<span v-if="item.score >= 0" class="m-r-10">分数{{item.score}}</span>
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button>
</td>
</tr>
@ -265,7 +267,7 @@ export default {
this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer)
this.timerList.forEach(n => {
clearInterval(n)
clearTimeout(n)
})
this.timerList = []
})
@ -318,7 +320,7 @@ export default {
const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // +
if (now > endTime) { //
info.stages.find(n => n.stageId == e.stageId).showDetail = 1
} else { //
} else if (endTime - now < 86400000) { //
this.timerList.push(setTimeout(this.getInfo, endTime - now))
}
}
@ -544,16 +546,16 @@ export default {
if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row
this.memberVisible = true
const teamId = this.form.competitionRegistration.teamId
const teamId = this.info.teamId
if (teamId) {
this.$post(this.api.stageGradeManagementList, {
this.$post(this.api.frontOfficeCompetitionRanking, {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
stageId: row.stageId,
isNakadai: 0
}).then(({ page }) => {
this.members = page.records.filter(e => e.teamId === teamId)
isOverallRanking: 0,
teamId
}).then(({ list }) => {
this.members = list
}).catch(res => {})
} else {
this.members = []
@ -564,7 +566,7 @@ export default {
},
//
toReport(row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
this.$router.push(`/match/report?reportId=${row.reportId}`)
},
}
};

@ -20,8 +20,9 @@
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
</div>
<div>
<el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-if="published && ((!type && sourceType === '0') || (type && sourceType == 1))" type="primary" @click="cancelPublish(0)">取消发布</el-button>
<!-- <el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button> -->
<el-button v-if="!published" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center">
@ -38,13 +39,13 @@
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column>
<el-table-column prop="timeSum" label="用时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum }}min
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }}
</template>
</el-table-column>
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column label="得分详情" align="center" width="160">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row, scope.$index)">查看</el-button>
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text" @click="show(scope.row, scope.$index)">查看</el-button>
</template>
</el-table-column>
</el-table>
@ -113,7 +114,7 @@
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload
ref="importStaff"
ref="upload"
name="file"
accept=".xls,.xlsx"
:on-remove="handleRemove"
@ -128,8 +129,10 @@
:data="{
competitionId: this.id,
stageId: this.stageId,
isOverallRanking: active ? 0 : 1
isOverallRanking: active ? 0 : 1,
schoolId: this.$store.state.user.schoolId
}"
:auto-upload="false"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
@ -204,33 +207,58 @@ export default {
//
getData() {
//
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
const ids = this.grades.map(e => e.stageId)
ids.pop()
// >(:(1,0))
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
}).catch(res => {})
this.published = whetherToPublish
this.getRank(whetherToPublish)
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => {
// const ids = this.grades.map(e => e.stageId)
// ids.pop()
// // >(:(1,0))
// whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
// this.sourceType = source
// this.type = source == 1 ? 1 : 0
// }).catch(res => {})
// this.published = whetherToPublish
// this.getRank(whetherToPublish)
// }).catch(res => {})
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
// const ids = this.grades.map(e => e.stageId)
// ids.pop()
// // >(:(1,0))
// whetherToPublish ?
// this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
// this.sourceType = source
// this.type = source == 1 ? 1 : 0
// this.getRank(whetherToPublish)
// }).catch(res => {}) :
// this.getRank()
// this.published = whetherToPublish
// }).catch(res => {})
this.$post(`${this.api.selectTheLastSortStatus}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => {
this.sourceType = source
this.type = source == 1 ? 1 : 0
this.getRank()
}).catch(res => {})
},
//
getRank(whetherToPublish) {
//
if (whetherToPublish) {
this.$post(this.api.manuallyRankTheUploadList, {
getRank() {
//
if (this.type) {
this.$post(this.api.manuallyUploadedRankings, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
stageId: this.active || ''
}).then(({ message }) => {
stageId: this.active || this.stageId
}).then(({ message, publishStatus }) => {
// isRelease 01
this.published = publishStatus
this.sourceType = message.total ? message.records[0].isRelease : 0
this.list = message.records
this.total = message.total
}).catch(res => {})
} else { //
} else { //
if (!this.active) {
//
const ids = this.grades.map(e => e.stageId)
@ -238,13 +266,17 @@ export default {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
publicationType: this.type,
locationStageId: this.stageId,
stageIds: ids.splice(0, ids.length - 1)
}).then(({ page }) => {
}).then(({ page, publishStatus }) => {
this.published = publishStatus
this.list = page
this.total = total
}).catch(res => {})
} else { //
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(({ page, total }) => {
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => {
this.published = publishStatus
this.list = page
this.total = total
}).catch(res => {})
@ -270,7 +302,14 @@ export default {
},
//
typeChange(val) {
this.getRank(val)
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {}).catch(res => {})
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
// if (whetherToPublish && !val) this.sourceType = '0'
this.getRank()
// this.published = whetherToPublish
// }).catch(res => {})
},
initData() {
this.page = 1
@ -363,7 +402,7 @@ export default {
},
//
toReport(row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
this.$router.push(`/match/report?reportId=${row.reportId}`)
},
handleCurrentChange(val) { //
this.page = val;
@ -371,47 +410,71 @@ export default {
},
//
publishSubmit() {
let data = this.uploadData // data
if (!this.type) { //
//
const { list, id } = this
const isOverall = this.active ? 0 : 1
if (list.length) {
const isPerson = this.competitionType == 0
list.map(e => {
e.competitionId = id
e.isOverallRanking = isOverall
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
data = list
}
}
const ids = this.grades.map(e => e.stageId)
ids.pop()
//
this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(this.api.publishRanking, data).then(res => {
this.uploadData = []
const { startTime, endTime } = this.grades[this.index]
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
if (this.type) { //
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => {
this.getData()
util.successMsg('发布成功!')
}).catch(res => {})
}).catch(res => {})
} else {
let data = [] // data
if (!this.type) { //
//
const { list, id } = this
const isOverall = this.active ? 0 : 1
if (list.length) {
const isPerson = this.competitionType == 0
list.map(e => {
e.competitionId = id
e.isOverallRanking = isOverall
e.stageId = this.stageId
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
})
data = list
}
}
data.forEach(e => {
e.publicationType = this.type
})
const ids = this.grades.map(e => e.stageId)
ids.pop()
//
// this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(this.api.publishRanking, data).then(res => {
this.uploadData = []
this.getData()
util.successMsg('发布成功!')
}).catch(res => {})
// }).catch(res => {})
}
},
//
publish() {
//
if (this.published && this.sourceType != this.type) {
this.$confirm(this.sourceType == 1 && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' :
'默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', {
type: 'success'
}).then(() => {
// if (this.published && this.sourceType != this.type) {
// this.$confirm(this.sourceType == 1 && !this.type ?
// '' :
// '', '', {
// type: 'success'
// }).then(() => {
// this.publishSubmit()
// }).catch(() => {})
// } else {
// this.publishSubmit()
// }
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
whetherToPublish ?
this.$confirm('排名已经发布,是否直接覆盖?', '提示', {
type: 'success'
}).then(() => {
this.publishSubmit()
}).catch(() => {}) :
this.publishSubmit()
}).catch(() => {})
} else {
this.publishSubmit()
}
}).catch(res => {})
// this.publishSubmit()
},
//
cancelPublish(publish) {
@ -424,13 +487,15 @@ export default {
//
//
if (publish) {
this.$post(this.api.deleteLastPublication, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
stageIds: this.active ? [this.active] : stageIds
}).then(res => {
// this.type ?
this.publish()
}).catch(res => {})
// this.$post(this.api.deleteLastPublication, {
// competitionId: this.id,
// isOverallRanking: this.active ? 0 : 1,
// stageIds: this.active ? [this.active] : stageIds
// }).then(res => {
// this.publish()
// }).catch(res => {})
} else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
this.sourceType = ''
@ -473,10 +538,13 @@ export default {
this.exportCode = exportCode
this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
} else {
this.importVisible = false
this.getRank()
util.successMsg('请检查数据后,点击发布排名以发布数据!')
}
this.uploadData = res.data.data
} else {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据")
util.errorMsg(res.message || "上传失败,请检查数据")
}
},
uploadError(err, file, fileList) {
@ -494,9 +562,11 @@ export default {
this.uploadFaild = false
},
uploadSure() {
this.importVisible = false
this.list = this.uploadData
this.uploadData.length && util.successMsg('请检查数据后,点击发布排名以发布数据!')
this.list.length ?
this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => {
this.$refs.upload.submit()
}).catch(res => {}) :
this.$refs.upload.submit()
}
}
};

@ -5,7 +5,7 @@
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入姓名/手机号/团队名称/学号" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 250px"></el-input>
<el-input placeholder="请输入姓名/手机号/学号" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 250px"></el-input>
</li>
<li v-if="info.releaseType">
<label>参赛人员状态</label>
@ -62,7 +62,7 @@
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'>
<el-form-item prop="schoolId" label="院校">
<el-form-item v-if="!schoolDisable" prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
@ -76,7 +76,7 @@
<el-form-item label="账号角色">
学生
</el-form-item>
<el-form-item prop="teamId" label="所属团队">
<el-form-item v-if="info.completeCompetitionSetup.competitionType" prop="teamId" label="所属团队">
<div style="display: flex;align-items: center">
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable style="width: 240px;margin-right: 10px">
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
@ -194,7 +194,9 @@ export default {
identification: 1
},
originForm: {},
exitMember: 0
exitMember: 0,
notExit: 0,
schoolDisable: false
};
},
watch: {
@ -206,9 +208,9 @@ export default {
}
},
mounted() {
console.log(44, this.$store.state.user.schoolId)
this.initData()
this.getInfo()
this.getClient()
this.getTeam()
},
methods: {
@ -232,6 +234,13 @@ export default {
getInfo() {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
//
if (competition.competitionScope) {
this.getClient()
} else {
this.schoolDisable = true
this.form.schoolId = this.$store.state.user.schoolId
}
}).catch(err => {})
},
initData() {
@ -257,12 +266,14 @@ export default {
},
//
add() {
this.notExit = 0
this.isAdd = true
this.addVisible = true
},
//
edit(row) {
this.isAdd = false
this.notExit = 0
this.addVisible = true
row.userName = row.username
this.exitMember = 0
@ -281,6 +292,7 @@ export default {
}
this.formEnable = !account
}).catch(res => {
if (res.message === '学生不存在') this.notExit = 1
if (!this.isAdd) this.exitMember = 1
})
} else {
@ -289,12 +301,16 @@ export default {
},
//
submitForm() {
if (this.notExit) {
this.submiting = false
return util.errorMsg('学生不存在,无法添加!')
}
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
const { form } = this
if (!this.isAdd) { //
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
@ -333,7 +349,7 @@ export default {
})
} else {
//
this.$post(this.api.joinCompetitionTeam, {
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
accountId: form.id,
competitionId: this.id,
teamId: this.form.teamId,
@ -376,7 +392,7 @@ export default {
competitionId: this.id,
userName: '',
workNumber: '',
schoolId: '',
schoolId: this.schoolDisable ? this.$store.state.user.schoolId : '',
teamId: '',
whetherSignUp: 0,
phone: '',
@ -400,9 +416,15 @@ export default {
},
//
getClient() {
this.$get(this.api.querySchoolData).then(({ list }) => {
this.clients = list
}).catch(res => {})
if (this.info.competitionScope === 2) { //
this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => {
this.clients = schools
}).catch(res => {})
} else { //
this.$get(this.api.querySchoolData).then(({ list }) => {
this.clients = list
}).catch(res => {})
}
},
//
getTeam() {

@ -160,9 +160,11 @@ export default {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.deleteAnnouncementAnnex}?id=${id}`).then(res => {}).catch(res => {})
if (file.url) {
this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.delAnnex}?id=${id}`).then(res => {}).catch(res => {})
}
},
back() {
this.$router.back()

@ -5,8 +5,8 @@
<div class="flex-between">
<el-page-header @back="back" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button type="success" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button>
<el-button type="success" @click="save(0)">保存为草稿</el-button>
<el-button type="primary" @click="save(1)">确定并发布</el-button>
</div>
</div>
</el-card>
@ -57,7 +57,7 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" :index="1" />
</el-form-item>
</el-form>
</div>
@ -104,7 +104,7 @@
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="实验要求" align="center" width="600">
<template slot-scope="scope">
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" />
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" :index="2" />
</template>
</el-table-column>
<el-table-column prop="score" label="分数" align="center" width="120">
@ -134,7 +134,7 @@
<div>
<el-form label-width="0">
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" :minHeight="150" :height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" :minHeight="150" :height="150" :index="3" />
</el-form-item>
</el-form>
</div>
@ -231,7 +231,8 @@ export default {
visibleLoading: false, //
listLoading:false,//
submiting: false, //
updateTime: 0
updateTime: 0,
next: null
};
},
computed: {
@ -270,10 +271,24 @@ export default {
}, 500);
}
},
created() {
this.getSystemData();
// ,
beforeRouteLeave(to, from, next) {
console.log(44, this.updateTime)
if(this.updateTime){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.next = next
this.save(this.projectManage.state)
}).catch(() => {
next()
})
}else{
next()
}
},
mounted() {
this.getSystemData();
if (this.$route.query.projectId) {
this.projectId = this.$route.query.projectId;
this.getInfoData();
@ -312,6 +327,7 @@ export default {
});
this.$nextTick(() => {
this.$refs.main.scrollTop = 0;
this.updateTime = 0
});
}).catch(err => {
console.log(err);
@ -392,7 +408,7 @@ export default {
}
return true;
},
handleSubmit(state) { //
save(state) { //
if (this.submiting) return false
if (!this.judgmentRelease(state)) { //
return;
@ -434,7 +450,8 @@ export default {
updateProject(params) { //
this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => {
util.successMsg("更新实验项目成功");
this.$router.back();
this.updateTime = 0
this.next ? this.next() : this.$router.back();
}).catch(err => {
this.submiting = false
});
@ -443,7 +460,8 @@ export default {
console.log("🚀 ~ file: index.vue ~ line 448 ~ addProject ~ params", params)
this.$post(this.api[params.projectManage.state ? 'addProjectManage' : 'saveProjectDraft'], params).then(res => {
util.successMsg("添加实验项目成功");
this.$router.back();
this.updateTime = 0
this.next ? this.next() : this.$router.back();
}).catch(err => {
this.submiting = false
});
@ -677,23 +695,19 @@ export default {
console.log(err);
});
},
//
toList() {
this.$router.back()
},
//
back() {
//
if(this.updateTime > 1){
if(this.updateTime){
this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning"
}).then(() => {
this.handleSubmit(this.projectManage.state)
this.save(this.projectManage.state)
}).catch(() => {
this.toList()
this.$router.back()
})
} else {
this.toList()
this.$router.back()
}
}
}

@ -44,6 +44,21 @@ export default {
edited: false
};
},
// ,
beforeRouteLeave(to, from, next) {
if(this.edited){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.$refs.info.save()
next()
}).catch(() => {
next()
})
}else{
next()
}
},
components: { info },
computed: {
...mapState('user', [
@ -61,6 +76,7 @@ export default {
this.setAvatar(res.message)
},
updateStatus(status){
console.log("🚀 ~ file: index.vue:79 ~ updateStatus ~ status", status)
this.edited = status
}
}

@ -176,7 +176,7 @@
</div>
</div>
<div class="btns">
<el-button size="small" v-throttle @click="$router.back()">取消</el-button>
<!-- <el-button size="small" v-throttle @click="cancel">取消</el-button> -->
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button>
</div>
@ -400,6 +400,23 @@ export default {
"userId", "avatar"
])
},
watch: {
// ,
form: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
},
archivesList: {
handler(){
this.updateTime++
if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
}
},
mounted() {
this.getData();
this.getProvince();
@ -549,6 +566,10 @@ export default {
} else {
this.concatArch(1);
}
setTimeout(() => {
this.updateTime = 1
this.$emit('updateStatus',this.updateTime > 1)
}, 500)
});
})
.catch(err => {
@ -779,7 +800,21 @@ export default {
});
}
},
save() {
//
cancel() {
if(this.updateTime > 1){
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', {
type: 'warning'
}).then(() => {
this.save(1)
}).catch(() => {
this.$router.back()
})
}else{
this.$router.back()
}
},
save(close) {
let isEmpty = false;
// this.archivesList.forEach((n, k) => {
// if (!n.personalCareerId) isEmpty = true;
@ -832,6 +867,7 @@ export default {
this.$post(this.api.updatePersonCenter, data).then(res => {
this.setUserName(form.userName);
this.$message.success("提交成功!");
close && this.$router.back()
}).catch(res => {
});
},
@ -967,23 +1003,6 @@ export default {
}
}
},
watch: {
// ,
form: {
handler(){
this.updateTime++
// if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
},
archivesForm: {
handler(){
this.updateTime++
// if(this.updateTime > 1) this.$emit('updateStatus',this.updateTime > 1)
},
deep:true
},
},
};
</script>

@ -169,7 +169,7 @@ export default {
},
methods: {
goBack() {
this.$router.back();
this.$router.push('/station')
},
async getData() {
let { data } = await this.$post(`${this.api.curriculumDetail}?cid=${this.courseId}`);

@ -47,7 +47,7 @@
<el-dialog :title="Form.staffArchitectureId ? '编辑部门' : '新增部门'" :visible.sync="majorVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules">
<el-form-item prop="staffArchitectureName">
<el-input placeholder="请输入专业名称" v-model="Form.staffArchitectureName"></el-input>
<el-input placeholder="请输入部门名称" v-model="Form.staffArchitectureName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -57,14 +57,14 @@
</el-dialog>
<el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'" :visible.sync="depVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules">
<el-form ref="Form1" :model="Form" :rules="rules">
<el-form-item prop="gradeName">
<el-input placeholder="请输入部门名称" v-model="Form.gradeName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="depVisible = false"> </el-button>
<el-button type="primary" @click="sureDepartment('Form')"> </el-button>
<el-button type="primary" @click="sureDepartment('Form1')"> </el-button>
</span>
</el-dialog>
</div>
@ -89,7 +89,7 @@ export default {
},
rules: {
staffArchitectureName: [
{ required: true, message: "请输入专业名称", trigger: "blur" }
{ required: true, message: "请输入部门名称", trigger: "blur" }
],
gradeName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
@ -167,16 +167,17 @@ export default {
this.$post(this.api.saveProfessional, data).then(res => {
util.successMsg("添加成功");
this.majorVisible = false;
let newData = {
staffArchitectureId: res.staffArchitectureId,
staffArchitectureName: this.Form.staffArchitectureName,
label: this.Form.staffArchitectureName,
value: res.staffArchitectureId,
ifVisible: false,
ischeck: false,
children: []
};
this.orgList.push(newData);
this.getStaff()
// let newData = {
// staffArchitectureId: res.staffArchitectureId,
// staffArchitectureName: this.Form.staffArchitectureName,
// label: this.Form.staffArchitectureName,
// value: res.staffArchitectureId,
// ifVisible: false,
// ischeck: false,
// children: []
// };
// this.orgList.push(newData);
}).catch(res => {
});
}
@ -235,20 +236,21 @@ export default {
this.$post(this.api.saveGrade, data).then(res => {
util.successMsg("添加成功");
this.depVisible = false;
let newData = {
gradeId: res.gradeId,
gradeName: this.Form.gradeName,
label: this.Form.gradeName,
value: res.gradeId,
ifVisible: false,
ischeck: false
};
this.orgList.map(e => {
if (e.staffArchitectureId == this.Form.staffArchitectureId) {
e.ifVisible = true;
e.children.push(newData);
}
});
this.getStaff()
// let newData = {
// gradeId: res.gradeId,
// gradeName: this.Form.gradeName,
// label: this.Form.gradeName,
// value: res.gradeId,
// ifVisible: false,
// ischeck: false
// };
// this.orgList.map(e => {
// if (e.staffArchitectureId == this.Form.staffArchitectureId) {
// e.ifVisible = true;
// e.children.push(newData);
// }
// });
}).catch(res => {
});
}

@ -26,7 +26,7 @@ if (isPro) {
uploadURL = `http://121.37.12.51/`
host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服
// host = "http://192.168.31.51:9000/"; // 榕
// host = "http://192.168.31.151:9000/"; // 榕
host = 'http://192.168.31.116:9000/'; // 赓
}

Loading…
Cancel
Save