ui修改,文章联调

master
yujialong 2 years ago
parent 196a34b1e9
commit 8dd8cdde96
  1. 278
      src/api/index.js
  2. BIN
      src/assets/img/annex.png
  3. BIN
      src/assets/img/arrow-down.png
  4. BIN
      src/assets/img/avg.png
  5. BIN
      src/assets/img/bind.png
  6. BIN
      src/assets/img/bug.png
  7. BIN
      src/assets/img/close.png
  8. BIN
      src/assets/img/content.png
  9. BIN
      src/assets/img/cup.png
  10. BIN
      src/assets/img/date.png
  11. BIN
      src/assets/img/edit.png
  12. BIN
      src/assets/img/func.png
  13. BIN
      src/assets/img/group.png
  14. BIN
      src/assets/img/icon-xiangyou.png
  15. BIN
      src/assets/img/icon-yigouxuan.png
  16. BIN
      src/assets/img/icon_.png
  17. BIN
      src/assets/img/icon_1.png
  18. BIN
      src/assets/img/idcard.png
  19. BIN
      src/assets/img/images/back_02.png
  20. BIN
      src/assets/img/img.jpg
  21. BIN
      src/assets/img/info1.png
  22. BIN
      src/assets/img/info2.png
  23. BIN
      src/assets/img/info3.png
  24. BIN
      src/assets/img/label.png
  25. BIN
      src/assets/img/log-bg.png
  26. BIN
      src/assets/img/log-bg1.png
  27. BIN
      src/assets/img/logo-hh.png
  28. BIN
      src/assets/img/logo.png
  29. BIN
      src/assets/img/none.png
  30. BIN
      src/assets/img/open.png
  31. BIN
      src/assets/img/optimize.png
  32. BIN
      src/assets/img/point.png
  33. BIN
      src/assets/img/report2.png
  34. BIN
      src/assets/img/report3.png
  35. BIN
      src/assets/img/report4.png
  36. BIN
      src/assets/img/report5.png
  37. BIN
      src/assets/img/rocket.png
  38. BIN
      src/assets/img/school.png
  39. BIN
      src/assets/img/search.png
  40. BIN
      src/assets/img/select.png
  41. BIN
      src/assets/img/site-active.png
  42. BIN
      src/assets/img/site.png
  43. BIN
      src/assets/img/station-bg.png
  44. BIN
      src/assets/img/station1.png
  45. BIN
      src/assets/img/station2.png
  46. BIN
      src/assets/img/student1.png
  47. BIN
      src/assets/img/student2.png
  48. BIN
      src/assets/img/student3.png
  49. BIN
      src/assets/img/student4.png
  50. BIN
      src/assets/img/total.png
  51. BIN
      src/assets/img/trash.png
  52. BIN
      src/assets/img/upload.png
  53. BIN
      src/assets/img/user.png
  54. 47
      src/const/column.js
  55. 93
      src/layouts/header/index.vue
  56. 223
      src/layouts/home/index.vue
  57. 234
      src/layouts/navbar/index.vue
  58. 69
      src/pages/account/login/index.vue
  59. 529
      src/pages/article/add/index.vue
  60. 206
      src/pages/article/list/index.vue
  61. 445
      src/pages/assessment/list/index.vue
  62. 513
      src/pages/column/add/index.vue
  63. 158
      src/pages/column/list/index.vue
  64. 0
      src/pages/page/add/index.vue
  65. 90
      src/pages/page/list/index.vue
  66. 714
      src/pages/project/add/index.vue
  67. 436
      src/pages/project/list/index.vue
  68. 271
      src/pages/role/list/index.vue
  69. 86
      src/pages/site/list/index.vue
  70. 48
      src/pages/user/list/index.vue
  71. 11
      src/plugins/requests/index.js
  72. 29
      src/router/modules/article.js
  73. 29
      src/router/modules/assesment.js
  74. 29
      src/router/modules/column.js
  75. 29
      src/router/modules/page.js
  76. 23
      src/router/modules/role.js
  77. 12
      src/router/modules/setting.js
  78. 23
      src/router/modules/site.js
  79. 10
      src/router/modules/user.js
  80. 11
      src/setting.js
  81. 110
      src/store/modules/user.js
  82. 4
      src/styles/common.scss
  83. 2
      src/styles/default/index.scss
  84. 2
      src/styles/layout/index.scss
  85. 2
      src/styles/var.scss

