Commit 65f592b61bfd8f4bfad9e2a890bc206ea4837774

Authored by 梁保满
1 parent d4283687

答题卡列表页

router 0 → 100644
  1 +[ //测试用,后续后端获取
  2 + {
  3 + path: "/examinationPaper",
  4 + iconCls: "fa fa-file-text", // 图标样式class
  5 + name: "备题组卷",
  6 + component: Layout,
  7 + alone: true,
  8 + children: [
  9 + {
  10 + path: "/examinationPaper",
  11 + iconCls: "fa fa-file-text", // 图标样式class
  12 + name: "",
  13 + component: ExaminationPaper,
  14 + children: []
  15 + },
  16 + {
  17 + path: "/examinationPaperAdd",
  18 + iconCls: "", // 图标样式class
  19 + name: "添加答题卡",
  20 + component: ExaminationPaperAdd,
  21 + children: []
  22 + },
  23 + {
  24 + path: "/examinationPaperEdit",
  25 + iconCls: "", // 图标样式class
  26 + name: "修改答题卡",
  27 + component: ExaminationPaperEdit,
  28 + children: []
  29 + },
  30 + {
  31 + path: "/examinationPaperRecycle",
  32 + iconCls: "", // 图标样式class
  33 + name: "已归档答题卡",
  34 + component: ExaminationPaperRecycle,
  35 + children: []
  36 + },
  37 + ]
  38 + },
  39 + {
  40 + path: "/ask",
  41 + iconCls: "fa fa-bar-chart", // 图标样式class
  42 + name: "随堂问报表",
  43 + component: Layout,
  44 + alone: true,
  45 + children: [
  46 + {
  47 + path: "/ask",
  48 + iconCls: "fa fa-bar-chart", // 图标样式class
  49 + name: "",
  50 + component: Ask,
  51 + children: []
  52 +
  53 + },
  54 + {
  55 + path: "/askAnalysis",
  56 + iconCls: "", // 图标样式class
  57 + name: "随堂问报表分析",
  58 + component: AskAnalysis,
  59 + children: []
  60 + }
  61 + ]
  62 + },
  63 + {
  64 + path: "/test",
  65 + iconCls: "fa fa-pie-chart", // 图标样式class
  66 + name: "即时测报表",
  67 + component: Layout,
  68 + alone: true,
  69 + children: [
  70 + {
  71 + path: "/test",
  72 + iconCls: "fa fa-pie-chart", // 图标样式class
  73 + name: "",
  74 + component: Test,
  75 + children: []
  76 + },
  77 + {
  78 + path: "/testAnalysis",
  79 + iconCls: "", // 图标样式class
  80 + name: "即时测报表分析",
  81 + component: TestAnalysis,
  82 + children: []
  83 + }
  84 +
  85 + ]
  86 + },
  87 + {
  88 + path: "/portrait",
  89 + iconCls: "fa fa-users", // 图标样式class
  90 + name: "学生画像",
  91 + component: Layout,
  92 + alone: true,
  93 + children: [
  94 + {
  95 + path: "/portrait",
  96 + iconCls: "fa fa-users", // 图标样式class
  97 + name: "",
  98 + component: Portrait,
  99 + children: []
  100 + }
  101 + ]
  102 + },
  103 +
  104 + {
  105 + path: "/setUpConglomerate",
  106 + iconCls: "fa fa-building", // 图标样式class
  107 + name: "学校管理",
  108 + component: Layout,
  109 + alone: true,
  110 + children: [
  111 + {
  112 + path: "/setUpConglomerate",
  113 + iconCls: "fa fa-building",
  114 + name: '集团管理',
  115 + component: SetUpConglomerate,
  116 + children: []
  117 + },
  118 + ]
  119 + },
  120 + {
  121 + path: "/setUpAccount",
  122 + iconCls: "fa fa-id-card-o", // 图标样式class
  123 + name: "账号管理",
  124 + component: Layout,
  125 + alone: true,
  126 + children: [
  127 + {
  128 + path: "/setUpAccount",
  129 + iconCls: "fa fa-id-card-o",
  130 + name: '',
  131 + component: SetUpAccount,
  132 + children: []
  133 + },
  134 + ]
  135 + },
  136 + {
  137 + path: "/",
  138 + iconCls: "fa fa-cog",
  139 + name: '学校管理',
  140 + component: Layout,
  141 + children: [
  142 + {
  143 + path: "/setUpSchool",
  144 + iconCls: "fa fa-calculator",
  145 + name: '学校管理',
  146 + component: SetUpSchool,
  147 + children: []
  148 + },
  149 + {
  150 + path: "/setUpTeacher",
  151 + iconCls: "fa fa-male",
  152 + name: '教师管理',
  153 + component: SetUpTeacher,
  154 + children: []
  155 + },
  156 + {
  157 + path: "/setUpStudent",
  158 + iconCls: "fa fa-mortar-board",
  159 + name: '学生管理',
  160 + component: SetUpStudent,
  161 + children: []
  162 + },
  163 + ]
  164 + },
  165 + {
  166 + path: "/card",
  167 + iconCls: "fa fa-id-card", // 图标样式class
  168 + name: "发卡记录",
  169 + component: Layout,
  170 + alone: true,
  171 + children: [
  172 + {
  173 + path: "/card",
  174 + iconCls: "fa fa-id-card", // 图标样式class
  175 + name: "",
  176 + component: Card,
  177 + children: []
  178 + }
  179 + ]
  180 + },
  181 + {
  182 + path: "/device",
  183 + iconCls: "fa fa-dashboard", // 图标样式class
  184 + name: "设备状态",
  185 + component: Layout,
  186 + alone: true,
  187 + children: [
  188 + {
  189 + path: "/device",
  190 + iconCls: "fa fa-dashboard", // 图标样式class
  191 + name: "",
  192 + component: Device,
  193 + children: []
  194 + }
  195 + ]
  196 + },
  197 + {
  198 + path: "/analysis",
  199 + iconCls: "fa fa-area-chart", // 图标样式class
  200 + name: "使用分析",
  201 + component: Layout,
  202 + alone: true,
  203 + children: [
  204 + {
  205 + path: "/analysis",
  206 + iconCls: "fa fa-area-chart", // 图标样式class
  207 + name: "",
  208 + component: Analysis,
  209 + children: []
  210 + }
  211 + ]
  212 + },
  213 + {
  214 + path: "/down",
  215 + iconCls: "fa fa-download", // 图标样式class
  216 + name: "软件下载",
  217 + component: Layout,
  218 + alone: true,
  219 + children: [
  220 + {
  221 + path: "/down",
  222 + iconCls: "fa fa-download", // 图标样式class
  223 + name: "",
  224 + component: Down,
  225 + children: []
  226 + },
  227 + {
  228 + path: "/downClient",
  229 + iconCls: "", // 图标样式class
  230 + name: "",
  231 + component: DownClient,
  232 + children: []
  233 + }
  234 + ]
  235 + },
  236 + {
  237 + path: "/dataSync",
  238 + iconCls: "fa fa-random", // 图标样式class
  239 + name: "数据同步",
  240 + component: Layout,
  241 + alone: true,
  242 + children: [
  243 + {
  244 + path: "/dataSync",
  245 + iconCls: "fa fa-random", // 图标样式class
  246 + name: "",
  247 + component: DataSync,
  248 + children: []
  249 + }
  250 + ]
  251 + },
  252 + {
  253 + path: "*",
  254 + redirect: "/404",
  255 + hidden: true,
  256 + children: []
  257 + }
  258 +]
