Merge remote-tracking branch 'origin/new-exam' into new-exam

pg_adapter
wangxy 9 months ago
commit c24feeb695

@ -49,7 +49,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -65,7 +65,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -81,7 +81,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -90,7 +90,8 @@
width="80px"
>
<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>
</el-table-column>
</el-table>
@ -100,22 +101,22 @@
<el-card style="margin-top: 20px">
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="left" label-width="120px">
<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 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 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 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 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 label="是否限时">
<el-checkbox v-model="postForm.timeLimit" />
<el-checkbox v-model="postForm.timeLimit" ></el-checkbox>
</el-form-item>
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
<el-date-picker
@ -126,7 +127,8 @@
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
>
</el-date-picker>
</el-form-item>
</el-form>
</el-card>
@ -141,25 +143,29 @@
v-if="postForm.openType===1"
title="开放的,任何人都可以进行考试!"
type="warning"
/>
>
</el-alert>
<div v-if="postForm.openType===2">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
/>
>
</el-input>
<el-tree
v-loading="treeLoading"
ref="tree"
lazy
:data="treeData"
:default-checked-keys="postForm.departIds"
:props="defaultProps"
:filter-node-method="filterNode"
empty-text=" "
default-expand-all
show-checkbox
node-key="id"
:load="handleLoad"
@check-change="handleCheckChange"
/>
>
</el-tree>
</div>
</el-card>
<div style="margin-top: 20px">
@ -200,7 +206,7 @@
// 题库列表
repoList: [],
// 开放类型
openType: 1,
openType: 0,
// 考试班级列表
departIds: []
},
@ -283,17 +289,36 @@
},
created() {
// const id = this.$route.params.id
// if (typeof id !== undefined) {
// this.fetchData(id)
// }
//
// fetchTree({}).then(response => {
// this.treeData = response.data
// })
},
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() {
this.$refs.postForm.validate((valid) => {
if (!valid) {
@ -375,7 +400,7 @@
this.postForm.departIds = []
const nodes = this.$refs.tree.getCheckedNodes()
nodes.forEach(function(item) {
that.postForm.departIds.push(item.id)
that.postForm.departIds.push(item.deptId)
})
},

@ -49,7 +49,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -65,7 +65,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -81,7 +81,7 @@
align="center"
>
<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>
</el-table-column>
<el-table-column
@ -90,7 +90,8 @@
width="80px"
>
<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>
</el-table-column>
</el-table>
@ -100,22 +101,22 @@
<el-card style="margin-top: 20px">
<el-form ref="postForm" :model="postForm" :rules="rules" label-position="left" label-width="120px">
<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 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 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 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 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 label="是否限时">
<el-checkbox v-model="postForm.timeLimit" />
<el-checkbox v-model="postForm.timeLimit" ></el-checkbox>
</el-form-item>
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
<el-date-picker
@ -126,7 +127,8 @@
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
>
</el-date-picker>
</el-form-item>
</el-form>
</el-card>
@ -141,25 +143,26 @@
v-if="postForm.openType===1"
title="开放的,任何人都可以进行考试!"
type="warning"
/>
></el-alert>
<div v-if="postForm.openType===2">
<el-input
v-model="filterText"
placeholder="输入关键字进行过滤"
/>
></el-input>
<el-tree
v-loading="treeLoading"
ref="tree"
:data="treeData"
:default-checked-keys="postForm.departIds"
:props="defaultProps"
:filter-node-method="filterNode"
empty-text=" "
default-expand-all
show-checkbox
node-key="id"
@check-change="handleCheckChange"
/>
v-loading="treeLoading"
ref="tree"
lazy
:data="treeData"
:default-checked-keys="postForm.departIds"
:props="defaultProps"
:filter-node-method="filterNode"
empty-text=" "
show-checkbox
node-key="id"
:load="handleLoad"
@check-change="handleCheckChange"
></el-tree>
</div>
</el-card>
<div style="margin-top: 20px">
@ -200,7 +203,7 @@
// 题库列表
repoList: [],
// 开放类型
openType: 1,
openType: 0,
// 考试班级列表
departIds: []
},
@ -294,7 +297,34 @@
},
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() {
this.$refs.postForm.validate((valid) => {
if (!valid) {

@ -49,7 +49,7 @@
<el-row :gutter="24" style="margin-top: 50px">
<el-col :span="8" class="text-center">
考生姓名:{{ paperData.userId }}
考生姓名:{{ paperData.userName}}
</el-col>
<el-col :span="8" class="text-center">

@ -6,51 +6,53 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" >
<tbody th:each="columns : ${list}">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试时间:</label>
<div class="col-sm-8">
<span class="date">[[${#dates.format(columns.updateTime, 'yyyy-MM-dd hh:MM:ss')}]]</span>
<div style="border-bottom: 1px solid #ccc;line-height: 41px;box-sizing: border-box">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试时间:</label>
<div class="col-sm-8">
<span class="date">[[${#dates.format(columns.updateTime, 'yyyy-MM-dd hh:MM:ss')}]]</span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试用时:</label>
<div class="col-sm-8">
<span class="date">[[${columns.userTime}]]分钟</span>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试用时:</label>
<div class="col-sm-8">
<span class="date">[[${columns.userTime}]]分钟</span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试得分:</label>
<div class="col-sm-8">
<span class="date">[[${columns.userScore}]]</span>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试得分:</label>
<div class="col-sm-8">
<span class="date">[[${columns.userScore}]]</span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">及格分:</label>
<div class="col-sm-8">
<span class="date">[[${columns.qualifyScore}]]</span>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">及格分:</label>
<div class="col-sm-8">
<span class="date">[[${columns.qualifyScore}]]</span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试状态:</label>
<div class="col-sm-8">
<span th:if="${columns.state} eq 0 ">考试中</span>
<span th:if="${columns.state} eq 1 ">待阅卷</span>
<span th:if="${columns.state} eq 2 ">已完成</span>
<span th:if="${columns.state} eq 3 ">弃考</span>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">考试状态:</label>
<div class="col-sm-8">
<span th:if="${columns.state} eq 0 ">考试中</span>
<span th:if="${columns.state} eq 1 ">待阅卷</span>
<span th:if="${columns.state} eq 2 ">已完成</span>
<span th:if="${columns.state} eq 3 ">弃考</span>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save