系统管理开发,bug修复

dev_2022-05-11
yujialong 3 years ago
parent 188891de52
commit abd8350b60
  1. 31
      src/api/index.js
  2. 34
      src/layouts/header/index.vue
  3. 1
      src/main.js
  4. 5
      src/pages/course/add/index.vue
  5. 2
      src/pages/course/contentSettings/index.vue
  6. 2
      src/pages/course/preview/index.vue
  7. 3
      src/pages/evaluation/list/index.vue
  8. 3
      src/pages/match/manage/matchProgress.vue
  9. 667
      src/pages/setting/list/index.vue
  10. 44
      src/pages/student/list/index.vue
  11. 26
      src/pages/system/list/index.vue
  12. 174
      src/pages/system/list/role.vue
  13. 804
      src/pages/system/list/staff.vue
  14. 276
      src/pages/system/list/staffSide.vue
  15. 3
      src/pages/system/list/stafftree.vue
  16. 4
      src/router/index.js
  17. 27
      src/router/permission.js
  18. 9
      src/router/routes.js
  19. 4
      src/setting.js

@ -173,7 +173,38 @@ export default {
sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码 sendPhoneOrEmailCode: `${host}/users/users/userAccount/sendPhoneOrEmailCode`,// 更换手机号或邮箱--发送手机验证码
// 系统设置 // 系统设置
// 员工组织架构
professionalList: `${host}occupationlab/staff/professionalList`, //查询专业列表
staffGradeList: `${host}occupationlab/staff/staffGradeList`, //根据专业id查询年级
saveProfessional: `${host}occupationlab/staff/saveProfessional`, //新增专业
updateProfessional: `${host}occupationlab/staff/updateProfessional`, //编辑专业
deleteProfessional: `${host}occupationlab/staff/deleteProfessional`, //删除专业
saveGrade: `${host}occupationlab/staff/saveGrade`, //新增年级
updateGrade: `${host}occupationlab/staff/updateGrade`, //编辑年级
deleteGrade: `${host}occupationlab/staff/deleteGrade`, //删除年级
// 员工管理
saveStaff: `${host}occupationlab/staff/saveStaff`, //新增员工
staffDetail: `${host}occupationlab/staff/staffDetail`, //员工详情
modifyStaff: `${host}occupationlab/staff/modifyStaff`, //编辑员工
delStaff: `${host}occupationlab/staff/delStaff`, //删除员工
staffList: `${host}occupationlab/staff/staffList`, //员工列表
staffTemplate: `http://39.108.250.202/template/职站员工用户导入模板.xlsx`, //职站员工用户导入模板 staffTemplate: `http://39.108.250.202/template/职站员工用户导入模板.xlsx`, //职站员工用户导入模板
exportFailureStaff: `${host}occupationlab/staff/exportFailure`, //批量导入员工失败数据导出
importStaff: `${host}occupationlab/staff/importStaff`, //批量导入员工
// 角色管理
batchRemove: `${host}users/role/batchRemove`, //批量删除角色
checkRoleIsExist: `${host}users/role/checkRoleIsExist`, //判断该角色是否存在
delRoleByAccountId: `${host}users/role/delRoleByAccountId`, //删除某用户下的某个角色
roleList: `${host}users/role/list`, //角色分页列表查询
obtainDetails: `${host}users/role/obtainDetails`, //获取角色详情
saveOrUpdate: `${host}users/role/saveOrUpdate`, //新增或更新角色
queryAllMenus: `${host}users/users/permission/queryAllMenus`, //查询所有菜单
// 系统logo设置
logoDetail: `${host}occupationlab/sys/logo/detail`, //查看系统设置信息
logoSave: `${host}occupationlab/sys/logo/save`, //新增系统设置信息
logoUpdate: `${host}occupationlab/sys/logo/update`, //编辑系统设置信息

@ -1,7 +1,9 @@
<template> <template>
<div class="header"> <div class="header">
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" /> <div>
<img class="logo" v-else src="@/assets/img/logo.png" /> <img class="logo" :src="logoUrl" />
<span class="title">{{title}}</span>
</div>
<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>
@ -15,12 +17,12 @@
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from "@/setting";
export default { export default {
data() { data() {
return { return {
isHh: Setting.isHh title: "",
logoUrl: ""
}; };
}, },
computed: { computed: {
@ -32,7 +34,7 @@ export default {
]) ])
}, },
mounted() { mounted() {
this.getSystemDetail();
}, },
methods: { methods: {
...mapActions("user", [ ...mapActions("user", [
@ -40,7 +42,17 @@ export default {
]), ]),
toPersonal() { toPersonal() {
this.$router.push("/setting/person"); 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;
} else {
util.errorMsg(res.message);
}
}).catch(res => {});
},
} }
}; };
</script> </script>
@ -57,11 +69,11 @@ export default {
.logo { .logo {
height: 50px; height: 50px;
margin-left: 20px; margin: 0 20px;
}
&.hh { .title {
width: 220px; font-size: 18px;
} font-weight: bold;
} }
.action { .action {

@ -12,7 +12,6 @@ import { post, get, del, put } from "@/plugins/requests/index.js";
import api from "@/api"; import api from "@/api";
import store from "@/store"; import store from "@/store";
import Setting from "@/setting"; import Setting from "@/setting";
import permission from "@/router/permission";
// 插件 // 插件
import plugins from "@/plugins"; import plugins from "@/plugins";

@ -164,8 +164,7 @@ export default {
}); });
}, },
// handleExceed(files, fileList) { //
handleExceed(files, fileList) {
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
}, },
uploadSuccess(res, file, fileList) { uploadSuccess(res, file, fileList) {
@ -189,7 +188,7 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
goback() { goback() { //
if (this.isDetail) { if (this.isDetail) {
this.$router.back(); this.$router.back();
} else { } else {

@ -462,7 +462,7 @@ export default {
// console.log(JSON.stringify(row)); // console.log(JSON.stringify(row));
if (this.transferType(row.fileType) == "视频") { if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.playAuth; this.playAuth = res.data.playAuth;
if (this.player) { if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else { } else {

@ -155,7 +155,7 @@ export default {
this.iframeSrc = ""; this.iframeSrc = "";
if (this.transferType(row.fileType) == "视频") { if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.playAuth; this.playAuth = res.data.playAuth;
this.$nextTick(() => { this.$nextTick(() => {
if (this.player) { if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);

@ -15,8 +15,7 @@
</el-radio-group> </el-radio-group>
</li> </li>
<li> <li>
<el-input placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword" <el-input placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>

@ -96,9 +96,6 @@ export default {
util.warningMsg("请填写标题"); util.warningMsg("请填写标题");
} }
}, },
entry() {
this.$router.push("/permission");
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },

@ -1,77 +1,45 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<!-- 头像部分 --> <div class="topBack">
<div class="header"> <div class="back" @click="goBack"><i class="el-icon-arrow-left"></i>返回</div>
<el-avatar :size="80" :src="this.avatar" class="Headtop"></el-avatar>
<div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload
class="upload-demo"
:headers="{token}"
:action="this.api.updateUserAvatars"
name="file"
:limit="1"
:on-success="getRes"
>
<div>点击更改头像</div>
</el-upload>
</div> </div>
</div> <!-- 头像部分 -->
<div class="header">
<!-- 用户信息 --> <el-avatar :size="80" :src="this.avatar" class="Headtop"></el-avatar>
<div class="card" style="margin-top: -65px"> <div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;"> <el-upload
<span><img src="@/assets/img/person/user.png" alt=""> 用户信息</span> class="upload-demo"
<el-button type="primary" @click="save">更新资料</el-button> :headers="{token}"
</p> :action="this.api.uploadUserAvatars"
<p class="meta-title"> name="file"
<span>个人信息</span> :limit="1"
</p> :on-success="getRes"
<div class="information"> >
<div class="line"> <div>点击更改头像</div>
<div class="item"> </el-upload>
<span>姓名</span>
<input id="username" class="username" placeholder="请输入姓名" type="text" v-model="personalInformation.userName" />
<!-- <label for="username">
<i class="el-icon-edit"></i>
</label> -->
</div>
<div class="item">
<span>所在国家</span>
<el-select
v-model="personalInformation.countries"
placeholder
>
<el-option
v-for="item in countryList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
</div> </div>
<div class="line"> </div>
<div class="item">
<span>性别</span> <!-- 用户信息 -->
<div class="sexRadio"> <div class="card" style="margin-top: -65px">
<el-radio v-model="personalInformation.sex" :label="1"></el-radio> <p class="block-title" style="display: flex;justify-content: space-between;align-items: center;">
<el-radio v-model="personalInformation.sex" :label="2"></el-radio> <span><img src="@/assets/img/person/user.png" alt=""> 用户信息</span>
<el-button type="primary" @click="save">更新资料</el-button>
</p>
<p class="meta-title">
<span>个人信息</span>
</p>
<div class="information">
<div class="line">
<div class="item">
<span>姓名</span>
<input id="username" class="username" placeholder="请输入姓名" type="text" v-model="personalInformation.userName" />
<!-- <label for="username">
<i class="el-icon-edit"></i>
</label> -->
</div> </div>
<!-- <el-select <div class="item">
v-model="personalInformation.sex" <span>所在国家</span>
placeholder
>
<el-option
v-for="item in sexList"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select> -->
</div>
<div class="item">
<span>所在地</span>
<div class="selects">
<el-select <el-select
v-model="personalInformation.countries" v-model="personalInformation.countries"
placeholder placeholder
@ -83,306 +51,342 @@
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
<el-select
v-model="personalInformation.provinceId"
placeholder
@change="id => getCity(id,1)"
>
<el-option
v-for="item in provinceList"
:key="item.provinceId"
:label="item.provinceName"
:value="item.provinceId"
></el-option>
</el-select>
<el-select
v-model="personalInformation.cityId"
placeholder
:disabled="personalInformation.provinceId ? false : true"
>
<el-option
v-for="item in cityList"
:key="item.cityId"
:label="item.cityName"
:value="item.cityId"
></el-option>
</el-select>
</div> </div>
</div> </div>
</div>
<div class="line">
<div class="item">
<span>出生年月日</span>
<el-date-picker
v-model="personalInformation.dateBirth"
:clearable="false"
class="block-right"
type="date">
</el-date-picker>
</div>
<div class="item">
<span>证件</span>
<input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入证件" type="text" v-model="personalInformation.idNumber" />
</div>
</div>
<div class="line">
<div class="item">
<span>教育程度</span>
<el-select
v-model="personalInformation.educationDegree"
placeholder="请选择教育程度"
>
<el-option
v-for="(item,index) in educationDegreeList"
:key="index"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</div>
<div class="item">
<span>当前所在学校</span>
<input id="schoolName" class="school" disabled placeholder="所在学校" type="text" v-model="personalInformation.schoolName" />
</div>
</div>
<!-- 个人档案 -->
<p class="meta-title plus">
<span>个人档案</span>
<el-button type="text" icon="el-icon-plus" @click="addArch">新增</el-button>
</p>
</div>
<div class="information" style="margin-top: 20px;">
<div class="archives" v-for="(archive,index) in archivesList" :key="index" v-show="index == 0 || showArch">
<div class="line"> <div class="line">
<div class="item"> <div class="item">
<span>职业</span> <span>性别</span>
<el-select <div class="sexRadio">
v-model="archive.personalCareerId" <el-radio v-model="personalInformation.sex" :label="1"></el-radio>
placeholder="选择职业" <el-radio v-model="personalInformation.sex" :label="2"></el-radio>
</div>
<!-- <el-select
v-model="personalInformation.sex"
placeholder
> >
<el-option <el-option
v-for="item in occupationList" v-for="item in sexList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.name"
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select> -->
</div> </div>
<div class="item"> <div class="item">
<span>国家</span> <span>所在地</span>
<el-select <div class="selects">
v-model="personalInformation.countries" <el-select
placeholder v-model="personalInformation.countries"
> placeholder
<el-option >
v-for="item in countryList" <el-option
:key="item.value" v-for="item in countryList"
:label="item.label" :key="item.value"
:value="item.value" :label="item.label"
></el-option> :value="item.value"
</el-select> ></el-option>
</el-select>
<el-select
v-model="personalInformation.provinceId"
placeholder
@change="id => getCity(id,1)"
>
<el-option
v-for="item in provinceList"
:key="item.provinceId"
:label="item.provinceName"
:value="item.provinceId"
></el-option>
</el-select>
<el-select
v-model="personalInformation.cityId"
placeholder
:disabled="personalInformation.provinceId ? false : true"
>
<el-option
v-for="item in cityList"
:key="item.cityId"
:label="item.cityName"
:value="item.cityId"
></el-option>
</el-select>
</div>
</div> </div>
</div> </div>
<div class="line"> <div class="line">
<div class="item"> <div class="item">
<span>学校名称</span> <span>出生年月日</span>
<el-select <el-date-picker
v-model="archive.schoolId" v-model="personalInformation.dateBirth"
filterable :clearable="false"
placeholder="选择学校" class="block-right"
@change="id => getSchoolName(id,index)" type="date">
> </el-date-picker>
<el-option
v-for="item in schoolList"
:key="item.value"
:label="item.schoolName"
:value="item.schoolId"
></el-option>
</el-select>
</div> </div>
<div class="item"> <div class="item">
<span>专业学科</span> <span>证件</span>
<el-select <input onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" id="idnumber" class="idnumber" placeholder="请输入证件" type="text" v-model="personalInformation.idNumber" />
v-model="archive.disciplineId"
placeholder="选择专业学科"
@change="id => getItemProfessionalClass(id,index)"
@clear="() => clearItemClass(index)"
>
<el-option
v-for="item in subjectList"
:key="item.value"
:label="item.disciplineName"
:value="item.disciplineId"
></el-option>
</el-select>
</div> </div>
</div> </div>
<div class="line"> <div class="line">
<div class="item"> <div class="item">
<span>专业类</span> <span>教育程度</span>
<el-select <el-select
v-model="archive.professionalClassId" v-model="personalInformation.educationDegree"
placeholder="选择专业类" placeholder="请选择教育程度"
:disabled="archive.disciplineId ? false : true"
@change="id => getItemProfessional(id,index)"
@clear="() => clearItemProfess(index)"
> >
<el-option <el-option
v-for="item in archive.ProfessionalClassList" v-for="(item,index) in educationDegreeList"
:key="item.professionalClassId" :key="index"
:label="item.professionalClassName" :label="item.name"
:value="item.professionalClassId" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<div class="item"> <div class="item">
<span>专业</span> <span>当前所在学校</span>
<el-select <input id="schoolName" class="school" disabled placeholder="所在学校" type="text" v-model="personalInformation.schoolName" />
v-model="archive.professionalId"
placeholder="选择专业"
:disabled="archive.professionalClassId ? false : true"
@change="getItemStuGrade"
>
<el-option
v-for="item in archive.ProfessionalList"
:key="item.professionalId"
:label="item.professionalName"
:value="item.professionalId"
></el-option>
</el-select>
</div> </div>
</div> </div>
</div>
</div>
<div class="fold" v-if="archivesList.length > 1"> <!-- 个人档案 -->
<img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="@/assets/img/open.png" alt="" @click="foldArch"> <p class="meta-title plus">
</div> <span>个人档案</span>
</div> <el-button type="text" icon="el-icon-plus" @click="addArch">新增</el-button>
</p>
</div>
<div class="card mgb20"> <div class="information" style="margin-top: 20px;">
<p class="block-title" style="margin-bottom: 15px"> <div class="archives" v-for="(archive,index) in archivesList" :key="index" v-show="index == 0 || showArch">
<span><img src="@/assets/img/person/manag.png" alt=""> 账号信息</span> <div class="line">
</p> <div class="item">
<div class="information"> <span>职业</span>
<div class="line"> <el-select
<div class="item"> v-model="archive.personalCareerId"
<span>用户账号</span> placeholder="选择职业"
<input >
id="account" <el-option
type="text" v-for="item in occupationList"
class="username" placeholder="请输入用户账号" :key="item.value"
v-model="personalInformation.account" :label="item.label"
/> :value="item.value"
</div> ></el-option>
<div class="item"> </el-select>
<span>手机号</span> </div>
<div class="btns flex-between"> <div class="item">
<span>{{ personalInformation.phone }}</span> <span>国家</span>
<el-button v-if="personalInformation.phone" type="primary" @click="bindPhone">更换</el-button> <el-select
<el-button v-else type="primary" @click="bindPhone">绑定</el-button> v-model="personalInformation.countries"
placeholder
>
<el-option
v-for="item in countryList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<div class="item">
<span>学校名称</span>
<el-select
v-model="archive.schoolId"
filterable
placeholder="选择学校"
@change="id => getSchoolName(id,index)"
>
<el-option
v-for="item in schoolList"
:key="item.value"
:label="item.schoolName"
:value="item.schoolId"
></el-option>
</el-select>
</div>
<div class="item">
<span>专业学科</span>
<el-select
v-model="archive.disciplineId"
placeholder="选择专业学科"
@change="id => getItemProfessionalClass(id,index)"
@clear="() => clearItemClass(index)"
>
<el-option
v-for="item in subjectList"
:key="item.value"
:label="item.disciplineName"
:value="item.disciplineId"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<div class="item">
<span>专业类</span>
<el-select
v-model="archive.professionalClassId"
placeholder="选择专业类"
:disabled="archive.disciplineId ? false : true"
@change="id => getItemProfessional(id,index)"
@clear="() => clearItemProfess(index)"
>
<el-option
v-for="item in archive.ProfessionalClassList"
:key="item.professionalClassId"
:label="item.professionalClassName"
:value="item.professionalClassId"
></el-option>
</el-select>
</div>
<div class="item">
<span>专业</span>
<el-select
v-model="archive.professionalId"
placeholder="选择专业"
:disabled="archive.professionalClassId ? false : true"
@change="getItemStuGrade"
>
<el-option
v-for="item in archive.ProfessionalList"
:key="item.professionalId"
:label="item.professionalName"
:value="item.professionalId"
></el-option>
</el-select>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="line">
<div class="item"> <div class="fold" v-if="archivesList.length > 1">
<span>邮箱</span> <img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="@/assets/img/open.png" alt="" @click="foldArch">
<div class="btns flex-between"> </div>
<span>{{ personalInformation.email }}</span> </div>
<el-button v-if="personalInformation.email" type="primary" @click="bindEmail">更换</el-button>
<el-button v-else type="primary" @click="bindEmail">绑定</el-button> <div class="card mgb20">
<p class="block-title" style="margin-bottom: 15px">
<span><img src="@/assets/img/person/manag.png" alt=""> 账号信息</span>
</p>
<div class="information">
<div class="line">
<div class="item">
<span>用户账号</span>
<input
id="account"
type="text"
class="username" placeholder="请输入用户账号"
v-model="personalInformation.account"
/>
</div>
<div class="item">
<span>手机号</span>
<div class="btns flex-between">
<span>{{ personalInformation.phone }}</span>
<el-button v-if="personalInformation.phone" type="primary" @click="bindPhone">更换</el-button>
<el-button v-else type="primary" @click="bindPhone">绑定</el-button>
</div>
</div> </div>
</div> </div>
<!-- <div class="item"> <div class="line">
<span>微信</span> <div class="item">
<input id="weChat" class="weChat" disabled placeholder="微信" type="text" v-model="personalInformation.weChatID"/> <span>邮箱</span>
</div> --> <div class="btns flex-between">
<div class="item"> <span>{{ personalInformation.email }}</span>
<span>密码</span> <el-button v-if="personalInformation.email" type="primary" @click="bindEmail">更换</el-button>
<div class="btns flex-between"> <el-button v-else type="primary" @click="bindEmail">绑定</el-button>
<p>******</p> </div>
<el-button type="primary" @click="bindPassword">更换</el-button> </div>
<!-- <div class="item">
<span>微信</span>
<input id="weChat" class="weChat" disabled placeholder="微信" type="text" v-model="personalInformation.weChatID"/>
</div> -->
<div class="item">
<span>密码</span>
<div class="btns flex-between">
<p>******</p>
<el-button type="primary" @click="bindPassword">更换</el-button>
</div>
</div> </div>
<!-- <div class="item"></div> -->
</div> </div>
<!-- <div class="item"></div> -->
</div> </div>
</div> </div>
</div>
<el-dialog <el-dialog
:title="personalInformation.email ? '更换邮箱' : '绑定邮箱'" :title="personalInformation.email ? '更换邮箱' : '绑定邮箱'"
:visible.sync="emailVisible" :visible.sync="emailVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="closeEmail" @close="closeEmail"
width="30%"> width="30%">
<el-form ref="form" :model="form" label-width="60px"> <el-form ref="form" :model="form" label-width="60px">
<el-form-item label="邮箱"> <el-form-item label="邮箱">
<el-input placeholder="请输入邮箱" v-model="email"></el-input> <el-input placeholder="请输入邮箱" v-model="email"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="flex-between"> <div class="flex-between">
<el-input v-model="emailCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="emailCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendEmailCode" :disabled="emailDisabled">{{ emailBtnText }}</el-button> <el-button style="margin-left: 10px" type="text" @click="sendEmailCode" :disabled="emailDisabled">{{ emailBtnText }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="emailVisible = false"> </el-button> <el-button @click="emailVisible = false"> </el-button>
<el-button type="primary" @click="emailSubmit"> </el-button> <el-button type="primary" @click="emailSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:title="personalInformation.phone ? '更换手机号' : '绑定手机号'" :title="personalInformation.phone ? '更换手机号' : '绑定手机号'"
:visible.sync="phoneVisible" :visible.sync="phoneVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="closePhone" @close="closePhone"
width="30%"> width="30%">
<el-form ref="form" :model="form" label-width="60px"> <el-form ref="form" :model="form" label-width="60px">
<el-form-item label="手机号"> <el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input> <el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="flex-between"> <div class="flex-between">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText }}</el-button> <el-button style="margin-left: 10px" type="text" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button> <el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button> <el-button type="primary" @click="phoneSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
title="更换密码" title="更换密码"
:visible.sync="passwordVisible" :visible.sync="passwordVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="closePassword" @close="closePassword"
width="30%"> width="30%">
<el-form ref="passwordForm" :model="form" label-width="60px"> <el-form ref="passwordForm" :model="form" label-width="60px">
<el-form-item label="原密码"> <el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> <el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="新密码"> <el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input> <el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="新密码"> <el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input> <el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button> <el-button @click="passwordVisible = false"> </el-button>
<el-button type="primary" @click="editPassword"> </el-button> <el-button type="primary" @click="editPassword"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
@ -1045,12 +1049,42 @@ export default {
} }
}).catch(res => { }).catch(res => {
}); });
},
goBack() {
this.$router.go(-1);
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.topBack {
position: absolute;
top: 0;
left: 0;
right: 0;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
width: 100%;
height: 60px;
font-size: 16px;
color: #333;
.back {
cursor: pointer;
line-height: 60px;
height: 60px;
font-size: 16px;
font-weight: bold;
margin-left: 20px;
i {
color: #9278ff;
font-size: 20px;
}
}
}
.arrowTransform { .arrowTransform {
transition: 0.5s; transition: 0.5s;
transform-origin: center; transform-origin: center;
@ -1066,6 +1100,7 @@ export default {
.wrap { .wrap {
margin: -24px -24px 20px; margin: -24px -24px 20px;
padding-top: 170px; padding-top: 170px;
padding-bottom: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;

@ -155,7 +155,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="account" label="学生账号"> <el-form-item prop="account" label="学生账号">
<el-input v-model="form.account" placeholder="请输入学生账号" @change="accountChange"></el-input> <el-input v-model="form.account" placeholder="请输入学生账号" @blur="accountChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="学生姓名"> <el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input> <el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input>
@ -164,13 +164,13 @@
学生 学生
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" label="学生学号"> <el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="" @change="worknumberChange"></el-input> <el-input v-model="form.workNumber" placeholder="" @blur="worknumberChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="phone" label="手机号"> <el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11" @change="phoneChange"></el-input> <el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11" @blur="phoneChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码" @change="emailChange"></el-input> <el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码" @blur="emailChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="uniqueIdentification" label="唯一标识"> <el-form-item prop="uniqueIdentification" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentification"></el-input> <el-input disabled v-model="form.uniqueIdentification"></el-input>
@ -211,6 +211,7 @@
<el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> <el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div> </div>
<el-upload <el-upload
name="file"
accept=".xls,.xlsx" accept=".xls,.xlsx"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
@ -219,9 +220,8 @@
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="this.api.importStudent" :action="this.api.importStudent"
:headers="headers"
:file-list="uploadList" :file-list="uploadList"
name="file" :headers="headers"
> >
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> <el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
@ -664,21 +664,25 @@ export default {
}); });
}, },
async accountChange() { async accountChange() {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?account=${this.form.account}&workNumber=`); if (this.form.account) {
if (res.status === 200) { let res = await this.$post(`${this.api.checkWorkNumOrAccount}?account=${this.form.account}&workNumber=`);
this.accountReapeat = false; if (res.status === 200) {
} else { this.accountReapeat = false;
util.warningMsg("该账号已存在"); } else {
this.accountReapeat = true; util.warningMsg("该账号已存在");
this.accountReapeat = true;
}
} }
}, },
async worknumberChange() { async worknumberChange() {
let res = await this.$post(`${this.api.checkWorkNumOrAccount}?workNumber=${this.form.workNumber}&account=`); if (this.form.workNumber) {
if (res.status === 200) { let res = await this.$post(`${this.api.checkWorkNumOrAccount}?workNumber=${this.form.workNumber}&account=`);
this.workNumberReapeat = false; if (res.status === 200) {
} else { this.workNumberReapeat = false;
util.warningMsg("该学生学号已存在"); } else {
this.workNumberReapeat = true; util.warningMsg("该学生学号已存在");
this.workNumberReapeat = true;
}
} }
}, },
async phoneChange() { async phoneChange() {
@ -698,10 +702,10 @@ export default {
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 res = await this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`);
if (res.status === 200) { if (res.status === 200) {
this.accountReapeat = false; this.emailRepeat = false;
} else { } else {
util.warningMsg("该邮箱已存在"); util.warningMsg("该邮箱已存在");
this.accountReapeat = true; this.emailRepeat = true;
} }
} }
}, },

@ -5,37 +5,36 @@
</div> </div>
<staff v-if="active == 'staff'"></staff> <staff v-if="active == 'staff'"></staff>
<role v-else></role> <role v-if="active == 'role'"></role>
<logo v-if="active == 'logo'"></logo>
</div> </div>
</template> </template>
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import { mapState } from "vuex";
import staff from "./staff"; import staff from "./staff";
import role from "./role"; import role from "./role";
import logo from "./logo";
export default { export default {
data() { data() {
return { return {
active: "staff", active: "staff",
tabs: { tabs: {
staff: "员工管理", staff: "员工管理",
role: "角色权限" role: "角色权限",
logo: "系统logo设置",
} }
}; };
}, },
computed: { computed: {
...mapState("auth", [
"routes"
])
}, },
components: { components: {
staff, staff,
role role,
logo
}, },
created() { created() {
console.log("routes===", this.routes);
Setting.dynamicRoute && this.initTabs(); Setting.dynamicRoute && this.initTabs();
}, },
methods: { methods: {
@ -43,9 +42,9 @@ export default {
this.active = index; this.active = index;
}, },
initTabs() { initTabs() {
let btnPermissions = this.routes; let tab1 = this.auth("员工管理");
let tab1 = btnPermissions.includes("系统设置:员工管理"); let tab2 = this.auth("角色权限");
let tab2 = btnPermissions.includes("系统设置:角色权限"); let tab3 = this.auth("系统logo设置");
if (!tab1) { if (!tab1) {
delete this.tabs.staff; delete this.tabs.staff;
@ -53,6 +52,9 @@ export default {
if (!tab2) { if (!tab2) {
delete this.tabs.role; delete this.tabs.role;
} }
if (!tab3) {
// delete this.tabs.logo;
}
} }
} }
}; };

@ -1,33 +1,32 @@
<template> <template>
<div class="page"> <div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<!-- <el-button type="primary" round @click="addRole">新增角色</el-button> <el-button type="primary" round @click="addRole">新增角色</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button> --> <el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
</el-table-column> <el-table-column prop="roleName" label="角色名称" align="center" width="100"></el-table-column>
<el-table-column prop="name" label="角色名称" align="center" width="100">
</el-table-column>
<el-table-column label="角色描述" align="center"> <el-table-column label="角色描述" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.description" disabled></el-input> <el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark" disabled></el-input>
</template> </template>
</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 type="text" @click="showRole(scope.row)">查看</el-button> <el-button type="text" @click="showRole(scope.row)">查看</el-button>
<el-button type="text" @click="editRole(scope.row)">编辑</el-button> <el-button type="text" @click="editRole(scope.row)">编辑</el-button>
<!-- <el-button type="text" @click="handleDelete(scope.row)">删除</el-button> --> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -36,19 +35,20 @@
</div> </div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false"> <el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="100px" :disabled="isDetail"> <el-form ref="form" label-width="80px" :disabled="isDetail">
<el-form-item label="角色名称"> <el-form-item label="角色名称">
<el-input v-model="form.name " ref="account" placeholder="请输入角色名称"></el-input> <el-input v-model="form.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="角色描述"> <el-form-item label="角色描述">
<el-input v-model="form.description " placeholder="请输入角色描述" type="textarea" rows="5"></el-input> <el-input v-model="form.remark" placeholder="请输入角色描述" type="textarea" rows="5"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="role" label="角色权限"> <el-form-item prop="role" label="角色权限">
<div class="per-wrap"> <div style="max-height: 300px; overflow: auto">
<el-tree <el-tree
ref="per" ref="per"
:data="permissions" :data="permissions"
show-checkbox show-checkbox
default-expand-all
node-key="id" node-key="id"
:default-expanded-keys="checkedIds" :default-expanded-keys="checkedIds"
:default-checked-keys="checkedIds" :default-checked-keys="checkedIds"
@ -66,9 +66,7 @@
</template> </template>
<script> <script>
import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapState, mapActions } from "vuex";
export default { export default {
data() { data() {
@ -77,9 +75,9 @@ export default {
searchTimer: null, searchTimer: null,
isDetail: false, isDetail: false,
form: { form: {
roleId: "", id: "",
name: "", roleName: "",
description: "" remark: ""
}, },
listData: [], listData: [],
defaultProps: { defaultProps: {
@ -93,7 +91,8 @@ export default {
isAdd: true, isAdd: true,
roleVisible: false, roleVisible: false,
permissions: [], permissions: [],
checkedIds: [] checkedIds: [],
roleNameReapeat: false //
}; };
}, },
watch: { watch: {
@ -109,16 +108,10 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
let data = { this.$get(`${this.api.roleList}?page=${this.page}&size=${this.pageSize}&name=${util.encodeStr(this.keyword)}`).then(res => {
name: util.encodeStr(this.keyword), this.listData = res.rolePage.records;
page: this.page, this.total = res.rolePage.total;
size: this.pageSize }).catch(res => {});
};
this.$get(this.api.rolePermissionList, data).then(res => {
this.listData = res.data.list;
this.total = res.data.totalCount;
}).catch(res => {
});
}, },
currentChange(val) { currentChange(val) {
this.page = val; this.page = val;
@ -127,49 +120,33 @@ export default {
handleDelete(row) { handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$post(`${this.api.batchRemove}?roleIds=${row.id}`).then(res => {
let data = { util.successMsg("删除成功");
roleIds: [row.roleId] this.getData();
}; }).catch(res => {});
this.$post(`${this.api.delRolePermission}`, data).then(res => { }).catch(() => {});
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
}, },
getRowKeys(row) { getRowKeys(row) {
return row.roleId; return row.id;
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllSelection() { delAllSelection() {
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return item.roleId;
});
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { let ids = this.multipleSelection.map(item => {
let data = { return item.id;
roleIds: delList
};
this.$post(`${this.api.delRolePermission}`, data).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
}); });
this.$post(`${this.api.batchRemove}?roleIds=${ids.toString()}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {});
}).catch(() => {});
} else { } else {
util.errorMsg("请先选择数据!"); util.errorMsg("请先选择数据!");
} }
@ -177,9 +154,9 @@ export default {
closeRole() { closeRole() {
this.isDetail = false; this.isDetail = false;
this.form = { this.form = {
roleId: "", id: "",
name: "", roleName: "",
description: "" remark: ""
}; };
this.checkedIds = []; this.checkedIds = [];
this.permissions = []; this.permissions = [];
@ -187,8 +164,8 @@ export default {
// //
getPer(row) { getPer(row) {
if (!this.permissions.length) { if (!this.permissions.length) {
this.$get(this.api.roleTree).then(res => { this.$get(this.api.queryAllMenus).then(res => {
let data = res.data; let data = res.children;
// //
let yw = data.findIndex(n => n.name == "业务后台"); let yw = data.findIndex(n => n.name == "业务后台");
yw != -1 && data.splice(yw, 1); yw != -1 && data.splice(yw, 1);
@ -231,12 +208,12 @@ export default {
} }
return result; return result;
}, },
async getDetail(row) { async getDetail(row) { //
let res = await this.$get(`${this.api.queryPermissionArrById}?roleId=${row.roleId}`); let res = await this.$get(`${this.api.obtainDetails}?id=${row.id}`);
if (res.success) { if (res.status === 200) {
this.form = res.data; this.form = res.role;
this.form.roleId = row.roleId; this.form.id = row.id;
this.checkedIds = this.handleRolePer(res.data.permissionIds, this.permissions); this.checkedIds = this.handleRolePer(res.permissionList, this.permissions);
this.$refs.per.setCheckedNodes(this.checkedIds); this.$refs.per.setCheckedNodes(this.checkedIds);
} }
}, },
@ -251,32 +228,45 @@ export default {
this.getPer(row); this.getPer(row);
this.roleVisible = true; this.roleVisible = true;
}, },
async roleNameChange() {
let res = await this.$post(`${this.api.checkRoleIsExist}?roleName=${this.form.roleName}`);
if (res.status === 200) {
this.roleNameReapeat = false;
} else {
util.warningMsg("该角色已存在");
this.roleNameReapeat = true;
}
},
async saveData() { async saveData() {
if (!this.form.name) return util.warningMsg("请填写角色名称"); if (!this.form.roleName) return util.warningMsg("请填写角色名称");
if (!this.form.description) return util.warningMsg("请填写角色描述"); if (!this.form.remark) return util.warningMsg("请填写角色描述");
if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限"); if (!this.$refs.per.getCheckedKeys().length) return util.warningMsg("请选择角色权限");
// ,(), // ,(),
let permissionIds = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()]; let permissionId = [...this.$refs.per.getHalfCheckedKeys(), ...this.$refs.per.getCheckedKeys()];
let data = { let data = {
roleId: this.form.roleId, ...this.form,
name: this.form.name, permissionId
description: this.form.description,
permissionIds
}; };
if (this.form.roleId) { if (this.form.id) {
this.$post(this.api.updateRolePermission, data).then(res => { this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("修改成功"); if (res.status === 200) {
this.getData(); util.successMsg("修改成功");
this.roleVisible = false; this.getData();
}).catch(res => { this.roleVisible = false;
}); } else {
util.errorMsg(res.message);
}
}).catch(res => {});
} else { } else {
this.$post(this.api.saveRolePermission, data).then(res => { this.$post(this.api.saveOrUpdate, data).then(res => {
util.successMsg("新增成功"); if (res.status === 200) {
this.getData(); util.successMsg("新增成功");
this.roleVisible = false; this.getData();
}).catch(res => { this.roleVisible = false;
}); } else {
util.errorMsg(res.message);
}
}).catch(res => {});
} }
} }
} }

File diff suppressed because it is too large Load Diff

@ -8,10 +8,10 @@
></lctree> ></lctree>
</div> </div>
<el-dialog :title="Form.MajorId ? '编辑专业' : '新增专业'" :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="majorName"> <el-form-item prop="staffArchitectureName">
<el-input placeholder="请输入专业名称" v-model="Form.majorName" @change="majorChange"></el-input> <el-input placeholder="请输入专业名称" v-model="Form.staffArchitectureName" @change="majorChange"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -20,10 +20,10 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" 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="departmentName"> <el-form-item prop="gradeName">
<el-input placeholder="请输入部门名称" v-model="Form.departmentName"></el-input> <el-input placeholder="请输入部门名称" v-model="Form.gradeName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -36,7 +36,6 @@
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import util from "@/libs/util"; import util from "@/libs/util";
import { mapState, mapActions } from "vuex";
import lctree from "./stafftree"; import lctree from "./stafftree";
export default { export default {
@ -50,16 +49,16 @@ export default {
isAddDepartment: false, isAddDepartment: false,
schoolId: Setting.schoolId, schoolId: Setting.schoolId,
Form: { Form: {
MajorId: "", staffArchitectureId: "", // ID
majorName: "", staffArchitectureName: "", // //
departmentId: "", gradeId: "",
departmentName: "" gradeName: ""
}, },
rules: { rules: {
majorName: [ staffArchitectureName: [
{ required: true, message: "请输入专业名称", trigger: "blur" } { required: true, message: "请输入专业名称", trigger: "blur" }
], ],
departmentName: [ gradeName: [
{ required: true, message: "请输入部门名称", trigger: "blur" } { required: true, message: "请输入部门名称", trigger: "blur" }
] ]
}, },
@ -76,27 +75,24 @@ export default {
}, },
methods: { methods: {
getStaff() { getStaff() {
let data = { this.$get(this.api.professionalList).then(res => {
schoolId: this.schoolId if (res.data && res.data.length) {
}; res.data.map(e => {
this.$get(this.api.queryStaffPro, data).then(res => { (e.ifVisible = false), (e.ischeck = false), (e.label = e.staffArchitectureName), (e.value = e.staffArchitectureId);
if (res.message) {
res.message.map(e => {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName);
let data = { let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId staffArchitectureId: e.staffArchitectureId
}; };
this.$get(this.api.queryStaffGrade, data).then(res => { this.$get(this.api.staffGradeList, data).then(res => {
res.message.map(e => { res.data.map(e => {
(e.ischeck = false), (e.label = e.staffGradeName); (e.ischeck = false), (e.label = e.gradeName), (e.value = e.gradeId);
}); });
e.children = res.message; e.children = res.data;
}).catch(res => { }).catch(res => {
}); });
}); });
} }
setTimeout(() => { setTimeout(() => {
this.majorList = res.message; this.majorList = res.data;
}, 500); }, 500);
}).catch(res => { }).catch(res => {
}); });
@ -114,17 +110,17 @@ export default {
}, },
// //
addMajor() { addMajor() {
this.Form.MajorId = ""; this.Form.staffArchitectureId = "";
this.Form.majorName = ""; this.Form.staffArchitectureName = "";
this.isaddMajor = true; this.isaddMajor = true;
}, },
editMajor(item) { editMajor(item) {
this.Form.MajorId = item.staffProfessionalArchitectureId, this.Form.staffArchitectureId = item.staffArchitectureId;
this.Form.majorName = item.staffProfessionalArchitectureName; this.Form.staffArchitectureName = item.staffArchitectureName;
this.isaddMajor = true; this.isaddMajor = true;
}, },
async majorChange() { async majorChange() {
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName, schoolId: this.schoolId }); let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.staffArchitectureName, schoolId: this.schoolId });
if (res.message.length != 0) { if (res.message.length != 0) {
util.warningMsg("该一级部门已存在"); util.warningMsg("该一级部门已存在");
this.majorNoAdd = false; this.majorNoAdd = false;
@ -132,41 +128,50 @@ export default {
this.majorNoAdd = true; 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("该一级部门已存在"); if (!this.majorNoAdd) return util.warningMsg("该一级部门已存在");
let data = { let data = {
staffProfessionalArchitectureName: this.Form.majorName, staffArchitectureName: this.Form.staffArchitectureName,
staffProfessionalArchitectureId: this.Form.MajorId, staffArchitectureId: this.Form.staffArchitectureId,
schoolId: this.schoolId isDel: 0 // (0 1)
}; };
if (this.Form.MajorId) { if (this.Form.staffArchitectureId) {
this.$post(this.api.updateStaffPro, data).then(res => { this.$post(this.api.updateProfessional, data).then(res => {
util.successMsg("编辑成功"); if (res.status === 200) {
this.isaddMajor = false; util.successMsg("编辑成功");
this.majorList.map(e => { this.isaddMajor = false;
if (e.staffProfessionalArchitectureId == this.Form.MajorId) { this.majorList.map(e => {
e.staffProfessionalArchitectureName = this.Form.majorName; if (e.staffArchitectureId == this.Form.staffArchitectureId) {
e.label = this.Form.majorName; e.staffArchitectureName = this.Form.staffArchitectureName;
} e.label = this.Form.staffArchitectureName;
}); }
this.$emit("getData"); });
this.$emit("getData");
} else {
util.errorMsg(res.message);
}
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(this.api.addStaffPro, data).then(res => { this.$post(this.api.saveProfessional, data).then(res => {
util.successMsg("添加成功"); if (res.status === 200) {
this.isaddMajor = false; util.successMsg("添加成功");
let newData = { this.isaddMajor = false;
staffProfessionalArchitectureId: res.message, let newData = {
staffProfessionalArchitectureName: this.Form.majorName, staffArchitectureId: res.staffArchitectureId,
label: this.Form.majorName, staffArchitectureName: this.Form.staffArchitectureName,
ifVisible: false, label: this.Form.staffArchitectureName,
ischeck: false, value: res.staffArchitectureId,
children: [] ifVisible: false,
}; ischeck: false,
this.majorList.push(newData); children: []
};
this.majorList.push(newData);
} else {
util.errorMsg(res.message);
}
}).catch(res => { }).catch(res => {
}); });
} }
@ -177,62 +182,71 @@ export default {
}, },
// //
addDepartment(item) { addDepartment(item) {
this.Form.departmentId = ""; this.Form.gradeId = "";
this.Form.departmentName = ""; this.Form.gradeName = "";
this.isAddDepartment = true; this.isAddDepartment = true;
this.Form.MajorId = item.staffProfessionalArchitectureId; this.Form.staffArchitectureId = item.staffArchitectureId;
}, },
editDepartment(item) { editDepartment(item) {
this.Form.departmentId = item.staffGradeId, this.Form.gradeId = item.gradeId;
this.Form.departmentName = item.staffGradeName; this.Form.gradeName = item.gradeName;
this.isAddDepartment = true; this.isAddDepartment = true;
for (let j = 0; j < this.majorList.length; j++) { for (let j = 0; j < this.majorList.length; j++) {
for (let k = 0; k < this.majorList[j].children.length; k++) { for (let k = 0; k < this.majorList[j].children.length; k++) {
if (this.majorList[j].children[k].staffGradeName == item.staffGradeName) { if (this.majorList[j].children[k].gradeName == item.gradeName) {
this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId; this.Form.staffArchitectureId = this.majorList[j].staffArchitectureId;
} }
} }
} }
}, },
sureDepartment(Form) { sureDepartment(Form) { //
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
let data = { let data = {
staffGradeName: this.Form.departmentName, gradeId: this.Form.gradeId,
staffProfessionalArchitectureId: this.Form.MajorId, gradeName: this.Form.gradeName,
staffGradeId: this.Form.departmentId staffArchitectureId: this.Form.staffArchitectureId
}; };
if (this.Form.departmentId) { if (this.Form.gradeId) {
this.$post(this.api.updateStaffGrade, data).then(res => { this.$post(this.api.updateGrade, data).then(res => {
util.successMsg("编辑成功"); if (res.status === 200) {
this.isAddDepartment = false; util.successMsg("编辑成功");
this.majorList.map(e => { this.isAddDepartment = false;
e.children.map(r => { this.majorList.map(e => {
if (r.staffGradeId == this.Form.departmentId) { e.children.map(r => {
r.staffGradeName = this.Form.departmentName; if (r.gradeId == this.Form.gradeId) {
r.label = this.Form.departmentName; r.gradeName = this.Form.gradeName;
} r.label = this.Form.gradeName;
}
});
}); });
}); } else {
util.errorMsg(res.message);
}
}).catch(res => { }).catch(res => {
}); });
} else { } else {
this.$post(this.api.addStaffGrade, data).then(res => { this.$post(this.api.saveGrade, data).then(res => {
util.successMsg("添加成功"); if (res.status === 200) {
this.isAddDepartment = false; util.successMsg("添加成功");
let newData = { this.isAddDepartment = false;
staffGradeId: res.message, let newData = {
staffGradeName: this.Form.departmentName, gradeId: res.gradeId,
label: this.Form.departmentName, gradeName: this.Form.gradeName,
ifVisible: false, label: this.Form.gradeName,
ischeck: false value: res.gradeId,
}; ifVisible: false,
this.majorList.map(e => { ischeck: false
if (e.staffProfessionalArchitectureId == this.Form.MajorId) { };
e.ifVisible = true; this.majorList.map(e => {
e.children.push(newData); if (e.staffArchitectureId == this.Form.staffArchitectureId) {
} e.ifVisible = true;
}); e.children.push(newData);
}
});
} else {
util.errorMsg(res.message);
}
}).catch(res => { }).catch(res => {
}); });
} }
@ -244,54 +258,42 @@ export default {
delMajor(item, index) { delMajor(item, index) {
this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", { this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$post(`${this.api.deleteProfessional}?staffArchitectureId=${item.staffArchitectureId}`).then(res => {
let data = { util.successMsg("删除成功");
staffProfessionalArchitectureId: item.staffProfessionalArchitectureId this.majorList.splice(index, 1);
}; this.$emit("getData");
this.$post(this.api.deleteStaffPro, data).then(res => { // this.$get(`${this.api.dalStaffByProfessionalId}?staffArchitectureId=${item.staffArchitectureId}`).then(res => {
util.successMsg("删除成功"); // }).catch(res => {
this.majorList.splice(index, 1); // });
this.$emit("getData"); }).catch(res => {});
this.$get(`${this.api.dalStaffByProfessionalId}?staffProfessionalArchitectureId=${item.staffProfessionalArchitectureId}`).then(res => { }).catch(() => {});
}).catch(res => {
});
}).catch(res => {
});
})
.catch(() => {
});
}, },
delDepartment(item, indx) { delDepartment(item, index) {
console.log(item);
this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", { this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning" type: "warning"
}) }).then(() => {
.then(() => { this.$post(`${this.api.deleteGrade}?gradeId=${item.gradeId}`).then(res => {
let data = { util.successMsg("删除成功");
staffGradeId: item.staffGradeId this.majorList.map(e => {
}; e.children.map(r => {
this.$post(this.api.deleteStaffGrade, data).then(res => { if (r.gradeId == item.gradeId) {
util.successMsg("删除成功"); e.children.splice(index, 1);
this.majorList.map(e => { if (e.children.length == 0) {
e.children.map(r => { e.ifVisible = false;
if (r.staffGradeId == item.staffGradeId) {
e.children.splice(indx, 1);
if (e.children.length == 0) {
e.ifVisible = false;
}
} }
}); }
});
this.$emit("delDep", item, this.majorList);
this.$emit("getData");
this.$get(`${this.api.dalStaffByStaffGradeId}?staffGradeId=${item.staffGradeId}`).then(res => {
}).catch(res => {
}); });
}).catch(res => {
}); });
}) this.$emit("delDep", item, this.majorList);
.catch(() => { this.$emit("getData");
// this.$get(`${this.api.dalStaffByStaffGradeId}?gradeId=${item.gradeId}`).then(res => {
// }).catch(res => {
// });
}).catch(res => {
}); });
}).catch(() => {});
} }
} }
}; };

@ -113,9 +113,6 @@ export default {
addClass(item) { addClass(item) {
this.$emit("addClass", item); this.$emit("addClass", item);
}, },
editDepartment(item) {
this.$emit("editDepartment", item);
},
delDepartment(item, index) { delDepartment(item, index) {
this.$emit("delDepartment", item, index); this.$emit("delDepartment", item, index);
}, },

@ -5,7 +5,6 @@ import Setting from "@/setting";
import { get } from "@/plugins/requests/index.js"; import { get } from "@/plugins/requests/index.js";
import api from "@/api"; import api from "@/api";
import util from "@/libs/util"; import util from "@/libs/util";
import { permission } from "@/router/permission";
import BasicLayout from "@/layouts/home"; import BasicLayout from "@/layouts/home";
Vue.use(Router); Vue.use(Router);
@ -63,7 +62,6 @@ function getPermission() {
let data = res.permissionMenu[0].children; let data = res.permissionMenu[0].children;
if (data.length > 0) { if (data.length > 0) {
data.forEach(e => { data.forEach(e => {
// 第一级路由,需要根据匹配到的path,塞进对应的路由children里 // 第一级路由,需要根据匹配到的path,塞进对应的路由children里
let str = e.path.split("/")[1]; let str = e.path.split("/")[1];
@ -113,6 +111,7 @@ function getPermission() {
} }
} }
// permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由 // permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由
meta.push(i.name);
} else { } else {
meta.push(i.name); meta.push(i.name);
} }
@ -151,6 +150,7 @@ function getPermission() {
} }
} }
// permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由 // permissionRouters.push(obj) // path是页面,要塞入上一级同级里,需要单独push进去生成路由
meta.push(i.name+"-"+j.name);
} else { } else {
meta.push(i.name+"-"+j.name); meta.push(i.name+"-"+j.name);
} }

@ -1,27 +0,0 @@
import router from "./index";
import Setting from "@/setting";
import util from "@/libs/util";
// router.beforeEach((to, from, next) => {
// document.title = Setting.titleSuffix;
// const role = util.local.get(Setting.tokenKey);
// if (!role && to.path !== "/login") {
// next("/login");
// } else if (role && to.path == "/login") {
// next("/index");
// } else {
// let mg = from.query.mg;
// if (mg) {
// if (!to.query.mg) {
// next({
// path: to.path,
// query: { mg }
// });
// } else {
// next();
// }
// } else {
// next();
// }
// }
// });

@ -17,6 +17,7 @@ const frameIn = [
meta: { title: "首页" }, meta: { title: "首页" },
children: [] children: []
}, },
]; ];
/** /**
@ -32,6 +33,14 @@ const frameOut = [
title: "登录" title: "登录"
}, },
component: () => import("@/pages/account/login") component: () => import("@/pages/account/login")
},
{
path: "/setting/person",
name: "person",
meta: {
title: "个人中心"
},
component: () => import("@/pages/setting/list")
} }
]; ];

@ -42,8 +42,8 @@ if (isHh) {
schoolId = 2105; schoolId = 2105;
} else if (isDev) { } else if (isDev) {
jumpPath = "http://192.168.31.154:8087/"; jumpPath = "http://192.168.31.154:8087/";
host = "http://39.108.250.202:9000/"; // 中台测试服 // host = "http://39.108.250.202:9000/"; // 中台测试服
// host = "http://192.168.31.151:9000/"; // 榕 host = "http://192.168.31.151:9000/"; // 榕
// host = "http://192.168.31.125:9000/"; // 坤 // host = "http://192.168.31.125:9000/"; // 坤
// host = 'http://192.168.31.137:9000/'; // 赓 // host = 'http://192.168.31.137:9000/'; // 赓
title = "职站服务端管理系统"; title = "职站服务端管理系统";

Loading…
Cancel
Save