yujialong 3 years ago
parent f977c533b7
commit 559a5d9382
  1. BIN
      src/assets/img/school.png
  2. 12
      src/layouts/footer/index.vue
  3. 83
      src/layouts/header/index.vue
  4. 23
      src/layouts/home/index.vue
  5. 17
      src/layouts/navbar/index.vue
  6. 38
      src/pages/account/login/index.vue
  7. 108
      src/pages/data/list/index.vue
  8. 17
      src/pages/index/list/index.vue
  9. 41
      src/pages/setting/person/index.vue
  10. 4
      src/pages/setting/person/info.vue
  11. 51
      src/pages/stat/list/index.vue
  12. 44
      src/pages/user/list/index.vue
  13. 2
      src/setting.js
  14. 2
      src/styles/layout/index.scss
  15. 3
      src/styles/var.scss
  16. 2
      vue.config.js

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

@ -1,6 +1,8 @@
<template>
<div>
<div class="copyright"></div>
<div class="copyright">
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a>
</div>
</div>
</template>
<script>
@ -24,5 +26,13 @@ export default {
color: rgba(0, 0, 0, 0.45);
font-size: 12px;
text-align: center;
background-color: #333;
a{
color:#fff;
font-size: 12px;
&:hover{
opacity: .8;
}
}
}
</style>