0 \ No newline at end of file 259 \ No newline at end of file
src/api/apis/answerSheet.js 0 → 100644
  1 +
  2 +import axios from "../axios"
  3 +import answerSheet from "../urls/answerSheet"
  4 +
  5 +export default {
  6 + // 答题卡列表
  7 + fetchAnswerList(data) {
  8 + return axios({
  9 + url: answerSheet.answerList,
  10 + method: 'POST',
  11 + data
  12 + })
  13 + },
  14 + // 答题卡列表
  15 + fetchTypeNames(data) {
  16 + return axios({
  17 + url: answerSheet.typeNames,
  18 + method: 'POST',
  19 + data
  20 + })
  21 + },
  22 + // 答题卡列表
  23 + fetchClassList(data) {
  24 + return axios({
  25 + url: answerSheet.classList,
  26 + method: 'POST',
  27 + data
  28 + })
  29 + },
  30 + // 答题卡列表
  31 + fetchSubjectList(data) {
  32 + return axios({
  33 + url: answerSheet.subjectList,
  34 + method: 'POST',
  35 + data
  36 + })
  37 + },
  38 +}
  39 +
src/api/apis/role.js
@@ -7,17 +7,5 @@ export default { @@ -7,17 +7,5 @@ export default {
7 fetchGetRoleList () { 7 fetchGetRoleList () {
8 return axios.post(roleUrls.getRoleList) 8 return axios.post(roleUrls.getRoleList)
9 }, 9 },
10 - // 增加角色  
11 - fetchAddRole (data) {  
12 - return axios.post(roleUrls.addRole, data)  
13 - },  
14 - // 删除角色  
15 - fetchDelRole (data) {  
16 - return axios.post(roleUrls.delRole, data)  
17 - },  
18 - // 分配角色权限  
19 - fetchRolePermissions (data) {  
20 - return axios.post(roleUrls.rolePermissions, data)  
21 - }  
22 } 10 }
23 11
src/api/apis/user.js deleted
1 -  
2 -import axios from "../axios"  
3 -import userUrls from "../urls/user"  
4 -  
5 -export default {  
6 - // 注册/添加账号  
7 - fetchRegister (data) {  
8 - return axios.post(userUrls.register, data)  
9 - },  
10 - // 删除用户  
11 - fetchDelUser (data) {  
12 - return axios.post(userUrls.delUser, data)  
13 - },  
14 - // 获取用户列表  
15 - fetchUserList (data) {  
16 - return axios.post(userUrls.userList, data)  
17 - },  
18 - // 修改用户信息  
19 - fetchEditUser (data) {  
20 - return axios.post(userUrls.editUser, data)  
21 - },  
22 - // 获取当前用户信息  
23 - fetchGetUserInfo () {  
24 - return axios.get(userUrls.getUserInfo)  
25 - },  
26 - // 获取用户信息  
27 - fetchGetUserInfoId (data) {  
28 - return axios.post(userUrls.getUserInfoId, data)  
29 - },  
30 - // 修改密码  
31 - fetchEditPassword (data) {  
32 - return axios.post(userUrls.editPassword, data)  
33 - }  
34 -}  
35 -  
src/api/axios.js
@@ -2,27 +2,35 @@ import axios from "axios" @@ -2,27 +2,35 @@ import axios from "axios"
2 import Cookies from "js-cookie" 2 import Cookies from "js-cookie"
3 import NProgress from "nprogress" 3 import NProgress from "nprogress"
4 import { Message } from "element-ui" 4 import { Message } from "element-ui"
  5 +import config from "../config/index"; // 路径配置
