master
yujialong 4 years ago
parent 2105a2cbe3
commit 29b43f9886
  1. 1
      src/api/index.js
  2. BIN
      src/assets/img/account.png
  3. BIN
      src/assets/img/download.png
  4. BIN
      src/assets/img/home.png
  5. BIN
      src/assets/img/login_bg.png
  6. BIN
      src/assets/img/logo-full.png
  7. BIN
      src/assets/img/password.png
  8. BIN
      src/assets/img/ques.png
  9. BIN
      src/assets/img/student.png
  10. BIN
      src/assets/img/system-fullname.png
  11. BIN
      src/assets/img/system-name.png
  12. BIN
      src/assets/img/system.png
  13. BIN
      src/assets/img/upload.png
  14. 30
      src/components/breadcrumb/index.vue
  15. 28
      src/layouts/footer/index.vue
  16. 111
      src/layouts/header/index.vue
  17. 57
      src/layouts/home/index.vue
  18. 67
      src/layouts/navbar/index.vue
  19. 18
      src/libs/util.js
  20. 137
      src/pages/account/login/index.vue
  21. 225
      src/pages/client/add/index.vue
  22. 165
      src/pages/client/list/index.vue
  23. 218
      src/pages/quesBank/list/globalQuesBank.vue
  24. 35
      src/pages/quesBank/list/index.vue
  25. 309
      src/pages/quesBank/list/myQuesBank.vue
  26. 92
      src/pages/quesBank/list/quesBankType.vue
  27. 127
      src/pages/quesBank/list/quesDialog.vue
  28. 717
      src/pages/setting/person/index.vue
  29. 54
      src/pages/system/list/index.vue
  30. 277
      src/pages/system/list/organization.vue
  31. 91
      src/pages/system/list/role.vue
  32. 338
      src/pages/system/list/staff.vue
  33. 301
      src/pages/system/list/staffside.vue
  34. 215
      src/pages/user/list/index.vue
  35. 10
      src/plugins/requests/index.js
  36. 2
      src/setting.js
  37. 6
      src/store/modules/user.js
  38. 418
      src/styles/common.scss
  39. BIN
      src/styles/font/YouSheBiaoTiHei.ttf
  40. 3
      src/styles/layout/index.scss
  41. 10
      vue.config.js
  42. BIN
      题库导入模板.xlsx

