|
|
@ -49,7 +49,7 @@
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-slot="scope">
|
|
|
|
<template v-slot="scope">
|
|
|
|
<el-input-number v-model="scope.row.radioScore" :min="0" :controls="false" style="width: 100%" />
|
|
|
|
<el-input-number v-model="scope.row.radioScore" :min="0" :controls="false" style="width: 100%" ></el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
@ -65,7 +65,7 @@
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-slot="scope">
|
|
|
|
<template v-slot="scope">
|
|
|
|
<el-input-number v-model="scope.row.multiScore" :min="0" :controls="false" style="width: 100%" />
|
|
|
|
<el-input-number v-model="scope.row.multiScore" :min="0" :controls="false" style="width: 100%" ></el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
@ -81,7 +81,7 @@
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-slot="scope">
|
|
|
|
<template v-slot="scope">
|
|
|
|
<el-input-number v-model="scope.row.judgeScore" :min="0" :controls="false" style="width: 100%" />
|
|
|
|
<el-input-number v-model="scope.row.judgeScore" :min="0" :controls="false" style="width: 100%" ></el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
@ -90,7 +90,8 @@
|
|
|
|
width="80px"
|
|
|
|
width="80px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-slot="scope">
|
|
|
|
<template v-slot="scope">
|
|
|
|
<el-button type="danger" icon="el-icon-delete" circle @click="removeItem(scope.$index)" />
|
|
|
|
<el-button type="danger" icon="el-icon-delete" circle @click="removeItem(scope.$index)" >
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
@ -100,22 +101,22 @@
|
|
|
|
<el-card style="margin-top: 20px">
|
|
|
|
<el-card style="margin-top: 20px">
|
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="left" label-width="120px">
|
|
|
|
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="left" label-width="120px">
|
|
|
|
<el-form-item label="考试名称" prop="title">
|
|
|
|
<el-form-item label="考试名称" prop="title">
|
|
|
|
<el-input v-model="postForm.title" />
|
|
|
|
<el-input v-model="postForm.title" ></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="考试描述" prop="content">
|
|
|
|
<el-form-item label="考试描述" prop="content">
|
|
|
|
<el-input v-model="postForm.content" type="textarea" />
|
|
|
|
<el-input v-model="postForm.content" type="textarea" ></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="总分数" prop="totalScore">
|
|
|
|
<el-form-item label="总分数" prop="totalScore">
|
|
|
|
<el-input-number :value="postForm.totalScore" disabled />
|
|
|
|
<el-input-number :value="postForm.totalScore" disabled ></el-input-number>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="及格分" prop="qualifyScore">
|
|
|
|
<el-form-item label="及格分" prop="qualifyScore">
|
|
|
|
<el-input-number v-model="postForm.qualifyScore" :max="postForm.totalScore" />
|
|
|
|
<el-input-number v-model="postForm.qualifyScore" :max="postForm.totalScore" ></el-input-number>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="考试时长(分钟)" prop="totalTime">
|
|
|
|
<el-form-item label="考试时长(分钟)" prop="totalTime">
|
|
|
|
<el-input-number v-model="postForm.totalTime" />
|
|
|
|
<el-input-number v-model="postForm.totalTime" ></el-input-number>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="是否限时">
|
|
|
|
<el-form-item label="是否限时">
|
|
|
|
<el-checkbox v-model="postForm.timeLimit" />
|
|
|
|
<el-checkbox v-model="postForm.timeLimit" ></el-checkbox>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
|
|
|
|
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
|
|
|
|
<el-date-picker
|
|
|
|
<el-date-picker
|
|
|
@ -126,7 +127,8 @@
|
|
|
|
range-separator="至"
|
|
|
|
range-separator="至"
|
|
|
|
start-placeholder="开始时间"
|
|
|
|
start-placeholder="开始时间"
|
|
|
|
end-placeholder="结束时间"
|
|
|
|
end-placeholder="结束时间"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
|
|
|
|
</el-date-picker>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
</el-card>
|
|
|
|
</el-card>
|
|
|
@ -141,25 +143,29 @@
|
|
|
|
v-if="postForm.openType===1"
|
|
|
|
v-if="postForm.openType===1"
|
|
|
|
title="开放的,任何人都可以进行考试!"
|
|
|
|
title="开放的,任何人都可以进行考试!"
|
|
|
|
type="warning"
|
|
|
|
type="warning"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
|
|
|
|
</el-alert>
|
|
|
|
<div v-if="postForm.openType===2">
|
|
|
|
<div v-if="postForm.openType===2">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="filterText"
|
|
|
|
v-model="filterText"
|
|
|
|
placeholder="输入关键字进行过滤"
|
|
|
|
placeholder="输入关键字进行过滤"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
|
|
|
|
</el-input>
|
|
|
|
<el-tree
|
|
|
|
<el-tree
|
|
|
|
v-loading="treeLoading"
|
|
|
|
v-loading="treeLoading"
|
|
|
|
ref="tree"
|
|
|
|
ref="tree"
|
|
|
|
|
|
|
|
lazy
|
|
|
|
:data="treeData"
|
|
|
|
:data="treeData"
|
|
|
|
:default-checked-keys="postForm.departIds"
|
|
|
|
:default-checked-keys="postForm.departIds"
|
|
|
|
:props="defaultProps"
|
|
|
|
:props="defaultProps"
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
:filter-node-method="filterNode"
|
|
|
|
empty-text=" "
|
|
|
|
empty-text=" "
|
|
|
|
default-expand-all
|
|
|
|
|
|
|
|
show-checkbox
|
|
|
|
show-checkbox
|
|
|
|
node-key="id"
|
|
|
|
node-key="id"
|
|
|
|
|
|
|
|
:load="handleLoad"
|
|
|
|
@check-change="handleCheckChange"
|
|
|
|
@check-change="handleCheckChange"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
|
|
|
|
</el-tree>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
</el-card>
|
|
|
|
<div style="margin-top: 20px">
|
|
|
|
<div style="margin-top: 20px">
|
|
|
@ -200,7 +206,7 @@
|
|
|
|
// 题库列表
|
|
|
|
// 题库列表
|
|
|
|
repoList: [],
|
|
|
|
repoList: [],
|
|
|
|
// 开放类型
|
|
|
|
// 开放类型
|
|
|
|
openType: 1,
|
|
|
|
openType: 0,
|
|
|
|
// 考试班级列表
|
|
|
|
// 考试班级列表
|
|
|
|
departIds: []
|
|
|
|
departIds: []
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -283,17 +289,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
// const id = this.$route.params.id
|
|
|
|
|
|
|
|
// if (typeof id !== undefined) {
|
|
|
|
|
|
|
|
// this.fetchData(id)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// fetchTree({}).then(response => {
|
|
|
|
|
|
|
|
// this.treeData = response.data
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
async handleLoad(node, resolve) {
|
|
|
|
|
|
|
|
if (node.level === 0 && this.treeData.length === 0) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const response = await axios.get('/system/dept/detpList', { params: { deptId: 0 } });
|
|
|
|
|
|
|
|
this.treeData = response.data.data;
|
|
|
|
|
|
|
|
resolve(this.treeData);
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error('Error fetching root nodes', error);
|
|
|
|
|
|
|
|
resolve([]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.fetchChildren(node.data.deptId).then(children => {
|
|
|
|
|
|
|
|
resolve(children);
|
|
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
|
|
|
console.error(`Error fetching children for node ${node.data.deptId}`, error);
|
|
|
|
|
|
|
|
resolve([]);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
async fetchChildren(parentId) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const response = await axios.get('/system/dept/detpList/',{params:{deptId: parentId}});
|
|
|
|
|
|
|
|
return response.data.data;
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.error(`Error fetching children for node ${parentId}`, error);
|
|
|
|
|
|
|
|
return [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
handleSave() {
|
|
|
|
handleSave() {
|
|
|
|
this.$refs.postForm.validate((valid) => {
|
|
|
|
this.$refs.postForm.validate((valid) => {
|
|
|
|
if (!valid) {
|
|
|
|
if (!valid) {
|
|
|
@ -375,7 +400,7 @@
|
|
|
|
this.postForm.departIds = []
|
|
|
|
this.postForm.departIds = []
|
|
|
|
const nodes = this.$refs.tree.getCheckedNodes()
|
|
|
|
const nodes = this.$refs.tree.getCheckedNodes()
|
|
|
|
nodes.forEach(function(item) {
|
|
|
|
nodes.forEach(function(item) {
|
|
|
|
that.postForm.departIds.push(item.id)
|
|
|
|
that.postForm.departIds.push(item.deptId)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|