|
@@ -1,18 +1,18 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-row>
|
|
|
- <!--用户数据1-->
|
|
|
+ <!--用户数据-->
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
- <el-form-item label="考试名称" prop="userName">
|
|
|
+ <el-form-item label="考试名称" prop="examCollectionName">
|
|
|
<el-input
|
|
|
- v-model="queryParams.userName"
|
|
|
+ v-model="queryParams.examCollectionName"
|
|
|
placeholder="请输入考试名称"
|
|
|
clearable
|
|
|
style="width: 150px"
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
+ <!-- <el-form-item label="状态" prop="status">
|
|
|
<el-select
|
|
|
v-model="queryParams.status"
|
|
|
placeholder="用户状态"
|
|
@@ -26,7 +26,7 @@
|
|
|
:value="dict.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="考试时间">
|
|
|
<el-date-picker
|
|
|
v-model="dateRange"
|
|
@@ -38,15 +38,15 @@
|
|
|
end-placeholder="结束日期"
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="模拟器类型" prop="userName">
|
|
|
+ <el-form-item label="模拟器类型" prop="simType">
|
|
|
<el-select
|
|
|
- v-model="queryParams.userName"
|
|
|
+ v-model="queryParams.simType"
|
|
|
placeholder="模拟器类型"
|
|
|
clearable
|
|
|
style="width: 240px"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="dict in dict.type.sim_equip_type"
|
|
|
+ v-for="dict in dict.type.sim_sim_type"
|
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
@@ -76,6 +76,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
+
|
|
|
>新增</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -113,12 +114,21 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
- <!-- <el-table-column label="编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> -->
|
|
|
- <el-table-column label="考试名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="模拟器类型" align="center" key="liexing" prop="liexing" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="创建老师" align="center" key="creater" prop="creater" v-if="columns[4].visible" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="考试状态" align="center" key="status" v-if="columns[5].visible">
|
|
|
+ <el-table-column label="编号" align="center" key="examCollectionId" prop="examCollectionId" v-if="columns[0].visible" />
|
|
|
+ <el-table-column label="考试名称" align="center" key="examCollectionName" prop="examCollectionName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="考试时长" align="center" key="limitDuration" prop="limitDuration" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="考试时间" align="center" key="kaoshiTime" prop="kaoshiTime" v-if="columns[3].visible" :show-overflow-tooltip="true" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.startTime}}</span> ~ <span>{{scope.row.endTime}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="模拟器类型" align="center" key="simType" prop="simType" v-if="columns[4].visible" :show-overflow-tooltip="true" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag class="text-navy" :options="dict.type.sim_sim_type" :value="scope.row.simType"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建老师" align="center" key="createBy" prop="createBy" v-if="columns[5].visible" :show-overflow-tooltip="true" />
|
|
|
+ <!-- <el-table-column label="考试状态" align="center" key="status" v-if="columns[6].visible">
|
|
|
<template slot-scope="scope">
|
|
|
<el-switch
|
|
|
v-model="scope.row.status"
|
|
@@ -127,8 +137,8 @@
|
|
|
@change="handleStatusChange(scope.row)"
|
|
|
></el-switch>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[7].visible" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
</template>
|
|
@@ -145,16 +155,13 @@
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['simulator:user:edit']"
|
|
|
>修改</el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['simulator:user:remove']"
|
|
|
>删除</el-button>
|
|
|
-
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -170,44 +177,41 @@
|
|
|
|
|
|
<!-- 添加或修改用户配置对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px" style="display: flex;">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px" >
|
|
|
<el-row>
|
|
|
- <el-col :span="6" style="width: 20%;">
|
|
|
- <el-form-item label="型号">
|
|
|
- <el-select v-model="selectedEquip" placeholder="请选择模拟器类型">
|
|
|
- <el-option
|
|
|
- value="请选择"
|
|
|
- >请选择</el-option>
|
|
|
- <el-option
|
|
|
- v-for="dict in dict.type.sim_equip_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.label"
|
|
|
- :value="dict.value"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="考试名称" prop="examCollectionName">
|
|
|
+ <el-input placeholder="请输入考试名称" maxlength="30" v-model="form.examCollectionName"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="考试名称" prop="userName">
|
|
|
- <el-input placeholder="请输入考试名称" maxlength="30" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="考试时长" prop="limitDuration">
|
|
|
+ <el-input placeholder="请输入考试时长" maxlength="30" v-model="form.limitDuration"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="考试时长" prop="userName">
|
|
|
- <el-input placeholder="请输入考试时长" maxlength="30" />
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="考试时间" prop="examTime">
|
|
|
+ <el-date-picker type="daterange" v-model="form.examTime" format="yyyy-MM-dd"
|
|
|
+ value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始时间" end-placeholder="结束时间"
|
|
|
+ range-separator="至" clearable></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="日期范围" prop="field101">
|
|
|
- <el-date-picker type="daterange" format="yyyy-MM-dd"
|
|
|
- value-format="yyyy-MM-dd" :style="{width: '100%'}" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
- range-separator="至" clearable></el-date-picker>
|
|
|
+
|
|
|
+ <el-col :span="8" >
|
|
|
+ <el-form-item label="型号" prop="simType">
|
|
|
+ <el-select v-model="form.simType" placeholder="请选择模拟器类型" style="width: 100%;">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.sim_sim_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="出题方式" prop="userName">
|
|
|
- <el-select v-model="selectmethod" placeholder="请选择出题方式">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="出题方式" prop="questionSettingMethod">
|
|
|
+ <el-select v-model="form.questionSettingMethod" placeholder="请选择出题方式" style="width: 100%;" @change="selectmethod">
|
|
|
<el-option
|
|
|
value="请选择"
|
|
|
>请选择</el-option>
|
|
@@ -220,7 +224,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-button type="primary" round @click="handleSelectType" v-show="isShow">自选考题编辑</el-button>
|
|
|
+ <el-button type="primary" round @click="handleSelectType" v-show="isShow" style="margin-left: 15px;">自选考题编辑</el-button>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
@@ -310,7 +314,8 @@
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer" style="margin-top: 10%;">
|
|
|
- <el-button type="primary" @click="submitForm">添加考试</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="form.examCollectionId == undefined" >添加考试</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="form.examCollectionId != undefined" >确定考试</el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
@@ -393,21 +398,18 @@
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
-import { listStudent, getStudent, delStudent, addStudent, updateStudent } from "@/api/sim/student";
|
|
|
+import { examTearcherList,examTearcherdel,examTearcheradd,examTearcherupdate,examTearcherGet} from "@/api/sim/exam";
|
|
|
import { listMajor } from "@/api/sim/major";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+
|
|
|
|
|
|
export default {
|
|
|
- name: "Task",
|
|
|
- dicts: ['sim_equip_type','sys_topic_way','sys_normal_disable'],
|
|
|
- components: { Treeselect },
|
|
|
+ name: "Exam",
|
|
|
+ dicts: ['sim_sim_type','sys_topic_way','sys_normal_disable',],
|
|
|
data() {
|
|
|
return {
|
|
|
multipleSelection: [],
|
|
|
selectedEquip: '',
|
|
|
- selectmethod:'',
|
|
|
+ // selectmethod:'',
|
|
|
isShow:false,
|
|
|
selectedZjEquip: '',
|
|
|
tableData_tm: [
|
|
@@ -605,27 +607,16 @@ export default {
|
|
|
roleOptions: [],
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
- field101: null,
|
|
|
+ simType:'',
|
|
|
+ questionSettingMethod:'',
|
|
|
+ examTime:[],
|
|
|
+ startTime:'',
|
|
|
+ endTime:'',
|
|
|
},
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "label"
|
|
|
},
|
|
|
- // 用户导入参数
|
|
|
- upload: {
|
|
|
- // 是否显示弹出层(用户导入)
|
|
|
- open: false,
|
|
|
- // 弹出层标题(用户导入)
|
|
|
- title: "",
|
|
|
- // 是否禁用上传
|
|
|
- isUploading: false,
|
|
|
- // 是否更新已经存在的用户数据
|
|
|
- updateSupport: 0,
|
|
|
- // 设置上传的请求头部
|
|
|
- headers: { Authorization: "Bearer " + getToken() },
|
|
|
- // 上传的地址
|
|
|
- url: process.env.VUE_APP_BASE_API + "/simulator/user/importData"
|
|
|
- },
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -639,26 +630,46 @@ export default {
|
|
|
columns: [
|
|
|
{ key: 0, label: `编号`, visible: true },
|
|
|
{ key: 1, label: `考试名称`, visible: true },
|
|
|
- { key: 2, label: `考试时间`, visible: true },
|
|
|
- { key: 3, label: `模拟器类型`, visible: true },
|
|
|
- { key: 4, label: `考试状态`, visible: true },
|
|
|
- { key: 5, label: `创建老师`, visible: true },
|
|
|
- { key: 6, label: `创建时间`, visible: true }
|
|
|
+ { key: 2, label: `考试时长`, visible: true },
|
|
|
+ { key: 3, label: `考试时间`, visible: true },
|
|
|
+ { key: 4, label: `模拟器类型`, visible: true },
|
|
|
+ { key: 5, label: `考试状态`, visible: false },
|
|
|
+ { key: 6, label: `创建老师`, visible: true },
|
|
|
+ { key: 7, label: `创建时间`, visible: true }
|
|
|
],
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
+ examCollectionName: [
|
|
|
+ { required: true,
|
|
|
+ message: "考试名称不能为空",
|
|
|
+ trigger: "blur" },
|
|
|
+ ],
|
|
|
+ limitDuration:[
|
|
|
+ { required: true,
|
|
|
+ message: "考试时长不能为空",
|
|
|
+ trigger: "blur" },
|
|
|
+ ],
|
|
|
+ simType: [
|
|
|
+ { required: true,
|
|
|
+ message: "模拟器型号不能为空",
|
|
|
+ trigger: "change"}
|
|
|
+ ],
|
|
|
+
|
|
|
+ questionSettingMethod: [
|
|
|
+ { required: true,
|
|
|
+ message: "出题方式不能为空",
|
|
|
+ trigger: "change"}
|
|
|
+ ],
|
|
|
+ examTime:[{
|
|
|
+ required: true,
|
|
|
+ type: 'array',
|
|
|
+ message: '请选择考试时间',
|
|
|
+ trigger: 'change'
|
|
|
+ }],
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
- selectmethod(Value){
|
|
|
- console.log('出题方式:'+Value)
|
|
|
- if(Value==2){
|
|
|
- this.isShow = true;
|
|
|
- }else{
|
|
|
- this.isShow = false;
|
|
|
- }
|
|
|
- },
|
|
|
selectedEquip(newValue) {
|
|
|
// console.log(newValue);
|
|
|
// 根据newValue更新tableData
|
|
@@ -834,6 +845,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectmethod(value){
|
|
|
+ console.log('出题方式:'+value)
|
|
|
+ if(value==2){
|
|
|
+ this.isShow = true;
|
|
|
+ }else{
|
|
|
+ this.isShow = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
// console.log(this.selectedEquip+'@@@')
|
|
|
//第一列型号
|
|
@@ -931,10 +950,10 @@ export default {
|
|
|
handleSelectionRow(val) {
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
- /** 查询用户列表 */
|
|
|
+ /** 查询考试列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listStudent(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
+ examTearcherList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
|
//将返回值注释
|
|
|
this.userList = response.rows;
|
|
|
this.total = response.total;
|
|
@@ -969,16 +988,16 @@ export default {
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 用户状态修改
|
|
|
- handleStatusChange(row) {
|
|
|
- let text = row.status === "0" ? "启用" : "停用";
|
|
|
- this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
|
|
- return changeUserStatus(row.userId, row.status);
|
|
|
- }).then(() => {
|
|
|
- this.$modal.msgSuccess(text + "成功");
|
|
|
- }).catch(function() {
|
|
|
- row.status = row.status === "0" ? "1" : "0";
|
|
|
- });
|
|
|
- },
|
|
|
+ // handleStatusChange(row) {
|
|
|
+ // let text = row.status === "0" ? "启用" : "停用";
|
|
|
+ // this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
|
|
|
+ // return changeUserStatus(row.userId, row.status);
|
|
|
+ // }).then(() => {
|
|
|
+ // this.$modal.msgSuccess(text + "成功");
|
|
|
+ // }).catch(function() {
|
|
|
+ // row.status = row.status === "0" ? "1" : "0";
|
|
|
+ // });
|
|
|
+ // },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -989,17 +1008,18 @@ export default {
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
- userId: undefined,
|
|
|
- deptId: undefined,
|
|
|
- userName: undefined,
|
|
|
- password: undefined,
|
|
|
- phonenumber: undefined,
|
|
|
- email: undefined,
|
|
|
- sex: undefined,
|
|
|
- status: "0",
|
|
|
- remark: undefined,
|
|
|
- postIds: [],
|
|
|
- roleIds: []
|
|
|
+ examCollectionId: undefined,
|
|
|
+ examCollectionType:3,
|
|
|
+ // deptId: undefined,
|
|
|
+ // userName: undefined,
|
|
|
+ // password: undefined,
|
|
|
+ // phonenumber: undefined,
|
|
|
+ // email: undefined,
|
|
|
+ // sex: undefined,
|
|
|
+ // status: "0",
|
|
|
+ // remark: undefined,
|
|
|
+ // postIds: [],
|
|
|
+ // roleIds: []
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -1012,13 +1032,13 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
this.resetForm("queryForm");
|
|
|
- this.queryParams.deptId = undefined;
|
|
|
- this.$refs.tree.setCurrentKey(null);
|
|
|
+ // this.queryParams.deptId = undefined;
|
|
|
+ // this.$refs.tree.setCurrentKey(null);
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.userId);
|
|
|
+ this.ids = selection.map(item => item.examCollectionId);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -1037,17 +1057,18 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const userId = row.userId || this.ids;
|
|
|
- // getUser(userId).then(response => {
|
|
|
- // this.form = response.data;
|
|
|
+ const examCollectionId = row.examCollectionId || this.ids;
|
|
|
+ examTearcherGet(examCollectionId).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.form.examTime= [response.data.startTime,response.data.endTime];
|
|
|
// this.postOptions = response.posts;
|
|
|
// this.roleOptions = response.roles;
|
|
|
// this.$set(this.form, "postIds", response.postIds);
|
|
|
// this.$set(this.form, "roleIds", response.roleIds);
|
|
|
this.open = true;
|
|
|
this.title = "修改考试";
|
|
|
- this.form.password = "";
|
|
|
- // });
|
|
|
+ // this.form.password = "";
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
/** 当前考试查询 */
|
|
@@ -1072,14 +1093,20 @@ export default {
|
|
|
submitForm: function() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.userId != undefined) {
|
|
|
- updateUser(this.form).then(response => {
|
|
|
+ if(this.form.examTime){
|
|
|
+ const start_time = this.form.examTime[0];
|
|
|
+ const end_time = this.form.examTime[1];
|
|
|
+ this.form.startTime = start_time;
|
|
|
+ this.form.endTime = end_time;
|
|
|
+ }
|
|
|
+ if (this.form.examCollectionId != undefined) {
|
|
|
+ examTearcherupdate(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addUser(this.form).then(response => {
|
|
|
+ examTearcheradd(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -1088,11 +1115,13 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const userIds = row.userId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
|
|
|
- return delUser(userIds);
|
|
|
+ const examCollectionIds = row.examCollectionId || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除编号为"' + examCollectionIds + '"的数据项?').then(function() {
|
|
|
+ return examTearcherdel(examCollectionIds);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|