@ -17,6 +17,7 @@ export default {
queryProvince: `cjEnterprise/province/queryProvince`,
// 个人中心
uploadUserAvatars: `http://www.liuwanr.cn/liuwanr/user/uploadUserAvatars`,
userinfoUpdate:`management/userInfo/update`,
userinfo:`management/userInfo/getUserInfo`,
getAccount:`management/userInfo/getAccount`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

@ -0,0 +1,30 @@
<template>
<div class="breadcrumb">
<span class="cur">当前位置</span>
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">超竞企业端</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item,index) in pages" :key="index" :to="{ path: index == pages.length - 1 ? curRoute : route }">{{item}}</el-breadcrumb-item>
</el-breadcrumb>
</div>
</template>
<script>
export default {
props: ['data','route'],
data() {
return {
pages: this.data.split('/'),
curRoute: this.$route.path
};
},
methods: {
update(data){
console.log(2222,data)
this.pages = data.split('/')
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -0,0 +1,28 @@
<template>
<div>
<div class="copyright">广州超竞教育投资有限公司版权所有</div>
</div>
</template>
<script>
export default {
data() {
return {
};
},
mounted(){
},
methods: {
},
};
</script>
<style lang="scss" scoped>
.copyright{
padding: 20px 0;
color: rgba(0, 0, 0, 0.45);
font-size: 12px;
text-align: center;
}
</style>

@ -1,18 +1,17 @@
<template>
<div class="header flex a-center j-between">
<div v-if="showBack" class="goBack" v-throttle @click="back"><i class="el-icon-arrow-left"></i>返回</div>
<div v-else class="logo">
<img src="../../assets/img/logo-fill.png">
</div>
<div class="header-right">
<div class="header-user-con">
<div class="user" @click="toPerson">
<div>
<div class="header">
<img class="system-name" src="../../assets/img/system-fullname.png">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="user-avator">{{userName}}</span>
<span class="username">{{userName}}</span>
</div>
<el-divider class="m-l-20" direction="vertical"></el-divider>
<el-button type="text" class="m-l-20" @click="loginout">退出</el-button>
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person">个人资料</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
@ -42,79 +41,43 @@ export default {
...mapActions('user', [
'logout'
]),
toPerson(){
this.$router.push('/setting/person')
},
loginout() {
this.logout()
},
back(){
this.$router.back()
userCommand(command){
console.log(command)
if(command == 'person'){
this.$router.push('/setting/person')
}else{
this.logout()
}
}
},
};
</script>
<style lang="scss" scoped>
.goBack{
cursor: pointer;
line-height: 60px;
height: 60px;
font-size: 16px;
font-weight: bold;
margin-left: 20px;
i{
color: #cb221c;
font-size: 20px;
}
}
.header {
position: relative;
box-sizing: border-box;
width: 100%;
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 40px 20px 24px;
font-size: 16px;
color: #333;
border-bottom: 1px solid #efefef;
box-shadow: 0 0 1.5625rem 0.125rem rgba(255, 45, 45, 0.14);
.logo {
float: left;
width: 170px;
height: 40px;
margin-left: 20px;
img{
height: 100%;
}
background-color: #fff;
box-sizing: border-box;
.system-name {
width: 326px;
}
.header-right {
float: right;
padding-right: 50px;
.header-user-con {
display: flex;
height: 70px;
.user-wrap {
display: flex;
align-items: center;
.user{
display: inline-flex;
align-items: center;
.user{
display: inline-flex;
align-items: center;
cursor: pointer;
}
}
.el-button--text{
color: #333;
}
.el-divider--vertical{
width: 2px;
height: 15px;
}
.el-divider{
background-color: #333;
}
.user-avator {
margin-left: 10px;
img {
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
.username{
margin-left: 10px;
color: #000;
font-size: 16px;
}
}
}

@ -1,30 +1,27 @@
<template>
<div class="wrapper">
<div class="placeholder" :class="{mini: !hideNavbar}"></div>
<div class="fixed">
<div class="main">
<v-navbar class="nav"></v-navbar>
<div class="layout">
<v-head></v-head>
<v-navbar v-show="hideNavbar"></v-navbar>
</div>
<div class="content-box" :class="{'content-collapse':collapse}">
<!-- <v-tags></v-tags> -->
<div class="content">
<transition name="move" mode="out-in">
<keep-alive :include="tagsList">
<router-view></router-view>
<router-view class="view"></router-view>
</keep-alive>
</transition>
<el-backtop target=".content"></el-backtop>
<v-footer ref="footer"></v-footer>
</div>
</div>
</div>
</template>
<script>
import vHead from '../header/index.vue';
import vNavbar from '../navbar/index.vue';
import vTags from '../tags/index.vue';
import bus from '@/libs/bus';
import Setting from '@/setting';
import vHead from '../header/index.vue'
import vNavbar from '../navbar/index.vue'
import vFooter from '../footer'
import bus from '@/libs/bus'
import Setting from '@/setting'
export default {
data() {
return {
@ -36,7 +33,7 @@ export default {
components: {
vHead,
vNavbar,
vTags
vFooter
},
computed: {
hideNavbar() {
@ -62,20 +59,24 @@ export default {
};
</script>
<style lang="scss" scoped>
.sidebar+.content-box{
margin-left: 210px !important;
}
.fixed{
z-index: 10;
position: fixed;
top: 0;
width: 100%;
background-color: #fff;
}
.placeholder{
height: 120px;
&.mini{
height: 60px;
.main{
display: flex;
min-width: 1300px;
height: 100%;
overflow: hidden;
.nav{
width: 220px;
}
.layout{
width: calc(100% - 220px);
.content{
height: calc(100vh - 80px);
padding: 24px 24px 0;
overflow: auto;
.view{
min-height: calc(100% - 60px);
}
}
}
}
</style>

@ -1,14 +1,16 @@
<template>
<div>
<div class="logo">
<img src="../../assets/img/logo-full.png" width="125">
</div>
<el-menu
class="sidebar-el-menu"
:default-active="onRoutes"
:collapse="collapse"
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#cb221c"
background-color="#141414"
text-color="#fff"
active-text-color="#fff"
unique-opened
mode="horizontal"
router
>
<template v-for="item in menus">
@ -60,24 +62,24 @@ export default {
collapse: false,
defaultMenus: [
{
icon: 'el-icon-coordinate',
icon: 'menu-icon icon-home',
index: '/index/list',
title: '学校管理'
title: '院校信息管理'
},
{
icon: 'el-icon-user',
icon: 'menu-icon icon-student',
index: '/user/list',
title: '用户管理'
title: '院校用户管理'
},
{
icon: 'el-icon-notebook-1',
icon: 'menu-icon icon-ques',
index: '/quesBank/list',
title: '题库管理'
title: '题库资源管理'
},
{
icon: 'el-icon-setting',
icon: 'menu-icon icon-system',
index: '/system/list',
title: '系统设置'
title: '系统分管设置'
}
],
menus: [],
@ -125,6 +127,47 @@ export default {
</script>
<style lang="scss" scoped>
.nav{
height: 100%;
background-color: #141414;
overflow: auto;
.logo{
padding: 20px 0;
text-align: center;
}
/deep/.el-menu{
border-right: 0 !important;
.el-menu-item{
display: flex;
align-items: center;
&.is-active{
background-color: #CC221C !important;
}
.menu-icon{
width: 24px;
height: 24px;
margin-right: 12px;
background: url(../../assets/img/home.png) no-repeat;
&.icon-ques{
background-image: url(../../assets/img/ques.png);
}
&.icon-student{
background-image: url(../../assets/img/student.png);
}
&.icon-system{
background-image: url(../../assets/img/system.png);
}
}
span{
font-size: 15px;
}
}
}
}
.sidebar::-webkit-scrollbar {
width: 0;
}
.sidebar-el-menu:not(.el-menu--collapse) {
width: 100%;
}

@ -1,5 +1,6 @@
import cookies from './util.cookies'
import {_local,_session} from './util.db'
import { Message } from 'element-ui'
const util = {
cookies,
@ -103,6 +104,23 @@ const util = {
}
x.send()
},
// 成功提示
successMsg(message) {
Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
},
// 警告提示
warningMsg(message) {
Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
},
// 错误提示
errorMsg(message) {
Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration: 1500})
},
// 给超过给定长度的字符串加省略号
ellipsisStr(str) {
if(str.length > 14) str = str.substr(0,14) + '……'
return str
},
}
export default util

@ -1,51 +1,23 @@
<template>
<div class="wrap">
<div class="header">
<div class="inner">
<img class="logo" src="../../../assets/img/logo.png" alt="">
</div>
<div class="left">
<img class="logo" src="../../../assets/img/logo-full.png" alt="">
<img class="name" src="../../../assets/img/system-name.png" alt="">
</div>
<div class="main">
<div class="left">
<div class="text">
<p>欢迎进入</p>
<p>电子竞技<br>数字化考试系统<br><span>超竞企业端</span></p>
</div>
</div>
<div class="right">
<div class="right">
<div>
<h2>密码登录</h2>
<el-form :model="loginForm" :rules="loginRules" ref="login" label-width="0px">
<el-form-item prop="username">
<p class="label">用户名</p>
<label class="account"></label>
<el-input v-model="loginForm.username" placeholder="请输入账号/手机号" @keyup.enter.native="submitForm()"></el-input>
</el-form-item>
<el-form-item prop="password">
<p class="label">密码</p>
<el-input
type="password"
placeholder="请输入密码"
v-model="loginForm.password"
@keyup.enter.native="submitForm()"
>
<label class="password"></label>
<el-input type="password" placeholder="请输入密码" v-model="loginForm.password" @keyup.enter.native="submitForm()">
</el-input>
</el-form-item>
<el-button class="submit" type="primary" @click="submitForm">登录</el-button>
<!-- <div class="links flex j-between">
<el-button type="text" class="ques" @click="toReg">前往注册</el-button>
<el-button type="text" class="forget">忘记密码</el-button>
</div> -->
<!-- <p class="login-tips">其他登陆方式</p>
<div class="thirdParty">
<div class="item">
<img src="../../../assets/img/icon_wechat.png" alt="">
微信扫码登录
</div>
<div class="item">
<img src="../../../assets/img/icon_qq.png" alt="">
QQ一键登录
</div>
</div> -->
</el-form>
</div>
</div>
@ -53,7 +25,7 @@
</template>
<script>
import { mapActions } from 'vuex';
import { mapActions } from 'vuex'
export default {
data: function() {
return {
@ -103,83 +75,38 @@ export default {
</script>
<style scoped lang="scss">
.header{
.wrap {
position: relative;
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(51,51,51,.7);
.inner{
display: inline-flex;
justify-content: space-between;
align-items: center;
width: 65%;
padding: 5px 0;
font-size: 16px;
color: #fff;
.logo{
width: 200px;
}
.reg{
cursor: pointer;
}
}
}
.wrap {
position: relative;
width: 100%;
height: 100%;
background: url(../../../assets/img/login_bg.png) 0 0/100% 100% no-repeat;
overflow: hidden;
.mask{
z-index: -1;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0,0,0,1);
}
.main{
height: calc(100% - 60px);
display: flex;
justify-content: center;
align-items: center;
background-color: rgba(0,0,0,.4);
}
.left{
margin-top: -200px;
margin-right: 10%;
margin-right: 200px;
img{
width: 447px;;
margin-bottom: 30px;
display: block;
}
.text{
font-size: 52px;
color: #fff;
p:first-child{
margin-bottom: 30px;
}
span{
font-size: 36px;
}
.logo{
max-width: 242px;
margin-bottom: 60px;
}
.name{
max-width: 663px;
}
}
.right{
width: 580px;
padding: 40px 70px 50px;
background-color: #fff;
box-sizing: border-box;
box-shadow: 0 1px 20px rgba(0,0,0,0.16);
border-radius: 16px;
h2{
padding-bottom: 10px;
font-size: 24px;
font-weight: 400;
color: #303d4c;
color: #000;
text-align: center;
border-bottom: 1px solid #E5E5E5;
}
.el-form{
margin-top: 30px;
@ -188,11 +115,25 @@ export default {
color: #105CB2;
}
/deep/.el-input__inner{
position: relative;
width: 320px;
height: 46px;
padding: 0 23px;
padding: 0 20px 0 40px;
line-height: 46px;
border: 1px solid #AFB5BB;
border-radius: 23px !important;
border: 1px solid #E6E6E6;
border-radius: 8px !important;
}
.account,.password{
z-index: 10;
position: absolute;
top: 11px;
left: 12px;
width: 24px;
height: 24px;
background: url(../../../assets/img/account.png) 0 0/100% 100% no-repeat;
}
.password{
background-image: url(../../../assets/img/password.png);
}
/deep/.el-form-item__error{
top: 105%;
@ -203,7 +144,7 @@ export default {
.submit{
width: 100%;
height: 48px;
margin-top: 60px;
margin-top: 30px;
line-height: 48px;
padding: 0;
font-size: 20px;

@ -1,70 +1,105 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between a-center">
<div class="per_title" v-throttle @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="isDetail ? '查看用户' : (id != '' ? '编辑客户' : '新增客户')"></span>
</div>
<el-button type="primary" size="small" round class="mag" v-if="!isDetail" v-throttle @click="saveAdd">确定</el-button>
<breadcrumb :data="'学校信息列表/学校信息'"></breadcrumb>
<div class="page">
<div class="p-title">学校信息</div>
<div class="page-content">
<ul class="list" v-if="isDetail">
<li>
<div class="side">
<span class="name"><i class="required">*</i>国家</span>
<span class="val">中国</span>
</div>
<div class="side">
<span class="name"><i class="required">*</i>客户类型</span>
<span class="val">{{clientTypeList.find(n => n.value == form.type).name}}</span>
</div>
</li>
<li>
<div class="side">
<span class="name"><i class="required">*</i>省份</span>
<span class="val">{{provinceList.find(n => n.provinceId == form.provinceId).provinceName}}</span>
</div>
<div class="side">
<span class="name"><i class="required">*</i>城市</span>
<span class="val">{{cityList.find(n => n.cityId == form.cityId).cityName}}</span>
</div>
</li>
<li>
<div class="side">
<span class="name"><i class="required">*</i>客户名称</span>
<span class="val">{{form.clientName}}</span>
</div>
<div class="side">
<span class="name"><i class="required">*</i>联系人名称</span>
<span class="val">{{form.contactPersonName}}</span>
</div>
</li>
<li>
<div class="side">
<span class="name"><i class="required">*</i>手机号</span>
<span class="val">{{form.phone}}</span>
</div>
<div class="side"></div>
</li>
</ul>
<el-form v-else :model="form" :rules="rules" ref="form" label-width="100px" size="small">
<el-form-item prop="countries" label="国家">
<div class="d-inline-block">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<div class="d-inline-block">
<el-select v-model="form.provinceId" placeholder="" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item prop="clientName" label="院校名称">
<div class="d-inline-block">
<el-input placeholder="请输入院校名称" v-model="form.clientName" @change="nameChange"></el-input>
</div>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<div class="d-inline-block">
<el-input placeholder="请输入手机号" v-model="form.phone" maxlength="11"></el-input>
</div>
</el-form-item>
<el-form-item prop="type" label="客户类型">
<div class="d-inline-block">
<el-select v-model="form.type" placeholder="">
<el-option v-for="(item,index) in clientTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<div class="d-inline-block">
<el-select v-model="form.cityId" :disabled="form.provinceId ? false : true" placeholder="">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</div>
</el-form-item>
<el-form-item prop="contactPersonName" label="对接人姓名">
<div class="d-inline-block">
<el-input placeholder="请输入对接人姓名" v-model="form.contactPersonName"></el-input>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" v-if="!isDetail" v-throttle @click="saveAdd">确定</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover">
<div>
<div class="p-title m-b-20">基本信息</div>
<div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex j-center" :disabled="isDetail">
<el-col :span="6" style="margin-right: 60px;">
<el-form-item prop="countries" label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="provinceId" label="省份">
<el-select v-model="form.provinceId" placeholder="" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="clientName" label="客户名称">
<el-input placeholder="请输入客户名称" v-model="form.clientName" @change="nameChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input placeholder="请输入手机号" v-model="form.phone" maxlength="11"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" style="margin-left: 60px;">
<el-form-item prop="type" label="客户类型">
<el-select v-model="form.type" placeholder="">
<el-option v-for="(item,index) in clientTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cityId" label="城市">
<el-select v-model="form.cityId" :disabled="form.provinceId ? false : true" placeholder="">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="contactPersonName" label="管理员姓名">
<el-input placeholder="请输入管理员姓名" v-model="form.contactPersonName"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { mapState } from 'vuex'
import breadcrumb from '@/components/breadcrumb'
import util from '@/libs/util'
export default {
name: 'index-add',
data() {
@ -128,6 +163,7 @@ export default {
nameRepeat: false
};
},
components: { breadcrumb },
computed: {
...mapState('client', [
'provinceList'
@ -151,7 +187,7 @@ export default {
this.$get(`${this.api.getClientName}?clientName=${this.form.clientName}`).then(res => {
if(res.data.client.length){
this.nameRepeat = true
this.$message.warning('该客户名称已存在')
util.warningMsg('该客户名称已存在')
}else{
this.nameRepeat = false
}
@ -180,19 +216,19 @@ export default {
saveAdd(){
this.$refs.form.validate((valid) => {
if (valid) {
if(this.nameRepeat) return this.$message.warning('该客户名称已存在')
if(this.nameRepeat) return util.warningMsg('该客户名称已存在')
this.form.provinceName = this.provinceList.find(n => n.provinceId == this.form.provinceId).provinceName
this.form.cityName = this.cityList.find(n => n.cityId == this.form.cityId).cityName
let data = this.form
if(this.id){
this.$post(this.api.updateClient,data).then((res) => {
this.$message.success('编辑成功');
util.successMsg('编辑成功')
this.$router.back()
}).catch((res) => {
})
}else{
this.$post(this.api.addClient,data).then((res) => {
this.$message.success('添加成功');
util.successMsg('添加成功')
this.$router.back()
}).catch((res) => {
})
@ -200,25 +236,56 @@ export default {
}
})
},
goback() {
if(this.isDetail){
this.$router.back()
}else{
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/.el-row{
margin-bottom: 0;
.search{
display: flex;
align-items: center;
margin-bottom: 20px;
label{
white-space: nowrap;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
}
.el-input{
width: 250px;
}
}
/deep/.d-inline-block{
width: 216px;
.el-select,.el-input{
width: 100%;
}
}
.course-name{
margin-right: 5px;
}
.list{
li{
display: flex;
justify-content: center;
align-items: center;
margin: 32px 0;
.side{
width: 200px;
&:first-child{
margin-right: 100px;
}
}
.name,.val{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
}
.name{
width: 45%;
text-align: right;
}
.val{
width: 55%;
}
}
}
</style>

@ -1,94 +1,86 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div>
<el-form label-width="80px">
<el-col :span="6">
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="initData()">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
<breadcrumb :data="'院校信息管理/客户院校列表'"></breadcrumb>
<div class="page">
<div class="p-title">客户院校列表</div>
<div class="page-content">
<div class="tool">
<ul class="filter">
<li>
<label>国家</label>
<el-select v-model="form.countries" clearable placeholder="请选择国家" size="small">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li>
<label>省份</label>
<el-select v-model="form.provinces" clearable placeholder="请选择省份" size="small" @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</li>
<li>
<label>城市</label>
<el-select v-model="form.city" clearable placeholder="请选择城市" size="small" :disabled="form.provinces ? false : true" @change="initData()">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入客户名称/管理员姓名/电话" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">客户列表</div>
<div>
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
<el-table :data="customerData" ref="table" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="clientName" label="客户院校名称" align="center">
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center">
</el-table-column>
<el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="contactPersonName" label="对接人姓名" align="center">
</el-table-column>
<el-table-column prop="phone" label="手机号" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'/index/list:禁用'"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</div>
<el-table :data="customerData" ref="table" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<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">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="clientName" label="客户名称" align="center">
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center">
</el-table-column>
<el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="contactPersonName" label="管理员姓名" align="center">
</el-table-column>
<el-table-column prop="phone" label="手机号" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-switch
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'/index/list:禁用'"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import breadcrumb from '@/components/breadcrumb'
import util from '@/libs/util'
export default {
name: 'index',
data() {
@ -113,6 +105,7 @@ export default {
searchTimer: null
};
},
components: { breadcrumb },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
@ -181,12 +174,12 @@ export default {
this.$router.push(`add?id=${row.id}`);
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteClient}?clientIds=${row.id}`).then(res => {
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
@ -204,7 +197,7 @@ export default {
isDisable: val
}
this.$post(this.api.updateClient,data).then((res) => {
val == 1 ? this.$message.success('禁用成功') : this.$message.success('启用成功')
val == 1 ? util.successMsg('禁用成功') : util.successMsg('启用成功')
}).catch((res) => {
})
},
@ -214,19 +207,19 @@ export default {
let delList = newArr.map(item => {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].clientName)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteClient}?clientIds=${delList.join()}`).then(res => {
this.$refs.table.clearSelection()
this.multipleSelection = [];
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择数据');
util.errorMsg('请先选择数据');
}
},
handleCurrentChange(val) {

@ -1,68 +1,84 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="tool">
<ul class="filter">
<li>
<label>创建人</label>
<el-select v-model="createUser" clearable placeholder="请选择创建人" size="small" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in createUserList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li>
<label>题目类型</label>
<el-select v-model="name" clearable placeholder="请选择题目类型" size="small" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入题干/知识点" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<div class="p-title m-b-20">筛选</div>
<div>
<div class="flex j-between no-mb">
<div>
<el-form label-width="80px" inline>
<el-form-item class="no-mb" label="创建人">
<el-select v-model="createUser" clearable placeholder="请选择创建人" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in createUserList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item class="no-mb" label="试题类型">
<el-select v-model="name" clearable placeholder="请选择试题类型" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div>
<el-input placeholder="请输入题干/知识点" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:校企公共题库:批量取消共享'">批量取消共享</el-button>
</div>
</el-card>
</div>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">题目列表</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="共享时间" width="140" align="center"></el-table-column>
<el-table-column prop="createUser" label="创建人" width="100" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:校企公共题库:查看'">查看</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth="'/quesBank/list:校企公共题库:取消共享'">取消共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
</div>
<div>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:公共题库:批量取消共享'">批量取消共享</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="100" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="共享时间" width="140" align="center"></el-table-column>
<el-table-column prop="createUser" label="创建人" width="100" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="120">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:公共题库:查看'">查看</el-button>
<el-button v-if="scope.row.createUser == '系统内置'" type="text" @click="delData(scope.row)" v-auth="'/quesBank/list:公共题库:取消共享'">取消共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
</div>
</el-card>
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog>
<el-dialog title="查看题目" :visible.sync="visible" width="870px" class="dialog" :close-on-click-modal="false">
<ul class="list">
<li>
<span class="name">所属题库</span>
<span class="val">{{topicForm.cid ? quesBankList.find(n => n.cid == topicForm.cid).typeName : ''}}</span>
</li>
<li>
<span class="name">所属课程</span>
<span class="val">{{topicForm.courses}}</span>
</li>
<li>
<span class="name">知识点</span>
<span class="val">{{topicForm.knowledgePoints}}</span>
</li>
<li>
<span class="name">题型</span>
<span class="val">{{topicForm.questionType}}</span>
</li>
<li>
<span class="name">题干</span>
<div class="val">
<div v-html="topicForm.questionStem"></div>
</div>
</li>
<li>
<span class="name">答案解析</span>
<span class="val">{{topicForm.answerAnalysis}}</span>
</li>
</ul>
</el-dialog>
</div>
</template>
@ -92,13 +108,16 @@ export default {
searchTimer: null,
isDetail: false,
visible: false,
topicsTitle: ''
topicsTitle: '',
quesBankList: [],
topicForm: {}
};
},
components: {quesDialog},
mounted() {
this.getData()
this.getType()
this.getQuesBank()
},
watch: {
keyword: function(val) {
@ -138,12 +157,12 @@ export default {
this.multipleSelection = val
},
delData(row) {
this.$confirm('确定要取消共享吗?', '提示', {
this.$confirm('确定要取消共享该选中的题目吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=1&ids=${row.sid}`).then(res => {
this.$message.success('取消共享成功')
util.successMsg('取消共享成功')
this.getData()
}).catch(res => {});
})
@ -156,20 +175,20 @@ export default {
return item.sid
})
this.$confirm('确定要取消共享吗?', '提示', {
this.$confirm(`是否确认取消共享${util.ellipsisStr(newArr[0].questionStem)}${newArr.length}个选中的题目?`, '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubjectBySharing}?identification=1&ids=${delList.join()}`).then(res => {
this.multipleSelection = [];
this.$message.success('取消共享成功')
util.successMsg('取消共享成功')
this.getData()
this.$refs.table.clearSelection()
}).catch(res => {})
})
.catch(() => {})
}else{
this.$message.error('请先选择数据!')
util.errorMsg('请先选择数据!')
}
},
dialogGetData(){
@ -181,8 +200,56 @@ export default {
this.visible = true
this.isDetail = false
},
getQuesBank() {
let data = {
pageNum: 1,
pageSize: 10000,
schoolId: this.clientId,
source: 1
}
this.$post(this.api.listByPage,data).then(res => {
let list = res.data.list.list
let result = []
list.map(n => {
result.push(n)
if(n.secondColumn.length) result = result.concat(n.secondColumn)
})
this.quesBankList = result
}).catch(err => {})
},
getDetail(id) {
this.$refs.quesDialog.getData(id)
this.$post(`${this.api.findById}?id=${id}`).then(res => {
let list = res.data.list
this.topicForm = {
id: list.id,
userId: list.userId,
schoolId: this.clientId,
cid : list.cid,
typeId: list.typeId,
courses: list.courses,
knowledgePoints: list.knowledgePoints,
answer: list.answer,
questionType: '',
questionStem: list.questionStem,
optionA: list.optionA,
optionB: list.optionB,
optionC: list.optionC,
optionD: list.optionD,
optionE: list.optionE,
optionF: list.optionF,
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
judgeOptionA: '正确',
judgeOptionB: '错误',
answerAnalysis: list.answerAnalysis,
videoAudio: list.videoAudio
}
console.log(this.topicForm,this.quesBankList)
}).catch(err => {})
},
edit(row) {
this.topicsTitle = '编辑题目'
@ -203,7 +270,22 @@ export default {
}
</script>
<style lang="scss" scoped>
/deep/.no-mb.el-form-item{
margin-bottom: 0;
.list{
li{
display: flex;
margin-bottom: 16px;
.name{
width: 80px;
text-align: right;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
white-space: nowrap;
}
.val{
max-width: calc(100% - 80px);
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
}
}
}
</style>

@ -1,12 +1,16 @@
<template>
<div>
<div class="tabs m-b-20">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
<breadcrumb :data="'题库资源管理/' + tabs[active]" ref="breadcrumb"></breadcrumb>
<div class="page">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="page-content">
<ques-bank-type v-if="active == 'type'" v-auth="'题库资源管理:题库分类'"></ques-bank-type>
<my-ques-bank v-else-if="active == 'my'" v-auth="'题库资源管理:我上传的题库'"></my-ques-bank>
<global-ques-bank v-else v-auth="'题库资源管理:校企公共题库'"></global-ques-bank>
</div>
</div>
<ques-bank-type v-if="active == 'type'" v-auth="'题库管理:题库分类'"></ques-bank-type>
<my-ques-bank v-else-if="active == 'my'" v-auth="'题库管理:我上传的题库'"></my-ques-bank>
<global-ques-bank v-else v-auth="'题库管理:公共题库'"></global-ques-bank>
</div>
</template>
<script>
@ -15,14 +19,15 @@ import Setting from '@/setting'
import quesBankType from './quesBankType'
import myQuesBank from './myQuesBank'
import globalQuesBank from './globalQuesBank'
import breadcrumb from '@/components/breadcrumb'
export default {
data() {
return {
active: 'type',
active: 'my',
tabs: {
type: '题库分类',
my: '我上传的题库',
global: '公共题库'
global: '校企公共题库',
type: '题库分类',
},
};
},
@ -30,6 +35,7 @@ export default {
quesBankType,
myQuesBank,
globalQuesBank,
breadcrumb
},
computed: {
...mapState('auth', [
@ -42,16 +48,17 @@ export default {
methods: {
tabChange(index){
this.active = index
this.$refs.breadcrumb.update('题库资源管理/' + this.tabs[this.active])
},
initTabs(){
let tab1 = this.btns.includes('题库管理:题库分类')
let tab2 = this.btns.includes('题库管理:我上传的题库')
let tab3 = this.btns.includes('题库管理:公共题库')
let tab1 = this.btns.includes('题库资源管理:我上传的题库')
let tab2 = this.btns.includes('题库资源管理:校企公共题库')
let tab3 = this.btns.includes('题库资源管理:题库分类')
if(!tab1 && tab2){
this.active = 'my'
}else if(!tab1 && !tab2 && tab3){
this.active = 'global'
}else if(!tab1 && !tab2 && tab3){
this.active = 'type'
}
if(!tab1) delete this.tabs.type
if(!tab2) delete this.tabs.my

@ -1,112 +1,107 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="p-title m-b-20">测评题库</div>
<div class="flex j-between">
<el-form label-width="80px">
<el-form-item class="no-mb" label="试题类型">
<el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</el-form-item>
</el-form>
<div>
<el-input
placeholder="请输入题干/知识点"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
></el-input>
</div>
<div class="tool">
<ul class="filter">
<li>
<label>题目类型</label>
<el-select v-model="typeId" clearable placeholder="请选择题目类型" size="small" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入题干/知识点" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addTopics" v-auth="'/quesBank/list:我上传的题库:单题创建'">单题创建</el-button>
<el-button type="primary" size="small" round @click="showimportVisible" v-auth="'/quesBank/list:我上传的题库:批量上传'">批量上传</el-button>
<el-button type="primary" size="small" round @click="shareDataBatch" v-auth="'/quesBank/list:我上传的题库:批量共享'">批量共享</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:我上传的题库:批量删除'">批量删除</el-button>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex j-between m-b-20">
<div class="p-title">题目列表</div>
</div>
<div>
<el-button type="primary" size="small" round @click="addTopics" v-auth="'/quesBank/list:我上传的题库:单题上传'">单题上传</el-button>
<el-button type="primary" size="small" round @click="showimportVisible" v-auth="'/quesBank/list:我上传的题库:批量上传'">批量上传</el-button>
<el-button type="primary" size="small" round @click="shareDataBatch" v-auth="'/quesBank/list:我上传的题库:批量共享'">批量共享</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth="'/quesBank/list:我上传的题库:批量删除'">批量删除</el-button>
</div>
</div>
<el-table
:data="listData"
ref="table"
row-key="id"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"
></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="操作" width="230">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:我上传的题库:查看'">查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth="'/quesBank/list:我上传的题库:修改'">修改</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth="'/quesBank/list:我上传的题库:删除'">删除</el-button>
<el-button v-if="!scope.row.myShare" type="text" @click="share(scope.row)" v-auth="'/quesBank/list:我上传的题库:共享'">共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@current-change="handleCurrentChange"
:current-page="page"
:page-size="pageSize"
layout="total,prev, pager, next"
:total="total"
></el-pagination>
</div>
</el-card>
<el-table :data="listData" ref="table" row-key="id" class="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="80"
align="center"
:reserve-selection="true"
:selectable="disabledSelection"
></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" :show-overflow-tooltip="true" label="题干" align="center"></el-table-column>
<el-table-column prop="name" label="试题类型" width="120" align="center"></el-table-column>
<el-table-column prop="courses" label="对应课程" width="140" align="center"></el-table-column>
<el-table-column prop="typeName" label="所属题库" width="140" align="center"></el-table-column>
<el-table-column prop="knowledgePoints" label="知识点" width="140" align="center"></el-table-column>
<el-table-column prop="useNum" label="使用次数" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="上传时间" width="140" align="center"></el-table-column>
<el-table-column label="共享状态" width="140" align="center">
<template slot-scope="scope">
{{scope.row.myShare ? '已共享' : '未共享'}}
</template>
</el-table-column>
<el-table-column label="操作" width="230">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth="'/quesBank/list:我上传的题库:查看'">查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth="'/quesBank/list:我上传的题库:修改'">修改</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth="'/quesBank/list:我上传的题库:删除'">删除</el-button>
<el-button v-if="!scope.row.myShare" type="text" @click="share(scope.row)" v-auth="'/quesBank/list:我上传的题库:共享'">共享</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-size="pageSize" layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center @close="closeImport" :close-on-click-modal="false">
<div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div>
<el-upload
ref="upload"
accept=".xls,.xlsx"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.impExcel"
:file-list="uploadList"
:data="{userId: this.userId}"
name="file"
:auto-upload="false"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<el-dialog title="查看题目" :visible.sync="detailVisible" width="870px" class="dialog" :close-on-click-modal="false">
<ul class="list">
<li>
<span class="name">所属题库</span>
<span class="val">{{topicForm.cid ? quesBankList.find(n => n.cid == topicForm.cid).typeName : ''}}</span>
</li>
<li>
<span class="name">所属课程</span>
<span class="val">{{topicForm.courses}}</span>
</li>
<li>
<span class="name">知识点</span>
<span class="val">{{topicForm.knowledgePoints}}</span>
</li>
<li>
<span class="name">题型</span>
<span class="val">{{topicForm.questionType}}</span>
</li>
<li>
<span class="name">题干</span>
<div class="val">
<div v-html="topicForm.questionStem"></div>
</div>
</li>
<li>
<span class="name">答案解析</span>
<span class="val">{{topicForm.answerAnalysis}}</span>
</li>
</ul>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.impExcel" :file-list="uploadList" :data="{userId: this.userId}" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
<div class="link" v-if="uploadFaild">
<el-link type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button>
@ -139,11 +134,10 @@ export default {
searchTimer: null,
uploadFaild: false,
token: '',
cancelShareVisible: false,
globalData: [],
pageGlobal: 1,
pageSizeGlobal: 10,
totalGlobal: 0,
detailVisible: false,
quesBankList: [],
topicForm: {}
};
},
computed: {
@ -154,6 +148,7 @@ export default {
mounted() {
this.getData()
this.getType()
this.getQuesBank()
},
components: {quesDialog},
watch: {
@ -206,31 +201,82 @@ export default {
this.topicsTitle = '编辑题目'
this.visible = true
this.isDetail = false
this.getDetail(row.id)
this.$refs.quesDialog.getData(row.id)
},
getQuesBank() {
let data = {
pageNum: 1,
pageSize: 10000,
schoolId: this.clientId,
source: 1
}
this.$post(this.api.listByPage,data).then(res => {
let list = res.data.list.list
let result = []
list.map(n => {
result.push(n)
if(n.secondColumn.length) result = result.concat(n.secondColumn)
})
this.quesBankList = result
}).catch(err => {})
},
getDetail(id) {
this.$post(`${this.api.findById}?id=${id}`).then(res => {
let list = res.data.list
this.topicForm = {
id: list.id,
userId: list.userId,
schoolId: this.clientId,
cid : list.cid,
typeId: list.typeId,
courses: list.courses,
knowledgePoints: list.knowledgePoints,
answer: list.answer,
questionType: '',
questionStem: list.questionStem,
optionA: list.optionA,
optionB: list.optionB,
optionC: list.optionC,
optionD: list.optionD,
optionE: list.optionE,
optionF: list.optionF,
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
judgeOptionA: '正确',
judgeOptionB: '错误',
answerAnalysis: list.answerAnalysis,
videoAudio: list.videoAudio
}
console.log(this.topicForm,this.quesBankList)
}).catch(err => {})
},
show(row) {
this.topicsTitle = '查看题目'
this.isDetail = true
this.visible = true
this.detailVisible = true
this.getDetail(row.id)
},
closeTopics() {
this.isDetail = false
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubject}?ids=${row.id}`).then(res => {
this.$message.success('删除成功')
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {})
},
share(row) {
this.$confirm('确定要共享吗?', '提示', {
this.$confirm('该题将共享至公共题库,是否确认共享?', '提示', {
type: 'info'
})
.then(() => {
@ -239,7 +285,7 @@ export default {
qid: row.id
}
this.$post(this.api.saveSharing,data).then(res => {
this.$message.success('共享成功')
util.successMsg('此题已成功共享至校企公共题库')
this.getData()
}).catch(res => {});
})
@ -251,7 +297,7 @@ export default {
})
.then(() => {
this.$post(`${this.api.cancelByMySharing}?ids=${row.id}`).then(res => {
this.$message.success('取消共享成功');
util.successMsg('取消共享成功');
this.getData()
}).catch(res => {});
})
@ -272,7 +318,7 @@ export default {
return item.id
})
this.$confirm('确定要共享吗?', '提示', {
this.$confirm(`是否确认共享${util.ellipsisStr(newArr[0].questionStem)}${newArr.length}个选中的题目?`, '提示', {
type: 'info'
})
.then(() => {
@ -283,7 +329,7 @@ export default {
}
this.$post(this.api.batchSave,data).then(res => {
this.multipleSelection = [];
this.$message.success('共享成功')
util.successMsg('此题已成功共享至校企公共题库')
this.getData()
this.$refs.table.clearSelection()
}).catch(res => {
@ -292,7 +338,7 @@ export default {
})
.catch(() => {});
}else{
this.$message.error('请先选择数据')
util.errorMsg('请先选择数据')
}
},
delAllData() {
@ -302,20 +348,20 @@ export default {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
this.$confirm(`此删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].questionStem)}${newArr.length}个选中的题目?`, '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteByMeSubject}?ids=${delList.join()}`).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
this.$refs.table.clearSelection()
}).catch(res => {})
})
.catch(() => {})
}else{
this.$message.error('请先选择数据!')
util.errorMsg('请先选择数据!')
}
},
downLoad() {
@ -325,7 +371,7 @@ export default {
this.importVisible = true
},
handleExceed(files, fileList) {
this.$message.warning(
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
@ -336,15 +382,15 @@ export default {
// this.token = res.data.data.token
// this.uploadFaild = true
// }else{
this.$message.success('上传成功')
util.successMsg('上传成功')
this.importVisible = false
this.page = 1
this.keyword = ''
this.getData()
// }
}else{
// res.message ? this.$message.error(res.message) : this.$message.error('')
res.message && this.$message.error(res.message)
// res.message ? util.errorMsg(res.message) : util.errorMsg('')
res.message && util.errorMsg(res.message)
}
},
showFaild(){
@ -378,8 +424,23 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.no-mb.el-form-item{
margin-bottom: 0;
.list{
li{
display: flex;
margin-bottom: 16px;
.name{
width: 80px;
text-align: right;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
white-space: nowrap;
}
.val{
max-width: calc(100% - 80px);
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
}
}
}
</style>

@ -1,49 +1,40 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入题库分类名称" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入分类名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
<el-button type="primary" size="small" round @click="addFirst" v-auth="'/quesBank/list:题库分类:添加一级分类'">添加一级分类</el-button>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">分类管理</div>
</div>
<div>
<el-button type="primary" size="small" round @click="addFirst" v-auth="'/quesBank/list:题库分类:添加一级分类'">添加一级分类</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="9">
<el-table-column prop="typeName" label="分类名称">
<template slot-scope="scope">
<span style="display: inline-block;width: 23px;" v-if="!scope.row.secondColumn.length"></span>{{scope.row.typeName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth="'/quesBank/list:题库分类:添加'">添加</el-button>
<el-button type="text" @click="editType(scope.row)" v-auth="'/quesBank/list:题库分类:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/quesBank/list:题库分类:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
</div>
</el-card>
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps" :indent="9">
<el-table-column prop="typeName" label="分类名称">
<template slot-scope="scope">
<span style="display: inline-block;width: 23px;" v-if="!scope.row.secondColumn.length"></span>{{scope.row.typeName}}
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth="'/quesBank/list:题库分类:添加'">添加</el-button>
<el-button type="text" @click="editType(scope.row)" v-auth="'/quesBank/list:题库分类:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/quesBank/list:题库分类:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total">
</el-pagination>
</div>
<el-dialog :title="isAddFirst ? '添加一级分类' : '编辑一级分类'" :visible.sync="firstVisible" width="24%" center @close="closeFirst" :close-on-click-modal="false">
<el-dialog :title="isAddFirst ? '添加一级分类名称' : '编辑一级分类名称'" :visible.sync="firstVisible" width="460px" @close="closeFirst" :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入题库分类名称" v-model="firstName" maxlength="15"></el-input>
<el-input placeholder="请输入一级分类名称" v-model="firstName" maxlength="15"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -52,10 +43,10 @@
</span>
</el-dialog>
<el-dialog :title="isAddSecond ? '添加二级分类' : '编辑二级分类'" :visible.sync="secondVisible" width="24%" center @close="closeSecond" :close-on-click-modal="false">
<el-dialog :title="isAddSecond ? '添加二级分类名称' : '编辑二级分类名称'" :visible.sync="secondVisible" width="460px" @close="closeSecond" :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入题库分类名称" v-model="secondName" maxlength="15"></el-input>
<el-input placeholder="请输入二级分类名称" v-model="secondName" maxlength="15"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -68,6 +59,7 @@
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
@ -125,12 +117,12 @@ export default {
this.getData()
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteById}?cid=${row.cid}`).then(res => {
this.$message.success('删除成功')
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
@ -141,7 +133,7 @@ export default {
this.firstVisible = true
},
firstSubmit(){
if(!this.firstName) return this.$message.warning('请填写题库分类名称')
if(!this.firstName) return util.warningMsg('请填写题库分类名称')
let data = {
userId: this.userId,
typeName: this.firstName,
@ -152,7 +144,7 @@ export default {
data.cid = this.curRow.cid
this.$post(this.api.modifyLevel, data).then(res => {
if(res.success){
this.$message.success('修改成功');
util.successMsg('修改成功');
this.firstVisible = false
this.getData()
}
@ -160,7 +152,7 @@ export default {
}else{
this.$post(this.api.AddOneLevel, data).then(res => {
if(res.success){
this.$message.success('添加成功');
util.successMsg('添加成功');
this.firstVisible = false
this.getData()
}
@ -193,7 +185,7 @@ export default {
}
},
secondSubmit(){
if(!this.secondName) return this.$message.warning('请填写题库分类名称')
if(!this.secondName) return util.warningMsg('请填写题库分类名称')
let data = {
typeName: this.secondName,
@ -204,26 +196,26 @@ export default {
if(this.curRow.parentId == 0){
data.parentId = this.curRow.cid
this.$post(this.api.AddSecondLevel, data).then(res => {
this.$message.success('添加成功');
util.successMsg('添加成功');
this.secondVisible = false
this.getData()
}).catch(err => {})
}else{
data.cid = this.curRow.cid
this.$post(this.api.modifyLevel, data).then(res => {
this.$message.success('修改成功');
util.successMsg('修改成功');
this.secondVisible = false
this.getData()
}).catch(err => {})
}
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}).catch(res => {})
}).catch(() => {})

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="visible" width="40%" @close="closeTopics" center :close-on-click-modal="false">
<el-dialog :title="title" :visible.sync="visible" width="1160px" @close="closeTopics" :close-on-click-modal="false">
<el-form
:model="topicForm"
:rules="rules"
@ -47,7 +47,7 @@
:action="this.api.fileupload"
:file-list="uploadList"
>
<el-button type="primary" class="ml20">上传视频/音频</el-button>
<el-button><img src="../../../assets/img/upload.png" alt=""> 上传视频/音频</el-button>
</el-upload>
<span v-if="topicForm.videoAudio">已上传</span>
</el-form-item>
@ -57,44 +57,44 @@
<el-form-item label="选项" prop="optionA" v-if="topicForm.questionType != '填空题' && topicForm.questionType != '简答题'">
<template v-if="topicForm.questionType == '判断题'">
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionA" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="1">设为正确答案</el-radio>
</div>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.judgeOptionB" disabled></el-input>
<el-radio v-model="topicForm.aisTrue" label="2">设为正确答案</el-radio>
</div>
</template>
<template v-else>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>D</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex j-around a-center m-b-15">
<div class="option">
<span>E</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex j-around a-center">
<div class="option">
<span>F</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
@ -133,6 +133,7 @@
<script>
import quill from '@/components/quill'
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
props: ['visible','title','isDetail'],
data() {
@ -292,16 +293,16 @@ export default {
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
}
}
if((topicForm.typeId == 1 || topicForm.typeId == 3) && optionCount < 2) return this.$message.warning('请至少添加两个选项!')
if(topicForm.typeId == 2 && optionCount < 3) return this.$message.warning('请至少添加三个选项!')
if(!answer) return this.$message.warning('请设置正确答案!')
if(topicForm.questionType == '单选题' && answer.length > 1) return this.$message.warning('单选题只能设置一个正确选项!')
if(topicForm.questionType == '多选题' && answer.length < 2) return this.$message.warning('多选题必须设置至少两个正确选项!')
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!');
if((topicForm.typeId == 1 || topicForm.typeId == 3) && optionCount < 2) return util.warningMsg('请至少添加两个选项!')
if(topicForm.typeId == 2 && optionCount < 3) return util.warningMsg('请至少添加三个选项!')
if(!answer) return util.warningMsg('请设置正确答案!')
if(topicForm.questionType == '单选题' && answer.length > 1) return util.warningMsg('单选题只能设置一个正确选项!')
if(topicForm.questionType == '多选题' && answer.length < 2) return util.warningMsg('多选题必须设置至少两个正确选项!')
if(isInvalidAnswer) return util.warningMsg('正确答案选项为空,请重新设置!');
if(topicForm.typeId == 3) answer = topicForm.aisTrue == 1 ? 'a' : 'b'
this.topicForm.answer = answer.toUpperCase()
}else if(this.topicForm.typeId == 5){
if(!this.fillList.length || this.fillList.every(n => n === '')) return this.$message.warning('请至少添加一个正确答案!')
if(!this.fillList.length || this.fillList.every(n => n === '')) return util.warningMsg('请至少添加一个正确答案!')
this.options.split('').map((n,i) => {
this.topicForm[`option${this.options[i]}`] = ''
})
@ -309,24 +310,24 @@ export default {
this.topicForm[`option${this.options[i]}`] = n
})
}
if(this.uploading) return this.$message.warning('视频正在上传,请稍等')
if(this.uploading) return util.warningMsg('视频正在上传,请稍等')
this.topicForm.userId = this.userId
if(this.topicForm.id) {
this.$post(this.api.updateQuestions,this.topicForm).then(res => {
if(res.success) {
this.$message.success('修改成功')
util.successMsg('修改成功')
this.$emit('getData')
}else{
this.$message.error(res.data.message)
util.errorMsg(res.data.message)
}
}).catch(res => {})
}else{
this.$post(this.api.addQuestions,this.topicForm).then(res => {
if(res.success) {
this.$message.success('新增成功')
util.successMsg('新增成功')
this.$emit('getData')
}else{
this.$message.error(res.data.message)
util.errorMsg(res.data.message)
}
}).catch(res => {})
}
@ -379,14 +380,14 @@ export default {
}).catch(res => {})
},
addFill(){
if(this.fillList.some(n => n === '')) return this.$message.warning('请先填写当前答案')
this.fillList.length < 5 ? this.fillList.push('') : this.$message.warning('最多添加5个')
if(this.fillList.some(n => n === '')) return util.warningMsg('请先填写当前答案')
this.fillList.length < 5 ? this.fillList.push('') : util.warningMsg('最多添加5个')
},
delFill(index){
this.fillList.splice(index,1)
},
handleExceed(files, fileList) {
this.$message.warning(
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
@ -428,43 +429,49 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.no-mb.el-form-item{
margin-bottom: 0;
}
/deep/.el-radio{
margin-right: 15px;
}
.second{
padding-left: 46px !important;
}
::v-deep .el-checkbox-group{
font-size: 2px;
}
.input ::v-deep .el-input {
width: 50%;
}
.radio {
margin: 0 15px 0 30px;
font-weight: 600;
}
.input-wrap{
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input{
display: inline-block;
width: 250px;
}
i{
margin-left: 5px;
font-size: 22px;
cursor: pointer;
}
}
.topic-form{
/deep/.topic-form{
height: 500px;
padding-right: 20px;
overflow: auto;
.no-mb.el-form-item{
margin-bottom: 0;
}
.option{
display: flex;
align-items: center;
margin-bottom: 15px;
.el-input {
width: 320px;
margin: 0 24px 0 8px;
}
}
.input-wrap{
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input{
display: inline-block;
width: 250px;
}
i{
margin-left: 5px;
font-size: 22px;
cursor: pointer;
}
}
.el-radio{
margin-right: 15px;
}
.radio {
margin: 0 15px 0 30px;
font-weight: 600;
}
.el-checkbox-group{
font-size: 2px;
}
.second{
padding-left: 46px !important;
}
}
</style>

@ -1,235 +1,152 @@
<template>
<div
style="width:100%;height:100%;display:flex;align-items: center;flex-direction:column">
<div class="header">
<img :src="avatar" class="HeadPortrait" />
<div style="color:#cb221c;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload :action="this.api.fileupload" :on-success="changeAvatar">
<div>点击更改头像</div>
</el-upload>
<div>
<div class="page">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
</div>
<div class="card">
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;">
用户信息
<el-button type="success" size="small" v-throttle @click="save">更新资料</el-button>
</p>
<p class="meta-title">个人信息</p>
<div class="information">
<div class="block">
<p class="block-left">姓名</p>
<div class="block-right">
<input
id="username"
type="text"
v-model="personalInformation.userName"
/>
<div class="ii">
<label for="username">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div>
</div>
</div>
<div class="block">
<p class="block-left">性别</p>
<el-select
v-model="personalInformation.sex"
placeholder
>
<el-option
v-for="item in sexList"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</div>
<div class="block">
<p class="block-left">所在国家</p>
<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 class="block">
<p class="block-left">所在省份</p>
<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>
</div>
<div class="block">
<p class="block-left">所在省市</p>
<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 class="page-content">
<div v-if="active == 'first'">
<el-form>
<ul class="list">
<li>
<label>头像</label>
<div class="avatar-wrap">
<img :src="avatar" class="avatar" />
<el-upload :action="this.api.fileupload" :data="{userId:this.userId}" name="file" :limit="1" :on-success="changeAvatar">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传头像</el-button>
</el-upload>
</div>
</li>
<li>
<label>姓名</label>
<div>
<el-input v-model="personalInformation.userName" clearable></el-input>
</div>
</li>
<li>
<label>性别</label>
<div>
<el-select v-model="personalInformation.sex">
<el-option v-for="item in sexList" :key="item.value" :label="item.name" :value="item.value"></el-option>
</el-select>
</div>
</li>
<li>
<label>所在国家</label>
<div>
<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>
</li>
<li>
<label>所在省份</label>
<div>
<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>
</div>
</li>
<li>
<label>所在省市</label>
<div>
<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>
</li>
<li>
<label>出生年月日</label>
<div>
<el-date-picker
v-model="personalInformation.dateBirth"
:clearable="false"
class="block-right"
type="date">
</el-date-picker>
</div>
</li>
<li>
<label>证件</label>
<div>
<el-input v-model="personalInformation.idnumber" clearable></el-input>
</div>
</li>
<li>
<label>教育程度</label>
<div>
<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>
</li>
</ul>
</el-form>
</div>
<div class="block">
<p class="block-left">出生年月日</p>
<el-date-picker
v-model="personalInformation.dateBirth"
:clearable="false"
class="block-right"
type="date">
</el-date-picker>
<div v-else>
<ul class="list">
<li>
<label>用户账号</label>
<div>
<el-input v-model="personalInformation.account" clearable></el-input>
</div>
</li>
<li>
<label>手机号</label>
<div>
<el-input v-model="personalInformation.phone" clearable></el-input>
</div>
</li>
<li>
<label>邮箱</label>
<div>
<el-input v-model="personalInformation.email" clearable></el-input>
</div>
</li>
<li>
<label>密码</label>
<div>
<el-button size="small" @click="bindPassword">更换密码</el-button>
</div>
</li>
</ul>
</div>
<div class="block">
<p class="block-left">证件</p>
<div class="block-right">
<input
id="idnumber"
type="text"
v-model="personalInformation.idnumber"
/>
<div class="ii">
<label for="idnumber">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div>
</div>
</div>
<div class="block">
<p class="block-left">教育程度</p>
<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="block">
<p class="block-left">当前所在学校</p>
<el-select v-model="personalInformation.clientId" filterable placeholder="请选择学校">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.clientName" :value="item.id"></el-option>
</el-select>
</div> -->
</div>
</div>
<div class="card m-b-20">
<p class="block-title">账号信息</p>
<div class="information">
<div class="block">
<p class="block-left">用户账号</p>
<div class="block-right">
<input
id="account"
type="text"
v-model="personalInformation.account"
@change="accountChange"
/>
<div class="ii">
<label for="account">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div>
</div>
</div>
<div class="block">
<p class="block-left">手机号</p>
<div class="block-right">
<input
id="phone"
type="text"
maxlength="11"
v-model="personalInformation.phone"
/>
<div class="ii">
<label for="phone">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div>
</div>
<!-- <div class="near-right">
{{personalInformation.phone}}
<el-button size="small" @click="bindPhone">更换</el-button>
</div> -->
</div>
<div class="block">
<p class="block-left">邮箱</p>
<div class="block-right">
<input
id="email"
type="text"
v-model="personalInformation.email"
/>
<div class="ii">
<label for="email">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div>
</div>
<!-- <div class="near-right"> -->
<!-- {{personalInformation.email}} -->
<!-- <el-button size="small" @click="bindEmail">绑定</el-button> -->
<!-- </div> -->
</div>
<!-- <div class="block">
<p class="block-left">微信</p> -->
<!-- <input
id="wechat"
type="text"
class="block-right"
v-model="personalInformation.weChatID"
/>
<div class="ii">
<label for="wechat">
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i>
</label>
</div> -->
<!-- <div class="near-right">
{{personalInformation.weChatID}}
<el-button size="small">绑定</el-button>
</div>
</div> -->
<div class="block">
<p class="block-left">密码</p>
<div class="near-right">
<el-button size="small" @click="bindPassword">更换密码</el-button>
</div>
<div style="margin-top: 32px">
<el-button type="primary" size="small" v-throttle @click="save">更新</el-button>
</div>
</div>
</div>
@ -260,10 +177,18 @@
</template>
<script>
import { mapState,mapActions } from 'vuex';
import { mapState,mapActions } from 'vuex'
import _ from 'lodash';
import bus from '@/libs/bus'
import util from '@/libs/util'
export default {
data() {
return {
active: 'first',
tabs: {
first: '用户信息',
second: '账号信息'
},
personalInformation: {
name:'',
workNumber:'',
@ -297,9 +222,8 @@ export default {
}
],
form: {},
provinceList: [], //
cityList: [], //
//
provinceList:[],
cityList: [],
educationDegreeList: [
{
name: '专科',
@ -329,8 +253,8 @@ export default {
},
computed: {
...mapState('user', [
'userId','avatar'
])
'userId','avatar','userName'
]),
},
mounted() {
this.getdata();
@ -341,6 +265,9 @@ export default {
...mapActions('user', [
'setAvatar','setUserName'
]),
tabChange(index){
this.active = index
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.data.list
@ -372,21 +299,24 @@ export default {
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
this.$message.warning('该账号已存在')
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
}).catch(res => {});
},
//
changeAvatar(res) {
this.setAvatar(res.data.filesResult.fileUrl)
},
uploadHeadImg: function() {
this.$el.querySelector('.hiddenInput').click();
},
getdata() {
this.$get(`${this.api.userinfo}?userId=${this.userId}`)
.then(res => {
this.personalInformation = res.data.userInfo
this.personalInformation.countries = '中国'
this.personalInformation.clientName = this.schoolList.find(n => n.id == this.personalInformation.clientId).clientName
this.curPassword = this.personalInformation.password
this.$nextTick(() => {
if(this.personalInformation.provinceId){
@ -402,12 +332,12 @@ export default {
this.passwordVisible = true
},
editPassword() {
if(!this.passwordForm.password) return this.$message.warning('请输入原密码')
if(!this.passwordForm.newPassword) return this.$message.warning('请输入新密码')
if(!this.passwordForm.reNewPassword) return this.$message.warning('请确认新密码')
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return this.$message.warning('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return this.$message.warning('输入的新密码不一致,请重新确认')
if(this.curPassword === this.passwordForm.newPassword) return this.$message.warning('原密码跟新密码不能一致')
if(!this.passwordForm.password) return util.warningMsg('请输入原密码')
if(!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if(!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return util.warningMsg('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return util.warningMsg('输入的新密码不一致,请重新确认')
if(this.curPassword === this.passwordForm.newPassword) return util.warningMsg('原密码跟新密码不能一致')
let data = {
userId: this.personalInformation.userId,
@ -416,11 +346,11 @@ export default {
this.$post(this.api.userinfoUpdate,data)
.then(res => {
if(res.success){
this.$message.success('更换成功')
util.successMsg('更换成功')
this.curPassword = this.passwordForm.newPassword
this.passwordVisible = false
}else{
this.$message.error('更换失败')
util.errorMsg('更换失败')
}
})
.catch(err => {
@ -435,10 +365,10 @@ export default {
}
},
save() {
if(this.personalInformation.idnumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idnumber)) return this.$message.warning('请输入正确的证件号码')
if(this.accountRepeat) return this.$message.warning('该账号已存在')
if(this.personalInformation.phone && !/^1[3456789]\d{9}$/.test(this.personalInformation.phone)) return this.$message.warning('请输入正确的手机号')
if(this.personalInformation.email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.personalInformation.email)) return this.$message.warning('请输入正确的邮箱')
if(this.personalInformation.idnumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idnumber)) return util.warningMsg('请输入正确的证件号码')
if(this.accountRepeat) return util.warningMsg('该账号已存在')
if(this.personalInformation.phone && !/^1[3456789]\d{9}$/.test(this.personalInformation.phone)) return util.warningMsg('请输入正确的手机号')
if(this.personalInformation.email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.personalInformation.email)) return util.warningMsg('请输入正确的邮箱')
let personalInformation = this.personalInformation
let userInfoEntity = {
idnumber: personalInformation.idnumber,
@ -460,278 +390,47 @@ export default {
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
this.setUserName(personalInformation.userName)
this.$message.success('提交成功')
util.successMsg('提交成功')
this.$router.back()
}else{
this.$message.error('提交失败')
util.errorMsg('提交失败')
}
}).catch(res => {});
}).catch(res => {})
}
}
};
</script>
<style lang="scss" scoped>
.header{
text-align: center;
}
.header /deep/.el-upload-list__item-name {
display: none;
}
.header /deep/.el-icon-upload-success{
display: none;
}
.header /deep/.el-upload-list__item-status-label{
display: none;
}
.header /deep/ .el-upload-list{
display: none;
}
/deep/.el-input__inner{
height: 32px !important;
}
/deep/.el-select .el-input .el-select__caret{
line-height: 32px;
}
input:focus {
outline: 0;
}
.header {
background: #f0f0f0;
}
.openfile {
cursor: pointer;
}
.HeadPortrait {
margin-top: 10px;
width: 80px;
height: 80px;
border-radius: 50%;
.head {
width: 34px;
height: 34px;
background: rgba(255, 255, 255, 1);
border-radius: 50%;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
position: relative;
.eee {
height: 10px;
width: 16px;
background-color: rgba(255, 255, 255, 1);
margin-bottom: -10px;
position: absolute;
top: 8px;
z-index: 2;
}
.Semicircle {
width: 12px;
height: 12px;
border: 2px solid #cb221c;
border-radius: 50px;
margin-bottom: 10px;
position: absolute;
}
}
.body {
color: #cb221c;
width: 30px;
height: 20px;
border: 3px solid #f5f5f5;
border-radius: 100%;
margin-top: 5px;
margin-bottom: -10px;
}
.body::after {
content: '';
width: 40px;
height: 30px;
display: inline-block;
background-color: #cb221c;
margin-top: 8px;
margin-left: -6px;
}
}
input {
height: 50px;
width: 300px;
border: 0;
text-align: right;
outline: none;
}
.card {
margin-top: 10px;
width: 750px;
padding: 20px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 21px 0px rgba(48, 115, 248, 0.1);
border-radius: 10px;
position: relative;
.block-title{
font-weight: bold;
font-size: 20px;
}
.meta-title{
margin: 10px 0 0;
color: #cdbcec;
font-size: 15px;
}
.el-icon-document {
color: #cb221c;
font-size: 30px;
}
.el-icon-collection {
color: #cb221c;
position: absolute;
left: 31px;
top: 31px;
font-size: 30px;
}
span {
color: #333333;
font-size: 20px;
}
.plus{
display: flex;
justify-content: space-between;
i{
font-size: 22px;
color: #21d749;
cursor: pointer;
}
}
.archives{
padding: 10px 20px;
margin-top: 20px;
border: 1px dashed #bbb;
border-radius: 12px;
&.default-arch{
margin-bottom: 20px;
/deep/.el-select{
width: 10rem;
}
/deep/input{
background-color: transparent;
}
}
}
.archives-wrap{
.block{
display: flex;
align-items: center;
margin-bottom: 8px;
&:last-child{
margin-bottom: 0;
}
.block-left{
width: 30%;
font-family: MicrosoftYaHei;
font-size: 14px;
color: #101010;
}
/deep/.el-input__inner{
border-radius: 8px !important;
}
}
}
.information {
.block {
line-height: 38px;
position: relative;
display: flex;
justify-content: space-between;
align-items: center;
.block-left {
font-family: MicrosoftYaHei;
font-size: 14px;
color: #101010;
}
input{
font-size: 16px;
}
/deep/.el-date-editor .el-input__prefix{
line-height: 32px;
}
/deep/.el-input__prefix,/deep/.el-input__suffix{
left: auto;
right: 0;
}
.block-right,.near-right {
display: inline-flex;
align-items: center;
margin: 0;
padding: 0;
color: #333333ff;
font-size: 18px;
}
.near-right{
right: 0;
font-size: 18px;
}
.ii {
display: flex;
justify-content: center;
align-items: center;
width: 22px;
height: 22px;
margin-left: 10px;
border-radius: 50%;
background-color: #cb221c;
i{
font-size: 12px;
}
}
/deep/.el-input__inner {
padding-right: 1.8rem;
margin-right: 5px;
color: #333333ff;
font-size: 16px;
text-align: right;
border: 0px;
}
/deep/.el-input__icon {
background: #cb221c;
width: 22px;
height: 22px;
line-height: 22px;
color: rgba(255, 255, 255, 1);
border-radius: 50%;
&.el-icon-date{
font-size: 14px;
/deep/.page{
.page-content{
padding-top: 0;
.list{
li{
display: flex;
align-items: center;
padding: 16px 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
label{
width: 180px;
color: rgba(0, 0, 0, 0.85);
font-size: 16px;
}
.avatar-wrap{
display: inline-flex;
align-items: center;
.avatar{
width: 64px;
height: 64px;
margin-right: 24px;
border-radius: 100%;
}
}
.el-input{
width: 320px;
}
}
}
/deep/.el-icon-arrow-up:before {
content: '\e6e1';
margin-top: 5px;
}
&.readonly .block-left{
color: #a5a7adff;
}
}
}
.fold{
margin-top: 20px;
text-align: center;
i{
font-size: 22px;
color: #8e8e8e;
cursor: pointer;
&:hover{
opacity: .8;
}
}
}
}
</style>

@ -1,37 +1,43 @@
<template>
<div>
<div class="tabs m-b-20" v-if="showTabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="score-table" v-if="activeName == 'staff'" v-auth="'系统设置:员工管理'">
<staff></staff>
</div>
<div class="score-table" v-else v-auth="'系统设置:角色权限'">
<role></role>
<breadcrumb :data="'系统分管设置/' + tabs[active]" ref="breadcrumb"></breadcrumb>
<div class="page">
<div class="tabs" v-if="showTabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="page-content">
<staff v-if="active == 'staff'" v-auth="'系统分管设置:员工管理'"></staff>
<role v-else-if="active == 'role'" v-auth="'系统分管设置:角色权限'"></role>
<organization v-else v-auth="'系统分管设置:架构管理'"></organization>
</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
import Setting from '@/setting';
import staff from './staff.vue';
import role from './role.vue';
import Setting from '@/setting'
import staff from './staff.vue'
import role from './role.vue'
import organization from './organization.vue'
import breadcrumb from '@/components/breadcrumb'
export default {
data() {
return {
activeName: 'staff',
active: 'staff',
tabs: {
staff: '员工管理',
role: '角色权限'
role: '角色权限',
organization: '架构管理'
},
showTabs: true
};
},
components: {
staff,
role
role,
organization,
breadcrumb
},
computed: {
...mapState('auth', [
@ -43,16 +49,22 @@ export default {
},
methods: {
tabChange(index){
this.activeName = index
this.active = index
this.$refs.breadcrumb.update('系统设置/' + this.tabs[this.active])
},
initTabs(){
let showStaff = this.btns.includes('系统设置:员工管理')
let showRole = this.btns.includes('系统设置:角色权限')
let tab1 = this.btns.includes('系统分管设置:员工管理')
let tab2 = this.btns.includes('系统分管设置:角色权限')
let tab3 = this.btns.includes('系统分管设置:架构管理')
if(!showStaff || !showRole){
this.showTabs = false
if(!tab1 && tab2){
this.active = 'role'
}else if(!tab1 && !tab2 && tab3){
this.active = 'organization'
}
!showStaff && showRole && (this.activeName = 'role')
if(!tab1) delete this.tabs.staff
if(!tab2) delete this.tabs.role
if(!tab3) delete this.tabs.organization
}
}
};

@ -0,0 +1,277 @@
<template>
<div>
<div class="tool">
<ul class="filter"></ul>
<div>
<el-button type="primary" size="small" round @click="addMajor" v-auth="'/system/list:架构管理:新增架构'">新增架构</el-button>
</div>
</div>
<el-table :data="listData" stripe header-align="center" row-key="id" :tree-props="treeProps" :indent="9">
<el-table-column prop="label" label="架构名称">
<template slot-scope="scope">
<span class="text">{{scope.row.label}}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth="'/system/list:架构管理:编辑'">编辑</el-button>
<el-button v-if="scope.row.isParent" type="text" @click="addDepartment(scope.row)" v-auth="'/system/list:架构管理:添加'">添加</el-button>
<el-button type="text" @click="del(scope.row)" v-auth="'/system/list:架构管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="Form.MajorId ? '编辑名称' : '新增架构'" :visible.sync="isaddMajor" width="460px" @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form">
<el-form-item prop="majorName">
<el-input :placeholder="Form.MajorId ? '请编辑架构名称' : '请输入架构名称'" v-model="Form.majorName" @change="majorChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isaddMajor = false"> </el-button>
<el-button size="small" type="primary" @click="sure('Form')"> </el-button>
</span>
</el-dialog>
<el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="460px" @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form">
<el-form-item prop="departmentName">
<el-input placeholder="请输入部门名称" v-model="Form.departmentName" @change="depChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isAddDepartment = false"> </el-button>
<el-button size="small" type="primary" @click="sureDepartment('Form')"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
name: 'organization',
data() {
return {
treeProps: {children: 'children', hasChildren: 'hasChildren'},
listData: [],
isaddMajor: false,
isAddDepartment: false,
Form: {
MajorId: '',
majorName: '',
departmentId: '',
departmentName: ''
},
staffstateProfessId: '',
staffstateId: '',
majorNoAdd: true,
depNoAdd: true
};
},
computed: {
...mapState('user', [
'clientId','clientName'
]),
},
mounted() {
this.getData()
},
methods: {
getData(){
let data = {
schoolId: this.clientId
}
this.$get(this.api.queryStaffPro,data).then(res => {
let firList = res.data.StaffProfessionalArchitectureList
if(firList){
firList.map(e => {
e.isParent = true
e.id = e.staffProfessionalArchitectureId
e.label = e.staffProfessionalArchitectureName
let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId
}
this.$get(this.api.queryStaffGrade,data).then(res1 => {
res1.data.staffGradeList.map(e => {
e.id = e.staffGradeId
e.label = e.staffGradeName
})
e.children = res1.data.staffGradeList
}).catch(res => {})
})
setTimeout(() => {
this.listData = firList
},500)
}
}).catch(res => {})
},
addMajor(){
this.Form.MajorId = ''
this.Form.majorName = ''
this.isaddMajor = true
},
edit(item){
if(item.isParent){
this.Form.MajorId = item.staffProfessionalArchitectureId,
this.Form.majorName = item.staffProfessionalArchitectureName
this.isaddMajor = true
}else{
this.Form.departmentId = item.staffGradeId,
this.Form.departmentName = item.staffGradeName
this.isAddDepartment = true
for (let j = 0; j < this.listData.length; j++) {
for (let k = 0; k < this.listData[j].children.length; k++) {
if(this.listData[j].children[k].staffGradeId == item.staffGradeId){
this.Form.MajorId = this.listData[j].staffProfessionalArchitectureId
}
}
}
}
},
async majorChange(){
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.schoolId });
if(res.data.StaffProfessionalArchitecture != null){
util.warningMsg('该一级部门已存在');
this.majorNoAdd = false
}else{
this.majorNoAdd = true
}
},
async depChange(){
let res = await this.$get(this.api.queryStaffName, { staffGradeName: this.Form.departmentName,staffProfessionalArchitectureId: this.Form.MajorId });
if(res.data.staffGrade != null){
util.warningMsg('该二级部门已存在');
this.depNoAdd = false
}else{
this.depNoAdd = true
}
},
sure(){
if(!this.Form.majorName) return util.warningMsg('请输入专业名称')
if(!this.majorNoAdd) return util.warningMsg('该一级部门已存在')
let data = {
staffProfessionalArchitectureName: this.Form.majorName,
staffProfessionalArchitectureId: this.Form.MajorId,
schoolId: this.schoolId,
}
if(this.Form.MajorId){
this.$post(this.api.updateStaffPro,data).then(res => {
util.successMsg('编辑成功')
this.isaddMajor = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.addStaffPro,data).then(res => {
util.successMsg('添加成功')
this.isaddMajor = false
this.getData()
}).catch(res => {})
}
},
//
addDepartment(item){
this.Form.departmentId = ''
this.Form.departmentName = ''
this.isAddDepartment = true
this.Form.MajorId = item.staffProfessionalArchitectureId
},
sureDepartment(Form){
if(!this.Form.departmentName) return util.warningMsg('请输入部门名称');
if(!this.depNoAdd) return util.warningMsg('该二级部门已存在');
let data = {
schoolId: this.schoolId,
staffGradeName: this.Form.departmentName,
staffProfessionalArchitectureId: this.Form.MajorId,
staffGradeId: this.Form.departmentId
}
if(this.Form.departmentId){
this.$post(this.api.updateStaffGrade,data).then(res => {
util.successMsg('编辑成功')
this.isAddDepartment = false
this.getData()
}).catch(res => {})
}else{
this.$post(this.api.addStaffGrade,data).then(res => {
util.successMsg('添加成功')
this.isAddDepartment = false
this.getData()
}).catch(res => {})
}
},
closeAdd(){
this.$refs.Form.resetFields()
},
del(item){
if(item.isParent){
this.$confirm('确定要删除该专业吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteStaffPro}?staffProfessionalArchitectureIds=${item.staffProfessionalArchitectureId}`).then(res => {
this.getData()
util.successMsg('删除成功')
}).catch(res => {})
}).catch(() => {})
}else{
this.$confirm('确定要删除该部门吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteStaffGrade}?staffGradeIds=${item.staffGradeId}`).then(res => {
this.getData()
util.successMsg('删除成功')
}).catch(res => {})
}).catch(() => {})
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/.el-table{
th:first-child{
.cell{
&:before{
content: '';
display: inline-block;
padding-left: 25vw;
}
}
}
.el-table__body-wrapper{
td:first-child{
.cell{
display: flex;
justify-content: flex-end;
align-items: center;
flex-direction: row-reverse;
i{
font-size: 16px;
}
.text{
&:before{
content: '';
display: inline-block;
padding-left: 25vw;
}
}
.el-table__placeholder + .text{
&:before{
padding-left: 26vw;
}
}
.el-table__expand-icon{
transform: rotate(90deg);
&.el-table__expand-icon--expanded{
transform: rotate(-90deg);
}
}
}
}
}
}
</style>

@ -1,54 +1,38 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入角色名称" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input>
</li>
</ul>
<div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
<el-button type="primary" size="small" round @click="addRole" v-auth="'/system/list:角色权限:新增角色'">新增角色</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'/system/list:角色权限:批量删除'">批量删除</el-button>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">角色列表</div>
</div>
<div>
<el-button type="primary" size="small" round @click="addRole" v-auth="'/system/list:角色权限:新增角色'">新增角色</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'/system/list:角色权限:批量删除'">批量删除</el-button>
</div>
</div>
<el-table :data="roleData" class="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="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" width="100">
</el-table-column>
<el-table-column label="角色描述" align="center">
<template slot-scope="scope">
<el-input disabled placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark "></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth="'/system/list:角色权限:查看'">查看</el-button>
<template v-if="scope.row.id != 1">
<el-button type="text" @click="editRole(scope.row)" v-auth="'/system/list:角色权限:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/system/list:角色权限:删除'">删除</el-button>
</template>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
<el-table :data="roleData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色名称" align="center" width="100"></el-table-column>
<el-table-column prop="remark" label="角色描述" align="center"></el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="text" @click="showRole(scope.row)" v-auth="'/system/list:角色权限:查看'">查看</el-button>
<!-- <template v-if="scope.row.id != 1"> -->
<el-button type="text" @click="editRole(scope.row)" v-auth="'/system/list:角色权限:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/system/list:角色权限:删除'">删除</el-button>
<!-- </template> -->
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible"
width="30%" center @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="500px" @close="closeRole" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" label-width="100px" :disabled="isDetail">
<el-form-item label="角色名称">
<el-input v-model="form.roleName " ref="account" placeholder="请输入角色名称"></el-input>
@ -80,6 +64,7 @@
<script>
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
name: 'role',
data() {
@ -201,9 +186,9 @@ export default {
this.roleVisible = true
},
async saveData() {
if(!this.form.roleName) return this.$message.warning('请填写角色名称')
if(!this.form.remark) return this.$message.warning('请填写角色描述')
// if(!this.$refs.per.getCheckedKeys().length) return this.$message.warning('')
if(!this.form.roleName) return util.warningMsg('请填写角色名称')
if(!this.form.remark) return util.warningMsg('请填写角色描述')
// if(!this.$refs.per.getCheckedKeys().length) return util.warningMsg('')
let roleData = {
clientId: this.clientId,
id: this.form.id,
@ -222,7 +207,7 @@ export default {
}
let perRes = await this.$post(this.api.doAssign,perData)
if(perRes.success){
this.$message.success('新增成功')
util.successMsg('新增成功')
this.getData()
this.roleVisible = false
}
@ -235,7 +220,7 @@ export default {
.then(() => {
this.$del(`${this.api.removeRole}?roleIds=${row.id}`).then(res => {
if(res.success){
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}
}).catch(res => {})
@ -255,19 +240,19 @@ export default {
return item.id
})
//
this.$confirm('确定要删除选中角色吗?', '提示', {
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].roleName)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
this.$del(`${this.api.removeRole}?roleIds=${delList.join()}`).then(res => {
if(res.success){
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}
}).catch(res => {})
}).catch(() => {});
}else{
this.$message.error('请先选择数据 !');
util.errorMsg('请先选择数据 !');
}
}
}

@ -1,63 +1,57 @@
<template>
<div>
<el-container>
<el-aside width="350px">
<TeacherSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @getData="getData"></TeacherSide>
</el-aside>
<div class="tool">
<ul class="filter">
<li>
<label>筛选</label>
<el-cascader :options="orgList" :props="props" collapse-tags clearable size="small" @change="orgChange"></el-cascader>
</li>
<li>
<label>搜索</label>
<el-input style="width: 250px" placeholder="请输入员工姓名/工号/角色名称" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="addTeacher" v-auth="'/system/list:员工管理:新增员工'">新增员工</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth="'/system/list:员工管理:批量导入'">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'/system/list:员工管理:批量删除'">批量删除</el-button>
</div>
</div>
<el-main style="padding-top: 0">
<el-col :span="24">
<el-card shadow="hover" class="m-b-20 teacher_tab">
<div class="flex j-between m-b-20">
<div>
<el-input style="width: 250px" placeholder="请输入员工姓名/工号/角色名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input>
</div>
<div>
<el-button type="primary" size="small" round @click="addTeacher" v-auth="'/system/list:员工管理:新增员工'">新增员工</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth="'/system/list:员工管理:批量导入'">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'/system/list:员工管理:批量删除'">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center">
</el-table-column>
<el-table-column prop="userName" label="职工姓名" align="center">
</el-table-column>
<el-table-column prop="account" label="账号" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="职工工号" align="center">
</el-table-column>
<el-table-column prop="staffProfessionalArchitectureName" label="一级部门" align="center">
</el-table-column>
<el-table-column prop="staffGradeName" label="二级部门" align="center">
</el-table-column>
<el-table-column prop="roleName" label="账号角色" align="center">
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'/system/list:员工管理:查看'">查看</el-button>
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'/system/list:员工管理:编辑'">编辑</el-button>
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'/system/list:员工管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="pageNo" @current-change="handleCurrentChange" :total="total">
</el-pagination>
</div>
</el-card>
</el-col>
</el-main>
</el-container>
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center">
</el-table-column>
<el-table-column prop="userName" label="职工姓名" align="center">
</el-table-column>
<el-table-column prop="account" label="账号" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="职工工号" align="center">
</el-table-column>
<el-table-column prop="staffProfessionalArchitectureName" label="一级部门" align="center">
</el-table-column>
<el-table-column prop="staffGradeName" label="二级部门" align="center">
</el-table-column>
<el-table-column prop="roleName" label="账号角色" align="center">
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'/system/list:员工管理:查看'">查看</el-button>
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'/system/list:员工管理:编辑'">编辑</el-button>
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'/system/list:员工管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="pageNo" @current-change="handleCurrentChange" :total="total">
</el-pagination>
</div>
<!-- 新增用户 -->
<el-dialog :title="isDetail ? '查看员工' : (isAddManage ? '新增员工' : '编辑员工')" :visible.sync="manageVisible"
width="30%" :center="!isIE" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-dialog :title="isDetail ? '查看员工' : (isAddManage ? '新增员工' : '编辑员工')" :visible.sync="manageVisible" width="500px" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="manageForm" :model="manageForm" :rules="rules" label-width="100px" :disabled="isDetail">
<el-form-item prop="userAccount" label="账号">
<el-input v-model="manageForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input>
@ -78,7 +72,7 @@
</el-form-item>
<el-form-item prop="major" label="一级部门">
<el-select v-model="manageForm.major" placeholder="请选择一级部门" @change="getDepartment">
<el-option v-for="(item,index) in majorList" :key="index"
<el-option v-for="(item,index) in orgList" :key="index"
:label="item.staffProfessionalArchitectureName" :value="item.staffProfessionalArchitectureId"></el-option>
</el-select>
</el-form-item>
@ -105,46 +99,82 @@
</span>
</el-dialog>
<!-- 批量导入 -->
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div>
<el-upload
accept=".xls,.xlsx"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.uploadFileStaff"
:data="{schoolId: this.clientId}"
:file-list="uploadList"
name="file"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<el-dialog title="查看员工" :visible.sync="staffShowVisible" width="500px" :close-on-click-modal="false">
<ul class="list">
<li>
<span class="name"><i class="required">*</i>账号</span>
<span class="val">{{manageForm.userAccount}}</span>
</li>
<li>
<span class="name"><i class="required">*</i>用户姓名</span>
<span class="val">{{manageForm.userName}}</span>
</li>
<li>
<span class="name">账号角色</span>
<span class="val">{{manageForm.roleValue ? roleList.find(n => n.id == manageForm.roleValue).roleName : ''}}</span>
</li>
<li>
<span class="name">唯一标识</span>
<span class="val">{{manageForm.uniqueIdentificationAccount}}</span>
</li>
<li>
<span class="name"><i class="required">*</i>职工工号</span>
<span class="val">{{manageForm.workNumber}}</span>
</li>
<li>
<span class="name"><i class="required">*</i>一级部门</span>
<span class="val">{{manageForm.major ? orgList.find(n => n.staffProfessionalArchitectureId == manageForm.major).staffProfessionalArchitectureName : ''}}</span>
</li>
<li>
<span class="name"><i class="required">*</i>二级部门</span>
<span class="val">{{manageForm.managerDepartment ? managerDepartmentList.find(n => n.staffGradeId == manageForm.managerDepartment).staffGradeName : ''}}</span>
</li>
<li>
<span class="name">手机号</span>
<span class="val">{{manageForm.phone}}</span>
</li>
<li>
<span class="name">邮箱</span>
<span class="val">{{manageForm.email}}</span>
</li>
<li>
<span class="name">默认密码</span>
<span class="val">{{password}}</span>
</li>
</ul>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFileStaff" :file-list="uploadList" :data="{schoolId: this.clientId}" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
<div class="link" v-if="uploadFaild">
<el-link type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
<el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from '@/setting';
import TeacherSide from './staffside.vue';
import { mapState } from 'vuex';
import Setting from '@/setting'
import { mapState } from 'vuex'
import util from '@/libs/util'
export default {
data() {
return {
pages: 10,
isDetail: false,
props: { multiple: true },
orgList: [],
isAddManage: false,
manageVisible: false,
staffShowVisible: false,
roleList: [],
manageForm: {
clientId: this.clientId,
@ -240,7 +270,6 @@ export default {
schoolList: [],
uploadFaild: false,
token: '',
majorList: [],
accountRepeat: false,
workNumberRepeat: false,
originalAccount: '',
@ -256,9 +285,6 @@ export default {
'isIE'
])
},
components: {
TeacherSide
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
@ -268,41 +294,40 @@ export default {
}
},
mounted(){
this.getOrg()
this.manageForm.clientId = this.clientId
this.manageForm.clientName = this.clientName
this.getData()
this.getRoles()
},
methods: {
handleCheck(data){
let oneDepartmentIds = []
let twoDepartmentIds = []
data.forEach( e => {
if(e.ischeck){
oneDepartmentIds.push(e.staffProfessionalArchitectureId)
}else{
util.removeByValue(oneDepartmentIds, e.staffProfessionalArchitectureId);
getOrg(){
let data = {
schoolId: this.clientId
}
this.$get(this.api.queryStaffPro,data).then(res => {
let firList = res.data.StaffProfessionalArchitectureList
if(firList){
firList.map(e => {
e.isParent = true
e.value = e.staffProfessionalArchitectureId
e.label = e.staffProfessionalArchitectureName
let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId
}
this.$get(this.api.queryStaffGrade,data).then(res1 => {
res1.data.staffGradeList.map(e => {
e.value = e.staffGradeId
e.label = e.staffGradeName
})
e.children = res1.data.staffGradeList
}).catch(res => {})
})
setTimeout(() => {
this.orgList = firList
},500)
}
e.children.forEach( r => {
if(r.ischeck){
twoDepartmentIds.push(r.staffGradeId)
}else{
util.removeByValue(twoDepartmentIds, r.staffGradeId);
}
})
})
this.oneDepartmentIds = oneDepartmentIds.toString()
this.twoDepartmentIds = twoDepartmentIds.toString()
this.getData()
},
fircheck(val,val2){
val.ischeck = !val.ischeck
val.children.map( e => e.ischeck = val.ischeck)
this.handleCheck(val2)
},
twocheck(val,val2){
this.handleCheck(val2)
}).catch(res => {})
},
getData(){
let data = {
@ -326,6 +351,10 @@ export default {
this.pageNo = 1
this.getData()
},
orgChange(node){
this.twoDepartmentIds = node.map(n => n[1]).toString()
this.getData()
},
getRoles() {
let data = {
clientId: this.clientId
@ -358,7 +387,6 @@ export default {
this.manageVisible = true
this.isAddManage = true
this.manageForm.manageId = ''
this.majorList = this.$refs.getSelectData.majorList
},
getStaffDetail(userId){
this.$get(`${this.api.getStaff}/${userId}`).then(res => {
@ -389,19 +417,18 @@ export default {
this.isAddManage = false
this.AccountNoAdd = false
this.manageForm.manageId = row.staffId
this.majorList = this.$refs.getSelectData.majorList
this.getStaffDetail(row.staffId)
},
showTeacher(row){
this.staffShowVisible = true
this.isDetail = true
this.manageVisible = true
this.isAddManage = false
this.AccountNoAdd = false
this.manageForm.manageId = row.staffId
this.majorList = this.$refs.getSelectData.majorList
this.getStaffDetail(row.staffId)
},
getDepartment(){
getDepartment(changed){
// if(changed) this.manageForm.managerDepartment = ''
let data = {
staffProfessionalArchitectureId: this.manageForm.major
}
@ -414,7 +441,7 @@ export default {
this.$get(`${this.api.getAccount}?account=${this.manageForm.userAccount}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
this.$message.warning('该账号已存在')
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
@ -428,7 +455,7 @@ export default {
this.$get(`${this.api.getWorkNumber}?workNumber=${this.manageForm.workNumber}`).then(res => {
if(res.data.staff){
this.workNumberRepeat = true
this.$message.warning('该工号已存在')
util.warningMsg('该工号已存在')
}else{
this.workNumberRepeat = false
}
@ -440,8 +467,8 @@ export default {
async saveSure(manageForm){
this.$refs[manageForm].validate((valid) => {
if (valid) {
if(this.accountRepeat) return this.$message.warning('该账号已存在')
if(this.workNumberRepeat) return this.$message.warning('该工号已存在')
if(this.accountRepeat) return util.warningMsg('该账号已存在')
if(this.workNumberRepeat) return util.warningMsg('该工号已存在')
let data = {
userInfo: {
userId: this.manageForm.userId,
@ -458,9 +485,9 @@ export default {
}
}
let oneDepartmentName = '';
for(let i in this.majorList){
if(this.majorList[i].staffProfessionalArchitectureId == this.manageForm.major) {
oneDepartmentName = this.majorList[i].staffProfessionalArchitectureName
for(let i in this.orgList){
if(this.orgList[i].staffProfessionalArchitectureId == this.manageForm.major) {
oneDepartmentName = this.orgList[i].staffProfessionalArchitectureName
break;
}
}
@ -484,23 +511,23 @@ export default {
if(this.manageForm.manageId){
this.$post(this.api.updateStaff,data).then(res => {
this.manageVisible = false
this.$message.success('编辑成功');
util.successMsg('编辑成功');
this.getData()
}).catch(res => {});
}).catch(res => {})
}else{
this.$post(this.api.addStaff,data).then(res => {
this.manageVisible = false
this.$message.success('添加成功');
util.successMsg('添加成功');
this.getData()
}).catch(res => {});
}).catch(res => {})
}
}else{
return false;
return false
}
})
},
delTeacher(row){
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
@ -508,7 +535,7 @@ export default {
staffIds: row.staffId
}
this.$del(this.api.deleteStaffs,data).then(res => {
this.$message.success('删除成功')
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
})
@ -524,7 +551,7 @@ export default {
return item.staffId
})
//
this.$confirm('确定要删除吗?', '提示', {
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].userName)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
@ -533,12 +560,12 @@ export default {
}
this.$del(this.api.deleteStaffs,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功')
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择数据 !')
util.errorMsg('请先选择数据 !')
}
},
batchImport(){
@ -562,7 +589,7 @@ export default {
},
//
handleExceed(files, fileList) {
this.$message.warning(
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
@ -573,10 +600,10 @@ export default {
this.token = res.data.data.token
this.uploadFaild = true
}else{
this.$message.success('上传成功')
util.successMsg('上传成功')
}
}else{
res.data.message ? this.$message.error(res.data.message) : this.$message.error('上传失败,请检查数据')
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
}
},
uploadError(err, file, fileList) {
@ -603,7 +630,38 @@ export default {
};
</script>
<style lang="scss" scoped>
.el-container{
background-color: #f0f0f0;
/deep/.dialog{
.el-form-item{
.el-form-item__label{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
&:before{
margin-right: 0;
color: #CC221C;
}
}
}
.el-input,.el-select{
width: 100%;
}
}
.list{
li{
display: flex;
justify-content: center;
align-items: center;
margin: 32px 0;
.name,.val{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
}
.name{
width: 45%;
text-align: right;
}
.val{
width: 55%;
}
}
}
</style>

@ -1,301 +0,0 @@
<template>
<div>
<div class="side_view second">
<p class="side_icon mab20">
<i class="icon-jiahao mar20" @click="addMajor"></i>
<!-- <i class="icon-delete"></i> -->
</p>
<div class="side_tree" @click.stop="open(item)" v-for="(item,index) in majorList" :key="index">
<div class="item" @click.stop="open(item)">
<!-- <i :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" class="icon-shixiangyoujiantou-"></i> -->
<img
v-if="item.children&&item.children.length!=0"
:class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}"
src="../../../assets/img/icon-xiangyou.png"
alt
/>
<i v-else class="empty"></i>
<i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i>
<span @click.stop="fircheckitem(item)">{{item.staffProfessionalArchitectureName}}</span>
<i class="edit ft" @click.stop="editMajor(item)"></i>
<i class="el-icon-circle-plus ft" @click.stop="addDepartment(item)"></i>
<i class="icon-delete ft" @click.stop="delMajor(item,index)"></i>
</div>
<div v-show="item.ifVisible" v-if="item.children&&item.children.length!=0">
<div v-for="(item1,index1) in item.children" :key="index1">
<div class="item2" @click.stop="open(item1)">
<i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i>
<span @click.stop="twocheckitem(item1)">{{item1.label}}</span>
<i class="edit ft" @click.stop="editDepartment(item1)"></i>
<i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i>
</div>
</div>
</div>
</div>
</div>
<!-- 添加专业 -->
<el-dialog :title="Form.MajorId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form">
<el-form-item prop="majorName">
<el-input placeholder="请输入专业名称" v-model="Form.majorName" @change="majorChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="isaddMajor = false"> </el-button>
<el-button type="primary" @click="sure('Form')"> </el-button>
</span>
</el-dialog>
<!-- 添加部门 -->
<el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form">
<el-form-item prop="departmentName">
<el-input placeholder="请输入部门名称" v-model="Form.departmentName" @change="depChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="isAddDepartment = false"> </el-button>
<el-button type="primary" @click="sureDepartment('Form')"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex';
export default {
props:["Data"],
data() {
return {
majorList: [],
firactive: 0,
twoactive: 0,
isaddMajor: false,
isAddDepartment: false,
Form: {
MajorId: '',
majorName: '',
departmentId: '',
departmentName: ''
},
staffstateProfessId: '',
staffstateId: '',
majorNoAdd: true,
depNoAdd: true
};
},
computed: {
...mapState('user', [
'clientId','clientName'
])
},
mounted(){
this.getStaff()
},
methods: {
getStaff(majorIds){
let data = {
schoolId: this.clientId
}
this.$get(this.api.queryStaffPro,data).then(res => {
let firList = res.data.StaffProfessionalArchitectureList
if(firList){
firList.map(e => {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName);
majorIds && majorIds.includes(e.staffProfessionalArchitectureId) && (e.ifVisible = true)
let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId
}
this.$get(this.api.queryStaffGrade,data).then(res1 => {
res1.data.staffGradeList.map(e => {
(e.ischeck = false), (e.label = e.staffGradeName);
})
e.children = res1.data.staffGradeList
}).catch(res1 => {});
})
}
setTimeout(() => {
this.majorList = firList
majorIds || (this.majorList[0].ifVisible = true)
}, 500);
}).catch(res => {});
},
//
open(item) {
item.ifVisible = !item.ifVisible;
},
//removeByvaluemain.js
choose(item) {
item.ifVisible = !item.ifVisible;
if (item.ifVisible) {
this.chooseList.push(item);
} else {
this.chooseList.removeByValue(item);
}
},
//
fircheckitem(item){
this.$emit("fircheck",item,this.majorList)
},
//
twocheckitem(item){
item.ischeck = !item.ischeck
this.majorList.forEach( e => {
e.children.forEach( r => {
if(r.staffGradeId == item.staffGradeId){
if(e.children.every(i => i.ischeck)){
e.ischeck = true
}else{
e.ischeck = false
}
}
})
})
this.$emit("twocheck",item,this.majorList)
},
closeAdd(){
this.$refs.Form.resetFields()
},
//
addMajor(){
this.Form.MajorId = ''
this.Form.majorName = ''
this.isaddMajor = true
},
editMajor(item){
this.Form.MajorId = item.staffProfessionalArchitectureId,
this.Form.majorName = item.staffProfessionalArchitectureName
this.isaddMajor = true
},
async majorChange(){
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.clientId });
if(res.data.StaffProfessionalArchitecture != null){
this.$message.warning('该一级部门已存在');
this.majorNoAdd = false
}else{
this.majorNoAdd = true
}
},
async depChange(){
let res = await this.$get(this.api.queryStaffName, { staffGradeName: this.Form.departmentName,staffProfessionalArchitectureId: this.Form.MajorId });
if(res.data.staffGrade != null){
this.$message.warning('该二级部门已存在');
this.depNoAdd = false
}else{
this.depNoAdd = true
}
},
sure(Form){
if(!this.Form.majorName) return this.$message.warning('请输入专业名称');
if(!this.majorNoAdd) return this.$message.warning('该一级部门已存在');
let data = {
staffProfessionalArchitectureName: this.Form.majorName,
staffProfessionalArchitectureId: this.Form.MajorId,
schoolId: this.clientId,
}
if(this.Form.MajorId){
this.$post(this.api.updateStaffPro,data).then(res => {
this.$message.success('编辑成功');
this.isaddMajor = false
this.getStaff()
this.$emit('getData')
}).catch(res => {});
}else{
this.$post(this.api.addStaffPro,data).then(res => {
this.$message.success('添加成功');
this.isaddMajor = false
this.getStaff()
}).catch(res => {});
}
},
//
addDepartment(item){
this.Form.departmentId = ''
this.Form.departmentName = ''
this.isAddDepartment = true
this.Form.MajorId = item.staffProfessionalArchitectureId
},
editDepartment(item){
this.Form.departmentId = item.staffGradeId,
this.Form.departmentName = item.staffGradeName
this.isAddDepartment = true
for (let j = 0; j < this.majorList.length; j++) {
for (let k = 0; k < this.majorList[j].children.length; k++) {
if(this.majorList[j].children[k].staffGradeId == item.staffGradeId){
this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId
}
}
}
},
sureDepartment(Form){
if(!this.Form.departmentName) return this.$message.warning('请输入部门名称');
if(!this.depNoAdd) return this.$message.warning('该二级部门已存在');
let data = {
schoolId: this.clientId,
staffGradeName: this.Form.departmentName,
staffProfessionalArchitectureId: this.Form.MajorId,
staffGradeId: this.Form.departmentId
}
if(this.Form.departmentId){
this.$post(this.api.updateStaffGrade,data).then(res => {
this.$message.success('编辑成功');
this.isAddDepartment = false
this.majorList.map(e =>{
e.children.map(r =>{
if(r.staffGradeId == this.Form.departmentId){
r.staffGradeName = this.Form.departmentName
r.label = this.Form.departmentName
}
})
})
}).catch(res => {});
}else{
let showMajorIds = this.majorList.map(e => {if(e.ifVisible) return e.staffProfessionalArchitectureId}).filter(n => n)
this.$post(this.api.addStaffGrade,data).then(res => {
this.$message.success('添加成功');
this.isAddDepartment = false
this.getStaff(showMajorIds)
}).catch(res => {});
}
},
delMajor(item,index){
this.$confirm('确定要删除该专业吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteStaffPro}?staffProfessionalArchitectureIds=${item.staffProfessionalArchitectureId}`).then(res => {
this.$message.success('删除成功');
this.majorList.splice(index, 1)
}).catch(res => {});
})
.catch(() => {});
},
delDepartment(item,indx){
this.$confirm('确定要删除该部门吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteStaffGrade}?staffGradeIds=${item.staffGradeId}`).then(res => {
this.$message.success('删除成功');
this.majorList.map(e =>{
e.children.map(r =>{
if(r.staffGradeId == item.staffGradeId){
e.children.splice(indx,1)
if(e.children.length == 0){
e.ifVisible = false
}
}
})
})
}).catch(res => {});
})
.catch(() => {});
}
}
};
</script>
<style lang="scss" scoped>
@import '../../../styles/pages/tree.scss';
</style>

@ -1,66 +1,63 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div>
<div class="p-title m-b-20">筛选</div>
<div class="flex">
<breadcrumb :data="'院校用户管理/用户列表'"></breadcrumb>
<div class="page">
<div class="p-title">客户列表</div>
<div class="page-content">
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input>
</li>
</ul>
<div>
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-button type="primary" size="small" round @click="adduser" v-auth>新增用户</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex j-between m-b-20">
<div class="p-title">用户列表</div>
<div>
<el-button type="primary" size="small" round @click="adduser" v-auth>新增用户</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button>
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="clientName" label="所属院校" align="center">
</el-table-column>
<el-table-column prop="name" label="管理员姓名" align="center">
</el-table-column>
<el-table-column prop="account" label="账号" align="center">
</el-table-column>
<el-table-column prop="role" label="账号角色" align="center">
<template slot-scope="scope">
{{getRoleName(scope.row.roleId)}}
</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
<template slot-scope="scope">
{{scope.row.lastLoginTime == '0000-00-00 00:00:00' ? '' : scope.row.lastLoginTime}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</div>
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<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>
<el-table-column prop="clientName" label="所属院校" align="center">
</el-table-column>
<el-table-column prop="name" label="管理员姓名" align="center">
</el-table-column>
<el-table-column prop="account" label="账号" align="center">
</el-table-column>
<el-table-column prop="role" label="账号角色" align="center">
<template slot-scope="scope">
{{getRoleName(scope.row.roleId)}}
</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
<template slot-scope="scope">
{{scope.row.lastLoginTime == '0000-00-00 00:00:00' ? '' : scope.row.lastLoginTime}}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
</div>
<el-dialog :title="isDetail ? '查看用户' : (isAdd ? '新增用户' : '编辑用户')" :visible.sync="userVisible"
width="30%" :center="!isIE" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
width="500px" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="isDetail">
<el-form-item prop="account" label="账号">
<el-input v-model="form.account" ref="account" placeholder="请输入账号" @change="accountChange"></el-input>
@ -74,7 +71,7 @@
</el-checkbox-group>
</el-form-item>
<el-form-item prop="clientId" label="所属院校">
<el-select v-model="form.clientId" clearable placeholder="请选择院校名称" filterable>
<el-select v-model="form.clientId" clearable placeholder="请选择院校名称" filterable style="width: 100%;">
<el-option v-for="(item,index) in clientList" :key="index" :label="item.clientName" :value="item.id"></el-option>
</el-select>
</el-form-item>
@ -85,28 +82,40 @@
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div>
<el-upload
accept=".xls,.xlsx"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.uploadFileUser"
:file-list="uploadList"
name="file"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<el-dialog title="查看用户" :visible.sync="userShowVisible" width="500px" class="dialog" :close-on-click-modal="false">
<ul class="list">
<li>
<span class="name"><i class="required">*</i>账号</span>
<span class="val">{{form.account}}</span>
</li>
<li>
<span class="name"><i class="required">*</i>用户姓名</span>
<span class="val">{{form.name}}</span>
</li>
<li>
<span class="name">账号角色</span>
<span class="val">超级管理员</span>
</li>
<li>
<span class="name"><i class="required">*</i>所属学校</span>
<span class="val">{{form.clientId ? clientList.find(n => n.id == form.clientId).clientName : ''}}</span>
</li>
</ul>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" :close-on-click-modal="false">
<div class="upload-wrap" :class="{lg: uploadFaild}">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload accept=".xls,.xlsx" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFileUser" :file-list="uploadList" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
<div class="link" v-if="uploadFaild">
<el-link type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false">取消</el-button>
<el-button type="primary" @click="uploadSure">确定</el-button>
<el-button size="small" @click="importVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="uploadSure">确定</el-button>
</span>
</el-dialog>
</div>
@ -116,6 +125,7 @@
import Setting from '@/setting'
import { mapState, mapGetters } from 'vuex'
import util from '@/libs/util'
import breadcrumb from '@/components/breadcrumb'
export default {
name: 'user',
data() {
@ -154,6 +164,7 @@ export default {
isAdd: true,
isDetail: false,
userVisible: false,
userShowVisible: false,
searchTimer: null,
curRow: {},
accountRepeat: false,
@ -164,6 +175,7 @@ export default {
originalAccount: '',
};
},
components: { breadcrumb },
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
@ -205,7 +217,7 @@ export default {
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => {
if(res.data.userInfo){
this.accountRepeat = true
this.$message.warning('该账号已存在')
util.warningMsg('该账号已存在')
}else{
this.accountRepeat = false
}
@ -253,22 +265,21 @@ export default {
this.form.name = row.name
this.form.clientId = row.clientId
this.form.clientName = row.clientName
this.userVisible = true
},
show(row){
this.isDetail = true
this.isAdd = false
this.userShowVisible = true
this.fillForm(row)
},
edit(row){
this.isDetail = false
this.isAdd = false
this.fillForm(row)
this.userVisible = true
},
saveData() {
this.$refs.form.validate((valid) => {
if (valid) {
if(this.accountRepeat) return this.$message.warning('该账号已存在')
if(this.accountRepeat) return util.warningMsg('该账号已存在')
this.form.clientName = this.clientList.find(n => n.id == this.form.clientId).clientName
let form = this.form
let data = {
@ -298,21 +309,21 @@ export default {
if(this.form.id) {
this.$post(this.api.updateUser,data).then(res => {
if(res.success) {
this.$message.success('修改成功');
util.successMsg('修改成功');
this.userVisible = false
this.getData()
}else{
this.$message.error(res.message);
util.errorMsg(res.message);
}
}).catch(res => {});
}else{
this.$post(this.api.addUser,data).then(res => {
if(res.success) {
this.$message.success('新增成功');
util.successMsg('新增成功');
this.userVisible = false
this.getData()
}else{
this.$message.error(res.message);
util.errorMsg(res.message);
}
}).catch(res => {});
}
@ -322,12 +333,12 @@ export default {
})
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteUser}?userIds=${row.id}`).then(res => {
this.$message.success('删除成功');
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
@ -342,9 +353,9 @@ export default {
}
this.$post(this.api.userinfoUpdate,data).then(res => {
if(res.success){
this.$message.success('重置成功')
util.successMsg('重置成功')
}else{
this.$message.error('重置失败')
util.errorMsg('重置失败')
}
}).catch(res => {});
}).catch(() => {
@ -363,19 +374,19 @@ export default {
return item.id
})
//
this.$confirm('确定要删除选中用户吗?', '提示', {
this.$confirm(`此批量删除操作不可逆,是否确认删除${util.ellipsisStr(newArr[0].name)}${newArr.length}个选中项?`, '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteUser}?userIds=${delList.join(',')}`).then(res => {
this.$refs.table.clearSelection()
this.multipleSelection = [];
this.$message.success('删除成功');
util.successMsg('删除成功')
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择数据 !');
util.errorMsg('请先选择数据 !')
}
},
@ -385,7 +396,7 @@ export default {
this.uploadFaild = false
},
handleExceed(files, fileList) {
this.$message.warning(
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
@ -402,10 +413,10 @@ export default {
this.token = res.data.data.token
this.uploadFaild = true
}else{
this.$message.success('上传成功')
util.successMsg('上传成功')
}
}else{
res.data.message ? this.$message.error(res.data.message) : this.$message.error('上传失败,请检查数据')
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
}
},
uploadError(err, file, fileList) {
@ -433,5 +444,23 @@ export default {
</script>
<style lang="scss" scoped>
.list{
li{
display: flex;
justify-content: center;
align-items: center;
margin: 32px 0;
.name,.val{
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
}
.name{
width: 45%;
text-align: right;
}
.val{
width: 55%;
}
}
}
</style>

@ -1,6 +1,6 @@
import axios from 'axios';
import QS from 'qs';
import { Message } from 'element-ui'
import axios from 'axios'
import QS from 'qs'
import util from '@/libs/util'
import router from '@/router/index'
import Setting from '@/setting'
@ -20,7 +20,7 @@ service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
// }
// return config;
// }, err => {
// Message.error({
// util.errorMsg({
// message: '退出登陆',
// onClose: function () {
// router.push({name: 'login'});
@ -38,7 +38,7 @@ service.interceptors.response.use(
} else {
switch (res.code) {
case 201:
Message.error(res.message ? res.message : '数据请求异常')
util.errorMsg(res.message ? res.message : '数据请求异常')
break;
default:
Promise.reject(res).catch(e => {})

@ -16,7 +16,7 @@ const Setting = {
showProgressBar: true,
// 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:8000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://192.168.31.152:8001' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -73,13 +73,13 @@ export default {
Setting.dynamicRoute && addRoutes(routes)
util.session.set(Setting.usernameKey, user.userName)
util.session.set(Setting.storeKey, JSON.stringify(state))
Message.success('登录成功');
util.successMsg('登录成功');
resolve()
}else{
Message.error('该用户没有权限')
util.errorMsg('该用户没有权限')
}
}else{
Message.error(res.message)
util.errorMsg(res.message)
}
}).catch(error => {
reject(error)

@ -1,152 +1,358 @@
@import "./default/index.scss";
.content-box {
-webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out;
@font-face{
font-family: youshe;
src: url('font/YouSheBiaoTiHei.ttf');
}
.content {
width: auto;
height: 100%;
padding: 20px;
box-sizing: border-box;
[v-cloak] {
display: none;
}
.content-collapse {
left: 65px;
::-webkit-scrollbar {
width: 6px;
}
.container {
padding: 30px;
background: #fff;
border: 1px solid #ddd;
border-radius: 5px;
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: rgba(0, 0, 0, 0.06);
}
.crumbs {
margin: 10px 0;
.required{
font-size: 16px;
color: #CC221C;
font-style: normal;
}
.pagination {
margin: 20px 0;
text-align: right;
.breadcrumb{
display: flex;
align-items: center;
margin-bottom: 20px;
.cur,.el-breadcrumb__inner,.el-breadcrumb__separator{
color: rgba(0,0,0,.45) !important;
font-weight: 400 !important;
font-size: 12px;
}
.el-breadcrumb__item:last-of-type .el-breadcrumb__inner{
color: rgba(0,0,0,.85) !important;
}
}
.el-button+.el-tooltip {
margin-left: 10px;
.el-button--primary.action-btn{
color: #CC221C !important;
font-size: 14px !important;
background-color: #fff !important;
border-radius: 4px !important;
}
.ql-snow .ql-tooltip {
transform: translateX(117.5px) translateY(10px) !important;
.el-input{
.el-input__inner{
border-color: rgba(0, 0, 0, 0.15);
}
}
.el-row {
margin-bottom: 20px;
}
.page{
position: relative;
background-color: #fff;
border-radius: 8px;
.p-title{
padding-left: 24px;
line-height: 56px;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
border-bottom: 1px solid rgba(0,0,0,.06);
}
.page-content{
padding: 24px;
.tool{
display: flex;
justify-content: space-between;
margin-bottom: 24px;
.filter{
display: inline-flex;
align-items: center;
flex: 1;
li{
display: inline-flex;
align-items: center;
margin-right: 30px;
label{
font-size: 14px;
line-height: 14px;
color: rgba(0,0,0,.65);
white-space: nowrap;
}
}
}
.single-choice{
dl {
display: flex;
line-height: 30px;
dt {
color: rgba(0,0,0,.65);
font-size: 14px;
white-space: nowrap;
}
dd {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
span {
padding: 0 10px;
margin: 0 10px;
color: #333;
font-size: 14px;
line-height: 1.8;
white-space: nowrap;
#app .el-table thead{
color: #fff;
}
#app .el-table th{
background-color: $--color-primary!important;
font-size: 16px;
font-weight: normal;
}
#app .el-select{
display: unset;
cursor: pointer;
&:hover {
color: #CC221C;
}
&.active {
border-radius: 4px;
color: #fff;
background-color: #CC221C;
}
}
}
}
}
.el-button--primary{
@extend .action-btn;
}
}
}
}
.required{
margin-right: 5px;
color: #F56C6C;
}
.p-title{
display: flex;
align-items: center;
&:before{
content: '';
display: inline-block;
width: 3px;
height: 15px;
margin-right: 5px;
background-color: $--color-primary;
.pagination {
margin: 20px 0;
text-align: center;
button,.number{
color: rgba(0,0,0,.65) !important;
background-color: transparent !important;
border: 1px solid rgba(0, 0, 0, 0.15) !important;
border-radius: 4px !important;
}
}
.per_title{
span{
font-size: 16px;
font-weight: bold;
button i{
color: #333;
}
.per_back{
margin-left: 5px;
.active{
color: #fff !important;
background-color: #CC221C !important;
}
.per_school{
margin-left: 30px;
}
.el-table{
border-radius: 8px;
border: 1px solid rgba(0, 0, 0, 0.06);
border-bottom: 0;
.cell{
color: rgba(0, 0, 0, 0.85);
font-size: 14px;
.el-checkbox{
&:before{
content: '全选';
margin-right: 5px;
color: rgba(0, 0, 0, 0.85);
font-size: 14px;
opacity: 0;
}
}
}
&:hover{
cursor:pointer;
th{
background: rgba(0, 0, 0, 0.04)!important;
font-size: 14px;
color: rgba(0, 0, 0, 0.85);
font-weight: normal;
.cell{
.el-checkbox{
&:before{
opacity: 1;
}
}
}
}
}
[v-cloak] {
display: none;
.el-checkbox__inner{
border-radius: 4px;
transition: none !important;
}
.el-checkbox__input.is-indeterminate .el-checkbox__inner{
background-color: #FFFFFF;
border-color: #DCDFE6;
}
.el-switch__core{
background-color: #bfbfbf;
}
.el-switch__label--right{
z-index: 2;
position: absolute;
right: 8px;
margin-left: 0;
color: #fff !important;
}
.el-switch__label--right.is-active{
left: 8px;
right: auto;
}
.el-switch__label--right span{
font-size: 12px;
}
}
.tabs{
display: flex;
align-items: center;
padding: 20px 1.5% 20px;
margin-bottom: 20px;
z-index: 999;
background-color: #fff;
padding: 0 24px;
border-bottom: 1px solid rgba(0,0,0,.06);
.item{
padding: 12px 20px;
margin-right: 10px;
color:#606266;
line-height: 1;
border-radius: 4px;
background-color: #fff;
border: 1px solid #dcdfe6;
position: relative;
padding: 20px 0;
margin-right: 40px;
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
cursor: pointer;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 3px;
border-bottom: 3px solid transparent;
border-radius: 2px;
}
&.active{
color: #fff;
background-color: $--color-primary;
border-color: $--color-primary;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
&.active:after{
border-bottom-color: $--color-primary;
}
}
}
.btns{
display: flex;
justify-content: center;
margin-top: 20px;
button{
height: 30px;
padding: 0 30px;
margin: 0 15px;
.el-message{
padding: 11px 20px;
.el-message__icon{
font-size: 16px;
}
.el-message__content{
font-size: 14px;
color: #333;
line-height: 30px;
background-color: #fff;
border: 1px solid #ededed;
border-radius: 4px;
cursor: pointer;
&.submit{
color: #fff;
background-color: #e80909;
border-color: #e80909;
color: rgba(0, 0, 0, 0.65);
}
.el-icon-close{
font-size: 14px;
color: #92998d;
}
.el-message--success{
border: 1px solid #B7EB8F;
background: #F6FFED;
.el-message__icon{
color: #00c700;
}
}
.el-message--warning{
border: 1px solid #FFE58F;
background: #FFFBE6;
.el-message__icon{
color: #ffa900;
}
}
}
.el-message-box{
padding-bottom: 24px;
.el-message-box__header{
padding: 32px 32px 12px 50px;
span{
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
}
&:hover{
opacity: .8;
}
.el-message-box__status{
top: -30px;
}
.el-message-box__status + .el-message-box__message{
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message-box__btns{
padding-right: 32px;
&.el-icon-warning{
color: #ffa900;
}
}
.el-button--primary,.el-button--primary:hover, .el-button--primary:focus{
background: #CC221C;
}
}
.el-dialog__wrapper{
.el-dialog{
border-radius: 4px;
.el-dialog__header{
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
.el-dialog__title{
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
}
}
&:focus{
outline: none;
.el-dialog__footer{
padding: 10px 16px;
border-top: 1px solid rgba(0, 0, 0, 0.06);
.el-button{
font-size: 14px;
border-radius: 4px;
border-color: rgba(0, 0, 0, 0.15);
}
}
}
}
.userRadio .el-radio{
margin-right: 10px!important;
.upload-wrap{
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 34px 0;
.el-button{
span{
display: flex;
align-items: center;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
img{
margin-right: 8px;
}
}
}
&>.el-button{
margin-right: 32px;
}
.el-upload-list{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
.link{
position: absolute;
bottom: -20px;
left: 0;
width: 100%;
text-align: center;
}
&.lg{
padding-bottom: 50px;
}
}
.userRadio .el-radio__input{
display: none!important;
@media(max-width: 1600px){
.el-table{
.el-switch__label--right.is-active{
left: 8px;
}
}
}

@ -8,6 +8,7 @@ body,
}
body {
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-size: 14px;
background: $bg-grey;
background: rgba(0, 0, 0, 0.02);
}

@ -17,11 +17,11 @@ module.exports = {
sass: {
prependData: `@import "@/styles/var.scss";`
},
postcss: {
plugins: [
postcss
]
}
// postcss: {
// plugins: [
// postcss
// ]
// }
}
},
publicPath: Setting.publicPath,

Binary file not shown.
Loading…
Cancel
Save