优化代码,修复bug

dev_2022-05-11
yujialong 3 years ago
parent 81925b4298
commit 2d0694ec85
  1. 50
      src/api/index.js
  2. 12
      src/layouts/header/index.vue
  3. 2
      src/main.js
  4. 2
      src/pages/achievement/edit/index.vue
  5. 2
      src/pages/achievement/list/index.vue
  6. 2
      src/pages/information/contentManage/contentList.vue
  7. 4
      src/pages/match/add/index.vue
  8. 6
      src/pages/match/list/manage/matchDetail.vue
  9. 7
      src/pages/match/manage/matchDetail.vue
  10. 2
      src/pages/project/add/index.vue
  11. 5
      src/pages/setting/list/index.vue
  12. 32
      src/pages/student/list/index.vue
  13. 32
      src/pages/system/list/staff.vue
  14. 2
      src/plugins/requests/index.js
  15. 2
      src/router/index.js
  16. 5
      src/store/modules/user.js

@ -169,8 +169,8 @@ export default {
queryUserInfoDetails: `${host}users/users/userAccount/queryUserInfoDetails`,//个人中心信息展示 queryUserInfoDetails: `${host}users/users/userAccount/queryUserInfoDetails`,//个人中心信息展示
updatePersonCenter: `${host}users/users/userAccount/updatePersonCenter`,//个人中心信息修改 updatePersonCenter: `${host}users/users/userAccount/updatePersonCenter`,//个人中心信息修改
examinePassword: `${host}users/users/userAccount/examinePassword`,//更换密码 examinePassword: `${host}users/users/userAccount/examinePassword`,//更换密码
bindPhoneOrEmail: `${host}/users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱 bindPhoneOrEmail: `${host}users/users/userAccount/bindPhoneOrEmail`,// 绑定手机或邮箱
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码 sendPhoneOrEmailCode: `${host}users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
// 系统设置 // 系统设置
// 员工组织架构 // 员工组织架构
@ -207,52 +207,6 @@ export default {
updateLogInNumber: `${host}liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间
queryAccountIsExist: `${host}liuwanr/userInfo/queryAccountIsExist`,//查询员工,学生账号是否存在接口
queryWorkNumberIsExist: `${host}liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在
querySchool: `${host}liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryPersonalCenter: `${host}liuwanr/personalCenter/queryPersonalCenter`,
addStaffPro: `${host}liuwanr/staffProfessionalArchitecture/addStaffProfessionalArchitecture`, //添加员工专业
queryStaffPro: `${host}liuwanr/staffProfessionalArchitecture/queryAllStaffProfessionalArchitecture`, //查询员工专业
deleteStaffPro: `${host}liuwanr/staffProfessionalArchitecture/deleteStaffProfessionalArchitecture`, //删除员工专业
deleteStaffGrade: `${host}liuwanr/staffGrade/deleteStaffGrade`, //删除员工部门
updateStaffPro: `${host}liuwanr/staffProfessionalArchitecture/updateStaffProfessionalArchitecture`, //编辑员工专业
queryStaffGrade: `${host}liuwanr/staffGrade/queryStaffGrade`, //查询员工部门
queryStaffGradeDetails: `${host}liuwanr/staffGrade/queryStaffGradeDetails`, //查询员工部门详情
addStaffGrade: `${host}liuwanr/staffGrade/addStaffGrade`, //新增员工部门
updateStaffGrade: `${host}liuwanr/staffGrade/updateStaffGrade`, //编辑员工部门
queryPhone: `${host}liuwanr/user/queryPhone`, //查询电话是否存在
queryEmail: `${host}liuwanr/user/queryEmail`, //查询邮箱是否存在
queryStaffPAN: `${host}liuwanr/staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在
// 员工管理
addStaff: `${host}evaluation/tms/system/addStaff`,
daleteBatchStaff: `${host}evaluation/tms/system/daleteBatchStaff`,
queryStaff: `${host}evaluation/tms/system/queryStaff`,
querystaffDetail: `${host}evaluation/tms/system/querystaffDetail`,
updateStaff: `${host}evaluation/tms/system/updateStaff`,
downloadStaff: `${host}evaluation/tms/system/download`,
export_failureStaff: `${host}evaluation/tms/system/export_failure`,
uploadFileStaff: `${host}evaluation/tms/system/uploadFile`,
queryAccountStaff: `${host}evaluation/tms/system/queryAccount`,
// resetPwd: `${host}evaluation/tms/system/resetPwd`,
dalStaffByStaffGradeId: `${host}evaluation/tms/system/dalStaffByStaffGradeId`,
dalStaffByProfessionalId: `${host}evaluation/tms/system/dalStaffByProfessionalId`,
// 角色权限
rolePermissionList: `${host}evaluation/sys-permission/rolePermissionList`,
saveRolePermission: `${host}evaluation/sys-permission/saveRolePermission`,
updateRolePermission: `${host}evaluation/sys-permission/updateRolePermission`,
delRolePermission: `${host}evaluation/sys-permission/delRolePermission`,
queryPermissionArrById: `${host}evaluation/sys-permission/queryPermissionArrById`,
roleTree: `${host}evaluation/sys-permission/tree`,
// 教师评语 // 教师评语
addComment: `${host}evaluation/comment/addComment`, addComment: `${host}evaluation/comment/addComment`,
queryComment: `${host}evaluation/comment/queryComment`, queryComment: `${host}evaluation/comment/queryComment`,

@ -31,10 +31,11 @@ export default {
}, },
mounted() { mounted() {
this.getSystemDetail(); this.getSystemDetail();
this.getUserDetail();
}, },
methods: { methods: {
...mapActions("user", [ ...mapActions("user", [
"logout", "setTitle", "setLogoUrl" "logout", "setTitle", "setLogoUrl", "setAvatar", "setUserName"
]), ]),
toPersonal() { toPersonal() {
if (!this.customer) { if (!this.customer) {
@ -48,11 +49,16 @@ export default {
this.setTitle(res.data.title); this.setTitle(res.data.title);
this.setLogoUrl(res.data.logoUrl); this.setLogoUrl(res.data.logoUrl);
} }
} else {
util.errorMsg(res.message);
} }
}).catch(res => {}); }).catch(res => {});
}, },
getUserDetail () { //
this.$get(this.api.queryUserInfoDetails).then(res => {
let info = res.result.hrUserInfo;
this.setAvatar(info.userAvatars ? info.userAvatars : "");
this.setUserName(info.userName);
}).catch(res => {});
},
} }
}; };
</script> </script>