@ -1,263 +1,25 @@
import Setting from "@/setting";
const host = Setting.apiBaseURL
const uploadURL = Setting.upload.apiURL;
const host1 = "http://121.37.12.51:8080/"
const host1 = 'http://192.168.31.151:10000/'
export default {
queryToken: `liuwanr/userInfo/queryToken`,
logins: `users/users/user/login`, //登录
verification: `${host}users/users/user/captcha`,// 验证码图片
isClient: `users/users/user/isClient`,// 是否为客户
getUserAllRoleByToken : `users/users/role/getUserAllRoleByToken`,
getSchoolIdByToken : `users/users/data/user/getSchoolIdByToken`,
platformLogList: `nakadai/nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`,
//实验台
curriculumDetail: `nakadai/nakadai/curriculum/curriculumDetail`, // 课程详情
curriculumChapter: `nakadai/nakadai/curriculum/chapter/queryChaptersAndSubsections`, // 根据课程id查询章节小节,树状结构
curriculumGetSubsection: `nakadai/nakadai/curriculum/subsection/getSubsection`, // 根据小节id获取预览文件地址
// 权限管理
getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`,
//学生管理
resetPassword: `users/users/userAccount/resetPwd`, // 密码重置
updateAccountEnable: `occupationlab/occupationlab/architecture/updateAccountEnable`, // 密码重置
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`, // 新增学生前:校验手机号或者邮箱
checkWorkNumOrAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
delStudent: `occupationlab/occupationlab/architecture/delStudent`, // 单个、批量删除学生
addStudent: `occupationlab/occupationlab/architecture/addStudent`, // 新增学生
modifyStudent: `occupationlab/occupationlab/architecture/modifyStudent`, // 编辑学生
getStudentInfoByAccountId: `occupationlab/occupationlab/architecture/getStudentInfoByAccountId`, // 查看学生信息
getDetailByAccount: `occupationlab/occupationlab/architecture/getDetailByAccount`, // 新增用户前调用:按帐户获取详细信息
importStudent: `${host}occupationlab/occupationlab/architecture/importStudent`, // 批量导入学生
exportFailure: `${host}occupationlab/occupationlab/architecture/exportFailure`, // 批量导入学生失败数据导出
removeStudent: `occupationlab/occupationlab/architecture/removeStudent`, // 移除学生
organizationalStudentList: `occupationlab/occupationlab/architecture/organizationalStudentList`, // 根据组织架构筛选学生列表
studentList: `occupationlab/occupationlab/architecture/studentList`, // 学生列表
stuOrganizationTree: `occupationlab/occupationlab/architecture/stuOrganizationTree`, // 学生组织架构树
treeList: `occupationlab/occupationlab/architecture/treeList`, // 学生组织架构树形列表
saveOrg: `occupationlab/occupationlab/architecture/save`, // 新增组织架构
updateOrg: `occupationlab/occupationlab/architecture/update`, // 编辑组织架构
deleteOrg: `occupationlab/occupationlab/architecture/delete`, // 删除组织架构
studentTemplate: `http://121.37.12.51/template/学生导入模板.xlsx`, // 学生导入模板
// 测评管理
questionsList: `occupationlab/occupationlab/questions/list`, // 题库列表查询
questionsSave: `occupationlab/occupationlab/questions/save`, // 新增题目
questionsUpdate: `occupationlab/occupationlab/questions/update`, // 根据试题id修改试题信息
questionsDetail: `occupationlab/occupationlab/questions/detail`, // 查看当前题库信息
questionsDelete: `occupationlab/occupationlab/questions/delete`, // 根据主键删除
questionsIsDisable: `occupationlab/occupationlab/questions/isDisable`, // 是否禁用试题
questionsTemplate: `http://121.37.12.51/template/试题导入模板.xlsx`, //excel模板文件下载
questionsImport: `${host}occupationlab/occupationlab/questions/importQuestion`, // 批量导入题库
questionsExportFailure: `${host}occupationlab/occupationlab/questions/exportFailure`, // 批量导入题库失败数据导出
questionsInfo: `occupationlab/occupationlab/questions/info`, // 测评规则信息的展示
questionsUpdateRules: `occupationlab/occupationlab/questions/updateEvaluationRules`, // 修改测评规则信息
// 考核管理
pageByCondition: `occupationlab/occupationlab/assessment/pageByCondition`, // 考核管理列表
saveAssessment: `occupationlab/occupationlab/assessment/saveAssessment`, // 创建考核
modifyAssessment: `occupationlab/occupationlab/assessment/modifyAssessment`, // 编辑考核
enableAssessment: `occupationlab/occupationlab/assessment/enableAssessment`, // 修改考核状态
getDetailById: `occupationlab/occupationlab/assessment/getDetailById`, // 根据考核Id查询考核详情
deleteAssessment: `occupationlab/occupationlab/assessment/deleteAssessment`, // 单个、批量删除
collectPaper: `occupationlab/occupationlab/assessment/collectPaper`, // 收卷(提前结束)
schoolCourse: `nakadai/nakadai/curriculum/schoolCourse`, // 获取学校购买订单后的课程
projectListByCourseId: `occupationlab/occupationlab/projectManage/getSchoolProjectByAssessent`, // 根据课程id获取实训项目列表
// 成绩管理
deleteExperimentalReport: `occupationlab/occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告
exportAssessmentInfo: `${host}occupationlab/occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
exportPracticeInfo: `${host}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
getAchievementInfo: `occupationlab/occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理
getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情
getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
myClass: `occupationlab/occupationlab/achievement/myClass`, // 教师端:我的班级
deleteReportById: `occupationlab/occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核
reportDetail: `occupationlab/occupationlab/achievement/reportDetail`, // 查看实验报告
schoolCourseByAchievement: `nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程
spliceClass: `occupationlab/occupationlab/achievement/spliceClass`,
// 项目管理
getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统
avgValues: `occupationlab/occupationlab/projectManage/avgValues`, // 平均分分配值
deleteProjectManage: `occupationlab/occupationlab/projectManage/deleteProjectManage`, // 新增项目管理
getProjectBySystemId: `occupationlab/occupationlab/projectManage/getProjectBySystemId`, // 根据系统id获取全部项目(项目中没有用上这个接口)
queryNameIsExist: `occupationlab/occupationlab/projectManage/queryNameIsExist`, // 新增/编辑项目管理名称判重
queryProjectManage: `occupationlab/occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选)
updateIsOpen: `occupationlab/occupationlab/projectManage/updateIsOpen`, // 更新开启状态
getProjectDetail: `occupationlab/occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情
saveProjectDraft: `occupationlab/occupationlab/projectManage/saveProjectDraft`, // 新增项目管理
addProjectManage: `occupationlab/occupationlab/projectManage/addProjectManage`, // 新增项目管理
updateProjectManage: `occupationlab/occupationlab/projectManage/updateProjectManage`, // 修改项目管理
editProjectDraft: `occupationlab/occupationlab/projectManage/editProjectDraft`, // 修改项目管理
copyProjectManage: `occupationlab/occupationlab/projectManage/copyProjectManage`, // 复制项目管理
// 判分点
getBcJudgmentPoint: `judgment/judgment/bcJudgmentPoint/getTeacherJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `judgment/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
addProjectJudgment: `occupationlab/occupationlab/projectJudgment/addProjectJudgment`, // 添加项目管理、判分点中间表
updateProjectJudgment: `occupationlab/occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `occupationlab/occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
// 赛事
contestPageConditionQueryByOccupationlab: `occupationlab/occupationlab/enterprise/match/contest/contestPageConditionQueryByOccupationlab`,
addContest: `occupationlab/occupationlab/enterprise/match/contest/addContest`,
editContest: `occupationlab/occupationlab/enterprise/match/contest/editContest`,
deleteContest: `occupationlab/occupationlab/enterprise/match/contest/deleteContest`,
getContest: `occupationlab/occupationlab/enterprise/match/contest/getContest`,
deleteAnnex: `occupationlab/occupationlab/contest/annex/delete`,
saveAnnex: `occupationlab/occupationlab/contest/annex/save`,
getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`,
disabledEvents: `occupationlab/occupationlab/enterprise/match/contest/disabledEvents`,
batchDeleteContest: `occupationlab/occupationlab/enterprise/match/contest/batchDeleteContest`,
// 竞赛进展
addContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/addContestProgress`,
deleteContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/deleteContestProgress`,
getContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/getContestProgress`,
editContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/editContestProgress`,
// 报名人员
addApplicant: `occupationlab/occupationlab/enterprise/match/applicant/addApplicant`,
disableContests: `occupationlab/occupationlab/enterprise/match/applicant/disableContests`,
excelExport: `${host}occupationlab/occupationlab/enterprise/match/applicant/excelExport`,
queryApplicantByCondition: `occupationlab/occupationlab/enterprise/match/applicant/queryApplicantByCondition`,
disableApplicant: `occupationlab/occupationlab/enterprise/match/applicant/disableApplicant`,
exportDataInBatches: `${host}occupationlab/occupationlab/enterprise/match/applicant/exportDataInBatches`,
// 赛事公告
addAnnouncement: `occupationlab/occupationlab/contest/announcement/addAnnouncement`,
amendmentAnnouncement: `occupationlab/occupationlab/contest/announcement/amendmentAnnouncement`,
deleteAnnouncement: `occupationlab/occupationlab/contest/announcement/deleteAnnouncement`,
disableAnnouncement: `occupationlab/occupationlab/contest/announcement/disableAnnouncement`,
queryAnnouncementByContestId: `occupationlab/occupationlab/contest/announcement/queryAnnouncementByContestId`,
queryAnnouncementDetails: `occupationlab/occupationlab/contest/announcement/queryAnnouncementDetails`,
deleteAnnouncementAnnex: `occupationlab/occupationlab/contestAnnouncementAnnex/delete`,
saveAnnouncementAnnex: `occupationlab/occupationlab/contestAnnouncementAnnex/save`,
// 栏目管理
addColumn: `occupationlab/occupationlab/enterprise/information/column/addColumn`,
deleteColumn: `occupationlab/occupationlab/enterprise/information/column/deleteColumn`,
editColumn: `occupationlab/occupationlab/enterprise/information/column/editColumn`,
queryAllColumns: `occupationlab/occupationlab/enterprise/information/column/queryAllColumns`,
columnReorder: `occupationlab/occupationlab/enterprise/information/column/reorder`,
// 内容管理
addArticle: `occupationlab/occupationlab/enterprise/information/article/addArticle`,
deleteArticles: `occupationlab/occupationlab/enterprise/information/article/deleteArticles`,
editArticle: `occupationlab/occupationlab/enterprise/information/article/editArticle`,
enableArticle: `occupationlab/occupationlab/enterprise/information/article/enableArticle`,
getArticle: `occupationlab/occupationlab/enterprise/information/article/getArticle`,
getArticles: `occupationlab/occupationlab/enterprise/information/article/getArticles`,
queryArticleByCondition: `occupationlab/occupationlab/enterprise/information/article/queryArticleByCondition`,
articleSort: `occupationlab/occupationlab/enterprise/information/article/articleSort`,
// 课程管理
queryCourseByCondition: `occupationlab/occupationlab/management/edu/course/queryCourseByCondition`, // 课程列表分页条件查询
addCourse: `occupationlab/occupationlab/management/edu/course/addCourse`, // 添加课程
deleteCourse: `occupationlab/occupationlab/management/edu/course/deleteCourse`, // 根据id删除课程
deleteCourses: `occupationlab/occupationlab/management/edu/course/deleteCourses`, // 批量删除课程
editCourse: `occupationlab/occupationlab/management/edu/course/editCourse`, // 修改课程
enableCourse: `occupationlab/occupationlab/management/schoolCourse/enableGlCourse`, // 是否启用管理端课程
getCourse: `occupationlab/occupationlab/management/edu/course/getCourse`, // 根据id查询课程
// 分类管理
queryGlClassification: `occupationlab/occupationlab/management/edu/courseClassification/queryGlClassification`,
deleteClassification: `occupationlab/occupationlab/management/edu/courseClassification/deleteClassification`,
addClassification: `occupationlab/occupationlab/management/edu/courseClassification/addClassification`,
editClassification: `occupationlab/occupationlab/management/edu/courseClassification/editClassification`,
// 课程章节管理
addChapter: `occupationlab/occupationlab/management/edu/courseChapter/addChapter`,
chapterReorder: `occupationlab/occupationlab/management/edu/courseChapter/chapterReorder`,
deleteChapter: `occupationlab/occupationlab/management/edu/courseChapter/deleteChapter`,
editChapter: `occupationlab/occupationlab/management/edu/courseChapter/editChapter`,
queryChaptersAndSubsections: `occupationlab/occupationlab/management/edu/courseChapter/queryChaptersAndSubsections`,
reorder: `occupationlab/occupationlab/management/edu/courseChapter/reorder`,
// 课程小节管理
addSubsection: `occupationlab/occupationlab/management/edu/courseSubsection/addSubsection`, // 添加小节
deleteSubsection: `occupationlab/occupationlab/management/edu/courseSubsection/deleteSubsection`, // 根据id删除小节
editSubsection: `occupationlab/occupationlab/management/edu/courseSubsection/editSubsection`, // 修改小节
getSubsection: `occupationlab/occupationlab/management/edu/courseSubsection/getSubsection`, // 根据小节id获取预览文件地址
// 阿里云文件/视频管理
fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件
fileupload: `${uploadURL}oss/manage/fileupload`, // 文件上传
getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证
removeMoreVideo: `${uploadURL}oss/manage/removeMoreVideo`, // 批量删除视频文件
removeVideo: `${uploadURL}oss/manage/removeVideo`, // 删除视频文件
queryProvince: `nakadai/nakadai/province/queryProvince`, //查询省份
queryCity: `nakadai/nakadai/city/queryCity`, //查询城市
querySchoolData: `nakadai/nakadai/school/querySchool`, //根据学校名称查询学校信息
queryCourseDiscipline: `nakadai/nakadai/subject/courseDiscipline`, //查询课程学科
queryCourseProfessionalClass: `nakadai/nakadai/subject/courseProfessionalClass`, //查询专业类
queryCourseProfessional: `nakadai/nakadai/subject/courseProfessional`, //查询专业
// 个人中心
uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`, //更改头像
queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`,//个人中心信息展示
updatePersonCenter: `users/users/userAccount/updatePersonCenter`,//个人中心信息修改
examinePassword: `users/users/userAccount/examinePassword`,//更换密码
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
// 系统设置
// 员工组织架构
professionalList: `occupationlab/occupationlab/staff/professionalList`, //查询专业列表
staffGradeList: `occupationlab/occupationlab/staff/staffGradeList`, //根据专业id查询年级
saveProfessional: `occupationlab/occupationlab/staff/saveProfessional`, //新增专业
updateProfessional: `occupationlab/occupationlab/staff/updateProfessional`, //编辑专业
deleteProfessional: `occupationlab/occupationlab/staff/deleteProfessional`, //删除专业
saveGrade: `occupationlab/occupationlab/staff/saveGrade`, //新增年级
updateGrade: `occupationlab/occupationlab/staff/updateGrade`, //编辑年级
deleteGrade: `occupationlab/occupationlab/staff/deleteGrade`, //删除年级
// 员工管理
saveStaff: `occupationlab/occupationlab/staff/saveStaff`, //新增员工
staffDetail: `occupationlab/occupationlab/staff/staffDetail`, //员工详情
modifyStaff: `occupationlab/occupationlab/staff/modifyStaff`, //编辑员工
delStaff: `occupationlab/occupationlab/staff/delStaff`, //删除员工
staffList: `occupationlab/occupationlab/staff/staffList`, //员工列表
staffTemplate: `http://121.37.12.51/template/员工用户导入模板.xlsx`, //员工用户导入模板
exportFailureStaff: `${host}occupationlab/occupationlab/staff/exportFailure`, //批量导入员工失败数据导出
importStaff: `${host}occupationlab/occupationlab/staff/importStaff`, //批量导入员工
// 角色管理
batchRemove: `users/users/role/batchRemove`, //批量删除角色
checkRoleIsExist: `users/users/role/checkRoleIsExist`, //判断该角色是否存在
delRoleByAccountId: `users/users/role/delRoleByAccountId`, //删除某用户下的某个角色
roleList: `users/users/role/list`, //角色分页列表查询
obtainDetails: `users/users/role/obtainDetails`, //获取角色详情
saveOrUpdate: `users/users/role/saveOrUpdate`, //新增或更新角色
queryAllMenus: `users/users/permission/queryAllMenus`, //查询所有菜单
// 系统logo设置
logoDetail: `occupationlab/occupationlab/sys/logo/detail`, //查看系统设置信息
logoSave: `occupationlab/occupationlab/sys/logo/save`, //新增系统设置信息
logoUpdate: `occupationlab/occupationlab/sys/logo/update`, //编辑系统设置信息
// 教师评语
addComment: `evaluation/cevaluation/comment/addComment`,
queryComment: `evaluation/evaluation/ccomment/queryComment`,
updateComment: `evaluation/evaluation/ccomment/updateComment`,
// 老师签名照
daleteSignature: `evaluation/evaluation/csignature/daleteSignature`,
querySignature: `evaluation/evaluation/csignature/querySignature`,
uploadSignature: `evaluation/evaluation/csignature/uploadSignature`,
// 判分点
queryListTrading: `judgment/judgment/tradingJudgmentPoints/query`,
queryDetailsTrading: `judgment/judgment/tradingJudgmentPoints/queryDetails`,
// 科大
queryPoint: `kdSys/queryPoint`,
querySubject: `kdSys/querySubject`,
queryItem: `kdSys/queryItem`,
// 川大
firstLevel: `${host1}sichuan/point/firstLevel`,
secondaryLevel: `${host1}sichuan/point/secondaryLevel`,
thirdLevel: `${host1}sichuan/point/thirdLevel`
};
logins: `iasf/sys/user/login`,
verification: `${host}iasf/sys/getVerify`,
dept: `iasf/sys/dept`,
deptTree: `iasf/sys/dept/tree`,
deptId: `iasf/sys/dept`,
depts: `iasf/sys/depts`,
listWithTree: `${host1}iasf/sysColumn/listWithTree`,
saveColumn: `${host1}iasf/sysColumn/save`,
updateColumn: `${host1}iasf/sysColumn/update`,
findColumn: `${host1}iasf/sysColumn/findById`,
deleteColumn: `${host1}iasf/sysColumn/delete`,
sameLevelJudgment: `${host1}iasf/sysColumn/sameLevelJudgment`,
checkIfTheTitleIsRepeat: `${host1}iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `${host1}iasf/sysContent/delete`,
findArticle: `${host1}iasf/sysContent/findById`,
queryArticle: `${host1}iasf/sysContent/pagingQuery`,
saveArticle: `${host1}iasf/sysContent/save`,
updateArticle: `${host1}iasf/sysContent/update`,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

@ -0,0 +1,47 @@
/**
* 栏目配置
* */
export default {
// 栏目类型
types: [
{
id: 1,
name: '常规栏目'
},
{
id: 2,
name: '跳转链接'
},
{
id: 3,
name: '长页栏目'
},
{
id: 4,
name: '子级优先栏目'
}
],
// 栏目模板
templates: [
{
id: 1,
name: '文章'
},
{
id: 2,
name: '文库'
},
],
// 站点
sites: [
{
id: 1,
name: 'EFL中文'
},
{
id: 2,
name: 'SRL中文'
},
],
}

@ -1,40 +1,20 @@
<template>
<div class="header">
<div style="line-height: 60px">
<img class="logo" :src="logoUrl" />
<span class="title">{{ title }}</span>
<div class="group">
<img src="@/assets/img/group.png">
<span>站点管理</span>
</div>
<div class="action">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="m-l-10">{{ customerName || userName }}</span>
<span class="username">{{userName}}</span>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="!customerName" command="person">个人中心</el-dropdown-item>
<el-dropdown-item v-else command="resetPw">修改密码</el-dropdown-item>
<el-dropdown-item command="person">个人资料</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
</div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="resetPassword" width="30%">
<el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="submitPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button>
<el-button type="primary" @click="submitPassword"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -44,29 +24,24 @@ import util from "@/libs/util";
export default {
data() {
return {
passwordVisible: false,
passwordForm: {
password: "",
newPassword: "",
reNewPassword: ""
}
};
},
computed: {
...mapState("user", [
"avatar", "userName", "title", "logoUrl", "customer", "customerName", 'fromClient'
"avatar", "userName"
])
},
mounted() {
this.getSystemDetail();
this.getUserDetail();
// this.getSystemDetail();
// this.getUserDetail();
},
methods: {
...mapMutations("user", [
'SET_SCHOOLID'
]),
...mapActions("user", [
"setTitle", "setLogoUrl", "setAvatar", "setUserName", 'logout'
'logout'
]),
getSystemDetail() { // logo
this.$get(this.api.logoDetail).then(res => {
@ -101,7 +76,7 @@ export default {
if (command == "person") {
this.$router.push("/setting/person");
} else {
this.passwordVisible = true;
this.logout()
}
},
resetPassword() { //
@ -130,48 +105,36 @@ export default {
<style lang="scss" scoped>
.header {
position: relative;
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 16px;
height: 64px;
padding: 0 25px;
color: #333;
background-color: #fff;
.logo {
height: 50px;
margin: 0 20px;
box-shadow: 0px 1px 4px 0px rgba(0,21,41,0.1200);
.group {
display: inline-flex;
align-items: center;
span {
margin-left: 13px ;
font-size: 14px;
color: #333;
}
.title {
font-size: 18px;
font-weight: bold;
}
.action {
.user-wrap {
display: flex;
padding-right: 50px;
align-items: center;
.user{
display: inline-flex;
align-items: center;
cursor: pointer;
span {
font-size: 12px;
}
}
.el-button--text {
margin-left: 20px;
color: #333;
.username{
margin-left: 10px;
color: #000;
font-size: 16px;
}
.el-divider {
width: 2px;
height: 15px;
margin-left: 20px;
background-color: #333;
}
}
}

@ -1,235 +1,54 @@
<template>
<div class="main">
<v-head></v-head>
<v-navbar class="nav"></v-navbar>
<div class="layout">
<navbar></navbar>
<v-head></v-head>
<div class="content">
<transition name="move" mode="out-in">
<router-view class="view"></router-view>
</transition>
<el-backtop target=".content"></el-backtop>
</div>
<v-footer ref="footer"></v-footer>
<div class="log-mask" v-if="logVisible"></div>
<div class="log-dia" v-if="logVisible">
<img class="bg1" src="@/assets/img/log-bg.png" alt="">
<img class="bg2" src="@/assets/img/log-bg1.png" alt="">
<p class="log-title">更新日志</p>
<div class="log-wrap">
<div class="logs">
<div class="item" v-for="(item, i) in list" :key="i" v-show="!i || (i && logAll)">
<h6>{{ item.versionName }}</h6>
<img v-if="item.coverUrl" :src="item.coverUrl" alt="" class="cover">
<ul class="detail">
<li v-for="(item, i) in item.logContents" :key="i">
<p class="name"><img :src="require('@/assets/img/' + funcList.find(e => e.id === item.type).icon + '.png')" alt=""> {{ funcList.find(e => e.id === item.type).name }}</p>
<div class="val">
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p>
</div>
</li>
</ul>
</div>
</div>
<div class="more-wrap">
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import vHead from "../header";
import navbar from "../navbar";
import vFooter from "../footer";
import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util";
import Setting from "@/setting";
import vHead from '../header/index.vue'
import vNavbar from '../navbar/index.vue'
import vFooter from '../footer'
export default {
data() {
return {
logVisible: false,
list: [],
logAll: false,
funcList: [
{
id: 0,
name: '新功能',
icon: 'func'
},
{
id: 1,
name: '修复',
icon: 'bug'
},
{
id: 2,
name: '优化',
icon: 'optimize'
}
]
};
},
components: {
vHead,
navbar,
vNavbar,
vFooter
},
computed: {
...mapState("user", [
'logView'
])
},
mounted() {
this.autoLogout();
this.logView || this.getLogStatus() // logViewfalse
},
methods: {
...mapMutations("user", [
'SET_LOG'
]),
...mapActions("user", [
"logout"
]),
//
getLog() {
this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => {
logList.map((e, i) => {
e.logContents.map(n => {
n.content = n.content.split('\n')
})
})
this.list = logList
}).catch(res => {})
},
//
getLogStatus() {
util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, {
platformId: Setting.platformId
}).then(({ notification }) => {
this.SET_LOG() // true
if (notification) {
this.logVisible = true // true
this.getLog()
}
}).catch(res => {})
},
// ,退
autoLogout() {
let lastTime = new Date().getTime();
document.onmousedown = () => {
lastTime = new Date().getTime();
};
setInterval(() => {
if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
util.errorMsg("用户登录过期,请重新登录");
setTimeout(this.logout, 1500);
}
}, 1000);
}
}
};
</script>
<style lang="scss" scoped>
.main{
min-height: 100%;
display: flex;
min-width: 1300px;
height: 100%;
overflow: hidden;
.nav{
width: 256px;
}
.layout{
width: calc(100% - 256px);
.content{
min-height: calc(100vh - 176px);
padding: 24px 24px;
}
}.log-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .4);
}
/deep/.log-dia {
z-index: 11;
position: absolute;
top: 250px;
left: 50%;
width: 550px;
transform: translateX(-50%);
background-color: #fff;
border-radius: 6px;
.bg1 {
width: 100%;
height: 140px;
}
.bg2 {
position: absolute;
top: -130px;
left: 48px;
max-width: 100%;
height: 250px;
}
.log-title {
position: absolute;
top: 65px;
left: 0;
width: 100%;
text-align: center;
font-size: 22px;
color: #fff;
font-weight: 600;
}
.log-wrap {
padding-bottom: 30px;
}
.logs {
max-height: 250px;
padding: 0 100px;
margin: 30px 0;
height: calc(100vh - 80px);
padding: 24px 24px 0;
overflow: auto;
}
h6 {
margin-bottom: 15px;
font-size: 16px;
color: #333;
line-height: 1;
}
.more-wrap {
padding: 0 60px;
font-size: 14px;
color: #333;
text-align: center;
}
.know {
margin-top: 15px;
}
.cover {
max-width: 250px;
max-height: 160px;
margin: 10px 0 20px;
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 14px;
img {
width: 20px;
margin-right: 8px;
}
}
.val {
font-size: 15px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
font-size: 13px;
color: #727272;
.view{
min-height: calc(100% - 60px);
}
}
}

@ -1,11 +1,24 @@
<template>
<div>
<el-menu class="sidebar-el-menu" :default-active="active" background-color="#324157" text-color="#bfcbd9" active-text-color="#9278FF" unique-opened mode="horizontal" router>
<div v-show="!collapse" class="flex-1">
<div class="logo">
<img src="@/assets/img/logo.png" alt="">
<span>粒子研究院中文站点</span>
</div>
<el-menu
:default-active="active"
background-color="#001529"
text-color="#fff"
active-text-color="#fff"
:collapse="collapse"
:collapse-transition="false"
@select="menuSelect"
>
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<img class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
@ -19,13 +32,58 @@
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<img class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
<div v-show="collapse" class="light">
<div class="col-wrap">
<img class="logo-icon" src="@/assets/img/logo.png" alt="">
<ul class="col-nav">
<li v-for="(item, i) in colNav" :key="i" @click="menuSelect(item.index)">
<img :src="require('@/assets/img/' + item.icon + '.png')" alt="">
</li>
</ul>
</div>
<div>
<div class="name">粒子研究院中文站点</div>
<el-menu
:default-active="siteActive"
background-color="#fff"
text-color="#333"
active-text-color="#fff"
router
>
<template v-for="item in sites">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<img class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
<template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<img class="icon" :src="require('@/assets/img/' + item.icon + '.png')" alt="">
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</div>
</div>
</template>
<script>
@ -35,25 +93,76 @@ import addRoutes from '@/libs/route/addRoutes'
export default {
data() {
return {
collapse: false,
active: this.$route.path,
defaultMenus: [
siteActive: '/page/list',
reloadSite: true,
menus: [
{
icon: 'site',
index: '/site/list',
title: '站点管理'
},
{
icon: 'user',
index: 'user',
title: '用户管理',
subs: [
{
icon: "el-icon-user",
index: "/student/list",
title: "学生管理"
index: '/user/list',
title: '组织与账号管理'
},
{
icon: "el-icon-takeaway-box",
index: "/assessment/list",
title: "考核管理"
index: '/role/list',
title: '角色管理'
},
{
icon: "el-icon-setting",
index: "/system/list",
title: "系统设置"
index: '/userGroup/list',
title: '用户组管理'
}
]
},
{
icon: 'annex',
index: '/annex',
title: '附件管理'
}
],
colNav: [
{
index: '/site/list',
icon: 'site-active'
},
{
index: 'user',
icon: 'user'
},
{
index: '/annex/list',
icon: 'annex'
}
],
sites: [
{
icon: 'content',
index: 'content',
title: '内容管理',
subs: [
{
index: '/page/list',
title: '页面管理'
},
{
index: '/column/list',
title: '栏目管理'
},
{
index: '/article/list',
title: '文章管理'
}
]
}
],
menus: [],
actives: {
dashboard: ["add"],
achievement: ["experiment", "experimentVir", "experimentTeach", "addexperiment", "addexperimentoptions", "showExperiment", "showExperimentoption", "showExperimentoptions"],
@ -75,16 +184,39 @@ export default {
}
let arr=this.$route.path.split("/");
let name = `/${arr[1]}/list`
this.active = name;
this.active = name
const { path } = this.$route
console.log("🚀 ~ file: index.vue ~ line 167 ~ path", this.sites[0].subs.find(e => e.index === path))
this.collapse = !!this.sites[0].subs.find(e => e.index === path)
}
},
created() {
this.getPer()
this.collapse = !!this.sites[0].subs.find(e => e.index === this.$route.path)
// this.getPer()
},
methods: {
...mapActions('user', [
'logout'
]),
//
menuSelect(index) {
console.log("🚀 ~ file: index.vue ~ line 180 ~ menuSelect ~ index", index)
this.collapse = false
if (index.includes('/')) {
this.$router.push(index)
// if (this.collapse) {
// this.reloadSite = false
// this.siteActive = '/page/list'
// this.$nextTick(() => {
// this.reloadSite = true
// })
// this.$router.push('/page')
// }
} else {
}
},
//
getPer() {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
@ -113,18 +245,76 @@ export default {
</script>
<style lang="scss" scoped>
.nav{
height: 100%;
background-color: #001529;
box-shadow: 2px 0px 6px 0px rgba(92,111,130,0.3500);
overflow: auto;
.logo {
display: flex;
align-items: center;
padding-left: 28px;
margin: 15px 0 26px;
font-size: 16px;
color: #fff;
img {
margin-right: 8px;
}
}
/deep/.el-menu{
border-right: 0 !important;
.icon{
margin: 0 11px 0 5px;
}
.el-menu-item{
&.is-active{
background-color: #2962FF !important;
}
}
.el-menu .el-menu-item {
padding-left: 50px !important;
}
}
.light {
display: flex;
height: 100%;
background-color: #fff;
.col-wrap {
width: 64px;
background-color: #001529;
}
.logo-icon {
width: 41px;
margin: 16px 0 30px 7px;
}
.col-nav {
text-align: center;
li {
padding: 25px 0;
cursor: pointer;
}
}
.name {
margin: 17px 0 27px 15px;
font-size: 14px;
color: #333;
line-height: 32px;
}
/deep/.el-submenu__title {
padding-left: 14px !important;
}
.icon {
margin-left: 0;
}
}
}
.sidebar::-webkit-scrollbar {
width: 0;
}
.sidebar-el-menu:not(.el-menu--collapse) {
width: 100%;
}
.el-menu.el-menu--horizontal {
border-bottom: none;
}
.sidebar > ul {
height: 100%;
}

@ -6,11 +6,11 @@
<el-tab-pane label="账号登录" name="1"></el-tab-pane>
<el-tab-pane label="手机号/邮箱登录" name="2"></el-tab-pane>
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" style="margin-top: 20px">
<el-form-item v-if="activeName === '1'" prop="account">
<el-input v-model.trim="loginForm.account" placeholder="请输入账号"></el-input>
<el-form-item v-if="activeName === '1'" prop="username">
<el-input v-model.trim="loginForm.username" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item v-if="activeName === '2'" prop="account">
<el-input v-model.trim="loginForm.account" placeholder="请输入手机号/邮箱"></el-input>
<el-form-item v-if="activeName === '2'" prop="username">
<el-input v-model.trim="loginForm.username" placeholder="请输入手机号/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
@ -20,10 +20,10 @@
>
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-form-item prop="captcha">
<el-input
placeholder="请输入验证码"
v-model.trim="loginForm.code"
v-model.trim="loginForm.captcha"
@keyup.enter.native="submitFormLogin"
>
</el-input>
@ -72,18 +72,14 @@ export default {
return {
activeName: "1",
loginForm: {
account: "",
username: "",
password: "",
code: "", //
random: "", //
distinguish: 1, // ,1,2
type: 0, // 0-> 1-> 2->
platform: Setting.platformId
captcha: "", //
},
loginRules: {
account: [{ required: true, message: "请输入账号", trigger: "blur" }],
username: [{ required: true, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }]
},
verificationIMG: "",
phoneVisible: false, //
@ -109,37 +105,29 @@ export default {
},
methods: {
...mapMutations("user", [
"SET_ROLENAME", 'SET_FROM'
]),
...mapActions("user", [
"setCustomer", "setCustomerName"
'SET_USERID', 'SET_USERNAME'
]),
getVerImg() { //
this.loginForm.random = Math.floor(Math.random() * 999999999);
this.verificationIMG = this.api.verification + "?random=" + `${this.loginForm.random}`;
},
handleClick(tab, event) { //
this.loginForm.account = "";
this.loginForm.username = "";
this.$refs.loginForm.clearValidate();
this.loginRules.account[0].message = tab.index === "1" ? "请输入账号" : "请输入手机号/邮箱";
this.loginRules.username[0].message = tab.index === "1" ? "请输入账号" : "请输入手机号/邮箱";
},
submitFormLogin() { //
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loginForm.distinguish = Number(this.activeName);
this.$post(this.api.logins, this.loginForm).then(res => {
if (res && res.status == 30001) {
this.phoneVisible = true;
}
this.getVerImg()
this.loginForm.code = ''
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires);
this.SET_FROM(false)
this.getRole()
this.queryCustomer()
this.$post(this.api.logins, this.loginForm).then(({ data }) => {
util.local.set(Setting.tokenKey, data.accessToken, Setting.tokenExpires)
util.successMsg('登录成功')
this.SET_USERID(data.id)
this.SET_USERNAME(data.username)
this.$router.push('/site')
}).catch(res => {
this.getVerImg()
this.loginForm.code = ''
this.loginForm.captcha = ''
})
} else {
return util.errorMsg("请检查表单数据");
@ -152,19 +140,6 @@ export default {
this.SET_ROLENAME(res)
}).catch(err => {})
},
queryCustomer() { //
this.$get(this.api.isClient).then(res => {
util.successMsg("登录成功");
this.setCustomer(res.customer);
res.customerName && this.setCustomerName(res.customerName);
const path = '/student/list' //
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const list = res.permissionMenu[0].children
this.$router.push(list.find(e => e.path === path) ? path : list[0].path)
}).catch(err => {})
}).catch(res => {});
},
phoneCountdown() {
let count = 60;
if (!this.phoneTimer) {
@ -207,10 +182,10 @@ export default {
let data = {
phone: this.phone,
types: 2,
code: this.phoneCode,
captcha: this.phoneCode,
opener: this.phoneOpener,
platform: Setting.platformId,
account: this.loginForm.account
username: this.loginForm.username
};
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
util.successMsg("绑定成功");

@ -0,0 +1,529 @@
<template>
<div>
<el-form>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="(isEdit ? '更新' : '创建') + '文章'"></el-page-header>
<div>
<el-button type="primary" @click="submit(1)">发布</el-button>
<el-button v-if="!form.id" type="primary" @click="submit(0)">保存为草稿</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">标题</p>
<el-input
placeholder="请输入标题"
v-model.trim="form.title"
clearable
maxlength="15"
class="inline-input"
@change="nameChange"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">所属栏目</p>
<el-cascader
ref="column"
v-model="form.columnId"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">发布日期</p>
<div class="inline-input">
<el-date-picker
v-model="form.releaseTime"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">来源</p>
<el-input
placeholder="请输入来源"
v-model.trim="form.source"
clearable
maxlength="15"
class="inline-input"
@change="nameChange"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">作者</p>
<el-input
placeholder="请输入作者"
v-model.trim="form.author"
clearable
maxlength="15"
class="inline-input"
@change="nameChange"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">标题图</p>
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.titleImg" :src="form.titleImg" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传banner</p>
</div>
<div slot="tip" class="el-upload__tip">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p>
</div>
</el-upload>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">banner图</p>
<el-upload
class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccessBanner"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传banner</p>
</div>
<div slot="tip" class="el-upload__tip">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p>
</div>
</el-upload>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">独立文章模板</p>
<div class="style-wrap">
<ul class="styles">
<li>
<el-radio v-model="form.articleTemplate" :label="1">视频详情</el-radio>
</li>
<li>
<el-radio v-model="form.articleTemplate" :label="2">富文本</el-radio>
</li>
<li>
<el-radio v-model="form.articleTemplate" :label="3">链接</el-radio>
</li>
</ul>
</div>
</div>
</el-card>
<template v-if="form.articleTemplate === 1 || form.articleTemplate === 2">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">正文</p>
<quill :border="true" v-model="form.mainBody" :height="400" />
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">文件上传</p>
<el-upload
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccessFile"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<el-button type="primary">上传</el-button>
</el-upload>
</div>
</el-card>
</template>
<template v-if="form.articleTemplate === 3">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">连接类型</p>
<el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio>
<el-radio :label="2">站外链接</el-radio>
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</div>
</el-card>
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站内链接</p>
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站外链接</p>
<el-input
placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
clearable
></el-input>
</div>
</el-card>
<template v-if="form.connectionType === 3">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站点选择</p>
<el-select v-model="form.siteSelection">
<el-option
v-for="item in sites"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目</p>
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
</template>
</template>
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">在新窗口打开</p>
<el-switch
v-model="form.showWithDetails"
:active-value="1"
:inactive-value="0">
</el-switch>
</div>
</el-card>
</el-form>
</div>
</template>
<script>
import util from "@/libs/util";
import ColumnConst from '@/const/column'
import quill from '@/components/quill'
import { mapState, mapActions } from "vuex";
export default {
data() {
return {
isEdit: this.$route.query.type === 'edit',
headers: {},
nameRepeat: false,
types: ColumnConst.types,
templates: ColumnConst.templates,
sites: ColumnConst.sites,
columns: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
form: {
id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId,
articleTemplate: '',
author: '',
bannerImg: '',
columnId: +this.$route.query.columnId,
file: '',
isRelease : '',
mainBody: '',
releaseTime: '',
source: '',
summary : '',
title: '',
titleImg: '',
connectionType : 1,
linkAddress: '',
siteSelection: 1,
},
submiting: false, //
updateTime: 0
};
},
components: {
quill
},
mounted() {
this.getList()
this.form.id && this.getData()
},
watch: {
// ,
form: {
handler(val){
this.updateTime++
},
deep:true
},
},
methods: {
//
getList() {
this.$post(this.api.listWithTree, {
columnName: '',
templateId: '',
typeId : '',
}).then(({ data }) => {
this.columns = data
this.$nextTick(() => {
// this.$refs.column.setCheckedKeys(data[0].id)
console.log("🚀 ~ file: index.vue ~ line 309 ~ this.$nextTick ~ his.$refs.column", this.$refs.column.setCheckedKeys)
})
}).catch(err => {})
},
//
getData() {
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => {
this.form = data
if (data.articleTemplate === 3 && data.connectionType !== 2 && data.linkAddress) this.links = data.linkAddress.split(',').map(e => +e)
this.originalName = data.title
}).catch(err => {})
},
//
nameChange(){
const { title, level, id } = this.form
if(title && title !== this.originalName){
this.$post(this.api.checkIfTheTitleIsRepeat, {
title,
id: id || ''
}).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}else{
this.nameRepeat = false
}
},
//
typeChange(val) {
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleExceed(files, fileList) {
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
handleRemove(file, fileList) {
this.form.columnBanner = ''
},
uploadSuccess(res) {
this.form.columnBanner = res.data.filesResult.fileUrl
},
uploadSuccessBanner(res) {
this.form.bannerImg = res.data.filesResult.fileUrl
},
uploadSuccessFile(res) {
this.form.file = res.data.filesResult.fileUrl
},
//
submit(isRelease) {
if (this.submiting) return false
const { form } = this
if (!form.title) return util.errorMsg('请填写标题')
if (this.nameRepeat) return util.errorMsg('该标题已重复!')
if (!form.releaseTime) return util.errorMsg('请选择发布日期')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
if (form.articleTemplate === 3 && form.connectionType !== 2) {
const { links } = this
if (!links.length && form.connectionType === 1) return util.errorMsg('请选择站内链接')
if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目')
form.linkAddress = links.join()
}
console.log(44, this.links)
form.isRelease = isRelease
this.submiting = true
if (form.id) {
delete form.children
form.editorId = +this.$store.state.user.userId
this.$post(this.api.updateArticle, form).then(res => {
util.successMsg("修改成功")
this.$router.back()
}).catch(err => {
this.submiting = false
})
} else {
this.$post(this.api.saveArticle, form).then(res => {
util.successMsg("创建成功")
this.$router.back()
}).catch(err => {
this.submiting = false
})
}
},
//
backPage() {
this.$router.back()
},
goBack() {
const { id } = this.form
const { updateTime } = this
//
if ((!this.isEdit && updateTime > 1) || (id && updateTime > 2)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.submit()
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
}
}
};
</script>
<style lang="scss" scoped>
.inline-input {
width: 500px;
}
$upload-width: 220px;
$upload-height: 140px;
$upload-lg-height: 150px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #cb221c;
}
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
.style-wrap {
display: flex;
margin-top: 10px;
.label {
margin-right: 30px;
}
}
.styles {
display: inline-flex;
li {
margin-right: 20px;
}
}
</style>

@ -0,0 +1,206 @@
<template>
<div class="flex">
<div class="page" style="width: 320px">
<div>
<div class="flex-between m-b-20">
<h6 class="p-title" style="margin-bottom: 0">栏目</h6>
</div>
<div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree ref="column" :data="columns" :props="defaultProps" node-key="id" @node-click="columnClick"></el-tree>
</div>
</div>
</div>
<div class="page flex-1 m-l-20">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" placeholder="请输入文章标题" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="info" v-auth @click="add">新增</el-button>
<el-button type="primary" v-auth @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="title" label="标题" align="center" min-width="100"></el-table-column>
<el-table-column prop="columnName" label="栏目" align="center" min-width="100"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-auth type="text" @click="resetPassword(scope.row)">预览</el-button>
<el-button v-auth type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
import { mapState } from "vuex";
export default {
data() {
return {
columns: [],
defaultProps: {
value: 'id',
label: 'columnName'
},
keyword: "",
originForm: {},
form: {
userName: "",
phone: "",
uniqueIdentification: "",
workNumber: "",
email: "",
account: "",
classId: ""
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
};
},
mounted() {
this.getColumn()
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
if (this.studentType) {
this.initData();
} else {
this.getOrgStudentData();
}
}, 500);
},
},
methods: {
//
getColumn() {
this.$post(this.api.listWithTree, {
columnName: '',
templateId: '',
typeId : '',
}).then(({ data }) => {
this.columns = data
this.$nextTick(() => {
this.$refs.column.setCurrentKey(data[0].id)
this.getData()
})
}).catch(e => {})
},
//
columnClick(data, node) {
this.getData()
},
//
getData() {
this.$post(this.api.queryArticle, {
columnIds: [this.$refs.column.getCurrentKey()],
pageNum: this.page,
pageSize: this.pageSize,
title: this.keyword
}).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
},
currentChange(val) { //
this.page = val;
this.getData()
},
handleSelectionChange(val) { //
this.multipleSelection = val;
},
initData() {
this.$refs.table.clearSelection();
this.page = 1;
this.getData();
},
delAllSelection() { //
if (this.multipleSelection.length) {
this.$confirm("确定要删除选中用户吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.accountId;
});
this.$post(`${this.api.delStudent}?accountIds=${ids.toString()}`).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
if (this.studentType) {
this.getData();
} else {
this.getOrgStudentData();
}
}).catch(res => {
});
if(this.multipleSelection.length === this.list.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleDelete(row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteArticle}?id=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData()
}).catch(res => {})
}).catch(() => {
});
},
//
add() {
this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}`)
},
//
edit(row) {
this.$router.push(`add?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.custom-tree-node {
display: inline-flex;
align-items: center;
}
.name {
display: inline-block;
max-width: 160px;
margin-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

@ -1,445 +0,0 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建时间</label>
<el-radio-group 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-group>
<el-date-picker v-model="date" @blur='pickerInput' align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="curriculumId" placeholder="请选择" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid"
></el-option>
</el-select>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入实验班级/项目名称/考核名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable style="width: 300px"></el-input>
</li>
</ul>
<div>
<div>
<el-button v-auth type="info" round @click="add" >创建考核</el-button>
<el-button v-auth type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
</div>
<el-table v-loading="listLoading" 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="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="className" label="实验班级" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="experimentalName" label="考核名称" align="center" min-width="120px" show-overflow-tooltip></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="200" show-overflow-tooltip align="center"></el-table-column>
<el-table-column prop="experimenterNum" label="实验人数" align="center"></el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center"></el-table-column>
<el-table-column label="邀请码" align="center">
<template slot-scope="scope">
<span>{{ scope.row.isEnableCode == 1 ? scope.row.invitationCode : "" }}</span>
</template>
</el-table-column>
<el-table-column prop="type" label="发布类型" align="center">
<template slot-scope="scope">
<span>{{ types[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" width="150" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="startTime" width="150" label="起始时间" align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" width="150" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{ transferTime(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column label="倒计时" align="center">
<template slot-scope="scope">
<span>{{ timeFilter(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="实验状态" align="center">
<template slot-scope="scope">
<span>
{{ status[scope.row.status] }}
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<template v-if="scope.row.status == 0 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth v-if="scope.row.type == 1" type="text" @click="start(scope.row)">启动</el-button>
<el-button v-auth type="text" @click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 1 && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))">
<el-button v-auth type="text" @click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button v-auth type="text" @click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-auth v-if="(scope.row.status == 0 || scope.row.status == 2) && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="pageNum"></el-pagination>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
typeList: [
{
value: "",
name: "不限"
}, {
value: 1,
name: "手动发布"
}, {
value: 2,
name: "定时发布"
}
],
types: ["", "手动发布", "定时发布"],
statusList: [
{
value: "",
name: "不限"
}, {
value: 0,
name: "待开始"
}, {
value: 1,
name: "进行中"
}, {
value: 2,
name: "已结束"
}
],
status: ["待开始", "进行中", "已结束"],
dateList: [
{
id: "",
name: "不限"
}, {
id: 1,
name: "近一个月"
}, {
id: 3,
name: "近三个月"
}, {
id: 6,
name: "近六个月"
}
],
date: [],
curriculumList: [],
curriculumId: "",
keyWord: "", //
searchTimer: null,
form: {
type: "",
status: "",
startTime: "",
endTime: "",
month: ""
},
pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
listData: [], //
multipleSelection: [], //
listLoading:false,//
ticker: null, //
sss:1,
datassdata:0
};
},
computed: {
...mapState("user", [
'roleName'
])
},
watch: {
"form.month": function(val) {
if (val) {
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))];
} else {
this.date = [];
}
},
date: function(val) {
if (val) {
this.form.startTime = val[0];
this.form.endTime = val[1];
} else {
this.form.startTime = "";
this.form.endTime = "";
this.form.month = '';
}
this.initData();
},
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
//
this.$once("hook:beforeDestroy", function() {
this.sss = 0
// clearInterval(this.ticker);
// this.ticker = null;
});
this.getData();
this.getschoolCourse();
},
methods: {
pickerInput(){
this.form.month = '6'
},
beginTimer() {
this.ticker = setInterval(() => {
if(this.sss == 0){
clearInterval(this.ticker);
this.ticker = null;
}else{
for (let i = 0; i < this.listData.length; i++) {
const item = this.listData[i];
if (item.countDown > 0) {
item.countDown--;
} else {
if (item.status == 0 && item.type == 2) { // -
item.status = 1;
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000;
// }
} else if (item.status == 1) {
// item.status = 2;
}
}
item.show = true;
this.$set(this.listData, i, item);
}
}
}, 1000);
},
timeFilter(countDown) {
if (countDown.countDown > 0) {
let h = Math.floor(countDown.countDown / (60 * 60));
let m = Math.floor(countDown.countDown % (60 * 60) / 60);
let s = Math.floor(countDown.countDown % (60 * 60) % 60);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
if(countDown.status == 1){
countDown.status = 2
}
return "00:00:00";
}
},
getData() {
this.datassdata = this.datassdata+1
this.listLoading = true;
this.listData.splice(0);
this.sss = 0
let data = {
...this.form,
keyWord: this.keyWord,
pageNum: this.pageNum,
pageSize: this.pageSize,
curriculumId: this.curriculumId
};
this.$post(this.api.pageByCondition, data).then(res => {
this.listData = res.list;
this.total = res.total;
this.listData.forEach(i => {
i.show = false;
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;
}
}
}
});
this.sss = 1;
if(this.datassdata == 1){
this.beginTimer()
}
// setTimeout(,3000)
this.listLoading = false;
}).catch(err => {
this.listLoading = false;
});
},
initData() {
this.$refs.table.clearSelection();
this.pageNum = 1;
this.sss = 0
this.getData();
},
getschoolCourse() { //
this.$get(this.api.schoolCourse).then(res => {
this.curriculumList = res.data;
}).catch(err => {
console.log(err);
});
},
add() {
this.$router.push("add");
},
edit(row) {
this.$router.push(`add?id=${row.id}`);
},
show(row) {
this.$router.push(`/achievement/teach?id=${row.id}&projectName=${row.projectName}&permissions=1`)
},
start(row) {
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => {
util.successMsg("启动成功!");
this.sss = 0
this.getData();
}).catch(err => {
console.log(err);
});
},
finish(row) {
this.$confirm("确定要提前结束吗?", "提示", {
type: "warning"
}).then(() => {
let data = {
id: row.id,
endTime: util.formatDate("yyyy-MM-dd hh:mm:ss", new Date()),
status: 2
};
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => {
util.successMsg("提前结束成功!");
this.sss = 0
this.getData();
}).catch(err => {
console.log(err);
});
}).catch(() => {
});
},
delData(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, [row.id]).then(res => {
util.successMsg("删除成功");
this.sss = 0
this.getData();
}).catch(res => {
});
}).catch(() => {
});
},
delAllData() {
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.sss = 0
this.getData();
}).catch(res => {
});
if(this.multipleSelection.length === this.listData.length && this.pageNum>1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
onSearch() {
this.pageNum = 1;
this.sss = 0
this.getData();
},
handleCurrentChange(val) {
this.pageNum = val
this.$router.push(`list?page=${val}`)
this.sss = 0
this.getData();
},
transferTime(date) {
if (date == "0000-00-00 00:00:00" || !date) return "---";
return date;
}
}
};
</script>
<style lang="scss" scoped>
.el-radio-group {
white-space: nowrap;
}
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style>

@ -0,0 +1,513 @@
<template>
<div>
<el-form>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="goBack" :content="(isEdit ? '更新' : '创建') + '栏目'"></el-page-header>
<div>
<el-button type="primary" @click="submit">{{ form.id ? "更新" : "创建" }}</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目名称</p>
<el-input
placeholder="请输入栏目名称"
v-model.trim="form.columnName"
clearable
maxlength="15"
class="inline-input"
@change="nameChange"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">设置上级</p>
<el-cascader
v-model="form.fatherId"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目类型</p>
<div class="inline-input">
<el-select v-model="form.typeId" @change="typeChange">
<el-option
v-for="item in types"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">分页条数</p>
<el-input
placeholder="请输入分页条数"
v-model.trim="form.pageSize"
maxlength="15"
type="number"
style="width: 150px"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">导航菜单可见</p>
<el-switch
v-model="form.menuVisible"
:active-value="0"
:inactive-value="1">
</el-switch>
</div>
</el-card>
<template v-if="form.typeId === 1 || form.typeId === 4">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目banner</p>
<el-upload
class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传banner</p>
</div>
<div slot="tip" class="el-upload__tip">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p>
</div>
</el-upload>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目模板</p>
<el-select v-model="form.templateId">
<el-option
v-for="item in templates"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div class="style-wrap">
<p class="label">列表样式</p>
<ul class="styles">
<li>
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
</li>
<li>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio>
</li>
<li>
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
</li>
</ul>
</div>
<div class="style-wrap">
<p class="label">详情样式</p>
<ul class="styles">
<li>
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio>
</li>
<li>
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio>
</li>
<li>
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio>
</li>
</ul>
</div>
</div>
</el-card>
</template>
<template v-if="form.typeId === 2">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">连接类型</p>
<el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio>
<el-radio :label="2">站外链接</el-radio>
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</div>
</el-card>
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站内链接</p>
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable></el-cascader>
</div>
</el-card>
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站外链接</p>
<el-input
placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
clearable
></el-input>
</div>
</el-card>
<template v-if="form.connectionType === 3">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">站点选择</p>
<el-select v-model="form.siteSelection">
<el-option
v-for="item in sites"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目</p>
<el-cascader
:options="links"
:props="{ checkStrictly: true }"
clearable></el-cascader>
</div>
</el-card>
</template>
</template>
<template v-if="form.typeId === 3">
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">栏目模板</p>
<el-select v-model="form.templateId">
<el-option
v-for="item in templates"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<div class="style-wrap">
<p class="label">列表样式</p>
<ul class="styles">
<li>
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio>
</li>
<li>
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio>
</li>
<li>
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio>
</li>
</ul>
</div>
</div>
</el-card>
</template>
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">只有一篇文章时以详情方式展示</p>
<el-switch
v-model="form.showWithDetails"
:active-value="1"
:inactive-value="0">
</el-switch>
</div>
</el-card>
</el-form>
</div>
</template>
<script>
import util from "@/libs/util";
import ColumnConst from '@/const/column'
import { mapState, mapActions } from "vuex";
export default {
data() {
return {
isEdit: this.$route.query.type === 'edit',
headers: {},
nameRepeat: false,
types: ColumnConst.types,
templates: ColumnConst.templates,
sites: ColumnConst.sites,
columns: [],
columnProps: {
checkStrictly: true,
value: 'id',
label: 'columnName'
},
links: [],
form: {
id: this.$route.query.id || '',
founderId: +this.$store.state.user.userId,
editorId: +this.$store.state.user.userId,
fatherId: +this.$route.query.id || 0,
level: this.$route.query.level || 1,
columnName: '',
typeId: 1,
pageSize: 10,
menuVisible: 0,
columnBanner: '',
templateId: 1,
listStyleId: 1,
detailStyle: 1,
connectionType: 1,
linkAddress : '',
showWithDetails: 0,
siteSelection: 1,
status: 1,
sort: 1,
},
submiting: false, //
updateTime: 0
};
},
mounted() {
this.getList()
this.isEdit && this.getData()
},
watch: {
// ,
form: {
handler(val){
this.updateTime++
},
deep:true
},
},
methods: {
//
getList() {
this.$post(this.api.listWithTree, {
columnName: '',
templateId: '',
typeId : '',
}).then(({ data }) => {
this.columns = data
}).catch(err => {})
},
//
getData() {
this.$post(`${this.api.findColumn}?id=${this.form.id}`).then(({ data }) => {
this.form = data
}).catch(err => {})
},
//
setFatherId() {
},
//
nameChange(){
const { columnName, level, id } = this.form
if(columnName && columnName !== this.originalName){
this.$post(this.api.sameLevelJudgment, {
columnName,
level: +level,
id: +id || ''
}).then(res => {
this.nameRepeat = false
}).catch(res => {
this.nameRepeat = true
})
}else{
this.nameRepeat = false
}
},
//
typeChange(val) {
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleExceed(files, fileList) {
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
handleRemove(file, fileList) {
this.form.columnBanner = ''
},
uploadSuccess(res) {
this.form.columnBanner = res.data.filesResult.fileUrl
},
//
submit() {
if (this.submiting) return false
const { form } = this
if (!form.columnName) return util.errorMsg('请填写栏目名称')
if (this.nameRepeat) return util.errorMsg('同级下已存在重复栏目!')
if (!form.pageSize) return util.errorMsg('请填写分页条数')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
if (form.typeId === 2 && form.connectionType !== 2) {
const { links } = this
if (!links.length && form.connectionType === 1) return util.errorMsg('请选择站内链接')
if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目')
form.linkAddress = links.join()
}
console.log(44, this.links)
this.submiting = true
if (this.isEdit) {
delete form.children
form.editorId = +this.$store.state.user.userId
this.$post(this.api.updateColumn, form).then(res => {
util.successMsg("修改成功")
this.$router.back()
}).catch(err => {
this.submiting = false
})
} else {
this.$post(this.api.saveColumn, form).then(res => {
util.successMsg("创建成功")
this.$router.back()
}).catch(err => {
this.submiting = false
})
}
},
//
backPage() {
this.$router.back()
},
goBack() {
const { id } = this.form
const { updateTime } = this
//
if ((!this.isEdit && updateTime > 1) || (id && updateTime > 2)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.submit()
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
}
}
};
</script>
<style lang="scss" scoped>
.inline-input {
width: 500px;
}
$upload-width: 220px;
$upload-height: 140px;
$upload-lg-height: 150px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #cb221c;
}
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
.style-wrap {
display: flex;
margin-top: 10px;
.label {
margin-right: 30px;
}
}
.styles {
display: inline-flex;
li {
margin-right: 20px;
}
}
</style>

@ -0,0 +1,158 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入栏目名称" prefix-icon="el-icon-search" v-model.trim="keyWord" clearable style="width: 300px"></el-input>
</li>
</ul>
<div>
<div>
<el-button type="info" round @click="add" >新增</el-button>
<el-button type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
</div>
<el-table v-loading="listLoading" ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="columnName" label="名称"></el-table-column>
<el-table-column prop="typeId" label="栏目类型" align="center">
<template slot-scope="scope">
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }}
</template>
</el-table-column>
<el-table-column prop="templateId" label="栏目模板" align="center"></el-table-column>
<el-table-column prop="listStyleId" label="列表/长页样式" align="center"></el-table-column>
<el-table-column prop="detailStyle" label="详情样式" align="center"></el-table-column>
<el-table-column prop="menuVisible" label="导航菜单" align="center"></el-table-column>
<el-table-column prop="id" label="ID" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row, 'add')">新增下级</el-button>
<el-button type="text" @click="edit(scope.row, 'edit')">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import ColumnConst from '@/const/column'
import util from "@/libs/util";
export default {
data() {
return {
types: ColumnConst.types,
templates: ColumnConst.templates,
keyWord: "", //
searchTimer: null,
page: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
listData: [], //
multipleSelection: [], //
listLoading:false,//
};
},
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getData()
},
methods: {
getData() {
this.$post(this.api.listWithTree, {
columnName: this.keyWord,
templateId: '',
typeId : '',
}).then(({ data }) => {
this.listData = data
this.listLoading = false
}).catch(err => {
this.listLoading = false
})
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
add() {
this.$router.push('add')
},
edit(row, type) {
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`)
},
del(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteColumn}?id=${row.id}`).then(res => {
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
},
delAllData() {
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.deleteAssessment, ids).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.sss = 0
this.getData();
}).catch(res => {
});
if(this.multipleSelection.length === this.listData.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.page = val
this.$router.push(`list?page=${val}`)
this.getData();
}
}
};
</script>
<style lang="scss" scoped>
.el-radio-group {
white-space: nowrap;
}
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style>

@ -0,0 +1,90 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入栏目或模板名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable style="width: 300px"></el-input>
</li>
</ul>
<div>
<div>
<!-- <el-button v-auth type="info" round @click="add" >创建考核</el-button>
<el-button v-auth type="primary" round @click="delAllData">批量删除</el-button> -->
</div>
</div>
</div>
<el-table ref="table" :data="list" class="table" stripe header-align="center" 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="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNum - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="长页栏目名称" align="center"></el-table-column>
<el-table-column prop="createTime" label="模板名称" align="center"></el-table-column>
<el-table-column prop="createTime" label="上级栏目" align="center"></el-table-column>
<el-table-column prop="createTime" label="最近编辑" align="center"></el-table-column>
<el-table-column prop="createTime" label="编辑人" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<el-button type="text" @click="start(scope.row)">预览</el-button>
<el-button type="text" @click="start(scope.row)">编辑</el-button>
<el-button type="text" @click="start(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="pageNum"></el-pagination>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
keyword: '',
pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
list: []
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
},
methods: {
handleCurrentChange(val) {
this.page = val
// this.getData();
},
add() {
this.$router.push("add");
},
edit(row) {
this.$router.push(`add?id=${row.id}`);
},
}
};
</script>
<style lang="scss" scoped>
.el-radio-group {
white-space: nowrap;
}
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
}
</style>

@ -1,714 +0,0 @@
<template>
<div ref="main" class="main">
<el-form :disabled="isDetail">
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button type="success" @click="handleSubmit(0)">保存为草稿</el-button>
<el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<h6 class="p-title">基本信息</h6>
<div>
<el-form label-width="80px" :disabled="isDetail">
<div class="flex">
<el-form-item label="系统">
<el-select v-model="projectManage.systemId" placeholder="请选择" @change="systemChange">
<el-option
v-for="item in systemList"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目名称">
<el-input v-model.trim="projectManage.projectName" placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="项目权限">
<el-select v-model="projectManage.permissions" placeholder="请选择" @change="permissionChange">
<el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
</el-select>
</el-form-item>
</div>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<h6 class="p-title">实验目标</h6>
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<h6 class="p-title">案例描述</h6>
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="m-b-20 flex-between">
<h6 class="p-title" style="margin-bottom: 0">实验任务</h6>
<div>
<!--<el-button :disabled="isDetail" type="primary" @click="toJudgePoint('home')">进入判分点</el-button>-->
</div>
</div>
<div class="m-b-20 flex-between">
<div class="flex-center">
<div class="m-r-20" style="color: #f00">项目总分值100</div>
<!-- <div>权重&emsp;<div class="dib"><el-input></el-input></div></div> -->
</div>
<div>
<el-button class="m-r-20" type="text" @click="avgDistributionScore">平均分配分值</el-button>
<el-button class="m-r-20" type="text" @click="manualDistributionScore">手动分配分值</el-button>
<span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div>
</div>
<el-button type="primary" icon="el-icon-plus" round @click="handleQueryJudgment" style="margin-bottom: 10px">判分点</el-button>
<el-button type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除</el-button>
<div class="draggable">
<el-table
ref="projectJudgementTable"
:data="projectJudgmentData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionProjectJudgment"
row-key="judgmentId"
v-loading="listLoading"
>
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="sort" label="序号" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</el-table-column>
<el-table-column prop="name" label="判分指标" align="center"></el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="实验要求" align="center" width="600">
<template slot-scope="scope">
<quill :border="true" :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :minHeight="150" :height="150" />
</template>
</el-table-column>
<el-table-column prop="score" label="分数" align="center" width="120">
<template slot-scope="scope">
<!--type="number" @blur="updateProjectJudgment"-->
<el-input v-model.trim="scope.row.score" @input="scoreChange(scope.row, scope.$index,$event)"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<!--<el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>-->
<el-button type="text" @click="delJudgePoint(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="m-b-20 flex-between">
<h6 class="p-title" style="margin-bottom: 0">实验提示</h6>
<div>
启用
<el-switch :active-value="0" :inactive-value="1" v-model="projectManage.hintOpen"></el-switch>
</div>
</div>
<div>
<el-form label-width="0">
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
</el-form>
<!--选择判分点对话框-->
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false">
<div class="text-right m-b-10">
<div>
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" clearable></el-input>
</div>
</div>
<el-table
v-loading="visibleLoading"
:data="judgementData"
ref="judgementTable"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionJudgment"
:row-key="rowKey"
>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="id" label="序号" align="center" width="100">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini" @click="toJudgePoint('view', scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addJudgment"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import util from "@/libs/util";
import { mapState, mapActions } from "vuex";
import quill from "@/components/quill";
import Sortable from "sortablejs";
export default {
components: {
quill
},
data() {
return {
projectId: this.$route.query.projectId,
founder: this.$route.query.founder,
systemList: [],
token: btoa(util.local.get(Setting.tokenKey)),
isDetail: Boolean(this.$route.query.show),
projectManage: {
founder: 0, // (0 1)
projectName: "", //
permissions: 0, // (0 1 2)
systemId: this.$store.state.project.lastSystemId, // id
hintOpen: 0, // (0 1 0)
experimentHint: "", //
experimentTarget: "", //
experimentDescription: "", //
state: 0, // (0稿 1)
isOpen: 0, // (0 1 0)
isDel: 0 // (0 1 0)
},
projectJudgmentData: [], //()
selectedProjectJudgment: [], //
dialogVisible: false, //
judgementpointsquery: "", //
judgementData: [], //
selectedJudgment: [], //
rowKey: "", // Key
projectNameRepeat: false, //
originName: '',
flag: false, //
avgValuelist: [], //
searchTimer: null,
isToPoint: false, //
visibleLoading: false, //
listLoading:false,//
submiting: false, //
updateTime: 0
};
},
computed: {
...mapState("project", [
"projectFields", "lastSystemId"
]),
handDistributionScore: function() {
//100
let score = 0;
this.projectJudgmentData.forEach(e => {
score += parseInt(e.score);
});
if (isNaN(score)) {
return 0;
}
if (score > 100) {
// util.errorMsg(res.message);
util.errorMsg("分配的数值已超过100");
}
console.log("chuli");
return score;
}
},
watch: {
// ,
projectManage: {
handler(){
this.updateTime++
},
deep:true
},
judgementpointsquery(n) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.handleQueryJudgment();
}, 500);
}
},
created() {
this.getSystemData();
},
mounted() {
if (this.$route.query.projectId) {
this.projectId = this.$route.query.projectId;
this.getInfoData();
}
//
if (JSON.stringify(this.projectFields) != "{}") {
let { projectManage, projectJudgmentData } = this.projectFields;
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData;
}
this.rowDrop();
this.$refs.main.scrollTop = 0;
},
beforeDestroy() {
if (!this.isToPoint) {
this.setProject({});
}
},
methods: {
...mapActions("project", [
"setSystemId", "setProject"
]),
getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(res => {
this.systemList = res.data;
});
},
getInfoData() { //
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res;
this.projectManage = projectManage;
this.originName = projectManage.projectName
this.projectJudgmentData = projectJudgmentVos;
this.projectJudgmentData.forEach((e, i) => {
e.sort = i + 1;
});
this.$nextTick(() => {
this.$refs.main.scrollTop = 0;
});
}).catch(err => {
console.log(err);
});
},
projectNameExistis() { //
const { projectName } = this.projectManage
if (this.originName === projectName) {
this.projectNameRepeat = false
} else {
this.$post(this.api.queryNameIsExist, { projectName }).then(res => {
if (res.status === 200) {
this.projectNameRepeat = false
}
}).catch(err => {
this.projectNameRepeat = true
})
}
},
systemChange() { //
if (this.projectJudgmentData.length) {
this.$confirm("更换系统会清空实验任务,确认更换?", "提示", {
type: "warning"
}).then(() => {
this.projectJudgmentData = [];
this.setSystemId(this.projectManage.systemId);
}).catch(() => {
this.projectManage.systemId = this.lastSystemId;
// console.log(this.lastSystemId, "this.lastSystemId");
});
}
},
//
removeTag(val) {
return val.replace('<p><br></p>', '')
},
judgmentRelease(state) { //
let {
projectName,
experimentTarget,
experimentDescription,
experimentHint,
hintOpen
} = this.projectManage;
if (!projectName) {
util.errorMsg("请输入项目名称");
return false;
}
if (this.projectNameRepeat) {
util.errorMsg("项目名称重复!");
return false;
}
if (state) {
if (!experimentTarget || !this.removeTag(experimentTarget)) {
util.errorMsg("请输入实验目标");
return false;
}
if (!experimentDescription || !this.removeTag(experimentDescription)) {
util.errorMsg("请输入案例描述");
return false;
}
if (this.projectJudgmentData.length == 0) {
util.errorMsg("请添加判分点");
return false;
}
if (this.handDistributionScore < 100) {
util.errorMsg("判分点分数未满100");
return false;
}
if (this.handDistributionScore > 100) {
util.errorMsg("判分点分数已超过100");
return false;
}
if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) {
util.errorMsg("请输入实验提示");
return false;
}
}
return true;
},
handleSubmit(state) { //
if (this.submiting) return false
if (!this.judgmentRelease(state)) { //
return;
}
this.submiting = true
this.setSystemId(this.projectManage.systemId);
this.projectManage.state = state;
let { systemId } = this.projectManage;
if (this.projectId) {
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else {
//
this.updateProjectJudgment();
}
} else {
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else {
//
let tempArr = this.projectJudgmentData.map(i => {
let obj = {
projectId: this.projectId ? this.projectId : "",
judgmentId: i.judgmentId,
score: i.score,
sort: i.sort
};
return obj;
});
let params = {
projectManage: this.projectManage,
projectJudgmentList: tempArr
};
this.addProject(params);
}
}
},
updateProject(params) { //
this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => {
util.successMsg("更新实验项目成功");
this.$router.back();
}).catch(err => {
this.submiting = false
});
},
addProject(params) { //
console.log("🚀 ~ file: index.vue ~ line 448 ~ addProject ~ params", params)
this.$post(this.api[params.projectManage.state ? 'addProjectManage' : 'saveProjectDraft'], params).then(res => {
util.successMsg("添加实验项目成功");
this.$router.back();
}).catch(err => {
this.submiting = false
});
},
manualDistributionScore() { //
},
avgDistributionScore() {
//
if (this.projectJudgmentData.length) {
this.$get(this.api.avgValues, {
number: this.projectJudgmentData.length
}).then(res => {
if (res.data) {
this.projectJudgmentData = this.projectJudgmentData.map((item, index) => {
item.score = res.data[index];
return item;
});
// this.updateProjectJudgment();
}
});
}
},
scoreChange(row, index, val) { //
this.projectJudgmentData.splice(index, 1, row);
},
delJudgePoint(index) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.projectJudgmentData.splice(index, 1);
}).catch(() => {
});
},
handleSelectionProjectJudgment(val) {
this.selectedProjectJudgment = val;
},
batchDeleteProjectJudgment() { //
if (this.selectedProjectJudgment.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let list = this.projectJudgmentData;
let result = [];
list.map(i => {
this.selectedProjectJudgment.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.projectJudgmentData = result;
}).catch(() => {
});
} else {
util.errorMsg("请选择判分点");
}
},
handleQueryJudgment() { //
let { systemId } = this.projectManage;
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.judgementTable.clearSelection();
});
let params = {
systemId,
name: this.judgementpointsquery
};
if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId);
} else if (systemId == 11) {
// ()
this.rowKey = "lcId";
this.getProcessClassData(params);
} else {
//
this.rowKey = "bcId";
this.getProgrammingClassData(params);
}
},
getProcessClassData(params) { //
this.visibleLoading = true;
this.$get(`${this.api.getBcJudgmentPoint}`, params).then(res => {
let list = res.judgmentPoints
let result = [];
list.map(i => {
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.visibleLoading = false;
this.judgementData = result;
}).catch(err => {
this.visibleLoading = false
});
},
getProgrammingClassData(params) { //
this.visibleLoading = true;
this.$get(this.api.getBcJudgmentPoint, params).then(res => {
let list = res.judgmentPoints
let result = [];
list.map(i => {
this.projectJudgmentData.find(j => j.judgmentId === i.judgmentId) || result.push(i);
});
this.visibleLoading = false;
this.judgementData = result;
}).catch(err => {
this.visibleLoading = false
});
},
handleSelectionJudgment(val) { //
this.selectedJudgment = val;
},
addJudgment() { //
if (this.selectedJudgment.length) {
// console.log(this.selectedJudgment, "queren");
this.dialogVisible = false;
let tempArr = this.selectedJudgment.map(i => {
i.score = 0;
return i;
});
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr);
this.projectJudgmentData.map((e, i) => {
e.sort = i + 1;
});
this.$nextTick(() => {
this.$refs.projectJudgementTable.clearSelection();
});
} else {
util.errorMsg("请选择判分点");
}
},
handleCacheData() { //
this.isToPoint = true;
this.setProject({ projectManage: this.projectManage, projectJudgmentData: this.projectJudgmentData });
},
toJudgePoint(type, row) { //
this.handleCacheData();
let jumpPath = Setting.jumpPath;
// let jumpPath = "http://192.168.31.154:8087/"; //
let { systemId } = this.projectManage;
let href = "";
if (type === "view") {
//
if (systemId == 2) {
console.log(systemId);
} else if (systemId == 3) {
console.log(systemId);
} else if (systemId == 11) {
//
href = `${jumpPath}#/Transaction?isView=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${window.btoa(location.href)}`;
} else {
// python
href = `${jumpPath}#/program?isView=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${window.btoa(location.href)}`;
}
} else if (type === "edit") {
//
if (systemId == 2) {
console.log(systemId);
} else if (systemId == 3) {
console.log(systemId);
} else if (systemId == 11) {
//
href = `${jumpPath}#/Transaction?isEdit=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} else {
// python
href = `${jumpPath}#/program?isEdit=true&systemId=${systemId}&bcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
} else if (type === "home") {
if (systemId == 2 || systemId == 3) {
console.log(systemId);
} else {
//
href = `${jumpPath}#/?systemId=${systemId}&token=${this.token}&referrer=${btoa(location.href)}`;
}
}
location.href = href;
},
permissionChange(){
if (this.projectManage.permissions == 1){
this.projectManage.hintOpen = 1
}else{
this.projectManage.hintOpen = 0
}
},
//
rowDrop() {
//
const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
const _this = this;
Sortable.create(tbody, {
//
draggable: ".draggable .el-table__row",
onEnd({ newIndex, oldIndex }) {
_this.projectJudgmentData.splice(newIndex, 0, _this.projectJudgmentData.splice(oldIndex, 1)[0]);
let newArray = _this.projectJudgmentData.slice(0);
_this.projectJudgmentData = [];
_this.$nextTick(function () {
newArray.forEach((e, i) => {
_this.$set(e, "sort", i + 1);//
_this.$set(e, "name", e.name + "?");
_this.$set(e, "name", e.name.slice(0, e.name.length - 1)); //
});
_this.projectJudgmentData = newArray;
});
}
});
},
//
async updateProjectJudgment() {
let param = this.projectJudgmentData.map((e, i) => {
let obj = {
judgmentId: e.judgmentId,
projectId: this.projectId || "",
score: e.score,
sort: i + 1,
id: e.id
};
return obj;
});
await this.$post(`${this.api.updateProjectJudgment}?projectId=${this.projectId}`, param).then(res => {
let tempArr = this.projectJudgmentData.map(i => {
let obj = {
projectId: this.projectId ? this.projectId : "",
judgmentId: i.judgmentId,
score: i.score,
sort: i.sort
};
return obj;
});
let params = {
projectManage: this.projectManage,
projectJudgmentList: tempArr
};
this.updateProject(params);
}).catch(err => {
console.log(err);
});
},
//
toList() {
this.$router.back()
},
//
back() {
//
if(this.updateTime > 1){
this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning"
}).then(() => {
this.handleSubmit(this.projectManage.state)
}).catch(() => {
this.toList()
})
} else {
this.toList()
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .readonly .ql-toolbar {
height: 0;
padding: 0;
border-bottom: 0;
}
.main{
overflow: auto;
overflow-x: hidden;
height: calc(100vh - 152px );
}
</style>

@ -1,436 +0,0 @@
<template>
<div>
<el-card v-if="showBack" shadow="hover" class="m-b-20">
<el-page-header content="实验项目管理" @back="goBack"></el-page-header>
</el-card>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建人</label>
<el-select v-model="queryData.founder" placeholder="请选择创建人" @change="founderChange">
<el-option
v-for="(item,index) in founderList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</li>
<li>
<label>状态</label>
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option
v-for="(item,index) in stateList"
:key="index"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</li>
<li>
<label>权限</label>
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in permissionsList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</li>
<li>
<label>课程</label>
<el-select v-model="queryData.cid" @change="courseChange">
<el-option
v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid">
</el-option>
</el-select>
</li>
<li>
<label>系统</label>
<el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</li>
<li>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button v-auth type="info" @click="add">新增项目</el-button>
<el-button v-auth type="primary" @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :selectable="disabledSelection"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="founder" label="创建人" min-width="150" align="center">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</el-table-column>
<el-table-column label="权限" min-width="120" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="150" align="center"></el-table-column>
<el-table-column prop="status" label="状态" min-width="100" align="center">
<template slot-scope="scope">
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row, 1)">查看</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.founder && (roleName.includes('超级') || roleName === scope.row.roleName || (roleName === '管理员' && !scope.row.roleName.includes('超级')))" type="text" @click="handleDelete(scope.row.projectId)">删除</el-button>
<el-button v-auth type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-auth="'禁用'"
v-if="scope.row.state"
v-model="scope.row.ccupationlabOpen"
:active-text="scope.row.ccupationlabOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff(scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false">
<el-form>
<el-form-item>
<!--前端不用做名称判重了@change='projectNameExistis'-->
<el-input placeholder="请输入项目名称" v-model="projectName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="copyVisible = false"> </el-button>
<el-button type="primary" @click="copySubmit"> </el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import { mapState, mapActions, mapMutations } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
showBack: Boolean(this.$route.query.show),
roleIdEd: this.roleId ? 13 : this.roleId,// roleId13roleId14113,1413>
systemId: "",
systemList: [],
systemListAll: [],
curriculumId: '',
curriculumList: [],
queryData: {
platformId: 1, // :1 :3
founder: +this.$route.query.founder || 2, // (0: 1: 2:)
state: "", // (0:稿 1:)
permissions: "", // (0: 1: 2:)
cid: ''
},
keyword: "",
status: "",
listData: [],
total: 0,
permissionsList: [
{
value: "",
label: "不限"
}, {
value: 0,
label: "练习"
}, {
value: 1,
label: "考核"
}, {
value: 2,
label: "竞赛"
}
],
permissionsKeys: {
0: "练习",
1: "考核",
2: "竞赛"
},
founderList: [
{
value: 2,
label: "全部"
}, {
value: 0,
label: "系统"
}, {
value: 1,
label: "老师"
}
],
founderKeys: {
0: "系统",
1: "老师"
},
stateList: [
{
value: "",
label: "不限"
}, {
value: 0,
label: "草稿箱"
}, {
value: 1,
label: "已发布"
}
],
stateKeys: {
0: "草稿箱",
1: "已发布"
},
page: +this.$route.query.page || 1,
pageSize: 10,
multipleSelection: [],
copyVisible: false,
projectName: "",
currentRow: {}, //
listDataAll: [],
isFirst: true
};
},
computed: {
...mapState("user", [
"userId", "roleId", 'roleName'
]),
...mapState("project", [
"lastSystemId",
"assFields",
"queryDataStatus",
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
},
queryData: {
handler: function(newVal) {
this.setQueryStatus({...newVal})
},
deep: true
}
},
mounted() {
this.getSystemData()
if(this.queryDataStatus.platformId) {
this.queryData = this.queryDataStatus
}
},
methods: {
...mapActions("project", [
"setSystemId"
]),
...mapMutations({
setQueryStatus: "project/SET_QUERYDATASTATUS"
}),
getData() {
this.setSystemId(this.systemId);
if (this.isFirst) this.page = +this.$route.query.page || 1
let data = {
...this.queryData,
projectName: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
systemId: this.systemId
};
this.$post(this.api.queryProjectManage, data).then(res => {
this.isFirst = false
this.listData = res.data.records;
this.total = res.data.total;
}).catch(err => {
});
},
//
getSystemData() {
this.$get(this.api.getSystemIdBySchool).then(({ data }) => {
this.systemListAll = data
// systemIdsystemIdsystemId
this.getschoolCourse()
});
},
//
getschoolCourse() {
this.$get(this.api.schoolCourse).then(({ data }) => {
this.curriculumList = data
const { cid } = this.queryData
if (data.length) {
this.queryData.cid = cid || data[0].cid
this.courseChange()
}
}).catch(err => {})
},
//
courseChange(val) {
const systemIds = this.curriculumList.find(e => e.cid == this.queryData.cid).systemId.split(',') // systemId
this.systemList = this.systemListAll.filter(e => systemIds.includes(e.id + '')) //
this.systemId = this.systemList.length ? this.systemList[0].id : ''
this.initData()
},
//
founderChange(val) {
this.$router.push({
path: 'list',
query: {
...this.$route.query,
founder: val
}
})
this.initData()
},
initData() {
this.page = 1;
this.getData();
},
disabledSelection(row, index) { //
const roleName = this.roleName
if (row.founder && (roleName.includes('超级') || roleName === row.roleName || (roleName === '管理员' && !row.roleName.includes('超级')))) return true
return false
},
handleCurrentChange(val) { //
this.page = val;
this.$router.push({
path: 'list',
query: {
...this.$route.query,
page: val
}
})
this.getData();
},
add() { //
this.setSystemId(this.systemId);
this.$router.push(`/project/add?founder=${this.queryData.founder}`);
},
edit(row, show) { //
this.setSystemId(row.systemId);
this.$router.push(`/project/add?projectId=${row.projectId}&founder=${this.queryData.founder}${show ? `&show=1` : ''}`);
},
handleSelectionChange(val) { //
this.multipleSelection = val;
},
delAllData() { //
if (this.multipleSelection.length) {
let ids = this.multipleSelection.map(item => {
return item.projectId;
});
let strIds = ids.toString();
this.handleDelete(strIds);
} else {
util.errorMsg("请先选择项目");
}
},
handleDelete(ids) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => {
util.successMsg("删除成功");
this.$refs.table.clearSelection()
this.getData();
}).catch(err => {
console.log(err);
});
}).catch(() => {
this.$message.info("已取消删除");
});
},
switchOff(row) { //
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ccupationlabOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
util.successMsg("更新启用状态成功");
this.getData();
}).catch(err => {
console.log(err);
});
},
projectNameExistis() { //
if (this.projectName) {
this.$post(this.api.queryNameIsExist, { projectName: this.projectName }).then(res => {
if (res.status === 200) {
this.projectNameRepeat = false;
}
}).catch(err => {
this.projectNameRepeat = true;
});
} else {
this.projectNameRepeat = false;
}
},
copyData(projectId) { // id
this.copyVisible = true;
this.$get(`${this.api.getProjectDetail}?projectId=${projectId}`).then(res => {
this.projectName = res.projectManage.projectName;
this.currentRow = {
projectManage: res.projectManage,
projectJudgmentList: res.projectJudgmentVos
};
}).catch(err => {
console.log(err);
});
},
copySubmit() {
if (!this.projectName) {
util.warningMsg("请输入项目名称");
return;
}
;
if (this.projectNameRepeat) {
util.warningMsg("该项目名称已存在");
return;
}
this.currentRow.projectManage.projectName = this.projectName;
this.currentRow.projectManage.projectId = "";
this.currentRow.projectJudgmentList.forEach(i => {
i.projectId = "";
});
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => {
this.initData();
util.successMsg("复制实验项目成功");
this.copyVisible = false;
}).catch(err => {
console.log(err);
});
},
goBack() { //
this.$router.back();
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,271 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button v-auth="'角色权限:新增角色'" type="info" round @click="addRole">新增角色</el-button>
<el-button v-auth="'角色权限:批量删除'" type="primary" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :selectable="practiceSelectable" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" min-width="250" show-overflow-tooltip></el-table-column>
<el-table-column label="角色描述" min-width="400" align="center">
<template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark" disabled></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button v-auth="'角色权限:查看'" type="text" @click="showRole(scope.row)">查看</el-button>
<el-button v-auth="'角色权限:编辑'" v-if="scope.row.roleName !== '超级管理员'" type="text" @click="editRole(scope.row)">编辑</el-button>
<el-button v-auth="'角色权限:删除'" v-if="scope.row.roleName !== '超级管理员' && scope.row.roleName !== '管理员'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="80px" :disabled="isDetail">
<el-form-item label="角色名称">
<el-input v-model="form.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述">
<el-input v-model="form.remark" placeholder="请输入角色描述" type="textarea" rows="5"></el-input>
</el-form-item>
<el-form-item prop="role" label="角色权限">
<div style="max-height: 300px; overflow: auto">
<el-tree
ref="per"
:data="permissions"
show-checkbox
default-expand-all
node-key="id"
:default-expanded-keys="checkedIds"
:default-checked-keys="checkedIds"
:props="defaultProps">
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Setting from "@/setting";
export default {
data() {
return {
keyword: "",
searchTimer: null,
isDetail: false,
form: {
id: "",
roleName: "",
remark: ""
},
listData: [],
defaultProps: {
children: "children",
label: "name"
},
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
isAdd: true,
roleVisible: false,
permissions: [],
checkedIds: [],
roleNameReapeat: false //
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted() {
this.getData();
},
methods: {
getData() {
this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${util.encodeStr(this.keyword)}&platformId=1&port=0`).then(res => {
this.listData = res.rolePage.records;
this.total = res.rolePage.total;
}).catch(res => {});
},
currentChange(val) {
this.page = val;
this.getData();
},
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.batchRemove}?roleIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
},
getRowKeys(row) {
return row.id;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.id;
});
this.$post(`${this.api.batchRemove}?roleIds=${ids.toString()}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
if(this.multipleSelection.length === this.listData.length && this.page>1) {
this.handleCurrentChange(this.page - 1)
}
}).catch(() => {});
} else {
util.errorMsg("请先选择数据!");
}
},
practiceSelectable(row, index){
let boolean = true;
if(row.roleName == '超级管理员'){
boolean = false
}else{
boolean = true
}
return boolean;
},
closeRole() {
this.isDetail = false;
this.form = {
id: "",
roleName: "",
remark: ""
};
this.checkedIds = [];
this.permissions = [];
},
//
getPer(row) {
if (!this.permissions.length) {
this.$get(`${this.api.queryAllMenus}?platformId=${Setting.platformId}`).then(res => {
let data = res.children;
//
let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw, 1);
try {
let system = data.findIndex(n => n.name == "系统设置");
if (system != -1) {
data[system].children[1].children.splice(4, 1);
data[system].children[1].children.splice(1, 1);
data[system].children[1].children.splice(0, 1);
}
} catch (error) {
}
this.permissions = data;
if (row) {
this.getDetail(row);
}
}).catch(res => {
});
}
},
addRole() {
this.isAdd = true;
this.getPer();
this.checkedIds = [];
this.permissions.length && this.$refs.per.setCheckedNodes([]);
this.roleVisible = true;
},
//
handleRolePer(data, permissions) {
let result = data;
if (permissions.length) {
permissions.map(e => {
if (result.includes(e.id) && e.children) {
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id), 1);
}
e.children && e.children.length && this.handleRolePer(data, e.children);
});
}
return result;
},
async getDetail(row) { //
let res = await this.$get(`${this.api.obtainDetails}?id=${row.id}`);
this.form = res.role;
this.form.id = row.id;
this.checkedIds = this.handleRolePer(res.permissionList, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds);
},
showRole(row) {
this.isDetail = true;
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
editRole(row) {
this.isAdd = false;
this.getPer(row);
this.roleVisible = true;
},
async saveData() {
if (!this.form.roleName) return util.warningMsg("请填写角色名称");
if (!this.form.remark) return util.warningMsg("请填写角色描述");
if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限");
// ,(),
let permissionId = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = {
...this.form,
permissionId,
platformId:1,
};
if (this.form.id) {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("修改成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
} else {
this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("新增成功");
this.getData();
this.roleVisible = false;
}).catch(res => {});
}
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,86 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<el-input placeholder="请输入站点名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable style="width: 300px"></el-input>
</li>
</ul>
</div>
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="站点名称" align="center"></el-table-column>
<el-table-column prop="domain" label="域名" align="center"></el-table-column>
<el-table-column label="操作" width="170" align="center">
<template slot-scope="scope">
<el-button type="text" @click="toIndex(scope.row)">前往网站首页</el-button>
<el-button type="text" @click="content(scope.row)">内容管理</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import { mapState } from "vuex";
import util from "@/libs/util";
export default {
data() {
return {
keyword: '',
page: +this.$route.query.page || 1, //
pageSize: 10, // 10
total: 0, //
list: [
{
id: 1,
name: '粒子研究院中文站点',
domain: 'www.iasf.ac.cn'
},
{
id: 2,
name: '粒子研究院英文文站点',
domain: 'www.iasf.ac.en'
}
]
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500)
}
},
mounted() {
},
methods: {
handleCurrentChange(val) {
this.page = val
},
//
toIndex(row) {
},
//
content(row) {
this.$router.push(`/page`)
},
}
};
</script>
<style lang="scss" scoped>
</style>

