完善功能,删除冗余

dev_2022-05-11
yujialong 3 years ago
parent abd8350b60
commit b28b78d935
  1. 24
      src/layouts/header/index.vue
  2. 8
      src/pages/account/login/index.vue
  3. 3
      src/pages/course/add/index.vue
  4. 1
      src/pages/course/list/courseManagement/index.vue
  5. 1
      src/pages/match/add/index.vue
  6. 23
      src/pages/system/list/staff.vue
  7. 14
      src/pages/system/list/staffSide.vue
  8. 7
      src/pages/system/list/stafftree.vue
  9. 10
      src/setting.js
  10. 2
      src/store/modules/project.js
  11. 32
      src/store/modules/user.js

@ -7,7 +7,7 @@
<div class="action"> <div class="action">
<div class="user" @click="toPersonal"> <div class="user" @click="toPersonal">
<el-avatar :size="40" :src="avatar"></el-avatar> <el-avatar :size="40" :src="avatar"></el-avatar>
<span class="m-l-10">{{ userName }}</span> <span class="m-l-10">{{ customer ? customerName : userName }}</span>
</div> </div>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button> <el-button type="text" class="ml20" @click="logout">退出</el-button>
@ -21,16 +21,12 @@ import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
title: "",
logoUrl: ""
}; };
}, },
computed: { computed: {
...mapState("user", [ ...mapState("user", [
"avatar", "userName" "avatar", "userName", "title", "logoUrl", "customer", "customerName"
]),
...mapState("auth", [
"routes"
]) ])
}, },
mounted() { mounted() {
@ -38,16 +34,20 @@ export default {
}, },
methods: { methods: {
...mapActions("user", [ ...mapActions("user", [
"logout" "logout", "setTitle", "setLogoUrl"
]), ]),
toPersonal() { toPersonal() {
this.$router.push("/setting/person"); if (!this.customer) {
this.$router.push("/setting/person");
}
}, },
getSystemDetail () { getSystemDetail () {
this.$get(this.api.logoDetail).then(res => { this.$get(this.api.logoDetail).then(res => {
if (res.status === 200 && res.data) { if (res.status === 200) {
this.title = res.data.title; if (res.data) {
this.logoUrl = res.data.logoUrl; this.setTitle(res.data.title);
this.setLogoUrl(res.data.logoUrl);
}
} else { } else {
util.errorMsg(res.message); util.errorMsg(res.message);
} }

@ -1,10 +1,5 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="header">
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" />
<img class="logo" v-else src="@/assets/img/logo.png" />
</div>
<div class="main"> <div class="main">
<div class="box"> <div class="box">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
@ -72,7 +67,6 @@ import Setting from "@/setting";
export default { export default {
data: function() { data: function() {
return { return {
isHh: Setting.isHh,
activeName: "1", activeName: "1",
loginForm: { loginForm: {
account: "", account: "",
@ -111,7 +105,7 @@ export default {
}, },
methods: { methods: {
...mapActions("user", [ ...mapActions("user", [
"login" "login", "setTitle", "setLogoUrl"
]), ]),
getVerImg() { // getVerImg() { //
this.loginForm.random = Math.floor(Math.random() * 999999999); this.loginForm.random = Math.floor(Math.random() * 999999999);

@ -69,7 +69,6 @@ export default {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
schoolId: Setting.schoolId,
id: this.$route.query.id, id: this.$route.query.id,
isDetail: Boolean(this.$route.query.show), isDetail: Boolean(this.$route.query.show),
username: this.$store.state.name, username: this.$store.state.name,
@ -107,8 +106,6 @@ export default {
coverUrl: this.coverUrl, coverUrl: this.coverUrl,
description: this.description, description: this.description,
name: this.name, name: this.name,
schoolId: this.schoolId,
founderId: this.userId, founderId: this.userId,
founderName: this.username, founderName: this.username,
distinguish: 1 distinguish: 1

@ -80,7 +80,6 @@ export default {
name: "courseManagement", name: "courseManagement",
data() { data() {
return { return {
schoolId: this.$store.state.schoolId,
keyword: "", keyword: "",
classificationId: "", classificationId: "",
courseData: [], courseData: [],

@ -121,7 +121,6 @@ export default {
headers: { headers: {
token: util.local.get(Setting.tokenKey) token: util.local.get(Setting.tokenKey)
}, },
schoolId: Setting.schoolId,
id: "", id: "",
coverUrl: "", coverUrl: "",
carouselUrl: "", carouselUrl: "",

@ -198,9 +198,6 @@ export default {
uploadList: [], // uploadList: [], //
uploadFaild: false, // uploadFaild: false, //
oneDepartmentIds: "",
twoDepartmentIds: "",
gradeId: "", // ID gradeId: "", // ID
staffArchitectureId: "", // ID staffArchitectureId: "", // ID
}; };
@ -221,6 +218,14 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
removeByValue(val) {
for (var i = 0; i < this.length; i++) {
if (JSON.stringify(this[i]).indexOf(JSON.stringify(val)) != -1) {
this.splice(i, 1);
break;
}
}
},
handleCheck(data) { handleCheck(data) {
let oneDepartmentIds = []; let oneDepartmentIds = [];
let twoDepartmentIds = []; let twoDepartmentIds = [];
@ -232,14 +237,14 @@ export default {
} }
e.children.forEach(r => { e.children.forEach(r => {
if (r.ischeck) { if (r.ischeck) {
twoDepartmentIds.push(r.staffGradeId); twoDepartmentIds.push(r.gradeId);
} else { } else {
this.removeByValue(twoDepartmentIds, r.staffGradeId); this.removeByValue(twoDepartmentIds, r.gradeId);
} }
}); });
}); });
this.oneDepartmentIds = oneDepartmentIds.toString(); this.staffArchitectureId = oneDepartmentIds.toString();
this.twoDepartmentIds = twoDepartmentIds.toString(); this.gradeId = twoDepartmentIds.toString();
this.initData(); this.initData();
}, },
fircheck(val, val2) { fircheck(val, val2) {
@ -251,7 +256,7 @@ export default {
val.ischeck = !val.ischeck; val.ischeck = !val.ischeck;
val2.map(e => { val2.map(e => {
e.children.map(r => { e.children.map(r => {
if (r.staffGradeId == val.staffGradeId) { if (r.gradeId == val.gradeId) {
if (e.children.every(i => i.ischeck)) { if (e.children.every(i => i.ischeck)) {
e.ischeck = true; e.ischeck = true;
} else { } else {
@ -325,7 +330,7 @@ export default {
}, },
resetPassword(row) { // resetPassword(row) { //
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPassword}?userId=${row.accountId}&newPwd=111aaa`).then(res => { this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=111aaa`).then(res => {
if (res.status === 200) { if (res.status === 200) {
util.successMsg("重置成功"); util.successMsg("重置成功");
} else { } else {

@ -11,7 +11,7 @@
<el-dialog :title="Form.staffArchitectureId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.staffArchitectureId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules"> <el-form ref="Form" :model="Form" :rules="rules">
<el-form-item prop="staffArchitectureName"> <el-form-item prop="staffArchitectureName">
<el-input placeholder="请输入专业名称" v-model="Form.staffArchitectureName" @change="majorChange"></el-input> <el-input placeholder="请输入专业名称" v-model="Form.staffArchitectureName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -47,7 +47,6 @@ export default {
twoactive: 0, twoactive: 0,
isaddMajor: false, isaddMajor: false,
isAddDepartment: false, isAddDepartment: false,
schoolId: Setting.schoolId,
Form: { Form: {
staffArchitectureId: "", // ID staffArchitectureId: "", // ID
staffArchitectureName: "", // // staffArchitectureName: "", // //
@ -64,7 +63,6 @@ export default {
}, },
staffstateProfessId: "", staffstateProfessId: "",
staffstateId: "", staffstateId: "",
majorNoAdd: true
}; };
}, },
components: { components: {
@ -119,19 +117,9 @@ export default {
this.Form.staffArchitectureName = item.staffArchitectureName; this.Form.staffArchitectureName = item.staffArchitectureName;
this.isaddMajor = true; this.isaddMajor = true;
}, },
async majorChange() {
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.staffArchitectureName, schoolId: this.schoolId });
if (res.message.length != 0) {
util.warningMsg("该一级部门已存在");
this.majorNoAdd = false;
} else {
this.majorNoAdd = true;
}
},
sure(Form) { // / sure(Form) { // /
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
if (!this.majorNoAdd) return util.warningMsg("该一级部门已存在");
let data = { let data = {
staffArchitectureName: this.Form.staffArchitectureName, staffArchitectureName: this.Form.staffArchitectureName,
staffArchitectureId: this.Form.staffArchitectureId, staffArchitectureId: this.Form.staffArchitectureId,

@ -106,16 +106,13 @@ export default {
editDepartment(item) { editDepartment(item) {
this.$emit("editDepartment", item); this.$emit("editDepartment", item);
}, },
delDepart(item, index) { delDepartment(item, index) {
this.$emit("delDepart", item, index); this.$emit("delDepartment", item, index);
}, },
// //
addClass(item) { addClass(item) {
this.$emit("addClass", item); this.$emit("addClass", item);
}, },
delDepartment(item, index) {
this.$emit("delDepartment", item, index);
},
// //
isHasObj(arr, val) { isHasObj(arr, val) {
var flag = 0; //1 0 var flag = 0; //1 0

@ -13,7 +13,6 @@ let jumpPath = "";
let host = ""; let host = "";
let title = ""; let title = "";
let schoolId = null; let schoolId = null;
let systemList = [];
if (isHh) { if (isHh) {
// 河海 // 河海
@ -62,15 +61,6 @@ const Setting = {
showProgressBar: true, // 页面切换时,是否显示模拟的进度条 showProgressBar: true, // 页面切换时,是否显示模拟的进度条
apiBaseURL: host, // 接口请求地址 apiBaseURL: host, // 接口请求地址
jumpPath, // 判分点系统前缀 jumpPath, // 判分点系统前缀
isHh, // 是否是河海版本
isCH, // 是否是巢湖版本
isBeta, // 是否是职站测试
isPro, // 是否是职站生产
schoolId, // 学校id
systemId: systemList.length && systemList[0].id, // 默认系统id
// 子系统列表.改的时候留意要改的是哪个环境,别影响到了其他环境
// 以后如果卖给了其他学校,要给该学校单独开放子系统的话,就在下面这个数组里加判断就行,然后把需要开放的子系统放出来。不要复制这个职站项目另起一个项目,这样学校一多就很难维护了
systemList,
autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间 autoLogoutTime: 3600000, // 长时间未操作,自动退出登录时间
projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key projectData: "sta_data", // 新增项目跳转判分点数据存储cookie的key
modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒 modalDuration: 3, // 接口请求返回错误时,弹窗的持续时间,单位:秒

@ -4,7 +4,7 @@
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
lastSystemId: 1, lastSystemId: "",
projectFields: {}, projectFields: {},
assFields: {} assFields: {}
}, },

@ -10,10 +10,13 @@ import addRoutes from "@/libs/route/addRoutes";
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
customer: false, // true:为客户,没有个人中心
customerName: "", // 客户名称
title: "",
logoUrl: "",
avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png", avatar: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
userId: 3, userId: 3,
userName: "", userName: "",
schoolId: "",
roleId: "", roleId: "",
dataTime: "" dataTime: ""
}, },
@ -21,11 +24,22 @@ export default {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.userAvatars; if (info.avatar) state.avatar = info.userAvatars;
state.userId = info.userId; state.userId = info.userId;
state.schoolId = info.schoolId;
state.userName = info.userName; state.userName = info.userName;
state.roleId = info.roleId; state.roleId = info.roleId;
state.dataTime = info.dataTime; 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) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar; state.avatar = avatar;
}, },
@ -46,6 +60,8 @@ export default {
// res.message.listValue && Setting.dynamicRoute && addRoutes(res.message.listValue) // res.message.listValue && Setting.dynamicRoute && addRoutes(res.message.listValue)
// 2021-10-13重做权限,因权限系统封装 // 2021-10-13重做权限,因权限系统封装
util.local.set(Setting.tokenKey, data.token, Setting.tokenExpires); util.local.set(Setting.tokenKey, data.token, Setting.tokenExpires);
commit("SET_CUSTOMER", data.customer);
commit("SET_CUSTOMER_NAME", data.customerName);
util.successMsg("登录成功"); util.successMsg("登录成功");
console.log(data, "登录保存的数据"); console.log(data, "登录保存的数据");
commit("SET_INFO", data); commit("SET_INFO", data);
@ -67,12 +83,18 @@ export default {
resolve(); resolve();
}); });
}, },
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},
setInfo({ state, commit }, info) { setInfo({ state, commit }, info) {
commit("SET_INFO", info); commit("SET_INFO", info);
}, },
setTitle({ state, commit }, title) {
commit("SET_TITLE", title);
},
setLogoUrl({ state, commit }, logoUrl) {
commit("SET_LOGO_URL", logoUrl);
},
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},
setUserName({ state, commit }, userName) { setUserName({ state, commit }, userName) {
commit("SET_USERNAME", userName); commit("SET_USERNAME", userName);
} }

Loading…
Cancel
Save