@ -39,7 +39,7 @@ Vue.prototype.auth = function(values){
// 直接拿值进行匹配,取得当前router的mate信息,传入,返回一个boolean,以此进行vif判断 // 直接拿值进行匹配,取得当前router的mate信息,传入,返回一个boolean,以此进行vif判断
// router.meta 信息匹配传进来的value,用vif去进行按钮级权限配置即可。 // router.meta 信息匹配传进来的value,用vif去进行按钮级权限配置即可。
// $router.currentRoute.meta // $router.currentRoute.meta
console.log(router.currentRoute.meta,'当前路由的按钮权限数组') // console.log(router.currentRoute.meta,'当前路由的按钮权限数组')
return router.currentRoute.meta.btn.some(e=>e===values) return router.currentRoute.meta.btn.some(e=>e===values)
} }
new Vue({ new Vue({

@ -306,7 +306,7 @@ export default {
util.successMsg("上传成功"); util.successMsg("上传成功");
this.getSgin(); this.getSgin();
} else { } else {
$message.error(res.errmessage); $message.error(res.message);
} }
}, },
goback() { goback() {

@ -75,7 +75,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="auth('成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button> <el-button v-if="auth('练习成绩管理') || auth('考核成绩管理')" type="text" @click="entry(scope.row)">成绩管理</el-button>
<el-button v-if="auth('删除')" type="text" :disabled="scope.row.isDel" @click="handleDelete(scope.row)" >删除</el-button> <el-button v-if="auth('删除')" type="text" :disabled="scope.row.isDel" @click="handleDelete(scope.row)" >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>

@ -6,7 +6,7 @@
<div class="btn-wrap"> <div class="btn-wrap">
<el-button v-if="auth('内容管理-保存排序')" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button> <el-button v-if="auth('内容管理-保存排序')" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button>
<el-button v-if="auth('内容管理-批量删除')" class="action-btn" type="primary" @click="delAllData">批量删除</el-button> <el-button v-if="auth('内容管理-批量删除')" class="action-btn" type="primary" @click="delAllData">批量删除</el-button>
<el-button v-if="auth('内容管理-新增')" class="action-btn" type="primary" @click="addArticle">新增文章</el-button> <el-button v-if="auth('内容管理-新增文章')" class="action-btn" type="primary" @click="addArticle">新增文章</el-button>
</div> </div>
<div class="page-content" style="padding-top: 24px"> <div class="page-content" style="padding-top: 24px">
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">

@ -243,8 +243,8 @@ export default {
getData() { getData() {
this.$get(this.api.getContest + this.id) this.$get(this.api.getContest + this.id)
.then(res => { .then(res => {
if (res.errmessage == "success") { if (res.status == 200) {
let info = res.ExperimentalTeaching; let info = res.contest;
this.coverUrl = info.coverUrl; this.coverUrl = info.coverUrl;
this.description = info.description; this.description = info.description;
this.name = info.name; this.name = info.name;

@ -103,6 +103,7 @@
<script> <script>
import quill from "@/components/quill"; import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapActions } from "vuex";
export default { export default {
name: "matchDetail", name: "matchDetail",
@ -156,6 +157,9 @@ export default {
this.commitId(); this.commitId();
}, },
methods: { methods: {
...mapActions("match", [
"setMatchId"
]),
save(status) { save(status) {
this.sponsor = this.sponsorList.filter(d => d).join(); this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join(); this.undertaker = this.undertakerList.filter(d => d).join();
@ -231,7 +235,7 @@ export default {
}); });
}, },
commitId() { commitId() {
this.$store.commit("setMatchId", { matchId: this.id }); this.setMatchId(this.id);
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);

@ -103,6 +103,7 @@
<script> <script>
import quill from "@/components/quill"; import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapActions } from "vuex";
export default { export default {
name: "matchDetail", name: "matchDetail",
@ -156,6 +157,9 @@ export default {
this.commitId(); this.commitId();
}, },
methods: { methods: {
...mapActions("match", [
"setMatchId"
]),
save(status) { save(status) {
this.sponsor = this.sponsorList.filter(d => d).join(); this.sponsor = this.sponsorList.filter(d => d).join();
this.undertaker = this.undertakerList.filter(d => d).join(); this.undertaker = this.undertakerList.filter(d => d).join();
@ -231,7 +235,8 @@ export default {
}); });
}, },
commitId() { commitId() {
this.$store.commit("setMatchId", { matchId: this.id }); this.setMatchId(this.id);
// this.$store.commit("setMatchId", { matchId: this.id });
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);

@ -672,7 +672,7 @@ export default {
}; };
return obj; return obj;
}); });
await this.$post(this.api.updateProjectJudgment, param).then(res => { await this.$post(`${this.api.updateProjectJudgment}?projectId=${this.projectId}`, param).then(res => {
let tempArr = this.projectJudgmentData.map(i => { let tempArr = this.projectJudgmentData.map(i => {
let obj = { let obj = {
projectId: this.projectId ? this.projectId : "", projectId: this.projectId ? this.projectId : "",

@ -606,7 +606,8 @@ export default {
this.personalInformation.accountId = userInfo.id; this.personalInformation.accountId = userInfo.id;
this.originAccount = this.personalInformation.account; this.originAccount = this.personalInformation.account;
this.archivesList = res.result.personalFileList; this.archivesList = res.result.personalFileList;
if (userInfo.userAvatars) this.avatar = userInfo.userAvatars; if (userInfo.userAvatars) this.setAvatar(userInfo.userAvatars);
this.$nextTick(() => { this.$nextTick(() => {
if (this.personalInformation.provinceId) { if (this.personalInformation.provinceId) {
@ -714,7 +715,7 @@ export default {
data.userid = this.userId; data.userid = this.userId;
this.$post(this.api.examinePassword, data) this.$post(this.api.examinePassword, data)
.then(res => { .then(res => {
if (res.errmessage == "success") { if (res.status === 200) {
util.successMsg("更换成功"); util.successMsg("更换成功");
this.passwordVisible = false; this.passwordVisible = false;
} }

@ -665,7 +665,13 @@ export default {
}, },
async accountChange() { async accountChange() {
if (this.form.account) { if (this.form.account) {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?account=${this.form.account}&workNumber=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkWorkNumOrAccount}?account=${this.form.account}&workNumber=`;
} else {
url = `${this.api.checkWorkNumOrAccount}?accountId=${this.form.accountId}&account=${this.form.account}&workNumber=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.accountReapeat = false; this.accountReapeat = false;
} else { } else {
@ -676,7 +682,13 @@ export default {
}, },
async worknumberChange() { async worknumberChange() {
if (this.form.workNumber) { if (this.form.workNumber) {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?workNumber=${this.form.workNumber}&account=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkWorkNumOrAccount}?workNumber=${this.form.workNumber}&account=`;
} else {
url = `${this.api.checkWorkNumOrAccount}?accountId=${this.form.accountId}&workNumber=${this.form.workNumber}&account=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.workNumberReapeat = false; this.workNumberReapeat = false;
} else { } else {
@ -688,7 +700,13 @@ export default {
async phoneChange() { async phoneChange() {
let regex = /^1[3456789]\d{9}$/; let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.form.phone)) { if (regex.test(this.form.phone)) {
let res = await this.$post(`${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`;
} else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&phone=${this.form.phone}&email=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.phoneRepeat = false; this.phoneRepeat = false;
} else { } else {
@ -700,7 +718,13 @@ export default {
async emailChange() { async emailChange() {
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if (regex.test(this.form.email)) { if (regex.test(this.form.email)) {
let res = await this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`;
} else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.form.accountId}&email=${this.form.email}&phone=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.emailRepeat = false; this.emailRepeat = false;
} else { } else {

@ -357,7 +357,13 @@ export default {
}, },
async accountChange() { // async accountChange() { //
if (this.teacherForm.account) { if (this.teacherForm.account) {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?account=${this.teacherForm.account}&workNumber=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkWorkNumOrAccount}?account=${this.teacherForm.account}&workNumber=`;
} else {
url = `${this.api.checkWorkNumOrAccount}?accountId=${this.teacherForm.accountId}&account=${this.teacherForm.account}&workNumber=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.accountReapeat = false; this.accountReapeat = false;
} else { } else {
@ -368,7 +374,13 @@ export default {
}, },
async workNumberChange() { // async workNumberChange() { //
if (this.teacherForm.workNumber) { if (this.teacherForm.workNumber) {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?workNumber=${this.teacherForm.workNumber}&account=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkWorkNumOrAccount}?workNumber=${this.teacherForm.workNumber}&account=`;
} else {
url = `${this.api.checkWorkNumOrAccount}?accountId=${this.teacherForm.accountId}&workNumber=${this.teacherForm.workNumber}&account=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.workNumberReapeat = false; this.workNumberReapeat = false;
} else { } else {
@ -380,7 +392,13 @@ export default {
async phoneChange() { // async phoneChange() { //
let regex = /^1[3456789]\d{9}$/; let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.teacherForm.phone)) { if (regex.test(this.teacherForm.phone)) {
let res = await this.$post(`${this.api.checkEmailOrPhone}?phone=${this.teacherForm.phone}&email=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkEmailOrPhone}?phone=${this.teacherForm.phone}&email=`;
} else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.teacherForm.accountId}&phone=${this.teacherForm.phone}&email=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.phoneRepeat = false; this.phoneRepeat = false;
} else { } else {
@ -392,7 +410,13 @@ export default {
async emailChange() { // async emailChange() { //
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if (regex.test(this.teacherForm.email)) { if (regex.test(this.teacherForm.email)) {
let res = await this.$post(`${this.api.checkEmailOrPhone}?email=${this.teacherForm.email}&phone=`); let url = "";
if (this.isAdd) {
url = `${this.api.checkEmailOrPhone}?email=${this.teacherForm.email}&phone=`;
} else {
url = `${this.api.checkEmailOrPhone}?accountId=${this.teacherForm.accountId}&email=${this.teacherForm.email}&phone=`;
}
let res = await this.$post(url);
if (res.status === 200) { if (res.status === 200) {
this.emailRepeat = false; this.emailRepeat = false;
} else { } else {

@ -35,7 +35,7 @@ service.interceptors.response.use(
} else if (!res.status) { } else if (!res.status) {
return Promise.resolve(res).catch(e => {}); return Promise.resolve(res).catch(e => {});
} else { } else {
util.errorMsg(res.errmessage || res.message); util.errorMsg(res.message);
// return Promise.reject(res) // return Promise.reject(res)
return Promise.resolve(res).catch(e => {}); return Promise.resolve(res).catch(e => {});
} }

@ -186,7 +186,7 @@ function getPermission() {
} }
} }
}); });
console.log(permissionRouters, "处理好的"); // console.log(permissionRouters, "处理好的");
// 把处理完成的路由,add到router里 // 把处理完成的路由,add到router里
// 记录一下路由的名称,用于nav // 记录一下路由的名称,用于nav
let nav = data.map(e => e.path); let nav = data.map(e => e.path);

@ -51,7 +51,7 @@ export default {
login({ state, commit }, userInfo) { login({ state, commit }, userInfo) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
post(api.logins, userInfo).then(res => { post(api.logins, userInfo).then(res => {
console.log(JSON.stringify(res)); // console.log(JSON.stringify(res));
if (res.status == 200) { if (res.status == 200) {
let { data } = res; let { data } = res;
// 生成路由权限 // 生成路由权限
@ -63,11 +63,10 @@ export default {
commit("SET_CUSTOMER", data.customer); commit("SET_CUSTOMER", data.customer);
commit("SET_CUSTOMER_NAME", data.customerName); commit("SET_CUSTOMER_NAME", data.customerName);
util.successMsg("登录成功"); util.successMsg("登录成功");
console.log(data, "登录保存的数据");
commit("SET_INFO", data); commit("SET_INFO", data);
resolve(); resolve();
} else { } else {
util.errorMsg(res.errmessage || res.message); util.errorMsg(res.message);
reject(res); reject(res);
} }
}).catch(error => { }).catch(error => {

Loading…
Cancel
Save