From edb23abd0a3b49143b25a2e6f4043de2fb109513 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期四, 13 六月 2024 10:35:52 +0800 Subject: [PATCH] 班级、班级学员管理 --- /dev/null | 18 - src/views/class-management/Class.vue | 311 ++++++++++++++-------------- src/api/user.js | 6 src/router.js | 23 + src/icons/svg/classes.svg | 1 src/api/examPaper.js | 5 src/views/class-management/ClassStaff.vue | 266 +++++++++++------------ 7 files changed, 315 insertions(+), 315 deletions(-) diff --git a/src/api/examPaper.js b/src/api/examPaper.js index 58a62ef..71d3cfa 100644 --- a/src/api/examPaper.js +++ b/src/api/examPaper.js @@ -1,9 +1,10 @@ -import { post } from '@/utils/request' +import { post,get } from '@/utils/request' export default { pageList: query => post('/api/admin/exam/paper/page', query), taskExamPage: query => post('/api/admin/exam/paper/taskExamPage', query), edit: query => post('/api/admin/exam/paper/edit', query), select: id => post('/api/admin/exam/paper/select/' + id), - deletePaper: id => post('/api/admin/exam/paper/delete/' + id) + deletePaper: id => post('/api/admin/exam/paper/delete/' + id), + myExamPaperList: param => get('/api/admin/exam/paper/my', param), } diff --git a/src/api/user.js b/src/api/user.js index bd97bde..34afe94 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,4 +1,4 @@ -import { post } from '@/utils/request' +import { post,get } from '@/utils/request' export default { getUserPageList: query => post('/api/admin/user/page/list', query), @@ -9,5 +9,7 @@ updateUser: query => post('/api/admin/user/update', query), changeStatus: id => post('/api/admin/user/changeStatus/' + id), deleteUser: id => post('/api/admin/user/delete/' + id), - selectByUserName: query => post('/api/admin/user/selectByUserName', query) + selectByUserName: query => post('/api/admin/user/selectByUserName', query), + studentList: () => get('/api/admin/user/student/list'), + getClassesCurrentUserList: (param) => get('/api/admin/user/classes/students', param), } diff --git a/src/icons/svg/classes.svg b/src/icons/svg/classes.svg new file mode 100644 index 0000000..84fda7f --- /dev/null +++ b/src/icons/svg/classes.svg @@ -0,0 +1 @@ +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718243377733" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4303" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M139.032703 846.938089a26.776811 26.776811 0 0 1-20.799743-9.839879 510.393683 510.393683 0 0 1-42.548045-59.690689 27.02938 27.02938 0 1 1 46.159429-28.136795 448.211595 448.211595 0 0 0 38.045243 53.405053 27.176806 27.176806 0 0 1-3.542813 38.090957 28.079652 28.079652 0 0 1-17.359785 6.171353z m0 0" p-id="4304"></path><path d="M511.885231 1023.998754a507.639431 507.639431 0 0 1-294.762066-93.541699 27.009951 27.009951 0 0 1 31.131043-44.148025 454.451518 454.451518 0 0 0 263.688165 83.598965c252.259735 0 457.560051-205.506028 457.560051-458.017188S764.144965 53.873619 511.885231 53.873619 54.439464 259.505359 54.439464 512.005091a456.680062 456.680062 0 0 0 18.388344 128.775549 27.028237 27.028237 0 0 1-51.862215 15.211241 513.387931 513.387931 0 0 1-20.45689-143.998218c0-282.350791 229.414303-511.993663 511.490812-511.993663s511.479384 229.642872 511.479383 511.993663-229.517159 511.993663-511.593667 511.993663z m0 0" p-id="4305"></path><path d="M551.564739 764.081971a22.388294 22.388294 0 0 1 0 44.765161H306.413488a111.838616 111.838616 0 0 1-112.68432-111.9529v-369.366857a112.478608 112.478608 0 0 1 112.68432-112.364324h410.737773c62.856365 0 113.141457 50.365091 113.141457 112.364324v184.694857a22.365437 22.365437 0 1 1-44.730875 0V327.527375a67.427737 67.427737 0 0 0-67.599163-67.587735H306.413488a67.427737 67.427737 0 0 0-67.530593 67.587735v368.955433a67.427737 67.427737 0 0 0 67.530593 67.599163z m0 0" p-id="4306"></path><path d="M677.243184 677.900181c-49.027965 0-88.593189-37.885245-88.593189-84.810379-0.43428-46.502282 39.565225-84.387527 88.593189-84.387527s88.604618 37.885245 88.604618 84.810379c0 46.502282-39.999505 84.387527-88.604618 84.387527z m0-126.14701c-25.371115 0-45.588007 18.514057-45.588007 41.759483s20.651173 41.759483 45.588007 41.759483 45.599436-18.514057 45.599436-41.759483-20.651173-41.759483-45.599436-41.759483z m0 0" p-id="4307"></path><path d="M807.572999 808.344281a21.314022 21.314022 0 0 1-21.508305-21.531162c0-55.530741-48.170832-100.74161-107.095817-100.741611s-107.095817 45.210869-107.095817 100.741611a21.508305 21.508305 0 1 1-43.005182 0c0-79.210448 67.519164-143.792506 150.100999-143.792506S829.069876 707.60267 829.069876 786.813119a21.302593 21.302593 0 0 1-21.496877 21.531162zM639.243654 329.367352a21.314022 21.314022 0 0 1-21.508305-21.531162v-68.022015a21.508305 21.508305 0 1 1 43.01661 0v68.022015a21.314022 21.314022 0 0 1-21.508305 21.531162z m-258.911081 0a21.314022 21.314022 0 0 1-21.508305-21.531162v-68.022015a21.508305 21.508305 0 1 1 43.005182 0v68.022015a21.576876 21.576876 0 0 1-21.496877 21.531162z m-184.45486 67.907731v-44.776589h632.666455v44.776589z m0 0M422.972045 475.628399v109.347218q4.502801 70.399129-63.222074 93.004563c-6.857058 1.714264-11.622713-0.43428-15.062671-6.468491-1.291413-6.022783 1.725693-9.89702 8.605608-12.045566 34.833855-9.039888 52.04507-33.588156 51.176509-74.056226v-109.781498c0-4.73137 3.017106-7.748476 9.46274-8.182756 5.16565 0.43428 8.171327 3.017106 9.039888 8.182756z m-120.432795-4.73137h56.77644c4.29709 0.422852 6.857058 3.428529 7.314196 9.039888-0.43428 5.599931-3.017106 8.182756-7.314196 8.182756h-21.508305v62.856365h16.731222c4.29709 0.422852 6.857058 3.428529 7.314195 9.028459-0.43428 5.599931-3.017106 8.182756-7.314195 8.182756h-16.731222v61.999233c1.291413-1.291413 4.308518-3.428529 9.46274-6.457063a23.736849 23.736849 0 0 0 7.314195-4.73137c4.29709-3.428529 8.594179-3.428529 12.902698 0.857132 3.005677 4.73137 2.582825 9.039888-1.725693 12.914126-16.342655 12.914126-37.839532 22.85686-65.37062 30.13677-6.022783 0.43428-10.285587-1.725693-12.045565-7.314195-0.422852-4.308518 2.148545-7.748476 8.605608-9.908449 11.177005-2.582825 18.4912-4.73137 22.365437-7.314195v-69.713423h-15.06267c-5.588502 0-8.605608-2.582825-8.605608-8.182756s3.017106-8.605608 8.605608-9.039888h15.051242v-63.313502h-16.765507c-5.588502 0-8.594179-2.582825-8.594179-8.182756 0.422852-5.599931 3.005677-8.617036 8.594179-9.039888z m137.198302 1.714264h63.233503c4.29709 0.43428 6.857058 3.428529 7.302767 9.039888-0.422852 5.599931-3.005677 8.182756-7.302767 8.182756h-25.382543V560.004497h18.4912c5.16565 0.43428 7.748476 3.428529 8.605608 9.051317-0.422852 6.022783-3.428529 9.039888-8.605608 9.039888h-18.4912v76.627623h27.95394c5.16565 0 7.748476 3.017106 8.605608 9.039888-0.43428 6.034211-3.428529 9.474168-8.605608 9.908449h-77.861893c-5.599931-0.43428-8.605608-3.874238-8.605608-9.908449s3.005677-9.039888 8.605608-9.039888h31.816749V578.518554h-20.616888c-5.588502 0-8.605608-3.005677-8.605608-9.039888 0-5.588502 3.017106-8.605608 8.605608-9.039888h20.639744V489.833937h-19.782612c-6.022783 0-9.46274-2.582825-10.285587-8.182756q0.651421-7.748476 10.285587-9.039888z m-46.856563 9.039888c-0.422852 21.954014-1.714264 42.628044-3.005677 61.999233a448.131596 448.131596 0 0 1-7.314195 52.090784c-2.582825 6.034211-6.457063 9.051317-12.045565 8.182756-5.588502-1.291413-7.314195-5.16565-5.588502-12.056994a382.646692 382.646692 0 0 0 6.457062-47.359414q2.571397-24.525411 3.86281-61.987804c0-4.742798 3.017106-7.748476 8.605608-8.182756 5.588502 0 8.605608 2.582825 9.028459 7.314195z m0 0" p-id="4308"></path><path d="M355.007172 683.180116c-6.445635 0-11.177005-3.017106-14.182681-9.474169l-0.434281-1.291412c-1.725693-8.182756 2.582825-14.639819 11.611285-16.788364 33.142447-8.617036 48.605113-31.428182 48.170833-69.713423v-110.284349c0-3.428529 1.291413-11.188433 13.336977-12.491274h0.857133c7.737047 0.868561 12.045565 5.177079 13.336977 12.056993 2.148545-3.874238 6.445635-6.022783 12.034137-6.857058h64.513487c3.862809 0.422852 9.885592 3.005677 11.177005 12.914126v0.788562c-1.291413 10.765581-8.605608 12.056994-11.611285 12.056994h-21.062596v61.564952h15.051242c6.857058 0.857132 11.177005 5.599931 12.045565 12.914126v0.857132c-1.291413 11.634142-9.46274 12.914126-12.479845 12.914126h-14.194111v68.033444h23.656851c3.428529 0 11.611285 1.291413 12.479845 12.914125v0.857133c-1.291413 10.765581-8.171327 13.348406-12.045565 13.782686h-79.141878c-7.737047-0.868561-12.045565-6.034211-12.045565-14.216967 0-8.605608 4.73137-13.336978 12.902698-13.336977h27.531087v-67.55345h-17.634067c-5.588502 0-9.89702-2.582825-11.611285-6.857058v9.039888c3.428529 48.650826-18.92548 81.370421-66.284894 97.301653a33.359587 33.359587 0 0 1-6.022782 0.868561z m-6.445634-12.925555c2.148545 3.874238 5.16565 4.742798 9.89702 3.874238 43.428034-14.62839 63.222075-43.428034 60.204969-88.684617v-109.381503c-0.422852-1.725693-0.857132-3.428529-5.154222-4.308518-5.16565 0.43428-5.16565 2.582825-5.16565 3.874238v110.650059c0.857132 42.182335-17.634067 68.444867-54.616467 77.919035-5.16565 1.291413-5.599931 3.428529-5.16565 6.022783z m79.141877 0h77.839037c1.291413 0 3.874238-0.857132 4.308518-5.588502-0.43428-4.742798-2.582825-4.742798-3.874238-4.742798h-32.262458v-85.713225h22.85686c1.291413 0 3.428529 0 3.874238-4.742799-0.43428-3.428529-2.148545-4.73137-4.308518-4.73137h-22.845431v-79.199019h29.713917c1.291413 0 2.571397 0 3.005678-3.885667-0.43428-3.874238-2.148545-4.73137-3.428529-4.73137h-62.844937c-4.29709 0.43428-5.588502 2.148545-6.022782 4.73137 0.43428 2.159973 1.291413 3.885666 6.022782 3.885667h24.091131v78.787596h-24.948263c-3.428529 0.43428-4.29709 1.725693-4.29709 4.742798 0 4.29709 1.714264 4.73137 4.29709 4.73137h24.948263v85.244659h-36.148124c-2.582825 0-4.308518 0.43428-4.308519 4.73137 0 5.16565 1.725693 6.034211 4.308519 6.457063z m-0.43428-181.712036v74.913358c1.714264-4.308518 5.588502-6.857058 11.188433-7.314195h16.765507v-61.999233h-15.485523c-6.022783 0-10.285587-1.725693-12.468417-5.59993zM299.099293 668.071731c-6.857058 0-12.045565-3.428529-14.628391-10.285587v-0.891417c-0.857132-4.308518 0.868561-10.765581 11.188433-14.639819h0.857133a95.998812 95.998812 0 0 0 18.92548-5.599931v-63.724925h-10.754153c-7.737047 0-12.902697-4.742798-12.902697-12.491274s4.308518-12.479846 12.045565-13.348407h11.177004v-54.673609h-12.468417c-7.737047 0-12.902697-4.73137-12.902697-12.479845s4.308518-12.491274 12.045565-13.348406h58.067853c3.862809 0.43428 9.885592 3.017106 11.177004 12.914126v0.43428c0.857132-5.599931 5.154222-9.039888 12.045565-9.908449h0.422852c7.748476 0 12.902697 3.874238 13.771258 11.199861v0.811419c-0.43428 21.954014-1.725693 42.628044-3.017105 62.422084-1.714264 20.239749-4.29709 37.885245-7.737047 52.570778l-0.43428 0.868561c-3.005677 7.748476-9.02846 11.622713-16.776936 10.754153h-0.422852a12.354133 12.354133 0 0 1-8.171327-5.165651c-1.725693-3.005677-2.148545-6.857058-0.857132-12.045565 1.714264-7.748476 3.005677-15.931231 4.297089-24.971119a11.028435 11.028435 0 0 1-10.285587 6.457063h-12.51413v49.507958c0.868561-0.43428 1.725693-1.291413 2.582825-1.725693 4.73137-2.582825 6.445635-3.428529 6.857058-3.874237 6.457063-5.16565 13.336978-4.73137 18.92548 0.857132l0.43428 0.86856c4.29709 6.457063 3.428529 13.348406-2.582825 18.514057q-25.142546 20.022609-67.096312 30.993902z m-6.445635-12.914126c0.857132 2.148545 2.571397 4.308518 7.302767 3.874238 26.673956-7.314195 47.74798-16.788364 63.222075-29.279638 2.582825-2.148545 3.017106-3.874238 1.302841-6.457063-3.017106-2.582825-4.73137-2.148545-6.857058-0.43428-1.291413 1.302841-4.29709 3.017106-8.171328 5.16565a81.416135 81.416135 0 0 0-8.171327 5.599931l-7.314195 7.325624v-76.627623h21.062596c1.291413 0 2.582825 0 3.017106-3.874238-0.43428-3.874238-2.148545-4.73137-3.428529-4.73137h-20.651173v-71.907681h25.805395c1.279984 0 2.571397 0 3.005677-3.874238-0.43428-3.874238-2.148545-4.742798-3.428529-4.742799h-56.34216c-3.428529 0.43428-4.29709 1.725693-4.29709 4.742799 0 2.582825 0.422852 3.874238 4.29709 3.874238h21.074025v71.461972h-18.959766c-3.428529 0.43428-4.29709 1.725693-4.297089 4.73137 0 2.594254 0.422852 3.885666 4.297089 3.885666h19.348332v77.484756l-2.148544 1.302841c-4.29709 2.582825-12.034137 5.16565-23.645422 7.748475-5.599931 1.714264-6.022783 3.874238-6.022783 4.73137z m78.707598-55.107889c2.571397 0.43428 5.154222-0.43428 7.302766-5.16565a426.783289 426.783289 0 0 0 7.314196-51.233652c1.291413-19.371189 2.148545-39.999505 2.582825-61.564952-0.43428-1.714264-0.857132-3.017106-4.73137-3.428529-4.29709 0.422852-4.29709 2.582825-4.29709 3.874237-0.43428 24.971119-1.725693 46.068001-3.874238 62.422085a388.12091 388.12091 0 0 1-6.457063 47.793694 8.731321 8.731321 0 0 0-0.422852 5.588502c0.422852 0.868561 1.291413 1.291413 2.582826 1.725693z m-28.822501-52.959345h12.902698c3.428529 0.43428 9.039888 2.582825 10.754152 10.34273l1.291413-12.925555q2.571397-24.525411 3.874238-61.987804v-1.291413c-1.725693 9.89702-8.605608 10.754153-11.611285 10.754153h-17.211216z m0 0" p-id="4309"></path></svg> \ No newline at end of file diff --git a/src/router.js b/src/router.js index d0e8b31..fd84032 100644 --- a/src/router.js +++ b/src/router.js @@ -37,11 +37,11 @@ ] }, { - path: '/exam', + path: '/exam1', component: Layout, children: [ { - path: '/manage', + path: '/exam1/manage', component: () => import('@/views/exam/exam/ExamManage'), name: 'Exam', meta: { title: '鑰冭瘯绠$悊', icon: 'exam', affix: true } @@ -49,6 +49,25 @@ ] }, { + path: '/classes', + component: Layout, + children: [ + { + path: '/classes/manage', + component: () => import('@/views/class-management/Class'), + name: 'Classes', + meta: { title: '鐝骇绠$悊', icon: 'classes', affix: true } + }, + { + path: '/classes/class-management/Class-staff', + component: () => import('@/views/class-management/ClassStaff'), + name: 'Classes', + hidden: true, + meta: { title: '鐝骇鎴愬憳绠$悊', icon: 'classes', affix: true } + } + ] + }, + { path: '/user', component: Layout, name: 'UserPage', diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue index 9cdd5a9..91a17f6 100644 --- a/src/views/class-management/Class.vue +++ b/src/views/class-management/Class.vue @@ -1,120 +1,113 @@ <!-- 鐝骇绠$悊 --> <template> - <div class="c"> - <div class="bg"> - <div class="main"> - <div class="main-1"> - <div - class="main-btn flex" - style="justify-content:space-between" - > - <div> - <el-button - type="primary" - size="small" - style="margin-right:20px;" - @click="handlerAdd" - >鏂板鐝骇</el-button> - </div> - <el-form :inline="true" :model="searchForm" class="demo-form-inline"> - <el-form-item label="鐝骇鍚嶇О"> - <el-input v-model="searchForm.className" size="small" clearable @clear="page" placeholder="鐝骇鍚嶇О"></el-input> - </el-form-item> - <el-form-item label="鐝骇鐘舵��"> - <el-select v-model="searchForm.status" size="small" clearable @change="page" placeholder="鐝骇鐘舵��"> - <el-option label="姝e父" value="normal"></el-option> - <el-option label="瑙f暎" value="dissolution"></el-option> - </el-select> - </el-form-item> - <el-form-item> - <el-button type="primary" @click="page">鏌ヨ</el-button> - </el-form-item> - </el-form> - </div> - <div> - <div> - <el-table - v-loading="loading" - :data="tableData" - border - :row-style="{height:'42px'}" - :cell-style="{padding: '0'}" - > - <el-table-column - align="center" - label="鐝骇" - prop="className" - width="180px" - ></el-table-column> - <el-table-column - label="鐘舵��" - align="center" - width="80px" - prop="status" - > - <template slot-scope="scope"> - <el-tag v-if="scope.row.status === '姝e父'" type="success">{{scope.row.status}}</el-tag> - <el-tag v-if="scope.row.status === '瑙f暎'" type="danger">{{scope.row.status}}</el-tag> - </template> - </el-table-column> - <el-table-column - width="100px" - align="center" - label="鍗曚綅" - prop="unit" - ></el-table-column> - <el-table-column - align="center" - width="100px" - label="鏁欏笀" - prop="createUserName" - ></el-table-column> - <el-table-column - align="center" - width="120px" - label="鑱旂郴鐢佃瘽" - prop="teacherPhone" - ></el-table-column> - <el-table-column - width="140px" - label="寮�鐝椂闂�" - align="center" - prop="startTime" - ></el-table-column> - <el-table-column - width="140px" - label="缁撴潫鏃堕棿" - align="center" - prop="endTime" - ></el-table-column> - <el-table-column - label="鎿嶄綔" - align="center" - fixed="right" - > - <template slot-scope="scope"> - <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)" type="primary">淇敼</el-button> - <el-button v-if="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button> - <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)" type="info">閫氱煡</el-button> - <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> - </template> - </el-table-column> - </el-table> - </div> - <div - class="flex" - style="justify-content:center;margin-top:20px;" - > - <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex" :limit.sync="searchForm.pageSize" - @pagination="page"/> - </div> - </div> - </div> + <div class="app-container"> + <div style="display: flex;flex-direction: row"> + <div style="margin-right:10px;"> + <el-button + type="primary" + size="small" + @click="handlerAdd" + >鏂板鐝骇 + </el-button> </div> - + <div> + <el-form :inline="true" :model="searchForm" class="demo-form-inline"> + <el-form-item label="鐝骇鍚嶇О"> + <el-input v-model="searchForm.className" size="small" clearable @clear="page" + placeholder="鐝骇鍚嶇О"></el-input> + </el-form-item> + <el-form-item label="鐝骇鐘舵��"> + <el-select v-model="searchForm.status" size="small" clearable @change="page" placeholder="鐝骇鐘舵��"> + <el-option label="姝e父" value="normal"></el-option> + <el-option label="瑙f暎" value="dissolution"></el-option> + </el-select> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="page">鏌ヨ</el-button> + </el-form-item> + </el-form> </div> + </div> + <el-table + v-loading="loading" + :data="tableData" + border + :row-style="{height:'42px'}" + :cell-style="{padding: '0'}" + > + <el-table-column + align="center" + label="鐝骇" + prop="className" + width="180px" + ></el-table-column> + <el-table-column + label="鐘舵��" + align="center" + width="80px" + prop="status" + > + <template slot-scope="scope"> + <el-tag v-if="scope.row.status === '姝e父'" type="success">{{ scope.row.status }}</el-tag> + <el-tag v-if="scope.row.status === '瑙f暎'" type="danger">{{ scope.row.status }}</el-tag> + </template> + </el-table-column> + <el-table-column + width="100px" + align="center" + label="鍗曚綅" + prop="unit" + ></el-table-column> + <el-table-column + align="center" + width="100px" + label="鏁欏笀" + prop="createUserName" + ></el-table-column> + <el-table-column + align="center" + width="120px" + label="鑱旂郴鐢佃瘽" + prop="teacherPhone" + ></el-table-column> + <el-table-column + width="140px" + label="寮�鐝椂闂�" + align="center" + prop="startTime" + ></el-table-column> + <el-table-column + width="140px" + label="缁撴潫鏃堕棿" + align="center" + prop="endTime" + ></el-table-column> + <el-table-column + label="鎿嶄綔" + align="center" + fixed="right" + > + <template slot-scope="scope"> + <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerEdit(scope.row)" + type="primary">淇敼 + </el-button> + <el-button v-if="scope.row.status !== '瑙f暎'" size="small" type="warning">鐝骇楠岃瘉</el-button> + <el-button v-if="scope.row.status !== '瑙f暎'" size="small" @click="handlerOpenNotify(scope.row)" + type="info">閫氱煡 + </el-button> + <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> + </template> + </el-table-column> + </el-table> + <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageIndex" + :limit.sync="searchForm.pageSize" + @pagination="page"/> <el-dialog title="鐝骇閫氱煡" :visible.sync="notifyOpen" @@ -122,7 +115,7 @@ :before-close="handleClose"> <el-form :model="notifyForm" :rules="notifyRules" ref="notifyForm" label-width="100px" class="demo-ruleForm"> <el-form-item label="閫氱煡鐝骇锛�" prop="className"> - <span>{{notifyForm.className}}</span> + <span>{{ notifyForm.className }}</span> </el-form-item> <el-form-item label="閫氱煡鍐呭锛�" prop="notifyContent"> <el-input type="textarea" v-model="notifyForm.notifyContent" size="small"></el-input> @@ -181,12 +174,13 @@ </template> <script> -import { addClasses, editClasses, getClassess, dissolution } from "@/api/classes"; -import { addClassesNotify } from "@/api/classesNotify"; -import Pagination from "@/components/Pagination" +import { addClasses, editClasses, getClassess, dissolution } from '@/api/classes' +import { addClassesNotify } from '@/api/classesNotify' +import Pagination from '@/components/Pagination' + export default { - components: {Pagination}, - data() { + components: { Pagination }, + data () { return { notifyOpen: false, notifyForm: { @@ -197,10 +191,10 @@ loading: true, total: 0, open: false, - title: "", - value: "", + title: '', + value: '', searchForm: { - className:'', + className: '', status: '', subject: null, pageSize: 10, @@ -208,12 +202,12 @@ }, form: { id: null, - className: "", - status: "", - verifyStatus: "", + className: '', + status: '', + verifyStatus: '', startTime: null, endTime: null, - remark: "" + remark: '' }, notifyRules: { notifyContent: [ @@ -233,18 +227,16 @@ { required: true, message: '璇烽�夋嫨鐝骇缁撴潫鏃堕棿', trigger: 'change' }, ], }, - tableData: [ - - ], - }; + tableData: [], + } }, methods: { - handlerOpenNotify(row) { + handlerOpenNotify (row) { this.notifyOpen = true this.notifyForm.className = row.className this.notifyForm.classesId = row.id }, - submitNotifyForm() { + submitNotifyForm () { this.$refs['notifyForm'].validate((valid) => { if (valid) { let _this = this @@ -256,97 +248,99 @@ } }) }, - clearNotifyForm() { + clearNotifyForm () { this.notifyForm = { className: '', notifyContent: '' } }, - handleNotifyClose() { + handleNotifyClose () { this.notifyOpen = false this.clearNotifyForm() }, - page() { + page () { getClassess(this.searchForm).then(res => { this.tableData = res.data.data this.total = res.data.total this.loading = false }) }, - resetForm() { + resetForm () { this.form = { id: null, - className: "", - status: "", - verifyStatus: "", + className: '', + status: '', + verifyStatus: '', startTime: null, endTime: null, - remark: "" + remark: '' } }, - submitForm() { + submitForm () { this.$refs['form'].validate((valid) => { if (valid) { if (this.form.id) { editClasses(this.form).then(res => { - this.$message.success("淇敼鎴愬姛") + this.$message.success('淇敼鎴愬姛') this.resetForm() this.open = false this.page() }) } else { addClasses(this.form).then(res => { - this.$message.success("娣诲姞鐝骇鎴愬姛") + this.$message.success('娣诲姞鐝骇鎴愬姛') this.resetForm() this.open = false this.page() }) } } else { - return false; + return false } - }); + }) }, - dissolution(id) { + dissolution (id) { dissolution(id).then(res => { this.$message.success(res.data.message) this.page() }) }, - handlerEdit(row) { - this.form = row; + handlerEdit (row) { + this.form = row this.open = true }, - handleClose() { + handleClose () { this.open = false this.resetForm() }, - handlerAdd() { + handlerAdd () { this.open = true - this.title = "鏂板鐝骇" + this.title = '鏂板鐝骇' }, // 璺宠浆(鏌ョ湅鐝骇浜哄憳鎯呭喌) - studentManager(classesId) { - this.$router.push({ path: "class-management/Class-staff", query: { classesId: classesId } }); + studentManager (classesId) { + this.$router.push({ path: '/classes/class-management/Class-staff', query: { classesId: classesId } }) }, // 杩斿洖涓婁竴涓〉闈� - goBack() { - this.$router.back(); + goBack () { + this.$router.back() }, }, - created() { + created () { this.page() }, -}; +} </script> <style scoped lang="scss"> .flex { display: flex; } + .mian-1-top { margin: 10px 0; align-items: center; + & input { height: 30px; width: 200px; @@ -359,10 +353,12 @@ border-left: 5px solid rgb(16, 71, 247); padding-left: 10px; margin: 30px 0; + & p { font-weight: 700; } } + &-1 { width: 1227px; // height: 784px; @@ -371,15 +367,18 @@ border-radius: 10px; padding: 32px 40px; } + &-btn { padding-bottom: 10px; border-bottom: 3px solid rgb(16, 71, 247); } } + .deepBlue { background: rgb(16, 71, 247); color: white; border: none; + &:hover { background-color: rgb(45, 92, 248); } diff --git a/src/views/class-management/ClassStaff.vue b/src/views/class-management/ClassStaff.vue index 2811374..2e20b1b 100644 --- a/src/views/class-management/ClassStaff.vue +++ b/src/views/class-management/ClassStaff.vue @@ -1,77 +1,78 @@ <!-- 鐝骇浜哄憳绠$悊 --> <template> - <div class="c"> - <div class="bg"> - <div class="main"> - <div class="content"> - <!-- 鐝骇鍚嶇О --> - <div style="padding-bottom:20px; border-bottom: 3px solid #409EFF;margin-bottom: 20px;"> - <span>{{title}}</span> - <el-button @click="handlerAddStudent" type="primary" size="small">鏂板瀛﹀憳</el-button> - <el-button @click="open = true" type="primary" size="small">瀛﹀憳璋冩暣</el-button> - </div> - <!-- 琛ㄦ牸 --> - <el-table - :header-cell-style="getRowClass" - :row-style="{height:'38px'}" - :cell-style="{padding: '0'}" - :data="tableData" - border - style="width: 100%;" - > - <el-table-column - align="center" - prop="id" - label="瀛﹀彿" - > - </el-table-column> - <el-table-column - align="center" - prop="realName" - label="濮撳悕" - > - </el-table-column> - <el-table-column - align="center" - prop="sex" - :formatter="sexFormatter" - label="鎬у埆" - > - </el-table-column> - <el-table-column - align="center" - prop="phone" - label="鐢佃瘽" - > - </el-table-column> - <el-table-column - label="鎿嶄綔" - align="center" - 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> - </template> - </el-table-column> - </el-table> - <div - class="block" - style="display: flex; margin-top: 40px;" - > - <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" - @pagination="page"/> - </div> - </div> + <div class="app-container"> + <div style="display: flex; flex-direction: row"> + <div style="padding-bottom:20px"> + <span class="item">{{ title }}</span> + <el-button class="item" @click="handlerAddStudent" type="primary" size="small">鏂板瀛﹀憳</el-button> + <el-button class="item" @click="open = true" type="primary" size="small">瀛﹀憳璋冩暣</el-button> </div> - + <div> + <el-form :inline="true" :model="searchForm" class="demo-form-inline"> + <el-form-item label="瀛﹀憳濮撳悕"> + <el-input v-model="searchForm.studentName" size="small" clearable @clear="page" + placeholder="瀛﹀憳濮撳悕"></el-input> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="page">鏌ヨ</el-button> + </el-form-item> + </el-form> + </div> </div> - <PopUp - ref="popUp" - @children="parentGoods" - /> - + <!-- 琛ㄦ牸 --> + <el-table + :header-cell-style="getRowClass" + :row-style="{height:'38px'}" + :cell-style="{padding: '0'}" + :data="tableData" + border + style="width: 100%;" + > + <el-table-column + align="center" + prop="id" + label="瀛﹀彿" + > + </el-table-column> + <el-table-column + align="center" + prop="realName" + label="濮撳悕" + > + </el-table-column> + <el-table-column + align="center" + prop="sex" + :formatter="sexFormatter" + label="鎬у埆" + > + </el-table-column> + <el-table-column + align="center" + prop="phone" + label="鐢佃瘽" + > + </el-table-column> + <el-table-column + label="鎿嶄綔" + align="center" + 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> + </template> + </el-table-column> + </el-table> + <div + class="block" + style="display: flex; margin-top: 40px;" + > + <pagination v-show="total>0" :total="total" :page.sync="searchForm.pageNum" + :limit.sync="searchForm.pageSize" + @pagination="page"/> + </div> <el-dialog :title="studentTitle" :visible.sync="addOpen" @@ -131,23 +132,21 @@ </template> <script> // 寮曞叆褰堝嚭绐楀彛绲勪欢 -import PopUp from "../../../components/PopUp/Question.vue"; -import UserApi from "@/api/user"; -import { updateClassesUser, getClassesUsers, deleteClassesUserById, addClassesUser, edit } from "@/api/classesUser"; +import UserApi from '@/api/user' +import { updateClassesUser, getClassesUsers, deleteClassesUserById, addClassesUser, edit } from '@/api/classesUser' +import Pagination from '@/components/Pagination' + export default { - // 娉ㄥ唽 - components: { - PopUp, - }, - data() { + components: { Pagination }, + data () { return { studentForm: { - realName: "", - sex: "", - phone: "", + realName: '', + sex: '', + phone: '', age: null, - account: "", - password: "" + account: '', + password: '' }, studentRules: { realName: [ @@ -163,12 +162,12 @@ { required: true, message: '璇峰~鍐欏鍛樼櫥褰曡处鍙�', trigger: 'blur' }, ] }, - studentTitle: "鏂板瀛﹀憳", + studentTitle: '鏂板瀛﹀憳', addOpen: false, total: 0, studentList: [], searchForm: { - examName: "", + studentName: '', pageSize: 10, pageNum: 1, classesId: null @@ -179,33 +178,32 @@ }, open: false, // 鐝骇鍚嶇О - title: "19绾ц蒋浠跺洓鐝�", + title: '19绾ц蒋浠跺洓鐝�', formLabelAlign: { - type: "", - user: "", - region: "", + type: '', + user: '', + region: '', }, - tableData: [ - ], - }; + tableData: [], + } }, - mounted() { - this.classes.id = this.$route.query.classesId; + mounted () { + this.classes.id = this.$route.query.classesId this.page() this.getClassesCurrentUserList(this.classes.id) this.getStudentList() }, methods: { - handlerEditStudent(row) { + handlerEditStudent (row) { this.studentForm = row - this.studentTitle = "缂栬緫瀛﹀憳" + this.studentTitle = '缂栬緫瀛﹀憳' this.addOpen = true }, - handlerAddStudent() { - this.studentTitle = "娣诲姞瀛﹀憳" + handlerAddStudent () { + this.studentTitle = '娣诲姞瀛﹀憳' this.addOpen = true }, - submitStudentForm() { + submitStudentForm () { this.$refs['studentForm'].validate((valid) => { if (valid) { this.studentForm.classes = this.classes.id @@ -224,33 +222,33 @@ } }) }, - resetStudentForm() { + resetStudentForm () { this.studentForm = { - realName: "", - sex: "", - phone: "", + realName: '', + sex: '', + phone: '', age: null } }, - handleAddClose() { + handleAddClose () { this.addOpen = false this.resetStudentForm() }, - remove(id) { + remove (id) { deleteClassesUserById(id).then(res => { this.$message.success(res.data.message) this.page() }) }, - sexFormatter(row) { + sexFormatter (row) { if (row.sex === 1) { - return "鐢�" + return '鐢�' } if (row.sex === 2) { - return "濂�" + return '濂�' } }, - getClassesCurrentUserList(classesId) { + getClassesCurrentUserList (classesId) { let param = { classesId: classesId } @@ -258,75 +256,73 @@ this.classes.studentList = res.data.map(item => item.id) }) }, - getStudentList() { + getStudentList () { UserApi.studentList().then(res => { - this.studentList = res.data; + this.studentList = res.data }) }, // 鑾峰彇褰撳墠鐝骇瀛﹀憳鍒嗛〉 - page() { + page () { this.searchForm.classesId = this.classes.id getClassesUsers(this.searchForm).then(res => { this.tableData = res.data.data }) }, - submitForm() { + submitForm () { updateClassesUser(this.classes).then(res => { this.$message.success(res.data.message) - this.page(); + this.page() + this.open = false }) }, - handleClose() { + handleClose () { this.open = false }, - filterMethod(query, item) { - if (! item.realName) { + filterMethod (query, item) { + if (!item.realName) { return null } - return item.realName.indexOf(query) > -1; + return item.realName.indexOf(query) > -1 }, // 杩斿洖涓婁竴涓〉闈� - goBack() { - this.$router.back(); + goBack () { + this.$router.back() }, // 淇敼琛ㄥ崟澶撮儴鐨勯鑹� - getRowClass() { - return "background:#d2d3d6"; + getRowClass () { + return 'background:#d2d3d6' }, // 鐢熸垚璇曞嵎 - getCreate() { + getCreate () { // 璺宠浆鍒扮敓鎴愰〉闈� //璺宠浆鍒板搴旂殑绠$悊椤甸潰 this.$router.push({ - path: "/manage/test-paper-generation", - }); - }, - - // 鐐瑰嚮鍚庤皟鐢ㄥ脊绐楃粍浠剁殑鏂规硶,寮�鍚脊绐� - getDialogFormVisible() { - this.$refs.popUp.showDialog(); + path: '/manage/test-paper-generation', + }) }, // 寮圭獥 // 鎺ユ敹寮圭獥缁勪欢杩斿洖鐨勮〃鍗曞�� - parentGoods(obj) { - console.log(obj, "寮圭獥缁勪欢鐨勮〃鍗曞��"); + parentGoods (obj) { + console.log(obj, '寮圭獥缁勪欢鐨勮〃鍗曞��') }, }, -}; +} </script> <style scoped lang="scss"> .flex { display: flex; } + // 鍐呭 .content { - width: 1262px; margin-bottom: 80px; background-color: #fff; padding: 20px 40px; border-radius: 10px; } +.item { + margin-right: 5px; +} </style> - diff --git a/src/views/class-management/index.vue b/src/views/class-management/index.vue deleted file mode 100644 index 6b8da30..0000000 --- a/src/views/class-management/index.vue +++ /dev/null @@ -1,12 +0,0 @@ -<template> - <div> - <router-view></router-view> - </div> -</template> - -<script> -export default {}; -</script> - -<style> -</style> diff --git a/src/views/exam/exam/Index.vue b/src/views/exam/exam/Index.vue deleted file mode 100644 index 35175ca..0000000 --- a/src/views/exam/exam/Index.vue +++ /dev/null @@ -1,18 +0,0 @@ -<template> - <div> - <router-view> - - </router-view> - </div> -</template> - -<script> -export default { - created() { - this.$store.commit("SET_HEADER_NUM", 2); - }, -}; -</script> - -<style> -</style> -- Gitblit v1.8.0