5 // axios默认配置 6 // axios默认配置
6 -axios.defaults.timeout = 10000 // 超时时间  
7 -axios.defaults.baseURL = process.env.API_HOST 7 +axios.defaults.timeout = 1000000000 // 超时时间
  8 +axios.defaults.baseURL = config.baseURL
8 9
9 // http request 拦截器 10 // http request 拦截器
10 axios.interceptors.request.use(config => { 11 axios.interceptors.request.use(config => {
11 NProgress.start() 12 NProgress.start()
12 config.headers["Content-Type"] = "application/json;charset=UTF-8" 13 config.headers["Content-Type"] = "application/json;charset=UTF-8"
13 - if (Cookies.get("access_token")) {  
14 - config.headers.Authorization = "Bearer" + Cookies.get("access_token")  
15 - } 14 +
  15 + const source = axios.CancelToken.source();
  16 + store.commit('setTokenSources', [source.token, source.cancel])
  17 + config.cancelToken = source.token;
  18 + // if (Cookies.get("access_token")) {
  19 + // config.headers.Authorization = "Bearer" + Cookies.get("access_token")
  20 + // }
16 return config 21 return config
17 }, 22 },
18 -error => {  
19 - return Promise.reject(error.response)  
20 -}) 23 + error => {
  24 + return Promise.reject(error.response)
  25 + })
