|
|
@ -16,16 +16,6 @@ |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<el-form label-width="80px"> |
|
|
|
<div class="flex"> |
|
|
|
<div class="flex"> |
|
|
|
<el-form-item label="项目名称"> |
|
|
|
|
|
|
|
<el-input :disabled="isDetail || item == 0" v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="项目权限"> |
|
|
|
|
|
|
|
<el-select :disabled="isDetail || item == 0" v-model="projectManage.permissions" placeholder="请选择" @change="permissionChange"> |
|
|
|
|
|
|
|
<el-option label="练习" :value="0"></el-option> |
|
|
|
|
|
|
|
<el-option label="考核" :value="1"></el-option> |
|
|
|
|
|
|
|
<el-option label="竞赛" :value="2"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="系统"> |
|
|
|
<el-form-item label="系统"> |
|
|
|
<el-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange"> |
|
|
|
<el-select :disabled="isDetail || item == 0" v-model="projectManage.systemId" placeholder="请选择" @change="systemChange"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
@ -36,6 +26,16 @@ |
|
|
|
></el-option> |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="项目名称"> |
|
|
|
|
|
|
|
<el-input :disabled="isDetail || item == 0" v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="项目权限"> |
|
|
|
|
|
|
|
<el-select :disabled="isDetail || item == 0" v-model="projectManage.permissions" placeholder="请选择" @change="permissionChange"> |
|
|
|
|
|
|
|
<el-option label="练习" :value="0"></el-option> |
|
|
|
|
|
|
|
<el-option label="考核" :value="1"></el-option> |
|
|
|
|
|
|
|
<el-option label="竞赛" :value="2"></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -222,6 +222,7 @@ export default { |
|
|
|
selectedJudgment: [], // 选中的判分点 |
|
|
|
selectedJudgment: [], // 选中的判分点 |
|
|
|
rowKey: "", // 判分点行数据的 Key |
|
|
|
rowKey: "", // 判分点行数据的 Key |
|
|
|
projectNameRepeat: false, // 项目名称是否重复 |
|
|
|
projectNameRepeat: false, // 项目名称是否重复 |
|
|
|
|
|
|
|
originName: '', |
|
|
|
|
|
|
|
|
|
|
|
flag: false, //判分点表格分数是否禁用 |
|
|
|
flag: false, //判分点表格分数是否禁用 |
|
|
|
avgValuelist: [], //取得判分点平均分的数组 |
|
|
|
avgValuelist: [], //取得判分点平均分的数组 |
|
|
@ -316,6 +317,7 @@ export default { |
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { |
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { |
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
this.projectManage = projectManage; |
|
|
|
this.projectManage = projectManage; |
|
|
|
|
|
|
|
this.originName = projectManage.projectName |
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
this.projectJudgmentData.forEach((e, i) => { |
|
|
|
this.projectJudgmentData.forEach((e, i) => { |
|
|
|
e.sort = i + 1; |
|
|
|
e.sort = i + 1; |
|
|
@ -328,16 +330,17 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
projectNameExistis() { // 项目管理名称判重 |
|
|
|
projectNameExistis() { // 项目管理名称判重 |
|
|
|
if (this.projectManage.projectName) { |
|
|
|
const { projectName } = this.projectManage |
|
|
|
this.$post(this.api.queryNameIsExist, { projectName: this.projectManage.projectName }).then(res => { |
|
|
|
if (this.originName === projectName) { |
|
|
|
|
|
|
|
this.projectNameRepeat = false |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$post(this.api.queryNameIsExist, { projectName }).then(res => { |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
this.projectNameRepeat = false; |
|
|
|
this.projectNameRepeat = false |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.projectNameRepeat = true; |
|
|
|
this.projectNameRepeat = true |
|
|
|
}); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
this.projectNameRepeat = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
systemChange() { // 切换系统 |
|
|
|
systemChange() { // 切换系统 |
|
|
@ -353,7 +356,11 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
judgmentRelease() { //判断能否成功发布 |
|
|
|
// 去除空白标签 |
|
|
|
|
|
|
|
removeTag(val) { |
|
|
|
|
|
|
|
return val.replace('<p><br></p>', '') |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
judgmentRelease(state) { //判断能否成功发布 |
|
|
|
let { |
|
|
|
let { |
|
|
|
projectName, |
|
|
|
projectName, |
|
|
|
experimentTarget, |
|
|
|
experimentTarget, |
|
|
@ -369,11 +376,12 @@ export default { |
|
|
|
util.warningMsg("该项目名称已存在"); |
|
|
|
util.warningMsg("该项目名称已存在"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!experimentTarget) { |
|
|
|
if (state) { |
|
|
|
|
|
|
|
if (!experimentTarget || !this.removeTag(experimentTarget)) { |
|
|
|
util.warningMsg("请输入实验目标"); |
|
|
|
util.warningMsg("请输入实验目标"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!experimentDescription) { |
|
|
|
if (!experimentDescription || !this.removeTag(experimentDescription)) { |
|
|
|
util.warningMsg("请输入案例描述"); |
|
|
|
util.warningMsg("请输入案例描述"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -389,15 +397,16 @@ export default { |
|
|
|
util.warningMsg("判分点分数已超过100"); |
|
|
|
util.warningMsg("判分点分数已超过100"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!experimentHint && hintOpen == 0) { |
|
|
|
if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) { |
|
|
|
util.warningMsg("请输入实验提示"); |
|
|
|
util.warningMsg("请输入实验提示"); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSubmit(state) { //处理提交 |
|
|
|
handleSubmit(state) { //处理提交 |
|
|
|
if (this.submiting) return false |
|
|
|
if (this.submiting) return false |
|
|
|
if (!this.judgmentRelease()) { //判断页面是否有没有输入的内容 |
|
|
|
if (!this.judgmentRelease(state)) { //判断页面是否有没有输入的内容 |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.submiting = true |
|
|
|
this.submiting = true |
|
|
@ -443,7 +452,8 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
addProject(params) { // 添加项目 |
|
|
|
addProject(params) { // 添加项目 |
|
|
|
this.$post(`${this.api.addProjectManage}`, params).then(res => { |
|
|
|
console.log("🚀 ~ file: index.vue ~ line 448 ~ addProject ~ params", params) |
|
|
|
|
|
|
|
this.$post(this.api[params.projectManage.state ? 'addProjectManage' : 'saveProjectDraft'], params).then(res => { |
|
|
|
util.successMsg("添加实验项目成功"); |
|
|
|
util.successMsg("添加实验项目成功"); |
|
|
|
this.$router.back(); |
|
|
|
this.$router.back(); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
@ -543,7 +553,7 @@ export default { |
|
|
|
this.visibleLoading = false; |
|
|
|
this.visibleLoading = false; |
|
|
|
this.judgementData = result; |
|
|
|
this.judgementData = result; |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
this.visibleLoading = false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getProgrammingClassData(params) { // 获取编程类判分点列表数据 |
|
|
|
getProgrammingClassData(params) { // 获取编程类判分点列表数据 |
|
|
@ -556,10 +566,8 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.visibleLoading = false; |
|
|
|
this.visibleLoading = false; |
|
|
|
this.judgementData = result; |
|
|
|
this.judgementData = result; |
|
|
|
// console.log(res, "res"); |
|
|
|
|
|
|
|
// console.log(this.projectJudgmentData, "projectJudgmentData"); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
this.visibleLoading = false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionJudgment(val) { // 处理多选判分点 |
|
|
|
handleSelectionJudgment(val) { // 处理多选判分点 |
|
|
|