dev_2022-05-11
yujialong 3 years ago
parent 245397841c
commit 9eed74a3b5
  1. 25
      src/App.vue
  2. 149
      src/api/index.js
  3. 77
      src/components/pdf/index.vue
  4. 136
      src/components/quill/index.vue
  5. 30
      src/components/quill/options.js
  6. 40
      src/i18n/index.js
  7. 25
      src/layouts/footer/index.vue
  8. 47
      src/layouts/header/index.vue
  9. 46
      src/layouts/home/index.vue
  10. 110
      src/layouts/navbar/index.vue
  11. 25
      src/libs/auth/generateBtnPermission.js
  12. 2
      src/libs/bus.js
  13. 6
      src/libs/random_str.js
  14. 18
      src/libs/resize/index.js
  15. 34
      src/libs/route/addRoutes.js
  16. 32
      src/libs/route/generateRoutes.js
  17. 8
      src/libs/route/resetRouter.js
  18. 12
      src/libs/util.cookies.js
  19. 14
      src/libs/util.db.js
  20. 246
      src/libs/util.js
  21. 40
      src/main.js
  22. 4
      src/mixins/app.js
  23. 6
      src/mixins/setBackground/index.js
  24. 111
      src/pages/account/login/index.vue
  25. 233
      src/pages/achievement/ass/index.vue
  26. 185
      src/pages/achievement/edit/index.vue
  27. 301
      src/pages/achievement/list/index.vue
  28. 323
      src/pages/achievement/show/index.vue
  29. 305
      src/pages/achievement/teach/index.vue
  30. 260
      src/pages/achievement/vir/index.vue
  31. 680
      src/pages/assessment/add/index.vue
  32. 328
      src/pages/assessment/list/index.vue
  33. 105
      src/pages/course/courseManagement/add.vue
  34. 388
      src/pages/course/courseManagement/contentSettings.vue
  35. 82
      src/pages/course/courseManagement/index.vue
  36. 174
      src/pages/course/courseManagement/preview.vue
  37. 28
      src/pages/course/index.vue
  38. 80
      src/pages/course/sortManagement/index.vue
  39. 428
      src/pages/evaluation/list/index.vue
  40. 37
      src/pages/exception/error/403/index.vue
  41. 37
      src/pages/exception/error/404/index.vue
  42. 33
      src/pages/exception/i18n/index.vue
  43. 291
      src/pages/exception/icon/index.vue
  44. 127
      src/pages/information/columnManage/index.vue
  45. 167
      src/pages/information/contentManage/addArticle.vue
  46. 159
      src/pages/information/contentManage/contentList.vue
  47. 22
      src/pages/information/contentManage/index.vue
  48. 18
      src/pages/information/index.vue
  49. 220
      src/pages/match/add.vue
  50. 205
      src/pages/match/index.vue
  51. 25
      src/pages/match/manage/index.vue
  52. 271
      src/pages/match/manage/matchDetail.vue
  53. 114
      src/pages/match/manage/matchProgress.vue
  54. 100
      src/pages/match/manage/matchSignup.vue
  55. 7
      src/pages/project/add/index.vue
  56. 101
      src/pages/project/list/index.vue
  57. 875
      src/pages/setting/person/index.vue
  58. 1148
      src/pages/student/list/index.vue
  59. 45
      src/pages/system/list/index.vue
  60. 234
      src/pages/system/list/role.vue
  61. 866
      src/pages/system/list/staff.vue
  62. 371
      src/pages/system/list/staffSide.vue
  63. 115
      src/pages/system/list/stafftree.vue
  64. 22
      src/plugins/auth/index.js
  65. 6
      src/plugins/filters/index.js
  66. 12
      src/plugins/index.js
  67. 148
      src/plugins/requests/index.js
  68. 16
      src/plugins/throttle/index.js
  69. 8
      src/router/index.js
  70. 40
      src/router/modules/achievement.js
  71. 20
      src/router/modules/assessment.js
  72. 28
      src/router/modules/course.js
  73. 16
      src/router/modules/evaluation.js
  74. 20
      src/router/modules/information.js
  75. 24
      src/router/modules/match.js
  76. 20
      src/router/modules/project.js
  77. 16
      src/router/modules/setting.js
  78. 16
      src/router/modules/student.js
  79. 16
      src/router/modules/system.js
  80. 36
      src/router/permission.js
  81. 60
      src/router/routes.js
  82. 8
      src/setting.env.js
  83. 80
      src/setting.js
  84. 6
      src/store/getters.js
  85. 22
      src/store/index.js
  86. 16
      src/store/modules/auth.js
  87. 20
      src/store/modules/info.js
  88. 16
      src/store/modules/layout.js
  89. 14
      src/store/modules/match.js
  90. 14
      src/store/modules/project.js
  91. 91
      src/store/modules/user.js
  92. 178
      src/styles/common.scss
  93. 44
      src/styles/font/icon/demo.css
  94. 56
      src/styles/font/icon/demo_index.html
  95. 9
      src/styles/font/icon/iconfont.css
  96. 61
      src/styles/font/icon/iconfont.svg
  97. 2
      src/styles/font/iconfont.css
  98. 1
      src/styles/layout/index.scss
  99. 4
      src/styles/lib/_flex.scss
  100. 2
      src/styles/lib/_float.scss
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,24 +1,25 @@
<template> <template>
<div id="app" > <div id="app">
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting'; import Setting from "@/setting";
import util from '@/libs/util'; import util from "@/libs/util";
export default {
name: 'App', export default {
created () { name: "App",
created() {
//localStorage //localStorage
if (util.local.get(Setting.storeKey) ) { if (util.local.get(Setting.storeKey)) {
this.$store.replaceState(Object.assign({}, this.$store.state,util.local.get(Setting.storeKey))) this.$store.replaceState(Object.assign({}, this.$store.state, util.local.get(Setting.storeKey)));
} }
//vuexlocalStorage //vuexlocalStorage
window.addEventListener("beforeunload",()=>{ window.addEventListener("beforeunload", () => {
util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey,this.$store.state) util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey, this.$store.state);
}) });
}
} }
};
</script> </script>

@ -1,32 +1,43 @@
import Setting from '@/setting'; import Setting from "@/setting";
// let host = Setting.apiBaseURL // let host = Setting.apiBaseURL
let host = 'http://192.168.31.151:9000/'; // 榕 let host = "http://192.168.31.151:9000/"; // 榕
// let host = 'http://192.168.31.125:9000/'; // 坤 // let host = 'http://192.168.31.125:9000/'; // 坤
let xsHost = 'http://39.108.250.202:9000/'; // 线上 let xsHost = "http://39.108.250.202:9000/"; // 线上
let uploadURL = Setting.upload.apiURL; let uploadURL = Setting.upload.apiURL;
let host1 = 'http://39.108.250.202:8080/'; // 川大 let host1 = "http://39.108.250.202:8080/"; // 川大
export default { export default {
// fileupload: `${uploadURL}oss/manage/fileupload`, // fileupload: `${uploadURL}oss/manage/fileupload`,
queryToken: `${host}liuwanr/userInfo/queryToken`, queryToken: `${host}liuwanr/userInfo/queryToken`,
logins: `${host}users/users/user/login`, //登录 logins: `${host}users/users/user/login`, //登录
verification:`${host}users/users/user/captcha`,// 验证码图片 verification: `${host}users/users/user/captcha`,// 验证码图片
// bindPhoneOrEmail:`${host}users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 // bindPhoneOrEmail:`${host}users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
// sendPhoneOrEmailCode:`${host} users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 // sendPhoneOrEmailCode:`${host} users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
// 考核管理
pageByCondition: `${host}occupationlab/assessment/pageByCondition`, // 考核管理列表
saveAssessment: `${host}occupationlab/assessment/saveAssessment`, // 创建考核
modifyAssessment: `${host}occupationlab/assessment/modifyAssessment`, // 编辑考核
getDetailById: `${host}occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情
deleteAssessment: `${host}occupationlab/assessment/deleteAssessment`, // 单个、批量删除
collectPaper: `${host}occupationlab/assessment/collectPaper`, // 收卷(提前结束)
// 学生组织架构
treeList: `${host}occupationlab/architecture/treeList`, // 学生组织架构树形列表
//学生管理
resetPassword: `${host}users/users/userAccount/resetPwd`, // 密码重置
updateAccountEnable: `${host}occupationlab/architecture/updateAccountEnable`, // 密码重置
checkEmailOrPhone: `${host}occupationlab/architecture/checkEmailOrPhone`, // 新增学生前:校验手机号或者邮箱
checkWorkNumOrAccount: `${host}occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
delStudent: `${host}occupationlab/architecture/delStudent`, // 单个、批量删除学生
addStudent: `${host}occupationlab/architecture/addStudent`, // 新增学生
modifyStudent: `${host}occupationlab/architecture/modifyStudent`, // 编辑学生
getStudentInfoByAccountId: `${host}occupationlab/architecture/getStudentInfoByAccountId`, // 查看学生信息
getDetailByAccount: `${host}occupationlab/architecture/getDetailByAccount`, // 新增用户前调用:按帐户获取详细信息
importStudent: `${host}occupationlab/architecture/importStudent`, // 批量导入学生
exportFailure: `${host}occupationlab/architecture/exportFailure`, // 批量导入学生失败数据导出
removeStudent: `${host}occupationlab/architecture/removeStudent`, // 移除学生
organizationalStudentList: `${host}occupationlab/architecture/organizationalStudentList`, // 根据组织架构筛选学生列表
studentList: `${host}occupationlab/architecture/studentList`, // 学生列表
stuOrganizationTree: `${host}occupationlab/architecture/stuOrganizationTree`, // 学生组织架构树
treeList: `${host}occupationlab/architecture/treeList`, // 学生组织架构树形列表
saveOrg: `${host}occupationlab/architecture/save`, // 新增组织架构
updateOrg: `${host}occupationlab/architecture/update`, // 编辑组织架构
deleteOrg: `${host}occupationlab/architecture/delete`, // 删除组织架构
// 测评管理 // 测评管理
questionsList: `${host}occupationlab/questions/list`, // 题库列表查询 questionsList: `${host}occupationlab/questions/list`, // 题库列表查询
@ -41,6 +52,25 @@ export default {
questionsInfo: `${host}occupationlab/questions/info`, // 测评规则信息的展示 questionsInfo: `${host}occupationlab/questions/info`, // 测评规则信息的展示
questionsUpdateRules: `${host}occupationlab/questions/updateEvaluationRules`, // 修改测评规则信息 questionsUpdateRules: `${host}occupationlab/questions/updateEvaluationRules`, // 修改测评规则信息
// 考核管理
pageByCondition: `${host}occupationlab/assessment/pageByCondition`, // 考核管理列表
saveAssessment: `${host}occupationlab/assessment/saveAssessment`, // 创建考核
modifyAssessment: `${host}occupationlab/assessment/modifyAssessment`, // 编辑考核
getDetailById: `${host}occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情
deleteAssessment: `${host}occupationlab/assessment/deleteAssessment`, // 单个、批量删除
collectPaper: `${host}occupationlab/assessment/collectPaper`, // 收卷(提前结束)
schoolCourse: `${host}nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程
projectListByCourseId: `${host}nakadai/nakadai/curriculum/projectListByCourseId`, // 获取学校购买订单后的课程
// 成绩管理
deleteExperimentalReport: `${host}occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告
exportAssessmentInfo: `${host}occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
exportPracticeInfo: `${host}occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
getAchievementInfo: `${host}occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理
getAssessmentDetail: `${host}occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情
getPracticeDetail: `${host}occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
myClass: `${host}occupationlab/achievement/myClass`, // 教师端:我的班级
deleteReportById: `${host}occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核
// 项目管理 // 项目管理
avgValues: `${host}occupationlab/projectManage/avgValues`, // 平均分分配值 avgValues: `${host}occupationlab/projectManage/avgValues`, // 平均分分配值
@ -78,7 +108,6 @@ export default {
disableApplicant: `${host}occupationlab/enterprise/match/applicant/disableApplicant`, disableApplicant: `${host}occupationlab/enterprise/match/applicant/disableApplicant`,
batchExport: `${host}occupationlab/enterprise/match/applicant/batchExport`, batchExport: `${host}occupationlab/enterprise/match/applicant/batchExport`,
// 栏目管理 // 栏目管理
addColumn: `${host}occupationlab/enterprise/information/column/addColumn`, addColumn: `${host}occupationlab/enterprise/information/column/addColumn`,
deleteColumn: `${host}occupationlab/enterprise/information/column/deleteColumn`, deleteColumn: `${host}occupationlab/enterprise/information/column/deleteColumn`,
@ -95,7 +124,6 @@ export default {
queryArticleByCondition: `${host}occupationlab/enterprise/information/article/queryArticleByCondition`, queryArticleByCondition: `${host}occupationlab/enterprise/information/article/queryArticleByCondition`,
articleSort: `${host}occupationlab/enterprise/information/article/articleSort`, articleSort: `${host}occupationlab/enterprise/information/article/articleSort`,
// 课程管理 // 课程管理
queryCourseByCondition: `${host}occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询 queryCourseByCondition: `${host}occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询
addCourse: `${host}occupationlab/management/edu/course/addCourse`, // 添加课程 addCourse: `${host}occupationlab/management/edu/course/addCourse`, // 添加课程
@ -122,16 +150,10 @@ export default {
editSubsection: `${host}occupationlab/management/edu/courseSubsection/editSubsection`, // 修改小节 editSubsection: `${host}occupationlab/management/edu/courseSubsection/editSubsection`, // 修改小节
getSubsection: `${host}occupationlab/management/edu/courseSubsection/getSubsection`, // 根据小节id获取预览文件地址 getSubsection: `${host}occupationlab/management/edu/courseSubsection/getSubsection`, // 根据小节id获取预览文件地址
// 阿里云文件/视频管理 // 阿里云文件/视频管理
fileDeletion: `${host}nakadai/nakadai/oss/fileDeletion`, // 删除OSS文件 fileDeletion: `${host}nakadai/nakadai/oss/fileDeletion`, // 删除OSS文件
fileupload: `${host}nakadai/nakadai/oss/fileUpload`, // 文件上传 fileupload: `${host}nakadai/nakadai/oss/fileUpload`, // 文件上传
getPlayAuth: `${host}nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证
getPlayAuth: `${host}occupationlab/oss/manage/getPlayAuth`,
removeMoreVideo: `${host}occupationlab/oss/manage/removeMoreVideo`,
removeVideo: `${host}occupationlab/oss/manage/removeVideo`,
@ -143,6 +165,9 @@ export default {
// getPlayAuth: `${host}occupationlab/oss/manage/getPlayAuth`,
removeMoreVideo: `${host}occupationlab/oss/manage/removeMoreVideo`,
removeVideo: `${host}occupationlab/oss/manage/removeVideo`,
updateLogInNumber: `${host}liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间 updateLogInNumber: `${host}liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间
@ -181,65 +206,6 @@ export default {
bindPhone: `${host}evaluation/tms/user/bindPhone`,//校验手机验证码 bindPhone: `${host}evaluation/tms/user/bindPhone`,//校验手机验证码
examinePassword: `${host}evaluation/tms/user/examinePassword`,//更换密码 examinePassword: `${host}evaluation/tms/user/examinePassword`,//更换密码
// 测评管理
list: `${host}evaluation/tms/questions/list`, //分页加条件查询试题信息
info: `${host}evaluation/tms/evaluationrules/info`, //测评规则信息的展示
update: `${host}evaluation/tms/evaluationrules/update`, //修改测评规则信息
delete: `${host}evaluation/tms/questions/delete`, //批量删除试题信息
// questionsTemplate: `${host}template/试题导入模板.xlsx`, //excel模板文件下载
import: `${host}evaluation/tms/questions/import`, //通过excel批量导入
infoId: `${host}evaluation/tms/questions/info/`, //根据试题id查询试题详情信息
isenable: `${host}evaluation/tms/questions/isenable`, //是否禁用试题
save: `${host}evaluation/tms/questions/save`, //新增一道试题
// questionsUpdate: `${host}evaluation/tms/questions/update`, //根据试题id修改试题信息
upload: `${host}evaluation/tms/questions/upload`, //excel模板文件上传
export_failure: `${host}evaluation/tms/questions/export_failure`, //导出导入失败的数据和失败原因
expDelete: `${host}evaluation/tms/exp/delete`, //删除实验教学
expList: `${host}evaluation/tms/exp/list`, //实验教学列表
expSave: `${host}evaluation/tms/exp/save`, //添加实验教学
expUpdate: `${host}evaluation/tms/exp/update`, //修改实验教学
expInfo: `${host}evaluation/tms/exp/getById/`, //实验教学详情
expCheck: `${host}evaluation/tms/exp/check`, //实验名称判重
getInvitationCode: `${host}evaluation/tms/exp/getInvitationCode`, //查询邀请码是否存在
expInfo1: `${host}evaluation/tms/exp/upload`, //实验教学提前结束
// queryAllManagements: `${host}project/ProjectManagement/queryAllManagements`, //项目管理列表信息
queryManagements: `${host}project/ProjectManagement/queryManagements`, //项目管理列表信息
addRole: `${host}project/ProjectManagement/addRole`, //新增案例对象
// avgValues: `${host}project/ProjectManagement/avgValues`, //平均分配分值
getByRoleId: `${host}project/ProjectManagement/getByRoleId`, //根据角色id查询信息
getByjudgmentPointsId: `${host}project/ProjectManagement/getByjudgmentPointsId`, //实验任务表格信息的展示
queryAllJudgmentPoints: `${host}project/ProjectManagement/queryAllJudgmentPoints`, //添加判分点面板的数据展示+条件筛选
getProjectId: `${host}project/ProjectManagement/getProjectId`, //根据项目管理id查询对应信息
updateProjectManagement: `${host}project/ProjectManagement/updateProjectManagement`, //编辑项目管理
addProjectManagement: `${host}project/ProjectManagement/addProjectManagement`, //添加项目管理
removeProjectManagement: `${host}project/ProjectManagement/removeProjectManagement`, //删除
getJudgmentPoints: `${host}project/ProjectManagement/getJudgmentPoints`, //复制项目获取数据
getZZJudgmentPoints: `${host}project/ProjectManagement/getZZJudgmentPoints`, //复制项目获取数据
updateRole: `${host}project/ProjectManagement/updateRole`, //修改实验数据—角色信息
isNameExistis: `${host}project/ProjectManagement/isNameExistis`, //项目名称是否存在
QueryPfdInformation: `${host}judgment/pointOfJudgement/queryPfdInformation`, //判分点详细信息
addProjectManagementTrad: `${host}project/ProjectManagement/newAddProjectManagement`,
getTrdingJudgmentPoints: `${host}project/ProjectManagement/getTrdingJudgmentPoints`,
updateProjectManagementTrad: `${host}project/ProjectManagement/newUpdateProjectManagement`,
enableProject: `${host}project/ProjectManagement/enable`,
QueryPointOfJudgement: `${host}judgment/pointOfJudgement/queryPointOfJudgement`, //判分点列表查询
queryUserIds: `${host}liuwanr/userInfo/queryUserIds`,
// 学生管理
addStudent: `${host}evaluation/tms/student/zzAddStudent`,
daleteStudent: `${host}evaluation/tms/student/daleteStudent`,
disableAccount: `${host}evaluation/tms/student/disableAccount`,
queryStudent: `${host}evaluation/tms/student/queryStudent`,
reSetPassword: `${host}evaluation/tms/student/reSetPassword`,
updateStudent: `${host}evaluation/tms/student/updateStudent`,
downloadStudent: `${host}evaluation/tms/student/download`,
uploadFile: `${host}evaluation/tms/student/uploadFile`,
export_failureStudent: `${host}evaluation/tms/student/export_failure`,
queryAccountStudent: `${host}evaluation/tms/student/queryAccount`,
studentTemplate: `${host}template/student.xlsx`,
// 员工管理 // 员工管理
addStaff: `${host}evaluation/tms/system/addStaff`, addStaff: `${host}evaluation/tms/system/addStaff`,
daleteBatchStaff: `${host}evaluation/tms/system/daleteBatchStaff`, daleteBatchStaff: `${host}evaluation/tms/system/daleteBatchStaff`,
@ -250,7 +216,7 @@ export default {
export_failureStaff: `${host}evaluation/tms/system/export_failure`, export_failureStaff: `${host}evaluation/tms/system/export_failure`,
uploadFileStaff: `${host}evaluation/tms/system/uploadFile`, uploadFileStaff: `${host}evaluation/tms/system/uploadFile`,
queryAccountStaff: `${host}evaluation/tms/system/queryAccount`, queryAccountStaff: `${host}evaluation/tms/system/queryAccount`,
resetPwd: `${host}evaluation/tms/system/resetPwd`, // resetPwd: `${host}evaluation/tms/system/resetPwd`,
dalStaffByStaffGradeId: `${host}evaluation/tms/system/dalStaffByStaffGradeId`, dalStaffByStaffGradeId: `${host}evaluation/tms/system/dalStaffByStaffGradeId`,
dalStaffByProfessionalId: `${host}evaluation/tms/system/dalStaffByProfessionalId`, dalStaffByProfessionalId: `${host}evaluation/tms/system/dalStaffByProfessionalId`,
staffTemplate: `${host}template/staff.xlsx`, staffTemplate: `${host}template/staff.xlsx`,
@ -263,21 +229,6 @@ export default {
queryPermissionArrById: `${host}evaluation/sys-permission/queryPermissionArrById`, queryPermissionArrById: `${host}evaluation/sys-permission/queryPermissionArrById`,
roleTree: `${host}evaluation/sys-permission/tree`, roleTree: `${host}evaluation/sys-permission/tree`,
// 成绩管理
getImitationAchievement: `${host}evaluation/Achievement/getImitationAchievement`,
getTeachAchievement: `${host}evaluation/Achievement/getTeachAchievement`,
addReport: `${host}evaluation/Achievement/addReport`,
deleteReport: `${host}evaluation/Achievement/deleteReport`,
deleteReportById: `${host}evaluation/Achievement/deleteReportById`,
exportAchievement: `${host}evaluation/Achievement/exportAchievement`,
// queryAchievement:`${host}evaluation/Achievement/queryAchievement`,
queryAchievement: `${host}evaluation/Achievement/list`,
queryAchievementNew: `${host}evaluation/Achievement/newList`,
queryEvaluationReport: `${host}evaluation/Achievement/queryEvaluationReport`,
queryReport: `${host}evaluation/Achievement/queryReport`,
queryArchievement: `${host}evaluation/tms/classTech/queryExperimentalReport`, //查看教学实验报告
queryVirtualReport: `${host}evaluation/tms/classTech/queryVirtualReport`, //查看虚仿实验报告
// 教师评语 // 教师评语
addComment: `${host}evaluation/comment/addComment`, addComment: `${host}evaluation/comment/addComment`,
queryComment: `${host}evaluation/comment/queryComment`, queryComment: `${host}evaluation/comment/queryComment`,
@ -298,6 +249,6 @@ export default {
// 川大 // 川大
firstLevel: `${host1}sichuan/point/firstLevel`, firstLevel: `${host1}sichuan/point/firstLevel`,
secondaryLevel: `${host1}sichuan/point/secondaryLevel`, secondaryLevel: `${host1}sichuan/point/secondaryLevel`,
thirdLevel: `${host1}sichuan/point/thirdLevel`, thirdLevel: `${host1}sichuan/point/thirdLevel`
}; };

@ -13,7 +13,7 @@
<div class="pdf"> <div class="pdf">
<p class="arrow"> <p class="arrow">
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span> <span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span>
{{currentPage}} / {{pageCount}} {{ currentPage }} / {{ pageCount }}
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span> <span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span>
</p> </p>
<pdf <pdf
@ -32,73 +32,78 @@
</template> </template>
<script> <script>
import pdf from "vue-pdf"; import pdf from "vue-pdf";
export default { export default {
props: ['visible','src'], props: ["visible", "src"],
data() { data() {
return { return {
pdfVisible: false, pdfVisible: false,
pdfSrc: '', pdfSrc: "",
currentPage: 0, currentPage: 0,
pageCount: 0, pageCount: 0,
fileType: 'pdf', fileType: "pdf"
}; };
}, },
components: { pdf }, components: { pdf },
mounted(){ mounted() {
this.addEvent() this.addEvent();
}, },
methods: { methods: {
closePdf(){ closePdf() {
this.$emit('update:visible',false) this.$emit("update:visible", false);
this.$emit('update:src','') this.$emit("update:src", "");
this.currentPage = 1 this.currentPage = 1;
}, },
changePdfPage (val) { changePdfPage(val) {
if (val === 0 && this.currentPage > 1) { if (val === 0 && this.currentPage > 1) {
this.currentPage-- this.currentPage--;
} }
if (val === 1 && this.currentPage < this.pageCount) { if (val === 1 && this.currentPage < this.pageCount) {
this.currentPage++ this.currentPage++;
} }
}, },
loadPdfHandler (e) { loadPdfHandler(e) {
this.currentPage = 1 this.currentPage = 1;
}, },
addEvent(){ addEvent() {
document.onkeydown = e => { document.onkeydown = e => {
let key = window.event.keyCode let key = window.event.keyCode;
if(key == 37){ if (key == 37) {
this.changePdfPage(0) this.changePdfPage(0);
}else if(key == 39){ } else if (key == 39) {
this.changePdfPage(1) this.changePdfPage(1);
}
} }
this.$once('hook:beforeDestroy',() => { };
document.onkeydown = null this.$once("hook:beforeDestroy", () => {
}) document.onkeydown = null;
});
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.pdf-dia{ /deep/ .pdf-dia {
border-radius: 0 !important; border-radius: 0 !important;
.el-dialog__header{
.el-dialog__header {
display: none; display: none;
} }
.el-dialog__body{
.el-dialog__body {
padding: 0; padding: 0;
} }
.el-dialog__headerbtn{
.el-dialog__headerbtn {
top: 10px; top: 10px;
.el-dialog__close{
.el-dialog__close {
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
} }
} }
.pdf{ .pdf {
.arrow{ .arrow {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -107,18 +112,20 @@ export default {
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
background-color: #333; background-color: #333;
.turn{
.turn {
margin: 0 10px; margin: 0 10px;
font-size: 18px; font-size: 18px;
cursor: pointer; cursor: pointer;
} }
} }
.pdf-wrap{
.pdf-wrap {
height: calc(100vh - 45px); height: calc(100vh - 45px);
margin: 0 auto; margin: 0 auto;
overflow: auto; overflow: auto;
} }
} }
} }
</style> </style>

@ -15,32 +15,32 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
import Quill from 'quill'; import Quill from "quill";
import 'quill/dist/quill.core.css'; import "quill/dist/quill.core.css";
import 'quill/dist/quill.snow.css'; import "quill/dist/quill.snow.css";
import 'quill/dist/quill.bubble.css'; import "quill/dist/quill.bubble.css";
import toolbarOptions from './options' import toolbarOptions from "./options";
export default { export default {
name: 'quill', name: "quill",
props: { props: {
value: { value: {
type: String, type: String,
default: '' default: ""
}, },
readonly: { readonly: {
type: Boolean, type: Boolean,
default:false default: false
}, },
toTop: { toTop: {
type: Boolean, type: Boolean,
default:true default: true
}, },
border: { border: {
type: Boolean, type: Boolean,
default:false default: false
}, },
height: { height: {
type: Number type: Number
@ -52,51 +52,51 @@ import Setting from '@/setting'
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致 * 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏 * 使用props传入elseRead = 'true'手动隐藏工具栏
*/ */
elseRead:{ elseRead: {
type:String,default:'false' type: String, default: "false"
} }
}, },
data () { data() {
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
Quill: null, Quill: null,
currentValue: '', currentValue: "",
options: { options: {
theme: 'snow', theme: "snow",
bounds: document.body, bounds: document.body,
debug: 'warn', debug: "warn",
modules: { modules: {
toolbar: { toolbar: {
container: toolbarOptions, container: toolbarOptions,
handlers: { handlers: {
'image': function (value) { "image": function(value) {
if (value) { if (value) {
// iview // iview
document.querySelector('.editorUpload').click() document.querySelector(".editorUpload").click();
} else { } else {
this.Quill.format('image', false); this.Quill.format("image", false);
} }
} }
} }
} }
}, },
placeholder: '', placeholder: "",
readOnly: this.readonly readOnly: this.readonly
}, },
loading: false loading: false
} };
}, },
computed: { computed: {
classes () { classes() {
return [ return [
{ {
'quill-no-border': !this.border "quill-no-border": !this.border
} }
]; ];
}, },
styles () { styles() {
let style = {}; let style = {};
if (this.minHeight) { if (this.minHeight) {
style.minHeight = `${this.minHeight}px`; style.minHeight = `${this.minHeight}px`;
@ -105,12 +105,12 @@ import Setting from '@/setting'
style.height = `${this.height}px`; style.height = `${this.height}px`;
} }
return style; return style;
}, }
}, },
watch: { watch: {
value: { value: {
handler (val) { handler(val) {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val; this.currentValue = val;
if (this.Quill) { if (this.Quill) {
@ -121,97 +121,99 @@ import Setting from '@/setting'
immediate: true immediate: true
} }
}, },
created(){ created() {
}, },
mounted () { mounted() {
this.init(); this.init();
// //
if(this.elseRead==='true'){ if (this.elseRead === "true") {
let children = this.$refs.quill.children[0].style let children = this.$refs.quill.children[0].style;
children.padding = '0' children.padding = "0";
children.overflow = 'hidden' children.overflow = "hidden";
children.height = '0' children.height = "0";
children.borderTop = '0' children.borderTop = "0";
} }
}, },
beforeDestroy () { beforeDestroy() {
// //
this.Quill = null; this.Quill = null;
}, },
methods: { methods: {
init () { init() {
const editor = this.$refs.editor; const editor = this.$refs.editor;
// //
this.Quill = new Quill(editor, this.options); this.Quill = new Quill(editor, this.options);
// //
this.Quill.pasteHTML(this.currentValue); this.Quill.pasteHTML(this.currentValue);
if(this.toTop){ if (this.toTop) {
this.$nextTick(() => { this.$nextTick(() => {
window.scrollTo(0,0) window.scrollTo(0, 0);
}) });
} }
// //
this.Quill.on('text-change', (delta, oldDelta, source) => { this.Quill.on("text-change", (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML; const html = this.$refs.editor.children[0].innerHTML;
const text = this.Quill.getText(); const text = this.Quill.getText();
const quill = this.Quill; const quill = this.Quill;
// //
this.currentValue = html; this.currentValue = html;
// v-model // v-model
this.$emit('input', html); this.$emit("input", html);
// //
this.$emit('on-change', { html, text, quill }); this.$emit("on-change", { html, text, quill });
}); });
// quill // quill
this.Quill.on('text-change', (delta, oldDelta, source) => { this.Quill.on("text-change", (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source); this.$emit("on-text-change", delta, oldDelta, source);
}); });
this.Quill.on('selection-change', (range, oldRange, source) => { this.Quill.on("selection-change", (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source); this.$emit("on-selection-change", range, oldRange, source);
}); });
this.Quill.on('editor-change', (eventName, ...args) => { this.Quill.on("editor-change", (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args); this.$emit("on-editor-change", eventName, ...args);
}); });
}, },
beforeUpload(file){ beforeUpload(file) {
this.loading = true this.loading = true;
}, },
editorUploadSuccess (res) { editorUploadSuccess(res) {
// //
let quill = this.Quill let quill = this.Quill;
// //
if (res.filesResult.fileUrl) { if (res.filesResult.fileUrl) {
// //
let length = quill.getSelection().index; let length = quill.getSelection().index;
// res // res
quill.insertEmbed(length, 'image', res.filesResult.fileUrl) quill.insertEmbed(length, "image", res.filesResult.fileUrl);
// //
quill.setSelection(length + 1) quill.setSelection(length + 1);
} else { } else {
util.successMsg('图片插入失败') util.successMsg("图片插入失败");
} }
this.loading = false this.loading = false;
},
} }
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.quill-no-border{ .quill-no-border {
.ql-toolbar.ql-snow{ .ql-toolbar.ql-snow {
border: none; border: none;
border-bottom: 1px solid #e8eaec; border-bottom: 1px solid #e8eaec;
} }
.ql-container.ql-snow{
.ql-container.ql-snow {
border: none; border: none;
} }
} }
.else{
.ql-toolbar.ql-snow{ .else {
.ql-toolbar.ql-snow {
height: 0; height: 0;
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
border-top: 0; border-top: 0;
} }
} }
</style> </style>

@ -1,16 +1,16 @@
export default [ export default [
['bold', 'italic', 'underline', 'strike'], ["bold", "italic", "underline", "strike"],
['blockquote', 'code-block'], ["blockquote", "code-block"],
[{ 'header': 1 }, { 'header': 2 }], [{ "header": 1 }, { "header": 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ "list": "ordered" }, { "list": "bullet" }],
[{ 'script': 'sub' }, { 'script': 'super' }], [{ "script": "sub" }, { "script": "super" }],
[{ 'indent': '-1' }, { 'indent': '+1' }], [{ "indent": "-1" }, { "indent": "+1" }],
[{ 'direction': 'rtl' }], [{ "direction": "rtl" }],
[{ 'size': ['small', false, 'large', 'huge'] }], [{ "size": ["small", false, "large", "huge"] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ "header": [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], [{ "color": [] }, { "background": [] }],
[{ 'font': [] }], [{ "font": [] }],
[{ 'align': [] }], [{ "align": [] }],
['clean'], ["clean"],
['link', 'image', 'video'] ["link", "image", "video"]
] ];

@ -1,30 +1,30 @@
export const messages = { export const messages = {
'zh': { "zh": {
i18n: { i18n: {
breadcrumb: '国际化产品', breadcrumb: "国际化产品",
tips: '通过切换语言按钮,来改变当前内容的语言。', tips: "通过切换语言按钮,来改变当前内容的语言。",
btn: '切换英文', btn: "切换英文",
title1: '常用用法', title1: "常用用法",
p1: '要是你把你的秘密告诉了风,那就别怪风把它带给树。', p1: "要是你把你的秘密告诉了风,那就别怪风把它带给树。",
p2: '没有什么比信念更能支撑我们度过艰难的时光了。', p2: "没有什么比信念更能支撑我们度过艰难的时光了。",
p3: '只要能把自己的事做好,并让自己快乐,你就领先于大多数人了。', p3: "只要能把自己的事做好,并让自己快乐,你就领先于大多数人了。",
title2: '组件插值', title2: "组件插值",
info: 'Element组件需要国际化,请参考 {action}。', info: "Element组件需要国际化,请参考 {action}。",
value: '文档' value: "文档"
} }
}, },
'en': { "en": {
i18n: { i18n: {
breadcrumb: 'International Products', breadcrumb: "International Products",
tips: 'Click on the button to change the current language. ', tips: "Click on the button to change the current language. ",
btn: 'Switch Chinese', btn: "Switch Chinese",
title1: 'Common usage', title1: "Common usage",
p1: "If you reveal your secrets to the wind you should not blame the wind for revealing them to the trees.", p1: "If you reveal your secrets to the wind you should not blame the wind for revealing them to the trees.",
p2: "Nothing can help us endure dark times better than our faith. ", p2: "Nothing can help us endure dark times better than our faith. ",
p3: "If you can do what you do best and be happy, you're further along in life than most people.", p3: "If you can do what you do best and be happy, you're further along in life than most people.",
title2: 'Component interpolation', title2: "Component interpolation",
info: 'The default language of Element is Chinese. If you wish to use another language, please refer to the {action}.', info: "The default language of Element is Chinese. If you wish to use another language, please refer to the {action}.",
value: 'documentation' value: "documentation"
} }
} }
} };

@ -8,36 +8,35 @@
<script> <script>
export default { export default {
data() { data() {
return { return {};
};
},
mounted(){
}, },
methods: { mounted() {
}, },
methods: {}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.copyright{ .copyright {
padding: 20px 0; padding: 20px 0;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
background-color: #333; background-color: #333;
p{
p {
margin-bottom: 10px; margin-bottom: 10px;
color: #fff; color: #fff;
font-size: 12px; font-size: 12px;
} }
a{
color:#fff; a {
color: #fff;
font-size: 12px; font-size: 12px;
&:hover{
&:hover {
opacity: .8; opacity: .8;
} }
} }
} }
</style> </style>

@ -5,7 +5,7 @@
<div class="action"> <div class="action">
<div class="user" @click="toPersonal"> <div class="user" @click="toPersonal">
<el-avatar :size="40" :src="avatar"></el-avatar> <el-avatar :size="40" :src="avatar"></el-avatar>
<span class="m-l-10">{{userName}}</span> <span class="m-l-10">{{ userName }}</span>
</div> </div>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button> <el-button type="text" class="ml20" @click="logout">退出</el-button>
@ -13,34 +13,35 @@
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {
isHh: Setting.isHh, isHh: Setting.isHh
}; };
}, },
computed: { computed: {
...mapState('user', [ ...mapState("user", [
'avatar','userName' "avatar", "userName"
]), ]),
...mapState('auth', [ ...mapState("auth", [
'routes' "routes"
]) ])
}, },
mounted(){ mounted() {
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions("user", [
'logout' "logout"
]), ]),
toPersonal(){ toPersonal() {
this.$router.push('/setting/person') this.$router.push("/setting/person");
}, }
}, }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -53,27 +54,33 @@ export default {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
background-color: #fff; background-color: #fff;
.logo { .logo {
height: 50px; height: 50px;
margin-left: 20px; margin-left: 20px;
&.hh{
&.hh {
width: 220px; width: 220px;
} }
} }
.action { .action {
display: flex; display: flex;
padding-right: 50px; padding-right: 50px;
align-items: center; align-items: center;
.user{
.user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
.el-button--text{
.el-button--text {
margin-left: 20px; margin-left: 20px;
color: #333; color: #333;
} }
.el-divider{
.el-divider {
width: 2px; width: 2px;
height: 15px; height: 15px;
margin-left: 20px; margin-left: 20px;

@ -15,17 +15,16 @@
</template> </template>
<script> <script>
import vHead from '../header' import vHead from "../header";
import navbar from '../navbar' import navbar from "../navbar";
import vFooter from '../footer' import vFooter from "../footer";
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {};
};
}, },
components: { components: {
vHead, vHead,
@ -33,35 +32,36 @@ export default {
vFooter vFooter
}, },
mounted() { mounted() {
this.autoLogout() this.autoLogout();
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions("user", [
'logout' "logout"
]), ]),
// ,退 // ,退
autoLogout(){ autoLogout() {
let lastTime = new Date().getTime() let lastTime = new Date().getTime();
document.onmousedown = () => { document.onmousedown = () => {
lastTime = new Date().getTime() lastTime = new Date().getTime();
} };
setInterval(() => { setInterval(() => {
if(util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime){ if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
util.errorMsg('用户登录过期,请重新登录') util.errorMsg("用户登录过期,请重新登录");
setTimeout(this.logout,1500) setTimeout(this.logout, 1500);
} }
},1000) }, 1000);
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main{ .main {
min-height: 100%; min-height: 100%;
.content{
.content {
min-height: calc(100vh - 176px); min-height: calc(100vh - 176px);
padding: 24px 24px 0; padding: 24px 24px 0;
} }
} }
</style> </style>

@ -29,99 +29,100 @@
</template> </template>
<script> <script>
import { mapState,mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
active: this.$route.path, active: this.$route.path,
defaultMenus: [ defaultMenus: [
{ {
icon: 'el-icon-user', icon: "el-icon-user",
index: '/student/list', index: "/student/list",
title: '学生管理' title: "学生管理"
}, },
{ {
icon: 'el-icon-receiving', icon: "el-icon-receiving",
index: '/evaluation/list', index: "/evaluation/list",
title: '测评管理' title: "测评管理"
}, },
{ {
icon: 'el-icon-takeaway-box', icon: "el-icon-takeaway-box",
index: '/assessment/list', index: "/assessment/list",
title: '考核管理' title: "考核管理"
}, },
{ {
icon: 'el-icon-collection', icon: "el-icon-collection",
index: '/achievement/list', index: "/achievement/list",
title: '成绩管理' title: "成绩管理"
}, },
{ {
icon: 'el-icon-news', icon: "el-icon-news",
index: '/course/list', index: "/course/list",
title: '理论课程管理' title: "理论课程管理"
}, },
{ {
icon: 'el-icon-document', icon: "el-icon-document",
index: '/information/list', index: "/information/list",
title: '资讯管理' title: "资讯管理"
}, },
{ {
icon: 'el-icon-school', icon: "el-icon-school",
index: '/match/list', index: "/match/list",
title: '赛事管理' title: "赛事管理"
}, },
{ {
icon: 'el-icon-postcard', icon: "el-icon-postcard",
index: '/project/list', index: "/project/list",
title: '实验项目管理' title: "实验项目管理"
}, },
{ {
icon: 'el-icon-setting', icon: "el-icon-setting",
index: '/system/list', index: "/system/list",
title: '系统设置' title: "系统设置"
} }
], ],
menus: [], menus: [],
actives: { actives: {
dashboard: ['add'], dashboard: ["add"],
achievement: ['experiment','experimentVir','experimentTeach','addexperiment','addexperimentoptions','showExperiment','showExperimentoption','showExperimentoptions'], achievement: ["experiment", "experimentVir", "experimentTeach", "addexperiment", "addexperimentoptions", "showExperiment", "showExperimentoption", "showExperimentoptions"],
project: ['addproject','program','programOption','programOptions'], project: ["addproject", "program", "programOption", "programOptions"],
backstage: ['report'] backstage: ["report"]
} }
}; };
}, },
computed: { computed: {
...mapState('auth', [ ...mapState("auth", [
'routes' "routes"
]) ])
}, },
watch: { watch: {
'$route'(to,from) { "$route"(to, from) {
let actives = this.actives let actives = this.actives;
for(let i in this.actives){ for (let i in this.actives) {
if(actives[i].includes(this.$route.name)) this.active = `/${i}/list` if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`;
} }
this.active = this.$route.path this.active = this.$route.path;
} }
}, },
created() { created() {
this.initMenu() this.initMenu();
}, },
methods: { methods: {
initMenu(){ initMenu() {
if(Setting.dynamicRoute){ if (Setting.dynamicRoute) {
let routes = this.routes let routes = this.routes;
let menus = [] let menus = [];
this.defaultMenus.map(e => { this.defaultMenus.map(e => {
routes.find(n => n.path == e.index) && menus.push(e) routes.find(n => n.path == e.index) && menus.push(e);
}) });
this.menus = menus this.menus = menus;
}else{ } else {
this.menus = this.defaultMenus this.menus = this.defaultMenus;
}
} }
},
} }
}; };
</script> </script>
@ -130,12 +131,15 @@ export default {
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 100%; width: 100%;
} }
.el-menu.el-menu--horizontal{
.el-menu.el-menu--horizontal {
border-bottom: none; border-bottom: none;
} }
.sidebar > ul { .sidebar > ul {
height: 100%; height: 100%;
} }

@ -2,20 +2,21 @@
* @description 生成按钮级别权限组 * @description 生成按钮级别权限组
* */ * */
import store from '@/store'; import store from "@/store";
export default function(data){
let result = [] export default function(data) {
let result = [];
data.map(e => { data.map(e => {
e.children.map(n => { e.children.map(n => {
if(n.children.length){ if (n.children.length) {
result.push(`${e.name}:${n.name}`) result.push(`${e.name}:${n.name}`);
n.children.map(j => { n.children.map(j => {
e.menuUrl ? result.push(`${e.menuUrl}:${n.name}:${j.name}`) : result.push(`${n.menuUrl}:${j.name}`) e.menuUrl ? result.push(`${e.menuUrl}:${n.name}:${j.name}`) : result.push(`${n.menuUrl}:${j.name}`);
}) });
}else{ } else {
result.push(`${e.menuUrl}:${n.name}`) result.push(`${e.menuUrl}:${n.name}`);
} }
}) });
}) });
store.dispatch('auth/addBtnAuth',result) store.dispatch("auth/addBtnAuth", result);
} }

@ -1,4 +1,4 @@
import Vue from 'vue'; import Vue from "vue";
// 使用 Event Bus // 使用 Event Bus
const bus = new Vue(); const bus = new Vue();

@ -1,8 +1,8 @@
// 生成随机字符串 // 生成随机字符串
export default function (len = 32) { export default function(len = 32) {
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; const $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
const maxPos = $chars.length; const maxPos = $chars.length;
let str = ''; let str = "";
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
str += $chars.charAt(Math.floor(Math.random() * maxPos)); str += $chars.charAt(Math.floor(Math.random() * maxPos));
} }

@ -1,16 +1,18 @@
// rem等比适配配置文件 // rem等比适配配置文件
// 基准大小 // 基准大小
const baseSize = 16 const baseSize = 16;
// 设置 rem 函数 // 设置 rem 函数
function setRem () { function setRem() {
// 当前页面宽度相对于 1920宽的缩放比例,可根据自己需要修改。 // 当前页面宽度相对于 1920宽的缩放比例,可根据自己需要修改。
const scale = document.documentElement.clientWidth / 1920 const scale = document.documentElement.clientWidth / 1920;
// 设置页面根节点字体大小(“Math.min(scale, 2)” 指最高放大比例为2,可根据实际业务需求调整) // 设置页面根节点字体大小(“Math.min(scale, 2)” 指最高放大比例为2,可根据实际业务需求调整)
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px' document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + "px";
} }
// 初始化 // 初始化
setRem() setRem();
// 改变窗口大小时重新设置 rem // 改变窗口大小时重新设置 rem
window.onresize = function () { window.onresize = function() {
setRem() setRem();
} };

@ -1,31 +1,31 @@
import store from '@/store'; import store from "@/store";
import router from '@/router'; import router from "@/router";
import generateBtnPermission from '../auth/generateBtnPermission'; import generateBtnPermission from "../auth/generateBtnPermission";
const newRoutes = [] const newRoutes = [];
function createMeta(item){ function createMeta(item) {
let meta = { title: item.name } let meta = { title: item.name };
return meta return meta;
} }
function createRoute(data){ function createRoute(data) {
data.map(e => { data.map(e => {
if(e.menuUrl){ if (e.menuUrl) {
let meta = createMeta(e) let meta = createMeta(e);
newRoutes.push({ newRoutes.push({
name: e.menuUrl, name: e.menuUrl,
path: e.menuUrl, path: e.menuUrl,
meta meta
}) });
} }
// 递归生成路由集合 // 递归生成路由集合
e.children && e.children.length && createRoute(e.children) e.children && e.children.length && createRoute(e.children);
}) });
} }
export default function(data,path){ export default function(data, path) {
generateBtnPermission(data) generateBtnPermission(data);
createRoute(data) createRoute(data);
store.dispatch('auth/addRoutes',newRoutes) store.dispatch("auth/addRoutes", newRoutes);
} }

@ -1,26 +1,26 @@
import store from '@/store'; import store from "@/store";
import router from '@/router'; import router from "@/router";
export default function(){ export default function() {
setTimeout(() => { setTimeout(() => {
let routes = store.state.auth.routes let routes = store.state.auth.routes;
routes.forEach(e => { routes.forEach(e => {
if(e.path == '/'){ if (e.path == "/") {
e.component = () => import('@/layouts/home/index.vue') e.component = () => import("@/layouts/home/index.vue");
}else{ } else {
e.component = () => import(`@/pages/${e.path}.vue`) e.component = () => import(`@/pages/${e.path}.vue`);
} }
e.children && e.children.forEach(n => { e.children && e.children.forEach(n => {
n.path && (n.component = () => import(`@/pages/${n.path}.vue`)) n.path && (n.component = () => import(`@/pages/${n.path}.vue`));
}) });
}) });
routes.push({ routes.push({
path: '*', path: "*",
redirect: '404' redirect: "404"
}) });
router.addRoutes(routes) router.addRoutes(routes);
},500) }, 500);
} }

@ -1,6 +1,6 @@
import router from '@/router'; import router from "@/router";
export default function(){ export default function() {
const newRouter = createRouter() const newRouter = createRouter();
router.matcher = newRouter.matcher router.matcher = newRouter.matcher;
} }

@ -1,5 +1,5 @@
import Cookies from 'js-cookie'; import Cookies from "js-cookie";
import Setting from '@/setting'; import Setting from "@/setting";
const cookies = {}; const cookies = {};
@ -9,7 +9,7 @@ const cookies = {};
* @param {String} value cookie value * @param {String} value cookie value
* @param {Object} cookieSetting cookie setting * @param {Object} cookieSetting cookie setting
*/ */
cookies.set = function (name = 'default', value = '', cookieSetting = {}) { cookies.set = function(name = "default", value = "", cookieSetting = {}) {
let currentCookieSetting = { let currentCookieSetting = {
expires: Setting.cookiesExpires expires: Setting.cookiesExpires
}; };
@ -21,14 +21,14 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
* @description 拿到 cookie * @description 拿到 cookie
* @param {String} name cookie name * @param {String} name cookie name
*/ */
cookies.get = function (name = 'default') { cookies.get = function(name = "default") {
return Cookies.get(`admin-${name}`); return Cookies.get(`admin-${name}`);
}; };
/** /**
* @description 拿到 cookie 全部的值 * @description 拿到 cookie 全部的值
*/ */
cookies.getAll = function () { cookies.getAll = function() {
return Cookies.get(); return Cookies.get();
}; };
@ -36,7 +36,7 @@ cookies.getAll = function () {
* @description 删除 cookie * @description 删除 cookie
* @param {String} name cookie name * @param {String} name cookie name
*/ */
cookies.remove = function (name = 'default') { cookies.remove = function(name = "default") {
return Cookies.remove(`admin-${name}`); return Cookies.remove(`admin-${name}`);
}; };

@ -13,10 +13,10 @@ var _local = {
var data = Object.assign(params, { startTime: new Date().getTime() }); var data = Object.assign(params, { startTime: new Date().getTime() });
localStorage.setItem(key, JSON.stringify(data)); localStorage.setItem(key, JSON.stringify(data));
} else { } else {
if (Object.prototype.toString.call(value) == '[object Object]') { if (Object.prototype.toString.call(value) == "[object Object]") {
value = JSON.stringify(value); value = JSON.stringify(value);
} }
if (Object.prototype.toString.call(value) == '[object Array]') { if (Object.prototype.toString.call(value) == "[object Array]") {
value = JSON.stringify(value); value = JSON.stringify(value);
} }
localStorage.setItem(key, value); localStorage.setItem(key, value);
@ -55,20 +55,20 @@ var _local = {
clear() { clear() {
localStorage.clear(); localStorage.clear();
} }
} };
/** /**
* sessionStorage * sessionStorage
*/ */
var _session = { var _session = {
get: function (key) { get: function(key) {
var data = sessionStorage[key]; var data = sessionStorage[key];
if (!data || data === "null") { if (!data || data === "null") {
return null; return null;
} }
return data; return data;
}, },
set: function (key, value) { set: function(key, value) {
sessionStorage[key] = value; sessionStorage[key] = value;
}, },
// 删除 // 删除
@ -79,5 +79,5 @@ var _session = {
clear() { clear() {
sessionStorage.clear(); sessionStorage.clear();
} }
} };
export { _local, _session } export { _local, _session };

@ -1,18 +1,18 @@
import cookies from './util.cookies' import cookies from "./util.cookies";
import {_local,_session} from './util.db' import { _local, _session } from "./util.db";
import { Message } from 'element-ui' import { Message } from "element-ui";
import store from '@/store' import store from "@/store";
import axios from 'axios' import axios from "axios";
import api from '@/api' import api from "@/api";
import Setting from '@/setting' import Setting from "@/setting";
let logout = false let logout = false;
const roleList = { const roleList = {
'1': '超级管理员', "1": "超级管理员",
'13': '管理员', "13": "管理员",
'14': '老师', "14": "老师",
'4': '学生' "4": "学生"
} };
const util = { const util = {
cookies, cookies,
local: _local, local: _local,
@ -20,51 +20,51 @@ const util = {
// 传入身份证获取生日 // 传入身份证获取生日
getBirth(idCard) { getBirth(idCard) {
var birthday = ""; var birthday = "";
if(idCard != null && idCard != ""){ if (idCard != null && idCard != "") {
if(idCard.length == 15){ if (idCard.length == 15) {
birthday = "19"+idCard.slice(6,12); birthday = "19" + idCard.slice(6, 12);
} else if(idCard.length == 18){ } else if (idCard.length == 18) {
birthday = idCard.slice(6,14); birthday = idCard.slice(6, 14);
} }
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-"); birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
//通过正则表达式来指定输出格式为:1990-01-01 //通过正则表达式来指定输出格式为:1990-01-01
} }
return birthday; return birthday;
}, },
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/ // new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
dateCompatible(date) { dateCompatible(date) {
return date.replace(/\-/g, '/') return date.replace(/\-/g, "/");
}, },
// 日期时间前面补零 // 日期时间前面补零
formateTime(num) { formateTime(num) {
return num < 10 ? `0${num}` : num return num < 10 ? `0${num}` : num;
}, },
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss" //返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
formatDate(fmt,date) { formatDate(fmt, date) {
var date = date ? date : new Date() var date = date ? date : new Date();
var o = { var o = {
"M+" : date.getMonth()+1, //月份 "M+": date.getMonth() + 1, //月份
"d+" : date.getDate(), //日 "d+": date.getDate(), //日
"h+" : date.getHours(), //小时 "h+": date.getHours(), //小时
"m+" : date.getMinutes(), //分 "m+": date.getMinutes(), //分
"s+" : date.getSeconds(), //秒 "s+": date.getSeconds(), //秒
"q+" : Math.floor((date.getMonth()+3)/3), //季度 "q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S" : date.getMilliseconds() //毫秒 "S": date.getMilliseconds() //毫秒
}; };
if(/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
} }
for(var k in o) { for (var k in o) {
if(new RegExp("("+ k +")").test(fmt)){ if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
} }
} }
return fmt; return fmt;
}, },
// 移除数组中指定值 // 移除数组中指定值
removeByValue(arr, val) { removeByValue(arr, val) {
for(var i=0; i<arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if(arr[i] == val) { if (arr[i] == val) {
arr.splice(i, 1); arr.splice(i, 1);
break; break;
} }
@ -72,116 +72,154 @@ const util = {
}, },
// 传入文件后缀判断是否是视频 // 传入文件后缀判断是否是视频
isVideo(ext) { isVideo(ext) {
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return true;
return false return false;
}, },
// 传入文件后缀判断是否是音频 // 传入文件后缀判断是否是音频
isAudio(ext) { isAudio(ext) {
if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true if ("mp3,aac,ape,flac,wav,wma,amr,mid".includes(ext)) return true;
return false return false;
}, },
// 传入文件后缀判断是否是图片 // 传入文件后缀判断是否是图片
isImg(ext) { isImg(ext) {
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return true;
return false return false;
}, },
// 传入文件后缀判断是否是pdf以外的文档 // 传入文件后缀判断是否是pdf以外的文档
isDoc(ext) { isDoc(ext) {
if(!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != 'pdf') return true if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != "pdf") return true;
return false return false;
}, },
// 循环去除html标签 // 循环去除html标签
removeHtmlTag(list,attr) { removeHtmlTag(list, attr) {
list.map(n => { list.map(n => {
n[attr] = n[attr].replace(/<\/?.+?>/gi,'') n[attr] = n[attr].replace(/<\/?.+?>/gi, "");
}) });
return list return list;
}, },
// 传入文件名获取文件后缀 // 传入文件名获取文件后缀
getFileExt(fileName) { getFileExt(fileName) {
return fileName.substring(fileName.lastIndexOf('.') + 1) return fileName.substring(fileName.lastIndexOf(".") + 1);
}, },
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
downloadFile(fileName,url) { downloadFile(fileName, url) {
var x = new XMLHttpRequest() var x = new XMLHttpRequest();
x.open("GET", url, true) x.open("GET", url, true);
x.responseType = 'blob' x.responseType = "blob";
x.onload=function(e) { x.onload = function(e) {
var url = window.URL.createObjectURL(x.response) var url = window.URL.createObjectURL(x.response);
var a = document.createElement('a') var a = document.createElement("a");
a.href = url a.href = url;
a.download = fileName a.download = fileName;
a.click() a.click();
} };
x.send() x.send();
}, },
// 传入文件名和数据,下载文件 // 传入文件名和数据,下载文件
downloadFileDirect(fileName,data) { downloadFileDirect(fileName, data) {
if ('download' in document.createElement('a')) { // 非IE下载 if ("download" in document.createElement("a")) { // 非IE下载
const elink = document.createElement('a') const elink = document.createElement("a");
elink.download = fileName elink.download = fileName;
elink.style.display = 'none' elink.style.display = "none";
elink.href = URL.createObjectURL(data) elink.href = URL.createObjectURL(data);
document.body.appendChild(elink) document.body.appendChild(elink);
elink.click() elink.click();
URL.revokeObjectURL(elink.href) // 释放URL 对象 URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink) document.body.removeChild(elink);
} else { // IE10+下载 } else { // IE10+下载
navigator.msSaveBlob(data, fileName) navigator.msSaveBlob(data, fileName);
} }
}, },
// 传入字符串,返回去除[]后的字符串,因为通过get请求带入方括号的话会有问题 // 传入字符串,返回去除[]后的字符串,因为通过get请求带入方括号的话会有问题
encodeStr(str) { encodeStr(str) {
if(str.includes('[') || str.includes(']')){ if (str.includes("[") || str.includes("]")) {
let newStr = '' let newStr = "";
for(let i of str){ for (let i of str) {
if(i == '[' || i == ']'){ if (i == "[" || i == "]") {
newStr += encodeURI(i) newStr += encodeURI(i);
}else{ } else {
newStr += i newStr += i;
} }
} }
return newStr return newStr;
} }
return str return str;
}, },
// 成功提示 // 成功提示
successMsg(message,duration = 3000) { successMsg(message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
}, },
// 警告提示 // 警告提示
warningMsg(message,duration = 3000) { warningMsg(message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
}, },
// 错误提示 // 错误提示
errorMsg(message,duration = 3000) { errorMsg(message, duration = 3000) {
Message.closeAll(); Message.closeAll();
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration });
}, },
// 传入roleId,返回角色名称 // 传入roleId,返回角色名称
getRoleName(roleId){ getRoleName(roleId) {
return roleList[roleId] || '未知状态' return roleList[roleId] || "未知状态";
}, },
// 登录互踢 // 登录互踢
getToken(){ getToken() {
if(process.env.NODE_ENV != 'production'){ if (process.env.NODE_ENV != "production") {
if(store.state.user.dataTime && !logout){ if (store.state.user.dataTime && !logout) {
axios.get(`${api.queryToken}?token=${_local.get(Setting.tokenKey)}`).then(res => { axios.get(`${api.queryToken}?token=${_local.get(Setting.tokenKey)}`).then(res => {
if(store.state.user.dataTime && (res.data.message != store.state.user.dataTime)){ if (store.state.user.dataTime && (res.data.message != store.state.user.dataTime)) {
logout || Message.error('您已在另一台设备登录,本次登录已下线!') logout || Message.error("您已在另一台设备登录,本次登录已下线!");
logout = true logout = true;
setTimeout(() => { setTimeout(() => {
_local.remove(Setting.storeKey) _local.remove(Setting.storeKey);
_local.remove(Setting.tokenKey) _local.remove(Setting.tokenKey);
location.reload() location.reload();
},1500) }, 1500);
}
}).catch(err => {})
} }
}).catch(err => {
});
} }
} }
} },
debounce(fn, delay) { // 防抖
let timeout = null;
return function() {
const context = this;
const args = arguments;
clearTimeout(timeout);
timeout = setTimeout(() => {
fn.apply(context, args);
}, delay);
};
},
deepCopy(obj) { // 深拷贝
if (obj == null) {
return null;
}
if (typeof obj !== "object") return obj;
let result;
if (Array.isArray(obj)) {
result = [];
obj.forEach(item => {
result.push(
typeof item === "object" && !(item instanceof Date)
? util.deepCopy(item)
: item
);
});
} else {
result = {};
Object.keys(obj).forEach(key => {
result[key] =
typeof obj[key] === "object" && !(obj[key] instanceof Date)
? util.deepCopy(obj[key])
: obj[key];
});
}
return result;
}
};
export default util export default util;

@ -1,26 +1,26 @@
import Vue from 'vue'; import Vue from "vue";
import App from '@/App.vue'; import App from "@/App.vue";
import router from '@/router'; import router from "@/router";
import ElementUI from 'element-ui'; import ElementUI from "element-ui";
import '@/styles/index.scss' import "@/styles/index.scss";
import VueI18n from 'vue-i18n'; import VueI18n from "vue-i18n";
import mixinApp from '@/mixins/app'; import mixinApp from "@/mixins/app";
import { messages } from '@/i18n'; import { messages } from "@/i18n";
import 'babel-polyfill'; import "babel-polyfill";
import '@/libs/resize'; import "@/libs/resize";
import { post, get, del, put } from '@/plugins/requests/index.js'; import { post, get, del, put } from "@/plugins/requests/index.js";
import api from '@/api'; import api from "@/api";
import store from '@/store' import store from "@/store";
import Setting from '@/setting'; import Setting from "@/setting";
import permission from '@/router/permission'; import permission from "@/router/permission";
// 插件 // 插件
import plugins from '@/plugins'; import plugins from "@/plugins";
import filters from '@/plugins/filters' import filters from "@/plugins/filters";
Vue.use(plugins); Vue.use(plugins);
Object.keys(filters).forEach(item => Vue.filter(item, filters[item])) Object.keys(filters).forEach(item => Vue.filter(item, filters[item]));
Vue.prototype.api = api; Vue.prototype.api = api;
Vue.prototype.$get = get; Vue.prototype.$get = get;
@ -30,7 +30,7 @@ Vue.prototype.$put = put;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(VueI18n); Vue.use(VueI18n);
Vue.use(ElementUI, { size: 'small' }); Vue.use(ElementUI, { size: "small" });
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: Setting.i18n.default, locale: Setting.i18n.default,
messages messages
@ -42,4 +42,4 @@ new Vue({
i18n, i18n,
store, store,
render: h => h(App) render: h => h(App)
}).$mount('#app'); }).$mount("#app");

@ -4,8 +4,8 @@
export default { export default {
methods: { methods: {
// 当 $route 更新时触发 // 当 $route 更新时触发
appRouteChange (to, from) { appRouteChange(to, from) {
} }
} }
} };

@ -1,8 +1,8 @@
export default { export default {
beforeCreate() { beforeCreate() {
document.querySelector('body').setAttribute('style', 'background-color:#fff') document.querySelector("body").setAttribute("style", "background-color:#fff");
}, },
beforeDestroy() { beforeDestroy() {
document.body.removeAttribute('style') document.body.removeAttribute("style");
} }
} };

@ -28,7 +28,7 @@
@keyup.enter.native="submitForm('param')" @keyup.enter.native="submitForm('param')"
> >
</el-input> </el-input>
<img style="cursor: pointer;" @click="blur" :src="verificationIMG" class="verification" alt=""> <img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button> <el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button>
</el-form> </el-form>
@ -54,7 +54,7 @@
@keyup.enter.native="submitForm('param')" @keyup.enter.native="submitForm('param')"
> >
</el-input> </el-input>
<img style="cursor: pointer;" @click="blur" :src="verificationIMG" class="verification" alt=""> <img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button> <el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button>
</el-form> </el-form>
@ -68,70 +68,73 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from "vuex";
import vFooter from '@/layouts/footer' import vFooter from "@/layouts/footer";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
data: function() { data: function() {
return { return {
isHh: Setting.isHh, isHh: Setting.isHh,
tabName: "1", tabName: "1",
param: { param: {
account: 'admin', account: "admin",
password: '111aaa', password: "111aaa",
code: '', // code: "", //
random: '', // random: "", //
distinguish: null, // ,1,2 distinguish: null, // ,1,2
platform: 3, // 123 platform: 3 // 123
}, },
rules: { rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }], account: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }], code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
}, },
verificationIMG: "" verificationIMG: ""
}; };
}, },
components: { components: {
vFooter, vFooter
}, },
methods: { methods: {
...mapActions('user', [ ...mapActions("user", [
'login' "login"
]), ]),
submitForm(form) { submitForm(form) {
this.$refs[form].validate(valid => { this.$refs[form].validate(valid => {
if (valid) { if (valid) {
this.param.distinguish = this.tabName === '1' ? 1 : 2; this.param.distinguish = this.tabName === "1" ? 1 : 2;
this.login(this.param).then(() => { this.login(this.param).then(() => {
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index' let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index";
this.$router.replace(redirect) this.$router.replace(redirect);
}).catch(res => {}) }).catch(res => {
});
} else { } else {
return util.errorMsg('请检查表单数据') return util.errorMsg("请检查表单数据");
} }
}); });
}, },
blur() { blur() {
this.param.random = Math.floor(Math.random()*999999999); this.param.random = Math.floor(Math.random() * 999999999);
this.verificationIMG = this.api.verification+'?random='+`${this.param.random}`; this.verificationIMG = this.api.verification + "?random=" + `${this.param.random}`;
} }
}, },
created(){ created() {
this.blur(); this.blur();
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap{ .wrap {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url(../../../assets/img/login-bg.png); background-image: url(../../../assets/img/login-bg.png);
background-size: 100%; background-size: 100%;
.header{
.header {
width: 100%; width: 100%;
height: 60px; height: 60px;
position: absolute; position: absolute;
@ -142,68 +145,79 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-size: 18px; font-size: 18px;
.logo{
.logo {
width: 150px; width: 150px;
margin-left: 20px; margin-left: 20px;
&.hh{
&.hh {
width: 220px; width: 220px;
} }
} }
} }
/deep/.main{
/deep/ .main {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 42px; top: 42px;
transform: translate(-50%,0); transform: translate(-50%, 0);
width: 1200px; width: 1200px;
height: 82%; height: 82%;
margin-top: 60px; margin-top: 60px;
background-image: url(../../../assets/img/login-input.png); background-image: url(../../../assets/img/login-input.png);
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); box-shadow: 0px 0px 79px 0px rgba(11, 15, 65, 0.36);
overflow: hidden; overflow: hidden;
.box { .box {
width: 548px; width: 548px;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 50px; top: 50px;
transform: translate(-50%,0); transform: translate(-50%, 0);
.el-tabs__nav-scroll{
.el-tabs__nav-scroll {
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.el-tabs__nav-wrap::after{
.el-tabs__nav-wrap::after {
background-color: #fff; background-color: #fff;
opacity: 0; opacity: 0;
.el-tabs__active-bar{
.el-tabs__active-bar {
background-color: #000; background-color: #000;
border-radius:2px; border-radius: 2px;
} }
.el-tabs__item{
.el-tabs__item {
padding: 0 90px; padding: 0 90px;
color: #999; color: #999;
&:hover{
&:hover {
color: #000; color: #000;
} }
&.is-active{
&.is-active {
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
} }
} }
.el-input__inner{ .el-input__inner {
height: 80px; height: 80px;
line-height: 80px; line-height: 80px;
border:1px solid rgba(220,220,220,1); border: 1px solid rgba(220, 220, 220, 1);
border-radius:2px; border-radius: 2px;
} }
.verification{ .verification {
position: absolute; position: absolute;
top: 1px; top: 1px;
right: 1px; right: 1px;
width: 160px; width: 160px;
height: 78px; height: 78px;
cursor: pointer;
} }
.btn { .btn {
@ -211,13 +225,14 @@ export default {
height: 88px; height: 88px;
margin-bottom: 50px; margin-bottom: 50px;
font-weight: bold; font-weight: bold;
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1)); background: linear-gradient(90deg, rgba(94, 206, 253, 1), rgba(91, 67, 231, 1));
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51); box-shadow: 0px 7px 27px 0px rgba(50, 129, 255, 0.51);
border-radius:10px; border-radius: 10px;
} }
} }
} }
.footer{
.footer {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;

@ -19,11 +19,11 @@
<div class="nums"> <div class="nums">
<div class="item"> <div class="item">
<p class="name">实验总人数</p> <p class="name">实验总人数</p>
<p class="val">{{total}}</p> <p class="val">{{ total }}</p>
</div> </div>
<div class="item"> <div class="item">
<p class="name">实验平均分</p> <p class="name">实验平均分</p>
<p class="val">{{avg}}</p> <p class="val">{{ avg }}</p>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
@ -42,14 +42,14 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center"> <el-table-column prop="experimentalName" label="考核名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{experimentalName}} {{ experimentalName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="className" prop="class" label="班级" align="center"> <el-table-column v-if="className" prop="class" label="班级" align="center">
@ -76,9 +76,10 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import echarts from 'echarts' import echarts from "echarts";
export default { export default {
data() { data() {
return { return {
@ -88,17 +89,17 @@ export default {
projectName: this.$route.query.name, projectName: this.$route.query.name,
experimentalName: this.$route.query.experimentalName, experimentalName: this.$route.query.experimentalName,
className: this.$route.query.class, className: this.$route.query.class,
keyword: '', keyword: "",
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
avg: 0, avg: 0
}; };
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
@ -108,88 +109,93 @@ export default {
size: this.pageSize, size: this.pageSize,
searchContant: this.keyword, searchContant: this.keyword,
projectId: this.id projectId: this.id
} };
this.$get(this.api.queryEvaluationReport,data).then(res => { this.$get(this.api.queryEvaluationReport, data).then(res => {
let list = res.data.list let list = res.data.list;
let score = 0 let score = 0;
list.map(n => { list.map(n => {
n.class = this.className n.class = this.className;
score += n.score score += n.score;
}) });
this.listData = list this.listData = list;
this.total = res.data.totalCount this.total = res.data.totalCount;
this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0 this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0;
this.getChart() this.getChart();
}).catch(res => {}); }).catch(res => {
});
}, },
edit(row){ edit(row) {
if(this.systemId == 2 || this.systemId == 3){ if (this.systemId == 2 || this.systemId == 3) {
this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
this.$router.push(`addexperiment?id=${row.reportId}`) this.$router.push(`addexperiment?id=${row.reportId}`);
} }
}, },
show(row){ show(row) {
if(this.systemId == 2){ if (this.systemId == 2) {
this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else if(this.systemId == 3){ } else if (this.systemId == 3) {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
if(this.className){ if (this.className) {
this.$router.push(`show?id=${row.recordId}&projectId=${this.id}&reportId=${row.reportId}&studentId=${row.studentId}`) this.$router.push(`show?id=${row.recordId}&projectId=${this.id}&reportId=${row.reportId}&studentId=${row.studentId}`);
}else{ } else {
this.$router.push(`show?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`);
} }
} }
}, },
exportData(){ exportData() {
if(!this.listData.length) return false if (!this.listData.length) return false;
let selected = this.multipleSelection let selected = this.multipleSelection;
let exportList = [] let exportList = [];
if(selected.length){ if (selected.length) {
exportList = selected.map(item => { exportList = selected.map(item => {
return item.recordId return item.recordId;
}) });
}else{ } else {
exportList = this.listData.map(item => { exportList = this.listData.map(item => {
return item.recordId return item.recordId;
}) });
} }
window.open(`${this.api.exportAchievement}?ids=${exportList.join(',')}&projectId=${this.projectId}&source=2`) window.open(`${this.api.exportAchievement}?ids=${exportList.join(",")}&projectId=${this.projectId}&source=2`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => { this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return `reportId=${item.reportId}` return `reportId=${item.reportId}`;
}) });
let delList1 = newArr.map(item => { let delList1 = newArr.map(item => {
return `recordId=${item.recordId}` return `recordId=${item.recordId}`;
}) });
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => { this.$post(`${this.api.deleteReport}?${delList.join("&")}&${delList1.join("&")}`).then(res => {
util.successMsg('删除成功') util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}) }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
}else{ });
util.errorMsg('请先选择数据 !') } else {
util.errorMsg("请先选择数据 !");
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -199,75 +205,79 @@ export default {
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
getChart(){ getChart() {
let data = [0,0,0,0,0,0,0,0,0,0] let data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
let list = this.listData let list = this.listData;
list.map(n => { list.map(n => {
n.score n.score;
if(n.score >= 0 && n.score <= 10){ if (n.score >= 0 && n.score <= 10) {
data[0]++ data[0]++;
}else if(n.score > 10 && n.score <= 20){ } else if (n.score > 10 && n.score <= 20) {
data[1]++ data[1]++;
}else if(n.score > 20 && n.score <= 30){ } else if (n.score > 20 && n.score <= 30) {
data[2]++ data[2]++;
}else if(n.score > 30 && n.score <= 40){ } else if (n.score > 30 && n.score <= 40) {
data[3]++ data[3]++;
}else if(n.score > 40 && n.score <= 50){ } else if (n.score > 40 && n.score <= 50) {
data[4]++ data[4]++;
}else if(n.score > 50 && n.score <= 60){ } else if (n.score > 50 && n.score <= 60) {
data[5]++ data[5]++;
}else if(n.score > 60 && n.score <= 70){ } else if (n.score > 60 && n.score <= 70) {
data[6]++ data[6]++;
}else if(n.score > 70 && n.score <= 80){ } else if (n.score > 70 && n.score <= 80) {
data[7]++ data[7]++;
}else if(n.score > 80 && n.score <= 90){ } else if (n.score > 80 && n.score <= 90) {
data[8]++ data[8]++;
}else if(n.score > 90 && n.score <= 100){ } else if (n.score > 90 && n.score <= 100) {
data[9]++ data[9]++;
} }
}) });
let myChart = echarts.init(document.getElementById('chart')) let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({ myChart.setOption({
title: { text: '实验分数分布图' }, title: { text: "实验分数分布图" },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: '分数', name: "分数",
type: 'category', type: "category",
boundaryGap: false, boundaryGap: false,
data: ['0-10', '11-20', '21-30', '31-40', '41-50', '51-60', '61-70', '71-80','81-90','91-100'] data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
}, },
yAxis: { yAxis: {
name: '人数', name: "人数",
type: 'value' type: "value"
}, },
series: [{ series: [{
data, data,
type: 'line', type: "line",
areaStyle: {}, areaStyle: {},
color: ['#8191fd'] color: ["#8191fd"]
}] }]
}) });
}, },
goBack() { goBack() {
this.$router.back() this.$router.back();
}, }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-tabs__nav-wrap::after{ /deep/ .el-tabs__nav-wrap::after {
display: none; display: none;
} }
.stat{
.stat {
display: flex; display: flex;
.nums { .nums {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
.item:nth-child(1) { .item:nth-child(1) {
background-image: url('../../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.item:nth-child(2) { .item:nth-child(2) {
background-image: url('../../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
@ -280,18 +290,21 @@ export default {
border-radius: 8px; border-radius: 8px;
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
p { p {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
.val{
.val {
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 36px; font-size: 36px;
} }
} }
} }
.chart{
.chart {
flex: 1; flex: 1;
height: 300px; height: 300px;
} }

@ -96,7 +96,7 @@
<el-table :data="expData" class="table" stripe header-align="center"> <el-table :data="expData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + 1}} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="module" label="模块" align="center"> <el-table-column prop="module" label="模块" align="center">
@ -121,7 +121,8 @@
<div class="flex-between" style="margin-top: 10px"> <div class="flex-between" style="margin-top: 10px">
<span>教师评分</span> <span>教师评分</span>
<div> <div>
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10) <el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input>
(10)
</div> </div>
</div> </div>
</el-card> </el-card>
@ -135,7 +136,8 @@
<div class="flex-between" style="margin-top: 10px"> <div class="flex-between" style="margin-top: 10px">
<span>教师评分</span> <span>教师评分</span>
<div> <div>
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10) <el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input>
(10)
</div> </div>
</div> </div>
</el-card> </el-card>
@ -192,48 +194,48 @@
</template> </template>
<script> <script>
export default { export default {
data (){ data() {
return { return {
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
id: this.$route.query.id, id: this.$route.query.id,
infoData: [], infoData: [],
accountData: [], accountData: [],
analysisContent: '', analysisContent: "",
showData: '1', showData: "1",
autograph: '1', autograph: "1",
form: { form: {
projectName: '', projectName: "",
period: '', period: "",
userName: '', userName: "",
content: '', content: "",
conclusion: '', conclusion: "",
score: '', score: ""
}, },
pages: 1, pages: 1,
ipVisible: false, ipVisible: false,
configId : this.$store.state.configId, configId: this.$store.state.configId,
keyword: '', keyword: "",
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}], fileList: [{ name: "food.jpeg", url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100" }],
isEdit: false, isEdit: false,
signList: [], signList: [],
signId: '' signId: ""
} };
}, },
mounted(){ mounted() {
this.getData() this.getData();
this.getSgin() this.getSgin();
}, },
methods: { methods: {
getData(){ getData() {
let data = { let data = {
// reportId: this.id // reportId: this.id
reportId: 97 reportId: 97
} };
this.$get(this.api.queryReport,data).then(res => { this.$get(this.api.queryReport, data).then(res => {
this.form = res.data.report this.form = res.data.report;
this.form.score = res.data.record.score this.form.score = res.data.record.score;
let form = this.form let form = this.form;
this.infoData.push({ this.infoData.push({
projectName: form.projectName, projectName: form.projectName,
period: form.period, period: form.period,
@ -242,45 +244,47 @@
conclusion: form.conclusion, conclusion: form.conclusion,
score: form.score, score: form.score,
analysis: form.analysis analysis: form.analysis
}) });
}).catch(res => {}); }).catch(res => {
});
}, },
getSgin(){ getSgin() {
let data = { let data = {
userId: this.userId userId: this.userId
} };
this.$get(this.api.querySignature,data).then(res => { this.$get(this.api.querySignature, data).then(res => {
this.signList = res.data this.signList = res.data;
}).catch(res => {}); }).catch(res => {
});
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log(file, fileList); console.log(file, fileList);
}, },
saveAdd(){ saveAdd() {
let data = { let data = {
systemId: this.configId, systemId: this.configId,
systemName: this.form.systemName, systemName: this.form.systemName,
systemType: this.form.systemType, systemType: this.form.systemType,
systemAttribution: this.form.systemAttribution, systemAttribution: this.form.systemAttribution
} };
if(this.configId){ if (this.configId) {
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig, data).then((res) => {
util.successMsg('编辑成功'); util.successMsg("编辑成功");
this.$router.back() this.$router.back();
}).catch((res) => { }).catch((res) => {
}) });
}else{ } else {
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig, data).then((res) => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.$router.back() this.$router.back();
}).catch((res) => { }).catch((res) => {
}) });
} }
}, },
SpanMethod({ row, column, rowIndex, columnIndex }) { SpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
if (columnIndex === 6) { if (columnIndex === 6) {
if(!row.Intranet){ if (!row.Intranet) {
return [1, 2]; return [1, 2];
} }
} }
@ -289,80 +293,91 @@
// } // }
} }
}, },
editMsg(){ editMsg() {
this.isEdit = true this.isEdit = true;
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
uploadSuccess(res,file){ uploadSuccess(res, file) {
if(res.status == 200){ if (res.status == 200) {
util.successMsg('上传成功') util.successMsg("上传成功");
this.getSgin() this.getSgin();
}else{ } else {
$message.error(res.errmessage) $message.error(res.errmessage);
} }
}, },
goback() { goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$router.back() this.$router.back();
}) })
.catch(() => {}); .catch(() => {
} });
} }
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.meta-title{ .meta-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 20px; font-size: 20px;
} }
.step-title{
.step-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 16px; font-size: 16px;
color: #9278ff; color: #9278ff;
} }
.border_lf{
.border_lf {
border-left: 1px dashed #eee; border-left: 1px dashed #eee;
padding: 0 60px; padding: 0 60px;
} }
.border_lf label{
.border_lf label {
width: 120px; width: 120px;
} }
.pad_none{
.pad_none {
padding: 0 0 0 60px; padding: 0 0 0 60px;
} }
.edit-msg{
.edit-msg {
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
} }
.sign-select{
/deep/.el-input{ .sign-select {
/deep/ .el-input {
width: 150px; width: 150px;
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.meta-title-wrap{
.meta-title-wrap {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.meta-title{
.meta-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
} }
.step-title{
.step-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 16px; font-size: 16px;
color: #9278ff; color: #9278ff;
} }
.bd-title{
.bd-title {
padding-top: 20px; padding-top: 20px;
border-top: 1px dashed #ccc; border-top: 1px dashed #ccc;
} }
</style> </style>

@ -6,16 +6,31 @@
<li> <li>
<label>时间</label> <label>时间</label>
<el-radio-group size="small" v-model="month" @change="initData"> <el-radio-group size="small" v-model="month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> <el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li> </li>
<li> <li>
<label>实验项目分类</label> <label>实验项目分类</label>
<el-radio-group size="small" v-model="projectPermissions" @change="initData"> <el-radio-group size="small" v-model="projectPermissions" @change="initData">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
</li> </li>
<li v-show="projectPermissions === 1">
<label>班级</label>
<el-select size="small" v-model="classId" placeholder="请选择" @change="initData">
<el-option
v-for="item in classList"
:key="item.id"
:label="item.className"
:value="item.id"
></el-option>
</el-select>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li> <li>
<label>系统</label> <label>系统</label>
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData"> <el-select size="small" v-model="systemId" placeholder="请选择" @change="initData">
@ -28,9 +43,10 @@
</el-select> </el-select>
</li> </li>
<li> <li>
<el-input size="small" placeholder="请输入实验项目名称/班级名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input size="small" placeholder="请输入实验项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button> <el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
</div> </div>
@ -40,27 +56,27 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<template v-if="projectPermissions == 1"> <template v-if="projectPermissions == 1">
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column> <el-table-column prop="className" label="班级" align="center"></el-table-column>
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column> <el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column>
</template> </template>
<el-table-column prop="projectName" label="项目名称" align="center"> <el-table-column prop="projectName" label="项目名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="projectPermissions" label="分类" align="center"> <el-table-column prop="projectPermissions" label="分类" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.projectPermissions == 2 ? '竞赛' : projectType.find(n => n.id === scope.row.projectPermissions).name}} {{ scope.row.permissions == 2 ? "竞赛" : projectType.find(n => n.id === scope.row.permissions).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="number" label="成绩报告数量" align="center"></el-table-column> <el-table-column prop="experimentalNumber" label="成绩报告数量" align="center"></el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center"> <el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button> <el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button>
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isdel">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isDel">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -71,207 +87,210 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import { Loading } from 'element-ui' import { Loading } from "element-ui";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
name: 'achievement', name: "achievement",
data() { data() {
return { return {
systemId: '', classId: "",
classList: [],
systemId: "",
systemList: Setting.systemList, systemList: Setting.systemList,
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0, projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0,
keyword: '', keyword: "",
startingtime: '', searchTimer: null,
endTime: '', startingtime: "",
month: '', endTime: "",
month: "",
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
dateList: [ dateList: [
{ {
id: '', id: "",
name: '不限' name: "不限"
}, },
{ {
id: 1, id: 1,
name: '近一个月' name: "近一个月"
}, },
{ {
id: 6, id: 6,
name: '近六个月' name: "近六个月"
} }
], ],
projectType: [ projectType: [
{ {
id: 0, id: 0,
name: '练习' name: "练习"
}, },
{ {
id: 1, id: 1,
name: '考核' name: "考核"
} }
], ],
date: '', date: "",
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
loadIns: null, loadIns: null,
listDataAll: []
}; };
}, },
computed: { computed: {
...mapState('user', [ ...mapState("project", [
'userId' "lastSystemId"
]), ])
...mapState('project', [
'lastSystemId'
]),
}, },
watch: { watch: {
month: function(val){ month: function(val) {
if(val){ if (val) {
let unit = 24 * 60 * 60 * 1000 let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
}else{ } else {
this.date = [] this.date = [];
} }
}, },
date: function(val){ date: function(val) {
if(val){ if (val) {
this.startingtime = val[0] this.startingtime = val[0];
this.endTime = val[1] this.endTime = val[1];
}else{ } else {
this.startingtime = '' this.startingtime = "";
this.endTime = '' this.endTime = "";
} }
this.initData() this.initData();
}, },
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData();
},500) }, 500);
} }
}, },
mounted() { mounted() {
// systemIdsystemIdsystemId // systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId;
this.getData() this.getData();
this.getClassData();
}, },
methods: { methods: {
...mapActions('project', [ ...mapActions("project", [
'setSystemId' "setSystemId"
]), ]),
getClassData() { //
this.$post(this.api.myClass).then(res => {
this.classList = res.list;
}).catch(res => { });
},
getData() { getData() {
this.loadIns = Loading.service({ this.loadIns = Loading.service({
background: 'rgba(255,255,255,.6)' background: "rgba(255,255,255,.6)"
}) });
let data = { let data = {
searchContant: util.encodeStr(this.keyword), classId: this.classId,
permissions: this.projectPermissions,
systemId: this.systemId,
keyWord: this.keyword,
startTime: this.startingtime, startTime: this.startingtime,
endTime: this.endTime, endTime: this.endTime,
month: this.month, month: this.month,
page: this.page, pageNum: this.page,
size: this.pageSize, pageSize: this.pageSize
userId: this.userId };
}
let url = this.api.queryAchievement this.$post(this.api.getAchievementInfo, data).then(res => {
if(this.projectPermissions){ this.listData = res.page.records;
data.systemId = this.systemId this.total = res.page.total;
url = this.api.queryAchievementNew
}else{
data.systemId = this.systemId
data.projectPermissions = this.projectPermissions
}
this.$get(url,data).then(res => {
this.listData = res.data.list
this.total = res.data.total
this.$nextTick(() => { this.$nextTick(() => {
this.loadIns.close() this.loadIns.close();
}) });
}).catch(res => { }).catch(res => {
this.loadIns.close() this.loadIns.close();
}) });
},
handlePage(){
let list = this.listDataAll
let result = []
list.map(n => {
if(!n.projectHiddenEntity) result.push(n)
})
this.listData = result.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.total = result.length
}, },
initData(){ initData() {
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
this.page = 1 this.page = 1;
this.getData() this.getData();
}, },
disabledSelection(row,index){ disabledSelection(row, index) { //
if(row.isdel == 0) return false if (row.isDel === 0) return false;
return true return true;
}, },
entry(row){ entry(row) { //
this.setSystemId(this.systemId) this.setSystemId(this.systemId);
if(this.projectPermissions){ if (this.projectPermissions === 1) {
this.$router.push(`teach?id=${row.id}&name=${row.experimentalName}&class=${row.experimentalClassName}&projectId=${row.projectId}&systemId=${this.systemId}`) let list = row.classList.map(i => {
}else{ return {id: i.id.toString(), name: i.className}
this.$router.push(`vir?id=${row.projectId}&name=${row.projectName}&class=${row.experimentalClassName}&systemId=${this.systemId}`) })
this.$router.push(`teach?assessmentId=${row.assessmentId}&projectName=${row.projectName}&permissions=${row.permissions}&systemId=${this.systemId}&classList=${JSON.stringify(list)}`);
} else {
this.$router.push(`vir?projectId=${row.projectId}&projectName=${row.projectName}&permissions=${row.permissions}&systemId=${this.systemId}`);
} }
}, },
handleDelete(row) { handleDelete(row) { //
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: 'warning' type: "warning"
}) }).then(() => {
.then(() => { let url = "";
this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => { if (this.projectPermissions === 0) {
util.successMsg('删除成功') url = `${this.api.deleteExperimentalReport}?projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`
this.getData() } else {
}).catch(res => {}) url = `${this.api.deleteExperimentalReport}?ids=${row.assessmentId}&projectIds=${row.projectId}&projectPermissions=${this.projectPermissions}`
}) }
.catch(() => {}) this.$post(url).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => {
});
}, },
delAllData() { delAllData() { //
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length) {
let newArr = this.multipleSelection this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
let delList = newArr.map(item => { type: "warning"
return `projectIds=${item.projectId}` }).then(() => {
}) let url = "";
let delList1 = newArr[0].id ? newArr.map(item => { let ids = [];
return `ids=${item.id}` let projectIds = this.multipleSelection.map(item => {
}) : [] return item.projectId;
});
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { if (this.projectPermissions === 0) {
type: 'warning' url = `${this.api.deleteExperimentalReport}?projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
}) } else {
.then(() => { ids = this.multipleSelection.map(item => {
let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}` return item.assessmentId;
this.$post(`${this.api.deleteReportById}?${data}`).then(res => { });
url = `${this.api.deleteExperimentalReport}?ids=${ids.toString()}&projectIds=${projectIds.toString()}&projectPermissions=${this.projectPermissions}`
}
this.$post(url).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功') util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}) }).catch(res => {});
}) }).catch(() => {});
.catch(() => {}) } else {
}else{ util.errorMsg("请先选择数据 !");
util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) { //
this.multipleSelection = val this.multipleSelection = val;
},
handleCurrentChange(val) {
this.page = val
this.getData()
}, },
handleCurrentChange(val) { //
this.page = val;
this.getData();
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-radio.is-bordered+.el-radio.is-bordered{ .el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0; margin-left: 0;
} }
</style> </style>

@ -56,7 +56,7 @@
<el-table :data="expData" class="table" stripe header-align="center"> <el-table :data="expData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + 1}} {{ scope.$index + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="judgmentPointsName" label="任务名称" align="center"> <el-table-column prop="judgmentPointsName" label="任务名称" align="center">
@ -89,34 +89,35 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default {
data (){ export default {
data() {
return { return {
title: '实验报告', title: "实验报告",
form: { form: {
analysis: '', analysis: "",
conclusion: '', conclusion: "",
content: ``, content: ``,
data: '', data: "",
purpose: ``, purpose: ``,
experimentId: '', experimentId: "",
experimentalClassName: '', experimentalClassName: "",
improvement: '', improvement: "",
laboratory: '', laboratory: "",
period: '', period: "",
principle: '', principle: "",
proName: '', proName: "",
score: 0, score: 0,
step: ``, step: ``,
submitTime: '', submitTime: "",
summarize: '', summarize: "",
instructor: '', instructor: "",
userId: this.userId, userId: this.userId,
userName: '', userName: "",
workNumber: '', workNumber: ""
}, },
type: this.$route.query.type, type: this.$route.query.type,
id: this.$route.query.id, id: this.$route.query.id,
@ -127,51 +128,54 @@ import Setting from '@/setting'
infoData: [], infoData: [],
expData: [], expData: [],
accountData: [], accountData: [],
showData: '1', showData: "1",
autograph: '1', autograph: "1",
pages: 1, pages: 1,
ipVisible: false, ipVisible: false,
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}], fileList: [{ name: "food.jpeg", url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100" }, {
name: "food2.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100"
}],
conclusionOptions: [ conclusionOptions: [
{ {
value: 1, value: 1,
label: '结论符合预期' label: "结论符合预期"
}
],
} }
]
};
}, },
computed: { computed: {
...mapState('user', [ ...mapState("user", [
'userId' "userId"
]), ])
}, },
mounted(){ mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData(){ getData() {
if(this.type){ if (this.type) {
let data = { let data = {
recordId: this.id, recordId: this.id
} };
this.$get(this.api.queryVirtualReport,data).then(res => { this.$get(this.api.queryVirtualReport, data).then(res => {
this.form = res.data.report this.form = res.data.report;
let expData = res.data.data let expData = res.data.data;
let form = this.form let form = this.form;
let score = form.score let score = form.score;
if(expData){ if (expData) {
if(score){ if (score) {
expData.map(n => { expData.map(n => {
if(n.isError){ if (n.isError) {
score -= n.codeScore score -= n.codeScore;
n.codeScore = 0 n.codeScore = 0;
} }
}) });
form.score = score form.score = score;
} }
this.expData = expData this.expData = expData;
} }
this.infoData.push({ this.infoData.push({
@ -183,33 +187,34 @@ import Setting from '@/setting'
submitTime: form.submitTime, submitTime: form.submitTime,
score: form.score, score: form.score,
userName: form.userName userName: form.userName
}) });
}).catch(res => {}); }).catch(res => {
}else{ });
} else {
let data = { let data = {
studentId: this.studentId, studentId: this.studentId,
projectId: this.projectId, projectId: this.projectId,
recordId: this.id, recordId: this.id,
reportId: this.reportId reportId: this.reportId
} };
this.$get(this.api.queryArchievement,data).then(res => { this.$get(this.api.queryArchievement, data).then(res => {
this.form = res.data.report ? res.data.report : {} this.form = res.data.report ? res.data.report : {};
let expData = res.data.data let expData = res.data.data;
let form = this.form let form = this.form;
let score = form.score let score = form.score;
if(expData){ if (expData) {
if(score){ if (score) {
expData.map(n => { expData.map(n => {
if(n.isError){ if (n.isError) {
score -= n.codeScore score -= n.codeScore;
n.codeScore = 0 n.codeScore = 0;
} }
}) });
form.score = score form.score = score;
} }
this.expData = expData this.expData = expData;
} }
this.infoData.push({ this.infoData.push({
workNumber: form.workNumber, workNumber: form.workNumber,
@ -220,8 +225,9 @@ import Setting from '@/setting'
submitTime: form.submitTime, submitTime: form.submitTime,
score: form.score, score: form.score,
userName: form.userName userName: form.userName
}) });
}).catch(res => {}); }).catch(res => {
});
} }
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
@ -230,25 +236,25 @@ import Setting from '@/setting'
handlePreview(file) { handlePreview(file) {
console.log(file); console.log(file);
}, },
saveAdd(){ saveAdd() {
let data = { let data = {
systemId: this.configId, systemId: this.configId,
systemName: this.form.systemName, systemName: this.form.systemName,
systemType: this.form.systemType, systemType: this.form.systemType,
systemAttribution: this.form.systemAttribution, systemAttribution: this.form.systemAttribution
} };
if(this.configId){ if (this.configId) {
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig, data).then((res) => {
util.successMsg('编辑成功'); util.successMsg("编辑成功");
this.goBack() this.goBack();
}).catch((res) => { }).catch((res) => {
}) });
}else{ } else {
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig, data).then((res) => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.goBack() this.goBack();
}).catch((res) => { }).catch((res) => {
}) });
} }
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
@ -258,7 +264,7 @@ import Setting from '@/setting'
SpanMethod({ row, column, rowIndex, columnIndex }) { SpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
if (columnIndex === 6) { if (columnIndex === 6) {
if(!row.Intranet){ if (!row.Intranet) {
return [1, 2]; return [1, 2];
} }
} }
@ -267,131 +273,153 @@ import Setting from '@/setting'
// } // }
} }
}, },
goBack(){ goBack() {
this.$router.go(-1) this.$router.go(-1);
}, },
exportPage(){ exportPage() {
var title = this.title; var title = this.title;
html2Canvas(document.querySelector('#pdfDom'), { html2Canvas(document.querySelector("#pdfDom"), {
allowTaint: true allowTaint: true
}).then(function (canvas) { }).then(function(canvas) {
let contentWidth = canvas.width let contentWidth = canvas.width;
let contentHeight = canvas.height let contentHeight = canvas.height;
let pageHeight = contentWidth / 592.28 * 841.89 let pageHeight = contentWidth / 592.28 * 841.89;
let leftHeight = contentHeight let leftHeight = contentHeight;
let position = 0 let position = 0;
let imgWidth = 595.28 let imgWidth = 595.28;
let imgHeight = 592.28 / contentWidth * contentHeight let imgHeight = 592.28 / contentWidth * contentHeight;
let pageData = canvas.toDataURL('image/jpeg', 1.0) let pageData = canvas.toDataURL("image/jpeg", 1.0);
let PDF = new JsPDF('', 'pt', 'a4') let PDF = new JsPDF("", "pt", "a4");
if (leftHeight < pageHeight) { if (leftHeight < pageHeight) {
PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight) PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
} else { } else {
while (leftHeight > 0) { while (leftHeight > 0) {
PDF.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight) PDF.addImage(pageData, "JPEG", 0, position, imgWidth, imgHeight);
leftHeight -= pageHeight leftHeight -= pageHeight;
position -= 841.89 position -= 841.89;
if (leftHeight > 0) { if (leftHeight > 0) {
PDF.addPage() PDF.addPage();
}
} }
} }
PDF.save(title + '.pdf')
} }
) PDF.save(title + ".pdf");
} }
);
} }
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box{ .box {
padding: 0 50px; padding: 0 50px;
background-color: #fff; background-color: #fff;
} }
/deep/.el-textarea.is-disabled .el-textarea__inner{
/deep/ .el-textarea.is-disabled .el-textarea__inner {
color: #777; color: #777;
background-color: #e5dfff; background-color: #e5dfff;
} }
.pre-wrap{
.pre-wrap {
min-height: 117px; min-height: 117px;
padding: 5px 15px; padding: 5px 15px;
color: #777; color: #777;
background-color: #e5dfff; background-color: #e5dfff;
} }
#pdfDom{
#pdfDom {
padding: 50px; padding: 50px;
/deep/.info-table{
/deep/ .info-table {
margin-bottom: 40px; margin-bottom: 40px;
border: 0; border: 0;
th{
th {
background-color: #fff !important; background-color: #fff !important;
.cell{
.cell {
color: #444; color: #444;
} }
} }
tr{
tr {
border: 0; border: 0;
} }
tr:hover,tr:hover>td{
tr:hover, tr:hover > td {
background-color: #e5dfff !important; background-color: #e5dfff !important;
} }
td{
td {
border: { border: {
left: 4px solid #fff; left: 4px solid #fff;
right: 4px solid #fff; right: 4px solid #fff;
} }
&:first-child{
&:first-child {
border-left: 0; border-left: 0;
} }
&:last-child{
&:last-child {
border-right: 0; border-right: 0;
} }
background-color: #e5dfff; background-color: #e5dfff;
border-bottom: 0; border-bottom: 0;
} }
} }
/deep/.table th{
/deep/ .table th {
background-color: #e1eaff !important; background-color: #e1eaff !important;
.cell{
.cell {
color: #555555; color: #555555;
} }
} }
} }
/deep/.cell{ /deep/ .cell {
font-size: 12px; font-size: 12px;
} }
/deep/.el-row{
/deep/ .el-row {
padding-top: 20px; padding-top: 20px;
margin: 0 !important; margin: 0 !important;
} }
.form-item{
.form-item {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.form-item .el-input{
.form-item .el-input {
width: auto; width: auto;
} }
.form-item span{
.form-item span {
margin-right: 10px; margin-right: 10px;
} }
.meta-title-wrap{
.meta-title-wrap {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
span{
span {
font-size: 13px; font-size: 13px;
color: #444; color: #444;
} }
} }
.flex-between{
span{ .flex-between {
span {
font-size: 13px; font-size: 13px;
color: #444; color: #444;
} }
} }
.meta-title{
.meta-title {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 10px 20px; padding: 10px 20px;
@ -399,18 +427,21 @@ import Setting from '@/setting'
font-size: 16px; font-size: 16px;
color: #fff; color: #fff;
background-color: #9278ff; background-color: #9278ff;
img{
img {
width: 20px; width: 20px;
margin-right: 10px; margin-right: 10px;
} }
} }
.step-title{
.step-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 16px; font-size: 16px;
color: #9278ff; color: #9278ff;
} }
.bd-title{
.bd-title {
padding-top: 20px; padding-top: 20px;
border-top: 1px dashed #ccc; border-top: 1px dashed #ccc;
} }
</style> </style>

@ -1,29 +1,25 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-10"> <div class="flex-between m-b-20">
<el-page-header @back="goBack" :content="experimentalName"></el-page-header> <el-page-header @back="goBack" :content="experimentalName"></el-page-header>
</div> </div>
<el-form label-width="100px">
<div class="flex-between">
<div></div>
<div>
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in classList" :label="item.name" :name="item.id"></el-tab-pane>
</el-tabs>
<div class="stat"> <div class="stat">
<div class="nums"> <div class="nums">
<div class="item"> <div class="item">
<p class="name">实验总人数</p> <p class="name">实验总人数</p>
<p class="val">{{total}}</p> <p class="val">{{ peopleNum }}</p>
</div> </div>
<div class="item"> <div class="item">
<p class="name">实验平均分</p> <p class="name">实验平均分</p>
<p class="val">{{avg}}</p> <p class="val">{{ avgScore }}</p>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
@ -33,7 +29,13 @@
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<div> <div>
<el-input
size="small"
placeholder="请输入学校/学生姓名"
prefix-icon="el-icon-search"
v-model="keyword" clearable
style="width: 300px"
></el-input>
</div> </div>
<div> <div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button> <el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
@ -44,18 +46,16 @@
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center"> <el-table-column prop="experimentalName" label="考核名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{experimentalName}} {{ experimentalName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="className" prop="class" label="班级" align="center">
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column> <el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column> <el-table-column prop="score" label="分数" align="center"></el-table-column>
@ -78,201 +78,193 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import echarts from 'echarts' import echarts from "echarts";
export default { export default {
data() { data() {
return { return {
activeName: "", //
classId: "", // id
classList: [], //
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
id: this.$route.query.id, permissions: this.$route.query.permissions,
experimentalName: this.$route.query.name, experimentalName: this.$route.query.projectName,
className: this.$route.query.class, assessmentId: this.$route.query.assessmentId,
projectId: this.$route.query.projectId, keyword: "",
keyword: '', searchTimer: null,
listDataAll: [],
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
avg: 0, peopleNum: 0, //
avgScore: 0, //
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
created() {
this.classList = JSON.parse(this.$route.query.classList);
this.classId = this.classList[0].id;
this.activeName = this.classList[0].id;
// console.log(this.classList);
},
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { handleClick(tab, event) { //
let data = { if (this.classId === tab.name) return;
id: this.id this.classId = tab.name;
} this.getData();
this.$get(this.api.getTeachAchievement,data).then(res => {
let list = res.data
let score = 0
list.map(n => {
n.class = this.className
score += n.score
})
this.listDataAll = list
this.handlePage()
this.total = list.length
this.avg = score ? (score / list.length).toFixed(2) : 0
this.getChart()
}).catch(res => {});
}, },
handlePage(){ getData() { //
let list = this.listDataAll this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.assessmentId}&classId=${this.classId}&keyword=${this.keyword}`).then(res => {
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) this.listData = res.page.records;
this.total = list.length this.total = res.page.total;
this.avgScore = res.avgScore;
this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum);
}).catch(err => {
});
}, },
edit(row){ edit(row) {
if(this.systemId == 2 || this.systemId == 3){ if (this.systemId == 2 || this.systemId == 3) {
this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
this.$router.push(`addexperiment?id=${row.reportId}`) this.$router.push(`addexperiment?id=${row.reportId}`);
} }
}, },
show(row){ show(row) { //
if(this.systemId == 2){ if (this.systemId == 2) {
this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else if(this.systemId == 3){ } else if (this.systemId == 3) {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
if(this.className){ if (this.permissions) {
this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`) this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`);
}else{ } else {
this.$router.push(`show?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`);
} }
} }
}, },
exportData(){ exportData() { // ()
if(!this.listData.length) return false if (this.multipleSelection.length) {
let selected = this.multipleSelection let ids = this.multipleSelection.map(item => {
let exportList = [] return item.projectId;
if(selected.length){ });
exportList = selected.map(item => { location.href = `${this.api.exportAssessmentInfo}?ids=${ids.toString()}`;
return item.recordId } else {
}) location.href = `${this.api.exportAssessmentInfo}?ids=`;
}else{
exportList = this.listData.map(item => {
return item.recordId
})
} }
console.log(exportList.join(','),this.id,this.projectId)
window.open(`${this.api.exportAchievement}?ids=${exportList.join(',')}&projectId=${this.projectId}&source=2`)
}, },
handleDelete(row) { handleDelete(row) { //
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) }).then(() => {
.then(() => { this.$post(this.api.deleteExperimentalReport, [row.projectId]).then(res => {
this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => { util.successMsg("删除成功");
util.successMsg('删除成功') this.getData();
this.getData() }).catch(res => {
}).catch(res => {}); });
}) }).catch(() => {
.catch(() => {}); });
}, },
delAllData() { delAllData() { //
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length) {
let newArr = this.multipleSelection this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
let delList = newArr.map(item => { type: "warning"
return `reportId=${item.reportId}` }).then(() => {
}) let ids = this.multipleSelection.map(item => {
let delList1 = newArr.map(item => { return item.projectId;
return `recordId=${item.recordId}` });
}) this.$post(this.api.deleteExperimentalReport, ids).then(res => {
this.$confirm('确定要删除吗?', '提示', { this.multipleSelection = [];
type: 'warning' this.$refs.table.clearSelection();
}) util.successMsg("删除成功");
.then(() => { this.getData();
this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => { }).catch(res => {
util.successMsg('删除成功') });
this.getData() }).catch(() => {});
}).catch(res => {}) } else {
}) util.errorMsg("请先选择数据 !");
.catch(() => {});
}else{
util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) { //
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) { //
this.page = val; this.page = val;
this.handlePage(); this.handlePage();
}, },
getChart(){ getChart(num) { // 线
let data = [0,0,0,0,0,0,0,0,0,0] let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10];
let list = this.listData let myChart = echarts.init(document.getElementById("chart"));
list.map(n => {
n.score
if(n.score >= 0 && n.score <= 10){
data[0]++
}else if(n.score > 10 && n.score <= 20){
data[1]++
}else if(n.score > 20 && n.score <= 30){
data[2]++
}else if(n.score > 30 && n.score <= 40){
data[3]++
}else if(n.score > 40 && n.score <= 50){
data[4]++
}else if(n.score > 50 && n.score <= 60){
data[5]++
}else if(n.score > 60 && n.score <= 70){
data[6]++
}else if(n.score > 70 && n.score <= 80){
data[7]++
}else if(n.score > 80 && n.score <= 90){
data[8]++
}else if(n.score > 90 && n.score <= 100){
data[9]++
}
})
let myChart = echarts.init(document.getElementById('chart'))
myChart.setOption({ myChart.setOption({
title: { text: '实验分数分布图' }, title: { text: "实验分数分布图" },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: '分数', name: "分数",
type: 'category', type: "category",
boundaryGap: false, boundaryGap: false,
data: ['0-10', '11-20', '21-30', '31-40', '41-50', '51-60', '61-70', '71-80','81-90','91-100'] data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
}, },
yAxis: { yAxis: {
name: '人数', name: "人数",
type: 'value' type: "value"
}, },
series: [{ series: [{
data, data,
type: 'line', type: "line",
areaStyle: {}, areaStyle: {},
color: ['#8191fd'] color: ["#8191fd"]
}] }]
}) });
}, },
goBack() { goBack() {
this.$router.push('list?per=1') this.$router.push("/achievement/list?per=1");
}, }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-tabs__nav-wrap::after{
/deep/ .head-card {
.el-card__body{
padding-bottom: 0px;
.el-tabs__header{
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none; display: none;
}
.el-tabs__item{
font-size: 18px;
}
}
}
} }
.stat{
.stat {
display: flex; display: flex;
.nums { .nums {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
.item:nth-child(1) { .item:nth-child(1) {
background-image: url('../../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.item:nth-child(2) { .item:nth-child(2) {
background-image: url('../../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
@ -285,18 +277,21 @@ export default {
border-radius: 8px; border-radius: 8px;
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
p { p {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
.val{
.val {
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 36px; font-size: 36px;
} }
} }
} }
.chart{
.chart {
flex: 1; flex: 1;
height: 300px; height: 300px;
} }

@ -4,14 +4,6 @@
<div class="flex-between m-b-10"> <div class="flex-between m-b-10">
<el-page-header @back="goBack" :content="experimentName"></el-page-header> <el-page-header @back="goBack" :content="experimentName"></el-page-header>
</div> </div>
<el-form label-width="100px">
<div class="flex-between">
<div></div>
<div>
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
@ -19,11 +11,11 @@
<div class="nums"> <div class="nums">
<div class="item"> <div class="item">
<p class="name">实验总人数</p> <p class="name">实验总人数</p>
<p class="val">{{total}}</p> <p class="val">{{ peopleNum }}</p>
</div> </div>
<div class="item"> <div class="item">
<p class="name">实验平均分</p> <p class="name">实验平均分</p>
<p class="val">{{avg}}</p> <p class="val">{{ avgScore }}</p>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
@ -33,24 +25,22 @@
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<div> <div>
<el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
<div> <div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button> <el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button type="primary" size="small" @click="exportData">导出</el-button> <el-button type="primary" size="small" @click="exportData">导出</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
</el-table-column> </el-table-column>
<el-table-column v-if="className" prop="class" label="班级" align="center">
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column> <el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column> <el-table-column prop="score" label="分数" align="center"></el-table-column>
@ -73,121 +63,115 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import echarts from 'echarts' import echarts from "echarts";
export default { export default {
data() { data() {
return { return {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
projectId: this.$route.query.id, permissions: this.$route.query.permissions,
experimentName: this.$route.query.name, experimentName: this.$route.query.projectName,
className: this.$route.query.class, projectId: this.$route.query.projectId,
keyword: '', keyword: "",
listDataAll: [], searchTimer: null,
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
avg: 0, peopleNum: 0, //
avgScore: 0, //
}; };
}, },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { initData() {
let data = { this.$refs.table.clearSelection();
projectId: this.projectId this.page = 1;
} this.getData();
this.$get(this.api.getImitationAchievement,data).then(res => {
let list = res.data
let score = 0
list.map(n => {
n.class = this.className
score += n.score
})
this.listDataAll = list
this.handlePage()
this.total = list.length
this.avg = score ? (score / list.length).toFixed(2) : 0
this.getChart()
}).catch(res => {});
}, },
handlePage(){ getData() {
let list = this.listDataAll this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.projectId}&keyword=${this.keyword}`).then(res => {
this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) this.listData = res.page.records;
this.total = list.length this.total = res.page.total;
this.avgScore = res.avgScore;
this.peopleNum = res.peopleNum;
this.getChart(res.getFractionalSegmentNum);
}).catch(res => {
});
}, },
edit(row){ edit(row) {
if(this.systemId == 2 || this.systemId == 3){ if (this.systemId == 2 || this.systemId == 3) {
this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
this.$router.push(`addexperiment?id=${row.reportId}`) this.$router.push(`addexperiment?id=${row.reportId}`);
} }
}, },
show(row){ show(row) {
if(this.systemId == 2){ if (this.systemId == 2) {
this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOption?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else if(this.systemId == 3){ } else if (this.systemId == 3) {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`);
}else{ } else {
if(this.class){ if (this.permissions) {
this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`) this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`);
}else{ } else {
this.$router.push(`show?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`);
} }
} }
}, },
exportData(){ exportData() {
if(!this.listData.length) return false if (this.multipleSelection.length) {
let selected = this.multipleSelection let ids = this.multipleSelection.map(item => {
let exportList = [] return item.projectId;
if(selected.length){ });
exportList = selected.map(item => { location.href = `${this.api.exportPracticeInfo}?ids=${ids.toString()}`;
return item.recordId } else {
}) location.href = `${this.api.exportPracticeInfo}?ids=`;
}else{
exportList = this.listData.map(item => {
return item.recordId
})
} }
window.open(`${this.api.exportAchievement}?ids=${exportList.join(',')}&projectId=${this.projectId}&source=1`)
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) }).then(() => {
.then(() => { this.$post(this.api.deleteExperimentalReport, [row.projectId]).then(res => {
this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => { util.successMsg("删除成功");
util.successMsg('删除成功') this.getData();
this.getData() }).catch(res => {
}).catch(res => {}) });
}) }).catch(() => {
.catch(() => {}); });
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length) {
let newArr = this.multipleSelection this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
let delList = newArr.map(item => { type: "warning"
return `reportId=${item.reportId}` }).then(() => {
}) let ids = this.multipleSelection.map(item => {
let delList1 = newArr.map(item => { return item.projectId;
return `recordId=${item.recordId}` });
}) this.$post(this.api.deleteExperimentalReport, ids).then(res => {
this.$confirm('确定要删除吗?', '提示', { this.multipleSelection = [];
type: 'warning' this.$refs.table.clearSelection();
}) util.successMsg("删除成功");
.then(() => { this.getData();
this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => { }).catch(res => {
util.successMsg('删除成功') });
this.getData() }).catch(() => {});
}).catch(res => {}) } else {
}) util.errorMsg("请先选择数据 !");
.catch(() => {});
}else{
util.errorMsg('请先选择数据 !');
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -197,75 +181,50 @@ export default {
this.page = val; this.page = val;
this.handlePage(); this.handlePage();
}, },
getChart(){ getChart(num) {
let data = [0,0,0,0,0,0,0,0,0,0] let data = [num.num1, num.num2, num.num3, num.num4, num.num5, num.num6, num.num7, num.num8, num.num9, num.num10];
let list = this.listData let myChart = echarts.init(document.getElementById("chart"));
list.map(n => {
n.score
if(n.score >= 0 && n.score <= 10){
data[0]++
}else if(n.score > 10 && n.score <= 20){
data[1]++
}else if(n.score > 20 && n.score <= 30){
data[2]++
}else if(n.score > 30 && n.score <= 40){
data[3]++
}else if(n.score > 40 && n.score <= 50){
data[4]++
}else if(n.score > 50 && n.score <= 60){
data[5]++
}else if(n.score > 60 && n.score <= 70){
data[6]++
}else if(n.score > 70 && n.score <= 80){
data[7]++
}else if(n.score > 80 && n.score <= 90){
data[8]++
}else if(n.score > 90 && n.score <= 100){
data[9]++
}
})
let myChart = echarts.init(document.getElementById('chart'))
myChart.setOption({ myChart.setOption({
title: { text: '实验分数分布图' }, title: { text: "实验分数分布图" },
tooltip: {}, tooltip: {},
xAxis: { xAxis: {
name: '分数', name: "分数",
type: 'category', type: "category",
boundaryGap: false, boundaryGap: false,
data: ['0-10', '11-20', '21-30', '31-40', '41-50', '51-60', '61-70', '71-80','81-90','91-100'] data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
}, },
yAxis: { yAxis: {
name: '人数', name: "人数",
type: 'value' type: "value"
}, },
series: [{ series: [{
data, data,
type: 'line', type: "line",
areaStyle: {}, areaStyle: {},
color: ['#8191fd'] color: ["#8191fd"]
}] }]
}) });
}, },
goBack() { goBack() {
this.$router.back() this.$router.back();
}, }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-tabs__nav-wrap::after{ .stat {
display: none;
}
.stat{
display: flex; display: flex;
.nums { .nums {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 20px; margin-right: 20px;
.item:nth-child(1) { .item:nth-child(1) {
background-image: url('../../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.item:nth-child(2) { .item:nth-child(2) {
background-image: url('../../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
@ -278,18 +237,21 @@ export default {
border-radius: 8px; border-radius: 8px;
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
p { p {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
.val{
.val {
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 36px; font-size: 36px;
} }
} }
} }
.chart{
.chart {
flex: 1; flex: 1;
height: 300px; height: 300px;
} }

@ -3,9 +3,9 @@
<el-form :disabled="isDetail"> <el-form :disabled="isDetail">
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" :content="isDetail ? '查看' : (id ? '更新' : '创建') + '教学实验'"></el-page-header> <el-page-header @back="goBack" :content="isDetail ? '查看' : (form.id ? '更新' : '创建') + '教学实验'"></el-page-header>
<div> <div>
<el-button type="primary" size="small" @click="upload" v-show="!isDetail">{{id ? '更新' : '创建'}}</el-button> <el-button type="primary" size="small" @click="upload" v-show="!isDetail">{{ form.id ? "更新" : "创建" }}</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -15,7 +15,7 @@
<p class="m-b-20">考核名称</p> <p class="m-b-20">考核名称</p>
<el-input <el-input
placeholder="请输入考核名称" placeholder="请输入考核名称"
v-model="experimentalName" v-model.trim="form.experimentalName"
clearable clearable
maxlength="15" maxlength="15"
class="inline-input" class="inline-input"
@ -24,11 +24,10 @@
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<p class="m-b-20">发布方式</p> <p class="m-b-20">发布方式</p>
<el-radio-group v-model="type" :disabled="id ? true : false"> <el-radio-group v-model="form.type" :disabled="form.id ? true : false">
<el-radio :label="1">手动发布</el-radio> <el-radio :label="1">手动发布</el-radio>
<el-radio :label="2">定时发布</el-radio> <el-radio :label="2">定时发布</el-radio>
</el-radio-group> </el-radio-group>
@ -39,15 +38,18 @@
<div> <div>
<p class="m-b-20">实验时间</p> <p class="m-b-20">实验时间</p>
<!-- 手动发布显示 --> <!-- 手动发布显示 -->
<div class="date-inputs" v-if="type==1"> <div class="date-inputs" v-if="form.type==1">
实验时长 实验时长
<el-input size="small" v-model="duration.day" placeholder></el-input> <el-input size="small" v-model.trim="duration.day" placeholder></el-input>
<el-input size="small" v-model="duration.hour" placeholder></el-input>
<el-input size="small" v-model="duration.minute" placeholder></el-input> <el-input size="small" v-model.trim="duration.hour" placeholder></el-input>
小时
<el-input size="small" v-model.trim="duration.minute" placeholder></el-input>
</div> </div>
<!-- 定时发布显示 --> <!-- 定时发布显示 -->
<div v-if="type==2" class="addAssess"> <div v-if="form.type==2" class="addAssess">
<span class="mgr10">开始时间:</span> <span class="mgr10">开始时间:</span>
<el-date-picker <el-date-picker
size="small" size="small"
@ -66,12 +68,12 @@
<div> <div>
<p class="m-b-20">课程</p> <p class="m-b-20">课程</p>
<div class="inline-input"> <div class="inline-input">
<el-select v-model="systemId" placeholder="请选择" @change="initData"> <el-select v-model="form.curriculumId" placeholder="请选择" @change="initData">
<el-option <el-option
v-for="item in systemList" v-for="item in curriculumList"
:key="item.value" :key="item.cid"
:label="item.label" :label="item.curriculumName"
:value="item.id" :value="item.cid"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
@ -84,7 +86,7 @@
<span>实训项目</span> <span>实训项目</span>
<div style="display: inline-flex;"> <div style="display: inline-flex;">
<div> <div>
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</div> </div>
<el-button style="margin-left: 5px" type="primary" size="small" round @click="toProject">自定义实验项目</el-button> <el-button style="margin-left: 5px" type="primary" size="small" round @click="toProject">自定义实验项目</el-button>
</div> </div>
@ -94,7 +96,7 @@
<!-- 单选实训项目ID --> <!-- 单选实训项目ID -->
<el-table-column width="60" label="选择" align="center"> <el-table-column width="60" label="选择" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio v-model="projectId" :label="scope.row.projectId">&nbsp;</el-radio> <el-radio v-model="form.projectId" :label="scope.row.projectId">&nbsp;</el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
@ -129,22 +131,22 @@
<el-card shadow="hover" class="mgr20 m-b-20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="m-b-20">考核发布</p> <p class="m-b-20">考核发布</p>
<el-radio-group v-model="isSpecify"> <el-radio-group v-model="form.isSpecify">
<el-radio :label="1">指定范围</el-radio> <el-radio :label="1">指定范围</el-radio>
<el-radio :label="0">无指定范围</el-radio> <el-radio :label="0">无指定范围</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-show="isSpecify === 1" style='padding-top: 24px;'> <div v-show="form.isSpecify === 1" style="padding-top: 24px;">
<p class="m-b-20">班级名称</p> <p class="m-b-20">班级名称</p>
<el-input <el-input
placeholder="请输入班级名称" placeholder="请输入班级名称"
v-model="filterClassName" v-model.trim="filterClassName"
class="inline-input" class="inline-input m-b-20"
clearable clearable
></el-input> ></el-input>
<div v-show='tagList.length' style="padding: 24px 0"> <div v-show="tagList.length" class="m-b-20">
<el-tag <el-tag
v-for="(tag, index) in tagList" v-for="(tag, index) in tagList"
:key="index" :key="index"
@ -152,37 +154,40 @@
@close="handleCloseTag(tag)" @close="handleCloseTag(tag)"
style="margin-right: 10px" style="margin-right: 10px"
> >
{{tag.className}} {{ tag.organizationName }}
</el-tag> </el-tag>
</div> </div>
<div class="tree-con">
<el-tree <el-tree
ref="tree" ref="tree"
node-key="id" node-key="nodeKey"
show-checkbox show-checkbox
highlight-current highlight-current
default-expand-all default-expand-all
:data="classTreeList" lazy
:default-checked-keys="defaultCheckedList" :load="loadTree"
:default-checked-keys="defaultCheckedKeys"
:props="{children: 'children', label: 'organizationName'}"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:props="defaultProps"
@check="handleCheck" @check="handleCheck"
> >
</el-tree> </el-tree>
</div> </div>
</div>
</el-card> </el-card>
<!-- 邀请码 --> <!-- 邀请码 -->
<el-card v-if='isSpecify === 0' shadow="hover" class="m-b-20"> <el-card v-if="form.isSpecify === 0" shadow="hover" class="m-b-20">
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<p class="m-b-20">设置邀请码</p> <p class="m-b-20">设置邀请码</p>
<el-radio-group v-model="isEnableCode"> <el-radio-group v-model="form.isEnableCode">
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-if="isEnableCode === 0"> <div v-if="form.isEnableCode === 0">
<el-input style="display: inline-block;width: auto;margin-right: 10px" type="number" v-model="invitationCode" maxlength="6" placeholder="请设置6个数字"></el-input> <el-input style="display: inline-block;width: auto;margin-right: 10px" type="number" v-model.trim="form.invitationCode" maxlength="6" placeholder="请设置6个数字"></el-input>
<el-button type="text" @click="createInv">随机</el-button> <el-button type="text" @click="createInv">随机</el-button>
</div> </div>
</el-card> </el-card>
@ -190,488 +195,389 @@
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
founderKeys: { founderKeys: {
0: '系统', 0: "系统",
1: '老师' 1: "老师"
}, },
permissionsKeys: { permissionsKeys: {
0: '练习', 0: "练习",
1: '考核', 1: "考核",
2: '竞赛' 2: "竞赛"
}, },
id: '', isDetail: Boolean(this.$route.query.show),
form: {
id: this.$route.query.id ? this.$route.query.id : "",
experimentalName: "",
type: 1, // (1 2) type: 1, // (1 2)
experimentDuration: "0d0h0m",
curriculumId: "",
projectId: "",
isSpecify: 1, // (1 2) isSpecify: 1, // (1 2)
isEnableCode: 0, //
invitationCode: "",
status: 0, // (0 1 2)
classId: "",
stuInfo: []
},
date: "", //
duration: {
day: "",
hour: "",
minute: ""
}, //
startTime: "0000-00-00 00:00:00", //
stopTime: "0000-00-00 00:00:00", //
expNameRepeat: false, //
curriculumList: [], //
filterClassName: "", // filterClassName: "", //
tagList: [], // tagList: [], //
classTreeList: [], // defaultCheckedKeys: [], //
defaultCheckedList: [], //
allCheckedNodes: [], // allCheckedNodes: [], //
allCheckedKeys: [], // key
defaultProps: { keyword: "", //
children: 'children',
label: 'organizationName'
}, //
schoolId: Setting.schoolId, // id Setting.schoolId
systemId: Setting.systemId,
systemList: Setting.systemList,
roleStatus: util.getRoleName,
isDetail: Boolean(this.$route.query.show),
duration: {
day: '',
hour: '',
minute: ''
},
keyword: '',
searchTimer: null, searchTimer: null,
date: '',
experimentDuration: '0d0h0m', surplusTime: "",
experimentalNumber: 0,
projectId: '',
projectName: '',
status: 0, // (0 1 2)
surplusTime: '',
experimentalName: '',//
isEnableCode: 0, //
startTime: '0000-00-00 00:00:00', //
stopTime: '0000-00-00 00:00:00', //
invitationCode: '',
currPage: 1,
projectDataAll: [], projectDataAll: [],
projectData: [], projectData: [],
invRepeat: false,
pickerOptions: { pickerOptions: {
disabledDate: time => { disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000 return time.getTime() < new Date().getTime() - 86400000;
} }
}, },
projectPermissionsList: ['练习','考核','竞赛'],
projectQueryData: {
userId: this.userId,
systemId: this.systemId
},
page: 1, page: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
multipleSelection: [], isToProject: false
isToProject: false,
expNameRepeat: false
}; };
}, },
computed: { computed: {
...mapState('user', [ ...mapState("project", [
'userId' "assFields"
]), ])
...mapState('project', [
'assFields'
]),
}, },
mounted() { mounted() {
// console.log(22,this.assFields) // console.log(22,this.assFields)
this.date = [util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000)),util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000))] this.date = [util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000)), util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(new Date().getTime() + 300000))];
this.id = this.$route.query.id this.form.id && this.getData();
this.id && this.getData() this.getschoolCourse();
this.getProjectData() this.recoveryData();
this.recoveryData()
this.getClassTreeData()
}, },
beforeDestroy(){ beforeDestroy() {
if(!this.isToProject) this.setAss({}) if (!this.isToProject) this.setAss({});
}, },
watch: { watch: {
date: function(val){ date: function(val) {
if(val[0] != '0000-00-00 00:00:00'){ if (val[0] != "0000-00-00 00:00:00") {
this.startTime = util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[0])) this.startTime = util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(val[0]));
this.stopTime = util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[1])) this.stopTime = util.formatDate("yyyy-MM-dd hh:mm:ss", new Date(val[1]));
} }
}, },
duration: { duration: {
handler(n,o){ handler(n, o) {
this.experimentDuration = `${n.day ? n.day : 0}d${n.hour ? n.hour : 0}h${n.minute ? n.minute : 0}m` this.form.experimentDuration = `${n.day ? n.day : 0}d${n.hour ? n.hour : 0}h${n.minute ? n.minute : 0}m`;
}, },
deep: true deep: true
}, },
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData();
},500) }, 500);
}, },
filterClassName(val) { filterClassName(val) {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
}, },
methods: { methods: {
...mapActions('project', [ ...mapActions("project", [
'setAss' "setAss"
]), ]),
handleCloseTag(tag) { // handleCloseTag(tag) { //
let tagIndex = this.tagList.findIndex( i => i.classId === tag.classId); this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
this.tagList.splice(tagIndex, 1);
//
let classIndex = this.allCheckedNodes.findIndex( i => i.id === tag.id);
// keys
let studentsKeys = [];
if(this.allCheckedNodes[classIndex].children && this.allCheckedNodes[classIndex].children.length) {
studentsKeys = this.allCheckedNodes[classIndex].children.map( i => i.id);
}
let filterKeys = [...studentsKeys, this.allCheckedNodes[classIndex].id];
let setKeys = []; //
this.allCheckedKeys.forEach(i => {
if(!filterKeys.includes(i)){
setKeys.push(i)
}
}); //
this.allCheckedKeys = setKeys; // key
console.log("所有节点keys===",JSON.stringify(this.allCheckedKeys));
console.log("当前班级和学生keys===",JSON.stringify(filterKeys));
console.log("设置选中的节点===",JSON.stringify(setKeys));
let tempArr = []; let tagIndex = this.tagList.findIndex(i => i.id === tag.id);
this.tagList.splice(tagIndex, 1);
//
let setKeys = [];
this.allCheckedNodes.forEach(i => { this.allCheckedNodes.forEach(i => {
if(!filterKeys.includes(i.id)){ if (i.level === 4 && i.parentId !== tag.id) setKeys.push(i.nodeKey);
tempArr.push(i)
}
}); });
this.allCheckedNodes = tempArr; //
this.$refs.tree.setCheckedKeys(setKeys); this.$refs.tree.setCheckedKeys(setKeys);
this.allCheckedNodes = this.allCheckedNodes.filter(i => (i.level === 3 && i.id !== tag.id) || (i.level === 4 && i.parentId !== tag.id));
}, },
handleCheck(data, checked) { // handleCheck(data, checked) { //
console.log(checked); console.log(checked);
// console.log(JSON.stringify(checked.checkedNodes));
// //
let checkedClass = checked.checkedNodes.filter( i => i.level === 3); let checkedClass = checked.checkedNodes.filter(i => i.level === 3);
let halfCheckedClass = checked.halfCheckedNodes.filter( i => i.level === 3); let halfCheckedClass = checked.halfCheckedNodes.filter(i => i.level === 3);
this.tagList = [...checkedClass, ...halfCheckedClass].map(i => { this.tagList = [...checkedClass, ...halfCheckedClass].map(i => {
return {classId: i.id, className: i.organizationName} return { id: i.id, organizationName: i.organizationName };
}); });
// //
this.allCheckedNodes = [...checked.checkedNodes, ...checked.halfCheckedNodes]; this.allCheckedNodes = [...checked.checkedNodes, ...checked.halfCheckedNodes];
// key
let tempArr = checked.checkedNodes.filter( i => i.level === 3 || i.level === 4);
this.allCheckedKeys = tempArr.map(i => i.id);
}, },
filterNode(value, data) { // filterNode(value, data) { //
if (!value) return true; if (!value) return true;
return data.organizationName.indexOf(value) !== -1; return data.organizationName.indexOf(value) !== -1;
}, },
toTreeId(data) { // idid+id,便key loadTree(node, resolve) { //
if (!data) return data; let level = 1;
let result; let parentId = "";
if (Array.isArray(data)) { if (node.level === 0) {
result = []; this.treeNode = node;
data.forEach(item => { this.treeResolve = resolve;
if (item.level < 4 && item.children && item.children.length) { this.getTreeData(resolve, level, parentId);
item.children = this.toTreeId(item.children); } else if (node.level > 3) {
} else if (item.level === 4) { return resolve([]);
item.id = `${item.parentId}-${item.id}`; } else {
if (node.data && node.data.level && node.data.id) {
this.getTreeData(resolve, node.data.level + 1, node.data.id);
} }
result.push(item);
});
} }
return result;
}, },
getClassTreeData () { // async getTreeData(resolve, level, parentId) { //
this.$post(`${this.api.treeList}?schoolId=${this.schoolId}`).then(res => { let { status, treeList } = await this.$post(`${this.api.stuOrganizationTree}?level=${level}&parentId=${parentId}`);
let {status, list} = res; if (status === 200 && treeList.length) {
if (status === 200 && list) { let result = [];
this.classTreeList = this.toTreeId(res.list); treeList.forEach(i => {
if (i.level === 4) {
i.nodeKey = `${i.parentId}-${i.id}`;
i.isLeaf = "leaf";
} else {
i.nodeKey = `${i.id}-${new Date().getTime()}`;
}
result.push(i);
});
this.$nextTick(() => {
//
if (this.form.stuInfo && this.form.stuInfo.length) {
let keys = this.form.stuInfo.map(i => {
return `${i.classId}-${i.stuAccountId}`;
});
this.defaultCheckedKeys = keys;
}
//
let nodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
this.allCheckedNodes = nodes;
this.tagList = nodes.filter(i => i.level === 3);
});
return resolve(result);
} else { } else {
util.errorMsg(res.message); return resolve([]);
} }
},
getschoolCourse() {
this.$get(this.api.schoolCourse).then(res => {
this.curriculumList = res.data;
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
}, },
getProjectData(){ getProjectData() {
let data = { this.$get(`${this.api.projectListByCourseId}?cid=${this.form.curriculumId}&permissions=1&projectName=${this.keyword}`).then(res => {
schoolId: this.schoolId, // id
platformId: 1, // :1 :3
permissions: 1, // (0: 1: 2:)
projectName: this.keyword, //
systemId: this.systemId, // id
founder: 0, // (0: 1:)
state: 1, // (0:稿 1:)
pageNum: this.page,
pageSize: 10000,
}
this.$post(this.api.queryProjectManage, data).then(res => {
let { status, data } = res; let { status, data } = res;
if (status === 200 && data) { if (status === 200 && data) {
let list = data.records; let list = data.records;
let result = [] let result = [];
list.map(n => { list.map(n => {
n.enable || result.push(n) n.enable || result.push(n);
}) });
this.projectDataAll = result this.projectDataAll = result;
this.total = result.length this.total = result.length;
this.handlePage() this.handlePage();
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
}, },
handlePage(){ handlePage() {
let list = this.projectDataAll let list = this.projectDataAll;
let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) let result = list.slice((this.page - 1) * this.pageSize, this.page * this.pageSize);
this.projectData = result this.projectData = result;
},
initData(){
this.page = 1
this.getProjectData()
}, },
recoveryData(){ initData() {
if(JSON.stringify(this.assFields) != '{}'){ this.page = 1;
let info = this.assFields this.getProjectData();
this.experimentDuration = info.experimentDuration
this.experimentalName = info.experimentalName
this.invitationCode = info.invitationCode
this.isEnableCode = info.isEnableCode
this.projectId = info.projectId
this.startTime = info.startTime
this.stopTime = info.stopTime
this.surplusTime = info.surplusTime
this.type = info.type
this.expNameRepeat = info.expNameRepeat
this.formatDuration()
}
}, },
upload() { // upload() { //
if(!this.experimentalName) return util.warningMsg('请填写考核名称') if (!this.form.experimentalName) return util.warningMsg("请填写考核名称");
if(this.expNameRepeat) return util.warningMsg('考核名称重复,请重新输入') if (this.expNameRepeat) return util.warningMsg("考核名称重复,请重新输入");
if(this.type !== 1){ if (this.form.type !== 1) {
if(new Date().getTime() > new Date(this.startTime).getTime()) return util.warningMsg('开始时间不能早于当前时间') if (new Date().getTime() > new Date(this.startTime).getTime()) return util.warningMsg("开始时间不能早于当前时间");
let timestamp = new Date(new Date(this.stopTime).getTime() - new Date(this.startTime).getTime()) let timestamp = new Date(new Date(this.stopTime).getTime() - new Date(this.startTime).getTime());
let minute = 1000 * 60 let minute = 1000 * 60;
let hour = minute * 60 let hour = minute * 60;
let day = hour * 24 let day = hour * 24;
this.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m` this.form.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m`;
} }
if(this.type == 1 && this.experimentDuration == '0d0h0m') return util.warningMsg('请填写实验时长') if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长");
if(this.type == 2 && this.startTime == '0000-00-00 00:00:00') return util.warningMsg('请填写实验时间') if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间");
if(!this.projectId) return util.warningMsg('请选择实训项目') if (!this.form.projectId) return util.warningMsg("请选择实训项目");
this.projectName = this.projectData.find(n => n.projectId == this.projectId).projectName if (this.form.isSpecify === 0 && this.form.isEnableCode == 0) {
if(this.isSpecify === 0 && this.isEnableCode == 0){ if (!this.form.invitationCode) return util.warningMsg("请设置邀请码");
if(!this.invitationCode) return util.warningMsg('请设置邀请码') if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码");
if(!this.invitationCode || String(this.invitationCode).length < 6 || isNaN(this.invitationCode)) return util.warningMsg('请输入6位纯数字邀请码') }
// if(this.invRepeat) return util.warningMsg('')
} if (this.form.type == 2) {
this.form.startTime = this.startTime;
let classId = ""; this.form.stopTime = this.stopTime;
}
let classId = [];
let stuInfo = []; let stuInfo = [];
if (this.isSpecify === 1) { this.allCheckedNodes.forEach(i => {
if (!this.tagList.length) { if (i.level === 3) {
util.warningMsg('请选择学生') classId.push(i.id);
} else if (i.level === 4) {
stuInfo.push({ classId: i.parentId, stuAccountId: i.id });
}
});
if (this.isSpecify === 1 && !stuInfo.length) {
util.warningMsg("请选择学生");
return; return;
} else { } else {
let ids = this.tagList.map(i => i.classId); this.form.classId = classId.toString();
classId = ids.toString(); this.form.stuInfo = stuInfo;
let nodes = this.allCheckedNodes.filter( i => i.level === 4);
nodes.forEach(i => {
let arr = i.id.split("-")
stuInfo.push({classId: arr[0], stuAccountId: arr[1]})
});
}
}
let data = {
id: this.id,
experimentDuration: this.experimentDuration,
createTime: this.id ? this.createTime : util.formatDate("yyyy-MM-dd hh:mm:ss"),
experimentalName: this.experimentalName,
experimentalNumber: this.experimentalNumber,
invitationCode: this.invitationCode,
isEnableCode: this.isEnableCode,
projectId: this.projectId,
projectName: this.projectName,
status: this.status,
surplusTime: this.surplusTime,
type: this.type,
userId: this.userId,
systemId: this.systemId,
isSpecify: this.isSpecify,
classId,
stuInfo,
}
if(this.type == 2){
data.startTime = this.startTime
data.stopTime = this.stopTime
} }
if(this.id){ if (this.form.id) {
this.$post(this.api.modifyAssessment, data).then(res => { this.$post(this.api.modifyAssessment, this.form).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.$router.back() this.$router.back();
}) }).catch(err => {
.catch(err => {
console.log(err); console.log(err);
}); });
}else{
this.$post(this.api.saveAssessment, data).then(res => {
if (res.status === 200) {
util.successMsg('创建成功');
this.$router.back()
} else { } else {
this.$post(this.api.saveAssessment, this.form).then(res => {
if (res.status === 200) {
util.successMsg("创建成功");
this.$router.back();
} }
}) }).catch(err => {
.catch(err => {
console.log(err); console.log(err);
}); });
} }
}, },
getData() { getData() { //
this.$get(`${this.api.getDetailById}?id=${this.id}`) this.$get(`${this.api.getDetailById}?id=${this.form.id}`).then(res => {
.then(res => { if (res.status == 200) {
if(res.status == 200){ this.form = res.data;
let info = res.data;
this.createTime = info.createTime
this.experimentDuration = info.experimentDuration
this.experimentalName = info.experimentalName
this.experimentalNumber = info.experimentalNumber
this.invitationCode = info.invitationCode
this.isEnableCode = info.isEnableCode
this.projectId = info.projectId
this.projectName = info.projectName
this.startTime = info.startTime
this.status = info.status
this.stopTime = info.stopTime
this.surplusTime = info.surplusTime
this.type = info.type
//
this.formatDuration(); this.formatDuration();
//
if (info.stuInfo && info.stuInfo.length) {
let keys = info.stuInfo.map(i => {
return `${i.classId}-${i.stuAccountId}`;
});
this.$nextTick(function () {
this.$refs.tree.setCheckedKeys(keys);
});
} }
}).catch(err => {
//
this.allCheckedNodes = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes());
// key
let tempArr = this.$refs.tree.getCheckedNodes().filter( i => i.level === 3 || i.level === 4);
this.allCheckedKeys = tempArr.map(i => i.id);
this.tagList = this.allCheckedNodes.map(i => {
let obj = {};
if (i.level === 3) {
obj = { classId: i.id, className: i.organizationName }
}
return obj;
})
}else{
util.errorMsg(res.message);
}
})
.catch(err => {
console.log(err); console.log(err);
}); });
}, },
formatDuration(){ formatDuration() { //
let duration = this.experimentDuration.replace(/\D+/g,',').split(',') let duration = this.form.experimentDuration.replace(/\D+/g, ",").split(",");
this.duration = { this.duration = {
day: duration[0], day: duration[0],
hour: duration[1], hour: duration[1],
minute: duration[2] minute: duration[2]
};
this.date = [this.startTime, this.stopTime];
},
recoveryData() { //
if (JSON.stringify(this.assFields) != "{}") {
let info = this.assFields;
this.form = info.form;
this.duration = info.duration; //
this.startTime = info.startTime; //
this.stopTime = info.startTime; //
this.expNameRepeat = info.expNameRepeat; //
this.allCheckedNodes = info.allCheckedNodes; //
this.formatDuration();
} }
this.date = [this.startTime,this.stopTime]
}, },
handleCacheData(){ handleCacheData() { // ,,
let data = { this.allCheckedNodes.forEach(i => {
id: this.id, if (i.level === 4) {
experimentDuration: this.experimentDuration, this.form.stuInfo.push({ classId: i.parentId, stuAccountId: i.id });
experimentalName: this.experimentalName,
invitationCode: this.invitationCode,
isEnableCode: this.isEnableCode,
projectId: this.projectId,
startTime: this.startTime,
stopTime: this.stopTime,
surplusTime: this.surplusTime,
type: this.type,
expNameRepeat: this.expNameRepeat
} }
this.setAss(data) });
this.isToProject = true
let data = {
form: this.form,
date: this.date, //
duration: this.duration, //
startTime: this.startTime, //
stopTime: this.startTime, //
expNameRepeat: this.expNameRepeat, //
allCheckedNodes: this.allCheckedNodes //
};
this.setAss(data);
this.isToProject = true;
}, },
toProject(){ toProject() {
this.handleCacheData() this.handleCacheData();
this.$router.push('/project/list/?show=1') this.$router.push("/project/list/?show=1");
}, },
showProject(row){ showProject(row) {
this.handleCacheData() this.handleCacheData();
this.$router.push(`/project/add?projectId=${row.projectId}&show=1`) this.$router.push(`/project/add?projectId=${row.projectId}&show=1`);
}, },
goBack() { createInv() {
if(this.isDetail){ let result = "";
this.$router.back() for (let i = 0; i < 6; i++) {
}else{ result += Math.floor(Math.random() * 10);
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
} }
this.form.invitationCode = result;
}, },
varifyInv() { handleCurrentChange(val) {
this.$get(this.api.getInvitationCode, { invitationCode: this.invitationCode }) this.page = val;
.then(res => { this.handlePage();
if(res.InvitationCode) {
util.warningMsg('邀请码重复,请重新输入')
this.invRepeat = true
}else{
this.invRepeat = false
}
})
.catch(err => {});
}, },
createInv() { goBack() {
let result = '' if (this.isDetail) {
for(let i=0; i<6; i++){ this.$router.back();
result += Math.floor(Math.random()*10) } else {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { type: "warning" }).then(() => {
this.$router.back();
});
}
} }
this.invitationCode = result
// this.varifyInv()
},
handleCurrentChange(val){
this.page = val
this.handlePage()
} }
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.inline-input{ .inline-input {
width: 300px; width: 300px;
} }
.date-inputs{
.el-input{ .date-inputs {
.el-input {
width: 100px; width: 100px;
} }
}
.tree-con {
height: 400px;
max-height: 400px;
width: 300px;
border: 1px solid #DCDFE6;
border-radius: 4px;
padding: 10px 10px 10px 0px;
overflow: auto;
/deep/ .el-icon-caret-right:before {
color: #9278FF;
font-weight: bold;
} }
}
</style> </style>

@ -6,7 +6,7 @@
<li> <li>
<label>实验时间</label> <label>实验时间</label>
<el-radio-group size="small" v-model="form.month" @change="initData"> <el-radio-group size="small" v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> <el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li> </li>
@ -35,7 +35,7 @@
</el-select> </el-select>
</li> </li>
<li> <li>
<el-input size="small" placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input> <el-input size="small" placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
@ -45,10 +45,10 @@
</div> </div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status!=1" width="50" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNum - 1) * pageSize + 1}} {{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="className" label="实验班级" align="center"> <el-table-column prop="className" label="实验班级" align="center">
@ -57,41 +57,40 @@
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目名称" width="250" show-overflow-tooltip align="center"> <el-table-column prop="projectName" label="项目名称" width="250" show-overflow-tooltip align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentalNumber" label="实验人数" align="center"> <el-table-column prop="experimenterNum" label="实验人数" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center"> <el-table-column prop="experimentDuration" label="实验时长" align="center">
</el-table-column> </el-table-column>
<el-table-column label="邀请码" align="center"> <el-table-column label="邀请码" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.isEnableCode == 0 ? scope.row.invitationCode : ''}}</span> <span>{{ scope.row.isEnableCode == 0 ? scope.row.invitationCode : "" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="adminName" label="发布类型" align="center"> <el-table-column prop="type" label="发布类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{types[scope.row.type]}}</span> <span>{{ types[scope.row.type] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" width="150" label="创建时间" align="center"> <el-table-column prop="createTime" width="150" label="创建时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="startTime" width="150" label="起始时间" align="center"> <el-table-column prop="startTime" width="150" label="起始时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{transferTime(scope.row.startTime,scope.row.type)}}</span> <span>{{ transferTime(scope.row.startTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="endTime" width="150" label="结束时间" align="center"> <el-table-column prop="stopTime" width="150" label="结束时间" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{transferTime(scope.row.stopTime,scope.row.type)}}</span> <span>{{ transferTime(scope.row.stopTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="surplusTime" label="倒计时" align="center"> <el-table-column label="倒计时" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 1" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span> <span>{{ timeChange(scope.row.countDown) }}</span>
<span v-else>00:00:00</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="实验状态" align="center"> <el-table-column label="实验状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{status[scope.row.status]}}</span> <span>{{ status[scope.row.status] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
@ -117,162 +116,180 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
typeList: [ typeList: [
{ {
value: '', value: "",
name: '不限' name: "不限"
}, },
{ {
value: 1, value: 1,
name: '手动发布' name: "手动发布"
}, },
{ {
value: 2, value: 2,
name: '定时发布' name: "定时发布"
} }
], ],
types: ['','手动发布','定时发布'], types: ["", "手动发布", "定时发布"],
statusList: [ statusList: [
{ {
value: '', value: "",
name: '不限' name: "不限"
}, },
{ {
value: 0, value: 0,
name: '待开始' name: "待开始"
}, },
{ {
value: 1, value: 1,
name: '进行中' name: "进行中"
}, },
{ {
value: 2, value: 2,
name: '已完成' name: "已完成"
} }
], ],
status: ['待开始','进行中','已完成'], status: ["待开始", "进行中", "已完成"],
dateList: [ dateList: [
{ {
id: '', id: "",
name: '不限' name: "不限"
}, },
{ {
id: 1, id: 1,
name: '近一个月' name: "近一个月"
}, },
{ {
id: 3, id: 3,
name: '近三个月' name: "近三个月"
}, },
{ {
id: 6, id: 6,
name: '近六个月' name: "近六个月"
} }
], ],
date: [], date: [],
systemList: Setting.systemList, systemList: Setting.systemList,
systemId: '', systemId: "",
keyWord: '', // keyWord: "", //
searchTimer: null,
form: { form: {
type: '', type: "",
status: '', status: "",
startTime: '', startTime: "",
endTime: '', endTime: "",
month: '' month: ""
}, },
pageNum: 1, // pageNum: 1, //
pageSize: 10, // 10 pageSize: 10, // 10
total: 0, // total: 0, //
listData: [], // listData: [], //
multipleSelection: [], // multipleSelection: [], //
ruleIds: [], ticker: null
timer: null
}; };
}, },
directives: {
countdown: {
bind: function(el,binding,vnode) {
let that = vnode.context
let time = binding.value
let timer = setInterval(() => {
let timeList = time.split(':')
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2])
if(total > 0){
--total
let hours = Math.floor(total / (60 * 60))
let minutes = Math.floor(total % (60 * 60) / 60)
let seconds = Math.floor(total % (60 * 60) % 60)
time = `${util.formateTime(hours)}:${util.formateTime(minutes)}:${util.formateTime(seconds)}`
}else{
clearInterval(timer)
}
el.innerHTML = time
},1000)
that.timerList.push(timer)
}
}
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
watch: { watch: {
'form.month': function(val){ "form.month": function(val) {
if(val){ if (val) {
let unit = 24 * 60 * 60 * 1000 let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
}else{ } else {
this.date = [] this.date = [];
} }
}, },
date: function(val){ date: function(val) {
if(val){ if (val) {
this.form.startTime = val[0] this.form.startTime = val[0];
this.form.endTime = val[1] this.form.endTime = val[1];
}else{ } else {
this.form.startTime = '' this.form.startTime = "";
this.form.endTime = '' this.form.endTime = "";
} }
this.initData() this.initData();
}, },
keyWord: function(val) { keyWord: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData();
},500) }, 500);
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
// this.timer = setInterval(this.getData,1000) this.beginTimer();
// this.$once('hook:beforeDestroy',() => { },
// clearInterval(this.timer) created() {
// }) if (this.ticker) {
clearInterval(this.ticker);
}
}, },
methods: { methods: {
beginTimer() {
this.ticker = setInterval(() => {
for (let i = 0; i < this.listData.length; i++) {
const item = this.listData[i];
if (item.countDown > 0) {
item.countDown = item.countDown - 1;
}
this.$set(this.listData, i, item);
}
}, 1000);
},
timeChange(countDown) {
let that = this;
if (countDown < 0) {
clearInterval(setInterval(this.timeChange(countDown), 1000));
}
let hh = that.fillNumber(countDown / (60 * 60));
let mm = that.fillNumber(countDown % (60 * 60) / 60);
let ss = that.fillNumber(countDown % (60 * 60) % 60);
return `${hh}:${mm}:${ss}`;
},
fillNumber(num) {
let number = Math.floor(num);
return number > 9 ? number : `0${number}`;
},
getData() { getData() {
let data = { let data = {
type: this.form.type, ...this.form,
startTime: this.form.startTime,
endTime: this.form.endTime,
month: this.form.month,
status: this.form.status,
keyWord: this.keyWord, keyWord: this.keyWord,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
systemId: this.systemId systemId: this.systemId
} };
this.$post(this.api.pageByCondition,data).then(res => { this.$post(this.api.pageByCondition, data).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.listData = res.list; this.listData = res.list;
this.total = res.total; this.total = res.total;
this.listData.forEach(i => {
if (i.status === 2) { //
i.countDown = 0;
} else {
if (i.type === 2) { //
if (i.status === 0) {
//
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; //
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
} else if (i.type === 1) { //
if (i.status === 0) {
//
i.countDown = 0;
} else if (i.status === 1) {
//
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000;
}
}
}
});
} else { } else {
util.errorMsg(res.message); util.errorMsg(res.message);
} }
@ -280,110 +297,115 @@ export default {
console.log(err); console.log(err);
}); });
}, },
initData(){ initData() {
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
this.pageNum = 1 this.pageNum = 1;
this.getData() this.getData();
}, },
add(){ add() {
this.$router.push('add') this.$router.push("add");
}, },
edit(row){ edit(row) {
this.$router.push(`add?id=${row.id}`) this.$router.push(`add?id=${row.id}`);
}, },
show(row){ show(row) {
this.$router.push(`/achievement/ass?systemId=${this.systemId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`) this.$router.push(`/achievement/ass?systemId=${this.systemId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`);
}, },
start(row){ start(row) {
let data = { let data = {
id: row.id, id: row.id,
startTime: util.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), startTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 1 status: 1
} };
this.$post(this.api.modifyAssessment, data).then(res => { this.$post(this.api.modifyAssessment, data).then(res => {
if(res.status === 200) { if (res.status === 200) {
util.successMsg('启动成功!') util.successMsg("启动成功!");
this.getData() this.getData();
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
}, },
finish(row){ finish(row) {
this.$confirm('确定要提前结束吗?', '提示', { this.$confirm("确定要提前结束吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
id: row.id, id: row.id,
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 2 status: 2
} };
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => {
if(res.status === 200) { if (res.status === 200) {
util.successMsg('提前结束成功!') util.successMsg("提前结束成功!");
this.getData() this.getData();
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
});
}) })
}) .catch(() => {
.catch(() => {}) });
}, },
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$post(this.api.deleteAssessment,[row.id]).then(res => { this.$post(this.api.deleteAssessment, [row.id]).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length){ if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.projectId return item.projectId;
}) });
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => { this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
}else{ });
util.errorMsg('请先选择数据 !'); } else {
util.errorMsg("请先选择数据 !");
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
onSearch(){ onSearch() {
this.pageNum = 1 this.pageNum = 1;
this.getData() this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNum = val; this.pageNum = val;
this.getData(); this.getData();
}, },
transferTime(date,type){ transferTime(date) {
if(date == '0000-00-00 00:00:00') return '---' if (date == "0000-00-00 00:00:00") return "---";
return date return date;
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-radio-group{ .el-radio-group {
white-space: nowrap; white-space: nowrap;
} }
</style> </style>

@ -50,7 +50,7 @@
<quill :border="true" :readonly="isDetail" v-model="description" :height="400" /> <quill :border="true" :readonly="isDetail" v-model="description" :height="400" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small" v-throttle @click="save" v-show="!isDetail">{{ id ? '更新' : '创建' }}</el-button> <el-button type="primary" size="small" v-throttle @click="save" v-show="!isDetail">{{ id ? "更新" : "创建" }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -58,35 +58,34 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
import quill from '@/components/quill' import quill from "@/components/quill";
export default { export default {
name: 'courseAddEdit', name: "courseAddEdit",
data() { data() {
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
schoolId: Setting.schoolId, schoolId: Setting.schoolId,
id: '', id: this.$route.query.id,
isDetail: Boolean(this.$route.query.show), isDetail: Boolean(this.$route.query.show),
username: this.$store.state.name, username: this.$store.state.name,
classificationId: '', classificationId: "",
coverUrl: '', coverUrl: "",
name: '', name: "",
classificationList: [], classificationList: [],
uploadList: [], uploadList: [],
description: '', description: "",
submiting: false submiting: false
}; };
}, },
mounted() { mounted() {
this.id = this.$route.query.id this.getClassification();
this.getClassification() this.id && this.getData();
this.id && this.getData()
}, },
components: { components: {
quill quill
@ -97,11 +96,11 @@ export default {
this.$router.back(); this.$router.back();
}, },
save() { save() {
if (this.submiting) return false if (this.submiting) return false;
if (!this.name) return util.warningMsg('请填写课程名称'); if (!this.name) return util.warningMsg("请填写课程名称");
if (!this.classificationId) return util.warningMsg('请选择课程分类'); if (!this.classificationId) return util.warningMsg("请选择课程分类");
if (!this.coverUrl) return util.warningMsg('请上传课程封面'); if (!this.coverUrl) return util.warningMsg("请上传课程封面");
this.submiting = true this.submiting = true;
let data = { let data = {
id: this.id, id: this.id,
@ -114,53 +113,53 @@ export default {
founderId: this.userId, founderId: this.userId,
founderName: this.username, founderName: this.username,
distinguish: 1 distinguish: 1
} };
if (this.id) { if (this.id) {
this.$put(this.api.editCourse, data).then(res => { this.$put(this.api.editCourse, data).then(res => {
this.submiting = false this.submiting = false;
util.successMsg('修改成功'); util.successMsg("修改成功");
this.$router.back() this.$router.back();
}) })
.catch(err => { .catch(err => {
this.submiting = false this.submiting = false;
}); });
} else { } else {
this.$post(this.api.addCourse, data).then(res => { this.$post(this.api.addCourse, data).then(res => {
this.submiting = false this.submiting = false;
this.$confirm('课程创建成功,是否马上进行课程内容设置?', '提示', { this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: 'success', type: "success",
confirmButtonText: '马上设置', confirmButtonText: "马上设置",
cancelButtonText: '稍后操作' cancelButtonText: "稍后操作"
}) })
.then(() => { .then(() => {
this.$router.push(`courseConfig?id=${res.data.courseId}`) this.$router.push(`courseConfig?id=${res.data.courseId}`);
}).catch(() => { }).catch(() => {
this.$router.back() this.$router.back();
}); });
}) })
.catch(err => { .catch(err => {
this.submiting = false this.submiting = false;
}); });
} }
}, },
getClassification() { getClassification() {
this.$get(this.api.queryGlClassification).then(res => { this.$get(this.api.queryGlClassification).then(res => {
this.classificationList = res.classificationList this.classificationList = res.classificationList;
}).catch(res => { }).catch(res => {
}); });
}, },
getData() { getData() {
this.$get(`${this.api.getCourse}/${this.id}`) this.$get(`${this.api.getCourse}/${this.id}`)
.then(res => { .then(res => {
let data = res.course let data = res.course;
this.name = data.name this.name = data.name;
this.classificationId = data.classificationId this.classificationId = data.classificationId;
this.description = data.description this.description = data.description;
this.coverUrl = data.coverUrl this.coverUrl = data.coverUrl;
this.uploadList.push({ this.uploadList.push({
name: 'cover.jpg', name: "cover.jpg",
url: this.coverUrl url: this.coverUrl
}) });
}) })
.catch(err => { .catch(err => {
@ -168,10 +167,10 @@ export default {
}, },
// //
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg('当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!'); util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.coverUrl = res.filesResult.fileUrl this.coverUrl = res.filesResult.fileUrl;
// this.uploadList.push({ name: file.name, url: response.message.fileUrl }); // this.uploadList.push({ name: file.name, url: response.message.fileUrl });
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
@ -185,28 +184,28 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/', '') let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = '' this.coverUrl = "";
}).catch(res => { }).catch(res => {
}) });
}, },
uploadSure() { uploadSure() {
this.importVisible = false this.importVisible = false;
this.pageNo = 1 this.pageNo = 1;
this.staffGradeId = '' this.staffGradeId = "";
this.keyword = '' this.keyword = "";
this.getTeacher() this.getTeacher();
}, },
goback() { goback() {
if (this.isDetail) { if (this.isDetail) {
this.$router.back() this.$router.back();
} else { } else {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$router.back() this.$router.back();
}) })
.catch(() => { .catch(() => {
}); });

@ -181,41 +181,41 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
import { Loading } from 'element-ui'; import { Loading } from "element-ui";
import pdf from '@/components/pdf' import pdf from "@/components/pdf";
export default { export default {
name: 'contentSettings', name: "contentSettings",
data() { data() {
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
id: '', id: "",
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
chapters: [], chapters: [],
sorting: false, sorting: false,
uploading: false, uploading: false,
uploadList: [], uploadList: [],
chapterVisible: false, chapterVisible: false,
chapterId: '', chapterId: "",
chapterName: '', chapterName: "",
sectionVisible: false, sectionVisible: false,
sectionName: '', sectionName: "",
sectionId: '', sectionId: "",
switchVisible: false, switchVisible: false,
sectionNameVisible: false, sectionNameVisible: false,
fileId: '', fileId: "",
fileName: '', fileName: "",
fileUrl: '', fileUrl: "",
originalFileName: '', originalFileName: "",
fileType: '', fileType: "",
playAuth: '', playAuth: "",
player: null, player: null,
previewImg: '', previewImg: "",
iframeSrc: '', iframeSrc: "",
curFile: {}, curFile: {},
isAddSection: false, isAddSection: false,
isWord: false, isWord: false,
@ -226,15 +226,15 @@ export default {
showMask2: false, showMask2: false,
loadIns: null, loadIns: null,
pdfVisible: false, pdfVisible: false,
pdfSrc: '', pdfSrc: "",
previewing: false previewing: false
} };
}, },
components: { pdf }, components: { pdf },
mounted() { mounted() {
this.insertScript() this.insertScript();
this.id = this.$route.query.id this.id = this.$route.query.id;
this.id && this.getData() this.id && this.getData();
// //
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL); history.pushState(null, null, document.URL);
@ -248,7 +248,7 @@ export default {
getData() { getData() {
this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`)
.then(res => { .then(res => {
this.chapters = res.chapterList this.chapters = res.chapterList;
}) })
.catch(err => { .catch(err => {
@ -256,53 +256,53 @@ export default {
}, },
goBack() { goBack() {
if (this.previewing) { if (this.previewing) {
this.closeIframe() this.closeIframe();
} else { } else {
history.back() history.back();
} }
}, },
iframeOnload() { iframeOnload() {
document.querySelector('#fileIframe').onload = e => { document.querySelector("#fileIframe").onload = e => {
if (this.isPPT) { if (this.isPPT) {
this.showMask = true this.showMask = true;
} else { } else {
this.showMask = false this.showMask = false;
} }
if (this.isWord) { if (this.isWord) {
this.showMask1 = true this.showMask1 = true;
} else { } else {
this.showMask1 = false this.showMask1 = false;
} }
if (this.isExcel) { if (this.isExcel) {
this.showMask2 = true this.showMask2 = true;
} else { } else {
this.showMask2 = false this.showMask2 = false;
}
this.loadIns.close()
} }
this.loadIns.close();
};
}, },
insertScript() { insertScript() {
const linkTag = document.createElement('link'); const linkTag = document.createElement("link");
linkTag.rel = 'stylesheet'; linkTag.rel = "stylesheet";
linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css'; linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
document.body.appendChild(linkTag); document.body.appendChild(linkTag);
const scriptTag = document.createElement('script'); const scriptTag = document.createElement("script");
scriptTag.type = 'text/javascript'; scriptTag.type = "text/javascript";
scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'; scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
document.body.appendChild(scriptTag); document.body.appendChild(scriptTag);
}, },
// //
beforeUpload(file) { beforeUpload(file) {
let type = this.transferType(file.name.substring(file.name.lastIndexOf('.') + 1)) let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1));
if (type != '视频' && type != '图片' && type != 'pdf' && (file.size / 1024 / 1024) > 10) { if (type != "视频" && type != "图片" && type != "pdf" && (file.size / 1024 / 1024) > 10) {
util.errorMsg('请上传10M以内的文件') util.errorMsg("请上传10M以内的文件");
return false return false;
} }
this.uploading = true this.uploading = true;
this.originalFileName = file.name this.originalFileName = file.name;
if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf(".")) if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = file.name.substring(file.name.lastIndexOf('.') + 1) this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg( util.warningMsg(
@ -310,11 +310,11 @@ export default {
); );
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploading = false this.uploading = false;
this.fileId = res.filesResult.fileId this.fileId = res.filesResult.fileId;
this.fileType = res.filesResult.fileType this.fileType = res.filesResult.fileType;
this.fileUrl = res.filesResult.fileUrl this.fileUrl = res.filesResult.fileUrl;
this.fileName = res.filesResult.ossFileName this.fileName = res.filesResult.ossFileName;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -329,63 +329,63 @@ export default {
} }
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.uploadList = fileList this.uploadList = fileList;
}, },
uploadSure() { uploadSure() {
this.importVisible = false this.importVisible = false;
this.pageNo = 1 this.pageNo = 1;
this.staffGradeId = '' this.staffGradeId = "";
this.keyword = '' this.keyword = "";
this.getTeacher() this.getTeacher();
}, },
goback() { goback() {
this.$router.push('course') this.$router.push("course");
}, },
transferType(ext) { transferType(ext) {
if ('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return '图片' if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return '视频' if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext return ext;
}, },
addChapter() { addChapter() {
this.chapterName = '' this.chapterName = "";
this.chapterId = '' this.chapterId = "";
this.chapterVisible = true this.chapterVisible = true;
}, },
sort() { sort() {
this.sorting = true this.sorting = true;
}, },
cancelSort() { cancelSort() {
this.sorting = false this.sorting = false;
}, },
saveSort() { saveSort() {
this.chapters.forEach((n, k) => { this.chapters.forEach((n, k) => {
n.sort = k + 1 n.sort = k + 1;
n.subsectionList.forEach((j, i) => { n.subsectionList.forEach((j, i) => {
j.sort = i + 1 j.sort = i + 1;
}) });
}) });
let data = { let data = {
chapterVOList: this.chapters chapterVOList: this.chapters
} };
this.$post(this.api.reorder, data).then(res => { this.$post(this.api.reorder, data).then(res => {
this.sorting = false this.sorting = false;
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
}, },
editChapter(item) { editChapter(item) {
this.chapterId = item.id this.chapterId = item.id;
this.chapterName = item.name this.chapterName = item.name;
this.chapterVisible = true this.chapterVisible = true;
}, },
delChapter(id) { delChapter(id) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteChapter}/${id}`).then(res => { this.$del(`${this.api.deleteChapter}/${id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
}) })
@ -393,46 +393,46 @@ export default {
}); });
}, },
closeSection() { closeSection() {
this.isAddSection = false this.isAddSection = false;
}, },
addSection(id) { addSection(id) {
this.chapterId = id this.chapterId = id;
this.sectionName = '' this.sectionName = "";
this.fileUrl = '' this.fileUrl = "";
this.uploadList = [] this.uploadList = [];
this.sectionId = '' this.sectionId = "";
this.isAddSection = true this.isAddSection = true;
this.sectionVisible = true this.sectionVisible = true;
}, },
chapterSubmit() { chapterSubmit() {
if (!this.chapterName) return util.warningMsg('请填写章节名称') if (!this.chapterName) return util.warningMsg("请填写章节名称");
let data = { let data = {
courseId: this.id, courseId: this.id,
name: this.chapterName name: this.chapterName
} };
if (this.chapterId) { if (this.chapterId) {
data.id = this.chapterId data.id = this.chapterId;
this.$put(this.api.editChapter, data).then(res => { this.$put(this.api.editChapter, data).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.chapterVisible = false this.chapterVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
} else { } else {
this.$post(this.api.addChapter, data).then(res => { this.$post(this.api.addChapter, data).then(res => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.chapterVisible = false this.chapterVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
sectionSubmit() { sectionSubmit() {
if (!this.sectionName) return util.warningMsg('请填写小节名称') if (!this.sectionName) return util.warningMsg("请填写小节名称");
if (this.uploading) return util.warningMsg('资源正在上传中,请稍候') if (this.uploading) return util.warningMsg("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return util.warningMsg('请上传资源') if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
courseId: this.id, courseId: this.id,
@ -443,95 +443,95 @@ export default {
fileName: this.fileName, fileName: this.fileName,
fileType: this.fileType, fileType: this.fileType,
originalFileName: this.originalFileName originalFileName: this.originalFileName
} };
this.$post(this.api.addSubsection, data).then(res => { this.$post(this.api.addSubsection, data).then(res => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.sectionVisible = false this.sectionVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}, },
closeSwitch() { closeSwitch() {
this.fileId = '' this.fileId = "";
this.fileName = '' this.fileName = "";
this.fileType = '' this.fileType = "";
this.fileUrl = '' this.fileUrl = "";
this.sectionId = '' this.sectionId = "";
}, },
preview(row) { preview(row) {
if (this.transferType(row.fileType) == '视频') { if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth this.playAuth = res.data.playAuth;
if (this.player) { if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth) this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else { } else {
this.player = new Aliplayer({ this.player = new Aliplayer({
id: 'player', id: "player",
width: '100%', width: "100%",
autoplay: false, autoplay: false,
vid: row.fileId, vid: row.fileId,
playauth: this.playAuth, playauth: this.playAuth,
encryptType: 1 // encryptType: 1 //
}) });
} }
}).catch(res => { }).catch(res => {
}) });
} else if (this.transferType(row.fileType) == '图片') { } else if (this.transferType(row.fileType) == "图片") {
this.previewImg = row.fileUrl this.previewImg = row.fileUrl;
} else if (row.fileType == 'pdf') { } else if (row.fileType == "pdf") {
this.pdfSrc = row.fileUrl this.pdfSrc = row.fileUrl;
this.pdfVisible = true this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { this.$get(`${this.api.getSubsection}/${row.id}`).then(res => {
this.previewing = true this.previewing = true;
this.loadIns = Loading.service() this.loadIns = Loading.service();
this.$route.fullPath.includes('#file') || history.pushState({ file: true }, '文件预览', '#' + this.$route.fullPath + '#file') this.$route.fullPath.includes("#file") || history.pushState({ file: true }, "文件预览", "#" + this.$route.fullPath + "#file");
if (row.fileType == 'pptx') { if (row.fileType == "pptx") {
this.isPPT = true this.isPPT = true;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
} else if (row.fileType == 'doc' || row.fileType == 'docx') { } else if (row.fileType == "doc" || row.fileType == "docx") {
this.isPPT = false this.isPPT = false;
this.isWord = true this.isWord = true;
this.isExcel = false this.isExcel = false;
} else if (row.fileType == 'xls' || row.fileType == 'xlsx') { } else if (row.fileType == "xls" || row.fileType == "xlsx") {
this.isExcel = true this.isExcel = true;
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
} else { } else {
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
} }
this.iframeSrc = res.data.previewUrl this.iframeSrc = res.data.previewUrl;
this.$nextTick(() => { this.$nextTick(() => {
this.iframeOnload() this.iframeOnload();
}) });
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
editSectionName(row, chapterId) { editSectionName(row, chapterId) {
this.chapterId = chapterId this.chapterId = chapterId;
this.sectionId = row.id this.sectionId = row.id;
this.sectionName = row.name this.sectionName = row.name;
this.sectionNameVisible = true this.sectionNameVisible = true;
}, },
switchFile(row, chapterId, sectionId) { switchFile(row, chapterId, sectionId) {
this.uploadList = [] this.uploadList = [];
this.curFile = { this.curFile = {
fileId: row.fileId, fileId: row.fileId,
fileName: row.fileName, fileName: row.fileName,
fileType: row.fileType, fileType: row.fileType,
fileUrl: row.fileUrl fileUrl: row.fileUrl
} };
this.chapterId = chapterId this.chapterId = chapterId;
this.sectionId = row.id this.sectionId = row.id;
this.sectionName = row.sectionName this.sectionName = row.sectionName;
this.switchVisible = true this.switchVisible = true;
}, },
switchSubmitFile() { switchSubmitFile() {
let data = { let data = {
@ -544,41 +544,41 @@ export default {
fileType: this.fileType, fileType: this.fileType,
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
originalFileName: this.originalFileName originalFileName: this.originalFileName
} };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
util.successMsg('更换成功'); util.successMsg("更换成功");
this.switchVisible = false this.switchVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}, },
switchSubmit() { switchSubmit() {
if (this.uploading) return util.warningMsg('资源正在上传中,请稍候') if (this.uploading) return util.warningMsg("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return util.warningMsg('请上传资源') if (!this.fileUrl && !this.fileId) return util.warningMsg("请上传资源");
if (this.transferType(this.curFile.fileType) == '视频') { if (this.transferType(this.curFile.fileType) == "视频") {
let data = { let data = {
videoIdList: [this.sectionId] videoIdList: [this.sectionId]
} };
this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => { this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => {
this.switchSubmitFile() this.switchSubmitFile();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => {
this.switchSubmitFile() this.switchSubmitFile();
}).catch(res => { }).catch(res => {
}); });
} }
}, },
delSection(row) { delSection(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
}) })
@ -587,58 +587,58 @@ export default {
}, },
sortChapter(row, type, disabled, index) { sortChapter(row, type, disabled, index) {
if (!disabled) { if (!disabled) {
if (type == 'up') { if (type == "up") {
let tempItem = this.chapters.splice(index - 1, 1)[0] let tempItem = this.chapters.splice(index - 1, 1)[0];
this.chapters.splice(index, 0, tempItem) this.chapters.splice(index, 0, tempItem);
} else { } else {
let tempItem = this.chapters.splice(index + 1, 1)[0] let tempItem = this.chapters.splice(index + 1, 1)[0];
this.chapters.splice(index, 0, tempItem) this.chapters.splice(index, 0, tempItem);
} }
} }
}, },
sortSection(chapterIndex, type, disabled, index) { sortSection(chapterIndex, type, disabled, index) {
if (!disabled) { if (!disabled) {
let list = this.chapters[chapterIndex].subsectionList let list = this.chapters[chapterIndex].subsectionList;
if (type == 'up') { if (type == "up") {
let tempItem = list.splice(index - 1, 1)[0] let tempItem = list.splice(index - 1, 1)[0];
list.splice(index, 0, tempItem) list.splice(index, 0, tempItem);
} else { } else {
let tempItem = list.splice(index + 1, 1)[0] let tempItem = list.splice(index + 1, 1)[0];
list.splice(index, 0, tempItem) list.splice(index, 0, tempItem);
} }
this.chapters[chapterIndex].subsectionList = list this.chapters[chapterIndex].subsectionList = list;
} }
}, },
sectionNameSubmit() { sectionNameSubmit() {
if (!this.sectionName) return util.warningMsg('请填写小节名称') if (!this.sectionName) return util.warningMsg("请填写小节名称");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
courseId: this.id, courseId: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionName name: this.sectionName
} };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.sectionNameVisible = false this.sectionNameVisible = false;
this.getData() this.getData();
}) })
.catch(err => { .catch(err => {
}); });
}, },
closePlayer() { closePlayer() {
this.playAuth = '' this.playAuth = "";
this.player.pause() this.player.pause();
}, },
closeIframe() { closeIframe() {
this.iframeSrc = '' this.iframeSrc = "";
this.showMask = false this.showMask = false;
this.showMask1 = false this.showMask1 = false;
this.showMask2 = false this.showMask2 = false;
this.previewing = false this.previewing = false;
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

@ -74,15 +74,15 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'courseManagement', name: "courseManagement",
data() { data() {
return { return {
schoolId: this.$store.state.schoolId, schoolId: this.$store.state.schoolId,
keyword: '', keyword: "",
classificationId: '', classificationId: "",
courseData: [], courseData: [],
multipleSelection: [], multipleSelection: [],
classificationList: [], classificationList: [],
@ -93,66 +93,66 @@ export default {
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData();
}, 500) }, 500);
} }
}, },
mounted() { mounted() {
this.getClassification() this.getClassification();
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
let data = { let data = {
classificationId: this.classificationId, classificationId: this.classificationId,
name: this.keyword name: this.keyword
} };
this.$get(`${this.api.queryCourseByCondition}/${this.current}/${this.pageSize}`, data).then(res => { this.$get(`${this.api.queryCourseByCondition}/${this.current}/${this.pageSize}`, data).then(res => {
this.courseData = res.courseList this.courseData = res.courseList;
this.totals = res.total this.totals = res.total;
if (!this.courseData.length && this.totals) { if (!this.courseData.length && this.totals) {
this.current-- this.current--;
this.getData() this.getData();
} }
}).catch(res => { }).catch(res => {
}); });
}, },
initData() { initData() {
this.current = 1 this.current = 1;
this.getData() this.getData();
}, },
getClassification() { getClassification() {
this.$get(this.api.queryGlClassification).then(res => { this.$get(this.api.queryGlClassification).then(res => {
this.classificationList = res.classificationList this.classificationList = res.classificationList;
}).catch(res => { }).catch(res => {
}); });
}, },
changeType(type) { changeType(type) {
this.classificationId = type this.classificationId = type;
this.initData() this.initData();
}, },
preview(row) { preview(row) {
this.$router.push(`/course/preview?id=${row.id}`) this.$router.push(`/course/preview?id=${row.id}`);
}, },
config(row) { config(row) {
this.$router.push(`/course/contentSettings?id=${row.id}`) this.$router.push(`/course/contentSettings?id=${row.id}`);
}, },
addCourse() { addCourse() {
this.$router.push('/course/add') this.$router.push("/course/add");
}, },
editCourse(row) { editCourse(row) {
this.$router.push(`/course/add?id=${row.id}`) this.$router.push(`/course/add?id=${row.id}`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteCourse}/${row.id}`).then(res => { this.$del(`${this.api.deleteCourse}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.initData() this.initData();
}).catch(res => { }).catch(res => {
}); });
}) })
@ -166,29 +166,29 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllData() { delAllData() {
if (this.multipleSelection.length != '') { if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id;
}) });
this.$confirm(`此批量删除操作不可逆,是否确认删除${newArr[0].name}${newArr.length}个选中项?`, '提示', { this.$confirm(`此批量删除操作不可逆,是否确认删除${newArr[0].name}${newArr.length}个选中项?`, "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
courseIds: delList.join() courseIds: delList.join()
} };
this.$del(this.api.deleteCourses, data).then(res => { this.$del(this.api.deleteCourses, data).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功'); util.successMsg("删除成功");
this.initData() this.initData();
}).catch(res => { }).catch(res => {
}); });
}).catch(() => { }).catch(() => {
}); });
} else { } else {
util.errorMsg('请先选择数据 !'); util.errorMsg("请先选择数据 !");
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
@ -198,14 +198,14 @@ export default {
switchOff(val, row, index) { switchOff(val, row, index) {
this.$put(`${this.api.enableCourse}?courseId=${row.id}&isEnable=${val}`) this.$put(`${this.api.enableCourse}?courseId=${row.id}&isEnable=${val}`)
.then(res => { .then(res => {
this.getData() this.getData();
val == 1 ? util.warningMsg('该教学资源已隐藏,对学生端用户不可见') : util.successMsg('该教学资源已公开,对学生端用户可见') val == 1 ? util.warningMsg("该教学资源已隐藏,对学生端用户不可见") : util.successMsg("该教学资源已公开,对学生端用户可见");
}) })
.catch(err => { .catch(err => {
}); });
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -72,28 +72,28 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import { mapState } from 'vuex'; import { mapState } from "vuex";
import pdf from "vue-pdf"; import pdf from "vue-pdf";
import 'quill/dist/quill.core.css'; import "quill/dist/quill.core.css";
import 'quill/dist/quill.snow.css'; import "quill/dist/quill.snow.css";
import 'quill/dist/quill.bubble.css'; import "quill/dist/quill.bubble.css";
export default { export default {
name: 'coursePreview', name: "coursePreview",
data() { data() {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
video: 'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4', video: "http://liuwanr.oss-cn-shenzhen.aliyuncs.com/mp4/20200519/1589871025648.mp4",
videoSrc: '', videoSrc: "",
videoList: [], videoList: [],
courseName: '', courseName: "",
description: '', description: "",
coverUrl: '', coverUrl: "",
playAuth: '', playAuth: "",
player: null, player: null,
previewImg: '', previewImg: "",
iframeSrc: '', iframeSrc: "",
isWord: false, isWord: false,
isPPT: false, isPPT: false,
isExcel: false, isExcel: false,
@ -101,149 +101,149 @@ export default {
showMask1: false, showMask1: false,
showMask2: false, showMask2: false,
closePosi: { closePosi: {
top: '80px' top: "80px"
}, },
pdfVisible: false, pdfVisible: false,
pdfSrc: '', pdfSrc: "",
currentPage: 0, // pdf currentPage: 0, // pdf
pageCount: 0, // pdf pageCount: 0, // pdf
fileType: 'pdf', // fileType: "pdf", //
desShrink: false desShrink: false
} };
}, },
components: { pdf }, components: { pdf },
mounted() { mounted() {
this.insertScript() this.insertScript();
this.getData() this.getData();
this.getChapter() this.getChapter();
}, },
methods: { methods: {
goBack() { goBack() {
this.$router.back(); this.$router.back();
}, },
async getData() { async getData() {
let res = await this.$get(`${this.api.getCourse}/${this.id}`) let res = await this.$get(`${this.api.getCourse}/${this.id}`);
this.courseName = res.course.name this.courseName = res.course.name;
this.description = res.course.description this.description = res.course.description;
this.coverUrl = res.course.coverUrl this.coverUrl = res.course.coverUrl;
}, },
async getChapter() { async getChapter() {
let res = await this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`) let res = await this.$get(`${this.api.queryChaptersAndSubsections}/${this.id}`);
this.videoList = res.chapterList this.videoList = res.chapterList;
}, },
insertScript() { insertScript() {
const linkTag = document.createElement('link'); const linkTag = document.createElement("link");
linkTag.rel = 'stylesheet'; linkTag.rel = "stylesheet";
linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css'; linkTag.href = "https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css";
document.body.appendChild(linkTag); document.body.appendChild(linkTag);
const scriptTag = document.createElement('script'); const scriptTag = document.createElement("script");
scriptTag.type = 'text/javascript'; scriptTag.type = "text/javascript";
scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'; scriptTag.src = "https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js";
document.body.appendChild(scriptTag); document.body.appendChild(scriptTag);
}, },
transferType(ext) { transferType(ext) {
if ('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return '图片' if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return '视频' if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
return ext return ext;
}, },
preview(row) { preview(row) {
this.player = null this.player = null;
this.playauth = '' this.playauth = "";
this.coverUrl = '' this.coverUrl = "";
this.pdfSrc = '' this.pdfSrc = "";
this.iframeSrc = '' this.iframeSrc = "";
if (this.transferType(row.fileType) == '视频') { if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.playAuth this.playAuth = res.playAuth;
this.$nextTick(() => { this.$nextTick(() => {
if (this.player) { if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth) this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else { } else {
this.player = new Aliplayer({ this.player = new Aliplayer({
id: 'player', id: "player",
width: '100%', width: "100%",
autoplay: false, autoplay: false,
vid: row.fileId, vid: row.fileId,
playauth: this.playAuth, playauth: this.playAuth,
encryptType: 1 // encryptType: 1 //
}) });
} }
}) });
}).catch(res => { }).catch(res => {
}) });
} else if (this.transferType(row.fileType) == '图片') { } else if (this.transferType(row.fileType) == "图片") {
this.coverUrl = row.fileUrl this.coverUrl = row.fileUrl;
} else if (row.fileType == 'pdf') { } else if (row.fileType == "pdf") {
this.pdfSrc = row.fileUrl this.pdfSrc = row.fileUrl;
this.pdfVisible = true this.pdfVisible = true;
} else { } else {
this.$get(`${this.api.getSubsection}/${row.id}`).then(res => { this.$get(`${this.api.getSubsection}/${row.id}`).then(res => {
if (row.fileType == 'pptx') { if (row.fileType == "pptx") {
this.isPPT = true this.isPPT = true;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
} else if (row.fileType == 'doc' || row.fileType == 'docx') { } else if (row.fileType == "doc" || row.fileType == "docx") {
this.isPPT = false this.isPPT = false;
this.isWord = true this.isWord = true;
this.isExcel = false this.isExcel = false;
} else if (row.fileType == 'xls' || row.fileType == 'xlsx') { } else if (row.fileType == "xls" || row.fileType == "xlsx") {
this.isExcel = true this.isExcel = true;
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
} else { } else {
this.isPPT = false this.isPPT = false;
this.isWord = false this.isWord = false;
this.isExcel = false this.isExcel = false;
} }
if (this.isPPT) { if (this.isPPT) {
this.showMask = true this.showMask = true;
} else { } else {
this.showMask = false this.showMask = false;
} }
if (this.isWord) { if (this.isWord) {
this.showMask1 = true this.showMask1 = true;
} else { } else {
this.showMask1 = false this.showMask1 = false;
} }
if (this.isExcel) { if (this.isExcel) {
this.showMask2 = true this.showMask2 = true;
} else { } else {
this.showMask2 = false this.showMask2 = false;
} }
this.iframeSrc = res.previewUrl this.iframeSrc = res.previewUrl;
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
closePlayer() { closePlayer() {
this.playAuth = '' this.playAuth = "";
this.player.pause() this.player.pause();
}, },
closeIframe() { closeIframe() {
this.iframeSrc = '' this.iframeSrc = "";
this.showMask = false this.showMask = false;
this.showMask1 = false this.showMask1 = false;
}, },
closePdf() { closePdf() {
this.pdfSrc = '' this.pdfSrc = "";
this.currentPage = 1 this.currentPage = 1;
}, },
changePdfPage(val) { changePdfPage(val) {
if (val === 0 && this.currentPage > 1) { if (val === 0 && this.currentPage > 1) {
this.currentPage-- this.currentPage--;
} }
if (val === 1 && this.currentPage < this.pageCount) { if (val === 1 && this.currentPage < this.pageCount) {
this.currentPage++ this.currentPage++;
} }
}, },
loadPdfHandler(e) { loadPdfHandler(e) {
this.currentPage = 1 this.currentPage = 1;
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -14,30 +14,30 @@
</template> </template>
<script> <script>
import Setting from '@/setting'; import Setting from "@/setting";
import { mapState } from 'vuex' import { mapState } from "vuex";
import CourseManagement from "./courseManagement"; import CourseManagement from "./courseManagement";
import SortManagement from "./sortManagement"; import SortManagement from "./sortManagement";
export default { export default {
name: 'course', name: "course",
components: { components: {
CourseManagement, CourseManagement,
SortManagement SortManagement
}, },
data() { data() {
return { return {
active: 'first', // active: "first", //
tabs: { tabs: {
first: '课程管理', first: "课程管理",
second: '分类管理' second: "分类管理"
}, },
showTabs: true showTabs: true
} };
}, },
computed: { computed: {
...mapState('auth', [ ...mapState("auth", [
'routes' "routes"
]) ])
}, },
methods: { methods: {
@ -46,19 +46,19 @@ export default {
}, },
initTabs() { initTabs() {
let btnPermissions = this.routes; let btnPermissions = this.routes;
let showStaff = btnPermissions.includes('课程资源管理:课程管理'); let showStaff = btnPermissions.includes("课程资源管理:课程管理");
let showRole = btnPermissions.includes('课程资源管理:分类管理'); let showRole = btnPermissions.includes("课程资源管理:分类管理");
if (!showStaff || !showRole) { if (!showStaff || !showRole) {
this.showTabs = false; this.showTabs = false;
} }
!showStaff && showRole && (this.active = 'second') !showStaff && showRole && (this.active = "second");
} }
}, },
mounted() { mounted() {
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs();
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -41,10 +41,10 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'sortManagement', name: "sortManagement",
data() { data() {
return { return {
classificationList: [], classificationList: [],
@ -54,33 +54,33 @@ export default {
isAddclass: true, isAddclass: true,
classVisible: false, classVisible: false,
curRow: {}, curRow: {},
className: '' className: ""
} };
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
this.$get(this.api.queryGlClassification).then(res => { this.$get(this.api.queryGlClassification).then(res => {
this.classificationList = res.classificationList this.classificationList = res.classificationList;
}).catch(res => { }).catch(res => {
}); });
}, },
addCourse() { addCourse() {
this.$router.push('/addcourse') this.$router.push("/addcourse");
}, },
editCourse(row) { editCourse(row) {
this.$router.push(`/addcourse?id=${row.id}`) this.$router.push(`/addcourse?id=${row.id}`);
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteClassification}/${row.id}`).then(res => { this.$del(`${this.api.deleteClassification}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
}) })
@ -94,31 +94,31 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
closeColumn() { closeColumn() {
this.className = '' this.className = "";
this.curRow = {} this.curRow = {};
}, },
delAllData() { delAllData() {
if (this.multipleSelection.length != '') { if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id;
}) });
// //
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = delList.join() let data = delList.join();
this.$del(this.api.deleteClassification, data).then(res => { this.$del(this.api.deleteClassification, data).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
}).catch(() => { }).catch(() => {
}); });
} else { } else {
util.errorMsg('请先选择数据 !'); util.errorMsg("请先选择数据 !");
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
@ -126,39 +126,39 @@ export default {
this.getData(); this.getData();
}, },
addClass() { addClass() {
this.isAddClass = true this.isAddClass = true;
this.classVisible = true this.classVisible = true;
}, },
editClass(row) { editClass(row) {
this.curRow = row this.curRow = row;
this.className = row.name this.className = row.name;
this.isAddClass = false this.isAddClass = false;
this.classVisible = true this.classVisible = true;
}, },
classSubmit() { classSubmit() {
if (!this.className) return util.warningMsg('请填写分类名称') if (!this.className) return util.warningMsg("请填写分类名称");
let data = { let data = {
name: this.className name: this.className
} };
if (this.curRow.id) { if (this.curRow.id) {
data.id = this.curRow.id data.id = this.curRow.id;
this.$put(this.api.editClassification, data).then(res => { this.$put(this.api.editClassification, data).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.classVisible = false this.classVisible = false;
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(`${this.api.addClassification}/${this.className}?distinguish=1`).then(res => { this.$post(`${this.api.addClassification}/${this.className}?distinguish=1`).then(res => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.classVisible = false this.classVisible = false;
this.getData() this.getData();
}).catch(res => { }).catch(res => {
}); });
} }
} }
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -1,309 +1,309 @@
<template> <template>
<div class='page'> <div class="page">
<h6 class='p-title'>筛选</h6> <h6 class="p-title">筛选</h6>
<div class='tool'> <div class="tool">
<ul class='filter'> <ul class="filter">
<li> <li>
<label>题目类型</label> <label>题目类型</label>
<el-radio-group v-model='subject' @change='initData'> <el-radio-group v-model="subject" @change="initData">
<el-radio <el-radio
v-for='(item,index) in subjectList' v-for="(item,index) in subjectList"
:key='index' :key="index"
:label='item.id' :label="item.id"
>{{ item.name }} >{{ item.name }}
</el-radio> </el-radio>
</el-radio-group> </el-radio-group>
</li> </li>
<li> <li>
<el-input size='small' placeholder='请输入题干' prefix-icon='el-icon-search' v-model='keyword' <el-input size="small" placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword"
clearable></el-input> clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button type='primary' size='small' @click='getInfo' v-auth>测评设置</el-button> <el-button type="primary" size="small" @click="getInfo" v-auth>测评设置</el-button>
<el-button type='primary' size='small' @click='addTopics' v-auth>新增题目</el-button> <el-button type="primary" size="small" @click="addTopics" v-auth>新增题目</el-button>
<el-button type='primary' size='small' @click='showBatchUpload' v-auth>批量上传</el-button> <el-button type="primary" size="small" @click="showBatchUpload" v-auth>批量上传</el-button>
<el-button type='primary' size='small' @click='delAllData' v-auth>批量删除</el-button> <el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data='listData' ref='table' row-key='id' class='table' stripe header-align='center' <el-table :data="listData" ref="table" row-key="id" class="table" stripe header-align="center"
@selection-change='handleSelectionChange'> @selection-change="handleSelectionChange">
<el-table-column type='selection' width='55' align='center' :reserve-selection='true'></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type='index' width='100' label='序号' align='center'> <el-table-column type="index" width="100" label="序号" align="center">
<template <template
slot-scope='scope' slot-scope="scope"
>{{ scope.$index + (page - 1) * pageSize + 1 }} >{{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop='questionStem' label='题干' align='center'></el-table-column> <el-table-column prop="questionStem" label="题干" align="center"></el-table-column>
<el-table-column prop='questionType' label='题型' align='center'> <el-table-column prop="questionType" label="题型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{questionType[scope.row.questionType]}}</span> <span>{{ questionType[scope.row.questionType] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop='updateTime' label='时间' align='center'></el-table-column> <el-table-column prop="updateTime" label="时间" align="center"></el-table-column>
<el-table-column label='操作' align='center'> <el-table-column label="操作" align="center">
<template slot-scope='scope'> <template slot-scope="scope">
<template v-if='scope.row.isEnable'> <template v-if="scope.row.isEnable">
<el-button type='text' @click='showQues(scope.row)' v-auth>查看</el-button> <el-button type="text" @click="showQues(scope.row)" v-auth>查看</el-button>
</template> </template>
<template v-else> <template v-else>
<el-button type='text' @click='editQues(scope.row)' v-auth>修改</el-button> <el-button type="text" @click="editQues(scope.row)" v-auth>修改</el-button>
</template> </template>
<el-switch <el-switch
v-model='scope.row.isEnable' v-model="scope.row.isEnable"
:active-text="scope.row.isEnable ? '关闭' : '启用'" :active-text="scope.row.isEnable ? '关闭' : '启用'"
:active-value='1' :active-value="1"
:inactive-value='0' :inactive-value="0"
style='margin: 0 10px 0 5px' style="margin: 0 10px 0 5px"
@change='switchQues($event,scope.row,scope.$index)' @change="switchQues($event,scope.row,scope.$index)"
v-auth="'evaluation:禁用'" v-auth="'evaluation:禁用'"
></el-switch> ></el-switch>
<el-button type='text' @click='delData(scope.row)' v-auth>删除</el-button> <el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class='pagination'> <div class="pagination">
<el-pagination background @current-change='handleCurrentChange' :current-page='page' :page-size='pageSize' <el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-size="pageSize"
layout='total,prev, pager, next' :total='total'></el-pagination> layout="total,prev, pager, next" :total="total"></el-pagination>
</div> </div>
<el-dialog title='测评设置' :visible.sync='SetEvaluation' width='30%' :close-on-click-modal='false'> <el-dialog title="测评设置" :visible.sync="SetEvaluation" width="30%" :close-on-click-modal="false">
<div style='margin-bottom: 15px;'> <div style="margin-bottom: 15px;">
<span class='radio'>题目选择</span> <span class="radio">题目选择</span>
<el-radio v-model='info.evaluationType' label='1'>随机</el-radio> <el-radio v-model="info.evaluationType" label="1">随机</el-radio>
<el-radio v-model='info.evaluationType' label='0'>自定义</el-radio> <el-radio v-model="info.evaluationType" label="0">自定义</el-radio>
</div> </div>
<!-- 随机 --> <!-- 随机 -->
<el-card shadow='hover' class='card_m' v-show='info.evaluationType==1'> <el-card shadow="hover" class="card_m" v-show="info.evaluationType==1">
<div class='input flex_around'> <div class="input flex_around">
<span>测评题目总数</span> <span>测评题目总数</span>
<el-input placeholder='请输入题目数量' type='number' v-model='info.questionNum'></el-input> <el-input placeholder="请输入题目数量" type="number" v-model="info.questionNum"></el-input>
<span>(总数{{ info.totalQuestionNum }})</span> <span>(总数{{ info.totalQuestionNum }})</span>
</div> </div>
</el-card> </el-card>
<!-- 自定义 --> <!-- 自定义 -->
<el-card shadow='hover' class='card_m' v-show='info.evaluationType==0'> <el-card shadow="hover" class="card_m" v-show="info.evaluationType==0">
<div class='input'> <div class="input">
<div class='check-wrap' :class='{checked: info.isSingleEnable}'> <div class="check-wrap" :class="{checked: info.isSingleEnable}">
<el-checkbox v-model='info.isSingleEnable'>单选题</el-checkbox> <el-checkbox v-model="info.isSingleEnable">单选题</el-checkbox>
<el-input placeholder='请输入题目数量' type='number' v-model='info.singleNum' <el-input placeholder="请输入题目数量" type="number" v-model="info.singleNum"
:disabled='!info.isSingleEnable'></el-input> :disabled="!info.isSingleEnable"></el-input>
<span>(总数{{ info.totalSingleNum }})</span> <span>(总数{{ info.totalSingleNum }})</span>
</div> </div>
<div class='check-wrap' :class='{checked: info.isMultipleEnable}'> <div class="check-wrap" :class="{checked: info.isMultipleEnable}">
<el-checkbox v-model='info.isMultipleEnable'>多选题</el-checkbox> <el-checkbox v-model="info.isMultipleEnable">多选题</el-checkbox>
<el-input placeholder='请输入题目数量' type='number' v-model='info.multipleNum' <el-input placeholder="请输入题目数量" type="number" v-model="info.multipleNum"
:disabled='!info.isMultipleEnable'></el-input> :disabled="!info.isMultipleEnable"></el-input>
<span>(总数{{ info.totalMultipleNum }})</span> <span>(总数{{ info.totalMultipleNum }})</span>
</div> </div>
<div class='check-wrap' :class='{checked: info.isJudgmentEnable}'> <div class="check-wrap" :class="{checked: info.isJudgmentEnable}">
<el-checkbox v-model='info.isJudgmentEnable'>判断题</el-checkbox> <el-checkbox v-model="info.isJudgmentEnable">判断题</el-checkbox>
<el-input placeholder='请输入题目数量' type='number' v-model='info.judgmentNum' <el-input placeholder="请输入题目数量" type="number" v-model="info.judgmentNum"
:disabled='!info.isJudgmentEnable'></el-input> :disabled="!info.isJudgmentEnable"></el-input>
<span>(总数{{ info.totalJudgmentNum }})</span> <span>(总数{{ info.totalJudgmentNum }})</span>
</div> </div>
</div> </div>
</el-card> </el-card>
<div class='jobNumber'> <div class="jobNumber">
<div class='input'> <div class="input">
<span style='margin:0px 15px 0px 35px'>测评时长</span> <span style="margin:0px 15px 0px 35px">测评时长</span>
<el-input placeholder='请输入时间' type='number' v-model='info.duration'></el-input> <el-input placeholder="请输入时间" type="number" v-model="info.duration"></el-input>
<span style='margin-left:15px'>分钟</span> <span style="margin-left:15px">分钟</span>
</div> </div>
</div> </div>
<span slot='footer' class='dialog-footer'> <span slot="footer" class="dialog-footer">
<el-button size='small' @click='SetEvaluation = false'> </el-button> <el-button size="small" @click="SetEvaluation = false"> </el-button>
<el-button size='small' type='primary' @click='submitSetEva'> </el-button> <el-button size="small" type="primary" @click="submitSetEva"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title='topicsTitle' :visible.sync='NewTopics' width='30%' @close='closeTopics' <el-dialog :title="topicsTitle" :visible.sync="NewTopics" width="30%" @close="closeTopics"
:close-on-click-modal='false'> :close-on-click-modal="false">
<el-form <el-form
:model='topicForm' :model="topicForm"
:rules='rules' :rules="rules"
:disabled='isShowTopics' :disabled="isShowTopics"
ref='topicForm' ref="topicForm"
label-width='70px' label-width="70px"
class='demo-topicForm' class="demo-topicForm"
> >
<el-form-item label='题型' prop='questionType'> <el-form-item label="题型" prop="questionType">
<el-radio-group v-model='topicForm.questionType' @change='questionTypeChange'> <el-radio-group v-model="topicForm.questionType" @change="questionTypeChange">
<el-radio label='单选题'></el-radio> <el-radio label="单选题"></el-radio>
<el-radio label='多选题'></el-radio> <el-radio label="多选题"></el-radio>
<el-radio label='判断题'></el-radio> <el-radio label="判断题"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label='题干' prop='questionStem'> <el-form-item label="题干" prop="questionStem">
<el-input type='textarea' v-model='topicForm.questionStem'></el-input> <el-input type="textarea" v-model="topicForm.questionStem"></el-input>
</el-form-item> </el-form-item>
<el-form-item label='选项' prop='optionA'> <el-form-item label="选项" prop="optionA">
<div class='input flex_around bt'> <div class="input flex_around bt">
<span>A</span> <span>A</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionA'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model='topicForm.aisTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class='input flex_around bt'> <div class="input flex_around bt">
<span>B</span> <span>B</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionB'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model='topicForm.bisTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div> </div>
<template v-if="topicForm.questionType != '判断题'"> <template v-if="topicForm.questionType != '判断题'">
<div class='input flex_around bt'> <div class="input flex_around bt">
<span>C</span> <span>C</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionC'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model='topicForm.cisTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class='input flex_around bt'> <div class="input flex_around bt">
<span>D</span> <span>D</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionD'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model='topicForm.disTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div> </div>
<div class='input flex_around bt'> <div class="input flex_around bt">
<span>E</span> <span>E</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionE'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model='topicForm.eisTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div> </div>
<div class='input flex_around'> <div class="input flex_around">
<span>F</span> <span>F</span>
<el-input placeholder='请输入题目' v-model='topicForm.optionF'></el-input> <el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model='topicForm.fisTrue'>设为正确答案</el-checkbox> <el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
</div> </div>
</template> </template>
</el-form-item> </el-form-item>
<el-form-item label='答案解析' prop='answerAnalysis'> <el-form-item label="答案解析" prop="answerAnalysis">
<el-input type='textarea' v-model='topicForm.answerAnalysis'></el-input> <el-input type="textarea" v-model="topicForm.answerAnalysis"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot='footer' class='dialog-footer' v-show='!isShowTopics'> <div slot="footer" class="dialog-footer" v-show="!isShowTopics">
<el-button size='small' @click='NewTopics = false'> </el-button> <el-button size="small" @click="NewTopics = false"> </el-button>
<el-button size='small' type='primary' @click='saveTopics'> </el-button> <el-button size="small" type="primary" @click="saveTopics"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title='批量上传' :visible.sync='BatchUpload' width='30%' @close='closeUpload' <el-dialog title="批量上传" :visible.sync="BatchUpload" width="30%" @close="closeUpload"
:close-on-click-modal='false'> :close-on-click-modal="false">
<el-card shadow='hover' class='card_m' v-show='this.label=1'> <el-card shadow="hover" class="card_m" v-show="this.label=1">
<div class='Upload'> <div class="Upload">
<div class='bt' @click='downloadTem'> <div class="bt" @click="downloadTem">
<el-link :underline='false'> <el-link :underline="false">
1.请下载模板 1.请下载模板
<i class='el-icon-download'></i> <i class="el-icon-download"></i>
</el-link> </el-link>
</div> </div>
<div> <div>
<el-upload <el-upload
accept='.xls,.xlsx' accept=".xls,.xlsx"
:on-remove='handleDataRemove' :on-remove="handleDataRemove"
:on-error='uploadError' :on-error="uploadError"
:on-success='uploadSuccess' :on-success="uploadSuccess"
:before-remove='beforeRemove' :before-remove="beforeRemove"
:limit='1' :limit="1"
:on-exceed='handleExceed' :on-exceed="handleExceed"
:action='questionsImport' :action="questionsImport"
:file-list='uploadDataList' :file-list="uploadDataList"
name='file' name="file"
> >
<el-link :underline='false'> <el-link :underline="false">
2.请点击批量导入 2.请点击批量导入
<i class='el-icon-upload'></i> <i class="el-icon-upload"></i>
</el-link> </el-link>
</el-upload> </el-upload>
<el-link v-if='uploadFaild' type='primary' @click='showFaild'>部分数据导入失败查看失败原因</el-link> <el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div> </div>
</div> </div>
</el-card> </el-card>
<span slot='footer' class='dialog-footer'> <span slot="footer" class="dialog-footer">
<el-button size='small' @click='BatchUpload = false'> </el-button> <el-button size="small" @click="BatchUpload = false"> </el-button>
<el-button size='small' type='primary' @click='uploadSure'> </el-button> <el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from "vuex";
import util from '@/libs/util'; import util from "@/libs/util";
import Setting from '@/setting'; import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {
questionsImport: this.api.questionsImport, questionsImport: this.api.questionsImport,
topicForm: { topicForm: {
answer: '', answer: "",
questionType: '单选题', questionType: "单选题",
questionStem: '', questionStem: "",
optionA: '', optionA: "",
optionB: '', optionB: "",
optionC: '', optionC: "",
optionD: '', optionD: "",
optionE: '', optionE: "",
optionF: '', optionF: "",
aisTrue: false, aisTrue: false,
bisTrue: false, bisTrue: false,
cisTrue: false, cisTrue: false,
disTrue: false, disTrue: false,
eisTrue: false, eisTrue: false,
fisTrue: false, fisTrue: false,
answerAnalysis: '' answerAnalysis: ""
}, },
rules: { rules: {
questionType: [{ required: true, message: '请选择题型', trigger: 'change' }], questionType: [{ required: true, message: "请选择题型", trigger: "change" }],
questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }] questionStem: [{ required: true, message: "请填写题干", trigger: "blur" }]
// optionA: [{ required: true, message: '', trigger: 'change' }], // optionA: [{ required: true, message: '', trigger: 'change' }],
// optionB: [{ required: true, message: '', trigger: 'change' }] // optionB: [{ required: true, message: '', trigger: 'change' }]
}, },
value: true, value: true,
subject: '', // subject: "", //
keyword: '', keyword: "",
listData: [], listData: [],
subjectList: [ subjectList: [
{ {
id: '', id: "",
name: '不限' name: "不限"
}, },
{ {
id: 1, id: 1,
name: '单选题' name: "单选题"
}, },
{ {
id: 2, id: 2,
name: '多选题' name: "多选题"
}, },
{ {
id: 3, id: 3,
name: '判断题' name: "判断题"
} }
], ],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
SetEvaluation: false, SetEvaluation: false,
radio: '1', // radio: "1", //
topicsNumber: '', // topicsNumber: "", //
topicsTime: '', // topicsTime: "", //
random: true, random: true,
custom: false, custom: false,
info: {}, info: {},
NewTopics: false, // NewTopics: false, //
Customs: ['1', '2', '3'], Customs: ["1", "2", "3"],
BatchUpload: false, // BatchUpload: false, //
questionType: ['', '单选题', '多选题', '判断题'], questionType: ["", "单选题", "多选题", "判断题"],
multipleSelection: [], multipleSelection: [],
isShowTopics: false, isShowTopics: false,
topicsTitle: '', topicsTitle: "",
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
searchTimer: null, searchTimer: null,
uploadFaild: false, uploadFaild: false,
exportCode: '' exportCode: ""
}; };
}, },
mounted() { mounted() {
@ -326,7 +326,7 @@ export default {
questionType: this.subject questionType: this.subject
}) })
.then(res => { .then(res => {
if(res.status === 200) { if (res.status === 200) {
this.listData = res.page.records; this.listData = res.page.records;
this.total = res.page.total; this.total = res.page.total;
} else { } else {
@ -344,22 +344,22 @@ export default {
}, },
resetForm() { resetForm() {
this.topicForm = { this.topicForm = {
answer: '', answer: "",
questionType: '', questionType: "",
questionStem: '', questionStem: "",
optionA: '', optionA: "",
optionB: '', optionB: "",
optionC: '', optionC: "",
optionD: '', optionD: "",
optionE: '', optionE: "",
optionF: '', optionF: "",
aisTrue: false, aisTrue: false,
bisTrue: false, bisTrue: false,
cisTrue: false, cisTrue: false,
disTrue: false, disTrue: false,
eisTrue: false, eisTrue: false,
fisTrue: false, fisTrue: false,
answerAnalysis: '' answerAnalysis: ""
}; };
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.topicForm.clearValidate(); this.$refs.topicForm.clearValidate();
@ -370,12 +370,12 @@ export default {
this.getData(); this.getData();
}, },
addTopics() { addTopics() {
this.topicForm.id = ''; this.topicForm.id = "";
this.topicsTitle = '新增题目'; this.topicsTitle = "新增题目";
this.NewTopics = true; this.NewTopics = true;
}, },
getDetail(id) { getDetail(id) {
this.$get(`${this.api.questionsDetail}`, {id}).then(res => { this.$get(`${this.api.questionsDetail}`, { id }).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.topicForm = res.questions; this.topicForm = res.questions;
this.topicForm.id = id; this.topicForm.id = id;
@ -389,11 +389,11 @@ export default {
}); });
}, },
editQues(row) { editQues(row) {
this.topicsTitle = '编辑题目'; this.topicsTitle = "编辑题目";
this.getDetail(row.id); this.getDetail(row.id);
}, },
showQues(row) { showQues(row) {
this.topicsTitle = '查看题目'; this.topicsTitle = "查看题目";
this.isShowTopics = true; this.isShowTopics = true;
this.getDetail(row.id); this.getDetail(row.id);
}, },
@ -413,12 +413,12 @@ export default {
}); });
}, },
delData(row) { delData(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$post(`${this.api.questionsDelete}?ids=${row.id}`).then(res => { this.$post(`${this.api.questionsDelete}?ids=${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
@ -430,28 +430,24 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length){ if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.id return item.id;
}); });
let strIds = ids.toString(); this.$post(`${this.api.questionsDelete}?ids=${ids.toString()}`).then(res => {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.questionsDelete}?ids=${strIds}`).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
}) }).catch(() => { });
.catch(() => {
});
} else { } else {
util.errorMsg('请先选择题目 !'); util.errorMsg("请先选择题目 !");
} }
}, },
downloadTem() { downloadTem() {
@ -470,34 +466,34 @@ export default {
}, },
questionTypeChange() { questionTypeChange() {
for (let i in this.topicForm) { for (let i in this.topicForm) {
if (i.includes('isTrue')) this.topicForm[i] = false; if (i.includes("isTrue")) this.topicForm[i] = false;
} }
}, },
submitSetEva() { submitSetEva() {
let info = this.info; let info = this.info;
if (info.evaluationType == 0) { if (info.evaluationType == 0) {
let allEmpty = true; let allEmpty = true;
if (!info.isSingleEnable && !info.isMultipleEnable && !info.isJudgmentEnable) return util.warningMsg('请至少选择一种题型'); if (!info.isSingleEnable && !info.isMultipleEnable && !info.isJudgmentEnable) return util.warningMsg("请至少选择一种题型");
if (info.isSingleEnable == 1 && info.singleNum != 0) allEmpty = false; if (info.isSingleEnable == 1 && info.singleNum != 0) allEmpty = false;
if (info.isMultipleEnable == 1 && info.multipleNum != 0) allEmpty = false; if (info.isMultipleEnable == 1 && info.multipleNum != 0) allEmpty = false;
if (info.isJudgmentEnable == 1 && info.judgmentNum != 0) allEmpty = false; if (info.isJudgmentEnable == 1 && info.judgmentNum != 0) allEmpty = false;
if (allEmpty) return util.warningMsg('请至少选中一种类型,并数量大于0'); if (allEmpty) return util.warningMsg("请至少选中一种类型,并数量大于0");
if (info.isSingleEnable == 1 && info.singleNum > info.totalSingleNum) return util.warningMsg('单选题大于总数,请重新输入'); if (info.isSingleEnable == 1 && info.singleNum > info.totalSingleNum) return util.warningMsg("单选题大于总数,请重新输入");
if (info.isMultipleEnable == 1 && info.multipleNum > info.totalMultipleNum) return util.warningMsg('多选题大于总数,请重新输入'); if (info.isMultipleEnable == 1 && info.multipleNum > info.totalMultipleNum) return util.warningMsg("多选题大于总数,请重新输入");
if (info.isJudgmentEnable == 1 && info.judgmentNum > info.totalJudgmentNum) return util.warningMsg('判断题大于总数,请重新输入'); if (info.isJudgmentEnable == 1 && info.judgmentNum > info.totalJudgmentNum) return util.warningMsg("判断题大于总数,请重新输入");
} else { } else {
if (info.questionNum === '') return util.warningMsg('请输入测评题目总数'); if (info.questionNum === "") return util.warningMsg("请输入测评题目总数");
if (info.questionNum == 0) return util.warningMsg('测评题目总数不得为0'); if (info.questionNum == 0) return util.warningMsg("测评题目总数不得为0");
} }
if (info.duration === '') return util.warningMsg('请输入测评时长'); if (info.duration === "") return util.warningMsg("请输入测评时长");
if (info.duration == 0) return util.warningMsg('测评时长不得为0'); if (info.duration == 0) return util.warningMsg("测评时长不得为0");
this.info.isSingleEnable = Number(this.info.isSingleEnable); this.info.isSingleEnable = Number(this.info.isSingleEnable);
this.info.isMultipleEnable = Number(this.info.isMultipleEnable); this.info.isMultipleEnable = Number(this.info.isMultipleEnable);
this.info.isJudgmentEnable = Number(this.info.isJudgmentEnable); this.info.isJudgmentEnable = Number(this.info.isJudgmentEnable);
this.$post(this.api.questionsUpdateRules, this.info).then(res => { this.$post(this.api.questionsUpdateRules, this.info).then(res => {
if (res.status === 200) { if (res.status === 200) {
util.successMsg('提交成功!'); util.successMsg("提交成功!");
this.SetEvaluation = false; this.SetEvaluation = false;
} else { } else {
util.errorMsg(res.message); util.errorMsg(res.message);
@ -511,29 +507,29 @@ export default {
if (valid) { if (valid) {
let topicForm = this.topicForm; let topicForm = this.topicForm;
let optionCount = 0; let optionCount = 0;
let answer = ''; let answer = "";
let isInvalidAnswer = false; let isInvalidAnswer = false;
for (let n in topicForm) { for (let n in topicForm) {
if (n.includes('option')) { if (n.includes("option")) {
topicForm[n] != '' && ++optionCount; topicForm[n] != "" && ++optionCount;
} }
if (n.includes('isTrue') && topicForm[n]) { if (n.includes("isTrue") && topicForm[n]) {
let curOpt = n.replace('isTrue', ''); let curOpt = n.replace("isTrue", "");
answer += curOpt; answer += curOpt;
if (!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true; if (!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true;
} }
} }
if (optionCount < 2) return util.warningMsg('请至少添加两个选项!'); if (optionCount < 2) return util.warningMsg("请至少添加两个选项!");
if (!answer) return util.warningMsg('请设置正确答案!'); if (!answer) return util.warningMsg("请设置正确答案!");
if (topicForm.questionType != '多选题' && answer.length > 1) return util.warningMsg('单选题、判断题只能设置一个正确答案!'); if (topicForm.questionType != "多选题" && answer.length > 1) return util.warningMsg("单选题、判断题只能设置一个正确答案!");
if (isInvalidAnswer) return util.warningMsg('正确答案选项为空,请重新设置!'); if (isInvalidAnswer) return util.warningMsg("正确答案选项为空,请重新设置!");
this.topicForm.questionType = this.questionType.indexOf(this.topicForm.questionType); this.topicForm.questionType = this.questionType.indexOf(this.topicForm.questionType);
this.topicForm.answer = answer.toUpperCase(); this.topicForm.answer = answer.toUpperCase();
if (this.topicForm.id) { if (this.topicForm.id) {
this.$post(this.api.questionsUpdate, this.topicForm).then(res => { this.$post(this.api.questionsUpdate, this.topicForm).then(res => {
if (res.status === 200) { if (res.status === 200) {
util.successMsg('提交成功!'); util.successMsg("提交成功!");
this.NewTopics = false; this.NewTopics = false;
this.getData(); this.getData();
} else { } else {
@ -545,7 +541,7 @@ export default {
} else { } else {
this.$post(this.api.questionsSave, this.topicForm).then(res => { this.$post(this.api.questionsSave, this.topicForm).then(res => {
if (res.status === 200) { if (res.status === 200) {
util.successMsg('提交成功!'); util.successMsg("提交成功!");
this.NewTopics = false; this.NewTopics = false;
this.getData(); this.getData();
} else { } else {
@ -571,7 +567,7 @@ export default {
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false; this.uploadFaild = false;
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));
let {message, status, data } = res; let { message, status, data } = res;
if (status === 200) { if (status === 200) {
util.successMsg(`上传成功:${data.successNum},上传失败:${data.failureNum}`); util.successMsg(`上传成功:${data.successNum},上传失败:${data.failureNum}`);
if (data.failureNum !== "0") { if (data.failureNum !== "0") {
@ -585,8 +581,8 @@ export default {
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: '上传出错,请重试!', message: "上传出错,请重试!",
type: 'error', type: "error",
center: true center: true
}); });
}, },
@ -603,7 +599,7 @@ export default {
uploadSure() { uploadSure() {
this.BatchUpload = false; this.BatchUpload = false;
this.page = 1; this.page = 1;
this.keyword = ''; this.keyword = "";
this.getData(); this.getData();
}, },
closeUpload() { closeUpload() {
@ -615,7 +611,7 @@ export default {
}; };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
::v-deep .el-checkbox-group { ::v-deep .el-checkbox-group {
font-size: 2px; font-size: 2px;
} }

@ -14,19 +14,19 @@
<script> <script>
export default { export default {
methods: { methods: {
toIndex(){ toIndex() {
this.$router.push('/') this.$router.push("/");
}, },
goBack(){ goBack() {
this.$router.go(-1); this.$router.go(-1);
} }
} }
} };
</script> </script>
<style scoped> <style scoped>
.error-page{ .error-page {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -35,25 +35,30 @@ export default {
height: 100%; height: 100%;
background: #f3f3f3; background: #f3f3f3;
box-sizing: border-box; box-sizing: border-box;
} }
.error-code{
.error-code {
line-height: 1; line-height: 1;
font-size: 250px; font-size: 250px;
font-weight: bolder; font-weight: bolder;
color: #f02d2d; color: #f02d2d;
} }
.error-code span{
.error-code span {
color: #00a854; color: #00a854;
} }
.error-desc{
.error-desc {
font-size: 30px; font-size: 30px;
color: #777; color: #777;
} }
.error-handle{
.error-handle {
margin-top: 30px; margin-top: 30px;
padding-bottom: 200px; padding-bottom: 200px;
} }
.error-btn{
.error-btn {
margin-left: 100px; margin-left: 100px;
} }
</style> </style>

@ -14,19 +14,19 @@
<script> <script>
export default { export default {
methods: { methods: {
toIndex(){ toIndex() {
this.$router.push('/') this.$router.push("/");
}, },
goBack(){ goBack() {
this.$router.go(-1); this.$router.go(-1);
} }
} }
} };
</script> </script>
<style scoped> <style scoped>
.error-page{ .error-page {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -35,25 +35,30 @@ export default {
height: 100%; height: 100%;
background: #f3f3f3; background: #f3f3f3;
box-sizing: border-box; box-sizing: border-box;
} }
.error-code{
.error-code {
line-height: 1; line-height: 1;
font-size: 250px; font-size: 250px;
font-weight: bolder; font-weight: bolder;
color: #2d8cf0; color: #2d8cf0;
} }
.error-code span{
.error-code span {
color: #00a854; color: #00a854;
} }
.error-desc{
.error-desc {
font-size: 30px; font-size: 30px;
color: #777; color: #777;
} }
.error-handle{
.error-handle {
margin-top: 30px; margin-top: 30px;
padding-bottom: 200px; padding-bottom: 200px;
} }
.error-btn{
.error-btn {
margin-left: 100px; margin-left: 100px;
} }
</style> </style>

@ -2,22 +2,22 @@
<section class="main"> <section class="main">
<div class="crumbs"> <div class="crumbs">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item><i class="el-icon-lx-global"></i> {{$t('i18n.breadcrumb')}}</el-breadcrumb-item> <el-breadcrumb-item><i class="el-icon-lx-global"></i> {{ $t("i18n.breadcrumb") }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="container"> <div class="container">
<span>{{$t('i18n.tips')}}</span> <span>{{ $t("i18n.tips") }}</span>
<el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{$t('i18n.btn')}}</el-button> <el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{ $t("i18n.btn") }}</el-button>
<div class="list"> <div class="list">
<h2>{{$t('i18n.title1')}}</h2> <h2>{{ $t("i18n.title1") }}</h2>
<p>{{$t('i18n.p1')}}</p> <p>{{ $t("i18n.p1") }}</p>
<p>{{$t('i18n.p2')}}</p> <p>{{ $t("i18n.p2") }}</p>
<p>{{$t('i18n.p3')}}</p> <p>{{ $t("i18n.p3") }}</p>
</div> </div>
<h2>{{$t('i18n.title2')}}</h2> <h2>{{ $t("i18n.title2") }}</h2>
<div> <div>
<i18n path="i18n.info" tag="p"> <i18n path="i18n.info" tag="p">
<a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t('i18n.value') }}</a> <a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t("i18n.value") }}</a>
</i18n> </i18n>
</div> </div>
</div> </div>
@ -26,21 +26,22 @@
<script> <script>
export default { export default {
data(){ data() {
return { return {};
} }
} };
}
</script> </script>
<style scoped> <style scoped>
.list{ .list {
padding: 30px 0; padding: 30px 0;
} }
.list p{
.list p {
margin-bottom: 20px; margin-bottom: 20px;
} }
a{
a {
color: #cb221c; color: #cb221c;
} }
</style> </style>

@ -8,7 +8,7 @@
<div class="container"> <div class="container">
<h2>使用方法</h2> <h2>使用方法</h2>
<p style="line-height: 50px;"> <p style="line-height: 50px;">
直接通过设置类名为 el-icon-lx-iconName 来使用即可例如{{iconList.length}}个图标 直接通过设置类名为 el-icon-lx-iconName 来使用即可例如{{ iconList.length }}个图标
</p> </p>
<p class="example-p"> <p class="example-p">
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i> <i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
@ -31,7 +31,7 @@
<li class="icon-li" v-for="(item,index) in list" :key="index"> <li class="icon-li" v-for="(item,index) in list" :key="index">
<div class="icon-li-content"> <div class="icon-li-content">
<i :class="`el-icon-lx-${item}`"></i> <i :class="`el-icon-lx-${item}`"></i>
<span>{{item}}</span> <span>{{ item }}</span>
</div> </div>
</li> </li>
</ul> </ul>
@ -41,172 +41,177 @@
</template> </template>
<script> <script>
export default { export default {
data: function(){ data: function() {
return { return {
keyword: '', keyword: "",
iconList: [ iconList: [
'attentionforbid', "attentionforbid",
'attentionforbidfill', "attentionforbidfill",
'attention', "attention",
'attentionfill', "attentionfill",
'tag', "tag",
'tagfill', "tagfill",
'people', "people",
'peoplefill', "peoplefill",
'notice', "notice",
'noticefill', "noticefill",
'mobile', "mobile",
'mobilefill', "mobilefill",
'voice', "voice",
'voicefill', "voicefill",
'unlock', "unlock",
'lock', "lock",
'home', "home",
'homefill', "homefill",
'delete', "delete",
'deletefill', "deletefill",
'notification', "notification",
'notificationfill', "notificationfill",
'notificationforbidfill', "notificationforbidfill",
'like', "like",
'likefill', "likefill",
'comment', "comment",
'commentfill', "commentfill",
'camera', "camera",
'camerafill', "camerafill",
'warn', "warn",
'warnfill', "warnfill",
'time', "time",
'timefill', "timefill",
'location', "location",
'locationfill', "locationfill",
'favor', "favor",
'favorfill', "favorfill",
'skin', "skin",
'skinfill', "skinfill",
'news', "news",
'newsfill', "newsfill",
'record', "record",
'recordfill', "recordfill",
'emoji', "emoji",
'emojifill', "emojifill",
'message', "message",
'messagefill', "messagefill",
'goods', "goods",
'goodsfill', "goodsfill",
'crown', "crown",
'crownfill', "crownfill",
'move', "move",
'add', "add",
'hot', "hot",
'hotfill', "hotfill",
'service', "service",
'servicefill', "servicefill",
'present', "present",
'presentfill', "presentfill",
'pic', "pic",
'picfill', "picfill",
'rank', "rank",
'rankfill', "rankfill",
'male', "male",
'female', "female",
'down', "down",
'top', "top",
'recharge', "recharge",
'rechargefill', "rechargefill",
'forward', "forward",
'forwardfill', "forwardfill",
'info', "info",
'infofill', "infofill",
'redpacket', "redpacket",
'redpacket_fill', "redpacket_fill",
'roundadd', "roundadd",
'roundaddfill', "roundaddfill",
'friendadd', "friendadd",
'friendaddfill', "friendaddfill",
'cart', "cart",
'cartfill', "cartfill",
'more', "more",
'moreandroid', "moreandroid",
'back', "back",
'right', "right",
'shop', "shop",
'shopfill', "shopfill",
'question', "question",
'questionfill', "questionfill",
'roundclose', "roundclose",
'roundclosefill', "roundclosefill",
'roundcheck', "roundcheck",
'roundcheckfill', "roundcheckfill",
'global', "global",
'mail', "mail",
'punch', "punch",
'exit', "exit",
'upload', "upload",
'read', "read",
'file', "file",
'link', "link",
'full', "full",
'group', "group",
'friend', "friend",
'profile', "profile",
'addressbook', "addressbook",
'calendar', "calendar",
'text', "text",
'copy', "copy",
'share', "share",
'wifi', "wifi",
'vipcard', "vipcard",
'weibo', "weibo",
'remind', "remind",
'refresh', "refresh",
'filter', "filter",
'settings', "settings",
'scan', "scan",
'qrcode', "qrcode",
'cascades', "cascades",
'apps', "apps",
'sort', "sort",
'searchlist', "searchlist",
'search', "search",
'edit' "edit"
] ]
} };
}, },
computed: { computed: {
list(){ list() {
return this.iconList.filter((item) => { return this.iconList.filter((item) => {
return item.indexOf(this.keyword) !== -1; return item.indexOf(this.keyword) !== -1;
}) });
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.example-p{ .example-p {
height: 45px; height: 45px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.search-box{
.search-box {
text-align: center; text-align: center;
margin-top: 10px; margin-top: 10px;
} }
.search{
.search {
width: 300px; width: 300px;
} }
ul,li{
ul, li {
list-style: none; list-style: none;
} }
.icon-li{
.icon-li {
display: inline-block; display: inline-block;
padding: 10px; padding: 10px;
width: 120px; width: 120px;
height: 120px; height: 120px;
} }
.icon-li-content{
.icon-li-content {
display: flex; display: flex;
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
@ -214,11 +219,13 @@ ul,li{
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
} }
.icon-li-content i{
.icon-li-content i {
font-size: 36px; font-size: 36px;
color: #606266; color: #606266;
} }
.icon-li-content span{
.icon-li-content span {
margin-top: 10px; margin-top: 10px;
color: #787878; color: #787878;
} }

@ -1,43 +1,43 @@
<template> <template>
<div> <div>
<div class='page'> <div class="page">
<!-- <!--
<div class='tabs'> <div class='tabs'>
<a class='item' v-for='(item,index) in tabs' :key='index' :class='{active: index == activeName}' @click='tabChange(index)'>{{ item }}</a> <a class='item' v-for='(item,index) in tabs' :key='index' :class='{active: index == activeName}' @click='tabChange(index)'>{{ item }}</a>
</div> </div>
--> -->
<div class='btn-wrap'> <div class="btn-wrap">
<template v-if='sorting'> <template v-if="sorting">
<el-button class='action-btn' type='primary' size='small' round @click='cancelSort'>取消</el-button> <el-button class="action-btn" type="primary" size="small" round @click="cancelSort">取消</el-button>
<el-button class='action-btn' type='primary' size='small' round @click='sortSubmit'>保存</el-button> <el-button class="action-btn" type="primary" size="small" round @click="sortSubmit">保存</el-button>
</template> </template>
<template v-if='!sorting'> <template v-if="!sorting">
<el-button class='action-btn' type='primary' size='small' round @click='openSort' v-auth>更改排序 <el-button class="action-btn" type="primary" size="small" round @click="openSort" v-auth>更改排序
</el-button> </el-button>
<el-button class='action-btn' type='primary' size='small' round @click='addColumn' v-auth>添加栏目 <el-button class="action-btn" type="primary" size="small" round @click="addColumn" v-auth>添加栏目
</el-button> </el-button>
</template> </template>
</div> </div>
<div class='page-content' style='padding-top: 24px; margin-top: 24px'> <div class="page-content" style="padding-top: 24px; margin-top: 24px">
<div class='el-table'> <div class="el-table">
<div class='list'> <div class="list">
<div class='thead'> <div class="thead">
<span>栏目名称</span> <span>栏目名称</span>
<span><em :class='{hide: sorting}' style='font-style: normal'>操作</em></span> <span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
</div> </div>
</div> </div>
<el-tree :data='listData' node-key='id' default-expand-all @node-drop='handleDrop' <el-tree :data="listData" node-key="id" default-expand-all @node-drop="handleDrop"
:draggable='sorting' :allow-drop='allowDrop' :allow-drag='allowDrag'> :draggable="sorting" :allow-drop="allowDrop" :allow-drag="allowDrag">
<span class='custom-tree-node' slot-scope='{ node, data }'> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class='name'>{{ node.label }}</span> <span class="name">{{ node.label }}</span>
<span class='action' v-show='!sorting'> <span class="action" v-show="!sorting">
<el-button type='text' @click.stop='editType(data)' v-auth>编辑</el-button> <el-button type="text" @click.stop="editType(data)" v-auth>编辑</el-button>
<el-divider direction='vertical' v-auth="'information:编辑'"></el-divider> <el-divider direction="vertical" v-auth="'information:编辑'"></el-divider>
<template v-if='node.level == 1' v-auth="'information:新增'"> <template v-if="node.level == 1" v-auth="'information:新增'">
<el-button type='text' @click.stop='addType(data)'>新增</el-button> <el-button type="text" @click.stop="addType(data)">新增</el-button>
<el-divider direction='vertical'></el-divider> <el-divider direction="vertical"></el-divider>
</template> </template>
<el-button type='text' @click.stop='delData(data)' v-auth>删除</el-button> <el-button type="text" @click.stop="delData(data)" v-auth>删除</el-button>
</span> </span>
</span> </span>
</el-tree> </el-tree>
@ -45,43 +45,44 @@
</div> </div>
</div> </div>
<el-dialog :title="isAddColumn ? '添加栏目' : '编辑栏目'" :visible.sync='columnVisible' width='400px' <el-dialog :title="isAddColumn ? '添加栏目' : '编辑栏目'" :visible.sync="columnVisible" width="400px"
:close-on-click-modal='false' @close='closeColumn'> :close-on-click-modal="false" @close="closeColumn">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder='栏目名称' v-model='columnName'></el-input> <el-input placeholder="栏目名称" v-model="columnName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot='footer' class='dialog-footer'> <span slot="footer" class="dialog-footer">
<el-button size='small' @click='columnVisible = false'> </el-button> <el-button size="small" @click="columnVisible = false"> </el-button>
<el-button size='small' type='primary' @click='columnSubmit'> </el-button> <el-button size="small" type="primary" @click="columnSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="isAddType ? '添加分类' : '编辑分类'" :visible.sync='typeVisible' width='400px' <el-dialog :title="isAddType ? '添加分类' : '编辑分类'" :visible.sync="typeVisible" width="400px"
:close-on-click-modal='false' @close='closeType'> :close-on-click-modal="false" @close="closeType">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder='分类名称' v-model='typeName'></el-input> <el-input placeholder="分类名称" v-model="typeName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot='footer' class='dialog-footer'> <span slot="footer" class="dialog-footer">
<el-button size='small' @click='typeVisible = false'> </el-button> <el-button size="small" @click="typeVisible = false"> </el-button>
<el-button size='small' type='primary' @click='typeSubmit'> </el-button> <el-button size="small" type="primary" @click="typeSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'columnManage', name: "columnManage",
data() { data() {
return { return {
activeName: 'first', activeName: "first",
tabs: { tabs: {
first: '栏目管理' first: "栏目管理"
}, },
name: this.$store.state.name, name: this.$store.state.name,
originalList: [], originalList: [],
@ -91,18 +92,18 @@ export default {
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
columnVisible: false, columnVisible: false,
columnName: '', columnName: "",
typeVisible: false, typeVisible: false,
typeName: '', typeName: "",
curRow: {}, curRow: {},
sortObj: null, sortObj: null,
sorting: false, sorting: false,
curParentId: '', curParentId: "",
isAddColumn: false, isAddColumn: false,
isAddType: false, isAddType: false,
defaultProps: { defaultProps: {
children: 'children', children: "children",
label: 'label' label: "label"
} }
}; };
}, },
@ -111,8 +112,8 @@ export default {
}, },
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (JSON.stringify(this.originalList) !== JSON.stringify(this.listData)) { if (JSON.stringify(this.originalList) !== JSON.stringify(this.listData)) {
this.$confirm('确定返回?排序尚未保存。', '提示', { this.$confirm("确定返回?排序尚未保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
next(); next();
@ -164,12 +165,12 @@ export default {
}); });
}, },
delData(row) { delData(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => { this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
@ -202,14 +203,14 @@ export default {
}); });
let data = { columnTree: list }; let data = { columnTree: list };
this.$post(this.api.columnReorder, data).then(res => { this.$post(this.api.columnReorder, data).then(res => {
util.successMsg('保存成功'); util.successMsg("保存成功");
this.sorting = false; this.sorting = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
}, },
columnSubmit() { columnSubmit() {
if (!this.columnName) return util.warningMsg('请填写栏目名称'); if (!this.columnName) return util.warningMsg("请填写栏目名称");
let data = { let data = {
level: 1, level: 1,
parentId: 1, parentId: 1,
@ -218,14 +219,14 @@ export default {
if (this.curRow.id) { if (this.curRow.id) {
data.id = this.curRow.id; data.id = this.curRow.id;
this.$put(this.api.editColumn, data).then(res => { this.$put(this.api.editColumn, data).then(res => {
util.warningMsg('修改成功'); util.warningMsg("修改成功");
this.columnVisible = false; this.columnVisible = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(this.api.addColumn, data).then(res => { this.$post(this.api.addColumn, data).then(res => {
util.successMsg('添加成功'); util.successMsg("添加成功");
this.columnVisible = false; this.columnVisible = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -250,7 +251,7 @@ export default {
} }
}, },
typeSubmit(row) { typeSubmit(row) {
if (!this.typeName) return util.warningMsg('请填写分类名称'); if (!this.typeName) return util.warningMsg("请填写分类名称");
let data = { let data = {
level: 2, level: 2,
name: this.typeName name: this.typeName
@ -259,7 +260,7 @@ export default {
data.id = this.curRow.id; data.id = this.curRow.id;
data.parentId = this.curRow.parentId; data.parentId = this.curRow.parentId;
this.$put(this.api.editColumn, data).then(res => { this.$put(this.api.editColumn, data).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.typeVisible = false; this.typeVisible = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -267,7 +268,7 @@ export default {
} else { } else {
data.parentId = this.curRow.id; data.parentId = this.curRow.id;
this.$post(this.api.addColumn, data).then(res => { this.$post(this.api.addColumn, data).then(res => {
util.successMsg('新增成功'); util.successMsg("新增成功");
this.typeVisible = false; this.typeVisible = false;
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -294,11 +295,11 @@ export default {
this.getData(); this.getData();
}, },
closeColumn() { closeColumn() {
this.columnName = ''; this.columnName = "";
this.curRow = {}; this.curRow = {};
}, },
closeType() { closeType() {
this.typeName = ''; this.typeName = "";
this.curRow = {}; this.curRow = {};
}, },
handleDrop(draggingNode, dropNode, dropType, ev) { handleDrop(draggingNode, dropNode, dropType, ev) {
@ -306,21 +307,21 @@ export default {
}, },
allowDrop(draggingNode, dropNode, type) { allowDrop(draggingNode, dropNode, type) {
if (dropNode.level == 2 && draggingNode.childNodes.length == 0) { if (dropNode.level == 2 && draggingNode.childNodes.length == 0) {
return type !== 'inner'; return type !== "inner";
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 2) || (draggingNode.childNodes.length > 0 && type == 'inner')) { } else if ((draggingNode.childNodes.length > 0 && dropNode.level == 2) || (draggingNode.childNodes.length > 0 && type == "inner")) {
return false; return false;
} else { } else {
return true; return true;
} }
}, },
allowDrag(draggingNode) { allowDrag(draggingNode) {
return draggingNode.data.label.indexOf('三级 3-2-2') === -1; return draggingNode.data.label.indexOf("三级 3-2-2") === -1;
} }
} }
}; };
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.btn-wrap { .btn-wrap {
position: absolute; position: absolute;
top: 15px; top: 15px;

@ -53,11 +53,12 @@
</template> </template>
<script> <script>
import quill from '@/components/quill' import quill from "@/components/quill";
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
name: 'addArticle', name: "addArticle",
data() { data() {
return { return {
headers: { headers: {
@ -65,14 +66,14 @@ export default {
}, },
columnId: this.$route.query.columnId, columnId: this.$route.query.columnId,
sort: this.$route.query.sort, sort: this.$route.query.sort,
id: '', id: "",
coverUrl: '', coverUrl: "",
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
author: '', author: "",
date: '', date: "",
title: '', title: "",
content: '', content: "",
submiting: false, submiting: false,
uploading: false uploading: false
}; };
@ -81,8 +82,8 @@ export default {
quill quill
}, },
mounted() { mounted() {
this.id = this.$route.query.id this.id = this.$route.query.id;
this.id && this.getData() this.id && this.getData();
}, },
methods: { methods: {
// //
@ -92,26 +93,26 @@ export default {
getData() { getData() {
this.$get(`${this.api.getArticle}/${this.id}`) this.$get(`${this.api.getArticle}/${this.id}`)
.then(res => { .then(res => {
let data = res.article let data = res.article;
this.coverUrl = data.coverUrl this.coverUrl = data.coverUrl;
this.author = data.author this.author = data.author;
this.date = data.date this.date = data.date;
this.title = data.title this.title = data.title;
this.content = data.content this.content = data.content;
}) })
.catch(err => { .catch(err => {
}); });
}, },
saveData() { saveData() {
if(this.submiting) return false if (this.submiting) return false;
if(!this.coverUrl) return util.warningMsg('请上传封面图') if (!this.coverUrl) return util.warningMsg("请上传封面图");
if(!this.author) return util.warningMsg('请填写作者') if (!this.author) return util.warningMsg("请填写作者");
if(!this.date) return util.warningMsg('请选择日期') if (!this.date) return util.warningMsg("请选择日期");
if(!this.title) return util.warningMsg('请填写文章标题') if (!this.title) return util.warningMsg("请填写文章标题");
if(!this.content) return util.warningMsg('请填写文章内容') if (!this.content) return util.warningMsg("请填写文章内容");
if(this.uploading) return util.warningMsg('图片正在上传中,请稍等') if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.submiting = true this.submiting = true;
let data = { let data = {
id: this.id, id: this.id,
@ -122,25 +123,25 @@ export default {
title: this.title, title: this.title,
content: this.content, content: this.content,
sort: this.sort sort: this.sort
} };
if(this.id){ if (this.id) {
this.$put(this.api.editArticle, data).then(res => { this.$put(this.api.editArticle, data).then(res => {
this.submiting = false this.submiting = false;
util.successMsg('修改成功'); util.successMsg("修改成功");
this.back() this.back();
}) })
.catch(err => { .catch(err => {
this.submiting = false this.submiting = false;
}) });
}else{ } else {
this.$post(this.api.addArticle, data).then(res => { this.$post(this.api.addArticle, data).then(res => {
this.submiting = false this.submiting = false;
util.successMsg('创建成功'); util.successMsg("创建成功");
this.back() this.back();
}) })
.catch(err => { .catch(err => {
this.submiting = false this.submiting = false;
}) });
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
@ -150,11 +151,13 @@ export default {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
if(this.coverUrl){ if (this.coverUrl) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {}).catch(res => {}); this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
} }
this.coverUrl = res.filesResult.fileUrl this.coverUrl = res.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -167,49 +170,51 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = '' this.coverUrl = "";
}).catch(res => {}); }).catch(res => {
});
}, },
uploadSure(){ uploadSure() {
this.BatchUpload = false this.BatchUpload = false;
this.pageNo = 1 this.pageNo = 1;
this.keyword = '' this.keyword = "";
this.getData() this.getData();
}, },
back(){ back() {
// this.$router.push(`/content?id=${this.columnId}`) // this.$router.push(`/content?id=${this.columnId}`)
this.$router.back() this.$router.back();
}, },
goback() { goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.back() this.back();
}) })
.catch(() => {}); .catch(() => {
}, });
addSponsor(){
this.sponsorList.push('')
},
delSponsor(index){
this.sponsorList.splice(index,1)
}, },
addOrganizer(){ addSponsor() {
this.organzinerList.push('') this.sponsorList.push("");
}, },
delOrganizer(index){ delSponsor(index) {
this.organzinerList.splice(index,1) this.sponsorList.splice(index, 1);
}, },
addOrganizer() {
this.organzinerList.push("");
}, },
delOrganizer(index) {
this.organzinerList.splice(index, 1);
}
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$avatar-width: 104px; $avatar-width: 104px;
/deep/.avatar-uploader{ /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $avatar-width; width: $avatar-width;
@ -217,10 +222,12 @@ $avatar-width: 104px;
border-radius: 2px; border-radius: 2px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
&:hover { &:hover {
border-color: #409EFF; border-color: #409EFF;
} }
.uploader-default{
.uploader-default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -228,39 +235,47 @@ $avatar-width: 104px;
height: $avatar-width; height: $avatar-width;
text-align: center; text-align: center;
background: rgba(0, 0, 0, 0.04); background: rgba(0, 0, 0, 0.04);
i{
i {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #8c939d; color: #8c939d;
} }
p{
p {
margin-top: 10px; margin-top: 10px;
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
line-height: 1; line-height: 1;
} }
} }
.avatar { .avatar {
width: $avatar-width; width: $avatar-width;
height: $avatar-width; height: $avatar-width;
display: block; display: block;
} }
} }
.el-upload__tip{
.el-upload__tip {
margin-top: 0; margin-top: 0;
p{
p {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
line-height: 1; line-height: 1;
&:first-child{
&:first-child {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
} }
} }
/deep/.d-inline-block{
/deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select,.el-input{
.el-select, .el-input {
width: 100%; width: 100%;
} }
} }

@ -1,32 +1,32 @@
<template> <template>
<div class="page"> <div class="page">
<!-- <div class="tabs">--> <!-- <div class="tabs">-->
<!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>--> <!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>-->
<!-- </div>--> <!-- </div>-->
<div class="btn-wrap"> <div class="btn-wrap">
<el-button class="action-btn" type="primary" size="small" @click="sortSubmit" v-auth="'content:保存排序'">保存排序</el-button> <el-button class="action-btn" type="primary" size="small" @click="sortSubmit" v-auth="'content:保存排序'">保存排序</el-button>
<el-button class="action-btn" type="primary" size="small" @click="delAllData" v-auth="'content:批量删除'">批量删除</el-button> <el-button class="action-btn" type="primary" size="small" @click="delAllData" v-auth="'content:批量删除'">批量删除</el-button>
<el-button class="action-btn" type="primary" size="small" @click="addArticle" v-auth="'content:新增文章'">新增文章</el-button> <el-button class="action-btn" type="primary" size="small" @click="addArticle" v-auth="'content:新增文章'">新增文章</el-button>
</div> </div>
<div class="page-content" style='padding-top: 24px'> <div class="page-content" style="padding-top: 24px">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" label="标题"> <el-table-column prop="title" label="标题" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center"> <el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small" class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number" v-auth="'content:保存排序'"></el-input> <el-input size="small" class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number" v-auth="'content:保存排序'"></el-input>
<span>{{scope.row.sort}}</span> <span>{{ scope.row.sort }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="date" label="添加日期" align="center"> <el-table-column prop="date" label="添加日期" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{transferDate(scope.row.date)}} {{ transferDate(scope.row.date) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
@ -48,7 +48,7 @@
@change="switchOff($event,scope.row,scope.$index)" @change="switchOff($event,scope.row,scope.$index)"
v-auth="'content:禁用'" v-auth="'content:禁用'"
></el-switch> ></el-switch>
<span>{{scope.row.status ? '禁用' : '启用'}}</span> <span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -61,118 +61,126 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
activeName: 'first', activeName: "first",
tabs: { tabs: {
first: '栏目内容管理' first: "栏目内容管理"
}, },
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0
}; };
}, },
props: { props: {
columnId: "" columnId: ""
}, },
watch: { watch: {
columnId(){ columnId() {
this.getData() this.getData();
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData(id){ getData(id) {
let data = { let data = {
columnId: this.columnId columnId: this.columnId
};
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => {
this.listData = res.articleList;
this.totals = res.total;
if (!this.listData.length && this.totals) {
this.pageNo--;
this.getData();
} }
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`,data).then(res => { }).catch(res => {
this.listData = res.articleList });
this.totals = res.total
if(!this.listData.length && this.totals){
this.pageNo--
this.getData()
}
}).catch(res => {});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val this.pageNo = val;
this.getData() this.getData();
}, },
addArticle(){ addArticle() {
this.$router.push(`/information/addarticle?columnId=${this.columnId}&sort=${this.listData.length+1}`) this.$router.push(`/information/addarticle?columnId=${this.columnId}&sort=${this.listData.length + 1}`);
}, },
editArticle(scope){ editArticle(scope) {
this.$router.push(`/information/addarticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index+1}`) this.$router.push(`/information/addarticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index + 1}`);
}, },
delData(row) { delData(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => { this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
transferDate(date){ transferDate(date) {
return date.replace(' 00:00:00','') return date.replace(" 00:00:00", "");
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id;
}) });
let title = newArr[0].title let title = newArr[0].title;
if(title.length > 14){ if (title.length > 14) {
title = title.substr(0,14) + '……' title = title.substr(0, 14) + "……";
} }
this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, '提示', { this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(',')}`).then(res => { this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(",")}`).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}) }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
}else{ });
util.errorMsg('请先选择数据 !') } else {
util.errorMsg("请先选择数据 !");
} }
}, },
switchOff(val,row,index) { switchOff(val, row, index) {
this.$put(`${this.api.enableArticle}/${row.id}/${val}`) this.$put(`${this.api.enableArticle}/${row.id}/${val}`)
.then(res => { .then(res => {
val == 1 ? util.errorMsg('该文章已隐藏,对学生端用户不可见') : util.successMsg('该文章已发布,对学生端用户可见') val == 1 ? util.errorMsg("该文章已隐藏,对学生端用户不可见") : util.successMsg("该文章已发布,对学生端用户可见");
}) })
.catch(err => {}) .catch(err => {
});
}, },
sortSubmit(){ sortSubmit() {
if(this.listData.length){ if (this.listData.length) {
if(this.listData.find(n => n.sort < 1)) return util.errorMsg('排序值最小为1') if (this.listData.find(n => n.sort < 1)) return util.errorMsg("排序值最小为1");
let data = {articleList: this.listData} let data = { articleList: this.listData };
this.$post(this.api.articleSort, data).then(res => { this.$post(this.api.articleSort, data).then(res => {
util.successMsg('保存成功') util.successMsg("保存成功");
this.getContent(this.columnId) this.getContent(this.columnId);
}) })
.catch(err => {}) .catch(err => {
}else{ });
util.errorMsg('数据为空') } else {
util.errorMsg("数据为空");
} }
} }
} }
@ -180,18 +188,21 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.btn-wrap{ .btn-wrap {
text-align: right; text-align: right;
} }
.sort-input{
/deep/.el-input__inner{ .sort-input {
/deep/ .el-input__inner {
padding: 0 0 0 10px; padding: 0 0 0 10px;
} }
} }
.sort-input+span{
.sort-input + span {
display: none; display: none;
} }
.off+span{
.off + span {
display: none; display: none;
} }
</style> </style>

@ -35,10 +35,11 @@
</template> </template>
<script> <script>
import ContentList from './contentList' import ContentList from "./contentList";
import { mapActions } from 'vuex' import { mapActions } from "vuex";
export default { export default {
name: 'contentManage', name: "contentManage",
components: { components: {
ContentList ContentList
}, },
@ -47,14 +48,14 @@ export default {
menuList: [], menuList: [],
activeName: this.$store.state.info.columnId, activeName: this.$store.state.info.columnId,
columnId: "" columnId: ""
} };
}, },
mounted() { mounted() {
this.getMenuData(); this.getMenuData();
}, },
methods: { methods: {
...mapActions('info', [ ...mapActions("info", [
'setColumnId' "setColumnId"
]), ]),
getMenuData() { getMenuData() {
this.$get(this.api.queryAllColumns, { page: 1, size: 10000 }).then(res => { this.$get(this.api.queryAllColumns, { page: 1, size: 10000 }).then(res => {
@ -88,12 +89,15 @@ export default {
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
background-color: #F2F6FC; background-color: #F2F6FC;
overflow: hidden; overflow: hidden;
.el-menu{
.el-menu {
background-color: transparent; background-color: transparent;
.el-submenu{
.el-submenu {
background-color: transparent; background-color: transparent;
} }
.el-menu-item.is-active{
.el-menu-item.is-active {
color: #ffffff; color: #ffffff;
background-color: #9278FF; background-color: #9278FF;
} }

@ -15,9 +15,9 @@
</template> </template>
<script> <script>
import ColumnManage from './columnManage' import ColumnManage from "./columnManage";
import ContentManage from './contentManage' import ContentManage from "./contentManage";
import { mapActions } from 'vuex' import { mapActions } from "vuex";
export default { export default {
components: { components: {
@ -26,21 +26,21 @@ export default {
}, },
data() { data() {
return { return {
tabsName: this.$store.state.info.tabsName, tabsName: this.$store.state.info.tabsName
} };
}, },
methods: { methods: {
...mapActions('info', [ ...mapActions("info", [
'setTabsName' "setTabsName"
]), ]),
handleClick(tab, event) { handleClick(tab, event) {
this.setTabsName(tab.name) this.setTabsName(tab.name);
} }
}, },
mounted() { mounted() {
} }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -6,103 +6,103 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-form label-width='170px' label-suffix=':' size='small'> <el-form label-width="170px" label-suffix=":" size="small">
<el-form-item label='竞赛封面(选填)'> <el-form-item label="竞赛封面(选填)">
<el-upload <el-upload
class='avatar-uploader' class="avatar-uploader"
accept='.jpg,.png,.jpeg,.gif' accept=".jpg,.png,.jpeg,.gif"
:on-remove='handleRemove' :on-remove="handleRemove"
:on-error='uploadError' :on-error="uploadError"
:on-success='uploadSuccess' :on-success="uploadSuccess"
:before-remove='beforeRemove' :before-remove="beforeRemove"
:limit='1' :limit="1"
:on-exceed='handleExceed' :on-exceed="handleExceed"
:action='this.api.fileupload' :action="this.api.fileupload"
:headers="headers" :headers="headers"
name='file' name="file"
> >
<img v-if='coverUrl' :src='coverUrl' class='avatar'> <img v-if="coverUrl" :src="coverUrl" class="avatar">
<div class='uploader-default' v-else> <div class="uploader-default" v-else>
<i class='el-icon-plus'></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
</div> </div>
<div slot='tip' class='el-upload__tip'> <div slot="tip" class="el-upload__tip">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p> <p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label='竞赛封面长图(选填)'> <el-form-item label="竞赛封面长图(选填)">
<el-upload <el-upload
class='avatar-uploader avatar-uploader-lg' class="avatar-uploader avatar-uploader-lg"
accept='.jpg,.png,.jpeg,.gif' accept=".jpg,.png,.jpeg,.gif"
:on-remove='handleLgRemove' :on-remove="handleLgRemove"
:on-error='uploadError' :on-error="uploadError"
:on-success='uploadLgSuccess' :on-success="uploadLgSuccess"
:before-remove='beforeRemove' :before-remove="beforeRemove"
:limit='1' :on-exceed='handleExceed' :limit="1" :on-exceed="handleExceed"
:action='this.api.fileupload' :action="this.api.fileupload"
:headers="headers" :headers="headers"
name='file' name="file"
> >
<img v-if='carouselUrl' :src='carouselUrl' class='avatar-lg'> <img v-if="carouselUrl" :src="carouselUrl" class="avatar-lg">
<div class='uploader-default' v-else> <div class="uploader-default" v-else>
<i class='el-icon-plus'></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
</div> </div>
<div slot='tip' class='el-upload__tip'> <div slot="tip" class="el-upload__tip">
<p>展示宽度为1920高度300JPG/PNG/GIF3MB以内</p> <p>展示宽度为1920高度300JPG/PNG/GIF3MB以内</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label='竞赛名称'> <el-form-item label="竞赛名称">
<div class='d-inline-block'> <div class="d-inline-block">
<el-input placeholder='请输入竞赛名称' v-model='name' clearable></el-input> <el-input placeholder="请输入竞赛名称" v-model="name" clearable></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label='主办方'> <el-form-item label="主办方">
<div class='inline-input'> <div class="inline-input">
<div class='input-wrap' v-for='(item,index) in sponsorList' :key='index'> <div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder='主办方名称' v-model='sponsorList[index]'></el-input> <el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if='sponsorList.length > 1' class='remove' @click='delSponsor(index)'></i> <i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if='index == 0' class='add-btn' @click='addSponsor'> <button v-if="index == 0" class="add-btn" @click="addSponsor">
<i class='el-icon-plus'></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label='承办方(选填)'> <el-form-item label="承办方(选填)">
<div class='inline-input'> <div class="inline-input">
<div class='input-wrap' v-for='(item,index) in undertakerList' :key='index'> <div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder='承办方名称' v-model='undertakerList[index]'></el-input> <el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if='undertakerList.length > 1' class='remove' @click='delOrganizer(index)'></i> <i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if='index == 0' class='add-btn' @click='addOrganizer'> <button v-if="index == 0" class="add-btn" @click="addOrganizer">
<i class='el-icon-plus'></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
</div> </div>
</div> </div>
<button v-if='!undertakerList.length' class='add-btn' @click='addOrganizer'> <button v-if="!undertakerList.length" class="add-btn" @click="addOrganizer">
<i class='el-icon-plus'></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
</el-form-item> </el-form-item>
<el-form-item label='报名时间'> <el-form-item label="报名时间">
<el-date-picker v-model='signupTime' value-format='yyyy-MM-dd HH:mm:ss' type='datetimerange' <el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
range-separator='-' start-placeholder='开始日期' end-placeholder='结束日期' range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options='pickerOptions'></el-date-picker> :picker-options="pickerOptions"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label='竞赛时间'> <el-form-item label="竞赛时间">
<el-date-picker v-model='playTime' value-format='yyyy-MM-dd HH:mm:ss' type='datetimerange' <el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
range-separator='-' start-placeholder='开始日期' end-placeholder='结束日期' range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options='pickerOptions'></el-date-picker> :picker-options="pickerOptions"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label='竞赛详情'> <el-form-item label="竞赛详情">
<quill :border='true' v-model='description' :height='400' /> <quill :border="true" v-model="description" :height="400" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size='small' v-throttle @click='save(1)'>保存</el-button> <el-button size="small" v-throttle @click="save(1)">保存</el-button>
<el-button type='primary' size='small' v-throttle @click='save(0)'>发布</el-button> <el-button type="primary" size="small" v-throttle @click="save(0)">发布</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -110,40 +110,40 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
import quill from '@/components/quill'; import quill from "@/components/quill";
export default { export default {
name: 'add', name: "add",
data() { data() {
return { return {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
schoolId: Setting.schoolId, schoolId: Setting.schoolId,
id: '', id: "",
coverUrl: '', coverUrl: "",
carouselUrl: '', carouselUrl: "",
publishStatus: 0, publishStatus: 0,
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
username: this.$store.state.name, username: this.$store.state.name,
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
coverVisible: false, coverVisible: false,
coverImageUrl: '', coverImageUrl: "",
name: '', name: "",
sponsor: '', sponsor: "",
sponsorList: [''], sponsorList: [""],
undertaker: '', undertaker: "",
undertakerList: [''], undertakerList: [""],
signUpStartTime: '', signUpStartTime: "",
signUpEndTime: '', signUpEndTime: "",
signupTime: '', signupTime: "",
playTime: '', playTime: "",
playStartTime: '', playStartTime: "",
playEndTime: '', playEndTime: "",
description: '', description: "",
pickerOptions: { pickerOptions: {
disabledDate: time => { disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000; return time.getTime() < new Date().getTime() - 86400000;
@ -161,8 +161,8 @@ export default {
this.signUpStartTime = val[0]; this.signUpStartTime = val[0];
this.signUpEndTime = val[1]; this.signUpEndTime = val[1];
} else { } else {
this.signUpStartTime = ''; this.signUpStartTime = "";
this.signUpEndTime = ''; this.signUpEndTime = "";
} }
}, },
playTime: function(val) { playTime: function(val) {
@ -170,8 +170,8 @@ export default {
this.playStartTime = val[0]; this.playStartTime = val[0];
this.playEndTime = val[1]; this.playEndTime = val[1];
} else { } else {
this.playStartTime = ''; this.playStartTime = "";
this.playEndTime = ''; this.playEndTime = "";
} }
} }
}, },
@ -189,19 +189,19 @@ export default {
if (this.submiting) return false; if (this.submiting) return false;
this.sponsor = this.sponsorList.filter(d => d).join(); this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join(); this.undertaker = this.undertakerList.filter(d => d).join();
if (!this.name) return util.warningMsg('请填写竞赛名称'); if (!this.name) return util.warningMsg("请填写竞赛名称");
if (status == 0) { if (status == 0) {
if (!this.sponsor) return util.warningMsg('请填写主办方'); if (!this.sponsor) return util.warningMsg("请填写主办方");
if (!this.signUpStartTime) return util.warningMsg('请选择报名时间'); if (!this.signUpStartTime) return util.warningMsg("请选择报名时间");
} }
let now = new Date().getTime(); let now = new Date().getTime();
let signUpStartTime = new Date(this.signUpStartTime).getTime(); let signUpStartTime = new Date(this.signUpStartTime).getTime();
let signUpEndTime = new Date(this.signUpEndTime).getTime(); let signUpEndTime = new Date(this.signUpEndTime).getTime();
let playStartTime = new Date(this.playStartTime).getTime(); let playStartTime = new Date(this.playStartTime).getTime();
if (signUpStartTime && now > signUpStartTime) return util.warningMsg('报名时间不能早于当前时间'); if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间");
if (!this.playStartTime && status == 0) return util.warningMsg('请选择竞赛时间'); if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg('竞赛时间不能早于报名结束时间'); if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!this.description && status == 0) return util.warningMsg('请填写竞赛详情'); if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = { let data = {
id: this.id, id: this.id,
@ -224,7 +224,7 @@ export default {
if (this.id) { if (this.id) {
this.$put(this.api.editContest, data).then(res => { this.$put(this.api.editContest, data).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg('修改成功'); util.successMsg("修改成功");
this.$router.back(); this.$router.back();
}) })
.catch(err => { .catch(err => {
@ -233,7 +233,7 @@ export default {
} else { } else {
this.$post(this.api.addContest, data).then(res => { this.$post(this.api.addContest, data).then(res => {
this.submiting = false; this.submiting = false;
util.successMsg('创建成功'); util.successMsg("创建成功");
this.$router.back(); this.$router.back();
}) })
.catch(err => { .catch(err => {
@ -244,7 +244,7 @@ export default {
getData() { getData() {
this.$get(this.api.getContest + this.id) this.$get(this.api.getContest + this.id)
.then(res => { .then(res => {
if (res.errmessage == 'success') { if (res.errmessage == "success") {
let info = res.ExperimentalTeaching; let info = res.ExperimentalTeaching;
this.coverUrl = info.coverUrl; this.coverUrl = info.coverUrl;
this.description = info.description; this.description = info.description;
@ -253,7 +253,7 @@ export default {
this.signupTime = [info.signUpStartTime, info.signUpEndTime]; this.signupTime = [info.signUpStartTime, info.signUpEndTime];
this.playTime = [info.playStartTime, info.playEndTime]; this.playTime = [info.playStartTime, info.playEndTime];
} else { } else {
util.errorMsg('查询失败'); util.errorMsg("查询失败");
} }
}) })
.catch(err => { .catch(err => {
@ -265,7 +265,7 @@ export default {
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
if (this.coverUrl) { if (this.coverUrl) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/', ''); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => { }).catch(res => {
}); });
@ -274,7 +274,7 @@ export default {
}, },
uploadLgSuccess(res, file, fileList) { uploadLgSuccess(res, file, fileList) {
if (this.carouselUrl) { if (this.carouselUrl) {
let fileName = this.carouselUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/', ''); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => { }).catch(res => {
}); });
@ -283,8 +283,8 @@ export default {
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: '上传出错,请重试!', message: "上传出错,请重试!",
type: 'error', type: "error",
center: true center: true
}); });
}, },
@ -292,28 +292,28 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/', ''); let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = ''; this.coverUrl = "";
}).catch(res => { }).catch(res => {
}); });
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
let fileName = this.carouselUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/', ''); let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = ''; this.carouselUrl = "";
}).catch(res => { }).catch(res => {
}); });
}, },
uploadSure() { uploadSure() {
this.BatchUpload = false; this.BatchUpload = false;
this.pageNo = 1; this.pageNo = 1;
this.keyword = ''; this.keyword = "";
this.getData(); this.getData();
}, },
goback() { goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$router.back(); this.$router.back();
@ -322,13 +322,13 @@ export default {
}); });
}, },
addSponsor() { addSponsor() {
this.sponsorList.push(''); this.sponsorList.push("");
}, },
delSponsor(index) { delSponsor(index) {
this.sponsorList.splice(index, 1); this.sponsorList.splice(index, 1);
}, },
addOrganizer() { addOrganizer() {
this.undertakerList.push(''); this.undertakerList.push("");
}, },
delOrganizer(index) { delOrganizer(index) {
this.undertakerList.splice(index, 1); this.undertakerList.splice(index, 1);
@ -337,7 +337,7 @@ export default {
}; };
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
$upload-width: 220px; $upload-width: 220px;
$upload-height: 140px; $upload-height: 140px;
$upload-lg-height: 150px; $upload-lg-height: 150px;

@ -9,7 +9,7 @@
<dl> <dl>
<dd> <dd>
<el-radio-group size="small" v-model="form.month" @change="changeType"> <el-radio-group size="small" v-model="form.month" @change="changeType">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
</dd> </dd>
</dl> </dl>
@ -32,24 +32,24 @@
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="竞赛名称"> <el-table-column prop="name" label="竞赛名称">
</el-table-column> </el-table-column>
<el-table-column prop="applicantNum" label="报名人数" width="100" align="center"> <el-table-column prop="applicantNum" label="报名人数" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.applicantNum ? scope.row.applicantNum : 0}} {{ scope.row.applicantNum ? scope.row.applicantNum : 0 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="状态" width="80" align="center"> <el-table-column prop="status" label="状态" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{transferPublishStatus[scope.row.publishStatus]}} {{ transferPublishStatus[scope.row.publishStatus] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="time" label="竞赛时间" align="center" width="300"> <el-table-column prop="time" label="竞赛时间" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.playStartTime}} ~ {{scope.row.playEndTime}} {{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="gmtCreate" label="创建时间" width="150" align="center"> <el-table-column prop="gmtCreate" label="创建时间" width="150" align="center">
@ -85,155 +85,161 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'match', name: "match",
data() { data() {
return { return {
keyword: '', keyword: "",
statusList: [ statusList: [
{ {
value: '', value: "",
name: '不限' name: "不限"
}, },
{ {
value: 1, value: 1,
name: '待发布' name: "待发布"
}, },
{ {
value: 0, value: 0,
name: '已发布' name: "已发布"
} }
], ],
matchData: [], matchData: [],
form: { form: {
month: '', month: "",
publishStatus: '', publishStatus: "",
startTime: '', startTime: "",
endTime: '' endTime: ""
}, },
multipleSelection: [], multipleSelection: [],
dateList: [ dateList: [
{ {
id: '', id: "",
name: '不限' name: "不限"
}, },
{ {
id: 1, id: 1,
name: '近一个月' name: "近一个月"
}, },
{ {
id: 3, id: 3,
name: '近三个月' name: "近三个月"
}, },
{ {
id: 6, id: 6,
name: '近六个月' name: "近六个月"
} }
], ],
date: [], date: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
transferPublishStatus: ['已发布','未发布'] transferPublishStatus: ["已发布", "未发布"]
}; };
}, },
watch: { watch: {
'form.month': function(val){ "form.month": function(val) {
if(val){ if (val) {
let unit = 24 * 60 * 60 * 1000 let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
}else{ } else {
this.date = [] this.date = [];
} }
}, },
date: function(val){ date: function(val) {
if(val){ if (val) {
this.form.startTime = val[0] this.form.startTime = val[0];
this.form.endTime = val[1] this.form.endTime = val[1];
}else{ } else {
this.form.startTime = '' this.form.startTime = "";
this.form.endTime = '' this.form.endTime = "";
} }
this.initData() this.initData();
}, },
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData();
},500) }, 500);
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
let data = {} let data = {};
if(this.form.month) data.month = this.form.month if (this.form.month) data.month = this.form.month;
if(this.keyword) data.name = this.keyword if (this.keyword) data.name = this.keyword;
if(this.form.publishStatus !== '') data.publishStatus = this.form.publishStatus if (this.form.publishStatus !== "") data.publishStatus = this.form.publishStatus;
if(this.form.startTime) data.startTime = this.form.startTime if (this.form.startTime) data.startTime = this.form.startTime;
if(this.form.endTime) data.endTime = this.form.endTime if (this.form.endTime) data.endTime = this.form.endTime;
this.$get(`${this.api.queryContestByCondition}/${this.pageNo}/${this.pageSize }`,data).then(res => { this.$get(`${this.api.queryContestByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => {
this.matchData = res.contestList this.matchData = res.contestList;
this.totals = res.total this.totals = res.total;
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
if(!this.matchData.length && this.totals){ if (!this.matchData.length && this.totals) {
this.pageNo-- this.pageNo--;
this.getData() this.getData();
} }
}).catch(res => {}); }).catch(res => {
});
}, },
initData(){ initData() {
this.pageNo = 1 this.pageNo = 1;
this.getData() this.getData();
}, },
add(){ add() {
this.$router.push('add') this.$router.push("add");
}, },
manage(row){ manage(row) {
this.$router.push(`manage?id=${row.id}`) this.$router.push(`manage?id=${row.id}`);
}, },
changeType() { changeType() {
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
this.initData(); this.initData();
}, },
delData(row) { delData(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteContest}/${row.id}`).then(res => { this.$del(`${this.api.deleteContest}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
delAllData() { delAllData() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id;
}) });
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = delList let data = delList;
this.$post(this.api.deleteContest,data).then(res => { this.$post(this.api.deleteContest, data).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
}else{ });
util.errorMsg('请先选择数据 !'); } else {
util.errorMsg("请先选择数据 !");
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
@ -243,37 +249,40 @@ export default {
this.pageNo = val; this.pageNo = val;
this.getData(); this.getData();
}, },
transferTime(date,type){ transferTime(date, type) {
if(date == '0000-00-00 00:00:00') return '---' if (date == "0000-00-00 00:00:00") return "---";
return date return date;
}, },
switchOff(val,row,index) { switchOff(val, row, index) {
this.$put(`${this.api.publishContest}/${row.id}/${val}`) this.$put(`${this.api.publishContest}/${row.id}/${val}`)
.then(res => { .then(res => {
val == 1 ? util.warningMsg('该赛事信息已隐藏对学生端用户不可见') : util.successMsg('该赛事信息已对学生端用户公开') val == 1 ? util.warningMsg("该赛事信息已隐藏对学生端用户不可见") : util.successMsg("该赛事信息已对学生端用户公开");
}) })
.catch(err => {}); .catch(err => {
}, });
}
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.tool{ /deep/ .tool {
.filter{ .filter {
.el-input{ .el-input {
min-width: 190px; min-width: 190px;
} }
} }
} }
@media(max-width: 1640px){
.page .page-content .tool .filter{ @media(max-width: 1640px) {
.page .page-content .tool .filter {
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: -15px; margin-bottom: -15px;
li{
li {
min-width: 34%; min-width: 34%;
margin-bottom: 15px; margin-bottom: 15px;
} }
} }
} }
</style> </style>

@ -8,7 +8,7 @@
</el-card> </el-card>
<div class="page" style="margin-bottom: 24px"> <div class="page" style="margin-bottom: 24px">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div> </div>
<!-- 大赛详情 --> <!-- 大赛详情 -->
<MatchDetail v-if="active == 'first'" /> <MatchDetail v-if="active == 'first'" />
@ -22,19 +22,20 @@
</template> </template>
<script> <script>
import MatchDetail from './matchDetail' import MatchDetail from "./matchDetail";
import MatchProgress from './matchProgress' import MatchProgress from "./matchProgress";
import MatchSignup from './matchSignup' import MatchSignup from "./matchSignup";
export default { export default {
name: 'matchManage', name: "matchManage",
data() { data() {
return { return {
active: 'first', active: "first",
tabs: { tabs: {
first: '大赛详情', first: "大赛详情",
second: '竞赛进展', second: "竞赛进展",
third: '报名人员' third: "报名人员"
}, }
}; };
}, },
components: { components: {
@ -49,8 +50,8 @@ export default {
goBack() { goBack() {
this.$router.back(); this.$router.back();
}, },
tabChange(index){ tabChange(index) {
this.active = index this.active = index;
} }
} }
}; };

@ -1,6 +1,6 @@
<template> <template>
<!-- 大赛详情 --> <!-- 大赛详情 -->
<div style='padding: 24px'> <div style="padding: 24px">
<div class="page-content"> <div class="page-content">
<el-form label-width="170px" label-suffix=":" size="small"> <el-form label-width="170px" label-suffix=":" size="small">
<el-form-item label="竞赛封面(选填)"> <el-form-item label="竞赛封面(选填)">
@ -101,77 +101,78 @@
</template> </template>
<script> <script>
import quill from '@/components/quill' import quill from "@/components/quill";
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'matchDetail', name: "matchDetail",
data() { data() {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
coverUrl: '', coverUrl: "",
carouselUrl: '', carouselUrl: "",
publishStatus: 0, publishStatus: 0,
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
name: '', name: "",
sponsor: '', sponsor: "",
sponsorList: [''], sponsorList: [""],
undertaker: '', undertaker: "",
undertakerList: [], undertakerList: [],
signUpStartTime: '', signUpStartTime: "",
signUpEndTime: '', signUpEndTime: "",
signupTime: '', signupTime: "",
playTime: '', playTime: "",
playStartTime: '', playStartTime: "",
playEndTime: '', playEndTime: "",
description: '' description: ""
}; };
}, },
components: { components: {
quill quill
}, },
watch: { watch: {
signupTime: function(val){ signupTime: function(val) {
if(val){ if (val) {
this.signUpStartTime = val[0] this.signUpStartTime = val[0];
this.signUpEndTime = val[1] this.signUpEndTime = val[1];
}else{ } else {
this.signUpStartTime = '' this.signUpStartTime = "";
this.signUpEndTime = '' this.signUpEndTime = "";
} }
}, },
playTime: function(val){ playTime: function(val) {
if(val){ if (val) {
this.playStartTime = val[0] this.playStartTime = val[0];
this.playEndTime = val[1] this.playEndTime = val[1];
}else{ } else {
this.playStartTime = '' this.playStartTime = "";
this.playEndTime = '' this.playEndTime = "";
} }
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
this.commitId() this.commitId();
}, },
methods: { methods: {
save(status) { save(status) {
this.sponsor = this.sponsorList.filter(d=>d).join() this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d=>d).join() this.undertaker = this.undertakerList.filter(d => d).join();
if(!this.name) return util.warningMsg('请填写竞赛名称') if (!this.name) return util.warningMsg("请填写竞赛名称");
if(status == 0){ if (status == 0) {
if(!this.sponsor) return util.warningMsg('请填写主办方') if (!this.sponsor) return util.warningMsg("请填写主办方");
if(!this.signUpStartTime) return util.warningMsg('请选择报名时间') if (!this.signUpStartTime) return util.warningMsg("请选择报名时间");
} }
let now = new Date().getTime() let now = new Date().getTime();
let signUpStartTime = new Date(this.signUpStartTime).getTime() let signUpStartTime = new Date(this.signUpStartTime).getTime();
let signUpEndTime = new Date(this.signUpEndTime).getTime() let signUpEndTime = new Date(this.signUpEndTime).getTime();
let playStartTime = new Date(this.playStartTime).getTime() let playStartTime = new Date(this.playStartTime).getTime();
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('') // if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('')
if(!this.playStartTime && status == 0) return util.warningMsg('请选择竞赛时间') if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间");
if(playStartTime && playStartTime < signUpEndTime) return util.warningMsg('竞赛时间不能早于报名结束时间') if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if(!this.description && status == 0) return util.warningMsg('请填写竞赛详情') if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情");
let data = { let data = {
id: this.id, id: this.id,
@ -187,67 +188,71 @@ export default {
signUpStartTime: this.signUpStartTime, signUpStartTime: this.signUpStartTime,
sponsor: this.sponsor, sponsor: this.sponsor,
undertaker: this.undertaker undertaker: this.undertaker
} };
if(this.id){ if (this.id) {
this.$put(this.api.editContest, data).then(res => { this.$put(this.api.editContest, data).then(res => {
util.successMsg('修改成功'); util.successMsg("修改成功");
this.$router.back() this.$router.back();
}) })
.catch(err => { .catch(err => {
}); });
}else{ } else {
this.$post(this.api.addContest, data).then(res => { this.$post(this.api.addContest, data).then(res => {
util.successMsg('创建成功'); util.successMsg("创建成功");
this.$router.back() this.$router.back();
}) })
.catch(err => { .catch(err => {
}); });
} }
}, },
getData() { getData() {
this.$get(this.api.getContest + '/' + this.id) this.$get(this.api.getContest + "/" + this.id)
.then(res => { .then(res => {
let data = res.contest let data = res.contest;
this.coverUrl = data.coverUrl this.coverUrl = data.coverUrl;
this.carouselUrl = data.carouselUrl this.carouselUrl = data.carouselUrl;
this.description = data.description this.description = data.description;
this.name = data.name this.name = data.name;
this.playEndTime = data.playEndTime this.playEndTime = data.playEndTime;
this.playStartTime = data.playStartTime this.playStartTime = data.playStartTime;
this.publishStatus = data.publishStatus this.publishStatus = data.publishStatus;
this.signUpEndTime = data.signUpEndTime this.signUpEndTime = data.signUpEndTime;
this.signUpStartTime = data.signUpStartTime this.signUpStartTime = data.signUpStartTime;
this.sponsor = data.sponsor this.sponsor = data.sponsor;
this.undertaker = data.undertaker this.undertaker = data.undertaker;
this.signupTime = [data.signUpStartTime,data.signUpEndTime] this.signupTime = [data.signUpStartTime, data.signUpEndTime];
this.playTime = [data.playStartTime,data.playEndTime] this.playTime = [data.playStartTime, data.playEndTime];
this.sponsorList = data.sponsor.split(',') this.sponsorList = data.sponsor.split(",");
this.undertakerList = data.undertaker.split(',') this.undertakerList = data.undertaker.split(",");
}) })
.catch(err => { .catch(err => {
}); });
}, },
commitId(){ commitId() {
this.$store.commit("setMatchData", { matchId : this.id}) this.$store.commit("setMatchId", { matchId: this.id });
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
if(this.coverUrl){ if (this.coverUrl) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {}).catch(res => {}); this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
} }
this.coverUrl = res.filesResult.fileUrl this.coverUrl = res.filesResult.fileUrl;
}, },
uploadLgSuccess(res, file, fileList) { uploadLgSuccess(res, file, fileList) {
if(this.carouselUrl){ if (this.carouselUrl) {
let fileName = this.carouselUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {}).catch(res => {}); this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
} }
this.carouselUrl = res.filesResult.fileUrl this.carouselUrl = res.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -260,46 +265,49 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
let fileName = this.coverUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = '' this.coverUrl = "";
}).catch(res => {}); }).catch(res => {
});
}, },
handleLgRemove(file, fileList) { handleLgRemove(file, fileList) {
let fileName = this.carouselUrl.replace('https://liuwanr.oss-cn-shenzhen.aliyuncs.com/','') let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.carouselUrl = '' this.carouselUrl = "";
}).catch(res => {}); }).catch(res => {
});
}, },
uploadSure(){ uploadSure() {
this.BatchUpload = false this.BatchUpload = false;
this.pageNo = 1 this.pageNo = 1;
this.keyword = '' this.keyword = "";
this.getData() this.getData();
}, },
goback() { goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$router.push('/match') this.$router.push("/match");
}) })
.catch(() => {}); .catch(() => {
}, });
addSponsor(){
this.sponsorList.push('')
}, },
delSponsor(index){ addSponsor() {
this.sponsorList.splice(index,1) this.sponsorList.push("");
}, },
addOrganizer(){ delSponsor(index) {
this.undertakerList.push('') this.sponsorList.splice(index, 1);
}, },
delOrganizer(index){ addOrganizer() {
this.undertakerList.splice(index,1) this.undertakerList.push("");
}, },
delOrganizer(index) {
this.undertakerList.splice(index, 1);
}
}, }
}; };
</script> </script>
@ -307,7 +315,7 @@ export default {
$upload-width: 220px; $upload-width: 220px;
$upload-height: 140px; $upload-height: 140px;
$upload-lg-height: 150px; $upload-lg-height: 150px;
/deep/.avatar-uploader{ /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
width: $upload-width; width: $upload-width;
@ -316,22 +324,26 @@ $upload-lg-height: 150px;
border-radius: 6px; border-radius: 6px;
cursor: pointer; cursor: pointer;
overflow: hidden; overflow: hidden;
&:hover { &:hover {
border-color: #cb221c; border-color: #cb221c;
} }
.uploader-default{
.uploader-default {
display: flex; display: flex;
height: $upload-height; height: $upload-height;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
background: rgba(0, 0, 0, 0.04); background: rgba(0, 0, 0, 0.04);
i{
i {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #8c939d; color: #8c939d;
} }
p{
p {
margin-top: 10px; margin-top: 10px;
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
@ -339,68 +351,80 @@ $upload-lg-height: 150px;
} }
} }
} }
&.avatar-uploader-lg{
&.avatar-uploader-lg {
.el-upload { .el-upload {
width: 100%; width: 100%;
max-width: 960px; max-width: 960px;
height: $upload-lg-height; height: $upload-lg-height;
.uploader-default{
.uploader-default {
height: $upload-lg-height; height: $upload-lg-height;
} }
} }
} }
.avatar { .avatar {
display: block; display: block;
width: $upload-width; width: $upload-width;
height: $upload-height; height: $upload-height;
} }
.avatar-lg { .avatar-lg {
display: block; display: block;
width: 100%; width: 100%;
height: $upload-lg-height; height: $upload-lg-height;
} }
.el-upload__tip{
.el-upload__tip {
margin-top: 0; margin-top: 0;
p{
p {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
line-height: 1; line-height: 1;
&:first-child{
&:first-child {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
} }
} }
/deep/.d-inline-block{ /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select,.el-input{
.el-select, .el-input {
width: 100%; width: 100%;
} }
} }
.inline-input{
.input-wrap{ .inline-input {
.input-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
.el-input{ .el-input {
display: inline-block; display: inline-block;
width: 216px; width: 216px;
margin-right: 8px; margin-right: 8px;
} }
.remove{
.remove {
width: 16px; width: 16px;
height: 16px; height: 16px;
background: url(../../../assets/img/close.png) 0 0/cover no-repeat; background: url(../../../assets/img/close.png) 0 0/cover no-repeat;
cursor: pointer; cursor: pointer;
} }
} }
.add-btn{
.add-btn {
margin-left: 32px; margin-left: 32px;
} }
} }
.add-btn{
.add-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -412,7 +436,8 @@ $upload-lg-height: 150px;
border: 1px dashed rgba(0, 0, 0, 0.15); border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px; border-radius: 4px;
cursor: pointer; cursor: pointer;
i{
i {
margin-right: 8px; margin-right: 8px;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;

@ -1,10 +1,10 @@
<template> <template>
<!-- 竞赛进展 --> <!-- 竞赛进展 -->
<div class="page-content" style='padding: 24px'> <div class="page-content" style="padding: 24px">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="标题"> <el-table-column prop="name" label="标题">
@ -38,24 +38,25 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
export default { export default {
name: 'matchProgress', name: "matchProgress",
data() { data() {
return { return {
id: this.$route.query.id, id: this.$route.query.id,
statusList: [ statusList: [
{ {
value: 0, value: 0,
name: '未完成' name: "未完成"
}, },
{ {
value: 1, value: 1,
name: '进行中' name: "进行中"
}, },
{ {
value: 2, value: 2,
name: '已完成' name: "已完成"
} }
], ],
listData: [], listData: [],
@ -66,79 +67,84 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
this.$get(`${this.api.getContestProgress}/${this.id}`).then(res => { this.$get(`${this.api.getContestProgress}/${this.id}`).then(res => {
this.listData = res.contestProgressList this.listData = res.contestProgressList;
}).catch(res => {}); }).catch(res => {
});
}, },
saveData(row){ saveData(row) {
let data = row let data = row;
if(data.title.length){ if (data.title.length) {
if(row.id){ if (row.id) {
this.$put(this.api.editContestProgress,data).then(res => { this.$put(this.api.editContestProgress, data).then(res => {
util.successMsg('修改成功') util.successMsg("修改成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
}else{ });
this.$post(this.api.addContestProgress,data).then(res => { } else {
util.successMsg('创建成功') this.$post(this.api.addContestProgress, data).then(res => {
this.getData() util.successMsg("创建成功");
}).catch(res => {}); this.getData();
}).catch(res => {
});
} }
}else{ } else {
util.warningMsg('请填写标题') util.warningMsg("请填写标题");
} }
}, },
entry(){ entry() {
this.$router.push('/permission') this.$router.push("/permission");
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
onSearch(){ onSearch() {
this.pageNo = 1 this.pageNo = 1;
this.getData() this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.getData(); this.getData();
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => { this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
addData(){ addData() {
if(this.listData.length){ if (this.listData.length) {
if(this.listData[this.listData.length-1].id){ if (this.listData[this.listData.length - 1].id) {
this.listData.push({ this.listData.push({
contestId: this.id, contestId: this.id,
id: '', id: "",
title: '', title: "",
description: '', description: "",
status: 0 status: 0
}) });
}else{ } else {
util.warningMsg('请先保存新数据') util.warningMsg("请先保存新数据");
} }
}else{ } else {
this.listData.push({ this.listData.push({
contestId: this.id, contestId: this.id,
id: '', id: "",
title: '', title: "",
description: '', description: "",
status: 0 status: 0
}) });
} }
} }
} }
@ -146,15 +152,17 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.box{ .box {
height: calc(100vh - 100px); height: calc(100vh - 100px);
overflow: auto; overflow: auto;
} }
.plus{
.plus {
padding: 15px 0 0; padding: 15px 0 0;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
i{
i {
font-size: 24px; font-size: 24px;
color: #cb221c; color: #cb221c;
} }

@ -1,6 +1,6 @@
<template> <template>
<!-- 报名人员 --> <!-- 报名人员 -->
<div class="page-content" style='padding: 24px'> <div class="page-content" style="padding: 24px">
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
@ -18,7 +18,7 @@
<el-table-column type="selection" :selectable="row => row.isDisable!=0" width="80" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" :selectable="row => row.isDisable!=0" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="school" label="学校"> <el-table-column prop="school" label="学校">
@ -50,15 +50,16 @@
</template> </template>
<script> <script>
import util from '@/libs/util' import util from "@/libs/util";
import Setting from '@/setting' import Setting from "@/setting";
export default { export default {
name: 'matchSignup', name: "matchSignup",
data() { data() {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
id: this.$route.query.id, id: this.$route.query.id,
keyword: '', keyword: "",
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
@ -68,80 +69,85 @@ export default {
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.getData();
},500) }, 500);
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
let data = { let data = {
contestId: this.id contestId: this.id
} };
if(this.keyword) data.name = this.keyword if (this.keyword) data.name = this.keyword;
this.$get(`${this.api.queryApplicantByCondition}/${this.pageNo}/${this.pageSize}`,data).then(res => { this.$get(`${this.api.queryApplicantByCondition}/${this.pageNo}/${this.pageSize}`, data).then(res => {
this.listData = res.data.applicantList this.listData = res.data.applicantList;
this.totals = res.data.total this.totals = res.data.total;
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
}).catch(res => {}); }).catch(res => {
});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
onSearch(){ onSearch() {
this.pageNo = 1 this.pageNo = 1;
this.getData() this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.getData(); this.getData();
}, },
switchOff(val,row,index) { switchOff(val, row, index) {
this.$put(`${this.api.disableApplicant}/${row.id}/${val}`) this.$put(`${this.api.disableApplicant}/${row.id}/${val}`)
.then(res => {}) .then(res => {
.catch(err => {}); })
.catch(err => {
});
}, },
disalbeAllData() { disalbeAllData() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.id return item.id;
}) });
this.$confirm('确定要禁用吗?', '提示', { this.$confirm("确定要禁用吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
console.log(11,delList.join()) console.log(11, delList.join());
this.$put(`${this.api.disableContests}?ids=${delList.join(',')}`).then(res => { this.$put(`${this.api.disableContests}?ids=${delList.join(",")}`).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
util.successMsg('禁用成功'); util.successMsg("禁用成功");
this.getData() this.getData();
}).catch(res => {}); }).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
}else{ });
util.errorMsg('请先选择数据 !'); } else {
util.errorMsg("请先选择数据 !");
} }
}, },
exportAll(){ exportAll() {
location.href = `${this.api.excelExport}/${this.id}/token=${this.token}` location.href = `${this.api.excelExport}/${this.id}/token=${this.token}`;
}, },
exportBatch(){ exportBatch() {
if(this.multipleSelection.length != ''){ if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let data = newArr.map(item => { let data = newArr.map(item => {
return item.id return item.id;
}) });
// return console.log(11,data) // return console.log(11,data)
location.href = `${this.api.batchExport}?ids=${data.join(',')}/token=${this.token}` location.href = `${this.api.batchExport}?ids=${data.join(",")}/token=${this.token}`;
}else{ } else {
util.errorMsg('请先选择数据 !'); util.errorMsg("请先选择数据 !");
} }
} }

@ -221,7 +221,6 @@ export default {
founder: 0, // (0 1) founder: 0, // (0 1)
projectName: "", // projectName: "", //
permissions: 0, // (0 1 2) permissions: 0, // (0 1 2)
schoolId: Setting.schoolId,
systemId: this.$store.state.project.lastSystemId, // id systemId: this.$store.state.project.lastSystemId, // id
hintOpen: 0, // (0 1 0) hintOpen: 0, // (0 1 0)
experimentHint: "", // experimentHint: "", //
@ -291,7 +290,7 @@ export default {
this.getInfoData(); this.getInfoData();
} }
// //
if (JSON.stringify(this.projectFields) != '{}') { if (JSON.stringify(this.projectFields) != "{}") {
let { projectManage, projectJudgmentData } = this.projectFields; let { projectManage, projectJudgmentData } = this.projectFields;
this.projectManage = projectManage; this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData; this.projectJudgmentData = projectJudgmentData;
@ -319,7 +318,7 @@ export default {
} }
}, },
getInfoData() { // getInfoData() { //
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}&schoolId=${this.projectManage.schoolId}`).then(res => { this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
let { projectManage, projectJudgmentVos } = res; let { projectManage, projectJudgmentVos } = res;
this.projectManage = projectManage; this.projectManage = projectManage;
@ -627,7 +626,7 @@ export default {
// python // python
href = `${host}jdTrials/#/program?isEdit=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`; href = `${host}jdTrials/#/program?isEdit=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} }
} else if (type === 'home') { } else if (type === "home") {
if (systemId == 2 || systemId == 3) { if (systemId == 2 || systemId == 3) {
href = `${host}jdTrials/#/list`; href = `${host}jdTrials/#/list`;
} else { } else {

@ -10,17 +10,24 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>创建人</label> <label>创建人</label>
<el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人" <el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData">
@change="initData"> <el-option
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label" v-for="(item,index) in founderList"
:value="item.value"></el-option> :key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>状态</label> <label>状态</label>
<el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> <el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label" <el-option
:value="item.value"></el-option> v-for="(item,index) in stateList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
@ -46,8 +53,7 @@
</el-select> </el-select>
</li> </li>
<li> <li>
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" <el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
@ -123,97 +129,96 @@
</template> </template>
<script> <script>
import Setting from '@/setting'; import Setting from "@/setting";
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
showBack: Boolean(this.$route.query.show), showBack: Boolean(this.$route.query.show),
roleIdEd: this.roleId ? 13 : this.roleId,// roleId13roleId14113,1413> roleIdEd: this.roleId ? 13 : this.roleId,// roleId13roleId14113,1413>
systemId: '', systemId: "",
systemList: Setting.systemList, systemList: Setting.systemList,
queryData: { queryData: {
schoolId: Setting.schoolId, // id
platformId: 1, // :1 :3 platformId: 1, // :1 :3
founder: 0, // (0: 1:) founder: 0, // (0: 1:)
state: "", // (0:稿 1:) state: "", // (0:稿 1:)
permissions: "", // (0: 1: 2:) permissions: "" // (0: 1: 2:)
}, },
keyword: '', keyword: "",
status: '', status: "",
listData: [], listData: [],
total: 0, total: 0,
permissionsList: [ permissionsList: [
{ {
value: '', value: "",
label: '不限' label: "不限"
}, },
{ {
value: 0, value: 0,
label: '练习' label: "练习"
}, },
{ {
value: 1, value: 1,
label: '考核' label: "考核"
}, },
{ {
value: 2, value: 2,
label: '竞赛' label: "竞赛"
} }
], ],
permissionsKeys: { permissionsKeys: {
0: '练习', 0: "练习",
1: '考核', 1: "考核",
2: '竞赛' 2: "竞赛"
}, },
founderList: [ founderList: [
{ {
value: 0, value: 0,
label: '系统' label: "系统"
}, },
{ {
value: 1, value: 1,
label: '老师' label: "老师"
} }
], ],
founderKeys: { founderKeys: {
0: '系统', 0: "系统",
1: '老师' 1: "老师"
}, },
stateList: [ stateList: [
{ {
value: '', value: "",
label: '不限' label: "不限"
}, },
{ {
value: 0, value: 0,
label: '草稿箱' label: "草稿箱"
}, },
{ {
value: 1, value: 1,
label: '已发布' label: "已发布"
} }
], ],
stateKeys: { stateKeys: {
0: '草稿箱', 0: "草稿箱",
1: '已发布' 1: "已发布"
}, },
page: 1, page: 1,
pageSize: 10, pageSize: 10,
multipleSelection: [], multipleSelection: [],
copyVisible: false, copyVisible: false,
projectName: '', projectName: "",
currentRow: {}, // currentRow: {}, //
listDataAll: [] listDataAll: []
}; };
}, },
computed: { computed: {
...mapState('user', [ ...mapState("user", [
'userId', 'roleId' "userId", "roleId"
]), ]),
...mapState('project', [ ...mapState("project", [
'lastSystemId', 'assFields' "lastSystemId", "assFields"
]) ])
}, },
watch: { watch: {
@ -227,12 +232,12 @@ export default {
mounted() { mounted() {
// systemIdsystemIdsystemId // systemIdsystemIdsystemId
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId; this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId;
console.log(this.systemId, '外面的sysid'); console.log(this.systemId, "外面的sysid");
this.getData(); this.getData();
}, },
methods: { methods: {
...mapActions('project', [ ...mapActions("project", [
'setSystemId' "setSystemId"
]), ]),
getData() { getData() {
this.setSystemId(this.systemId); this.setSystemId(this.systemId);
@ -263,7 +268,7 @@ export default {
}, },
add() { // add() { //
this.setSystemId(this.systemId); this.setSystemId(this.systemId);
this.$router.push('/project/add'); this.$router.push("/project/add");
}, },
edit(row) { // edit(row) { //
this.setSystemId(row.systemId); this.setSystemId(row.systemId);
@ -275,7 +280,7 @@ export default {
delAllData() { // delAllData() { //
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => { let ids = this.multipleSelection.map(item => {
return item.projectId return item.projectId;
}); });
let strIds = ids.toString(); let strIds = ids.toString();
this.handleDelete(strIds); this.handleDelete(strIds);
@ -284,8 +289,8 @@ export default {
} }
}, },
handleDelete(ids) { // handleDelete(ids) { //
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => { this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
@ -298,13 +303,13 @@ export default {
console.log(err); console.log(err);
}); });
}).catch(() => { }).catch(() => {
this.$message.info('已取消删除'); this.$message.info("已取消删除");
}); });
}, },
switchOff(row) { // switchOff(row) { //
this.$get(`${this.api.updateIsOpen}?isOpen=${row.isOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => { this.$get(`${this.api.updateIsOpen}?isOpen=${row.isOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
util.successMsg('更新启用状态成功'); util.successMsg("更新启用状态成功");
this.getData(); this.getData();
} else { } else {
util.errorMsg(res.message); util.errorMsg(res.message);
@ -336,7 +341,7 @@ export default {
this.currentRow = { this.currentRow = {
projectManage: res.projectManage, projectManage: res.projectManage,
projectJudgmentList: res.projectJudgmentVos projectJudgmentList: res.projectJudgmentVos
} };
} }
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
<template> <template>
<div class="page" style="padding: 0"> <div class="page" style="padding: 0">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div> </div>
<staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff> <staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff>
@ -10,23 +10,24 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import { mapState } from 'vuex' import { mapState } from "vuex";
import staff from './staff' import staff from "./staff";
import role from './role' import role from "./role";
export default { export default {
data() { data() {
return { return {
active: 'staff', active: "staff",
tabs: { tabs: {
staff: '员工管理', staff: "员工管理",
role: '角色权限' role: "角色权限"
}, }
}; };
}, },
computed: { computed: {
...mapState('auth', [ ...mapState("auth", [
'routes' "routes"
]) ])
}, },
components: { components: {
@ -35,22 +36,22 @@ export default {
}, },
created() { created() {
console.log("routes===", this.routes); console.log("routes===", this.routes);
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs();
}, },
methods: { methods: {
tabChange(index){ tabChange(index) {
this.active = index this.active = index;
}, },
initTabs(){ initTabs() {
let btnPermissions = this.routes let btnPermissions = this.routes;
let tab1 = btnPermissions.includes('系统设置:员工管理') let tab1 = btnPermissions.includes("系统设置:员工管理");
let tab2 = btnPermissions.includes('系统设置:角色权限') let tab2 = btnPermissions.includes("系统设置:角色权限");
if(!tab1){ if (!tab1) {
delete this.tabs.staff delete this.tabs.staff;
} }
if(!tab2){ if (!tab2) {
delete this.tabs.role delete this.tabs.role;
} }
} }
} }

@ -66,24 +66,25 @@
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
return { return {
keyword: '', keyword: "",
searchTimer: null, searchTimer: null,
isDetail: false, isDetail: false,
form: { form: {
roleId: '', roleId: "",
name: '', name: "",
description: '', description: ""
}, },
listData:[], listData: [],
defaultProps: { defaultProps: {
children: 'children', children: "children",
label: 'name' label: "name"
}, },
page: 1, page: 1,
pageSize: 10, pageSize: 10,
@ -97,14 +98,14 @@ export default {
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getData() this.getData();
},500) }, 500);
} }
}, },
mounted() { mounted() {
this.getData() this.getData();
}, },
methods: { methods: {
getData() { getData() {
@ -112,30 +113,33 @@ export default {
name: util.encodeStr(this.keyword), name: util.encodeStr(this.keyword),
page: this.page, page: this.page,
size: this.pageSize size: this.pageSize
} };
this.$get(this.api.rolePermissionList,data).then(res => { this.$get(this.api.rolePermissionList, data).then(res => {
this.listData = res.data.list this.listData = res.data.list;
this.total = res.data.totalCount this.total = res.data.totalCount;
}).catch(res => {}); }).catch(res => {
});
}, },
currentChange(val) { currentChange(val) {
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
roleIds: [row.roleId] roleIds: [row.roleId]
} };
this.$post(`${this.api.delRolePermission}`,data).then(res => { this.$post(`${this.api.delRolePermission}`, data).then(res => {
util.successMsg('删除成功') util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}) }).catch(res => {
});
}) })
.catch(() => {}) .catch(() => {
});
}, },
getRowKeys(row) { getRowKeys(row) {
return row.roleId; return row.roleId;
@ -144,131 +148,137 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllSelection() { delAllSelection() {
if(this.multipleSelection.length){ if (this.multipleSelection.length) {
let newArr = this.multipleSelection let newArr = this.multipleSelection;
let delList = newArr.map(item => { let delList = newArr.map(item => {
return item.roleId return item.roleId;
}) });
this.$confirm('确定要删除吗?', '提示', { this.$confirm("确定要删除吗?", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
roleIds: delList roleIds: delList
} };
this.$post(`${this.api.delRolePermission}`,data).then(res => { this.$post(`${this.api.delRolePermission}`, data).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection();
util.successMsg('删除成功') util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {}) }).catch(res => {
});
}) })
.catch(() => {}) .catch(() => {
}else{ });
util.errorMsg('请先选择数据!') } else {
util.errorMsg("请先选择数据!");
} }
}, },
closeRole(){ closeRole() {
this.isDetail = false this.isDetail = false;
this.form = { this.form = {
roleId: '', roleId: "",
name: '', name: "",
description: '' description: ""
} };
this.checkedIds = [] this.checkedIds = [];
this.permissions = [] this.permissions = [];
}, },
// //
getPer(row){ getPer(row) {
if(!this.permissions.length){ if (!this.permissions.length) {
this.$get(this.api.roleTree).then(res => { this.$get(this.api.roleTree).then(res => {
let data = res.data let data = res.data;
// //
let yw = data.findIndex(n => n.name == '业务后台') let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw,1) yw != -1 && data.splice(yw, 1);
try { try {
let system = data.findIndex(n => n.name == '系统设置') let system = data.findIndex(n => n.name == "系统设置");
if(system != -1){ if (system != -1) {
data[system].children[1].children.splice(4,1) data[system].children[1].children.splice(4, 1);
data[system].children[1].children.splice(1,1) data[system].children[1].children.splice(1, 1);
data[system].children[1].children.splice(0,1) data[system].children[1].children.splice(0, 1);
}
} catch (error) {
} }
} catch (error) {} this.permissions = data;
this.permissions = data if (row) {
if(row){ this.getDetail(row);
this.getDetail(row)
} }
}).catch(res => {}) }).catch(res => {
});
} }
}, },
addRole(){ addRole() {
this.isAdd = true this.isAdd = true;
this.getPer() this.getPer();
this.checkedIds = [] this.checkedIds = [];
this.permissions.length && this.$refs.per.setCheckedNodes([]) this.permissions.length && this.$refs.per.setCheckedNodes([]);
this.roleVisible = true this.roleVisible = true;
}, },
// //
handleRolePer(data,permissions){ handleRolePer(data, permissions) {
let result = data let result = data;
if(permissions.length){ if (permissions.length) {
permissions.map(e => { permissions.map(e => {
if(result.includes(e.id) && e.children){ if (result.includes(e.id) && e.children) {
// ,idid,,, // ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1) e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id), 1);
} }
e.children && e.children.length && this.handleRolePer(data,e.children) e.children && e.children.length && this.handleRolePer(data, e.children);
}) });
} }
return result return result;
}, },
async getDetail(row){ async getDetail(row) {
let res = await this.$get(`${this.api.queryPermissionArrById}?roleId=${row.roleId}`) let res = await this.$get(`${this.api.queryPermissionArrById}?roleId=${row.roleId}`);
if(res.success){ if (res.success) {
this.form = res.data this.form = res.data;
this.form.roleId = row.roleId this.form.roleId = row.roleId;
this.checkedIds = this.handleRolePer(res.data.permissionIds,this.permissions) this.checkedIds = this.handleRolePer(res.data.permissionIds, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds) this.$refs.per.setCheckedNodes(this.checkedIds);
} }
}, },
showRole(row){ showRole(row) {
this.isDetail = true this.isDetail = true;
this.isAdd = false this.isAdd = false;
this.getPer(row) this.getPer(row);
this.roleVisible = true this.roleVisible = true;
}, },
editRole(row){ editRole(row) {
this.isAdd = false this.isAdd = false;
this.getPer(row) this.getPer(row);
this.roleVisible = true this.roleVisible = true;
}, },
async saveData() { async saveData() {
if(!this.form.name) return util.warningMsg('请填写角色名称') if (!this.form.name) return util.warningMsg("请填写角色名称");
if(!this.form.description) return util.warningMsg('请填写角色描述') if (!this.form.description) return util.warningMsg("请填写角色描述");
if(!this.$refs.per.getCheckedKeys().length) return util.warningMsg('请选择角色权限') if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限");
// ,(), // ,(),
let permissionIds = [...this.$refs.per.getHalfCheckedKeys(),...this.$refs.per.getCheckedKeys()] let permissionIds = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = { let data = {
roleId: this.form.roleId, roleId: this.form.roleId,
name: this.form.name, name: this.form.name,
description: this.form.description, description: this.form.description,
permissionIds permissionIds
};
if (this.form.roleId) {
this.$post(this.api.updateRolePermission, data).then(res => {
util.successMsg("修改成功");
this.getData();
this.roleVisible = false;
}).catch(res => {
});
} else {
this.$post(this.api.saveRolePermission, data).then(res => {
util.successMsg("新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => {
});
} }
if(this.form.roleId){
this.$post(this.api.updateRolePermission,data).then(res => {
util.successMsg('修改成功')
this.getData()
this.roleVisible = false
}).catch(res => {})
}else{
this.$post(this.api.saveRolePermission,data).then(res => {
util.successMsg('新增成功')
this.getData()
this.roleVisible = false
}).catch(res => {})
} }
},
} }
}; };
</script> </script>

File diff suppressed because it is too large Load Diff

@ -34,12 +34,13 @@
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from "vuex";
import lctree from './stafftree' import lctree from "./stafftree";
export default { export default {
props:["Data"], props: ["Data"],
data() { data() {
return { return {
majorList: [], majorList: [],
@ -49,111 +50,114 @@ export default {
isAddDepartment: false, isAddDepartment: false,
schoolId: Setting.schoolId, schoolId: Setting.schoolId,
Form: { Form: {
MajorId: '', MajorId: "",
majorName: '', majorName: "",
departmentId: '', departmentId: "",
departmentName: '' departmentName: ""
}, },
rules: { rules: {
majorName: [ majorName: [
{ required: true, message: '请输入专业名称', trigger: 'blur' } { required: true, message: "请输入专业名称", trigger: "blur" }
], ],
departmentName: [ departmentName: [
{ required: true, message: '请输入部门名称', trigger: 'blur' } { required: true, message: "请输入部门名称", trigger: "blur" }
] ]
}, },
staffstateProfessId: '', staffstateProfessId: "",
staffstateId: '', staffstateId: "",
majorNoAdd: true majorNoAdd: true
}; };
}, },
components: { components: {
lctree lctree
}, },
mounted(){ mounted() {
this.getStaff() this.getStaff();
}, },
methods: { methods: {
getStaff(){ getStaff() {
let data = { let data = {
schoolId: this.schoolId schoolId: this.schoolId
} };
this.$get(this.api.queryStaffPro,data).then(res => { this.$get(this.api.queryStaffPro, data).then(res => {
if(res.message){ if (res.message) {
res.message.map(e => { res.message.map(e => {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName); (e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName);
let data = { let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId staffProfessionalArchitectureId: e.staffProfessionalArchitectureId
} };
this.$get(this.api.queryStaffGrade,data).then(res => { this.$get(this.api.queryStaffGrade, data).then(res => {
res.message.map(e => { res.message.map(e => {
(e.ischeck = false), (e.label = e.staffGradeName); (e.ischeck = false), (e.label = e.staffGradeName);
}) });
e.children = res.message e.children = res.message;
}).catch(res => {}); }).catch(res => {
}) });
});
} }
setTimeout(() => { setTimeout(() => {
this.majorList = res.message this.majorList = res.message;
}, 500); }, 500);
}).catch(res => {}); }).catch(res => {
});
}, },
// //
fircheckitem(item){ fircheckitem(item) {
this.$emit("fircheck",item,this.majorList) this.$emit("fircheck", item, this.majorList);
}, },
// //
twocheckitem(item){ twocheckitem(item) {
this.$emit("twocheck",item,this.majorList) this.$emit("twocheck", item, this.majorList);
}, },
closeAdd(){ closeAdd() {
this.$refs.Form.resetFields() this.$refs.Form.resetFields();
}, },
// //
addMajor(){ addMajor() {
this.Form.MajorId = '' this.Form.MajorId = "";
this.Form.majorName = '' this.Form.majorName = "";
this.isaddMajor = true this.isaddMajor = true;
}, },
editMajor(item){ editMajor(item) {
this.Form.MajorId = item.staffProfessionalArchitectureId, this.Form.MajorId = item.staffProfessionalArchitectureId,
this.Form.majorName = item.staffProfessionalArchitectureName this.Form.majorName = item.staffProfessionalArchitectureName;
this.isaddMajor = true this.isaddMajor = true;
}, },
async majorChange(){ async majorChange() {
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.schoolId }); let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName, schoolId: this.schoolId });
if(res.message.length != 0){ if (res.message.length != 0) {
util.warningMsg('该一级部门已存在'); util.warningMsg("该一级部门已存在");
this.majorNoAdd = false this.majorNoAdd = false;
}else{ } else {
this.majorNoAdd = true this.majorNoAdd = true;
} }
}, },
sure(Form){ sure(Form) {
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
if(!this.majorNoAdd) return util.warningMsg('该一级部门已存在'); if (!this.majorNoAdd) return util.warningMsg("该一级部门已存在");
let data = { let data = {
staffProfessionalArchitectureName: this.Form.majorName, staffProfessionalArchitectureName: this.Form.majorName,
staffProfessionalArchitectureId: this.Form.MajorId, staffProfessionalArchitectureId: this.Form.MajorId,
schoolId: this.schoolId, schoolId: this.schoolId
} };
if(this.Form.MajorId){ if (this.Form.MajorId) {
this.$post(this.api.updateStaffPro,data).then(res => { this.$post(this.api.updateStaffPro, data).then(res => {
util.successMsg('编辑成功'); util.successMsg("编辑成功");
this.isaddMajor = false this.isaddMajor = false;
this.majorList.map(e =>{ this.majorList.map(e => {
if(e.staffProfessionalArchitectureId == this.Form.MajorId){ if (e.staffProfessionalArchitectureId == this.Form.MajorId) {
e.staffProfessionalArchitectureName = this.Form.majorName e.staffProfessionalArchitectureName = this.Form.majorName;
e.label = this.Form.majorName e.label = this.Form.majorName;
} }
}) });
this.$emit('getData') this.$emit("getData");
}).catch(res => {}); }).catch(res => {
}else{ });
this.$post(this.api.addStaffPro,data).then(res => { } else {
util.successMsg('添加成功'); this.$post(this.api.addStaffPro, data).then(res => {
this.isaddMajor = false util.successMsg("添加成功");
this.isaddMajor = false;
let newData = { let newData = {
staffProfessionalArchitectureId: res.message, staffProfessionalArchitectureId: res.message,
staffProfessionalArchitectureName: this.Form.majorName, staffProfessionalArchitectureName: this.Form.majorName,
@ -161,203 +165,238 @@ export default {
ifVisible: false, ifVisible: false,
ischeck: false, ischeck: false,
children: [] children: []
};
this.majorList.push(newData);
}).catch(res => {
});
} }
this.majorList.push(newData) } else {
}).catch(res => {});
}
}else{
return false; return false;
} }
}) });
}, },
// //
addDepartment(item){ addDepartment(item) {
this.Form.departmentId = '' this.Form.departmentId = "";
this.Form.departmentName = '' this.Form.departmentName = "";
this.isAddDepartment = true this.isAddDepartment = true;
this.Form.MajorId = item.staffProfessionalArchitectureId this.Form.MajorId = item.staffProfessionalArchitectureId;
}, },
editDepartment(item){ editDepartment(item) {
this.Form.departmentId = item.staffGradeId, this.Form.departmentId = item.staffGradeId,
this.Form.departmentName = item.staffGradeName this.Form.departmentName = item.staffGradeName;
this.isAddDepartment = true this.isAddDepartment = true;
for (let j = 0; j < this.majorList.length; j++) { for (let j = 0; j < this.majorList.length; j++) {
for (let k = 0; k < this.majorList[j].children.length; k++) { for (let k = 0; k < this.majorList[j].children.length; k++) {
if(this.majorList[j].children[k].staffGradeName == item.staffGradeName){ if (this.majorList[j].children[k].staffGradeName == item.staffGradeName) {
this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId;
} }
} }
} }
}, },
sureDepartment(Form){ sureDepartment(Form) {
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
let data = { let data = {
staffGradeName: this.Form.departmentName, staffGradeName: this.Form.departmentName,
staffProfessionalArchitectureId: this.Form.MajorId, staffProfessionalArchitectureId: this.Form.MajorId,
staffGradeId: this.Form.departmentId staffGradeId: this.Form.departmentId
};
if (this.Form.departmentId) {
this.$post(this.api.updateStaffGrade, data).then(res => {
util.successMsg("编辑成功");
this.isAddDepartment = false;
this.majorList.map(e => {
e.children.map(r => {
if (r.staffGradeId == this.Form.departmentId) {
r.staffGradeName = this.Form.departmentName;
r.label = this.Form.departmentName;
} }
if(this.Form.departmentId){ });
this.$post(this.api.updateStaffGrade,data).then(res => { });
util.successMsg('编辑成功'); }).catch(res => {
this.isAddDepartment = false });
this.majorList.map(e =>{ } else {
e.children.map(r =>{ this.$post(this.api.addStaffGrade, data).then(res => {
if(r.staffGradeId == this.Form.departmentId){ util.successMsg("添加成功");
r.staffGradeName = this.Form.departmentName this.isAddDepartment = false;
r.label = this.Form.departmentName
}
})
})
}).catch(res => {});
}else{
this.$post(this.api.addStaffGrade,data).then(res => {
util.successMsg('添加成功');
this.isAddDepartment = false
let newData = { let newData = {
staffGradeId: res.message, staffGradeId: res.message,
staffGradeName: this.Form.departmentName, staffGradeName: this.Form.departmentName,
label: this.Form.departmentName, label: this.Form.departmentName,
ifVisible: false, ifVisible: false,
ischeck: false ischeck: false
};
this.majorList.map(e => {
if (e.staffProfessionalArchitectureId == this.Form.MajorId) {
e.ifVisible = true;
e.children.push(newData);
} }
this.majorList.map(e =>{ });
if(e.staffProfessionalArchitectureId == this.Form.MajorId){ }).catch(res => {
e.ifVisible = true });
e.children.push(newData)
} }
}) } else {
}).catch(res => {});
}
}else{
return false; return false;
} }
}) });
}, },
delMajor(item,index){ delMajor(item, index) {
this.$confirm('确定要删除该专业吗?该操作将会删除该组织下的用户账号。', '提示', { this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
staffProfessionalArchitectureId: item.staffProfessionalArchitectureId staffProfessionalArchitectureId: item.staffProfessionalArchitectureId
} };
this.$post(this.api.deleteStaffPro,data).then(res => { this.$post(this.api.deleteStaffPro, data).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.majorList.splice(index, 1) this.majorList.splice(index, 1);
this.$emit('getData') this.$emit("getData");
this.$get(`${this.api.dalStaffByProfessionalId}?staffProfessionalArchitectureId=${item.staffProfessionalArchitectureId}`).then(res => {}).catch(res => {}) this.$get(`${this.api.dalStaffByProfessionalId}?staffProfessionalArchitectureId=${item.staffProfessionalArchitectureId}`).then(res => {
}).catch(res => {}); }).catch(res => {
});
}).catch(res => {
});
}) })
.catch(() => {}); .catch(() => {
});
}, },
delDepartment(item,indx){ delDepartment(item, indx) {
this.$confirm('确定要删除该部门吗?该操作将会删除该组织下的用户账号。', '提示', { this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", {
type: 'warning' type: "warning"
}) })
.then(() => { .then(() => {
let data = { let data = {
staffGradeId: item.staffGradeId staffGradeId: item.staffGradeId
} };
this.$post(this.api.deleteStaffGrade,data).then(res => { this.$post(this.api.deleteStaffGrade, data).then(res => {
util.successMsg('删除成功'); util.successMsg("删除成功");
this.majorList.map(e =>{ this.majorList.map(e => {
e.children.map(r =>{ e.children.map(r => {
if(r.staffGradeId == item.staffGradeId){ if (r.staffGradeId == item.staffGradeId) {
e.children.splice(indx,1) e.children.splice(indx, 1);
if(e.children.length == 0){ if (e.children.length == 0) {
e.ifVisible = false e.ifVisible = false;
} }
} }
});
});
this.$emit("delDep", item, this.majorList);
this.$emit("getData");
this.$get(`${this.api.dalStaffByStaffGradeId}?staffGradeId=${item.staffGradeId}`).then(res => {
}).catch(res => {
});
}).catch(res => {
});
}) })
}) .catch(() => {
this.$emit("delDep",item,this.majorList) });
this.$emit('getData')
this.$get(`${this.api.dalStaffByStaffGradeId}?staffGradeId=${item.staffGradeId}`).then(res => {}).catch(res => {})
}).catch(res => {});
})
.catch(() => {});
} }
} }
}; };
</script> </script>
<style scoped> <style scoped>
.side_view{ .side_view {
height: 800px; height: 800px;
padding: 40px 20px; padding: 40px 20px;
background-color: #fff; background-color: #fff;
box-shadow:-2px 0px 57px 0px rgba(192,189,216,0.39); box-shadow: -2px 0px 57px 0px rgba(192, 189, 216, 0.39);
} }
.side_icon{
.side_icon {
text-align: right; text-align: right;
} }
.side_icon i{
cursor:pointer; .side_icon i {
cursor: pointer;
font-size: 20px; font-size: 20px;
color: #9278FF; color: #9278FF;
} }
.side_tree{
.side_tree {
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
} }
.side_tree i{
.side_tree i {
color: #9278FF; color: #9278FF;
margin-left: 10px; margin-left: 10px;
} }
.fir_back{
.fir_back {
width: 100%; width: 100%;
padding: 15px 0; padding: 15px 0;
background:rgba(255,255,255,1); background: rgba(255, 255, 255, 1);
/* box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); */ /* box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); */
border-radius:10px; border-radius: 10px;
text-align: left; text-align: left;
} }
.fir_back:first-child{
.fir_back:first-child {
margin-top: 20px; margin-top: 20px;
} }
.fir_back:hover{
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); .fir_back:hover {
cursor:pointer; box-shadow: 1px 14px 29px 0px rgba(138, 97, 250, 0.19);
cursor: pointer;
} }
.fir_back span{
.fir_back span {
margin-left: 10px; margin-left: 10px;
} }
.two_active{
.two_active {
color: #9278FF; color: #9278FF;
} }
/* .two_active:hover{ /* .two_active:hover{
color: #9278FF; color: #9278FF;
cursor:pointer; cursor:pointer;
} */ } */
.two_back:hover{ .two_back:hover {
cursor:pointer; cursor: pointer;
color: #9278FF; color: #9278FF;
} }
.mar_top{
.mar_top {
margin-top: 20px; margin-top: 20px;
} }
.back_active{
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); .back_active {
box-shadow: 1px 14px 29px 0px rgba(138, 97, 250, 0.19);
} }
.bor_lef{
.bor_lef {
padding: 20px 0 0 0; padding: 20px 0 0 0;
margin-left: 40px; margin-left: 40px;
} }
.three_lef{
.three_lef {
margin-left: 60px; margin-left: 60px;
padding: 20px 0; padding: 20px 0;
} }
.three_text{
.three_text {
font-size: 14px; font-size: 14px;
margin-top: 10px; margin-top: 10px;
} }
.teacher_tab{
.teacher_tab {
margin-left: 20px; margin-left: 20px;
} }
.icon_select:before{
.icon_select:before {
transform: rotate(180deg); transform: rotate(180deg);
} }
.list-enter-active, .list-leave-active { transition: all 1s; }
.list-enter, .list-leave-to { opacity: 0; transform: translateY(-30px); } .list-enter-active, .list-leave-active {
transition: all 1s;
}
.list-enter, .list-leave-to {
opacity: 0;
transform: translateY(-30px);
}
</style> </style>

@ -13,8 +13,12 @@
/> />
<i v-else class="empty"></i> <i v-else class="empty"></i>
<i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i> <i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i>
<span>{{item.label}}</span> <span>{{ item.label }}</span>
<svg t="1604370117041" class="icon edit ft" @click.stop="editMajor(item)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16"><path d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z" p-id="9030" fill="#9076ff"></path></svg> <svg t="1604370117041" class="icon edit ft" @click.stop="editMajor(item)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16">
<path
d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z"
p-id="9030" fill="#9076ff"></path>
</svg>
<i class="el-icon-circle-plus ft fz" @click.stop="addDepartment(item)"></i> <i class="el-icon-circle-plus ft fz" @click.stop="addDepartment(item)"></i>
<i class="icon-delete ft" @click.stop="delMajor(item,index)"></i> <i class="icon-delete ft" @click.stop="delMajor(item,index)"></i>
</div> </div>
@ -23,8 +27,12 @@
<div v-for="(item1,index1) in item.children" :key="index1"> <div v-for="(item1,index1) in item.children" :key="index1">
<div class="item2" @click.stop="open(item1,2)"> <div class="item2" @click.stop="open(item1,2)">
<i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i> <i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i>
<span>{{item1.label}}</span> <span>{{ item1.label }}</span>
<svg t="1604370117041" class="icon edit ft" @click.stop="editDepartment(item1)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16"><path d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z" p-id="9030" fill="#9076ff"></path></svg> <svg t="1604370117041" class="icon edit ft" @click.stop="editDepartment(item1)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16">
<path
d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z"
p-id="9030" fill="#9076ff"></path>
</svg>
<i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i> <i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i>
</div> </div>
</div> </div>
@ -34,7 +42,7 @@
</template> </template>
<script> <script>
Array.prototype.removeByValue = function (val) { Array.prototype.removeByValue = function(val) {
for (var i = 0; i < this.length; i++) { for (var i = 0; i < this.length; i++) {
if (JSON.stringify(this[i]).indexOf(JSON.stringify(val)) != -1) { if (JSON.stringify(this[i]).indexOf(JSON.stringify(val)) != -1) {
this.splice(i, 1); this.splice(i, 1);
@ -50,7 +58,7 @@ export default {
}, },
watch: { watch: {
chooseList(n, o) { chooseList(n, o) {
this.$emit('chooseNode', n); this.$emit("chooseNode", n);
} }
}, },
@ -61,9 +69,9 @@ export default {
}, },
methods: { methods: {
// //
open(item,type) { open(item, type) {
item.ifVisible = !item.ifVisible; item.ifVisible = !item.ifVisible;
type == 1 ? this.$emit('fircheckitem',item) : this.$emit('twocheckitem',item) type == 1 ? this.$emit("fircheckitem", item) : this.$emit("twocheckitem", item);
}, },
//removeByvaluemain.js //removeByvaluemain.js
@ -75,41 +83,41 @@ export default {
this.chooseList.removeByValue(item); this.chooseList.removeByValue(item);
} }
}, },
fircheckitem(item){ fircheckitem(item) {
this.$emit('fircheckitem',item); this.$emit("fircheckitem", item);
}, },
twocheckitem(item){ twocheckitem(item) {
this.$emit('twocheckitem',item); this.$emit("twocheckitem", item);
}, },
// //
addMajor(){ addMajor() {
this.$emit('addMajor'); this.$emit("addMajor");
}, },
editMajor(item){ editMajor(item) {
this.$emit('editMajor',item); this.$emit("editMajor", item);
}, },
delMajor(item,index){ delMajor(item, index) {
this.$emit('delMajor',item,index); this.$emit("delMajor", item, index);
}, },
// //
addDepartment(item){ addDepartment(item) {
this.$emit('addDepartment',item); this.$emit("addDepartment", item);
}, },
editDepartment(item){ editDepartment(item) {
this.$emit('editDepartment',item); this.$emit("editDepartment", item);
}, },
delDepart(item,index){ delDepart(item, index) {
this.$emit('delDepart',item,index); this.$emit("delDepart", item, index);
}, },
// //
addClass(item){ addClass(item) {
this.$emit('addClass',item); this.$emit("addClass", item);
}, },
editDepartment(item){ editDepartment(item) {
this.$emit('editDepartment',item); this.$emit("editDepartment", item);
}, },
delDepartment(item,index){ delDepartment(item, index) {
this.$emit('delDepartment',item,index); this.$emit("delDepartment", item, index);
}, },
// //
isHasObj(arr, val) { isHasObj(arr, val) {
@ -155,29 +163,34 @@ $outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色
@include public; @include public;
width: 100%; width: 100%;
padding: 15px 0; padding: 15px 0;
background:rgba(255,255,255,1); background: rgba(255, 255, 255, 1);
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); box-shadow: 1px 14px 29px 0px rgba(138, 97, 250, 0.19);
border-radius:10px; border-radius: 10px;
text-align: left; text-align: left;
margin-top: 20px; margin-top: 20px;
} }
.item:first{
.item:first {
margin-top: 0; margin-top: 0;
} }
.item .empty{
.item .empty {
width: 20px; width: 20px;
} }
.edit{
.edit {
width: 18px !important; width: 18px !important;
height: 18px !important; height: 18px !important;
margin-left: 10px; margin-left: 10px;
} }
.item2 { .item2 {
@include public; @include public;
margin-top: 20px; margin-top: 20px;
margin-left:60px margin-left: 60px
} }
.item2:hover{
.item2:hover {
color: #9278FF; color: #9278FF;
} }
@ -195,6 +208,7 @@ li {
transform-origin: center; transform-origin: center;
transform: rotateZ(0deg); transform: rotateZ(0deg);
} }
.arrowTransformReturn { .arrowTransformReturn {
transition: 0.4s; transition: 0.4s;
transform-origin: center; transform-origin: center;
@ -217,35 +231,42 @@ li {
background-size: 14px 14px; background-size: 14px 14px;
} }
.side_view{ .side_view {
// height: 800px; // height: 800px;
padding: 40px 20px; padding: 40px 20px;
background-color: #fff; background-color: #fff;
box-shadow:-2px 0px 57px 0px rgba(192,189,216,0.39); box-shadow: -2px 0px 57px 0px rgba(192, 189, 216, 0.39);
i { i {
color: #9278FF; color: #9278FF;
} }
} }
.side_icon{
.side_icon {
text-align: right; text-align: right;
} }
.side_icon i{
cursor:pointer; .side_icon i {
cursor: pointer;
font-size: 20px; font-size: 20px;
} }
.side_tree{
.side_tree {
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
i{
i {
margin-left: 10px; margin-left: 10px;
} }
span{
span {
margin-left: 5px; margin-left: 5px;
font-size: 14px; font-size: 14px;
} }
} }
.fz{
.fz {
font-size: 20px; font-size: 20px;
} }
</style> </style>

@ -3,25 +3,25 @@
* 当传入的权限当前用户没有时会移除该组件 * 当传入的权限当前用户没有时会移除该组件
* 用例<Tag v-auth>text</Tag> <Tag v-auth="'user:'">text</Tag> * 用例<Tag v-auth>text</Tag> <Tag v-auth="'user:'">text</Tag>
* */ * */
import store from '@/store' import store from "@/store";
export default { export default {
inserted (el, binding, vnode) { inserted(el, binding, vnode) {
let btnText = '' let btnText = "";
// 如果有传值,就取传的值,否则,就取页面路由和按钮名字拼接起来 // 如果有传值,就取传的值,否则,就取页面路由和按钮名字拼接起来
if(binding.value){ if (binding.value) {
btnText = binding.value btnText = binding.value;
}else{ } else {
btnText = `${vnode.context.$route.path}:${el.innerText}` btnText = `${vnode.context.$route.path}:${el.innerText}`;
} }
const btnPermissions = store.state.auth.btns const btnPermissions = store.state.auth.btns;
if (btnText && btnPermissions && btnPermissions.length) { if (btnText && btnPermissions && btnPermissions.length) {
const isPermission = btnPermissions.includes(btnText) const isPermission = btnPermissions.includes(btnText);
// 如果按钮集合里没有该权限,就把该按钮给去除 // 如果按钮集合里没有该权限,就把该按钮给去除
if (!isPermission) { if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el) el.parentNode && el.parentNode.removeChild(el);
} }
} }
} }
} };

@ -4,9 +4,9 @@
* 用例<Tag :default="val">text</Tag> <Tag>{{val | default}}</Tag> * 用例<Tag :default="val">text</Tag> <Tag>{{val | default}}</Tag>
* */ * */
const defaultShow = (val) => { const defaultShow = (val) => {
return val == null ? '--' : val return val == null ? "--" : val;
} };
module.exports = { module.exports = {
defaultShow defaultShow
} };

@ -2,13 +2,13 @@
* 插件 * 插件
* */ * */
import directiveAuth from '@/plugins/auth'; import directiveAuth from "@/plugins/auth";
import throttle from '@/plugins/throttle'; import throttle from "@/plugins/throttle";
export default { export default {
async install (Vue, options) { async install(Vue, options) {
// 指令 // 指令
Vue.directive('auth', directiveAuth); Vue.directive("auth", directiveAuth);
Vue.directive('throttle', throttle); Vue.directive("throttle", throttle);
} }
} };

@ -1,42 +1,43 @@
import axios from 'axios' import axios from "axios";
import util from '@/libs/util' import util from "@/libs/util";
import router from '@/router/index' import router from "@/router/index";
import Setting from '@/setting' import Setting from "@/setting";
const service = axios.create({ const service = axios.create({
baseURL: Setting.apiBaseURL, baseURL: Setting.apiBaseURL,
timeout: 10000000 timeout: 10000000
}) });
// post请求头 // post请求头
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
// 请求拦截器 // 请求拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
util.getToken() util.getToken();
let token = util.local.get(Setting.tokenKey) let token = util.local.get(Setting.tokenKey);
if(token) config.headers.token = token if (token) config.headers.token = token;
return config return config;
},err => { }, err => {
util.errorMsg({ util.errorMsg({
message: '退出登陆', message: "退出登陆",
onClose: function () { onClose: function() {
router.push({name: '/login'}) router.push({ name: "/login" });
} }
}) });
return Promise.reject(err) return Promise.reject(err);
}) });
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const res = response.data const res = response.data;
if(res.status == 200 || res.status == 10000) { if (res.status == 200 || res.status == 10000) {
return Promise.resolve(res).catch(e => {}) return Promise.resolve(res).catch(e => {});
}else if(!res.status){ } else if (!res.status) {
return Promise.resolve(res).catch(e => {}) return Promise.resolve(res).catch(e => {});
}else { } else {
util.errorMsg(res.errmessage || res.message) util.errorMsg(res.errmessage || res.message);
return Promise.reject(res) // return Promise.reject(res)
return Promise.resolve(res).catch(e => {});
} }
}, },
// 服务器状态码不是200的情况 // 服务器状态码不是200的情况
@ -47,94 +48,95 @@ service.interceptors.response.use(
// 未登录则跳转登录页面,并携带当前页面的路径 // 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。 // 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401: case 401:
util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey);
util.errorMsg('登录过期,请重新登录') util.errorMsg("登录过期,请重新登录");
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({
path: '/login', path: "/login",
query: { query: {
redirect: router.currentRoute.fullPath redirect: router.currentRoute.fullPath
} }
}) });
}, 1000) }, 1000);
break break;
case 500: case 500:
util.errorMsg('网络错误') util.errorMsg("网络错误");
break break;
// 403 token过期 // 403 token过期
// 登录过期对用户进行提示 // 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象 // 清除本地token和清空vuex中token对象
// 跳转登录页面 // 跳转登录页面
case 403: case 403:
util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey);
util.errorMsg('登录过期,请重新登录') util.errorMsg("登录过期,请重新登录");
// 清除token // 清除token
// store.commit('loginSuccess', null); // store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({
path: '/login', path: "/login",
query: { query: {
redirect: router.currentRoute.fullPath redirect: router.currentRoute.fullPath
} }
}) });
}, 1000) }, 1000);
break break;
// 404请求不存在 // 404请求不存在
case 404: case 404:
util.errorMsg('网络请求不存在!') util.errorMsg("网络请求不存在!");
break break;
// 其他错误,直接抛出错误提示 // 其他错误,直接抛出错误提示
default: default:
util.errorMsg(error.response.data.message) util.errorMsg(error.response.data.message);
Promise.reject(res) Promise.reject(res);
} }
return Promise.reject(error.response) return Promise.reject(error.response);
} }
} }
); );
function get(url, params){ function get(url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
service.get(url, {params: params}).then(res => { service.get(url, { params: params }).then(res => {
resolve(res) resolve(res);
}).catch(err => { }).catch(err => {
reject(err) reject(err);
}) });
}) });
} }
function post(url, params){ function post(url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
service.post(url,params).then(res => { service.post(url, params).then(res => {
resolve(res) resolve(res);
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data);
}) });
}) });
} }
function del(url, params){ function del(url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
service.delete(url, { service.delete(url, {
params params
}).then(res => { }).then(res => {
resolve(res) resolve(res);
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data);
}) });
}) });
} }
function put(url, params){ function put(url, params) {
return new Promise((resolve, reject) =>{ return new Promise((resolve, reject) => {
service.put(url, params).then(res => { service.put(url, params).then(res => {
resolve(res) resolve(res);
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data);
}) });
}) });
} }
export { get,post,del,put }
export { get, post, del, put };

@ -4,15 +4,15 @@
* 用例<Tag v-throttle>text</Tag> * 用例<Tag v-throttle>text</Tag>
* */ * */
export default{ export default {
inserted (el, binding, vnode) { inserted(el, binding, vnode) {
el.addEventListener('click', () => { el.addEventListener("click", () => {
if (!el.disabled) { if (!el.disabled) {
el.disabled = true el.disabled = true;
setTimeout(() => { setTimeout(() => {
el.disabled = false el.disabled = false;
}, binding.value || 1000) }, binding.value || 1000);
} }
}) });
} }
} };

@ -1,7 +1,7 @@
import Vue from 'vue'; import Vue from "vue";
import Router from 'vue-router'; import Router from "vue-router";
import routes from './routes'; import routes from "./routes";
import Setting from '@/setting'; import Setting from "@/setting";
Vue.use(Router); Vue.use(Router);

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'achievement-' const pre = "achievement-";
export default { export default {
path: '/achievement', path: "/achievement",
name: 'achievement', name: "achievement",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,28 +16,28 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/achievement/list'), component: () => import("@/pages/achievement/list"),
meta: { title: '成绩管理' } meta: { title: "成绩管理" }
},{ }, {
name: `${pre}vir`, name: `${pre}vir`,
path: `vir`, path: `vir`,
component: () => import('@/pages/achievement/vir'), component: () => import("@/pages/achievement/vir"),
meta: { title: '成绩管理' } meta: { title: "成绩管理" }
},{ }, {
name: `${pre}teach`, name: `${pre}teach`,
path: `teach`, path: `teach`,
component: () => import('@/pages/achievement/teach'), component: () => import("@/pages/achievement/teach"),
meta: { title: '成绩管理' } meta: { title: "成绩管理" }
},{ }, {
name: `${pre}ass`, name: `${pre}ass`,
path: `ass`, path: `ass`,
component: () => import('@/pages/achievement/ass'), component: () => import("@/pages/achievement/ass"),
meta: { title: '成绩管理' } meta: { title: "成绩管理" }
},{ }, {
name: `${pre}show`, name: `${pre}show`,
path: `show`, path: `show`,
component: () => import('@/pages/achievement/show'), component: () => import("@/pages/achievement/show"),
meta: { title: '实验报告' } meta: { title: "实验报告" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'assessment-' const pre = "assessment-";
export default { export default {
path: '/assessment', path: "/assessment",
name: 'assessment', name: "assessment",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,14 +16,14 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/assessment/list'), component: () => import("@/pages/assessment/list"),
meta: { title: '考核管理' } meta: { title: "考核管理" }
}, },
{ {
name: `${pre}add`, name: `${pre}add`,
path: `add`, path: `add`,
component: () => import('@/pages/assessment/add/index.vue'), component: () => import("@/pages/assessment/add/index.vue"),
meta: { title: '添加考核' } meta: { title: "添加考核" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'course-' const pre = "course-";
export default { export default {
path: '/course', path: "/course",
name: 'course', name: "course",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,26 +16,26 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/course'), component: () => import("@/pages/course"),
meta: { title: '理论课程管理' } meta: { title: "理论课程管理" }
}, },
{ {
name: `${pre}add`, name: `${pre}add`,
path: `add`, path: `add`,
component: () => import('@/pages/course/courseManagement/add'), component: () => import("@/pages/course/courseManagement/add"),
meta: { title: '新增课程' } meta: { title: "新增课程" }
}, },
{ {
name: `${pre}preview`, name: `${pre}preview`,
path: `preview`, path: `preview`,
component: () => import('@/pages/course/courseManagement/preview'), component: () => import("@/pages/course/courseManagement/preview"),
meta: { title: '课程预览' } meta: { title: "课程预览" }
}, },
{ {
name: `${pre}contentSettings`, name: `${pre}contentSettings`,
path: `contentSettings`, path: `contentSettings`,
component: () => import('@/pages/course/courseManagement/contentSettings'), component: () => import("@/pages/course/courseManagement/contentSettings"),
meta: { title: '内容设置' } meta: { title: "内容设置" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'evaluation-' const pre = "evaluation-";
export default { export default {
path: '/evaluation', path: "/evaluation",
name: 'evaluation', name: "evaluation",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,8 +16,8 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/evaluation/list'), component: () => import("@/pages/evaluation/list"),
meta: { title: '测评管理' } meta: { title: "测评管理" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'information-' const pre = "information-";
export default { export default {
path: '/information', path: "/information",
name: 'information', name: "information",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,14 +16,14 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/information'), component: () => import("@/pages/information"),
meta: { title: '资讯管理' } meta: { title: "资讯管理" }
}, },
{ {
name: `${pre}addArticle`, name: `${pre}addArticle`,
path: `addArticle`, path: `addArticle`,
component: () => import('@/pages/information/contentManage/addArticle'), component: () => import("@/pages/information/contentManage/addArticle"),
meta: { title: '新增文章' } meta: { title: "新增文章" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'match-' const pre = "match-";
export default { export default {
path: '/match', path: "/match",
name: 'match', name: "match",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,20 +16,20 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/match'), component: () => import("@/pages/match"),
meta: { title: '赛事管理' } meta: { title: "赛事管理" }
}, },
{ {
name: `${pre}add`, name: `${pre}add`,
path: `add`, path: `add`,
component: () => import('@/pages/match/add'), component: () => import("@/pages/match/add"),
meta: { title: '创建赛事' } meta: { title: "创建赛事" }
}, },
{ {
name: `${pre}manage`, name: `${pre}manage`,
path: `manage`, path: `manage`,
component: () => import('@/pages/match/manage'), component: () => import("@/pages/match/manage"),
meta: { title: '管理赛事' } meta: { title: "管理赛事" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'project-' const pre = "project-";
export default { export default {
path: '/project', path: "/project",
name: 'project', name: "project",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,14 +16,14 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/project/list'), component: () => import("@/pages/project/list"),
meta: { title: '实验项目管理' } meta: { title: "实验项目管理" }
}, },
{ {
name: `${pre}add`, name: `${pre}add`,
path: `add`, path: `add`,
component: () => import('@/pages/project/add'), component: () => import("@/pages/project/add"),
meta: { title: '新增项目' } meta: { title: "新增项目" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'setting-' const pre = "setting-";
export default { export default {
path: '/setting', path: "/setting",
name: 'setting', name: "setting",
redirect: { redirect: {
name: `${pre}person` name: `${pre}person`
}, },
@ -16,8 +16,8 @@ export default {
{ {
name: `${pre}person`, name: `${pre}person`,
path: `person`, path: `person`,
component: () => import('@/pages/setting/person'), component: () => import("@/pages/setting/person"),
meta: { title: '个人中心' } meta: { title: "个人中心" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'student-' const pre = "student-";
export default { export default {
path: '/student', path: "/student",
name: 'student', name: "student",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,8 +16,8 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/student/list'), component: () => import("@/pages/student/list"),
meta: { title: '学生管理' } meta: { title: "学生管理" }
}, }
] ]
}; };

@ -1,12 +1,12 @@
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const meta = {} const meta = {};
const pre = 'system-' const pre = "system-";
export default { export default {
path: '/system', path: "/system",
name: 'system', name: "system",
redirect: { redirect: {
name: `${pre}list` name: `${pre}list`
}, },
@ -16,8 +16,8 @@ export default {
{ {
name: `${pre}list`, name: `${pre}list`,
path: `list`, path: `list`,
component: () => import('@/pages/system/list'), component: () => import("@/pages/system/list"),
meta: { title: '系统设置' } meta: { title: "系统设置" }
}, }
] ]
}; };

@ -1,27 +1,27 @@
import router from './index' import router from "./index";
import Setting from '@/setting' import Setting from "@/setting";
import util from '@/libs/util' import util from "@/libs/util";
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
document.title = Setting.titleSuffix document.title = Setting.titleSuffix;
const role = util.local.get(Setting.tokenKey) const role = util.local.get(Setting.tokenKey);
if (!role && to.path !== '/login') { if (!role && to.path !== "/login") {
next('/login') next("/login");
} else if(role && to.path == '/login') { } else if (role && to.path == "/login") {
next('/index') next("/index");
} else { } else {
let mg = from.query.mg let mg = from.query.mg;
if(mg){ if (mg) {
if(!to.query.mg){ if (!to.query.mg) {
next({ next({
path: to.path, path: to.path,
query: {mg} query: { mg }
}) });
}else{ } else {
next() next();
} }
}else{ } else {
next() next();
} }
} }
}); });

@ -1,29 +1,29 @@
import assessment from './modules/assessment' import assessment from "./modules/assessment";
import achievement from './modules/achievement' import achievement from "./modules/achievement";
import evaluation from './modules/evaluation' import evaluation from "./modules/evaluation";
import project from './modules/project' import project from "./modules/project";
import student from './modules/student' import student from "./modules/student";
import system from './modules/system' import system from "./modules/system";
import setting from './modules/setting' import setting from "./modules/setting";
import course from './modules/course' import course from "./modules/course";
import match from './modules/match' import match from "./modules/match";
import information from './modules/information' import information from "./modules/information";
import BasicLayout from '@/layouts/home' import BasicLayout from "@/layouts/home";
const frameIn = [ const frameIn = [
{ {
path: '/', path: "/",
redirect: '/login', redirect: "/login"
}, },
{ {
path: '/index', path: "/index",
redirect: '/student', redirect: "/student"
}, },
{ {
path: '/', path: "/",
component: () => BasicLayout, component: () => BasicLayout,
meta: { title: '首页' }, meta: { title: "首页" },
children: [] children: []
}, },
assessment, assessment,
@ -36,7 +36,7 @@ const frameIn = [
course, course,
match, match,
information information
] ];
/** /**
* 在主框架之外显示 * 在主框架之外显示
@ -45,12 +45,12 @@ const frameIn = [
const frameOut = [ const frameOut = [
// 登录 // 登录
{ {
path: '/login', path: "/login",
name: 'login', name: "login",
meta: { meta: {
title: '登录' title: "登录"
}, },
component: () => import('@/pages/account/login') component: () => import("@/pages/account/login")
} }
]; ];
@ -60,20 +60,20 @@ const frameOut = [
const errorPage = [ const errorPage = [
{ {
path: '/403', path: "/403",
name: '403', name: "403",
meta: { meta: {
title: '403' title: "403"
}, },
component: () => import('@/pages/exception/error/403') component: () => import("@/pages/exception/error/403")
}, },
{ {
path: '*', path: "*",
name: '404', name: "404",
meta: { meta: {
title: '404' title: "404"
}, },
component: () => import('@/pages/exception/error/404') component: () => import("@/pages/exception/error/404")
} }
]; ];

@ -8,14 +8,14 @@ const Setting = {
// 是否使用 Mock 的数据,默认 开发环境为 true,生产环境为 false // 是否使用 Mock 的数据,默认 开发环境为 true,生产环境为 false
isMock: true, isMock: true,
// 部署应用包时的基本 URL // 部署应用包时的基本 URL
publicPath: env === 'development' ? './' : '', publicPath: env === "development" ? "./" : "",
// 生产环境构建文件的目录名 // 生产环境构建文件的目录名
outputDir: 'dist', outputDir: "dist",
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。 // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
assetsDir: 'static', assetsDir: "static",
// 开发环境每次保存时 lint 代码,会将 lint 错误输出为编译警告 // 开发环境每次保存时 lint 代码,会将 lint 错误输出为编译警告
// true || false || error // true || false || error
lintOnSave: true, lintOnSave: true
}; };
module.exports = Setting; module.exports = Setting;

@ -2,11 +2,11 @@
* 业务配置 * 业务配置
* */ * */
const url = location.host; const url = location.host;
const isDev = process.env.NODE_ENV === 'development'; // 开发环境 const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isHh = url.includes('10.196.131.73'); //是否是河海版本 const isHh = url.includes("10.196.131.73"); //是否是河海版本
const isCH = url.includes('120.78.127.12'); //是否是巢湖版本 const isCH = url.includes("120.78.127.12"); //是否是巢湖版本
const isBeta = isDev || url.includes('120.78.198.231'); //是否是职站测试(本地亦调用测试服接口) const isBeta = isDev || url.includes("120.78.198.231"); //是否是职站测试(本地亦调用测试服接口)
const isPro = location.host.includes('occupationlab.com'); //是否是职站生产 const isPro = location.host.includes("occupationlab.com"); //是否是职站生产
let host = ""; let host = "";
let title = ""; let title = "";
@ -19,11 +19,11 @@ if (isHh) {
title = "教师管理端"; title = "教师管理端";
schoolId = 729; schoolId = 729;
systemList = [ systemList = [
{ id: 1, label: 'Python程序设计教学系统', }, { id: 1, label: "Python程序设计教学系统" },
{ id: 4, label: '经济金融建模实验教学系统' }, { id: 4, label: "经济金融建模实验教学系统" },
{ id: 6, label: '金融随机过程实验教学系统' }, { id: 6, label: "金融随机过程实验教学系统" },
{ id: 7, label: '量化投资策略建模实验教学系统' }, { id: 7, label: "量化投资策略建模实验教学系统" },
{ id: 8, label: '大数据分析实验教学系统' } { id: 8, label: "大数据分析实验教学系统" }
]; ];
} else if (isCH) { } else if (isCH) {
// 巢湖 // 巢湖
@ -31,7 +31,7 @@ if (isHh) {
title = "教师管理端"; title = "教师管理端";
schoolId = 1006; schoolId = 1006;
systemList = [ systemList = [
{ id: 8, label: '大数据分析实验教学系统' } { id: 8, label: "大数据分析实验教学系统" }
]; ];
} else if (isBeta) { } else if (isBeta) {
// 职站测试 // 职站测试
@ -39,17 +39,17 @@ if (isHh) {
title = "职站服务端管理系统"; title = "职站服务端管理系统";
schoolId = 2105; schoolId = 2105;
systemList = [ systemList = [
{ id: 1, label: 'Python程序设计教学系统' }, { id: 1, label: "Python程序设计教学系统" },
// { id: 2, label: '跨国仿真系统' }, // { id: 2, label: '跨国仿真系统' },
// { id: 3, label: '期权期货系统' }, // { id: 3, label: '期权期货系统' },
{ id: 4, label: '经济金融建模实验教学系统' }, { id: 4, label: "经济金融建模实验教学系统" },
{ id: 5, label: 'Python可视化实验教学系统' }, { id: 5, label: "Python可视化实验教学系统" },
{ id: 6, label: '金融随机过程实验教学系统' }, { id: 6, label: "金融随机过程实验教学系统" },
{ id: 7, label: '量化投资策略建模实验教学系统' }, { id: 7, label: "量化投资策略建模实验教学系统" },
{ id: 8, label: '大数据分析实验教学系统' }, { id: 8, label: "大数据分析实验教学系统" },
{ id: 9, label: 'Python数据清洗教学实验系统' }, { id: 9, label: "Python数据清洗教学实验系统" },
{ id: 10, label: 'Python数据采集(爬虫)教学实验系统' }, { id: 10, label: "Python数据采集(爬虫)教学实验系统" },
{ id: 11, label: '银行综合系统' }, { id: 11, label: "银行综合系统" }
]; ];
} else if (isPro) { } else if (isPro) {
// 职站生产 // 职站生产
@ -57,14 +57,14 @@ if (isHh) {
title = "职站服务端管理系统"; title = "职站服务端管理系统";
schoolId = 2105; schoolId = 2105;
systemList = [ systemList = [
{ id: 1, label: 'Python程序设计教学系统' }, { id: 1, label: "Python程序设计教学系统" },
{ id: 4, label: '经济金融建模实验教学系统' }, { id: 4, label: "经济金融建模实验教学系统" },
{ id: 5, label: 'Python可视化实验教学系统' }, { id: 5, label: "Python可视化实验教学系统" },
{ id: 6, label: '金融随机过程实验教学系统' }, { id: 6, label: "金融随机过程实验教学系统" },
{ id: 7, label: '量化投资策略建模实验教学系统' }, { id: 7, label: "量化投资策略建模实验教学系统" },
{ id: 8, label: '大数据分析实验教学系统' }, { id: 8, label: "大数据分析实验教学系统" },
{ id: 9, label: 'Python数据清洗教学实验系统' }, { id: 9, label: "Python数据清洗教学实验系统" },
{ id: 10, label: 'Python数据采集(爬虫)教学实验系统' } { id: 10, label: "Python数据采集(爬虫)教学实验系统" }
]; ];
} else { } else {
console.log("其它版本"); console.log("其它版本");
@ -75,7 +75,7 @@ const Setting = {
* 基础配置 * 基础配置
* */ * */
titleSuffix: title, // 网页标题的后缀 titleSuffix: title, // 网页标题的后缀
routerMode: 'hash', // 路由模式,可选值为 history 或 hash routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
isHh, // 是否是河海版本 isHh, // 是否是河海版本
@ -88,38 +88,36 @@ const Setting = {
// 以后如果卖给了其他学校,要给该学校单独开放子系统的话,就在下面这个数组里加判断就行,然后把需要开放的子系统放出来。不要复制这个职站项目另起一个项目,这样学校一多就很难维护了 // 以后如果卖给了其他学校,要给该学校单独开放子系统的话,就在下面这个数组里加判断就行,然后把需要开放的子系统放出来。不要复制这个职站项目另起一个项目,这样学校一多就很难维护了
systemList, systemList,
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
projectData: 'sta_data', // 新增项目跳转判分点数据存储cookie的key projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒
errorModalType: 'Message', // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice errorModalType: "Message", // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
cookiesExpires: 1, // Cookies 默认保存时间,单位:天 cookiesExpires: 1, // Cookies 默认保存时间,单位:天
tokenExpires: 1296000000, // token在localStorage的时间(毫秒) tokenExpires: 1296000000, // token在localStorage的时间(毫秒)
/** /**
* localStorage里保存的token的key * localStorage里保存的token的key
*/ */
tokenKey: 'oc_server_token', tokenKey: "oc_server_token",
/** /**
* localStorage里保存的vuex的key * localStorage里保存的vuex的key
*/ */
storeKey: 'oc_server_store', storeKey: "oc_server_store",
/** /**
* 默认密码 * 默认密码
*/ */
initialPassword: '111aaa', initialPassword: "111aaa",
/** /**
* 多语言配置 * 多语言配置
* */ * */
i18n: { i18n: {
// 默认语言 // 默认语言
default: 'zh', default: "zh",
// 是否根据用户电脑配置自动设置语言(仅第一次有效) // 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false auto: false
}, },
/** /**
* 布局配置 * 布局配置
* */ * */
layout: { layout: {},
},
/** /**
* 功能配置 * 功能配置
* */ * */
@ -129,9 +127,9 @@ const Setting = {
dynamicRoute: false, dynamicRoute: false,
// 文件上传 // 文件上传
upload: { upload: {
apiURL: 'http://8.134.8.197:8001/', apiURL: "http://8.134.8.197:8001/",
maxSize: 30, maxSize: 30
}, }
}; };
export default Setting; export default Setting;

@ -1,4 +1,2 @@
const getters = { const getters = {};
export default getters;
}
export default getters

@ -1,25 +1,25 @@
import Vue from 'vue'; import Vue from "vue";
import Vuex from 'vuex'; import Vuex from "vuex";
import getters from './getters' import getters from "./getters";
Vue.use(Vuex); Vue.use(Vuex);
// https://webpack.js.org/guides/dependency-management/#requirecontext // https://webpack.js.org/guides/dependency-management/#requirecontext
const modulesFiles = require.context('./modules', true, /\.js$/) const modulesFiles = require.context("./modules", true, /\.js$/);
// you do not need `import app from './modules/app'` // you do not need `import app from './modules/app'`
// it will auto require all vuex module from modules file // it will auto require all vuex module from modules file
const modules = modulesFiles.keys().reduce((modules, modulePath) => { const modules = modulesFiles.keys().reduce((modules, modulePath) => {
// set './app.js' => 'app' // set './app.js' => 'app'
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, "$1");
const value = modulesFiles(modulePath) const value = modulesFiles(modulePath);
modules[moduleName] = value.default modules[moduleName] = value.default;
return modules return modules;
}, {}) }, {});
const store = new Vuex.Store({ const store = new Vuex.Store({
modules, modules,
getters getters
}) });
export default store export default store;

@ -9,18 +9,18 @@ export default {
}, },
mutations: { mutations: {
SET_BTN_AUTH: (state, btns) => { SET_BTN_AUTH: (state, btns) => {
state.btns = btns state.btns = btns;
}, },
SET_ROUTE: (state, routes) => { SET_ROUTE: (state, routes) => {
state.routes = routes state.routes = routes;
}, }
}, },
actions: { actions: {
addBtnAuth({ state,commit },btns) { addBtnAuth({ state, commit }, btns) {
commit('SET_BTN_AUTH',btns) commit("SET_BTN_AUTH", btns);
}, },
addRoutes({ state,commit },routes) { addRoutes({ state, commit }, routes) {
commit('SET_ROUTE',routes) commit("SET_ROUTE", routes);
} }
} }
} };

@ -4,23 +4,23 @@
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
tabsName: '2', tabsName: "2",
columnId: "" columnId: ""
}, },
mutations: { mutations: {
SET_TABS_NAME: (state, name) => { SET_TABS_NAME: (state, name) => {
state.tabsName = name state.tabsName = name;
}, },
SET_COLUMN_ID: (state, id) => { SET_COLUMN_ID: (state, id) => {
state.columnId = id state.columnId = id;
}, }
}, },
actions: { actions: {
setTabsName({ state,commit },name) { setTabsName({ state, commit }, name) {
commit('SET_TABS_NAME',name) commit("SET_TABS_NAME", name);
},
setColumnId({ state,commit },id) {
commit('SET_COLUMN_ID',id)
}, },
setColumnId({ state, commit }, id) {
commit("SET_COLUMN_ID", id);
}
} }
} };

@ -2,10 +2,10 @@
* 布局管理 * 布局管理
* */ * */
// 是否IE // 是否IE
function isIE() { function isIE() {
if (!!window.ActiveXObject || "ActiveXObject" in window) return true if (!!window.ActiveXObject || "ActiveXObject" in window) return true;
return false return false;
} }
export default { export default {
@ -15,10 +15,8 @@ export default {
}, },
mutations: { mutations: {
SET_IE: (state, val) => { SET_IE: (state, val) => {
state.isIE = val state.isIE = val;
},
},
actions: {
} }
} },
actions: {}
};

@ -4,16 +4,16 @@
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
matchId: '', matchId: "",
}, },
mutations: { mutations: {
SET_MATCH_ID: (state, id) => { SET_MATCH_ID: (state, id) => {
state.matchId = id state.matchId = id;
}, }
}, },
actions: { actions: {
setMatchId({ state,commit },id) { setMatchId({ state, commit }, id) {
commit('SET_MATCH_ID',id) commit("SET_MATCH_ID", id);
}, }
} }
} };

@ -10,24 +10,24 @@ export default {
}, },
mutations: { mutations: {
SET_SYSTEM_ID: (state, systemId) => { SET_SYSTEM_ID: (state, systemId) => {
state.lastSystemId = systemId state.lastSystemId = systemId;
}, },
SET_PROJECT: (state, projectFields) => { SET_PROJECT: (state, projectFields) => {
state.projectFields = projectFields state.projectFields = projectFields;
}, },
SET_ASS: (state, assFields) => { SET_ASS: (state, assFields) => {
state.assFields = assFields state.assFields = assFields;
} }
}, },
actions: { actions: {
setSystemId({ state, commit }, systemId) { setSystemId({ state, commit }, systemId) {
commit('SET_SYSTEM_ID', systemId) commit("SET_SYSTEM_ID", systemId);
}, },
setProject({ state, commit }, projectFields) { setProject({ state, commit }, projectFields) {
commit('SET_PROJECT', projectFields) commit("SET_PROJECT", projectFields);
}, },
setAss({ state, commit }, assFields) { setAss({ state, commit }, assFields) {
commit('SET_ASS', assFields) commit("SET_ASS", assFields);
} }
} }
} };

@ -1,9 +1,8 @@
import Setting from "@/setting";
import Setting from '@/setting' import util from "@/libs/util";
import util from '@/libs/util' import { post, get, del, put } from "@/plugins/requests/index.js";
import {post,get,del,put} from '@/plugins/requests/index.js' import api from "@/api";
import api from '@/api' import addRoutes from "@/libs/route/addRoutes";
import addRoutes from '@/libs/route/addRoutes'
/** /**
* 用户信息 * 用户信息
@ -11,70 +10,70 @@ import addRoutes from '@/libs/route/addRoutes'
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
userId: 3, userId: 3,
userName: '', userName: "",
schoolId: '', schoolId: "",
roleId: '', roleId: "",
dataTime: '' dataTime: ""
}, },
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
if(info.avatar) state.avatar = info.userAvatars if (info.avatar) state.avatar = info.userAvatars;
state.userId = info.userId state.userId = info.userId;
state.schoolId = info.schoolId state.schoolId = info.schoolId;
state.userName = info.userName state.userName = info.userName;
state.roleId = info.roleId state.roleId = info.roleId;
state.dataTime = info.dataTime state.dataTime = info.dataTime;
}, },
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar;
}, },
SET_USERNAME: (state, userName) => { SET_USERNAME: (state, userName) => {
state.userName = userName state.userName = userName;
}, }
}, },
actions: { actions: {
login({ state,commit }, userInfo) { login({ state, commit }, userInfo) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
post(api.logins, userInfo).then(res => { post(api.logins, userInfo).then(res => {
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));
if(res.status == 200){ if (res.status == 200) {
let { data } = res; let { data } = res;
// 生成路由权限 // 生成路由权限
// 每个系统都是用这套角色权限代码的,后端也是基本一样,除了个别字段可能会不一样 // 每个系统都是用这套角色权限代码的,后端也是基本一样,除了个别字段可能会不一样
// 总体来说就两个步骤: 1是生成能够访问的路由的数组集合,2是生成能看到的按钮的数组集合 // 总体来说就两个步骤: 1是生成能够访问的路由的数组集合,2是生成能看到的按钮的数组集合
//res.message.listValue && Setting.dynamicRoute && addRoutes(res.message.listValue) //res.message.listValue && Setting.dynamicRoute && addRoutes(res.message.listValue)
util.local.set(Setting.tokenKey,data.token,Setting.tokenExpires) util.local.set(Setting.tokenKey, data.token, Setting.tokenExpires);
util.successMsg('登录成功') util.successMsg("登录成功");
console.log(data,'登录保存的数据'); console.log(data, "登录保存的数据");
commit('SET_INFO',data) commit("SET_INFO", data);
resolve() resolve();
}else{ } else {
util.errorMsg(res.errmessage || res.message) util.errorMsg(res.errmessage || res.message);
reject(res) reject(res);
} }
}).catch(error => { }).catch(error => {
reject(error) reject(error);
}) });
}) });
}, },
logout({ commit, state, dispatch }) { logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey);
location.reload() location.reload();
resolve() resolve();
}) });
}, },
setAvatar({ state,commit },avatar) { setAvatar({ state, commit }, avatar) {
commit('SET_AVATAR',avatar) commit("SET_AVATAR", avatar);
}, },
setInfo({ state,commit },info) { setInfo({ state, commit }, info) {
commit('SET_INFO',info) commit("SET_INFO", info);
},
setUserName({ state,commit },userName) {
commit('SET_USERNAME',userName)
}, },
setUserName({ state, commit }, userName) {
commit("SET_USERNAME", userName);
}
} }
} };

@ -1,6 +1,6 @@
@import "./default/index.scss"; @import "./default/index.scss";
@font-face{ @font-face {
font-family: youshe; font-family: youshe;
src: url('font/YouSheBiaoTiHei.ttf'); src: url('font/YouSheBiaoTiHei.ttf');
} }
@ -13,32 +13,33 @@
width: 8px; width: 8px;
height: 8px; height: 8px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
width: 5px; width: 5px;
border-radius: 6px; border-radius: 6px;
background: rgba(146,120,255,.7); background: rgba(146, 120, 255, .7);
} }
.flex-between{ .flex-between {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.el-button--primary.action-btn{ .el-button--primary.action-btn {
color: $--color-primary !important; color: $--color-primary !important;
font-size: 14px !important; font-size: 14px !important;
background-color: #fff !important; background-color: #fff !important;
border-radius: 4px !important; border-radius: 4px !important;
} }
.el-input{ .el-input {
.el-input__inner{ .el-input__inner {
border-color: rgba(0, 0, 0, 0.15); border-color: rgba(0, 0, 0, 0.15);
} }
} }
.p-title{ .p-title {
padding-left: 5px; padding-left: 5px;
margin-bottom: 24px; margin-bottom: 24px;
line-height: 1; line-height: 1;
@ -46,42 +47,50 @@
color: #585858; color: #585858;
border-left: 3px solid $--color-primary; border-left: 3px solid $--color-primary;
} }
.page{
.page {
position: relative; position: relative;
padding: 24px; padding: 24px;
background-color: #fff; background-color: #fff;
border-radius: 8px; border-radius: 8px;
.tool{
.tool {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-bottom: 24px; margin-bottom: 24px;
.filter{ .filter {
display: inline-flex; display: inline-flex;
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
flex: 1; flex: 1;
li{
li {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
margin-right: 30px; margin-right: 30px;
label{
label {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
color: rgba(0,0,0,.65); color: rgba(0, 0, 0, .65);
white-space: nowrap; white-space: nowrap;
} }
} }
} }
.el-button--primary{
.el-button--primary {
@extend .action-btn; @extend .action-btn;
} }
&.mul{
&.mul {
margin-bottom: 0; margin-bottom: 0;
.filter{
.filter {
width: 1200px; width: 1200px;
li{
li {
margin-bottom: 24px; margin-bottom: 24px;
} }
} }
@ -92,31 +101,37 @@
.pagination { .pagination {
margin: 20px 0; margin: 20px 0;
text-align: center; text-align: center;
button,.number{
color: rgba(0,0,0,.65) !important; button, .number {
color: rgba(0, 0, 0, .65) !important;
background-color: transparent !important; background-color: transparent !important;
border: 1px solid rgba(0, 0, 0, 0.15) !important; border: 1px solid rgba(0, 0, 0, 0.15) !important;
border-radius: 4px !important; border-radius: 4px !important;
} }
button i{
button i {
color: #333; color: #333;
} }
.active{
.active {
color: #fff !important; color: #fff !important;
background-color: $--color-primary !important; background-color: $--color-primary !important;
} }
} }
.el-table{ .el-table {
border-radius: 8px; border-radius: 8px;
border: 1px solid rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.06);
border-bottom: 0; border-bottom: 0;
.cell{
.cell {
font-size: 14px; font-size: 14px;
} }
th{
th {
background: $--color-primary !important; background: $--color-primary !important;
.cell{
.cell {
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
@ -124,19 +139,21 @@
} }
} }
.tabs{ .tabs {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24px; padding: 0 24px;
border-bottom: 1px solid rgba(0,0,0,.06); border-bottom: 1px solid rgba(0, 0, 0, .06);
.item{
.item {
position: relative; position: relative;
padding: 20px 0; padding: 20px 0;
margin-right: 40px; margin-right: 40px;
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
cursor: pointer; cursor: pointer;
&:after{
&:after {
content: ''; content: '';
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -146,74 +163,91 @@
border-bottom: 3px solid transparent; border-bottom: 3px solid transparent;
border-radius: 2px; border-radius: 2px;
} }
&.active{
&.active {
font-weight: 500; font-weight: 500;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
&.active:after{
&.active:after {
border-bottom-color: $--color-primary; border-bottom-color: $--color-primary;
} }
} }
} }
.el-message{ .el-message {
padding: 11px 20px; padding: 11px 20px;
.el-message__icon{
.el-message__icon {
font-size: 16px; font-size: 16px;
} }
.el-message__content{
.el-message__content {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.el-icon-close{
.el-icon-close {
font-size: 14px; font-size: 14px;
color: #92998d; color: #92998d;
} }
.el-message--success{
.el-message--success {
border: 1px solid #B7EB8F; border: 1px solid #B7EB8F;
background: #F6FFED; background: #F6FFED;
.el-message__icon{
.el-message__icon {
color: #00c700; color: #00c700;
} }
} }
.el-message--warning{
.el-message--warning {
border: 1px solid #FFE58F; border: 1px solid #FFE58F;
background: #FFFBE6; background: #FFFBE6;
.el-message__icon{
.el-message__icon {
color: #ffa900; color: #ffa900;
} }
} }
} }
.el-message-box{ .el-message-box {
padding-bottom: 24px; padding-bottom: 24px;
.el-message-box__header{
.el-message-box__header {
padding: 32px 32px 12px 50px; padding: 32px 32px 12px 50px;
span{
span {
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
font-weight: 500; font-weight: 500;
} }
} }
.el-message-box__status{
.el-message-box__status {
top: -30px; top: -30px;
} }
.el-message-box__status + .el-message-box__message{
.el-message-box__status + .el-message-box__message {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.el-message-box__btns{
.el-message-box__btns {
padding-right: 32px; padding-right: 32px;
&.el-icon-warning{
&.el-icon-warning {
color: #ffa900; color: #ffa900;
} }
} }
&:not(.normal){
.el-button--primary{ &:not(.normal) {
.el-button--primary {
color: #606266; color: #606266;
background: #fff; background: #fff;
border-color: #DCDFE6; border-color: #DCDFE6;
&:hover{
&:hover {
color: $--color-primary; color: $--color-primary;
border-color: #efbdbb; border-color: #efbdbb;
background-color: #fae9e8; background-color: #fae9e8;
@ -222,20 +256,24 @@
} }
} }
.el-dialog__wrapper{ .el-dialog__wrapper {
.el-dialog{ .el-dialog {
border-radius: 4px; border-radius: 4px;
.el-dialog__header{
.el-dialog__header {
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-bottom: 1px solid rgba(0, 0, 0, 0.06);
.el-dialog__title{
.el-dialog__title {
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
} }
.el-dialog__footer{
.el-dialog__footer {
padding: 10px 16px; padding: 10px 16px;
border-top: 1px solid rgba(0, 0, 0, 0.06); border-top: 1px solid rgba(0, 0, 0, 0.06);
.el-button{
.el-button {
font-size: 14px; font-size: 14px;
border-radius: 4px; border-radius: 4px;
border-color: rgba(0, 0, 0, 0.15); border-color: rgba(0, 0, 0, 0.15);
@ -244,51 +282,57 @@
} }
} }
.upload-wrap{ .upload-wrap {
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 34px 0; padding: 34px 0;
.el-button{
span{ .el-button {
span {
display: flex; display: flex;
align-items: center; align-items: center;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
font-size: 14px; font-size: 14px;
img{
img {
margin-right: 8px; margin-right: 8px;
} }
} }
} }
&>.el-button{
& > .el-button {
margin-right: 32px; margin-right: 32px;
} }
.el-upload-list{
.el-upload-list {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
} }
.link{
.link {
position: absolute; position: absolute;
bottom: -20px; bottom: -20px;
left: 0; left: 0;
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
&.lg{
&.lg {
padding-bottom: 50px; padding-bottom: 50px;
} }
} }
.el-tooltip__popper{ .el-tooltip__popper {
width: 300px; width: 300px;
} }
@media(max-width: 1600px){ @media(max-width: 1600px) {
.el-table{ .el-table {
.el-switch__label--right.is-active{ .el-switch__label--right.is-active {
left: 8px; left: 8px;
} }
} }

@ -215,35 +215,35 @@
margin: 1em 0; margin: 1em 0;
} }
.markdown>p, .markdown > p,
.markdown>blockquote, .markdown > blockquote,
.markdown>.highlight, .markdown > .highlight,
.markdown>ol, .markdown > ol,
.markdown>ul { .markdown > ul {
width: 80%; width: 80%;
} }
.markdown ul>li { .markdown ul > li {
list-style: circle; list-style: circle;
} }
.markdown>ul li, .markdown > ul li,
.markdown blockquote ul>li { .markdown blockquote ul > li {
margin-left: 20px; margin-left: 20px;
padding-left: 4px; padding-left: 4px;
} }
.markdown>ul li p, .markdown > ul li p,
.markdown>ol li p { .markdown > ol li p {
margin: 0.6em 0; margin: 0.6em 0;
} }
.markdown ol>li { .markdown ol > li {
list-style: decimal; list-style: decimal;
} }
.markdown>ol li, .markdown > ol li,
.markdown blockquote ol>li { .markdown blockquote ol > li {
margin-left: 20px; margin-left: 20px;
padding-left: 4px; padding-left: 4px;
} }
@ -260,7 +260,7 @@
font-weight: 600; font-weight: 600;
} }
.markdown>table { .markdown > table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0px; border-spacing: 0px;
empty-cells: show; empty-cells: show;
@ -269,20 +269,20 @@
margin-bottom: 24px; margin-bottom: 24px;
} }
.markdown>table th { .markdown > table th {
white-space: nowrap; white-space: nowrap;
color: #333; color: #333;
font-weight: 600; font-weight: 600;
} }
.markdown>table th, .markdown > table th,
.markdown>table td { .markdown > table td {
border: 1px solid #e9e9e9; border: 1px solid #e9e9e9;
padding: 8px 16px; padding: 8px 16px;
text-align: left; text-align: left;
} }
.markdown>table th { .markdown > table th {
background: #F7F7F7; background: #F7F7F7;
} }
@ -318,8 +318,8 @@
display: inline-block; display: inline-block;
} }
.markdown>br, .markdown > br,
.markdown>p>br { .markdown > p > br {
clear: both; clear: both;
} }
@ -453,13 +453,13 @@ pre[class*="language-"] {
overflow: auto; overflow: auto;
} }
:not(pre)>code[class*="language-"], :not(pre) > code[class*="language-"],
pre[class*="language-"] { pre[class*="language-"] {
background: #f5f2f0; background: #f5f2f0;
} }
/* Inline code */ /* Inline code */
:not(pre)>code[class*="language-"] { :not(pre) > code[class*="language-"] {
padding: .1em; padding: .1em;
border-radius: .3em; border-radius: .3em;
white-space: normal; white-space: normal;

@ -1,9 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8" />
<title>IconFont Demo</title> <title>IconFont Demo</title>
<link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/> <link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon" />
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css"> <link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css"> <link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css"> <link rel="stylesheet" href="iconfont.css">
@ -14,7 +14,7 @@
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script> <script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
</head> </head>
<body> <body>
<div class="main"> <div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1> <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1>
<div class="nav-tabs"> <div class="nav-tabs">
<ul id="tabs" class="dib-box"> <ul id="tabs" class="dib-box">
@ -118,8 +118,8 @@
</blockquote> </blockquote>
<p>Unicode 使用步骤如下:</p> <p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3> <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.eot'); src: url('iconfont.eot');
src: url('iconfont.eot?#iefix') format('embedded-opentype'), src: url('iconfont.eot?#iefix') format('embedded-opentype'),
@ -130,8 +130,8 @@
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css" <pre><code class="language-css"
>.iconfont { >.iconfont {
font-family: "iconfont" !important; font-family: "iconfont" !important;
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
@ -140,7 +140,7 @@
} }
</code></pre> </code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3> <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre> <pre>
<code class="language-html" <code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt; >&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre> </code></pre>
@ -275,10 +275,10 @@
</ul> </ul>
<p>使用步骤如下:</p> <p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3> <h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt; <pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre> </code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3> <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt; <pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
</code></pre> </code></pre>
<blockquote> <blockquote>
<p>" <p>"
@ -400,10 +400,10 @@
</ul> </ul>
<p>使用步骤如下:</p> <p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3> <h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt; <pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre> </code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3> <h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt; <pre><code class="language-html">&lt;style&gt;
.icon { .icon {
width: 1em; width: 1em;
height: 1em; height: 1em;
@ -414,7 +414,7 @@
&lt;/style&gt; &lt;/style&gt;
</code></pre> </code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3> <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt; <pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt; &lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt; &lt;/svg&gt;
</code></pre> </code></pre>
@ -422,25 +422,25 @@
</div> </div>
</div> </div>
</div> </div>
<script> <script>
$(document).ready(function () { $(document).ready(function() {
$('.tab-container .content:first').show() $(".tab-container .content:first").show();
$('#tabs li').click(function (e) { $("#tabs li").click(function(e) {
var tabContent = $('.tab-container .content') var tabContent = $(".tab-container .content");
var index = $(this).index() var index = $(this).index();
if ($(this).hasClass('active')) { if ($(this).hasClass("active")) {
return return;
} else { } else {
$('#tabs li').removeClass('active') $("#tabs li").removeClass("active");
$(this).addClass('active') $(this).addClass("active");
tabContent.hide().eq(index).fadeIn() tabContent.hide().eq(index).fadeIn();
} }
}) });
}) });
</script> </script>
</body> </body>
</html> </html>

@ -1,10 +1,9 @@
@font-face {font-family: "iconfont"; @font-face {
font-family: "iconfont";
src: url('iconfont.eot?t=1589437921018'); /* IE9 */ src: url('iconfont.eot?t=1589437921018'); /* IE9 */
src: url('iconfont.eot?t=1589437921018#iefix') format('embedded-opentype'), /* IE6-IE8 */ src: url('iconfont.eot?t=1589437921018#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAdgAAsAAAAADwwAAAcTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCESgqOeIt2ATYCJAM0CxwABCAFhG0HgTMbpQxRlHBSFNlX2JThXqSJ4cz0aLyxzNkVgYOP2N97wQhUeQbPDZA1QByDeHha+9+5M7PrD1FpdI8mCSqJLulDJPFDxCQTvUQS6Qtka3ukU0/kuK8wfBBwMr1kmeTIb8hUohVh6lTeCHDCrRPPf5v6f+sQfS+QqgmpiZLNw+ZI6zMXZGL3nXY47elJFnjALaE4zjzyjJN773yuzM/7H4oZ9NV+v/q1g1ddvP1QmE5JlPRM7uAv5klMk0vWTBWTLpoJEUIja6hWSkNhOklN/ds4n0BvhyLMuZ6hKdArLC1Q4a4iG0Gfi1JaHEMbXtfsW8S8SpsepzuAJ+HLx28hoSepMmvby3e6LdC2EN2eV0ykW36MR/MlQFiJjGNAEej7WvtLgB6aM6evXtwH1glnTloW1snRYnBhky+LxyuL9glaGNmaDbRsJYR1tl+seImrgUGtEtLc//GMeo1WR9QYfUSrp7nohWgXDRrJBqpBcoAqkGagAGkBSiADQBlkEKiAbAI/N/mCYHoWi1HDEgWoBbGjlg7M/OpbgEMgnUf0fxab8kjK0tvq8cZ6/dpKwk4bNsXFx4bHR4RHcty4LVnR4xp/2TFxDN42tgefhUpEMeeqppXCU50JyT/gkVCD+EiEgl56LOkMN+6cAfyKs3dvomHU7fvnq96Uc/duIXMMqWmhNRoax1m8jNWfPorp2jlqumvHrolfe/2TcuIPCt3K589dhUNiT5OSEh4KoM9Jp1vK2GMnFjDdyaeFMrd06ki1gn9CmEz3OErpebmp+GzyAN+lMLw6dwkKh6Ve5dOnzp4W0+Y25TTfhHB10isXpxIB5GHDKcggnof+NCpCD+okAFyTPNGuRVgahmhLjZo1rnqnMlpD0ORJSluuY6jT+gPWHtaIeDKOaoradNDPruOQzulPGcBtz0C2YdbLrSFPIMGTrcNRDGC3YnJOm1JLceYK2sCWY5lqxICXIEU0gki2nkPFUteBwoqLMyTdKE7ZlOzE3yHfdSyOU2shl8RoxPJlx1bQ6C0Li3DLg+Sdi+c5evEkhtF3rBdfXpe0IiNcfW27+x6u5U4vs8zZZdu1R7Gblyc6AV9OB4Xp65HRDqcvw0Pi1DGbddntOKzYgkbhXJq+Y4bRVqszl746KdRPFV5FxSUb6XmKomd1yCb0nJbpz+aOIZskx0phXx8sHfNKyRjPsM8LGU/xJ9Qrv2JugdVBkBg/ZpUIDvpN0jfHD550XPKNDgkKEZ46l4dwq0sOxIecJlX2pxxA8GTwkCGMFqxVFf5PRZplCky9uCIQL/s/RFabTYZNkhtkQXFR28vKXwKUP5rZbFg+s3VAFTu5dBZG4G07t5tHuM2cFirh2BisrHKYoE8lzO1h/LkwjSD+VZF0qs1hQVK+d0xHOLN80q4B/P9utxQDmGt4DaEKE6Lc5lnI6VxDf/35owQHCAuKw95VG6l1bvXPY3J1slpepPBXdCx8EM+ubbd2tV48b2UtWLtYb89PZhvg2jsq5+zkBdIVVTFHfhEwNv0CxNiT02LKVxGSus1dt9VsXDZulogOJB1AkGQVg4e833uzaWatx7bPrLKyhBeBqlC3xGqNoe3MVQHmDmBs4jm+xFjW/sjcAgOiPOFawwe3bUeTa20vGNZgbV6tCtL/qEL/fmiFLjqCCDpZdQpkdKgx6tSuzlCdqnrMFsLMhWn9sKH4ezmjmvpp9Selw9oCS0Vtcbox4f967yYpc1lNwUzPAUT3N0R32yz0bof5Wblw2jzkuw4VkWFptzoKckHRUwszvHJS8IgkAfys2IvKr/LtZBa1LzvfHBmFD6/V9enLD7LLJD2tz7n3E8BkFcwVyA/DL8P0fCpXAdLntBfy9tQCpuUP2QBAWkwyYccYGYFWWc/HS8Of6pVNf1r8p8n48bn+wPLzm5gyWoneAh3ivzATiiRKljoz8hQTN3S0itSojpnbgvjFod7uBf2Rtsa7dej63gKVRdenkDS2Q9baZyzWY1AZnIBa6yT0juo9eLCWhhOlwxFrCYRVjkKywhfIVrlrLNa3UNngB9RWBQe9mxF1zMGBUFCnRoyUWLBpCStm1SU5sRRFFSeI7HUYtawUeswQzaNk4PKSsmJBL3ERbY4dPD65glIJS5rqxD3kYsThULFbU23ETEuslLobSkuluh1LzKoTkLM0hBH1A1pgJku2CjOVizQ+hUrPP4GQeTkYaS0tarYzCI2HMnusXImyHsZe3dWrxb1U9/CRVaBMggS79TUqJ6yHSSAcdq4Kc9evZUOYUSWsI7LdGpQy7Ul99ZL1qfObT4CedX+zSJGjRBV1NNFGF30MMcYsVugeKLLqDXiNLuQnSQjRvRwtrRzlsSoBxeiSl1SvLVQoF1FcZj0Jqi46odWosl43b1H9Lp2FOAgl7OKibs6cgOICAA==') format('woff2'),
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAdgAAsAAAAADwwAAAcTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCESgqOeIt2ATYCJAM0CxwABCAFhG0HgTMbpQxRlHBSFNlX2JThXqSJ4cz0aLyxzNkVgYOP2N97wQhUeQbPDZA1QByDeHha+9+5M7PrD1FpdI8mCSqJLulDJPFDxCQTvUQS6Qtka3ukU0/kuK8wfBBwMr1kmeTIb8hUohVh6lTeCHDCrRPPf5v6f+sQfS+QqgmpiZLNw+ZI6zMXZGL3nXY47elJFnjALaE4zjzyjJN773yuzM/7H4oZ9NV+v/q1g1ddvP1QmE5JlPRM7uAv5klMk0vWTBWTLpoJEUIja6hWSkNhOklN/ds4n0BvhyLMuZ6hKdArLC1Q4a4iG0Gfi1JaHEMbXtfsW8S8SpsepzuAJ+HLx28hoSepMmvby3e6LdC2EN2eV0ykW36MR/MlQFiJjGNAEej7WvtLgB6aM6evXtwH1glnTloW1snRYnBhky+LxyuL9glaGNmaDbRsJYR1tl+seImrgUGtEtLc//GMeo1WR9QYfUSrp7nohWgXDRrJBqpBcoAqkGagAGkBSiADQBlkEKiAbAI/N/mCYHoWi1HDEgWoBbGjlg7M/OpbgEMgnUf0fxab8kjK0tvq8cZ6/dpKwk4bNsXFx4bHR4RHcty4LVnR4xp/2TFxDN42tgefhUpEMeeqppXCU50JyT/gkVCD+EiEgl56LOkMN+6cAfyKs3dvomHU7fvnq96Uc/duIXMMqWmhNRoax1m8jNWfPorp2jlqumvHrolfe/2TcuIPCt3K589dhUNiT5OSEh4KoM9Jp1vK2GMnFjDdyaeFMrd06ki1gn9CmEz3OErpebmp+GzyAN+lMLw6dwkKh6Ve5dOnzp4W0+Y25TTfhHB10isXpxIB5GHDKcggnof+NCpCD+okAFyTPNGuRVgahmhLjZo1rnqnMlpD0ORJSluuY6jT+gPWHtaIeDKOaoradNDPruOQzulPGcBtz0C2YdbLrSFPIMGTrcNRDGC3YnJOm1JLceYK2sCWY5lqxICXIEU0gki2nkPFUteBwoqLMyTdKE7ZlOzE3yHfdSyOU2shl8RoxPJlx1bQ6C0Li3DLg+Sdi+c5evEkhtF3rBdfXpe0IiNcfW27+x6u5U4vs8zZZdu1R7Gblyc6AV9OB4Xp65HRDqcvw0Pi1DGbddntOKzYgkbhXJq+Y4bRVqszl746KdRPFV5FxSUb6XmKomd1yCb0nJbpz+aOIZskx0phXx8sHfNKyRjPsM8LGU/xJ9Qrv2JugdVBkBg/ZpUIDvpN0jfHD550XPKNDgkKEZ46l4dwq0sOxIecJlX2pxxA8GTwkCGMFqxVFf5PRZplCky9uCIQL/s/RFabTYZNkhtkQXFR28vKXwKUP5rZbFg+s3VAFTu5dBZG4G07t5tHuM2cFirh2BisrHKYoE8lzO1h/LkwjSD+VZF0qs1hQVK+d0xHOLN80q4B/P9utxQDmGt4DaEKE6Lc5lnI6VxDf/35owQHCAuKw95VG6l1bvXPY3J1slpepPBXdCx8EM+ubbd2tV48b2UtWLtYb89PZhvg2jsq5+zkBdIVVTFHfhEwNv0CxNiT02LKVxGSus1dt9VsXDZulogOJB1AkGQVg4e833uzaWatx7bPrLKyhBeBqlC3xGqNoe3MVQHmDmBs4jm+xFjW/sjcAgOiPOFawwe3bUeTa20vGNZgbV6tCtL/qEL/fmiFLjqCCDpZdQpkdKgx6tSuzlCdqnrMFsLMhWn9sKH4ezmjmvpp9Selw9oCS0Vtcbox4f967yYpc1lNwUzPAUT3N0R32yz0bof5Wblw2jzkuw4VkWFptzoKckHRUwszvHJS8IgkAfys2IvKr/LtZBa1LzvfHBmFD6/V9enLD7LLJD2tz7n3E8BkFcwVyA/DL8P0fCpXAdLntBfy9tQCpuUP2QBAWkwyYccYGYFWWc/HS8Of6pVNf1r8p8n48bn+wPLzm5gyWoneAh3ivzATiiRKljoz8hQTN3S0itSojpnbgvjFod7uBf2Rtsa7dej63gKVRdenkDS2Q9baZyzWY1AZnIBa6yT0juo9eLCWhhOlwxFrCYRVjkKywhfIVrlrLNa3UNngB9RWBQe9mxF1zMGBUFCnRoyUWLBpCStm1SU5sRRFFSeI7HUYtawUeswQzaNk4PKSsmJBL3ERbY4dPD65glIJS5rqxD3kYsThULFbU23ETEuslLobSkuluh1LzKoTkLM0hBH1A1pgJku2CjOVizQ+hUrPP4GQeTkYaS0tarYzCI2HMnusXImyHsZe3dWrxb1U9/CRVaBMggS79TUqJ6yHSSAcdq4Kc9evZUOYUSWsI7LdGpQy7Ul99ZL1qfObT4CedX+zSJGjRBV1NNFGF30MMcYsVugeKLLqDXiNLuQnSQjRvRwtrRzlsSoBxeiSl1SvLVQoF1FcZj0Jqi46odWosl43b1H9Lp2FOAgl7OKibs6cgOICAA==') format('woff2'),
url('iconfont.woff?t=1589437921018') format('woff'), url('iconfont.woff?t=1589437921018') format('woff'),
url('iconfont.ttf?t=1589437921018') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('iconfont.ttf?t=1589437921018') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('iconfont.svg?t=1589437921018#iconfont') format('svg'); /* iOS 4.1- */
url('iconfont.svg?t=1589437921018#iconfont') format('svg'); /* iOS 4.1- */
} }
.iconfont { .iconfont {

@ -4,12 +4,12 @@
2013-9-30: Created. 2013-9-30: Created.
--> -->
<svg> <svg>
<metadata> <metadata>
Created by iconfont Created by iconfont
</metadata> </metadata>
<defs> <defs>
<font id="iconfont" horiz-adv-x="1024" > <font id="iconfont" horiz-adv-x="1024">
<font-face <font-face
font-family="iconfont" font-family="iconfont"
font-weight="500" font-weight="500"
@ -18,45 +18,64 @@ Created by iconfont
ascent="896" ascent="896"
descent="-128" descent="-128"
/> />
<missing-glyph /> <missing-glyph/>
<glyph glyph-name="yigouxuan" unicode="&#58941;" d="M196.923077 896h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z m0-78.769231a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m584.900923-258.205538a36.509538 36.509538 0 0 0 1.260308-51.633231l-299.480616-313.107692c-0.118154-0.157538-0.393846-0.236308-0.630154-0.472616l-0.393846-0.551384c-2.166154-2.126769-4.726154-3.229538-7.207384-4.726154-1.575385-0.866462-2.796308-2.166154-4.411077-2.835692a35.800615 35.800615 0 0 0-27.490462-0.07877c-1.260308 0.512-2.284308 1.614769-3.544615 2.284308-2.756923 1.457231-5.592615 2.835692-8.034462 5.12-0.196923 0.157538-0.275692 0.433231-0.512 0.669538-0.196923 0.118154-0.393846 0.196923-0.551384 0.354462l-150.843077 156.593231a36.430769 36.430769 0 0 0 0.945231 51.633231 36.391385 36.391385 0 0 0 51.63323-0.945231l124.455385-129.102769 273.092923 285.61723a36.548923 36.548923 0 0 0 51.712 1.181539z" horiz-adv-x="1024" /> <glyph glyph-name="yigouxuan" unicode="&#58941;"
d="M196.923077 896h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z m0-78.769231a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m584.900923-258.205538a36.509538 36.509538 0 0 0 1.260308-51.633231l-299.480616-313.107692c-0.118154-0.157538-0.393846-0.236308-0.630154-0.472616l-0.393846-0.551384c-2.166154-2.126769-4.726154-3.229538-7.207384-4.726154-1.575385-0.866462-2.796308-2.166154-4.411077-2.835692a35.800615 35.800615 0 0 0-27.490462-0.07877c-1.260308 0.512-2.284308 1.614769-3.544615 2.284308-2.756923 1.457231-5.592615 2.835692-8.034462 5.12-0.196923 0.157538-0.275692 0.433231-0.512 0.669538-0.196923 0.118154-0.393846 0.196923-0.551384 0.354462l-150.843077 156.593231a36.430769 36.430769 0 0 0 0.945231 51.633231 36.391385 36.391385 0 0 0 51.63323-0.945231l124.455385-129.102769 273.092923 285.61723a36.548923 36.548923 0 0 0 51.712 1.181539z"
horiz-adv-x="1024"/>
<glyph glyph-name="weigouxuan" unicode="&#58942;" d="M196.923077 817.230769a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m0 78.769231h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z" horiz-adv-x="1024" /> <glyph glyph-name="weigouxuan" unicode="&#58942;"
d="M196.923077 817.230769a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m0 78.769231h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z"
horiz-adv-x="1024"/>
<glyph glyph-name="weigouxuan1" unicode="&#58954;" d="M256 768a128 128 0 0 1-128-128v-512a128 128 0 0 1 128-128h512a128 128 0 0 1 128 128V640a128 128 0 0 1-128 128H256z m0 51.2h512a179.2 179.2 0 0 0 179.2-179.2v-512a179.2 179.2 0 0 0-179.2-179.2H256a179.2 179.2 0 0 0-179.2 179.2V640a179.2 179.2 0 0 0 179.2 179.2z" horiz-adv-x="1024" /> <glyph glyph-name="weigouxuan1" unicode="&#58954;"
d="M256 768a128 128 0 0 1-128-128v-512a128 128 0 0 1 128-128h512a128 128 0 0 1 128 128V640a128 128 0 0 1-128 128H256z m0 51.2h512a179.2 179.2 0 0 0 179.2-179.2v-512a179.2 179.2 0 0 0-179.2-179.2H256a179.2 179.2 0 0 0-179.2 179.2V640a179.2 179.2 0 0 0 179.2 179.2z"
horiz-adv-x="1024"/>
<glyph glyph-name="yigouxuan1" unicode="&#58955;" d="M796.912941 598.437647L407.491765 203.294118l-156.611765 172.272941a30.177882 30.177882 0 0 1-44.574118-40.658824L361.411765 161.430588a60.235294 60.235294 0 0 1 85.232941-3.915294l2.409412 2.409412 390.927058 396.348235a30.117647 30.117647 0 1 1-43.068235 42.164706zM813.176471 896H210.823529a210.823529 210.823529 0 0 1-210.823529-210.823529v-602.352942a210.823529 210.823529 0 0 1 210.823529-210.823529h602.352942a210.823529 210.823529 0 0 1 210.823529 210.823529V685.176471a210.823529 210.823529 0 0 1-210.823529 210.823529z m150.588235-813.176471a150.588235 150.588235 0 0 0-150.588235-150.588235H210.823529a150.588235 150.588235 0 0 0-150.588235 150.588235V685.176471a150.588235 150.588235 0 0 0 150.588235 150.588235h602.352942a150.588235 150.588235 0 0 0 150.588235-150.588235z" horiz-adv-x="1024" /> <glyph glyph-name="yigouxuan1" unicode="&#58955;"
d="M796.912941 598.437647L407.491765 203.294118l-156.611765 172.272941a30.177882 30.177882 0 0 1-44.574118-40.658824L361.411765 161.430588a60.235294 60.235294 0 0 1 85.232941-3.915294l2.409412 2.409412 390.927058 396.348235a30.117647 30.117647 0 1 1-43.068235 42.164706zM813.176471 896H210.823529a210.823529 210.823529 0 0 1-210.823529-210.823529v-602.352942a210.823529 210.823529 0 0 1 210.823529-210.823529h602.352942a210.823529 210.823529 0 0 1 210.823529 210.823529V685.176471a210.823529 210.823529 0 0 1-210.823529 210.823529z m150.588235-813.176471a150.588235 150.588235 0 0 0-150.588235-150.588235H210.823529a150.588235 150.588235 0 0 0-150.588235 150.588235V685.176471a150.588235 150.588235 0 0 0 150.588235 150.588235h602.352942a150.588235 150.588235 0 0 0 150.588235-150.588235z"
horiz-adv-x="1024"/>
<glyph glyph-name="shixiangyoujiantou-" unicode="&#58918;" d="M701.44 384L322.56 99.413V668.587L701.44 384z" horiz-adv-x="1024" /> <glyph glyph-name="shixiangyoujiantou-" unicode="&#58918;" d="M701.44 384L322.56 99.413V668.587L701.44 384z" horiz-adv-x="1024"/>
<glyph glyph-name="shixiangxiajiantou-" unicode="&#58917;" d="M512 194.56L227.413 573.44h569.174L512 194.56z" horiz-adv-x="1024" /> <glyph glyph-name="shixiangxiajiantou-" unicode="&#58917;" d="M512 194.56L227.413 573.44h569.174L512 194.56z" horiz-adv-x="1024"/>
<glyph glyph-name="jiahao" unicode="&#59181;" d="M512 864C246.4 864 32 649.6 32 384s214.4-480 480-480 480 214.4 480 480S777.6 864 512 864z m256-512h-224v-224c0-19.2-12.8-32-32-32s-32 12.8-32 32v224H256c-19.2 0-32 12.8-32 32s12.8 32 32 32h224V640c0 19.2 12.8 32 32 32s32-12.8 32-32v-224h224c19.2 0 32-12.8 32-32s-12.8-32-32-32z" horiz-adv-x="1024" /> <glyph glyph-name="jiahao" unicode="&#59181;"
d="M512 864C246.4 864 32 649.6 32 384s214.4-480 480-480 480 214.4 480 480S777.6 864 512 864z m256-512h-224v-224c0-19.2-12.8-32-32-32s-32 12.8-32 32v224H256c-19.2 0-32 12.8-32 32s12.8 32 32 32h224V640c0 19.2 12.8 32 32 32s32-12.8 32-32v-224h224c19.2 0 32-12.8 32-32s-12.8-32-32-32z"
horiz-adv-x="1024"/>
<glyph glyph-name="up" unicode="&#59241;" d="M508.4 445.9l1.8 1.8-1.8-1.8zM508.2 447.9l2.2-2.2c-0.7 0.8-1.4 1.5-2.2 2.2zM511.1 485l1.8-1.8-1.8 1.8zM510.9 483l2.2 2.2c-0.8-0.7-1.5-1.4-2.2-2.2zM544 521.3v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32v336c0 17.6 14.4 32 32 32s32-14.4 32-32zM511.9 614.7c-8.3 0-15.8-3.1-21.5-8.3l-2.2-2.2-21.5-21.5L291 407c-12.4-12.4-12.4-32.8 0-45.3 12.4-12.4 32.8-12.4 45.3 0L512 537.5l175.8-175.7c12.4-12.4 32.8-12.4 45.3 0 12.4 12.4 12.4 32.8-0.1 45.2L557.3 582.7l-21.8 21.8-1.8 1.8c-5.7 5.3-13.4 8.5-21.8 8.4z" horiz-adv-x="1024" /> <glyph glyph-name="up" unicode="&#59241;"
d="M508.4 445.9l1.8 1.8-1.8-1.8zM508.2 447.9l2.2-2.2c-0.7 0.8-1.4 1.5-2.2 2.2zM511.1 485l1.8-1.8-1.8 1.8zM510.9 483l2.2 2.2c-0.8-0.7-1.5-1.4-2.2-2.2zM544 521.3v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32v336c0 17.6 14.4 32 32 32s32-14.4 32-32zM511.9 614.7c-8.3 0-15.8-3.1-21.5-8.3l-2.2-2.2-21.5-21.5L291 407c-12.4-12.4-12.4-32.8 0-45.3 12.4-12.4 32.8-12.4 45.3 0L512 537.5l175.8-175.7c12.4-12.4 32.8-12.4 45.3 0 12.4 12.4 12.4 32.8-0.1 45.2L557.3 582.7l-21.8 21.8-1.8 1.8c-5.7 5.3-13.4 8.5-21.8 8.4z"
horiz-adv-x="1024"/>
<glyph glyph-name="down" unicode="&#59243;" d="M515.6 322.1l-1.8-1.8 1.8 1.8zM515.8 320.1l-2.2 2.2c0.7-0.8 1.4-1.5 2.2-2.2zM512.9 283l-1.8 1.8 1.8-1.8zM513.1 285l-2.2-2.2c0.8 0.7 1.5 1.4 2.2 2.2zM480 246.70000000000005v336c0 17.6 14.4 32 32 32s32-14.4 32-32v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32zM512.1 153.29999999999995c8.3 0 15.8 3.1 21.5 8.3l2.2 2.2 21.5 21.5L733 361c12.4 12.4 12.4 32.8 0 45.3-12.4 12.4-32.8 12.4-45.3 0L512 230.5 336.2 406.2c-12.4 12.4-32.8 12.4-45.3 0-12.4-12.4-12.4-32.8 0.1-45.2l175.7-175.7 21.8-21.8 1.8-1.8c5.7-5.3 13.4-8.5 21.8-8.4z" horiz-adv-x="1024" /> <glyph glyph-name="down" unicode="&#59243;"
d="M515.6 322.1l-1.8-1.8 1.8 1.8zM515.8 320.1l-2.2 2.2c0.7-0.8 1.4-1.5 2.2-2.2zM512.9 283l-1.8 1.8 1.8-1.8zM513.1 285l-2.2-2.2c0.8 0.7 1.5 1.4 2.2 2.2zM480 246.70000000000005v336c0 17.6 14.4 32 32 32s32-14.4 32-32v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32zM512.1 153.29999999999995c8.3 0 15.8 3.1 21.5 8.3l2.2 2.2 21.5 21.5L733 361c12.4 12.4 12.4 32.8 0 45.3-12.4 12.4-32.8 12.4-45.3 0L512 230.5 336.2 406.2c-12.4 12.4-32.8 12.4-45.3 0-12.4-12.4-12.4-32.8 0.1-45.2l175.7-175.7 21.8-21.8 1.8-1.8c5.7-5.3 13.4-8.5 21.8-8.4z"
horiz-adv-x="1024"/>
<glyph glyph-name="delete" unicode="&#59113;" d="M512.019034 896C229.689856 896 0 666.310144 0 383.98096599999997c0-282.306337 229.689856-511.980966 512.019034-511.980966 282.321564 0 512.01142 229.67463 512.01142 511.980966C1024.030454 666.310144 794.340597 896 512.019034 896zM713.257467 174.96921199999997c-0.007613-22.109428-17.92965-40.107599-39.955331-40.107599L352.936215 134.86161200000004c-22.02568 0-39.940104 17.990558-39.940104 40.107599L312.996111 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-318.942208c0-6.70744 5.382702-12.158663 11.991167-12.158663l320.365921 0c6.608465 0 11.991167 5.451223 11.991167 12.158663L685.293303 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275s13.978275-6.273474 13.978275-13.978275L713.249853 174.96921199999997zM431.956104 216.02087700000004L431.956104 493.911419c0 7.704801 6.265861 13.978275 13.970661 13.978275 7.712414 0 13.978275-6.273474 13.978275-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.978275-13.978275C438.229578 202.05021599999998 431.956104 208.31607699999995 431.956104 216.02087700000004zM566.340924 216.02087700000004L566.340924 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.970661-13.978275C572.606785 202.05021599999998 566.340924 208.31607699999995 566.340924 216.02087700000004zM762.059614 549.002268L615.554197 549.002268c-3.730585 0-7.240381 1.454167-9.882244 4.09603l-52.08354 52.08354L471.987569 605.181838l-62.17896-52.844884c-2.497208-2.139377-5.717693-3.334687-9.044766-3.334687L261.978453 549.002268c-7.712414 0-13.978275 6.273474-13.978275 13.978275s6.265861 13.978275 13.978275 13.978275l133.653931 0 62.171347 52.844884c2.535275 2.14699 5.748147 3.327073 9.05238 3.327073l92.518517 0c3.730585 0 7.240381-1.454167 9.882244-4.09603l52.08354-52.08354 140.711589 0c7.712414 0 13.978275-6.265861 13.978275-13.970661C776.037889 555.275742 769.764415 549.002268 762.059614 549.002268z" horiz-adv-x="1025" /> <glyph glyph-name="delete" unicode="&#59113;"
d="M512.019034 896C229.689856 896 0 666.310144 0 383.98096599999997c0-282.306337 229.689856-511.980966 512.019034-511.980966 282.321564 0 512.01142 229.67463 512.01142 511.980966C1024.030454 666.310144 794.340597 896 512.019034 896zM713.257467 174.96921199999997c-0.007613-22.109428-17.92965-40.107599-39.955331-40.107599L352.936215 134.86161200000004c-22.02568 0-39.940104 17.990558-39.940104 40.107599L312.996111 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-318.942208c0-6.70744 5.382702-12.158663 11.991167-12.158663l320.365921 0c6.608465 0 11.991167 5.451223 11.991167 12.158663L685.293303 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275s13.978275-6.273474 13.978275-13.978275L713.249853 174.96921199999997zM431.956104 216.02087700000004L431.956104 493.911419c0 7.704801 6.265861 13.978275 13.970661 13.978275 7.712414 0 13.978275-6.273474 13.978275-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.978275-13.978275C438.229578 202.05021599999998 431.956104 208.31607699999995 431.956104 216.02087700000004zM566.340924 216.02087700000004L566.340924 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.970661-13.978275C572.606785 202.05021599999998 566.340924 208.31607699999995 566.340924 216.02087700000004zM762.059614 549.002268L615.554197 549.002268c-3.730585 0-7.240381 1.454167-9.882244 4.09603l-52.08354 52.08354L471.987569 605.181838l-62.17896-52.844884c-2.497208-2.139377-5.717693-3.334687-9.044766-3.334687L261.978453 549.002268c-7.712414 0-13.978275 6.273474-13.978275 13.978275s6.265861 13.978275 13.978275 13.978275l133.653931 0 62.171347 52.844884c2.535275 2.14699 5.748147 3.327073 9.05238 3.327073l92.518517 0c3.730585 0 7.240381-1.454167 9.882244-4.09603l52.08354-52.08354 140.711589 0c7.712414 0 13.978275-6.265861 13.978275-13.970661C776.037889 555.275742 769.764415 549.002268 762.059614 549.002268z"
horiz-adv-x="1025"/>
<glyph glyph-name="qq" unicode="&#58900;" d="M512-128C229.226667-128 0 101.22666700000002 0 384 0 666.773333 229.226667 896 512 896 794.773333 896 1024 666.773333 1024 384 1024 101.22666700000002 794.773333-128 512-128ZM693.333333 437.333333C689.024 457.365333 682.666667 469.333333 682.666667 469.333333 682.666667 469.333333 682.944 498.666667 650.666667 565.333333 618.389333 632 522.666667 640 522.666667 640L512 640C512 640 416.277333 632 384 565.333333 351.722667 498.666667 352 469.333333 352 469.333333 352 469.333333 345.642667 457.365333 341.333333 437.333333 337.024 417.301333 341.333333 405.333333 341.333333 405.333333 341.333333 405.333333 286.656 349.578667 288 309.33333300000004 289.344 269.08799999999997 299.221333 243.45600000000002 320 266.66666699999996 340.778667 289.877333 341.333333 288 341.333333 288 341.333333 288 340.970667 270.66666699999996 352 256 363.029333 241.33333300000004 373.333333 234.66666699999996 373.333333 234.66666699999996 373.333333 234.66666699999996 317.386667 206.965333 330.666667 170.66666699999996 343.946667 134.36800000000005 384.874667 127.71199999999999 416 128 447.125333 128.288 512 149.33333300000004 512 149.33333300000004L522.666667 149.33333300000004C522.666667 149.33333300000004 587.541333 128.288 618.666667 128 649.792 127.71199999999999 690.72 134.36800000000005 704 170.66666699999996 717.28 206.965333 661.333333 234.66666699999996 661.333333 234.66666699999996 661.333333 234.66666699999996 671.637333 241.33333300000004 682.666667 256 693.696 270.66666699999996 693.333333 288 693.333333 288 693.333333 288 693.888 289.877333 714.666667 266.66666699999996 735.445333 243.45600000000002 745.322667 269.08799999999997 746.666667 309.33333300000004 748.010667 349.578667 693.333333 405.333333 693.333333 405.333333 693.333333 405.333333 697.642667 417.301333 693.333333 437.333333Z" horiz-adv-x="1024" /> <glyph glyph-name="qq" unicode="&#58900;"
d="M512-128C229.226667-128 0 101.22666700000002 0 384 0 666.773333 229.226667 896 512 896 794.773333 896 1024 666.773333 1024 384 1024 101.22666700000002 794.773333-128 512-128ZM693.333333 437.333333C689.024 457.365333 682.666667 469.333333 682.666667 469.333333 682.666667 469.333333 682.944 498.666667 650.666667 565.333333 618.389333 632 522.666667 640 522.666667 640L512 640C512 640 416.277333 632 384 565.333333 351.722667 498.666667 352 469.333333 352 469.333333 352 469.333333 345.642667 457.365333 341.333333 437.333333 337.024 417.301333 341.333333 405.333333 341.333333 405.333333 341.333333 405.333333 286.656 349.578667 288 309.33333300000004 289.344 269.08799999999997 299.221333 243.45600000000002 320 266.66666699999996 340.778667 289.877333 341.333333 288 341.333333 288 341.333333 288 340.970667 270.66666699999996 352 256 363.029333 241.33333300000004 373.333333 234.66666699999996 373.333333 234.66666699999996 373.333333 234.66666699999996 317.386667 206.965333 330.666667 170.66666699999996 343.946667 134.36800000000005 384.874667 127.71199999999999 416 128 447.125333 128.288 512 149.33333300000004 512 149.33333300000004L522.666667 149.33333300000004C522.666667 149.33333300000004 587.541333 128.288 618.666667 128 649.792 127.71199999999999 690.72 134.36800000000005 704 170.66666699999996 717.28 206.965333 661.333333 234.66666699999996 661.333333 234.66666699999996 661.333333 234.66666699999996 671.637333 241.33333300000004 682.666667 256 693.696 270.66666699999996 693.333333 288 693.333333 288 693.333333 288 693.888 289.877333 714.666667 266.66666699999996 735.445333 243.45600000000002 745.322667 269.08799999999997 746.666667 309.33333300000004 748.010667 349.578667 693.333333 405.333333 693.333333 405.333333 693.333333 405.333333 697.642667 417.301333 693.333333 437.333333Z"
horiz-adv-x="1024"/>
<glyph glyph-name="weixin" unicode="&#59018;" d="M512-128C229.2-128 0 101.20000000000005 0 384S229.2 896 512 896s512-229.2 512-512-229.2-512-512-512z m105.6 582.1c-91.1 0-164.9-63.6-164.9-139.3 0-81.5 73.8-145.1 164.9-148.6 25.8 3.5 50.1 8.7 73.3 18.6l45.8-27.9-9.2 46.4c32.6 26.8 54.9 65.4 54.9 111.4 0.1 75.7-73.7 139.4-164.8 139.4z m-54.9-111.4c-17.2 0-27.5 10.4-27.5 27.9 0 8.2 10.3 18.6 27.5 18.6 8.1 0 18.3-10.4 18.3-18.6 0-17.5-10.2-27.9-18.3-27.9z m109.9 0c-8 0-18.3 10.4-18.3 27.9 0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.2-27.9-27.5-27.9z m-55 130c2.5-3.1 5.9-3.4 9.2 0-13.7 77.2-94 139.3-192.4 139.3C328.6 612 242 537.1 242 444.9c0-53 28.3-99.9 73.3-130l-18.3-65 64.1 37.1c25.5-5.2 49.4-9.5 73.3-9.3 4-0.2 6.8 0 9.2 0-3 12-5 24.4-9.2 37.1 4.2 85.6 84 154.8 183.2 157.9z m-109.9 55.7c17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9 0 8.2 10.2 18.6 18.3 18.6z m-174.1-18.5c0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9z" horiz-adv-x="1024" />
<glyph glyph-name="weixin" unicode="&#59018;"
d="M512-128C229.2-128 0 101.20000000000005 0 384S229.2 896 512 896s512-229.2 512-512-229.2-512-512-512z m105.6 582.1c-91.1 0-164.9-63.6-164.9-139.3 0-81.5 73.8-145.1 164.9-148.6 25.8 3.5 50.1 8.7 73.3 18.6l45.8-27.9-9.2 46.4c32.6 26.8 54.9 65.4 54.9 111.4 0.1 75.7-73.7 139.4-164.8 139.4z m-54.9-111.4c-17.2 0-27.5 10.4-27.5 27.9 0 8.2 10.3 18.6 27.5 18.6 8.1 0 18.3-10.4 18.3-18.6 0-17.5-10.2-27.9-18.3-27.9z m109.9 0c-8 0-18.3 10.4-18.3 27.9 0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.2-27.9-27.5-27.9z m-55 130c2.5-3.1 5.9-3.4 9.2 0-13.7 77.2-94 139.3-192.4 139.3C328.6 612 242 537.1 242 444.9c0-53 28.3-99.9 73.3-130l-18.3-65 64.1 37.1c25.5-5.2 49.4-9.5 73.3-9.3 4-0.2 6.8 0 9.2 0-3 12-5 24.4-9.2 37.1 4.2 85.6 84 154.8 183.2 157.9z m-109.9 55.7c17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9 0 8.2 10.2 18.6 18.3 18.6z m-174.1-18.5c0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9z"
horiz-adv-x="1024"/>
</font> </font>
</defs></svg> </defs>
</svg>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@ -1,3 +1,3 @@
[class*=" icon-"], [class^=icon-] { [class*=" icon-"], [class^=icon-] {
font-family: iconfont!important; font-family: iconfont !important;
} }

@ -1,5 +1,6 @@
@import "lib/var"; @import "lib/var";
@import "var"; @import "var";
html, html,
body, body,
#app, #app,

@ -10,15 +10,19 @@
.j-start { .j-start {
justify-content: flex-start; justify-content: flex-start;
} }
.j-end { .j-end {
justify-content: flex-end; justify-content: flex-end;
} }
.j-center { .j-center {
justify-content: center; justify-content: center;
} }
.j-between { .j-between {
justify-content: space-between; justify-content: space-between;
} }
.j-around { .j-around {
justify-content: space-around; justify-content: space-around;
} }

@ -3,10 +3,12 @@
content: ' '; content: ' ';
display: table; display: table;
} }
&:after { &:after {
clear: both; clear: both;
} }
} }
.fl { .fl {
float: left; float: left;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save