diff --git a/router b/router new file mode 100644 index 0000000..592aad7 --- /dev/null +++ b/router @@ -0,0 +1,258 @@ +[ //测试用,后续后端获取 + { + path: "/examinationPaper", + iconCls: "fa fa-file-text", // 图标样式class + name: "备题组卷", + component: Layout, + alone: true, + children: [ + { + path: "/examinationPaper", + iconCls: "fa fa-file-text", // 图标样式class + name: "", + component: ExaminationPaper, + children: [] + }, + { + path: "/examinationPaperAdd", + iconCls: "", // 图标样式class + name: "添加答题卡", + component: ExaminationPaperAdd, + children: [] + }, + { + path: "/examinationPaperEdit", + iconCls: "", // 图标样式class + name: "修改答题卡", + component: ExaminationPaperEdit, + children: [] + }, + { + path: "/examinationPaperRecycle", + iconCls: "", // 图标样式class + name: "已归档答题卡", + component: ExaminationPaperRecycle, + children: [] + }, + ] + }, + { + path: "/ask", + iconCls: "fa fa-bar-chart", // 图标样式class + name: "随堂问报表", + component: Layout, + alone: true, + children: [ + { + path: "/ask", + iconCls: "fa fa-bar-chart", // 图标样式class + name: "", + component: Ask, + children: [] + + }, + { + path: "/askAnalysis", + iconCls: "", // 图标样式class + name: "随堂问报表分析", + component: AskAnalysis, + children: [] + } + ] + }, + { + path: "/test", + iconCls: "fa fa-pie-chart", // 图标样式class + name: "即时测报表", + component: Layout, + alone: true, + children: [ + { + path: "/test", + iconCls: "fa fa-pie-chart", // 图标样式class + name: "", + component: Test, + children: [] + }, + { + path: "/testAnalysis", + iconCls: "", // 图标样式class + name: "即时测报表分析", + component: TestAnalysis, + children: [] + } + + ] + }, + { + path: "/portrait", + iconCls: "fa fa-users", // 图标样式class + name: "学生画像", + component: Layout, + alone: true, + children: [ + { + path: "/portrait", + iconCls: "fa fa-users", // 图标样式class + name: "", + component: Portrait, + children: [] + } + ] + }, + + { + path: "/setUpConglomerate", + iconCls: "fa fa-building", // 图标样式class + name: "学校管理", + component: Layout, + alone: true, + children: [ + { + path: "/setUpConglomerate", + iconCls: "fa fa-building", + name: '集团管理', + component: SetUpConglomerate, + children: [] + }, + ] + }, + { + path: "/setUpAccount", + iconCls: "fa fa-id-card-o", // 图标样式class + name: "账号管理", + component: Layout, + alone: true, + children: [ + { + path: "/setUpAccount", + iconCls: "fa fa-id-card-o", + name: '', + component: SetUpAccount, + children: [] + }, + ] + }, + { + path: "/", + iconCls: "fa fa-cog", + name: '学校管理', + component: Layout, + children: [ + { + path: "/setUpSchool", + iconCls: "fa fa-calculator", + name: '学校管理', + component: SetUpSchool, + children: [] + }, + { + path: "/setUpTeacher", + iconCls: "fa fa-male", + name: '教师管理', + component: SetUpTeacher, + children: [] + }, + { + path: "/setUpStudent", + iconCls: "fa fa-mortar-board", + name: '学生管理', + component: SetUpStudent, + children: [] + }, + ] + }, + { + path: "/card", + iconCls: "fa fa-id-card", // 图标样式class + name: "发卡记录", + component: Layout, + alone: true, + children: [ + { + path: "/card", + iconCls: "fa fa-id-card", // 图标样式class + name: "", + component: Card, + children: [] + } + ] + }, + { + path: "/device", + iconCls: "fa fa-dashboard", // 图标样式class + name: "设备状态", + component: Layout, + alone: true, + children: [ + { + path: "/device", + iconCls: "fa fa-dashboard", // 图标样式class + name: "", + component: Device, + children: [] + } + ] + }, + { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "使用分析", + component: Layout, + alone: true, + children: [ + { + path: "/analysis", + iconCls: "fa fa-area-chart", // 图标样式class + name: "", + component: Analysis, + children: [] + } + ] + }, + { + path: "/down", + iconCls: "fa fa-download", // 图标样式class + name: "软件下载", + component: Layout, + alone: true, + children: [ + { + path: "/down", + iconCls: "fa fa-download", // 图标样式class + name: "", + component: Down, + children: [] + }, + { + path: "/downClient", + iconCls: "", // 图标样式class + name: "", + component: DownClient, + children: [] + } + ] + }, + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "数据同步", + component: Layout, + alone: true, + children: [ + { + path: "/dataSync", + iconCls: "fa fa-random", // 图标样式class + name: "", + component: DataSync, + children: [] + } + ] + }, + { + path: "*", + redirect: "/404", + hidden: true, + children: [] + } +] \ No newline at end of file diff --git a/src/api/apis/answerSheet.js b/src/api/apis/answerSheet.js new file mode 100644 index 0000000..9ae8d29 --- /dev/null +++ b/src/api/apis/answerSheet.js @@ -0,0 +1,39 @@ + +import axios from "../axios" +import answerSheet from "../urls/answerSheet" + +export default { + // 答题卡列表 + fetchAnswerList(data) { + return axios({ + url: answerSheet.answerList, + method: 'POST', + data + }) + }, + // 答题卡列表 + fetchTypeNames(data) { + return axios({ + url: answerSheet.typeNames, + method: 'POST', + data + }) + }, + // 答题卡列表 + fetchClassList(data) { + return axios({ + url: answerSheet.classList, + method: 'POST', + data + }) + }, + // 答题卡列表 + fetchSubjectList(data) { + return axios({ + url: answerSheet.subjectList, + method: 'POST', + data + }) + }, +} + diff --git a/src/api/apis/role.js b/src/api/apis/role.js index 71e6782..4c9ba1e 100644 --- a/src/api/apis/role.js +++ b/src/api/apis/role.js @@ -7,17 +7,5 @@ export default { fetchGetRoleList () { return axios.post(roleUrls.getRoleList) }, - // 增加角色 - fetchAddRole (data) { - return axios.post(roleUrls.addRole, data) - }, - // 删除角色 - fetchDelRole (data) { - return axios.post(roleUrls.delRole, data) - }, - // 分配角色权限 - fetchRolePermissions (data) { - return axios.post(roleUrls.rolePermissions, data) - } } diff --git a/src/api/apis/user.js b/src/api/apis/user.js deleted file mode 100644 index d1483cc..0000000 --- a/src/api/apis/user.js +++ /dev/null @@ -1,35 +0,0 @@ - -import axios from "../axios" -import userUrls from "../urls/user" - -export default { - // 注册/添加账号 - fetchRegister (data) { - return axios.post(userUrls.register, data) - }, - // 删除用户 - fetchDelUser (data) { - return axios.post(userUrls.delUser, data) - }, - // 获取用户列表 - fetchUserList (data) { - return axios.post(userUrls.userList, data) - }, - // 修改用户信息 - fetchEditUser (data) { - return axios.post(userUrls.editUser, data) - }, - // 获取当前用户信息 - fetchGetUserInfo () { - return axios.get(userUrls.getUserInfo) - }, - // 获取用户信息 - fetchGetUserInfoId (data) { - return axios.post(userUrls.getUserInfoId, data) - }, - // 修改密码 - fetchEditPassword (data) { - return axios.post(userUrls.editPassword, data) - } -} - diff --git a/src/api/axios.js b/src/api/axios.js index 384ce91..86804dc 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -2,27 +2,35 @@ import axios from "axios" import Cookies from "js-cookie" import NProgress from "nprogress" import { Message } from "element-ui" +import config from "../config/index"; // 路径配置 // axios默认配置 -axios.defaults.timeout = 10000 // 超时时间 -axios.defaults.baseURL = process.env.API_HOST +axios.defaults.timeout = 1000000000 // 超时时间 +axios.defaults.baseURL = config.baseURL // http request 拦截器 axios.interceptors.request.use(config => { NProgress.start() config.headers["Content-Type"] = "application/json;charset=UTF-8" - if (Cookies.get("access_token")) { - config.headers.Authorization = "Bearer" + Cookies.get("access_token") - } + + const source = axios.CancelToken.source(); + store.commit('setTokenSources', [source.token, source.cancel]) + config.cancelToken = source.token; + // if (Cookies.get("access_token")) { + // config.headers.Authorization = "Bearer" + Cookies.get("access_token") + // } return config }, -error => { - return Promise.reject(error.response) -}) + error => { + return Promise.reject(error.response) + }) // http response 拦截器 axios.interceptors.response.use( response => { NProgress.done() + if (respones.config.cancelToken) { + store.commit('delTokenSources', respones.config.cancelToken) + } if (response.data.code === 11000) { Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) return Promise.resolve() diff --git a/src/api/urls/answerSheet.js b/src/api/urls/answerSheet.js new file mode 100644 index 0000000..cf3806d --- /dev/null +++ b/src/api/urls/answerSheet.js @@ -0,0 +1,10 @@ +export default { + // 答题卡列表 + answerList: "/apis/answerList", + // 答题卡类型 + typeNames: "/apis/typeNames", + // 查找班级 + classList: "/apis/classList", + // 查找科目 + subjectList: "/apis/subjectList", +} \ No newline at end of file diff --git a/src/api/urls/role.js b/src/api/urls/role.js index 3c971c0..a9aeaba 100644 --- a/src/api/urls/role.js +++ b/src/api/urls/role.js @@ -2,11 +2,5 @@ export default { // 获取角色列表 getRoleList: "/permissions/getRoleList", - // 增加角色 - addRole: "/permissions/addRole", - // 删除角色 - delRole: "/permissions/delRole", - // 分配角色权限 - rolePermissions: "/permissions/rolePermissions" } diff --git a/src/api/urls/user.js b/src/api/urls/user.js deleted file mode 100644 index fa3ea4f..0000000 --- a/src/api/urls/user.js +++ /dev/null @@ -1,17 +0,0 @@ - -export default { - // 注册/添加账号 - register: "/admin/user/register", - // 删除用户 - delUser: "/user/delUser", - // 修改用户信息 - editUser: "/user/editUserInfo", - // 获取当前用户信息 - getUserInfo: "/user/getUserInfo", - // 获取用户信息 - getUserInfoId: "/user/getUserInfoId", - // 获取用户列表 - userList: "/user/userList", - // 修改密码 - editPassword: "/user/editPassword" -} diff --git a/src/assets/css/base.css b/src/assets/css/base.css index ca347da..965708b 100644 --- a/src/assets/css/base.css +++ b/src/assets/css/base.css @@ -2,9 +2,10 @@ margin: 0px; padding: 0px; } + html, body { - height:100%; + height: 100%; overflow: hidden; background-color: #fff; font-size: 14px; @@ -17,4 +18,21 @@ li { a { text-decoration: none; +} + +/* element-style */ +.el-button--default{ + color: #667ffd; + border-color: #667ffd; +} +.el-button--primary { + background-color: #667ffd; + border-color: #667ffd; +} +.el-radio__input.is-checked+.el-radio__label{ + color: #667ffd; +} +.el-radio__input.is-checked .el-radio__inner{ + border-color: #667ffd; + background: #667ffd; } \ No newline at end of file diff --git a/src/components/backBox.vue b/src/components/backBox.vue index 2d3a4bc..4681344 100644 --- a/src/components/backBox.vue +++ b/src/components/backBox.vue @@ -1,6 +1,7 @@ \ No newline at end of file diff --git a/src/views/examinationPaper/recycle.vue b/src/views/examinationPaper/recycle.vue index 252625d..45d8c96 100644 --- a/src/views/examinationPaper/recycle.vue +++ b/src/views/examinationPaper/recycle.vue @@ -1,5 +1,11 @@