|
|
|
@ -75,7 +75,6 @@ |
|
|
|
|
<div class="m-r-20" style="color: #f00">项目总分值:100分</div> |
|
|
|
|
<!-- <div>权重 <div class="dib"><el-input></el-input></div></div> --> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div> |
|
|
|
|
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button> |
|
|
|
|
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button> |
|
|
|
@ -84,61 +83,43 @@ |
|
|
|
|
</div> |
|
|
|
|
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button> |
|
|
|
|
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button> |
|
|
|
|
<el-table |
|
|
|
|
ref="projectJudgementTable" |
|
|
|
|
:data="projectJudgmentData" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionProjectJudgment" |
|
|
|
|
row-key="judgmentId" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="id" label="序号" width="80" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分指标" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="排序" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button |
|
|
|
|
:disabled="isDetail" |
|
|
|
|
v-show="scope.$index > 0" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-top" |
|
|
|
|
@click="handleMoveUp(scope.$index)" |
|
|
|
|
style="font-size: 24px" |
|
|
|
|
></el-button> |
|
|
|
|
<el-button |
|
|
|
|
:disabled="isDetail" |
|
|
|
|
v-show="(scope.$index+1) < projectJudgmentData.length" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-bottom" |
|
|
|
|
@click="handleMoveDown(scope.$index)" |
|
|
|
|
style="font-size: 24px" |
|
|
|
|
></el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="实验要求" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="140" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!--<el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>--> |
|
|
|
|
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="score" label="分数" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!--type="number"--> |
|
|
|
|
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index)"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="draggable" style="padding: 20px"> |
|
|
|
|
<el-table |
|
|
|
|
ref="projectJudgementTable" |
|
|
|
|
:data="projectJudgmentData" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
@selection-change="handleSelectionProjectJudgment" |
|
|
|
|
row-key="judgmentId" |
|
|
|
|
> |
|
|
|
|
<el-table-column type="selection" width="55" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="sort" label="序号" width="80" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{scope.row.sort}} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分指标" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column label="实验要求" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="140" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!--<el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>--> |
|
|
|
|
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="score" label="分数" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!--type="number"--> |
|
|
|
|
<el-input :disabled="isDetail" v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index,$event)"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
@ -160,13 +141,12 @@ |
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
<!--选择判分点对话框--> |
|
|
|
|
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false"> |
|
|
|
|
<el-dialog title="添加判分点" v-loading="visibleLoading" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false"> |
|
|
|
|
<div class="text-right m-b-10"> |
|
|
|
|
<div> |
|
|
|
|
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
:data="judgementData" |
|
|
|
|
ref="judgementTable" |
|
|
|
@ -203,7 +183,7 @@ import Setting from "@/setting"; |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
|
import quill from "@/components/quill"; |
|
|
|
|
|
|
|
|
|
import Sortable from 'sortablejs'; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
quill |
|
|
|
@ -244,7 +224,8 @@ export default { |
|
|
|
|
avgValuelist: [], //取得判分点平均分的数组 |
|
|
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
|
isToPoint: false // 判断是否是跳转到判分点系统 |
|
|
|
|
isToPoint: false, // 判断是否是跳转到判分点系统 |
|
|
|
|
visibleLoading:false,// 加载弹框 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -295,6 +276,7 @@ export default { |
|
|
|
|
this.projectManage = projectManage; |
|
|
|
|
this.projectJudgmentData = projectJudgmentData; |
|
|
|
|
} |
|
|
|
|
this.rowDrop() |
|
|
|
|
}, |
|
|
|
|
beforeDestroy() { |
|
|
|
|
if (!this.isToPoint) { |
|
|
|
@ -323,6 +305,9 @@ export default { |
|
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
|
this.projectManage = projectManage; |
|
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
|
this.projectJudgmentData.forEach((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
util.warningMsg(res.message); |
|
|
|
|
} |
|
|
|
@ -410,7 +395,8 @@ export default { |
|
|
|
|
let obj = { |
|
|
|
|
projectId: this.projectId ? this.projectId : "", |
|
|
|
|
judgmentId: i.judgmentId, |
|
|
|
|
score: i.score |
|
|
|
|
score: i.score, |
|
|
|
|
sort:i.sort |
|
|
|
|
}; |
|
|
|
|
return obj; |
|
|
|
|
}); |
|
|
|
@ -475,24 +461,28 @@ export default { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleMoveUp(index) { // 处理上移 |
|
|
|
|
let x = index; |
|
|
|
|
let y = index + 1; |
|
|
|
|
this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); |
|
|
|
|
}, |
|
|
|
|
handleMoveDown(index) { // 处理下移 |
|
|
|
|
let x = index + 1; |
|
|
|
|
let y = index + 2; |
|
|
|
|
this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); |
|
|
|
|
}, |
|
|
|
|
scoreChange(row, index) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
|
// handleMoveUp(index) { // 处理上移 |
|
|
|
|
// let x = index; |
|
|
|
|
// let y = index + 1; |
|
|
|
|
// this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); |
|
|
|
|
// }, |
|
|
|
|
// handleMoveDown(index) { // 处理下移 |
|
|
|
|
// let x = index + 1; |
|
|
|
|
// let y = index + 2; |
|
|
|
|
// this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); |
|
|
|
|
// }, |
|
|
|
|
scoreChange(row, index,val) { // 暂时解决,输入分数,页面没有更新 |
|
|
|
|
this.projectJudgmentData.splice(index, 1, row); |
|
|
|
|
}, |
|
|
|
|
delJudgePoint(index) { // 删除判分点 |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.projectJudgmentData.splice(index, 1); |
|
|
|
|
if(this.projectId){ |
|
|
|
|
this.deleteProjectJudgment([this.projectJudgmentData[index].id]) |
|
|
|
|
}else{ |
|
|
|
|
this.projectJudgmentData.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -505,12 +495,17 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
// this.projectJudgmentData.splice(index, 1); |
|
|
|
|
let list = this.projectJudgmentData; |
|
|
|
|
let result = []; |
|
|
|
|
list.map(i => { |
|
|
|
|
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.projectJudgmentData = result; |
|
|
|
|
if(this.projectId){// 编辑项目的时候 |
|
|
|
|
let param = this.selectedProjectJudgment.map(e=>e.id) |
|
|
|
|
this.deleteProjectJudgment(param)// 调删除接口 |
|
|
|
|
}else{ |
|
|
|
|
let list = this.projectJudgmentData; |
|
|
|
|
let result = []; |
|
|
|
|
list.map(i => { |
|
|
|
|
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.projectJudgmentData = result; |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
@ -542,6 +537,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getProcessClassData(params) { // 获取流程类判分点列表数据 |
|
|
|
|
this.visibleLoading = true |
|
|
|
|
this.$post(`${this.api.getLcJudgmentPoint}`, params).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
let list = res.message.records; |
|
|
|
@ -550,6 +546,7 @@ export default { |
|
|
|
|
i.judgmentId = i.lcId; |
|
|
|
|
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.visibleLoading = false |
|
|
|
|
this.judgementData = result; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
@ -557,6 +554,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getProgrammingClassData(params) { // 获取编程类判分点列表数据 |
|
|
|
|
this.visibleLoading = true |
|
|
|
|
this.$post(this.api.getBcJudgmentPoint, params).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
let list = res.message.records; |
|
|
|
@ -565,7 +563,10 @@ export default { |
|
|
|
|
i.judgmentId = i.bcId; |
|
|
|
|
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i); |
|
|
|
|
}); |
|
|
|
|
this.visibleLoading = false |
|
|
|
|
this.judgementData = result; |
|
|
|
|
console.log(res,'res') |
|
|
|
|
console.log(this.projectJudgmentData,'projectJudgmentData') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
@ -577,15 +578,24 @@ export default { |
|
|
|
|
}, |
|
|
|
|
addJudgment() { // 确认选择判分点 |
|
|
|
|
if (this.selectedJudgment.length) { |
|
|
|
|
console.log(this.selectedJudgment,'queren') |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
let tempArr = this.selectedJudgment.map(i => { |
|
|
|
|
i.score = 0; |
|
|
|
|
return i; |
|
|
|
|
}); |
|
|
|
|
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.projectJudgementTable.clearSelection(); |
|
|
|
|
}); |
|
|
|
|
if(this.projectId){ // 编辑的时候,新增调接口 |
|
|
|
|
this.addProjectJudgment() |
|
|
|
|
}else{ |
|
|
|
|
// 新增时,假添加 |
|
|
|
|
let tempArr = this.selectedJudgment.map(i => { |
|
|
|
|
i.score = 0; |
|
|
|
|
return i; |
|
|
|
|
}); |
|
|
|
|
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr); |
|
|
|
|
this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs.projectJudgementTable.clearSelection(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
util.warningMsg("请选择判分点"); |
|
|
|
|
} |
|
|
|
@ -635,7 +645,105 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
location.href = href; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 行拖拽 |
|
|
|
|
rowDrop() { |
|
|
|
|
// 此时找到的元素是要拖拽元素的父容器 |
|
|
|
|
const tbody = document.querySelector('.draggable .el-table__body-wrapper tbody'); |
|
|
|
|
const _this = this; |
|
|
|
|
Sortable.create(tbody, { |
|
|
|
|
// 指定父元素下可被拖拽的子元素 |
|
|
|
|
draggable: ".draggable .el-table__row", |
|
|
|
|
onEnd({newIndex, oldIndex}) { |
|
|
|
|
let newItem = _this.projectJudgmentData[newIndex] |
|
|
|
|
_this.projectJudgmentData[newIndex] = _this.projectJudgmentData[oldIndex] |
|
|
|
|
_this.projectJudgmentData[oldIndex] = newItem |
|
|
|
|
// 循环,重新赋值排序赋值 |
|
|
|
|
_this.projectJudgmentData.forEach((e,i)=>{ |
|
|
|
|
_this.$set(e,'sort',i+1)// 不更新 |
|
|
|
|
_this.$set(e,'name',e.name+"?") |
|
|
|
|
_this.$set(e,'name',e.name.slice(0,e.name.length-1)) // 不更新的解决方案 |
|
|
|
|
}) |
|
|
|
|
// 调修改接口,更新列表 |
|
|
|
|
if(_this.projectId){// 如果是编辑项目,则调编辑接口 |
|
|
|
|
_this.updateProjectJudgment() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 添加判分点中间表 |
|
|
|
|
addProjectJudgment(){ |
|
|
|
|
let param = this.selectedJudgment.map((e,i)=>{ |
|
|
|
|
let obj = { |
|
|
|
|
judgmentId:e.judgmentId, |
|
|
|
|
projectId:this.projectId||'', |
|
|
|
|
score:0, |
|
|
|
|
sort:i+1 |
|
|
|
|
} |
|
|
|
|
return obj |
|
|
|
|
}) |
|
|
|
|
console.log(param,'param',this.projectId,) |
|
|
|
|
this.$post(this.api.addProjectJudgment,param).then(res => { |
|
|
|
|
// 重新调接口 |
|
|
|
|
console.log('添加成功',res) |
|
|
|
|
if(this.projectId){ // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain() |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// 修改判分点中间表 |
|
|
|
|
updateProjectJudgment(){ |
|
|
|
|
// 直接传data回去 |
|
|
|
|
let param = this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
let obj = { |
|
|
|
|
judgmentId:e.judgmentId, |
|
|
|
|
projectId:this.projectId||'', |
|
|
|
|
score:0, |
|
|
|
|
sort:i+1, |
|
|
|
|
id:e.id |
|
|
|
|
} |
|
|
|
|
return obj |
|
|
|
|
}) |
|
|
|
|
this.$post(this.api.updateProjectJudgment, param).then(res => { |
|
|
|
|
|
|
|
|
|
// 重新调接口 |
|
|
|
|
if(this.projectId){ // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain() |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 批量删除判分点中间表 |
|
|
|
|
deleteProjectJudgment(values){ |
|
|
|
|
if(values&&values.length>0){ |
|
|
|
|
this.$post(this.api.deleteProjectJudgment+"?projectJudgmentIds="+`${values}`).then(res => { |
|
|
|
|
|
|
|
|
|
// 重新调接口 |
|
|
|
|
if(this.projectId){ // 有项目id,调接口,没有项目id,手动更新 |
|
|
|
|
this.listAgain() |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 重新调接口,专门赋值列表 |
|
|
|
|
listAgain(){ |
|
|
|
|
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { |
|
|
|
|
let { projectManage, projectJudgmentVos } = res; |
|
|
|
|
this.projectJudgmentData = projectJudgmentVos; |
|
|
|
|
this.projectJudgmentData.map((e,i)=>{ |
|
|
|
|
e.sort = i+1 |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|