From f2e3affd102f6cd98448ef70c12ee3ca81afc659 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 04 七月 2024 17:57:01 +0800
Subject: [PATCH] Merge branch 'master' into dev
---
src/views/class-management/Class.vue | 32 +++++++++-
src/api/cheatRecord.js | 61 ++++++++++++++++++++
vue.config.js | 4
src/api/classes.js | 8 ++
src/views/user/student/list.vue | 1
src/views/exam/exam/ExamManage.vue | 10 +++
src/views/class-management/ClassStaff.vue | 13 ++--
7 files changed, 115 insertions(+), 14 deletions(-)
diff --git a/src/api/cheatRecord.js b/src/api/cheatRecord.js
new file mode 100644
index 0000000..ed4de07
--- /dev/null
+++ b/src/api/cheatRecord.js
@@ -0,0 +1,61 @@
+import axios from "./request";
+
+// 鑾峰彇浣滃紛璁板綍鍒嗛〉
+export const getCheatRecords = (params) => {
+ return axios({
+ url: "/api/cheat-record/page",
+ method: "GET",
+ params: params
+ })
+}
+
+// 鑾峰彇浣滃紛璁板綍鍒楄〃
+export const getCheatRecordList = () => {
+ return axios({
+ url: "/api/cheat-record/list",
+ method: "GET"
+ })
+}
+
+// 閫氳繃id鑾峰彇浣滃紛璁板綍
+export const getCheatRecordById = (params) => {
+ return axios({
+ url: "/api/cheat-record/" + params,
+ method: "GET"
+ })
+}
+
+// 閫氳繃id鍒犻櫎浣滃紛璁板綍
+export const deleteCheatRecordById = (params) => {
+ return axios({
+ url: "/api/cheat-record/" + params,
+ method: "DELETE"
+ })
+}
+
+// 鎵归噺鍒犻櫎浣滃紛璁板綍
+export const deleteCheatRecordByIds = (params) => {
+ return axios({
+ url: "/api/cheat-record/batch",
+ method: "DELETE",
+ data: params
+ })
+}
+
+// 淇敼浣滃紛璁板綍
+export const editCheatRecord = (params) => {
+ return axios({
+ url: "/api/cheat-record/",
+ method: "PUT",
+ data: params
+ })
+}
+
+// 娣诲姞浣滃紛璁板綍
+export const addCheatRecord = (params) => {
+ return axios({
+ url: "/api/cheat-record/",
+ method: "POST",
+ data: params
+ })
+}
diff --git a/src/api/classes.js b/src/api/classes.js
index c3e8bee..95940ee 100644
--- a/src/api/classes.js
+++ b/src/api/classes.js
@@ -75,3 +75,11 @@
data: params
})
}
+
+// 鐝骇鎭㈠姝e父
+export const recover = (id) => {
+ return axios({
+ url: "/api/admin/classes/recover/" + id,
+ method: "PUT"
+ })
+}
diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue
index 91a17f6..4f2f3f9 100644
--- a/src/views/class-management/Class.vue
+++ b/src/views/class-management/Class.vue
@@ -98,9 +98,24 @@
<el-button v-if="scope.row.status !== '瑙f暎'" @click="studentManager(scope.row.id)" size="small"
type="success">鎴愬憳绠$悊
</el-button>
- <el-button v-if="scope.row.status !== '瑙f暎'" @click="dissolution(scope.row.id)" type="danger"
- size="small">瑙f暎
- </el-button>
+ <el-popconfirm
+ class="confirm"
+ title="纭畾瑕佽В鏁h鐝骇锛�"
+ @confirm="dissolution(scope.row.id)"
+ >
+ <el-button slot="reference" v-if="scope.row.status !== '瑙f暎'" type="danger"
+ size="small">瑙f暎
+ </el-button>
+ </el-popconfirm>
+ <el-popconfirm
+ class="confirm"
+ title="纭畾瑕佹仮澶嶈鐝骇鍚楋紵"
+ @confirm="recover(scope.row.id)"
+ >
+ <el-button slot="reference" v-if="scope.row.status === '瑙f暎'" type="success"
+ size="small">鎭㈠姝e父
+ </el-button>
+ </el-popconfirm>
</template>
</el-table-column>
</el-table>
@@ -174,7 +189,7 @@
</template>
<script>
-import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes'
+import { addClasses, editClasses, getClassess, dissolution, recover } from '@/api/classes'
import { addClassesNotify } from '@/api/classesNotify'
import Pagination from '@/components/Pagination'
@@ -305,6 +320,12 @@
this.page()
})
},
+ recover(id) {
+ recover(id).then(res => {
+ this.$message.success(res.data.message)
+ this.page()
+ })
+ },
handlerEdit (row) {
this.form = row
this.open = true
@@ -333,6 +354,9 @@
</script>
<style scoped lang="scss">
+.confirm {
+ margin-left: 5px;
+}
.flex {
display: flex;
}
diff --git a/src/views/class-management/ClassStaff.vue b/src/views/class-management/ClassStaff.vue
index 2e20b1b..88caf31 100644
--- a/src/views/class-management/ClassStaff.vue
+++ b/src/views/class-management/ClassStaff.vue
@@ -59,9 +59,8 @@
width="300px"
>
<template slot-scope="scope">
- <el-button @click="handlerEditStudent(scope.row)" type="warning">缂栬緫</el-button>
- <el-button @click="remove(scope.row.id)" type="danger">鍒犻櫎</el-button>
- <el-button type="primary">鍒嗛厤瑙掕壊</el-button>
+ <el-button @click="handlerEditStudent(scope.row)" type="warning" size="small">缂栬緫</el-button>
+ <el-button @click="remove(scope.row.id)" type="danger" size="small">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -84,8 +83,8 @@
</el-form-item>
<el-form-item label="鎬у埆" prop="sex">
<el-select v-model="studentForm.sex">
- <el-option label="鐢�" value="N"></el-option>
- <el-option label="濂�" value="V"></el-option>
+ <el-option label="鐢�" :value="1"></el-option>
+ <el-option label="濂�" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="鐢佃瘽" prop="phone">
@@ -142,7 +141,7 @@
return {
studentForm: {
realName: '',
- sex: '',
+ sex: 1,
phone: '',
age: null,
account: '',
@@ -206,7 +205,7 @@
submitStudentForm () {
this.$refs['studentForm'].validate((valid) => {
if (valid) {
- this.studentForm.classes = this.classes.id
+ this.studentForm.classesId = this.classes.id
if (this.studentForm.id) {
edit(this.studentForm).then(res => {
this.addOpen = false
diff --git a/src/views/exam/exam/ExamManage.vue b/src/views/exam/exam/ExamManage.vue
index 11054e4..cdba0cb 100644
--- a/src/views/exam/exam/ExamManage.vue
+++ b/src/views/exam/exam/ExamManage.vue
@@ -72,6 +72,16 @@
@click="handlerEdit(scope.row)"
>淇敼
</el-button>
+ <el-popconfirm
+ v-if="scope.row.status === 'not_start'"
+ style="margin: 0 5px"
+ title="纭畾瑕佸垹闄よ鑰冭瘯鍚楋紵"
+ @confirm="deleteExam(scope.row.id)"
+ >
+ <el-button slot="reference" type="danger" size="small">鍒犻櫎</el-button>
+ </el-popconfirm>
+
+ <el-button v-if="scope.row.status === 'finished'" type="success" size="small" @click="markPaper(scope.row)">闃呭嵎</el-button>
<el-button type="danger" size="small" @click="deleteExam(scope.row.id)">鍒犻櫎</el-button>
<el-button type="success" size="small" @click="markPaper(scope.row)">闃呭嵎</el-button>
<el-button type="warning" size="small" @click="monitor(scope.row)">鐩戞帶</el-button>
diff --git a/src/views/user/student/list.vue b/src/views/user/student/list.vue
index 8144dd3..e62cc7c 100644
--- a/src/views/user/student/list.vue
+++ b/src/views/user/student/list.vue
@@ -13,7 +13,6 @@
</el-form>
<el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
- <el-table-column prop="id" label="Id" />
<el-table-column prop="userName" label="鐢ㄦ埛鍚�"/>
<el-table-column prop="realName" label="鐪熷疄濮撳悕" />
<el-table-column prop="userLevel" label="瀛︾骇" :formatter="levelFormatter"/>
diff --git a/vue.config.js b/vue.config.js
index 7978686..cc6f74c 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -19,8 +19,8 @@
hotOnly: false,
proxy: {
'/api': {
- target: 'http://localhost:8000',
- // target: 'http://192.168.3.64:8000',
+ // target: 'http://localhost:8000',
+ target: 'http://192.168.3.64:8000',
changeOrigin: true
}
}
--
Gitblit v1.8.0