diff --git a/src/api/index.js b/src/api/index.js index a7bf455..2d1ee0f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -87,6 +87,7 @@ export default { queryProjectManage: `${host}occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选) updateIsOpen: `${host}occupationlab/projectManage/updateIsOpen`, // 更新开启状态 getProjectDetail: `${host}occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情 + saveProjectDraft: `${host}occupationlab/projectManage/saveProjectDraft`, // 新增项目管理 addProjectManage: `${host}occupationlab/projectManage/addProjectManage`, // 新增项目管理 updateProjectManage: `${host}occupationlab/projectManage/updateProjectManage`, // 修改项目管理 copyProjectManage: `${host}occupationlab/projectManage/copyProjectManage`, // 复制项目管理 diff --git a/src/libs/util.cookies.js b/src/libs/util.cookies.js index 75c1c8d..17423b8 100644 --- a/src/libs/util.cookies.js +++ b/src/libs/util.cookies.js @@ -14,7 +14,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) { expires: Setting.cookiesExpires }; Object.assign(currentCookieSetting, cookieSetting); - Cookies.set(`admin-${name}`, value, currentCookieSetting); + Cookies.set(name, value, currentCookieSetting); }; /** @@ -22,7 +22,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) { * @param {String} name cookie name */ cookies.get = function(name = "default") { - return Cookies.get(`admin-${name}`); + return Cookies.get(name); }; /** @@ -37,7 +37,7 @@ cookies.getAll = function() { * @param {String} name cookie name */ cookies.remove = function(name = "default") { - return Cookies.remove(`admin-${name}`); + return Cookies.remove(name); }; export default cookies; diff --git a/src/pages/achievement/list/index.vue b/src/pages/achievement/list/index.vue index 227f34c..7ed681b 100644 --- a/src/pages/achievement/list/index.vue +++ b/src/pages/achievement/list/index.vue @@ -89,7 +89,7 @@ @@ -208,11 +208,12 @@ export default { this.loadIns = Loading.service({ background: "rgba(255,255,255,.6)" }); + const per = this.projectPermissions const curriculumId = this.curriculumId const curr = this.curriculumList.find(e => e.cid == curriculumId) let data = { classId: this.classId, - permissions: this.projectPermissions, + permissions: per, curriculumId, keyWord: this.keyword, startTime: this.startingtime, @@ -223,22 +224,32 @@ export default { systemId: curr ? curr.systemId : '' }; this.$post(this.api.getAchievementInfo, data).then(res => { - if(this.projectPermissions == 0){ - this.listData = res.page; - this.total = res.total; - }else{ - this.listData = res.page.records; - this.total = res.page.total; - } - this.$nextTick(() => { - this.loadIns.close(); - }); + let list = [] + if(per == 0){ + list = res.page + this.total = res.total + }else{ + list = res.page.records + this.total = res.page.total + } + console.log(33, per) + list.map(e => { + // isAdmin表示这个项目是不是内置的项目,如果为1 表示内置的项目,删除的前提条件就是这个项目删除了isdel=1以及courseDel=1 同时课程管理也移除了这个项目才能删除, 所以要系统内置的项目要满足这三个条件(1.为内置 2.中台删除了、3、课程里面也移除了)才能删除。是isAdmin为0就说明不是内置项目,为当前用户自己创建的项目,所以条件就是isDel为1直接删 + e.canDel = per ? + e.isDel : + (e.isAdmin === 0 && e.isDel === 1) || (e.isAdmin === 1 && e.isDel === 1 && e.courseDel === 1) + }) + this.listData = list + this.$nextTick(() => { + this.loadIns.close() + }); }).catch(res => { - this.loadIns.close(); + this.loadIns.close() }); }, perChange(val) { - this.$router.push(`list?per=${val}`) + this.$router.push(`list?per=${val}`) + this.getData() }, initData() { this.$refs.table.clearSelection(); @@ -246,7 +257,7 @@ export default { this.getData(); }, disabledSelection(row, index) { // 禁用勾选 - if ((row.isAdmin === 1 && (row.isDel === 1 || row.courseDel === 1)) || (row.isAdmin === 0 && row.isDel === 1)) return true + if (row.canDel) return true return false }, // 进入实验记录 diff --git a/src/pages/assessment/add/index.vue b/src/pages/assessment/add/index.vue index 08033fe..f4fc7a7 100644 --- a/src/pages/assessment/add/index.vue +++ b/src/pages/assessment/add/index.vue @@ -39,11 +39,11 @@
实验时长: - + 天 - + 小时 - +
@@ -434,11 +434,18 @@ export default { } if (this.form.type == 1 && this.form.experimentDuration == "0d0h0m") return util.warningMsg("请填写实验时长"); if (this.form.type == 2 && this.startTime == "0000-00-00 00:00:00") return util.warningMsg("请填写实验时间"); + if (this.form.type == 1) { + const duration = this.duration + if (String(duration.day).includes('.')) return util.warningMsg('实验天数请填写整数') + if (String(duration.hour).includes('.')) return util.warningMsg('实验小时请填写整数') + if (String(duration.minute).includes('.')) return util.warningMsg('实验分钟请填写整数') + } if (!this.form.projectId) return util.warningMsg("请选择实训项目"); if (this.form.isSpecify == 0 && this.form.isEnableCode == 1) { if (!this.form.invitationCode) return util.warningMsg("请设置邀请码"); if (!this.form.invitationCode || String(this.form.invitationCode).length < 6 || isNaN(this.form.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码"); } + debugger if (this.form.type == 2) { this.form.startTime = this.startTime; this.form.stopTime = this.stopTime; diff --git a/src/pages/project/add/index.vue b/src/pages/project/add/index.vue index a808c55..655253d 100644 --- a/src/pages/project/add/index.vue +++ b/src/pages/project/add/index.vue @@ -16,16 +16,6 @@
- - - - - - - - - - + + + + + + + + + +
@@ -222,6 +222,7 @@ export default { selectedJudgment: [], // 选中的判分点 rowKey: "", // 判分点行数据的 Key projectNameRepeat: false, // 项目名称是否重复 + originName: '', flag: false, //判分点表格分数是否禁用 avgValuelist: [], //取得判分点平均分的数组 @@ -316,6 +317,7 @@ export default { 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; @@ -328,17 +330,18 @@ export default { }); }, projectNameExistis() { // 项目管理名称判重 - if (this.projectManage.projectName) { - this.$post(this.api.queryNameIsExist, { projectName: this.projectManage.projectName }).then(res => { - if (res.status === 200) { - this.projectNameRepeat = false; - } - }).catch(err => { - this.projectNameRepeat = true; - }); - } else { - this.projectNameRepeat = false; - } + 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) { @@ -353,7 +356,11 @@ export default { }); } }, - judgmentRelease() { //判断能否成功发布 + // 去除空白标签 + removeTag(val) { + return val.replace('


', '') + }, + judgmentRelease(state) { //判断能否成功发布 let { projectName, experimentTarget, @@ -369,35 +376,37 @@ export default { util.warningMsg("该项目名称已存在"); return false; } - if (!experimentTarget) { - util.warningMsg("请输入实验目标"); - return false; - } - if (!experimentDescription) { - util.warningMsg("请输入案例描述"); - return false; - } - if (this.projectJudgmentData.length == 0) { - util.warningMsg("请添加判分点"); - return false; - } - if (this.handDistributionScore < 100) { - util.warningMsg("判分点分数未满100"); - return false; - } - if (this.handDistributionScore > 100) { - util.warningMsg("判分点分数已超过100"); - return false; - } - if (!experimentHint && hintOpen == 0) { - util.warningMsg("请输入实验提示"); - return false; + if (state) { + if (!experimentTarget || !this.removeTag(experimentTarget)) { + util.warningMsg("请输入实验目标"); + return false; + } + if (!experimentDescription || !this.removeTag(experimentDescription)) { + util.warningMsg("请输入案例描述"); + return false; + } + if (this.projectJudgmentData.length == 0) { + util.warningMsg("请添加判分点"); + return false; + } + if (this.handDistributionScore < 100) { + util.warningMsg("判分点分数未满100"); + return false; + } + if (this.handDistributionScore > 100) { + util.warningMsg("判分点分数已超过100"); + return false; + } + if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) { + util.warningMsg("请输入实验提示"); + return false; + } } return true; }, handleSubmit(state) { //处理提交 if (this.submiting) return false - if (!this.judgmentRelease()) { //判断页面是否有没有输入的内容 + if (!this.judgmentRelease(state)) { //判断页面是否有没有输入的内容 return; } this.submiting = true @@ -443,7 +452,8 @@ export default { }); }, addProject(params) { // 添加项目 - this.$post(`${this.api.addProjectManage}`, params).then(res => { + 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 => { @@ -543,7 +553,7 @@ export default { this.visibleLoading = false; this.judgementData = result; }).catch(err => { - console.log(err); + this.visibleLoading = false }); }, getProgrammingClassData(params) { // 获取编程类判分点列表数据 @@ -556,10 +566,8 @@ export default { }); this.visibleLoading = false; this.judgementData = result; - // console.log(res, "res"); - // console.log(this.projectJudgmentData, "projectJudgmentData"); }).catch(err => { - console.log(err); + this.visibleLoading = false }); }, handleSelectionJudgment(val) { // 处理多选判分点 diff --git a/src/pages/project/list/index.vue b/src/pages/project/list/index.vue index 6a0c436..9c13676 100644 --- a/src/pages/project/list/index.vue +++ b/src/pages/project/list/index.vue @@ -91,7 +91,7 @@ 删除 复制
  • - - + +
  • @@ -77,7 +77,7 @@
  • - +
  • @@ -776,7 +776,7 @@ export default { // }); // if (isEmpty) return util.warningMsg("请选择职业"); // if (this.accountReapeat) return util.warningMsg("该账号已存在"); - if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的证件号码"); + if (this.personalInformation.idNumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idNumber)) return util.warningMsg("请输入正确的身份证号码"); let form = this.personalInformation; let personalFileList = []; this.archivesList.forEach((n, k) => { @@ -1092,7 +1092,7 @@ export default { width: 80px; } } - + .l-title{ display: flex; align-items: center; diff --git a/src/setting.js b/src/setting.js index 81ad999..60ff857 100644 --- a/src/setting.js +++ b/src/setting.js @@ -40,8 +40,8 @@ if (isHh) { jumpPath = "http://192.168.31.125:8087/"; bankPath = `http://192.168.31.125:8093` // host = "http://www.occupationlab.com:9000/";//线上 - host = "http://39.108.250.202:9000/"; // 中台测试服 - // host = "http://192.168.31.151:9000/"; // 榕 + // host = "http://39.108.250.202:9000/"; // 中台测试服 + host = "http://192.168.31.151:9000/"; // 榕 // host = 'http://192.168.31.137:9000/'; // 赓 title = "职站服务端管理系统"; } else { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 06064f2..b523924 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -89,6 +89,7 @@ export default { util.local.remove(Setting.storeKey); util.local.remove(Setting.tokenKey); if (state.fromClient) { + util.cookies.remove('serverLogin') location.href = Setting.isDev ? `http://192.168.31.125:8082/#/` : Setting.isTest