完善功能,删除冗余

dev_2022-05-11
yujialong 3 years ago
parent abd8350b60
commit b28b78d935
  1. 22
      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="user" @click="toPersonal">
<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>
<el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
@ -21,16 +21,12 @@ import util from "@/libs/util";
export default {
data() {
return {
title: "",
logoUrl: ""
};
},
computed: {
...mapState("user", [
"avatar", "userName"
]),
...mapState("auth", [
"routes"
"avatar", "userName", "title", "logoUrl", "customer", "customerName"
])
},
mounted() {
@ -38,16 +34,20 @@ export default {
},
methods: {
...mapActions("user", [
"logout"
"logout", "setTitle", "setLogoUrl"
]),
toPersonal() {
if (!this.customer) {
this.$router.push("/setting/person");
}
},
getSystemDetail () {
this.$get(this.api.logoDetail).then(res => {
if (res.status === 200 && res.data) {
this.title = res.data.title;
this.logoUrl = res.data.logoUrl;
if (res.status === 200) {
if (res.data) {
this.setTitle(res.data.title);
this.setLogoUrl(res.data.logoUrl);
}
} else {
util.errorMsg(res.message);
}

@ -1,10 +1,5 @@
<template>
<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="box">
<el-tabs v-model="activeName" @tab-click="handleClick">
@ -72,7 +67,6 @@ import Setting from "@/setting";
export default {
data: function() {
return {
isHh: Setting.isHh,
activeName: "1",
loginForm: {
account: "",
@ -111,7 +105,7 @@ export default {
},
methods: {
...mapActions("user", [
"login"
"login", "setTitle", "setLogoUrl"
]),
getVerImg() { //
this.loginForm.random = Math.floor(Math.random() * 999999999);

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

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

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

@ -198,9 +198,6 @@ export default {
uploadList: [], //
uploadFaild: false, //
oneDepartmentIds: "",
twoDepartmentIds: "",
gradeId: "", // ID
staffArchitectureId: "", // ID
};
@ -221,6 +218,14 @@ export default {
this.getData();
},
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) {
let oneDepartmentIds = [];
let twoDepartmentIds = [];
@ -232,14 +237,14 @@ export default {
}
e.children.forEach(r => {
if (r.ischeck) {
twoDepartmentIds.push(r.staffGradeId);
twoDepartmentIds.push(r.gradeId);
} else {
this.removeByValue(twoDepartmentIds, r.staffGradeId);
this.removeByValue(twoDepartmentIds, r.gradeId);
}
});
});
this.oneDepartmentIds = oneDepartmentIds.toString();
this.twoDepartmentIds = twoDepartmentIds.toString();
this.staffArchitectureId = oneDepartmentIds.toString();
this.gradeId = twoDepartmentIds.toString();
this.initData();
},
fircheck(val, val2) {
@ -251,7 +256,7 @@ export default {
val.ischeck = !val.ischeck;
val2.map(e => {
e.children.map(r => {
if (r.staffGradeId == val.staffGradeId) {
if (r.gradeId == val.gradeId) {
if (e.children.every(i => i.ischeck)) {
e.ischeck = true;
} else {
@ -325,7 +330,7 @@ export default {
},
resetPassword(row) { //
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) {
util.successMsg("重置成功");
} else {

@ -11,7 +11,7 @@
<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-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>
<span slot="footer" class="dialog-footer">
@ -47,7 +47,6 @@ export default {
twoactive: 0,
isaddMajor: false,
isAddDepartment: false,
schoolId: Setting.schoolId,
Form: {
staffArchitectureId: "", // ID
staffArchitectureName: "", // //
@ -64,7 +63,6 @@ export default {
},
staffstateProfessId: "",
staffstateId: "",
majorNoAdd: true
};
},
components: {
@ -119,19 +117,9 @@ export default {
this.Form.staffArchitectureName = item.staffArchitectureName;
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) { // /
this.$refs[Form].validate((valid) => {
if (valid) {
if (!this.majorNoAdd) return util.warningMsg("该一级部门已存在");
let data = {
staffArchitectureName: this.Form.staffArchitectureName,
staffArchitectureId: this.Form.staffArchitectureId,

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

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

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

@ -10,10 +10,13 @@ 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: "",
schoolId: "",
roleId: "",
dataTime: ""
},
@ -21,11 +24,22 @@ export default {
SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.userAvatars;
state.userId = info.userId;
state.schoolId = info.schoolId;
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;
},
@ -46,6 +60,8 @@ export default {
// 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("登录成功");
console.log(data, "登录保存的数据");
commit("SET_INFO", data);
@ -67,12 +83,18 @@ export default {
resolve();
});
},
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},
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);
},
setAvatar({ state, commit }, avatar) {
commit("SET_AVATAR", avatar);
},
setUserName({ state, commit }, userName) {
commit("SET_USERNAME", userName);
}

Loading…
Cancel
Save