diff --git a/src/assets/img/info1.png b/src/assets/img/info1.png new file mode 100644 index 0000000..164b91a Binary files /dev/null and b/src/assets/img/info1.png differ diff --git a/src/assets/img/info2.png b/src/assets/img/info2.png new file mode 100644 index 0000000..c988e0d Binary files /dev/null and b/src/assets/img/info2.png differ diff --git a/src/assets/img/info3.png b/src/assets/img/info3.png new file mode 100644 index 0000000..e4e7fa3 Binary files /dev/null and b/src/assets/img/info3.png differ diff --git a/src/assets/img/trash.png b/src/assets/img/trash.png new file mode 100644 index 0000000..9e0bbda Binary files /dev/null and b/src/assets/img/trash.png differ diff --git a/src/router/index.js b/src/router/index.js index 80b4c40..6260d6b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -129,7 +129,7 @@ let router = new Router({ }, { path: '/person', - component: () => import('../views/setting/Person.vue'), + component: () => import('../views/setting'), // meta: { title: '个人中心' } }, { diff --git a/src/utils/api.js b/src/utils/api.js index aa615c5..95225d6 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,7 +1,7 @@ import Setting from "@/setting"; const uploadURL = Setting.uploadURL -const host1 = 'http://192.168.31.137:9000/' +const host1 = 'http://39.108.250.202:9000/' export default { @@ -92,6 +92,7 @@ export default { queryProjectManage: `occupationlab/projectManage/queryProjectManage`, // 项目管理列表(分页、筛选) updateIsOpen: `occupationlab/projectManage/updateIsOpen`, // 更新开启状态 getProjectDetail: `occupationlab/projectManage/getProjectDetail`, // 根据项目id查询详情 + saveProjectDraft: `occupationlab/projectManage/saveProjectDraft`, // 新增项目管理 addProjectManage: `occupationlab/projectManage/addProjectManage`, // 新增项目管理 updateProjectManage: `occupationlab/projectManage/updateProjectManage`, // 修改项目管理 copyProjectManage: `occupationlab/projectManage/copyProjectManage`, // 复制项目管理 diff --git a/src/views/serve/projectAdd.vue b/src/views/serve/projectAdd.vue index c456feb..f6141d9 100644 --- a/src/views/serve/projectAdd.vue +++ b/src/views/serve/projectAdd.vue @@ -257,6 +257,7 @@ export default { selectedJudgment: [], // 选中的判分点 rowKey: "", // 判分点行数据的 Key projectNameRepeat: false, // 项目名称是否重复 + originName: '', flag: false, //判分点表格分数是否禁用 avgValuelist: [], //取得判分点平均分的数组 @@ -365,19 +366,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; - } else { - this.projectNameRepeat = true; - } - }).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) { @@ -392,6 +392,10 @@ export default { }); } }, + // 去除空白标签 + removeTag(val) { + return val.replace('


', '') + }, judgmentRelease(state) { //判断能否成功发布 let { projectName, @@ -409,14 +413,11 @@ export default { return false; } if (state) { - let reg = /<\/?.+?\/?>/g - let experimentTargets = experimentTarget.replace(reg, '') - if (!experimentTargets) { + if (!experimentTarget || !this.removeTag(experimentTarget)) { this.$message.warning("请输入实验目标"); return false; } - let experimentDescriptions = experimentDescription.replace(reg, '') - if (!experimentDescriptions) { + if (!experimentDescription || !this.removeTag(experimentDescription)) { this.$message.warning("请输入案例描述"); return false; } @@ -432,8 +433,7 @@ export default { this.$message.warning("判分点分数已超过100"); return false; } - let experimentHints = experimentHint.replace(reg, '') - if (!experimentHints && hintOpen == 0) { + if ((!experimentHint || !this.removeTag(experimentHint)) && hintOpen == 0) { this.$message.warning("请输入实验提示"); return false; } @@ -497,7 +497,7 @@ export default { }); }, addProject(params) { // 添加项目 - this.$post(`${this.api.addProjectManage}`, params).then(res => { + this.$post(this.api[params.projectManage.state ? 'addProjectManage' : 'saveProjectDraft'], params).then(res => { if (res.status === 200) { this.$message.success("添加实验项目成功"); this.$router.back(); @@ -609,7 +609,7 @@ export default { this.judgementData = result; } }).catch(err => { - console.log(err); + this.visibleLoading = false }); }, getProgrammingClassData(params) { // 获取编程类判分点列表数据 @@ -626,7 +626,7 @@ export default { this.judgementData = result; } }).catch(err => { - console.log(err); + this.visibleLoading = false }); }, handleSelectionJudgment(val) { // 处理多选判分点 diff --git a/src/views/serve/projectList.vue b/src/views/serve/projectList.vue index 6da7fd7..869b36f 100644 --- a/src/views/serve/projectList.vue +++ b/src/views/serve/projectList.vue @@ -97,6 +97,7 @@ 复制 +
+
+
+
+ + + 点击更换头像 + +
+ + +
+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/src/views/setting/info.vue b/src/views/setting/info.vue new file mode 100644 index 0000000..5827e80 --- /dev/null +++ b/src/views/setting/info.vue @@ -0,0 +1,943 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/staff.vue b/src/views/system/staff.vue index 5be3839..d426915 100644 --- a/src/views/system/staff.vue +++ b/src/views/system/staff.vue @@ -35,16 +35,19 @@ {{ node.label }} @@ -94,8 +97,8 @@
- 新增员工 - 批量导入 + 新增员工 + 批量导入
@@ -105,14 +108,14 @@ - - + + @@ -168,9 +171,10 @@
- 模板下载 + 模板下载
上传文件 @@ -383,7 +388,8 @@ export default { }, // 组织类别筛选回调 changeType() { - this.initData(true) + this.$refs.orgTree.setCurrentKey(null) + this.initData() }, // 添加部门 addOrg(node, data) { @@ -479,11 +485,10 @@ export default { this.getOrg() }, // 员工列表 - getStaff(fromType) { - const orgId = this.$refs.orgTree.getCurrentKey() || '' + getStaff() { this.$post(this.api.staffList, { type: this.studentType || 1, - staffArchitectureId: fromType ? '' : orgId, + staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '', keyWord: this.keyWord, pageNum: this.page, pageSize: this.pageSize @@ -500,10 +505,10 @@ export default { handleSelectionChange(val) { // 多选 this.multipleSelection = val }, - initData(fromType) { + initData() { this.$refs.table.clearSelection() this.page = 1 - this.getStaff(fromType) + this.getStaff() }, // 删除 delStaff(row) { @@ -518,8 +523,9 @@ export default { }, // 重置密码 resetPassword(row) { - this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { - this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=111aaa`).then(res => { + const newPwd = Setting.initialPassword + this.$confirm(`重置后的密码为:${newPwd},确定重置?`, "提示", { type: "warning" }).then(() => { + this.$get(`${this.api.resetPwd}?userId=${row.userId}&newPwd=${newPwd}`).then(res => { util.successMsg("重置成功") }).catch(res => {}) }).catch(() => {}) @@ -626,7 +632,6 @@ export default { submitStaff() { this.$refs.form.validate((valid) => { if (valid) { - debugger if (this.submiting) return false if (this.accountReapeat) return util.warningMsg("该账号已存在") if (this.workNumberReapeat) return util.warningMsg("该工号已存在") @@ -635,7 +640,7 @@ export default { this.submiting = true const form = JSON.parse(JSON.stringify(this.form)) const ids = form.staffArchitectureId - form.staffArchitectureId = ids.map(e => e[e.length - 1]) + if (ids) form.staffArchitectureId = ids.map(e => e[e.length - 1]) if (form.accountId) { this.$post(this.api.modifyStaff, form).then(res => { util.successMsg("编辑成功!") @@ -667,7 +672,6 @@ export default { }, // 关闭新增员工对话框 closeStaff() { - this.$refs.form.clearValidate() this.form = { accountId: '', userName: '', @@ -678,9 +682,8 @@ export default { email: '', staffArchitectureId: [], roleList: [] - }; + } this.isDetail = false - this.staffVisible = false this.getStaff() }, // 批量导入 @@ -690,7 +693,7 @@ export default { this.uploadFaild = false }, // 模板下载 - downLoad() { + download() { location.href = this.api.staffTemplate }, // 上传文件 @@ -703,15 +706,24 @@ export default { showFaild() { location.href = `${this.api.exportFailure}?exportCode=${this.exportCode}` }, + // 上传成功后重置渲染 + importSuccess() { + this.importVisible = false + this.studentType = 1 + this.keyWord = '' + this.$refs.orgTree.setCurrentKey(null) + this.getOrg() + }, uploadSuccess(res, file, fileList) { this.uploadFaild = false if (res.status === 200) { if (res.data.exportCode) { this.exportCode = res.data.exportCode this.uploadFaild = true + util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) + } else { + this.importSuccess() } - util.successMsg(`上传成功${res.data.successNum},上传失败${res.data.failureNum}`) - util.successMsg(`本次上传有${res.data.failureNum}个错误信息录入`) } else { res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") } @@ -731,10 +743,7 @@ export default { this.uploadFaild = false }, uploadSure() { - this.importVisible = false - this.studentType = 1 - this.keyWord = '' - this.initData() + this.uploadFaild ? this.importSuccess() : this.$refs.importStaff.submit() } } };