21 26
22 // http response 拦截器 27 // http response 拦截器
23 axios.interceptors.response.use( 28 axios.interceptors.response.use(
24 response => { 29 response => {
25 NProgress.done() 30 NProgress.done()
  31 + if (respones.config.cancelToken) {
  32 + store.commit('delTokenSources', respones.config.cancelToken)
  33 + }
26 if (response.data.code === 11000) { 34 if (response.data.code === 11000) {
27 Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) 35 Cookies.set("access_token", response.data.message, { expires: 1 / 12 })
28 return Promise.resolve() 36 return Promise.resolve()
src/api/urls/answerSheet.js 0 → 100644
  1 +export default {
  2 + // 答题卡列表
  3 + answerList: "/apis/answerList",
  4 + // 答题卡类型
  5 + typeNames: "/apis/typeNames",
  6 + // 查找班级
  7 + classList: "/apis/classList",
  8 + // 查找科目
  9 + subjectList: "/apis/subjectList",
  10 +}
0 \ No newline at end of file 11 \ No newline at end of file
src/api/urls/role.js
@@ -2,11 +2,5 @@ @@ -2,11 +2,5 @@
2 export default { 2 export default {
3 // 获取角色列表 3 // 获取角色列表
4 getRoleList: "/permissions/getRoleList", 4 getRoleList: "/permissions/getRoleList",
5 - // 增加角色  
6 - addRole: "/permissions/addRole",  
7 - // 删除角色  
8 - delRole: "/permissions/delRole",  
9 - // 分配角色权限  
10 - rolePermissions: "/permissions/rolePermissions"  
11 } 5 }
12 6
src/api/urls/user.js deleted
1 -  
2 -export default {  
3 - // 注册/添加账号  
4 - register: "/admin/user/register",  
5 - // 删除用户  
6 - delUser: "/user/delUser",  
7 - // 修改用户信息  
8 - editUser: "/user/editUserInfo",  
9 - // 获取当前用户信息  
10 - getUserInfo: "/user/getUserInfo",  
11 - // 获取用户信息  
12 - getUserInfoId: "/user/getUserInfoId",  
13 - // 获取用户列表  
14 - userList: "/user/userList",  
15 - // 修改密码  
16 - editPassword: "/user/editPassword"  
17 -}  
src/assets/css/base.css
@@ -2,9 +2,10 @@ @@ -2,9 +2,10 @@
2 margin: 0px; 2 margin: 0px;
3 padding: 0px; 3 padding: 0px;
4 } 4 }
  5 +
5 html, 6 html,
6 body { 7 body {
7 - height:100%; 8 + height: 100%;
8 overflow: hidden; 9 overflow: hidden;
9 background-color: #fff; 10 background-color: #fff;
10 font-size: 14px; 11 font-size: 14px;
@@ -17,4 +18,21 @@ li { @@ -17,4 +18,21 @@ li {
17 18
18 a { 19 a {
19 text-decoration: none; 20 text-decoration: none;
  21 +}
  22 +
  23 +/* element-style */
  24 +.el-button--default{
  25 + color: #667ffd;
  26 + border-color: #667ffd;
  27 +}
  28 +.el-button--primary {
  29 + background-color: #667ffd;
  30 + border-color: #667ffd;
  31 +}
  32 +.el-radio__input.is-checked+.el-radio__label{
  33 + color: #667ffd;
  34 +}
  35 +.el-radio__input.is-checked .el-radio__inner{
  36 + border-color: #667ffd;
  37 + background: #667ffd;
20 } 38 }
21 \ No newline at end of file 39 \ No newline at end of file
src/components/backBox.vue
1 <template> 1 <template>
2 <div class="back"> 2 <div class="back">
3 <div class="back-l" @click="back"> 3 <div class="back-l" @click="back">
  4 + <i class="fa fa-mail-reply-all"></i>
4 <slot name="title"></slot> 5 <slot name="title"></slot>
5 </div> 6 </div>
6 <div class="back-r"> 7 <div class="back-r">
src/store/index.js
@@ -167,13 +167,13 @@ let addrouters = [ //测试用,后续后端获取 @@ -167,13 +167,13 @@ let addrouters = [ //测试用,后续后端获取
167 { 167 {
168 path: "/", 168 path: "/",
169 iconCls: "fa fa-cog", 169 iconCls: "fa fa-cog",
170 - name: '学校管理', 170 + name: '学校设置',
171 component: Layout, 171 component: Layout,
172 children: [ 172 children: [
173 { 173 {
174 path: "/setUpSchool", 174 path: "/setUpSchool",
175 iconCls: "fa fa-calculator", 175 iconCls: "fa fa-calculator",
176 - name: '学校管理', 176 + name: '学校设置',
177 component: SetUpSchool, 177 component: SetUpSchool,
178 children: [] 178 children: []
179 }, 179 },
@@ -251,14 +251,14 @@ let addrouters = [ //测试用,后续后端获取 @@ -251,14 +251,14 @@ let addrouters = [ //测试用,后续后端获取
251 { 251 {
252 path: "/down", 252 path: "/down",
253 iconCls: "fa fa-download", // 图标样式class 253 iconCls: "fa fa-download", // 图标样式class
254 - name: "", 254 + name: "发卡软件",
255 component: Down, 255 component: Down,
256 children: [] 256 children: []
257 }, 257 },
258 { 258 {
259 path: "/downClient", 259 path: "/downClient",
260 iconCls: "", // 图标样式class 260 iconCls: "", // 图标样式class
261 - name: "", 261 + name: "授课端软件",
262 component: DownClient, 262 component: DownClient,
263 children: [] 263 children: []
264 } 264 }
@@ -296,6 +296,7 @@ const store = new Vuex.Store({ @@ -296,6 +296,7 @@ const store = new Vuex.Store({
296 info: "", // 每次刷新都要通过token请求个人信息来筛选动态路由 296 info: "", // 每次刷新都要通过token请求个人信息来筛选动态路由
297 routers: [], 297 routers: [],
298 addRouters: [], 298 addRouters: [],
  299 + tokenSources:new Map(),
299 }, 300 },
300 mutations: { 301 mutations: {
301 setToken(state, token) { 302 setToken(state, token) {
@@ -317,6 +318,16 @@ const store = new Vuex.Store({ @@ -317,6 +318,16 @@ const store = new Vuex.Store({
317 state.addRouters = routers // 保存动态路由用来addRouter 318 state.addRouters = routers // 保存动态路由用来addRouter
318 state.routers = defaultRouter.concat(routers) // 所有有权限的路由表,用来生成菜单列表 319 state.routers = defaultRouter.concat(routers) // 所有有权限的路由表,用来生成菜单列表
319 }, 320 },
  321 + setTokenSources(state,data){
  322 + if(data instanceof Array){
  323 + state.tokenSources.set(data[0], data[1])
  324 + }else{
  325 + state.tokenSources = new Map()
  326 + }
  327 + },
  328 + delTokenSources(state,data){
  329 + state.tokenSources.delete(data)
  330 + },
320 }, 331 },
321 actions: { 332 actions: {
322 Login({ commit }, that) { 333 Login({ commit }, that) {
src/store/modules/layout/index.js
1 1
2 export default { 2 export default {
3 state: { 3 state: {
4 - isCollapse: false,  
5 - logoShow: false, 4 + isCollapse: sessionStorage.getItem('isCollapse') && sessionStorage.getItem('isCollapse') == 1 ? true : false || false,
  5 + logoShow: sessionStorage.getItem('isCollapse') && sessionStorage.getItem('isCollapse') == 1 ? true : false || false,
6 uniquerouter: true, 6 uniquerouter: true,
7 rightNav: {}, 7 rightNav: {},
8 tabnavBox: JSON.parse(sessionStorage.getItem("addTab")) || [{ 8 tabnavBox: JSON.parse(sessionStorage.getItem("addTab")) || [{
@@ -11,7 +11,7 @@ export default { @@ -11,7 +11,7 @@ export default {
11 }] 11 }]
12 }, 12 },
13 mutations: { 13 mutations: {
14 - addTab (state, arg) { 14 + addTab(state, arg) {
15 state.isActive = arg.path 15 state.isActive = arg.path
16 if (state.tabnavBox[0] && state.tabnavBox[0].title !== "home") { 16 if (state.tabnavBox[0] && state.tabnavBox[0].title !== "home") {
17 state.tabnavBox.unshift({ 17 state.tabnavBox.unshift({
@@ -32,10 +32,10 @@ export default { @@ -32,10 +32,10 @@ export default {
32 32
33 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox)) 33 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox))
34 }, 34 },
35 - openMenu (state, arg) { 35 + openMenu(state, arg) {
36 state.rightNav = arg 36 state.rightNav = arg
37 }, 37 },
38 - removeTab (state, arg) { 38 + removeTab(state, arg) {
39 let index = state.tabnavBox.findIndex(function (value, key) { 39 let index = state.tabnavBox.findIndex(function (value, key) {
40 return value.path === arg.tabItem.path 40 return value.path === arg.tabItem.path
41 }) 41 })
@@ -46,7 +46,7 @@ export default { @@ -46,7 +46,7 @@ export default {
46 } 46 }
47 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox)) 47 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox))
48 }, 48 },
49 - removeOtherTab (state, arg) { 49 + removeOtherTab(state, arg) {
50 state.tabnavBox = [{ 50 state.tabnavBox = [{
51 title: "home", 51 title: "home",
52 path: "/index" 52 path: "/index"
@@ -59,8 +59,9 @@ export default { @@ -59,8 +59,9 @@ export default {
59 arg.router.push(arg.tabItem.path) 59 arg.router.push(arg.tabItem.path)
60 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox)) 60 sessionStorage.setItem("addTab", JSON.stringify(state.tabnavBox))
61 }, 61 },
62 - collapse (state, arg) { 62 + collapse(state, arg) {
63 state.isCollapse = !state.isCollapse 63 state.isCollapse = !state.isCollapse
  64 + sessionStorage.setItem('isCollapse', state.isCollapse ? 1 : 0)
64 if (state.logoShow) { 65 if (state.logoShow) {
65 setTimeout(function () { 66 setTimeout(function () {
66 state.logoShow = false 67 state.logoShow = false
@@ -71,19 +72,19 @@ export default { @@ -71,19 +72,19 @@ export default {
71 } 72 }
72 }, 73 },
73 actions: { 74 actions: {
74 - addTab ({commit}, arg) { 75 + addTab({ commit }, arg) {
75 commit("addTab", arg) 76 commit("addTab", arg)
76 }, 77 },
77 - openMenu ({commit}, arg) { 78 + openMenu({ commit }, arg) {
78 commit("openMenu", arg) 79 commit("openMenu", arg)
79 }, 80 },
80 - removeTab ({commit}, arg) { 81 + removeTab({ commit }, arg) {
81 commit("removeTab", arg) 82 commit("removeTab", arg)
82 }, 83 },
83 - removeOtherTab ({commit}, arg) { 84 + removeOtherTab({ commit }, arg) {
84 commit("removeOtherTab", arg) 85 commit("removeOtherTab", arg)
85 }, 86 },
86 - collapse ({commit}, arg) { 87 + collapse({ commit }, arg) {
87 commit("collapse", arg) 88 commit("collapse", arg)
88 } 89 }
89 } 90 }
src/views/examinationPaper/edit.vue
1 <template> 1 <template>
2 - <div>修改答案</div> 2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>修改答案</span>
  6 + </template>
  7 + </back-box>
  8 + </div>
3 </template> 9 </template>
4 10
5 <script> 11 <script>
6 -export default {  
7 -  
8 -} 12 +export default {};
9 </script> 13 </script>
10 14
11 <style> 15 <style>
12 -  
13 </style> 16 </style>
14 \ No newline at end of file 17 \ No newline at end of file
src/views/examinationPaper/index.vue
@@ -2,28 +2,562 @@ @@ -2,28 +2,562 @@
2 <div> 2 <div>
3 <back-box> 3 <back-box>
4 <template slot="title"> 4 <template slot="title">
5 - <i class="fa fa-mail-reply-all"></i>  
6 <span>备题组卷</span> 5 <span>备题组卷</span>
7 </template> 6 </template>
8 <template slot="btns"> 7 <template slot="btns">
9 - 8 + <el-tooltip effect="dark" content="创建答题卡" placement="left">
  9 + <el-button
  10 + type="primary"
  11 + icon="el-icon-plus"
  12 + plain
  13 + circle
  14 + @click="toAdd"
  15 + ></el-button>
  16 + </el-tooltip>
10 </template> 17 </template>
11 </back-box> 18 </back-box>
12 - <div class="content">  
13 - <router-link to="/examinationPaperAdd">添加答题卡</router-link>  
14 - <router-link to="/examinationPaperRecycle">已归档答题卡</router-link>  
15 - <router-link to="/examinationPaperEdit">修改答案</router-link> 19 +
  20 + <div class="answer-header">
  21 + <div class="sel-box">
  22 + <el-select
  23 + class="sel"
  24 + v-model="query.clazzId"
  25 + placeholder="选择班级"
  26 + @change="changClazz"
  27 + >
  28 + <el-option
  29 + v-for="item in classList"
  30 + :key="item.value"
  31 + :label="item.label"
  32 + :value="item.value"
  33 + >{{ item.label }}
  34 + </el-option>
  35 + </el-select>
  36 + <el-select
  37 + class="sel"
  38 + v-model="query.subjectId"
  39 + placeholder="选择科目"
  40 + @change="_QueryData()"
  41 + >
  42 + <el-option
  43 + v-for="item in subjectList"
  44 + :key="item.value"
  45 + :label="item.label"
  46 + :value="item.value"
  47 + >
  48 + </el-option>
  49 + </el-select>
  50 + <el-select
  51 + class="sel"
  52 + v-model="query.typeName"
  53 + placeholder="选择类型"
  54 + @change="_QueryData()"
  55 + >
  56 + <el-option
  57 + v-for="item in typeList"
  58 + :key="item"
  59 + :label="item"
  60 + :value="item"
  61 + >{{ item }}
  62 + </el-option>
  63 + </el-select>
  64 + <el-input
  65 + placeholder="试卷名称"
  66 + v-model="query.title"
  67 + class="input-with-select"
  68 + @keyup.enter.native="_QueryData(true)"
  69 + >
  70 + <el-button
  71 + slot="append"
  72 + icon="el-icon-search"
  73 + @click="_QueryData(true)"
  74 + ></el-button>
  75 + </el-input>
  76 + </div>
16 </div> 77 </div>
  78 + <p class="tips">
  79 + <span>另有25份已经归档的答题卡,</span>
  80 + <router-link to="/examinationPaperRecycle">点击查看&gt;&gt;</router-link>
  81 + </p>
  82 + <ul class="content">
  83 + <li class="item" v-for="item in tableData" :key="item.id">
  84 + <div class="pic-box">
  85 + <p class="i-box"><i class="fa fa-map-o"></i></p>
  86 + <p class="ids">{{ item.id }}</p>
  87 + </div>
  88 + <div class="info">
  89 + <p class="title">
  90 + {{ item.title }} <span class="label">{{ item.typeName }}</span>
  91 + </p>
  92 + <p class="num">
  93 + 总题数:{{ item.answerNum }}
  94 + <em class="s-line">|</em>
  95 + 预计时长:{{ item.time }}
  96 + <em class="s-line">|</em>
  97 + 授课端同步:
  98 + <span
  99 + class="clazz"
  100 + v-for="(clazzChild, indexs) in item.aboutClazz"
  101 + :key="clazzChild"
  102 + >{{
  103 + `${clazzChild}班${
  104 + indexs != item.aboutClazz.length - 1 ? "、" : ""
  105 + }`
  106 + }}
  107 + <i class="el-icon-success"></i
  108 + ></span>
  109 + </p>
  110 + <p class="person">
  111 + {{ item.teacher }}<em class="s-line">|</em
  112 + ><span class="date">{{ item.date }}</span>
  113 + </p>
  114 + </div>
  115 + <div class="btn-box">
  116 + <el-tooltip effect="dark" content="修改答案" placement="bottom">
  117 + <el-button
  118 + class="edit"
  119 + type="primary"
  120 + size="mini"
  121 + circle
  122 + icon="el-icon-edit"
  123 + @click="toEdit(item)"
  124 + ></el-button>
  125 + </el-tooltip>
  126 + <el-dropdown
  127 + trigger="click"
  128 + @command="handleDropdownClick($event, item)"
  129 + >
  130 + <el-button
  131 + type="info"
  132 + size="mini"
  133 + circle
  134 + icon="el-icon-more"
  135 + ></el-button>
  136 + <el-dropdown-menu slot="dropdown">
  137 + <el-dropdown-item :command="1">授课端同步</el-dropdown-item>
  138 + <el-dropdown-item :command="2">修改分享范围</el-dropdown-item>
  139 + <el-dropdown-item :command="3">复制</el-dropdown-item>
  140 + <el-dropdown-item :command="4">归档</el-dropdown-item>
  141 + </el-dropdown-menu>
  142 + </el-dropdown>
  143 + </div>
  144 + </li>
  145 + </ul>
  146 + <el-dialog title="选择分享范围" :visible.sync="dialogVisible" width="400">
  147 + <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px">
  148 + <el-form-item label="适用年级:">
  149 + <el-col :span="11">
  150 + <el-input v-model="shareForm.grade"></el-input>
  151 + </el-col>
  152 + </el-form-item>
  153 + <el-form-item prop="share" label="分享范围:">
  154 + <el-radio-group v-model="shareForm.share">
  155 + <el-radio :label="1">任课班级分享</el-radio>
  156 + <el-radio :label="2">全年级分享</el-radio>
  157 + </el-radio-group>
  158 + </el-form-item>
  159 + </el-form>
  160 + <div slot="footer" class="dialog-footer">
  161 + <el-button type="primary" @click="saveShare">确 定</el-button>
  162 + <el-button @click="dialogVisible = false">取 消</el-button>
  163 + </div>
  164 + </el-dialog>
17 </div> 165 </div>
18 </template> 166 </template>
19 167
20 <script> 168 <script>
21 export default { 169 export default {
22 name: "examinationPaper", 170 name: "examinationPaper",
  171 + data() {
  172 + return {
  173 + dialogVisible: false,
  174 + query: {
  175 + clazzId: "2003",
  176 + subjectId: "0",
  177 + typeName: "周测",
  178 + title: "",
  179 + },
  180 + classList: [
  181 + {
  182 + label: "2003班",
  183 + value: "2003",
  184 + },
  185 + ],
  186 + subjectList: [
  187 + {
  188 + label: "语文",
  189 + value: "0",
  190 + },
  191 + ],
  192 + typeList: ["周测"],
  193 + tableData: [
  194 + {
  195 + title: "数学样例试卷202211-324654",
  196 + id: "1062837",
  197 + typeName: "周测",
  198 + answerNum: 45,
  199 + time: 90,
  200 + aboutClazz: [203, 204],
  201 + teacher: "张老师",
  202 + date: "2022-11-04 18:09:49",
  203 + share: 1,
  204 + },
  205 + {
  206 + title: "数学样例试卷202211-4180949",
  207 + id: "1062838",
  208 + typeName: "周测",
  209 + answerNum: 45,
  210 + time: 90,
  211 + aboutClazz: [203, 204],
  212 + teacher: "张老师",
  213 + date: "2022-11-04 18:09:49",
  214 + share: 1,
  215 + },
  216 + ],
  217 + shareForm: {
  218 + id: "",
  219 + grade: "",
  220 + share: 1,
  221 + },
  222 + shareRulesForm: {
  223 + share: [{ required: true, message: "选择分享范围", trigger: "blur" }],
  224 + },
  225 + };
  226 + },
  227 + methods: {
  228 + toAdd(query) {
  229 + this.$router.push({
  230 + path: "/examinationPaperAdd",
  231 + query:query&&{...query}
  232 + });
  233 + },
  234 + toEdit(item) {
  235 + this.$router.push({
  236 + path: "/examinationPaperEdit",
  237 + query: {
  238 + id: item.id,
  239 + },
  240 + });
  241 + },
  242 + handleDropdownClick(value, item) {//更多
  243 + const that = this;
  244 + switch (value) {
  245 + case 1:
  246 + //授课端同步
  247 + that.syncMeg(item)
  248 + break;
  249 + case 2:
  250 + //修改分享范围
  251 + that.shareForm.id = item.id;
  252 + that.shareForm.grade = item.grade;
  253 + that.shareForm.share = item.share || 1;
  254 + that.dialogVisible = true;
  255 + break;
  256 + case 3:
  257 + //复制
  258 + that.toAdd()
  259 + break;
  260 + case 4:
  261 + //归档
  262 + that.recovery(item)
  263 + break;
  264 + }
  265 + },
  266 + async syncMeg() {//同步
  267 + // const { data, code, message } = await this.$request.fetchAnswerList({
  268 + // ...this.shareForm,
  269 + // });
  270 + // this.loading = false;
  271 + // if (code === 0) {
  272 + this.$message.success("已同步");
  273 + // } else {
  274 + // this.$message.error(message);
  275 + // }
  276 + },
  277 + async saveShare() {//修改分享范围
  278 + // const { data, code, message } = await this.$request.fetchAnswerList({
  279 + // ...this.shareForm,
  280 + // });
  281 + // this.loading = false;
  282 + // if (code === 0) {
  283 + this.shareForm.id = "";
  284 + this.shareForm.grade = "";
  285 + this.shareForm.share = 1;
  286 + dialogVisible = false;
  287 + // } else {
  288 + // this.$message.error(message);
  289 + // }
  290 + },
  291 + async recovery(item) {//归档
  292 + // const { data, code, message } = await this.$request.fetchAnswerList({
  293 + // ...this.shareForm,
  294 + // });
  295 + // if (code === 0) {
  296 + this.tableData = this.tableData.filter(items=>{
  297 + return items.id != item.id
  298 + })
  299 + // } else {
  300 + // this.$message.error(message);
  301 + // }
  302 + },
  303 +
  304 + async changClazz() {//切换班级
  305 + await this._QuerySubjectList();
  306 + this._QueryData();
  307 + },
  308 + // 查找答题卡类型
  309 + async _QueryTypeList() {
  310 + const { data, code, message } = await this.$request.fetchTypeNames();
  311 + if (code === 0) {
  312 + this.typeList = [...data.typeNames] || [];
  313 + } else {
  314 + this.$message.error(message);
  315 + }
  316 + },
  317 + // 查找班级
  318 + async _QueryClassList() {
  319 + const { data, code, message } = await this.$request.fetchClassList();
  320 + if (code === 0) {
  321 + if (!!data.list) {
  322 + this.classList = data.list.map((item) => {
  323 + return {
  324 + value: item.clazzId,
  325 + label: item.clazzName,
  326 + };
  327 + });
  328 + this.query.clazzId = this.classList[0]?.value;
  329 + }
  330 + } else {
  331 + this.$message.error(message);
  332 + }
  333 + },
  334 + // 查找科目
  335 + async _QuerySubjectList() {
  336 + const { data, code, message } = await this.$request.fetchSubjectList({
  337 + clazzId: this.query.clazzId,
  338 + });
  339 + if (code === 0) {
  340 + this.subjectList = data.list.map((item) => {
  341 + return {
  342 + value: item.subjectId,
  343 + label: item.subjectName,
  344 + };
  345 + });
  346 + this.query.clazzId = this.subjectList[0]?.value;
  347 + } else {
  348 + this.$message.error(message);
  349 + }
  350 + },
  351 + async _QueryData(type) {//获取答题卡列表
  352 + let query = {};
  353 + if (!type) {
  354 + this.query.title = "";
  355 + query = { ...this.query };
  356 + } else {
  357 + query = { title: this.query.title };
  358 + this.query.typeName = "";
  359 + this.query.subjectId = "";
  360 + }
  361 + query.clazzId = this.query.clazzId;
  362 + for (let key in query) {
  363 + if (!query[key]) {
  364 + query[key] = null;
  365 + }
  366 + }
  367 + if (!query.clazzId) {
  368 + this.total = 0;
  369 + this.tableData = [];
  370 + this.loading = false;
  371 + return;
  372 + }
  373 + this.loading = true;
  374 + const { data, code, message } = await this.$request.fetchAnswerList({
  375 + ...query,
  376 + });
  377 + this.loading = false;
  378 + if (code === 0) {
  379 + this.total = data.total;
  380 + this.tableData = (data.list && [...data.list]) || [];
  381 + } else {
  382 + this.$message.error(message);
  383 + }
  384 + },
  385 + },
23 }; 386 };
24 </script> 387 </script>
25 388
26 <style scoped lang="scss"> 389 <style scoped lang="scss">
27 -.container { 390 +.answer-header {
  391 + padding: 16px 40px 12px 20px;
  392 + display: flex;
  393 + justify-content: space-between;
  394 + align-items: center;
  395 + .btn-box {
  396 + display: flex;
  397 + }
  398 +}
  399 +.sel-box {
  400 + display: flex;
  401 + align-items: center;
  402 + flex-wrap: nowrap;
  403 + .sel {
  404 + width: 8%;
  405 + min-width: 90px;
  406 + margin-right: 20px;
  407 + }
  408 + :deep(.el-input__inner) {
  409 + border-radius: 20px;
  410 + border: 1px solid #e2e2e2;
  411 + height: 36px;
  412 + line-height: 34px;
  413 + }
  414 + :deep(.el-input__icon) {
  415 + line-height: 34px;
  416 + }
  417 + :deep(.el-date-editor.el-input),
  418 + :deep(.el-date-editor.el-input__inner) {
  419 + width: 200px;
  420 + }
  421 + .input-with-select {
  422 + width: 200px;
  423 + height: 36px;
  424 + margin-right: 50px;
  425 + border-radius: 20px;
  426 + border: 1px solid #e2e2e2;
  427 + box-sizing: border-box;
  428 + :deep(.el-input__inner) {
  429 + border-radius: 20px;
  430 + border: none;
  431 + height: 34px;
  432 + line-height: 34px;
  433 + }
  434 + :deep(.el-input-group__append, .el-input-group__prepend) {
  435 + border: none;
  436 + background: transparent;
  437 + }
  438 + }
  439 + .d1 {
  440 + margin-left: 30px;
  441 + }
  442 + .p1 {
  443 + flex: 1;
  444 + .s1 {
  445 + margin-left: 36px;
  446 + cursor: pointer;
  447 + color: #7f7f7f;
  448 + &:hover {
  449 + color: #409eff;
  450 + }
  451 + &.active {
  452 + color: #667ffd;
  453 + }
  454 + }
  455 + }
  456 +}
  457 +.tips {
  458 + display: flex;
  459 + padding-left: 30px;
  460 + line-height: 16px;
  461 + font-size: 14px;
  462 + color: #999;
  463 + margin-bottom: 10px;
  464 +}
  465 +.content {
  466 + margin: 0 20px;
  467 + background: #f8f8f8;
  468 + padding: 12px;
  469 + border-radius: 20px;
  470 + .item {
  471 + display: flex;
  472 + align-items: center;
  473 + width: 100%;
  474 + overflow: hidden;
  475 + box-sizing: border-box;
  476 + padding: 12px;
  477 + border-radius: 20px;
  478 + background: #fff;
  479 + margin-bottom: 12px;
  480 + &:last-of-type {
  481 + margin-bottom: 0;
  482 + }
  483 + .pic-box {
  484 + width: 80px;
  485 + height: 80px;
  486 + border-radius: 10px;
  487 + margin-right: 10px;
  488 + flex-shrink: 0;
  489 + background: #667ffd;
  490 + text-align: center;
  491 + color: #fff;
  492 + font-weight: 500;
  493 + .i-box {
  494 + padding-top: 10px;
  495 + font-size: 32px;
  496 + margin-bottom: 3px;
  497 + }
  498 + }
  499 + .info {
  500 + height: 80px;
  501 + flex: 1;
  502 + overflow: hidden;
  503 + display: flex;
  504 + flex-direction: column;
  505 + justify-content: space-between;
  506 + .s-line {
  507 + padding: 0 5px;
  508 + color: #e2e2e2;
  509 + }
  510 + .title {
  511 + font-size: 16px;
  512 + color: #222;
  513 + font-weight: 500;
  514 + .label {
  515 + display: inline-block;
  516 + font-size: 12px;
  517 + color: #2e9afe;
  518 + line-height: 16px;
  519 + padding: 0 10px;
  520 + border: 1px solid #2e9afe;
  521 + border-radius: 10px;
  522 + transform: translateY(-2px);
  523 + }
  524 + }
  525 + .person {
  526 + color: #666;
  527 + }
  528 + }
  529 + .clazz {
  530 + font-size: 16px;
  531 + color: #667ffd;
  532 + font-weight: 500;
  533 + position: relative;
  534 + margin-right: 8px;
  535 + .el-icon-success {
  536 + position: absolute;
  537 + right: 0;
  538 + top: -5px;
  539 + color: #667ffd;
  540 + }
  541 + &:last-of-type {
  542 + .el-icon-success {
  543 + right: -18px;
  544 + }
  545 + }
  546 + }
  547 + .btn-box {
  548 + flex-shrink: 0;
  549 + .edit {
  550 + margin-right: 12px;
  551 + }
  552 + }
  553 + }
  554 +}
  555 +.dialog-footer {
  556 + text-align: center;
  557 + :deep(.el-button) {
  558 + border-radius: 20px;
  559 + padding: 8px 20px 7px;
  560 + margin: 0 12px;
  561 + }
28 } 562 }
29 </style> 563 </style>
30 \ No newline at end of file 564 \ No newline at end of file
src/views/examinationPaper/recycle.vue
1 <template> 1 <template>
2 - <div>归档</div> 2 + <div>
  3 + <back-box>
  4 + <template slot="title">
  5 + <span>归档</span>
  6 + </template>
  7 + </back-box>
  8 + </div>
3 </template> 9 </template>
4 10
5 <script> 11 <script>
src/views/layout/header/header.vue
@@ -81,9 +81,12 @@ export default { @@ -81,9 +81,12 @@ export default {
81 dialogPassVisible: false, 81 dialogPassVisible: false,
82 title: "", 82 title: "",
83 userId: "", 83 userId: "",
84 - isCollapse:false 84 + isCollapse:false,
85 }; 85 };
86 }, 86 },
  87 + created(){
  88 + this.isCollapse = this.$store.getters.isCollapse
  89 + },
87 methods: { 90 methods: {
88 collapse() { 91 collapse() {
89 this.isCollapse = !this.isCollapse 92 this.isCollapse = !this.isCollapse