@ -1,9 +1,13 @@
<template>
<div class="header">
<a class="logo" @click="toIndex">
<img width="180" v-if="isLogin || (isManager && showSetting) || !isUser" src="@/assets/img/logo.png" alt="">
<!-- <img width="180" v-if="isLogin || (isManager && showSetting) || !isUser" src="@/assets/img/logo.png" alt=""> -->
<span v-if="token && isManager && !showSetting">{{schoolName}}</span>
</a>
<div class="search" v-if="isData">
<input v-model="keyword" type="text" placeholder="请输入数据表名称">
<img src="../../assets/img/search.png" alt="" class="search-icon">
</div>
<div class="inner">
<div style="height: 80px;"></div>
<navbar ref="nav"></navbar>
@ -25,17 +29,14 @@
</el-dropdown>
</div>
<div v-else-if="!isLogin">
<div class="login" @click="toLogin">
<router-link class="login" to="/login" target="_blank">
<img src="@/assets/img/user.png" alt="">
<span>登录</span>
</div>
</div>
<div v-else>
<img class="search" src="../../assets/img/search.png" alt="" @click="toSearch">
</router-link>
</div>
</div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" @close="closePassword" width="30%">
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
@ -59,12 +60,17 @@ import navbar from '../navbar'
import { mapState,mapActions } from 'vuex'
import Setting from '@/setting'
import util from '@/libs/util'
import bus from '@/libs/bus'
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
isLogin: this.$route.path == '/login',
isData: this.$route.path == '/data/list',
customer: this.$route.query.customer,
rendered: false,
keyword: '',
searchTimer: null,
userName: '',
isUser: false,
showSetting: true,
@ -87,6 +93,25 @@ export default {
'routes'
])
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
if(!this.rendered){
this.searchTimer = setTimeout(() => {
bus.$emit('initData',this.keyword)
},500)
}
this.rendered = false
},
'$route'(to,from) {
let isData = this.$route.path == '/data/list'
if(isData){
this.rendered = true
this.keyword = ''
}
this.isData = isData
}
},
mounted(){
if(this.customer){
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
@ -193,14 +218,20 @@ export default {
</script>
<style lang="scss" scoped>
.header{
position: relative;
z-index: 10;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80px;
background-color: #fff;
.inner{
display: flex;
justify-content: space-between;
align-items: center;
width: $inner-width;
max-width: $max-width;
min-width: $min-width;
padding: 0 10px;
margin: 0 auto;
}
.logo{
@ -214,7 +245,39 @@ export default {
}
.search{
cursor: pointer;
z-index: 2;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: 80px;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
input{
width: 195px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&:focus{
outline: none;
}
}
.remove{
cursor: pointer;
}
.search-icon{
width: 18px;
}
}
.action{
display: inline-flex;

@ -9,7 +9,7 @@
</keep-alive>
</transition>
<el-backtop target=".content"></el-backtop>
<!-- <v-footer ref="footer"></v-footer> -->
<v-footer class="footer"></v-footer>
</div>
</div>
</div>
@ -24,7 +24,6 @@ export default {
data() {
return {
tagsList: [],
collapse: false,
hideNavList: Setting.layout.hideNavList
};
},
@ -40,18 +39,7 @@ export default {
}
},
created() {
bus.$on('collapse-content', msg => {
this.collapse = msg;
});
// 使keep-alive
bus.$on('tags', msg => {
let arr = [];
for (let i = 0, len = msg.length; i < len; i++) {
msg[i].name && arr.push(msg[i].name)
}
this.tagsList = arr
});
}
};
</script>
@ -59,9 +47,14 @@ export default {
.main{
min-height: 100%;
background: url(../../assets/img/login-bg.png) 0 0/100% 100% no-repeat;
.layout{
margin-top: 80px;
}
.view{
width: $inner-width;
padding: 20px 0;
max-width: $max-width;
min-width: $min-width;
min-height: calc(100vh - 56px);
padding: 20px;
margin: 0 auto;
}
}

@ -17,14 +17,16 @@ export default {
managerStr: this.$route.query.mg,
isManager: false,
active: this.$route.path,
defaultMenus: [{
defaultMenus: [],
//
dataMenu: [{
index: '/index/list',
title: '首页'
}],
dataMenu: [{
},{
index: '/data/list',
title: '数据'
}],
//
managerMenus: [
{
index: '/stat/list',
@ -56,7 +58,7 @@ export default {
}
},
mounted() {
if(util.local.get(Setting.tokenKey)){
if(util.local.get(Setting.tokenKey)){//
this.getPer()
if(this.managerStr && atob(decodeURI(this.managerStr)) === 'true'){
this.isManager = true
@ -71,7 +73,7 @@ export default {
'setManager'
]),
initMenu(){
if(this.isManager){
if(this.isManager){// trueurlmanagerStr
this.defaultMenus = this.managerMenus
if(Setting.dynamicRoute){
let routes = this.routes
@ -91,6 +93,7 @@ export default {
this.active = item.index
this.$router.push(item.index).catch(err => {})
},
//
getPer(){
this.$post(this.api.getPermissions).then(res => {
let routes = res.permissions[0].children
@ -111,10 +114,10 @@ export default {
left: 50%;
transform: translateX(-50%);
display: flex;
padding-bottom: 10px;
li{
padding: 25px;
padding: 0 25px;
font-size: 16px;
line-height: 80px;
color: #0d0d0d;
cursor: pointer;
&.active{

@ -1,11 +1,6 @@
<template>
<div class="wrap">
<vHead></vHead>
<div class="login">
<div class="names">
<img class="logo" src="../../../assets/img/three.png" alt="">
<p class="text">或然数据平台</p>
</div>
<div class="form">
<ul class="tab">
<li v-for="(item,index) in tabList" :key="index" :class="{active: form.distinguish == item.id}" @click="typeClick(item)">{{item.label}}</li>
@ -32,7 +27,7 @@
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%">
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">
@ -46,6 +41,8 @@
<el-button size="small" type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<v-footer class="footer"></v-footer>
</div>
</template>
@ -54,6 +51,7 @@ import { mapActions } from 'vuex'
import vHead from '@/layouts/header'
import util from '@/libs/util'
import Setting from '@/setting'
import vFooter from '@/layouts/footer'
export default {
data: function() {
return {
@ -87,7 +85,7 @@ export default {
phoneBtnText: '发送验证码'
};
},
components: {vHead},
components: {vHead,vFooter},
mounted(){
this.getVerImg()
},
@ -203,28 +201,19 @@ export default {
overflow: hidden;
.login{
width: 500px;
margin: 0 auto;
width: 600px;
margin: 200px auto;
text-align: center;
.names{
margin: 70px 0;
.text{
margin-top: 10px;
font-size: 20px;
color: #fff;
}
}
.form{
padding: 30px;
margin-top: 30px;
padding: 40px 40px 50px;
border-radius: 10px;
background-color: #fff;
.tab{
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 30px;
margin-bottom: 60px;
border-bottom: 2px solid #e0e0e0;
li{
padding: 9px 20px;
@ -254,7 +243,7 @@ export default {
border-radius: 0 !important;
}
.account,.password,.code{
z-index: 10;
z-index: 1;
position: absolute;
top: 11px;
left: 8px;
@ -296,5 +285,12 @@ export default {
}
}
}
.footer{
z-index: 3;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
}
}
</style>

@ -1,11 +1,5 @@
<template>
<div class="wrap">
<div class="search">
<!-- <img src="../../../assets/img/remove-black.png" alt="" class="remove" @click="keyword = ''"> -->
<input v-model="keyword" type="text" placeholder="请输入数据表名称">
<img src="../../../assets/img/search.png" alt="" class="search-icon">
</div>
<div class="left">
<el-menu class="menu" ref="type" @open="openType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType">
<template v-for="item in typeList">
@ -81,14 +75,19 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center">
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column>
<el-table-column label="起止时间" width="190" align="center">
<template slot-scope="scope">
{{scope.row.startTime}}-{{scope.row.endTime}}
</template>
</el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="110" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="220" align="center">
<el-table-column prop="updateTime" label="更新时间" width="150" align="center"></el-table-column>
<el-table-column label="操作" width="120" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button>
@ -148,6 +147,7 @@ import { mapState } from 'vuex'
import axios from 'axios'
import util from '@/libs/util'
import Setting from '@/setting'
import bus from '@/libs/bus'
let startTimeLimit = ''
let endTimeLimit = ''
@ -156,13 +156,12 @@ export default {
return {
that: this,
token: util.local.get(Setting.tokenKey),
keyword: '',
searchTimer: null,
typeId: this.$route.query.typeId,
typeList: [],
defaultType: '',
defaultOpenType: [],
introduce: '',
keyword: '',
listData: [],
listDataAll: [],
searchListData: [],
@ -215,15 +214,12 @@ export default {
'schoolId'
]),
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
mounted() {
bus.$on('initData',keyword => {
this.keyword = keyword
this.initData()
})
this.getType()
if(this.$route.query.download){
this.download({
@ -290,6 +286,7 @@ export default {
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => {
this.listData = res.pageList.records
this.total = res.pageList.total
this.listData.length && this.preview(this.listData[0],1)
}).catch(res => {})
},
initData(){
@ -326,25 +323,30 @@ export default {
this.previewData = []
this.initData()
},
findId(data,id){
let result = ''
data.forEach(n => {
if(n.id == id){
if(n.children[0].children.length){
return result = n.children[0].children[0].id
}else{
return result = n.children[0].id
}
}else{
this.findId(n.children,id)
}
})
return result
},
openType(index,indexPath){
let typeList = this.typeList
let firstChild = typeList.find(n => n.id == index)
let id = ''
if(firstChild){
id = firstChild.children[0].id
}else{
typeList.map(n => {
n.children.map(n => {
if(n.id == index) id = n.children[0].id
})
})
}
console.log(11,this.typeList)
let id = this.findId(this.typeList,index)
this.selectType(id,indexPath)
},
previewCurrentChange(val){
this.currentRow = val
},
preview(row){
preview(row,isDefault){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
this.$post(this.api.saveRecord,{
tableId: row.id,
@ -365,7 +367,7 @@ export default {
}
})
this.previewData = data
this.$nextTick(() => {
isDefault || this.$nextTick(() => {
document.querySelector('#previewTable').scrollIntoView()
})
@ -492,41 +494,6 @@ export default {
<style lang="scss" scoped>
.wrap{
display: flex;
.search{
z-index: 2;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: 80px;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
input{
width: 195px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&:focus{
outline: none;
}
}
.remove{
cursor: pointer;
}
.search-icon{
width: 18px;
}
}
/deep/.left{
margin-right: 20px;
@ -547,6 +514,9 @@ export default {
.el-submenu.is-active{
.el-submenu__title{
background-color: rgba(147,184,255,.3);
&+.el-menu .el-submenu__title{
background-color: rgba(147,184,255,.15);
}
}
}
.el-menu-item.is-active{

@ -1,7 +1,7 @@
<template>
<div class="wrap" :class="{result: keyword}">
<hr class="shadow" v-if="keyword">
<div class="title" v-if="!keyword">欢迎来到<br>或然数据平台</div>
<div class="title" v-if="!keyword">准确多元海量数据</div>
<div class="search-wrap">
<div class="search">
<div class="icon-wrap">
@ -119,17 +119,20 @@ export default {
this.$router.push(`/data?download=true&id=${row.id}&name=${row.name}&showName=${row.showName}`)
}).catch(res => {})
}else{
this.$router.push('/login')
let route = this.$router.resolve({
path: '/login'
})
window.open(route.href)
}
},
toData(row){
if(this.token){
this.$router.push(`/data?typeId=${row.categoryTwoId}`)
}else{
util.errorMsg('请先登录!')
setTimeout(() => {
this.$router.push('/login')
},1500)
let route = this.$router.resolve({
path: '/login'
})
window.open(route.href)
}
}
}
@ -140,7 +143,7 @@ export default {
.wrap{
position: relative;
.title{
margin: 70px 0 130px;
margin: 70px 0 90px;
font-size: 50px;
color: #fff;
text-align: center;

@ -10,16 +10,13 @@
</el-upload>
</div>
<el-menu class="menu" :default-active="active" @select="handleSelect">
<el-menu-item v-for="item in typeList" :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</el-menu>
<ul class="menu">
<li v-for="item in typeList" :key="item.index" :class="{active: item.index == active}" @click="selectType(item.index)">{{ item.title }}</li>
</ul>
</div>
</div>
<div class="right">
<info v-if="active == 1" @updateStatus="updateStatus"></info>
<info ref="info" v-if="active == 1" @updateStatus="updateStatus"></info>
<download v-else></download>
</div>
</div>
@ -57,10 +54,11 @@ export default {
},
beforeRouteLeave(to, from, next) {
if(this.edited){
this.$confirm(`修改的信息还没有保存,是否确认离开`, '提示', {
this.$confirm(`所更改的内容未更新,是否更新`, '提示', {
type: 'warning'
}).then(() => {
next()
this.$refs.info.save()
next(false)
}).catch(() => {
next(false)
})
@ -78,13 +76,17 @@ export default {
changeAvatar(res) {
this.setAvatar(res.message)
},
handleSelect(key, keyPath){
selectType(key){
if(key == 2 && this.edited){
this.$confirm(`修改的信息还没有保存,是否确认离开`, '提示', {
this.$confirm(`所更改的内容未更新,是否更新`, '提示', {
type: 'warning'
}).then(() => {
this.active = key
}).catch(() => {})
this.$refs.info.save()
this.active = '1'
}).catch(() => {
this.active = '1'
this.$forceUpdate()
})
}else{
this.active = key
}
@ -113,9 +115,16 @@ export default {
border-radius: 50%;
}
.menu{
.el-menu-item.is-active{
color: #fff;
background-color: $main-color;
li{
padding: 0 20px;
color: #303133;
font-size: 14px;
line-height: 56px;
cursor: pointer;
&.active{
color: #fff;
background-color: $main-color;
}
}
}
}

@ -188,7 +188,7 @@
<el-dialog :title="form.email ? '更换邮箱' : '绑定邮箱'" :visible.sync="emailVisible" :close-on-click-modal="false" @close="closeEmail" width="30%">
<el-form ref="form" :model="form" label-width="60px">
<el-form-item label="邮箱">
<el-input placeholder="请输入邮箱" v-model="email"></el-input>
<el-input style="width: 394px;" placeholder="请输入邮箱" v-model="email"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">
@ -206,7 +206,7 @@
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%">
<el-form ref="form" :model="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
<el-input style="width: 394px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">

@ -1,17 +1,32 @@
<template>
<div class="wrap">
<div class="left">
<div class="product" v-for="(item,index) in productList" :key="index">
<p class="product-name">{{item.productName}}</p>
<div class="date">
<span class="name">使用期限</span>
<div class="val">
{{item.endTime}}
<div class="products">
<img class="icon" width="100" src="@/assets/img/school.png" alt="">
<div class="product" v-for="(item,index) in productList" :key="index">
<p class="product-name">{{item.productName}}</p>
<div class="date">
<span class="name">使用期限</span>
<div class="val">
{{item.endTime}}
</div>
</div>
<p class="surplus" v-if="item.deadline"><span class="name">剩余期限</span><span class="num">{{item.deadline}}</span> </p>
<p class="surplus"><span class="name">账号数量</span><span class="num">{{item.accountNum}}</span> </p>
<el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button>
</div>
<div class="product" v-for="(item,index) in productList" :key="index">
<p class="product-name">{{item.productName}}</p>
<div class="date">
<span class="name">使用期限</span>
<div class="val">
{{item.endTime}}
</div>
</div>
<p class="surplus" v-if="item.deadline"><span class="name">剩余期限</span><span class="num">{{item.deadline}}</span> </p>
<p class="surplus"><span class="name">账号数量</span><span class="num">{{item.accountNum}}</span> </p>
<el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button>
</div>
<p class="surplus" v-if="item.deadline"><span class="name">剩余期限</span><span class="num">{{item.deadline}}</span> </p>
<p class="surplus"><span class="name">账号数量</span><span class="num">{{item.accountNum}}</span> </p>
<el-button class="renew" size="small" type="primary" v-if="!item.deadline">续费</el-button>
</div>
</div>
<div class="right">
@ -325,12 +340,23 @@ export default {
display: flex;
.left{
margin-right: 20px;
.product{
.products{
width: 200px;
padding: 15px;
margin-bottom: 15px;
text-align: center;
background-color: #fff;
border-radius: 8px;
.icon{
margin-bottom: 10px;
}
}
.product{
margin-bottom: 30px;
text-align: left;
&:last-child{
margin-bottom: 0;
}
.product-name{
margin-bottom: 15px;
font-size: 16px;
@ -364,6 +390,9 @@ export default {
}
}
}
.right{
max-width: calc(100% - 220px);
}
.page{
margin-bottom: 20px;
.arrow{

@ -7,7 +7,7 @@
<ul class="filter">
<li>
<label>创建时间</label>
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="w-150">
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="flex-1">
<el-option v-for="(item,index) in monthList" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</li>
@ -17,7 +17,7 @@
</li>
<li>
<label style="width: auto;">角色</label>
<el-select v-model="role" placeholder="请选择角色" size="small" clearable class="w-150" @change="initData">
<el-select v-model="role" placeholder="请选择角色" size="small" clearable @change="initData">
<el-option label="不限" value=""></el-option>
<el-option label="用户" value="0"></el-option>
<el-option v-for="(item,index) in roleList" :key="index" :label="item.roleName" :value="item.id"></el-option>
@ -25,7 +25,7 @@
</li>
<li>
<label>状态</label>
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="w-150" @change="initData">
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="flex-1" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select>
</li>
@ -34,11 +34,13 @@
<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="'/user/list:新增用户'">新增账号</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>
</div>
<div class="tool" style="justify-content: flex-end;margin-bottom: 16px;">
<el-button type="primary" size="small" round @click="add" v-auth="'/user/list:新增用户'">新增账号</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>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
@ -87,12 +89,12 @@
<el-input v-model="form.userName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item prop="roleId" label="账号角色">
<el-radio v-model="defaultUser" label="user" disabled>用户</el-radio>
<el-radio-group v-model="form.roleId">
<el-checkbox-group v-model="form.roleId" :max="2">
<el-checkbox label="user" disabled>用户</el-checkbox>
<template v-for="(item,index) in roleList">
<el-radio v-if="item.id != '1409424489820102658'" :key="index" :label="item.id" :disabled="item.id == 'user'">{{item.roleName}}</el-radio>
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :disabled="item.id == 'user'" @change="changeRole">{{item.roleName}}</el-checkbox>
</template>
</el-radio-group>
</el-checkbox-group>
</el-form-item>
<el-form-item prop="uniqueIdentification" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentification" placeholder="唯一标识"></el-input>
@ -177,7 +179,7 @@ export default {
isDetail: false,
userVisible: false,
roleList: [],
defaultUser: 'user',
defaultUser: true,
form: {
platformId: Setting.platformId,
// type: 1, // 0-> 1->
@ -185,7 +187,7 @@ export default {
userId: '',
accountId: '',
userName: '',
roleId: '',
roleId: ['user'],
phone: '',
uniqueIdentification: '',
workNumber: '',
@ -353,7 +355,7 @@ export default {
this.accountRepeat = false
this.workNumberRepeat = false
},
addTeacher(){
add(){
this.isDetail = false
this.userVisible = true
},
@ -387,7 +389,11 @@ export default {
this.isDetail = true
this.getDetail(row.accountId)
},
changeRole(val){
console.log(11,val)
},
confirm(){
// return console.log(11,this.form.roleId)
this.$refs.form.validate((valid) => {
if (valid) {
if(this.accountRepeat) return util.errorMsg('该账号已存在!')
@ -395,7 +401,11 @@ export default {
let data = this.form
data.schoolId = data.schoolId ? data.schoolId : this.schoolId
if(!data.userId) data.uniqueIdentification = new Date().getTime()
if(!data.roleId) data.roleId = '0'
if(data.roleId.length == 1){
data.roleId = '0'
}else{
data.roleId = data.roleId[1]
}
if(this.form.userId){
this.$post(this.api.modifyUser,data).then(res => {
this.userVisible = false
@ -474,7 +484,7 @@ export default {
this.getData()
},
downLoad(){
location.href = this.api.userTemplate
location.href = `${this.api.userTemplate}?id=${Math.random()}`
},
showFaild(){
this.importVisible = false

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

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

@ -1,5 +1,6 @@
$main-color: #568DF2;
$inner-width: 1440px;
$max-width: 1440px;
$min-width: 1280px;
@mixin ellipsis {
overflow: hidden;

@ -23,6 +23,6 @@ module.exports = {
  outputDir: Setting.outputDir,
  assetsDir: Setting.assetsDir,
devServer: {
port: 8092
port: 8081
}
}
Loading…
Cancel
Save