|
|
|
@ -3,13 +3,18 @@ |
|
|
|
|
<div class="content"> |
|
|
|
|
<div class="header"> |
|
|
|
|
<div> |
|
|
|
|
<i class="back el-icon-arrow-left" @click="Back()" style="cursor:pointer"> |
|
|
|
|
<i class="back el-icon-arrow-left" |
|
|
|
|
@click="Back()" |
|
|
|
|
style="cursor:pointer"> |
|
|
|
|
<span>Back</span> |
|
|
|
|
</i> |
|
|
|
|
<span class="title">判分点设置</span> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="saveAll">保存</el-button> |
|
|
|
|
<el-button v-if="!isView" |
|
|
|
|
type="primary" |
|
|
|
|
size="mini" |
|
|
|
|
@click="saveAll">保存</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -22,18 +27,22 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="item"> |
|
|
|
|
<div class="label">判分点</div> |
|
|
|
|
<el-input |
|
|
|
|
v-model.trim="formData.points.name" |
|
|
|
|
<el-input v-model.trim="formData.points.name" |
|
|
|
|
:readonly="isView" |
|
|
|
|
@blur="handleBlur" |
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
clearable |
|
|
|
|
style="width: 400px" |
|
|
|
|
></el-input> |
|
|
|
|
style="width: 400px"></el-input> |
|
|
|
|
</div> |
|
|
|
|
<div class="item"> |
|
|
|
|
<div class="label">实验要求</div> |
|
|
|
|
<quill class="quill" v-model="formData.points.experimentalRequirements" :readonly="isView" :border="true" :minHeight="150" :height="150"/> |
|
|
|
|
<quill class="quill" |
|
|
|
|
v-model="formData.points.experimentalRequirements" |
|
|
|
|
:type.sync="formData.points.experimentalRequirementsType" |
|
|
|
|
:readonly="isView" |
|
|
|
|
:border="true" |
|
|
|
|
:minHeight="150" |
|
|
|
|
:height="150" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -45,7 +54,13 @@ |
|
|
|
|
</div> |
|
|
|
|
<p style="text-align: center;">参考答案</p> |
|
|
|
|
<div> |
|
|
|
|
<quill v-model="formData.points.experimentCode" :readonly="isView" :border="true" :minHeight="300" :height="300" :index="1"/> |
|
|
|
|
<quill v-model="formData.points.experimentCode" |
|
|
|
|
:type.sync="formData.points.experimentCodeType" |
|
|
|
|
:readonly="isView" |
|
|
|
|
:border="true" |
|
|
|
|
:minHeight="300" |
|
|
|
|
:height="300" |
|
|
|
|
:index="1" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -57,75 +72,98 @@ |
|
|
|
|
<div>判分规则</div> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="batchDel">批量删除</el-button> |
|
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="addRule">新增</el-button> |
|
|
|
|
<el-button v-if="!isView" |
|
|
|
|
type="primary" |
|
|
|
|
size="mini" |
|
|
|
|
@click="batchDel">批量删除</el-button> |
|
|
|
|
<el-button v-if="!isView" |
|
|
|
|
type="primary" |
|
|
|
|
size="mini" |
|
|
|
|
@click="addRule">新增</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<el-table |
|
|
|
|
class="lc-table" |
|
|
|
|
<el-table class="lc-table" |
|
|
|
|
:data="tableData" |
|
|
|
|
:stripe="true" |
|
|
|
|
:cell-style="rowClass" |
|
|
|
|
header-align="center" |
|
|
|
|
:header-cell-style="headClass" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
> |
|
|
|
|
<el-table-column |
|
|
|
|
type="selection" |
|
|
|
|
@selection-change="handleSelectionChange"> |
|
|
|
|
<el-table-column type="selection" |
|
|
|
|
width="55"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="id" type="index" label="序号" width="80"> |
|
|
|
|
<el-table-column prop="id" |
|
|
|
|
type="index" |
|
|
|
|
label="序号" |
|
|
|
|
width="80"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.isSubject && scope.row.index + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="编译器中正确答案" align="center"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
|
<el-table-column label="编译器中正确答案" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope" |
|
|
|
|
v-if="scope.row.isSubject"> |
|
|
|
|
<p class="p">字段一致性规则:用户编辑器中至少出现如下语句</p> |
|
|
|
|
<el-input |
|
|
|
|
type="textarea" |
|
|
|
|
<el-input type="textarea" |
|
|
|
|
:rows="3" |
|
|
|
|
v-model="scope.row.required" |
|
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
|
></el-input> |
|
|
|
|
:disabled="isView || scope.row.isDisabled"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label=" " width="150"> |
|
|
|
|
<el-table-column label=" " |
|
|
|
|
width="150"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button |
|
|
|
|
circle |
|
|
|
|
<el-button circle |
|
|
|
|
type="primary" |
|
|
|
|
v-if="scope.row.isSubject" |
|
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
|
@click="changeResult(scope.row)" |
|
|
|
|
style="position: absolute; right: 55px" |
|
|
|
|
> |
|
|
|
|
style="position: absolute; right: 55px"> |
|
|
|
|
{{ scope.row.resultOperation === 0 ? '且' : '或' }} |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-else type="primary" circle @click="changeRule(scope.row, scope.$index)"> |
|
|
|
|
<el-button v-else |
|
|
|
|
type="primary" |
|
|
|
|
circle |
|
|
|
|
@click="changeRule(scope.row, scope.$index)"> |
|
|
|
|
{{ scope.row.ruleOperation === 0 ? "且" : "或" }} |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="终端中正确答案" align="center"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
|
<el-table-column label="终端中正确答案" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope" |
|
|
|
|
v-if="scope.row.isSubject"> |
|
|
|
|
<p class="p">运行结果一致性规则:用户运行结果需要与下方代码运行结果一致</p> |
|
|
|
|
<el-input |
|
|
|
|
type="textarea" |
|
|
|
|
<el-input type="textarea" |
|
|
|
|
:rows="3" |
|
|
|
|
v-model="scope.row.result" |
|
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
|
></el-input> |
|
|
|
|
:disabled="isView || scope.row.isDisabled"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="300" v-if="!isView"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row)">保存</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleDelete(scope.$index)">删除</el-button> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
width="300" |
|
|
|
|
v-if="!isView"> |
|
|
|
|
<template slot-scope="scope" |
|
|
|
|
v-if="scope.row.isSubject"> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleSave(scope.row)">保存</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleCancel(scope.row, scope.$index)">取消</el-button> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
@click="handleDelete(scope.$index)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -137,10 +175,10 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import quill from '@/components/quill' |
|
|
|
|
import {deepCopy} from '@/utils/deepCopy' |
|
|
|
|
import { deepCopy } from '@/utils/deepCopy' |
|
|
|
|
export default { |
|
|
|
|
components: {quill}, |
|
|
|
|
data() { |
|
|
|
|
components: { quill }, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
bcId: "", // 编程类判分点id |
|
|
|
|
isAdd: Boolean(this.$route.query.isAdd), // 添加 |
|
|
|
@ -156,7 +194,9 @@ export default { |
|
|
|
|
isDel: 0, |
|
|
|
|
isOpen: 0, |
|
|
|
|
projectId: "", |
|
|
|
|
systemId: "" |
|
|
|
|
systemId: "", |
|
|
|
|
experimentCodeType: '0', |
|
|
|
|
experimentalRequirementsType: '0', |
|
|
|
|
}, |
|
|
|
|
bcJudgmentRuleList: [] |
|
|
|
|
}, // 表单参数 |
|
|
|
@ -165,11 +205,7 @@ export default { |
|
|
|
|
isAddRule: false, // 是否禁用新增规则按钮 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
console.log('当前地址=', location.host); |
|
|
|
|
console.log("token=", this.$route.query.token) |
|
|
|
|
console.log("systemId=", this.$route.query.systemId) |
|
|
|
|
|
|
|
|
|
mounted () { |
|
|
|
|
this.$route.query.token && this.$store.commit('setParam', { |
|
|
|
|
token: atob(decodeURI(this.$route.query.token)), |
|
|
|
|
referrer: atob(decodeURI(this.$route.query.referrer)) |
|
|
|
@ -183,13 +219,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
Back() { // 返回 |
|
|
|
|
Back () { // 返回 |
|
|
|
|
this.$router.back(); |
|
|
|
|
}, |
|
|
|
|
getInfoData(bcId) { // 获取判分点详细信息 |
|
|
|
|
getInfoData (bcId) { // 获取判分点详细信息 |
|
|
|
|
this.$get(`${this.api.queryBcJudgmentPointByBcId}?bcId=${bcId}`).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
let {judgmentPoint, judgmentRule} = res; |
|
|
|
|
let { judgmentPoint, judgmentRule } = res; |
|
|
|
|
if (!judgmentPoint.experimentCodeType) judgmentPoint.experimentCodeType = '0' |
|
|
|
|
if (!judgmentPoint.experimentalRequirementsType) judgmentPoint.experimentalRequirementsType = '0' |
|
|
|
|
this.formData = { |
|
|
|
|
points: judgmentPoint, |
|
|
|
|
bcJudgmentRuleList: judgmentRule |
|
|
|
@ -211,18 +249,18 @@ export default { |
|
|
|
|
console.log(err) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange(val){ |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|
// 设置序号 |
|
|
|
|
setIndex() { |
|
|
|
|
setIndex () { |
|
|
|
|
let i = 0 |
|
|
|
|
this.tableData.map(e => { |
|
|
|
|
if (e.isSubject) e.index = i++ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 重新封装数据 |
|
|
|
|
anewPosttingData(judgmentRule){ |
|
|
|
|
anewPosttingData (judgmentRule) { |
|
|
|
|
let length = judgmentRule.length; |
|
|
|
|
let tempArr = []; |
|
|
|
|
judgmentRule.forEach((item, index) => { |
|
|
|
@ -258,13 +296,13 @@ export default { |
|
|
|
|
} |
|
|
|
|
tempArr.push(obj); |
|
|
|
|
if (length > 1 && index !== (length - 1)) { |
|
|
|
|
tempArr.push({ruleOperation: item.ruleOperation}); |
|
|
|
|
tempArr.push({ ruleOperation: item.ruleOperation }); |
|
|
|
|
} |
|
|
|
|
this.tableData = tempArr; |
|
|
|
|
this.setIndex() |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleBlur() { // 新增/编辑判分点名称判重 |
|
|
|
|
handleBlur () { // 新增/编辑判分点名称判重 |
|
|
|
|
if (this.formData.points.name) { |
|
|
|
|
let params = { |
|
|
|
|
bcId: this.bcId, |
|
|
|
@ -281,7 +319,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
saveAll() { // 保存判分点 |
|
|
|
|
saveAll () { // 保存判分点 |
|
|
|
|
if (this.isNameRepeat) { |
|
|
|
|
this.$message.warning(`当前判分点名称已存在`); |
|
|
|
|
return; |
|
|
|
@ -305,7 +343,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.formData.points.name || this.formData.points.experimentCode){ |
|
|
|
|
if (this.formData.points.name || this.formData.points.experimentCode) { |
|
|
|
|
let tempArr = []; |
|
|
|
|
this.tableData.forEach(i => { |
|
|
|
|
if (i.isSubject) { |
|
|
|
@ -344,7 +382,7 @@ export default { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(`实验代码与判分点名称至少填写一个`); |
|
|
|
|
// if (!this.formData.points.name) { |
|
|
|
|
// this.$message.warning(`判分点名称不能为空`); |
|
|
|
@ -356,7 +394,7 @@ export default { |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
addRule() { // 新增规则 |
|
|
|
|
addRule () { // 新增规则 |
|
|
|
|
this.isAddRule = true; |
|
|
|
|
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); |
|
|
|
|
if (this.tableData.length > 0) { |
|
|
|
@ -396,18 +434,18 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.setIndex() |
|
|
|
|
}, |
|
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
|
changeResult (row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
|
row.resultOperation = row.resultOperation === 0 ? 1 : 0; |
|
|
|
|
}, |
|
|
|
|
changeRule(row, index) { // (上下)规则运算符(0:且 1:或 默认0) |
|
|
|
|
changeRule (row, index) { // (上下)规则运算符(0:且 1:或 默认0) |
|
|
|
|
row.ruleOperation = row.ruleOperation === 0 ? 1 : 0; |
|
|
|
|
this.tableData[index - 1].ruleOperation = row.ruleOperation; |
|
|
|
|
}, |
|
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
|
handleEdit (row) { // 处理编辑规则 |
|
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
|
row.isDisabled = false; |
|
|
|
|
}, |
|
|
|
|
handleSave(row) { // 处理保存规则 |
|
|
|
|
handleSave (row) { // 处理保存规则 |
|
|
|
|
if (!row.required && !row.result) { |
|
|
|
|
this.$message.warning(`规则与结果至少填写一个`); |
|
|
|
|
return; |
|
|
|
@ -416,36 +454,36 @@ export default { |
|
|
|
|
row.isDisabled = true; |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
}, |
|
|
|
|
handleCancel(row, index) { // 处理取消编辑规则 |
|
|
|
|
handleCancel (row, index) { // 处理取消编辑规则 |
|
|
|
|
if (row.isSave) { |
|
|
|
|
this.$set(this.tableData, index, this.tableDataCopy[index]); |
|
|
|
|
} else { |
|
|
|
|
this.tableData.splice(index-1, 2); |
|
|
|
|
this.tableData.splice(index - 1, 2); |
|
|
|
|
// this.tableData.splice(index, 1); |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
} |
|
|
|
|
this.setIndex() |
|
|
|
|
}, |
|
|
|
|
handleDelete(index) { // 处理删除规则 |
|
|
|
|
handleDelete (index) { // 处理删除规则 |
|
|
|
|
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
center: true, |
|
|
|
|
}).then(() => { |
|
|
|
|
if (index+1 == this.tableData.length){ |
|
|
|
|
if (index + 1 == this.tableData.length) { |
|
|
|
|
this.tableData.splice(index - 1, 2) |
|
|
|
|
}else{ |
|
|
|
|
this.tableData.splice(index,2); |
|
|
|
|
} else { |
|
|
|
|
this.tableData.splice(index, 2); |
|
|
|
|
} |
|
|
|
|
this.itemkey = Math.random() |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
this.setIndex() |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
}, |
|
|
|
|
// 批量删除 |
|
|
|
|
batchDel() { |
|
|
|
|
if(this.multipleSelection.length){ |
|
|
|
|
batchDel () { |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
@ -463,17 +501,17 @@ export default { |
|
|
|
|
this.setIndex() |
|
|
|
|
this.itemkey = Math.random() |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(() => { }) |
|
|
|
|
} else { |
|
|
|
|
this.$message.error('请先选择数据 !') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 表头样式设置 |
|
|
|
|
headClass() { |
|
|
|
|
headClass () { |
|
|
|
|
return "text-align: center;"; |
|
|
|
|
}, |
|
|
|
|
// 表格样式设置 |
|
|
|
|
rowClass() { |
|
|
|
|
rowClass () { |
|
|
|
|
return "text-align: center;"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -567,7 +605,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -597,17 +634,17 @@ export default { |
|
|
|
|
border-radius: 0; |
|
|
|
|
background: #dddddd; |
|
|
|
|
} |
|
|
|
|
.tree-con{ |
|
|
|
|
.tree-con { |
|
|
|
|
height: 230px; |
|
|
|
|
position: relative; |
|
|
|
|
.mask{ |
|
|
|
|
.mask { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
position: absolute; |
|
|
|
|
top: 0; |
|
|
|
|
bottom: 0; |
|
|
|
|
right: 10px; |
|
|
|
|
cursor:not-allowed; |
|
|
|
|
cursor: not-allowed; |
|
|
|
|
z-index: 99999; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|