大赛训练产品调整暂提
This commit is contained in:
parent
5016a5b175
commit
32866bab90
@ -599,3 +599,11 @@ export function controlYjTrain(simulationId, right) {
|
||||
params: { right }
|
||||
});
|
||||
}
|
||||
/** 创建仿真(不通过功能id) */
|
||||
export function createSimulationNoFunction(mapId, data) {
|
||||
return request({
|
||||
url: `/simulation/new/${mapId}`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -48,13 +48,18 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<score-rule ref="scoreRule" />
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTaskTree } from '@/api/contest';
|
||||
import ScoreRule from './scoreRule';
|
||||
export default {
|
||||
name: 'ContestDetail',
|
||||
components: {
|
||||
ScoreRule
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nowKey: 0,
|
||||
@ -66,6 +71,25 @@ export default {
|
||||
label: 'name',
|
||||
disabled: true
|
||||
},
|
||||
funcitonData: {
|
||||
type: 'METRO',
|
||||
itemMap: {
|
||||
DEFAULT_MEMBER: ''
|
||||
},
|
||||
domConfig: {
|
||||
singleMember: false,
|
||||
singleClient: false,
|
||||
client: 'dispatchWork',
|
||||
hasTraining: false,
|
||||
hasExam: false,
|
||||
trainingDesign: true,
|
||||
hasLpf: false,
|
||||
hasVoice: true,
|
||||
joint: false,
|
||||
hasDeviceManage: false,
|
||||
hasMemberManage: true
|
||||
}
|
||||
},
|
||||
resp: {
|
||||
customModuleId: 2,
|
||||
child: [
|
||||
|
67
src/views/contest/scoreRule.vue
Normal file
67
src/views/contest/scoreRule.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="评分表" :visible.sync="dialogVisible" width="500px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
style="width: 100%;margin-top: 10px;"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="描述" prop="text" />
|
||||
<el-table-column label="作业程序" prop="worker" />
|
||||
<el-table-column label="分值" prop="score" width="50" />
|
||||
<el-table-column label="评分标准" prop="criteria" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getContextScoreDetail } from '@/api/contest';
|
||||
export default {
|
||||
name: 'ScoreRule',
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
dialogVisible: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(index, row) {
|
||||
this.dialogVisible = true;
|
||||
getContextScoreDetail(this.$route.query.id).then(resp => {
|
||||
this.tableData = resp.data.rule ? resp.data.rule.units : [];
|
||||
}).catch(() => { this.$message.error('初始化数据失败!'); });
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总分';
|
||||
return;
|
||||
}
|
||||
if (index === 3) {
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += '';
|
||||
} else {
|
||||
sums[index] = '/';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user