@ -20,38 +20,7 @@
</div>
<div style="height: 504px; max-height: 504px; overflow: auto">
<org-tree
v-if="treeVisible"
default-expand-all
ref="orgTree"
node-key="id"
highlight-current
lazy
:load="loadNodeTree"
:expand-on-click-node="false"
@node-click="handleNodeClick"
:current-node-key="architectureId"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name" :title="node.label">{{ node.label }}</span>
<span>
<el-button
v-auth="'学生组织架构编辑'"
type="text"
icon="el-icon-edit-outline"
@click="() => handleEdit(node, data)">
</el-button>
<el-button
v-auth="'学生组织架构添加'"
v-if="node.level < 3"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => handleAdd(node, data)">
</el-button>
</span>
</span>
</org-tree>
<el-tree :data="orgs" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>
</div>
@ -255,6 +224,11 @@ export default {
data() {
let that = this;
return {
orgs: [],
defaultProps: {
children: 'children',
label: 'label'
},
isRemove: false, //
currentClassId: "", // id
studentType: 1, //:(1. 2.)
@ -376,8 +350,9 @@ export default {
])
},
mounted() {
this.getOrg()
this.originForm = JSON.parse(JSON.stringify(this.form))
this.getData();
// this.getData();
},
watch: {
keyWord: function(val) {
@ -396,6 +371,13 @@ export default {
}
},
methods: {
//
getOrg() {
this.$get(this.api.depts).then(res => {
this.listData = res.page;
this.total = res.total;
}).catch(err => {})
},
handleNodeClick(data) { //
if (data.level === 3) {
this.isRemove = true;

@ -10,12 +10,13 @@ const service = axios.create({
});
// post请求头
service.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
// service.defaults.withCredentials = true
// 请求拦截器
service.interceptors.request.use(config => {
util.getToken();
let token = util.local.get(Setting.tokenKey);
if (token) config.headers.token = token;
config.headers.captcha = ''
return config;
}, err => {
util.errorMsg({
@ -31,12 +32,12 @@ service.interceptors.request.use(config => {
service.interceptors.response.use(
response => {
const res = response.data;
if (res.status == 200 || res.status == 10000 || res.status == 30001) {
return Promise.resolve(res).catch(e => {});
} else if (!res.status) {
console.log("🚀 ~ file: index.js ~ line 34 ~ res", res)
if (res.code == 200) {
return Promise.resolve(res).catch(e => {});
} else {
util.errorMsg(res.message);
util.errorMsg(res.msg);
console.log("🚀 ~ file: index.js ~ line 39 ~ res", res)
return Promise.reject(res)
// return Promise.resolve(res).catch(e => {});
}

@ -0,0 +1,29 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'article-'
export default {
path: '/article',
name: 'article',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/article/list'),
meta: { title: '文章管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/article/add'),
meta: { title: '添加文章' }
}
]
}

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

@ -0,0 +1,29 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'column-'
export default {
path: '/column',
name: 'column',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/column/list'),
meta: { title: '栏目管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/column/add/index.vue'),
meta: { title: '添加栏目' }
}
]
}

@ -0,0 +1,29 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'page-'
export default {
path: '/page',
name: 'page',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/page/list'),
meta: { title: '页面管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/page/add/index.vue'),
meta: { title: '添加页面' }
}
]
}

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'role-'
export default {
path: '/role',
name: 'role',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/role/list'),
meta: { title: '角色管理' }
}
]
}

@ -13,11 +13,11 @@ export default {
meta,
component: BasicLayout,
children: [
{
name: `${pre}person`,
path: `person`,
component: () => import("@/pages/setting/list"),
meta: { title: "个人中心" }
}
// {
// name: `${pre}person`,
// path: `person`,
// component: () => import("@/pages/setting/list"),
// meta: { title: "个人中心" }
// }
]
};

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'site-'
export default {
path: '/site',
name: 'site',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/site/list'),
meta: { title: '站点管理' }
}
]
}

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

@ -3,8 +3,6 @@
* */
const url = location.host;
const isDev = process.env.NODE_ENV === "development"; // 开发环境
const isHh = url.includes("10.196.131.73"); //是否河海版本
const isCH = url.includes("124.71.12.62"); //是否巢湖版本
const isPro = url.includes("occupationlab.com"); //是否职站生产
const isTest = url.includes('121.37.12.51'); //是否中台测试服
@ -12,7 +10,6 @@ let bankPath = `${location.origin}/banksystem` // 银行系统地址
let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}/`
let uploadURL = `http://121.37.12.51/`
let title = (isHh || isCH) ? '教师管理端' : '职站服务端管理系统'
if (isPro) {
// 职站生产
@ -23,8 +20,8 @@ if (isPro) {
jumpPath = "http://192.168.31.125:8087/";
bankPath = `http://192.168.31.125:8093`
host = "http://121.37.12.51/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕
// host = 'http://192.168.31.137:9000/'; // 赓
// host = "http://192.168.31.151:10000/"; // 榕
host = 'http://192.168.31.137:10000/'; // 赓
}
const Setting = {
@ -33,7 +30,7 @@ const Setting = {
* */
platformId: 1, // 平台标识,1职站,2数据平台,3中台
platformType: 0, // 平台端区分:0->教师端 1->学生端 2->无端
titleSuffix: title, // 网页标题的后缀
titleSuffix: '粒子研究院', // 网页标题的后缀
routerMode: "hash", // 路由模式,可选值为 history 或 hash
showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址
@ -83,7 +80,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: true,
dynamicRoute: false,
// 文件上传
upload: {
apiURL: uploadURL,

@ -10,125 +10,29 @@ import addRoutes from "@/libs/route/addRoutes";
export default {
namespaced: true,
state: {
customer: false, // true:为客户,没有个人中心
customerName: "", // 客户名称
title: "",
logoUrl: "",
avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
userId: 3,
userName: "",
roleId: "",
dataTime: "",
roleName: '',
schoolId: '',
fromClient: false, // 是否从学生端登录
logView: false // 是否查询过日志状态,如果有,则不再调接口
userId: '',
userName: '',
},
mutations: {
SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.userAvatars;
state.userId = info.userId;
state.userName = info.userName;
state.roleId = info.roleId;
state.dataTime = info.dataTime;
},
SET_CUSTOMER: (state, customer) => {
state.customer = customer;
},
SET_CUSTOMER_NAME: (state, customerName) => {
state.customerName = customerName;
},
SET_TITLE: (state, title) => {
state.title = title;
},
SET_LOGO_URL: (state, logoUrl) => {
state.logoUrl = logoUrl;
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar;
},
SET_USERNAME: (state, userName) => {
state.userName = userName;
state.avatar = avatar
},
SET_ROLENAME: (state, roleName) => {
state.roleName = roleName
SET_USERID: (state, userId) => {
state.userId = userId
},
SET_FROM: (state, fromClient) => {
state.fromClient = fromClient
},
SET_SCHOOLID: (state, schoolId) => {
state.schoolId = schoolId
},
SET_LOG: (state) => {
state.logView = true
SET_USERNAME: (state, userName) => {
state.userName = userName
},
},
actions: {
login({ state, commit }, userInfo) {
return new Promise((resolve, reject) => {
post(api.logins, userInfo).then(res => {
// console.log(JSON.stringify(res));
if (res.status == 200) {
let { data } = res;
// 生成路由权限
// 每个系统都是用这套角色权限代码的,后端也是基本一样,除了个别字段可能会不一样
// 总体来说就两个步骤: 1是生成能够访问的路由的数组集合,2是生成能看到的按钮的数组集合
// res.message.listValue && Setting.dynamicRoute && addRoutes(res.message.listValue)
// 2021-10-13重做权限,因权限系统封装
util.local.set(Setting.tokenKey, data.token, Setting.tokenExpires);
commit("SET_CUSTOMER", data.customer);
commit("SET_CUSTOMER_NAME", data.customerName);
util.successMsg("登录成功");
commit("SET_INFO", data);
resolve();
} else {
console.log(res.message)
util.errorMsg(res.message);
reject(res);
}
}).catch(error => {
reject(error);
});
});
},
logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
util.local.remove(Setting.storeKey);
util.local.remove(Setting.tokenKey);
if (state.fromClient) {
util.cookies.remove('serverLogin')
location.href = Setting.isDev
? `http://${location.hostname}:8082/#/`
: Setting.isTest
? `${location.origin}/student/#/login`
: `${location.origin}/#/login`
} else {
location.reload()
}
resolve();
});
},
setInfo({ state, commit }, info) {
commit("SET_INFO", info);
},
setTitle({ state, commit }, title) {
commit("SET_TITLE", title);
},
setLogoUrl({ state, commit }, logoUrl) {
commit("SET_LOGO_URL", logoUrl);
},
setCustomer({ state, commit }, customer) {
commit("SET_CUSTOMER", customer);
},
setCustomerName({ state, commit }, customerName) {
commit("SET_CUSTOMER_NAME", customerName);
},
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},
setUserName({ state, commit }, userName) {
commit("SET_USERNAME", userName);
}
}
};

@ -19,7 +19,9 @@
border-radius: 6px;
background: #d7d7d7;
}
.el-tooltip__popper.is-dark, .el-menu--vertical[x-placement="right-start"] {
display: none !important;
}
.flex-between {
display: flex;
justify-content: space-between;

@ -1,6 +1,6 @@
/* 改变主题色变量 */
$--color-primary: #9278FF;
$--color-primary: #2962FF;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';

@ -13,5 +13,5 @@ body {
min-width: 1280px;
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-size: 14px;
background: rgba(0, 0, 0, 0.05);
background: #F0F2F5;
}

@ -1,4 +1,4 @@
$main-color: #9278FF;
$main-color: #2962FF;
$max-width: 1440px;
$min-width: 1280px;

Loading…
Cancel
Save