Compare commits

..

No commits in common. 'master' and 'dev_2022-05-11' have entirely different histories.

  1. 1
      README.md
  2. 25
      public/index.html
  3. 100
      src/api/index.js
  4. BIN
      src/assets/img/index/customer.png
  5. BIN
      src/assets/img/index/index0.png
  6. BIN
      src/assets/img/index/sug.png
  7. BIN
      src/assets/img/index/tel-1.png
  8. BIN
      src/assets/img/index/tel-2.png
  9. BIN
      src/assets/img/index/tel.png
  10. BIN
      src/assets/img/index/top-1.png
  11. BIN
      src/assets/img/index/top.png
  12. BIN
      src/assets/img/index/wechat-1.png
  13. BIN
      src/assets/img/index/wechat.png
  14. 33
      src/layouts/footer/index.vue
  15. 96
      src/layouts/header/index.vue
  16. 104
      src/layouts/home/index.vue
  17. 6
      src/libs/util.js
  18. 345
      src/pages/account/login/index.vue
  19. 199
      src/pages/data/list/index.vue
  20. 186
      src/pages/index/list/index.vue
  21. 2
      src/pages/role/list/index.vue
  22. 195
      src/pages/screen/list/index.vue
  23. 253
      src/pages/user/list/index.vue
  24. 111
      src/plugins/requests/index.js
  25. 19
      src/setting.js
  26. 57
      src/store/modules/user.js
  27. 3
      vue.config.js

@ -1 +0,0 @@
# 数据前瞻平台前端

@ -1,25 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="数据前瞻,数据平台,金融数据,宏观数据,行业经济数据" /> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<meta <link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css">
name="description" <title>数据前瞻</title>
content="数据前瞻涵盖股票数据,期货数据,债券数据,期权数据,利率数据,公募数据和宏观数据,拥有超40年的历史数据,可为您解读、预测、分析,模拟市场趋势、经济周期和世界事件影响提供必要的数据支持。我们的数据均来源于各大专业财经权威网站和数据官方发布平台,并经过专业的数据分类和整理,可让用户轻松便捷地搜索并批量下载到自己研究所需的数据,极大地减轻自己搜索整理数据的时间,提高研究效率, 从而高效的输出研究成果。"
/>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css" />
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?26fbe82e56d2f1aeeb09fe697c4434d5';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<title>数据前瞻——准确、海量、易用的财经数据平台</title>
</head> </head>
<body> <body>
<noscript> <noscript>
@ -28,4 +14,5 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>

@ -3,22 +3,19 @@ const host = Setting.apiBaseURL
export default { export default {
// 登录注册 // 登录注册
logins: `users/users/user/login`, logins: `users/users/user/login`,
verification: `${host}users/users/user/captcha`, verification:`${host}users/users/user/captcha`,
sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`, sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`, getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`, getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`, unbindAccounts: `users/users/user/unbindAccounts`,
logout: `users/users/user/logout`,
checkUserNameOrWorkNumber: `users/users/batchProcessing/checkUserNameOrWorkNumber`,
updateUserNameOrWorkNumber: `users/users/batchProcessing/updateUserNameOrWorkNumber`,
// 加密货币 // 加密货币
market: `/topic/market`, market: `/topic/market`,
getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`, getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`,
platformLogList: `nakadai/nakadai/log/platformLogList`, platformLogList: `nakadai/log/platformLogList`,
logNotification: `nakadai/nakadai/log/logNotification`, logNotification: `nakadai/log/logNotification`,
// 公用接口 // 公用接口
queryProvince: `nakadai/nakadai/province/queryProvince`, queryProvince: `nakadai/nakadai/province/queryProvince`,
queryCity: `nakadai/nakadai/city/queryCity`, queryCity: `nakadai/nakadai/city/queryCity`,
@ -32,69 +29,70 @@ export default {
// 个人中心 // 个人中心
uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`, uploadUserAvatars: `${host}users/users/userAccount/updateUserAvatars`,
userInfo: `users/users/userInfo/getUserInfo`, userInfo:`users/users/userInfo/getUserInfo`,
updateUser: `users/users/userInfo/updateUser`, updateUser:`users/users/userInfo/updateUser`,
findPasswordByEmail: `users/users/userAccount/findPasswordByEmail`, findPasswordByEmail:`users/users/userAccount/findPasswordByEmail`,
findPasswordByPhone: `users/users/userAccount/findPasswordByPhone`, findPasswordByPhone:`users/users/userAccount/findPasswordByPhone`,
// 用户管理 // 用户管理
saveUser: `users/users/data/user/save`, saveUser: `users/users/data/user/save`,
getDetailByAccount: `occupationlab/occupationlab/architecture/getDetailByAccount`, getDetailByAccount: `occupationlab/architecture/getDetailByAccount`,
getUserList: `users/users/data/user/getUserList`, getUserList: `users/users/data/user/getUserList`,
getUserTotalBySchoolId: `users/users/data/user/getUserTotalBySchoolId`, getUserTotalBySchoolId: `users/users/data/user/getUserTotalBySchoolId`,
checkAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`, checkAccount:`occupationlab/architecture/checkWorkNumOrAccount`,
getDetail: `users/users/data/user/getDetail`, getDetail:`users/users/data/user/getDetail`,
modifyUser: `users/users/data/user/modify`, modifyUser:`users/users/data/user/modify`,
export_failure: `${host}users/users/data/user/export_failure`, export_failure:`${host}users/users/data/user/export_failure`,
uploadFile: `${host}users/users/data/user/uploadFile`, uploadFile:`${host}users/users/data/user/uploadFile`,
deleteUser: `users/users/data/user/delete`, deleteUser:`users/users/data/user/delete`,
resetPwd: `users/users/userAccount/resetPwd`, resetPwd: `users/users/userAccount/resetPwd`,
sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`, sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`, unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`, bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `users/users/userAccount/examinePassword`, examinePassword: `users/users/userAccount/examinePassword`,
isClient: `${host}users/users/user/isClient`,
deleteProfile: `users/users/userInfo/deleteProfile`, deleteProfile: `users/users/userInfo/deleteProfile`,
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`, checkEmailOrPhone: `occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`, accountIsDisabled: `users/users/user/accountIsDisabled`,
userTemplate: `https://www.dataforward.cn/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, userTemplate: `http://39.108.250.202/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`,
// 角色管理 // 角色管理
batchRemove: `users/users/role/batchRemove`, batchRemove:`users/role/batchRemove`,
getRole: `users/users/role/obtainDetails`, getRole:`users/role/obtainDetails`,
getName: `data/data/role/getName`, getName:`data/data/role/getName`,
listRole: `users/users/role/list`, listRole:`users/role/list`,
removeRole: `data/data/role/remove`, removeRole:`data/data/role/remove`,
saveOrUpdate: `users/users/role/saveOrUpdate`, saveOrUpdate:`users/role/saveOrUpdate`,
getPermissions: `users/users/user-role/getUserRolesPermissionMenu`, getPermissions:`users/user-role/getUserRolesPermissionMenu`,
// 权限菜单管理 // 权限菜单管理
doAssign: `data/data/permission/doAssign`, doAssign:`data/data/permission/doAssign`,
queryAllMenus: `users/users/permission/queryAllMenus`, queryAllMenus:`users/users/permission/queryAllMenus`,
savePer: `users/users/user-role/rolePermissionService`, savePer:`users/user-role/rolePermissionService`,
toAssign: `data/data/permission/toAssign`, toAssign:`data/data/permission/toAssign`,
// 表展示 // 表展示
getIdQueryTable: `data/data/table/getIdQueryTable`, getIdQueryTable:`data/data/table/getIdQueryTable`,
getTableByClassification: `data/data/table/getTableByClassification`, getTableByClassification:`data/data/table/getTableByClassification`,
getTableByCondition: `data/data/table/getTableByCondition`, getTableByCondition:`data/data/table/getTableByCondition`,
downloadData: `${host}data/data/download`, downloadData:`${host}data/data/download`,
previewData: `data/data/preview`, previewData:`data/data/preview`,
visualPreview: `data/data/visualPreview`, visualPreview:`data/data/visualPreview`,
downloadRecord: `data/data/myDownload/downloadRecord`, downloadRecord:`data/data/myDownload/downloadRecord`,
getDownloadRecord: `data/data/myDownload/getDownloadRecord`, getDownloadRecord:`data/data/myDownload/getDownloadRecord`,
downloadAgain: `data/data/downloadAgain`, downloadAgain:`data/data/downloadAgain`,
isDownload: `data/data/product/isDownload`, isDownload:`data/data/product/isDownload`,
getTableTime: `data/data/tableTime/getTableTime`, getTableTime:`data/data/tableTime/getTableTime`,
getLevel: `data/data/category/getLevel`, getLevel: `data/category/getLevel`,
multipleTablePreview: `data/data/multipleTablePreview`, multipleTablePreview: `data/data/multipleTablePreview`,
// 数据操作记录 // 数据操作记录
queryAccumulate: `data/data/dataRecord/queryAccumulate`, queryAccumulate:`data/data/dataRecord/queryAccumulate`,
queryDatabaseInfo: `data/data/dataRecord/queryDatabaseInfo`, queryDatabaseInfo:`data/data/dataRecord/queryDatabaseInfo`,
queryDatabaseInfoByMonth: `data/data/dataRecord/queryDatabaseInfoByMonth`, queryDatabaseInfoByMonth:`data/data/dataRecord/queryDatabaseInfoByMonth`,
saveRecord: `data/data/dataRecord/saveRecord`, saveRecord:`data/data/dataRecord/saveRecord`,
databaseInfoExport: `${host}data/data/dataRecord/databaseInfoExport`, databaseInfoExport:`${host}data/data/dataRecord/databaseInfoExport`,
databaseInfoByMonthExport: `${host}data/data/dataRecord/databaseInfoByMonthExport`, databaseInfoByMonthExport:`${host}data/data/dataRecord/databaseInfoByMonthExport`,
onlineNumber: `data/data/dataRecord/onlineNumber`, onlineNumber:`data/data/dataRecord/onlineNumber`,
getProductInfoBySchoolId: `data/data/product/getProductInfoBySchoolId`, getProductInfoBySchoolId:`data/data/product/getProductInfoBySchoolId`,
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

@ -8,24 +8,23 @@
<template> <template>
<div class="footer"> <div class="footer">
<div class="info"> <div class="info">
<!-- <span class="m-r-20">客服邮箱service@huorantech.cn</span> --> <span class="m-r-20">客服邮箱service@huorantech.cn</span>
<span>联系人金经理 15218726836</span> <span>联系人孙经理 18565785395</span>
</div> </div>
<div class="copyright"> <div class="copyright">
<span>© Copyright 2021 Dataforward 数据前瞻</span> <span>© Copyright 2021 Dataforward 数据前瞻</span>
<a href="https://beian.miit.gov.cn/#/Integrated/index" <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a>
target="_blank">粤ICP备20072679号</a>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
}; };
}, },
mounted () { mounted(){
}, },
methods: { methods: {
@ -34,31 +33,31 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.footer { .footer{
padding: 17px 0 9px; padding: 17px 0 9px;
text-align: center; text-align: center;
background-color: #0f1d2e; background-color: #0F1D2E;
.info { .info{
margin-bottom: 7px; margin-bottom: 7px;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
color: #d7dfe7; color: #D7DFE7;
} }
.copyright { .copyright{
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
line-height: 17px; line-height: 17px;
span { span{
margin-right: 20px; margin-right: 20px;
color: #757f8a; color: #757F8A;
} }
a { a{
color: #757f8a; color:#757F8A;
font-size: 12px; font-size: 12px;
&:hover { &:hover{
color: #c7c7c7; color: #c7c7c7;
} }
} }
} }
} }
</style> </style>

@ -11,7 +11,7 @@
<el-dropdown class="user-wrap" @command="userCommand"> <el-dropdown class="user-wrap" @command="userCommand">
<div class="user"> <div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar> <el-avatar :size="40" :src="avatar"></el-avatar>
<span class="username">{{ userName }}</span> <span class="username">{{userName}}</span>
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item> <el-dropdown-item command="person" v-if="!isCustomer">个人资料</el-dropdown-item>
@ -29,19 +29,16 @@
</div> </div>
</div> </div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" <el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="closePassword" width="30%">
@close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="82px"> <el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码"> <el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> <el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="新密码"> <el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" <el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
@keyup.enter.native="editPassword"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="确认新密码"> <el-form-item label="确认新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" <el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
@keyup.enter.native="editPassword"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -57,7 +54,7 @@ import { mapState, mapMutations, mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
export default { export default {
data () { data() {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
isLogin: this.$route.path == '/login', isLogin: this.$route.path == '/login',
@ -82,7 +79,7 @@ export default {
'routes' 'routes'
]) ])
}, },
mounted () { mounted() {
// ,store,, // ,store,,
if (this.customer) { if (this.customer) {
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
@ -107,7 +104,7 @@ export default {
'setInfo', 'logout', 'setManager', 'setCustomer' 'setInfo', 'logout', 'setManager', 'setCustomer'
]), ]),
// //
getUserInfo () { getUserInfo() {
this.$get(this.api.userInfo).then(res => { this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo ? res.userInfo : {} let userInfo = res.userInfo ? res.userInfo : {}
let userAccount = res.userAccount let userAccount = res.userAccount
@ -117,12 +114,16 @@ export default {
avatar: userInfo.userAvatars, avatar: userInfo.userAvatars,
userName: userInfo.userName userName: userInfo.userName
}) })
//
userInfo.userName || this.$get(this.api.isClient).then(res => {
res.customerName && this.setInfo({userName: res.customerName})
}).catch(res => {})
}).catch(err => { }) }).catch(err => { })
}, },
hideSetting () { hideSetting() {
this.showSetting = false this.showSetting = false
}, },
toIndex () { toIndex() {
// //
if (this.$route.path === '/index/list') { if (this.$route.path === '/index/list') {
location.reload() location.reload()
@ -131,11 +132,11 @@ export default {
this.showSetting = true this.showSetting = true
} }
}, },
toLogin () { toLogin() {
window.open(this.$router.resolve('/login').href) window.open(this.$router.resolve('/login').href)
}, },
// //
toManager () { toManager() {
let routes = this.routes let routes = this.routes
if (routes.length) { if (routes.length) {
let route = this.$router.resolve({ let route = this.$router.resolve({
@ -153,7 +154,7 @@ export default {
util.warningMsg('该角色未开放模块,请联系管理员') util.warningMsg('该角色未开放模块,请联系管理员')
} }
}, },
userCommand (command) { userCommand(command) {
if (command == 'person') { if (command == 'person') {
this.$router.push('/setting/person').catch(err => { }) this.$router.push('/setting/person').catch(err => { })
} else if (command == 'resetPw') { } else if (command == 'resetPw') {
@ -164,10 +165,10 @@ export default {
this.logout() this.logout()
} }
}, },
showPassword () { showPassword() {
this.passwordVisible = true this.passwordVisible = true
}, },
editPassword () { editPassword() {
if (!this.passwordForm.password) return util.warningMsg('请输入原密码') if (!this.passwordForm.password) return util.warningMsg('请输入原密码')
if (!this.passwordForm.newPassword) return util.warningMsg('请输入新密码') if (!this.passwordForm.newPassword) return util.warningMsg('请输入新密码')
if (!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码') if (!this.passwordForm.reNewPassword) return util.warningMsg('请确认新密码')
@ -182,7 +183,7 @@ export default {
this.passwordVisible = false this.passwordVisible = false
}).catch(err => { }) }).catch(err => { })
}, },
closePassword () { closePassword() {
this.passwordForm = { this.passwordForm = {
password: '', password: '',
newPassword: '', newPassword: '',
@ -194,8 +195,7 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 64px; $height: 64px;
.header{
.header {
z-index: 10; z-index: 10;
position: fixed; position: fixed;
top: 0; top: 0;
@ -204,8 +204,7 @@ $height: 64px;
height: $height; height: $height;
background-color: #fff; background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32); box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner{
.inner {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@ -213,8 +212,7 @@ $height: 64px;
padding: 0 80px 0 10px; padding: 0 80px 0 10px;
margin: 0 auto; margin: 0 auto;
} }
.logo{
.logo {
position: absolute; position: absolute;
top: 0; top: 0;
left: 80px; left: 80px;
@ -224,7 +222,7 @@ $height: 64px;
cursor: pointer; cursor: pointer;
} }
.search { .search{
z-index: 2; z-index: 2;
position: absolute; position: absolute;
top: 0; top: 0;
@ -238,59 +236,42 @@ $height: 64px;
padding: 7px 20px; padding: 7px 20px;
margin: 0 auto; margin: 0 auto;
background-color: #fff; background-color: #fff;
input{
input {
width: 195px; width: 195px;
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
&::-webkit-input-placeholder{color: #999}
&::-webkit-input-placeholder { &::-moz-placeholder{color: #999}
color: #999 &:-moz-placeholder{color: #999}
} &:focus{
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none; outline: none;
} }
} }
.remove{
.remove {
cursor: pointer; cursor: pointer;
} }
.search-icon{
.search-icon {
width: 18px; width: 18px;
} }
} }
.action{
.action {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
.icon{
.icon {
cursor: pointer; cursor: pointer;
} }
.user-wrap { .user-wrap {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
.user { .user{
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
.username{
.username {
margin-left: 10px; margin-left: 10px;
color: #000; color: #000;
font-size: 16px; font-size: 16px;
@ -298,17 +279,14 @@ $height: 64px;
} }
} }
} }
.login{
.login {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
&:hover{
&:hover {
opacity: .9; opacity: .9;
} }
span{
span {
margin-left: 5px; margin-left: 5px;
color: #666; color: #666;
font-size: 14px; font-size: 14px;

@ -21,9 +21,7 @@
<img v-if="item.coverUrl" :src="item.coverUrl" alt="" class="cover"> <img v-if="item.coverUrl" :src="item.coverUrl" alt="" class="cover">
<ul class="detail"> <ul class="detail">
<li v-for="(item, i) in item.logContents" :key="i"> <li v-for="(item, i) in item.logContents" :key="i">
<p class="name"><img <p class="name"><img :src="require('@/assets/img/' + funcList.find(e => e.id === item.type).icon + '.png')" alt=""> {{ funcList.find(e => e.id === item.type).name }}</p>
:src="require('@/assets/img/' + funcList.find(e => e.id === item.type).icon + '.png')" alt=""> {{
funcList.find(e => e.id === item.type).name }}</p>
<div class="val"> <div class="val">
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p> <p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p>
</div> </div>
@ -37,21 +35,6 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="" :visible.sync="realNameVisible" :close-on-click-modal="false" :close-on-press-escape="false"
:show-close="false" width="300px" custom-class="name-dia">
<el-form ref="realNameForm" :model="realNameForm" :rules="realNameRules" label-width="80px">
<el-form-item label="真实姓名" prop="userName">
<el-input v-model.trim="realNameForm.userName" placeholder="请输入真实姓名"></el-input>
</el-form-item>
<el-form-item label="学号" prop="workNumber">
<el-input v-model.trim="realNameForm.workNumber" placeholder="请输入学号"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="realNameSubmit"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -62,7 +45,7 @@ import { mapState, mapMutations, mapActions } from 'vuex'
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
export default { export default {
data () { data() {
return { return {
logVisible: false, logVisible: false,
list: [], list: [],
@ -83,18 +66,7 @@ export default {
name: '优化', name: '优化',
icon: 'optimize' icon: 'optimize'
} }
], ]
realNameVisible: false,
realNameForm: {
userName: '',
workNumber: '',
},
realNameRules: {
userName: [
{ required: true, message: '请输入真实姓名', trigger: 'blur' }
],
},
}; };
}, },
components: { components: {
@ -106,10 +78,9 @@ export default {
'logView' 'logView'
]) ])
}, },
mounted () { mounted() {
this.autoLogout() this.autoLogout()
this.logView || this.getLogStatus() // logViewfalse this.logView || this.getLogStatus() // logViewfalse
this.handleRealName()
}, },
methods: { methods: {
...mapMutations("user", [ ...mapMutations("user", [
@ -118,16 +89,8 @@ export default {
...mapActions('user', [ ...mapActions('user', [
'logout' 'logout'
]), ]),
//
async handleRealName () {
const res = await this.$post(this.api.checkUserNameOrWorkNumber)
//
if (res.hasName) {
this.realNameVisible = true
}
},
// //
getLog () { getLog() {
this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => { this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => {
logList.map((e, i) => { logList.map((e, i) => {
e.logContents.map(n => { e.logContents.map(n => {
@ -135,10 +98,10 @@ export default {
}) })
}) })
this.list = logList this.list = logList
}).catch(res => { }) }).catch(res => {})
}, },
// //
getLogStatus () { getLogStatus() {
util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, { util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, {
platformId: Setting.platformId platformId: Setting.platformId
}).then(({ notification }) => { }).then(({ notification }) => {
@ -147,10 +110,10 @@ export default {
this.logVisible = true // true this.logVisible = true // true
this.getLog() this.getLog()
} }
}).catch(res => { }) }).catch(res => {})
}, },
// ,退 // ,退
autoLogout () { autoLogout() {
let lastTime = new Date().getTime() let lastTime = new Date().getTime()
document.onmousedown = () => { document.onmousedown = () => {
lastTime = new Date().getTime() lastTime = new Date().getTime()
@ -163,31 +126,17 @@ export default {
setTimeout(this.logout, 1500) setTimeout(this.logout, 1500)
} }
}, 1000) }, 1000)
},
//
realNameSubmit () {
this.$refs.realNameForm.validate(async (valid) => {
if (valid) {
const form = this.realNameForm
await this.$post(`${this.api.updateUserNameOrWorkNumber}?userName=${form.userName}&workNumber=${form.workNumber}`)
this.realNameVisible = false
} else {
return false
} }
})
},
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main { .main{
min-height: calc(100% - 64px); min-height: calc(100% - 64px);
.layout{
.layout {
padding-top: 64px; padding-top: 64px;
} }
.view{
.view {
min-width: $min-width; min-width: $min-width;
min-height: calc(100vh - 134px); min-height: calc(100vh - 134px);
padding: 12px 80px 0; padding: 12px 80px 0;
@ -199,12 +148,10 @@ export default {
url(../../assets/img/shapes/shape9.png) right 645px no-repeat, url(../../assets/img/shapes/shape9.png) right 645px no-repeat,
url(../../assets/img/shapes/shape6.png) 0 1074px no-repeat; url(../../assets/img/shapes/shape6.png) 0 1074px no-repeat;
} }
.index{
.index {
padding: 0; padding: 0;
} }
} }
.log-mask { .log-mask {
position: fixed; position: fixed;
top: 0; top: 0;
@ -213,7 +160,6 @@ export default {
right: 0; right: 0;
background-color: rgba(0, 0, 0, .4); background-color: rgba(0, 0, 0, .4);
} }
/deep/.log-dia { /deep/.log-dia {
z-index: 11; z-index: 11;
position: absolute; position: absolute;
@ -223,12 +169,10 @@ export default {
transform: translateX(-50%); transform: translateX(-50%);
background-color: #fff; background-color: #fff;
border-radius: 6px; border-radius: 6px;
.bg1 { .bg1 {
width: 100%; width: 100%;
height: 140px; height: 140px;
} }
.bg2 { .bg2 {
position: absolute; position: absolute;
top: -130px; top: -130px;
@ -236,7 +180,6 @@ export default {
max-width: 100%; max-width: 100%;
height: 250px; height: 250px;
} }
.log-title { .log-title {
position: absolute; position: absolute;
top: 65px; top: 65px;
@ -247,64 +190,53 @@ export default {
color: #fff; color: #fff;
font-weight: 600; font-weight: 600;
} }
.log-wrap { .log-wrap {
padding-bottom: 30px; padding-bottom: 30px;
} }
.logs { .logs {
max-height: 250px; max-height: 250px;
padding: 0 100px; padding: 0 100px;
margin: 30px 0; margin: 30px 0;
overflow: auto; overflow: auto;
} }
h6 { h6 {
margin-bottom: 15px; margin-bottom: 15px;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
line-height: 1; line-height: 1;
} }
.more-wrap { .more-wrap {
padding: 0 60px; padding: 0 60px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
text-align: center; text-align: center;
} }
.know { .know {
margin-top: 15px; margin-top: 15px;
} }
.cover { .cover {
max-width: 250px; max-width: 250px;
max-height: 160px; max-height: 160px;
margin: 10px 0 20px; margin: 10px 0 20px;
} }
.detail { .detail {
li { li {
margin-bottom: 20px; margin-bottom: 20px;
} }
.name { .name {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 5px; margin-bottom: 5px;
font-size: 14px; font-size: 14px;
img { img {
width: 20px; width: 20px;
margin-right: 8px; margin-right: 8px;
} }
} }
.val { .val {
font-size: 15px; font-size: 15px;
line-height: 1.8; line-height: 1.8;
white-space: pre-wrap; white-space: pre-wrap;
p { p {
position: relative; position: relative;
font-size: 13px; font-size: 13px;
@ -313,14 +245,4 @@ export default {
} }
} }
} }
/deep/.name-dia {
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding-bottom: 10px;
}
}
</style> </style>

@ -121,15 +121,15 @@ const util = {
}, },
// 成功提示 // 成功提示
successMsg(message,duration = 1500) { successMsg(message,duration = 1500) {
return Message.success({message,showClose: true,duration}) return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
}, },
// 警告提示 // 警告提示
warningMsg(message,duration = 1500) { warningMsg(message,duration = 1500) {
return Message.warning({message,showClose: true,duration}) return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
}, },
// 错误提示 // 错误提示
errorMsg(message,duration = 1500) { errorMsg(message,duration = 1500) {
return Message.error({message,showClose: true,duration}) return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
}, },
} }

@ -4,15 +4,20 @@
<div class="form"> <div class="form">
<h6 class="title">欢迎使用请登录</h6> <h6 class="title">欢迎使用请登录</h6>
<ul class="tab"> <ul class="tab">
<li v-for="(item, index) in tabList" :key="index" :class="{ active: form.distinguish == item.id }" <li v-for="(item,index) in tabList" :key="index" :class="{active: form.distinguish == item.id}" @click="typeClick(item)">{{item.label}}</li>
@click="typeClick(item)">{{ item.label }}</li>
</ul> </ul>
<el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px"> <el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px">
<!-- 学号工号 --> <!-- 学号工号 -->
<div v-show="!form.distinguish && !verCodeLogin" class="items"> <div v-show="!form.distinguish">
<el-form-item class="school-select" prop="schoolId">
<label class="label school"></label>
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校">
<el-option v-for="(item, i) in schoolList" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item class="flex-1" prop="workNumber"> <el-form-item class="flex-1" prop="workNumber">
<label class="label account"></label> <label class="label account"></label>
<el-input v-model.trim="form.workNumber" placeholder="请输入学号/工号" @keyup.enter.native="submit"></el-input> <el-input v-model.trim="form.workNumber" :placeholder="'请输入学号/工号'" @keyup.enter.native="submit"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<!-- 手机号登录 --> <!-- 手机号登录 -->
@ -20,7 +25,7 @@
<label class="label account"></label> <label class="label account"></label>
<el-input v-model.trim="form.account" placeholder="请输入账号" @keyup.enter.native="submit"></el-input> <el-input v-model.trim="form.account" placeholder="请输入账号" @keyup.enter.native="submit"></el-input>
</el-form-item> </el-form-item>
<template v-if="verCodeLogin"> <template v-if="form.distinguish === 2">
<el-form-item prop="account"> <el-form-item prop="account">
<label class="label account"></label> <label class="label account"></label>
<el-input v-model.trim="form.account" placeholder="请输入手机号/邮箱" @keyup.enter.native="submit"></el-input> <el-input v-model.trim="form.account" placeholder="请输入手机号/邮箱" @keyup.enter.native="submit"></el-input>
@ -28,30 +33,36 @@
<el-form-item prop="code"> <el-form-item prop="code">
<label class="label code"></label> <label class="label code"></label>
<div class="ver-code"> <div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" <el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input>
@keyup.enter.native="submit"></el-input> <el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin
}}
</el-button> </el-button>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
<template v-else> <template v-if="form.distinguish !== 2">
<el-form-item prop="password"> <el-form-item prop="password">
<label class="password label"></label> <label class="password label"></label>
<el-input type="password" placeholder="请输入密码" v-model.trim="form.password" @keyup.enter.native="submit"> <el-input
type="password"
placeholder="请输入密码"
v-model.trim="form.password"
@keyup.enter.native="submit"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<label class="label code"></label> <label class="label code"></label>
<el-input placeholder="请输入验证码" v-model.trim="form.code" @keyup.enter.native="submit"> <el-input
placeholder="请输入验证码"
v-model.trim="form.code"
@keyup.enter.native="submit"
>
</el-input> </el-input>
<img @click="getVerImg" :src="verificationIMG" class="ver-img" alt=""> <img @click="getVerImg" :src="verificationIMG" class="ver-img" alt="">
</el-form-item> </el-form-item>
</template> </template>
<div class="bottom"> <div v-show="!form.distinguish" class="default-check">
<el-link :underline="false" type="primary" @click="switchType">{{ verCodeLogin ? '密码' : '验证码' }}登录</el-link> <el-checkbox v-model="setDefault">设置为默认学校</el-checkbox>
<!-- <el-link :underline="false" type="primary" @click="toAccount">没有账号点击申请</el-link> -->
</div> </div>
<el-button class="submit" type="primary" @click="submit">登录</el-button> <el-button class="submit" type="primary" @click="submit">登录</el-button>
</el-form> </el-form>
@ -67,9 +78,7 @@
<el-form-item label="验证码"> <el-form-item label="验证码">
<div class="ver-code"> <div class="ver-code">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" <el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button>
:disabled="binding === '' || phoneDisabled">{{
phoneBtnText }}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -78,18 +87,16 @@
<el-button size="small" type="primary" @click="phoneSubmit"> </el-button> <el-button size="small" type="primary" @click="phoneSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" <el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" width="500px">
width="500px">
<p class="tips">该手机号已绑定以下用户信息</p> <p class="tips">该手机号已绑定以下用户信息</p>
<ul class="users"> <ul class="users">
<li :class="{ isEnable: !user.isEnable }" v-for="(user, i) in users" :key="i" @click="chooseUser(user)"> <li :class="{isEnable: !user.isEnable}" v-for="(user, i) in users" :key="i" @click="chooseUser(user)">
<span>{{ user.schoolName }}{{ user.userName }}{{ user.workNumber }}{{ user.isEnable ? '' : '(已禁用)' }}</span> <span>{{ user.schoolName }}{{ user.userName }}{{ user.workNumber }}{{ user.isEnable ? '' : '(已禁用)'}}</span>
<i class="el-icon-right"></i> <i class="el-icon-right"></i>
</li> </li>
</ul> </ul>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" :show-close="false" custom-class="info-dia" <el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" :show-close="false" custom-class="info-dia" width="400px">
width="400px">
<div class="info-header"> <div class="info-header">
<i class="el-icon-warning"></i> <i class="el-icon-warning"></i>
提示 提示
@ -124,35 +131,41 @@ import util from '@/libs/util'
import Setting from '@/setting' import Setting from '@/setting'
import vFooter from '@/layouts/footer' import vFooter from '@/layouts/footer'
export default { export default {
data: function () { data: function() {
return { return {
tabList: [ tabList: [
{ {
id: 0, id: 0,
label: '学生/老师登录' label: '学号/工号登录'
}, { }, {
id: 1, id: 1,
label: '学校管理员登录' label: '学校管理员登录'
}, {
id: 2,
label: '手机号/邮箱'
} }
], ],
setDefault: !!util.local.get(schoolIdKey), // id
verificationIMG: '', verificationIMG: '',
schoolList: [], schoolList: [],
form: { form: {
schoolId: '',
workNumber: '', workNumber: '',
account: '', // account: '',
password: '', password: '',
code: '', // code: '', //
random: '', // random: '', //
platform: Setting.platformId, distinguish: 0, // ,1,2
distinguish: 0, type: 2, // 0-> 1-> 2->
platform: Setting.platformId
}, },
rules: { rules: {
workNumber: [{ required: true, message: "请输入学号/工号/手机号/邮箱", trigger: "blur" }], schoolId: [{ required: true, message: "请选择学校", trigger: "change" }],
workNumber: [{ required: true, message: "请输入学生学号", trigger: "blur" }],
account: [{ required: false, message: "请输入账号", trigger: "blur" }], account: [{ required: false, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }], password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }] code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
}, },
verCodeLogin: false,
phoneDisabledLogin: false, phoneDisabledLogin: false,
phoneTimerLogin: null, phoneTimerLogin: null,
phoneBtnTextLogin: '发送验证码', phoneBtnTextLogin: '发送验证码',
@ -173,8 +186,9 @@ export default {
infos: [] infos: []
}; };
}, },
components: { vHead, vFooter }, components: {vHead,vFooter},
mounted () { mounted(){
this.getSchool()
this.getVerImg() this.getVerImg()
}, },
methods: { methods: {
@ -184,20 +198,30 @@ export default {
...mapActions('user', [ ...mapActions('user', [
'login', 'setCustomer' 'login', 'setCustomer'
]), ]),
// // id
handleRule () { setSchool(list) {
const type = this.form.distinguish this.schoolList = list
const rules = this.rules // id
rules.workNumber[0].required = !type && !this.verCodeLogin const schoolId = util.local.get(schoolIdKey)
rules.account[0].required = (!type && this.verCodeLogin) || type if (schoolId) this.form.schoolId = schoolId
this.rules.account[0].message = type ? },
'请输入账号' : //
this.verCodeLogin ? getSchool() {
'请输入手机号/邮箱' : const schoolList = util.local.get('schoolList')
'请输入学号/工号/手机号/邮箱' if (schoolList && schoolList.length) {
this.setSchool(schoolList)
} else {
this.$get(this.api.querySchool, {
provinceId: '',
cityId: ''
}).then(({ list }) => {
this.setSchool(list)
util.local.set('schoolList', list)
}).catch(res => {})
}
}, },
// //
typeClick (tab) { typeClick(tab) {
const { id } = tab const { id } = tab
const form = this.form const form = this.form
// //
@ -213,17 +237,24 @@ export default {
platform: form.platform platform: form.platform
} }
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
this.handleRule() //
const rules = this.rules
rules.schoolId[0].required = id === 0
rules.workNumber[0].required = id === 0
rules.account[0].required = !!id
this.rules.account[0].message = id === 1 ?
'请输入账号' :
'请输入手机号/邮箱'
}, },
// //
chooseUser (user) { chooseUser(user) {
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => {
this.token = data.token this.token = data.token
this.setLogin() this.setLogin()
}).catch(res => { }) }).catch(res => {})
}, },
// //
setLogin () { setLogin() {
util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires) util.local.set(Setting.tokenKey, this.token, Setting.tokenExpires)
// //
this.$get(this.api.isClient).then(res => { this.$get(this.api.isClient).then(res => {
@ -234,24 +265,28 @@ export default {
userName userName
}) })
window.opener && window.opener.location.reload() // window.opener && window.opener.location.reload() //
util.local.set(Setting.storeKey, this.$store.state) util.local.set(Setting.storeKey,this.$store.state)
}).catch(res => { }) }).catch(res => {})
// schoolId // schoolId
this.$post(this.api.getSchoolIdByToken).then(res => { this.$post(this.api.getSchoolIdByToken).then(res => {
this.SET_INFO(res) this.SET_INFO(res)
}).catch(res => { }) }).catch(res => {})
// +1 // +1
this.$post(this.api.saveRecord, { this.$post(this.api.saveRecord,{
type: 3, type: 3,
}).then(res => { }).catch(res => { }) }).then(res => {}).catch(res => {})
util.successMsg('登录成功') util.successMsg('登录成功')
this.$router.replace('/index') this.$router.replace('/index')
}, },
submit () { submit() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
if (this.verCodeLogin) form.distinguish = 2 const { distinguish } = form
if (!form.distinguish && this.setDefault) util.local.set(schoolIdKey, form.schoolId) //
if (util.local.get(schoolIdKey) && !this.setDefault) util.local.remove(schoolIdKey) // id
if (distinguish) form.schoolId = ''
if (!distinguish) form.distinguish = 1
this.$post(this.api.logins, form).then(({ status, data, message }) => { this.$post(this.api.logins, form).then(({ status, data, message }) => {
// //
if (status == 30001) { if (status == 30001) {
@ -259,57 +294,46 @@ export default {
this.getVerImg() this.getVerImg()
form.code = '' form.code = ''
} else if (status == 200) { } else if (status == 200) {
const accounts = data.userAccounts
// //
if (accounts instanceof Array) { if (data instanceof Array) {
this.users = accounts //
if (data.length === 1) {
this.chooseUser(data[0])
} else {
this.users = data
this.userVisible = true this.userVisible = true
}
} else { } else {
this.token = data.token this.token = data.token
this.setLogin() this.setLogin()
} }
} else { } else {
form.code = ''
util.errorMsg(message) util.errorMsg(message)
} }
}).catch(res => { }).catch(res => {})
this.getVerImg()
form.code = ''
})
} }
}) })
}, },
getVerImg () { getVerImg(){
this.form.random = Math.floor(Math.random() * 999999999) this.form.random = Math.floor(Math.random()*999999999)
this.verificationIMG = this.api.verification + '?random=' + `${this.form.random}` this.verificationIMG = this.api.verification+'?random='+`${this.form.random}`
}, },
// //
verifyPhone (phone) { verifyPhone(phone) {
if (!phone) { if (!phone) {
this.$message.error("请输入手机号") util.warningMsg("请输入手机号")
return false return false
} }
if (!/^1[3456789]\d{9}$/.test(phone) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(phone)) { if (!/^1[3456789]\d{9}$/.test(phone) && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(phone)) {
this.$message.error("请输入正确的手机号/邮箱") util.warningMsg("请输入正确的手机号/邮箱")
return false return false
} }
return true return true
}, },
//
switchType () {
this.verCodeLogin = !this.verCodeLogin
this.$refs.form.clearValidate()
this.handleRule()
},
//
toAccount () {
this.accountVisible = true
},
// //
phoneCountdownLogin () { phoneCountdownLogin() {
let count = 60 let count = 60
if (!this.phoneTimerLogin) { if (!this.phoneTimerLogin) {
this.phoneDisabledLogin = true this.phoneDisabledLogin = true
@ -327,28 +351,28 @@ export default {
} }
}, },
// //
sendPhoneCodeLogin () { sendPhoneCodeLogin() {
const phone = this.form.account const phone = this.form.account
if (!this.verifyPhone(phone)) return false if (!this.verifyPhone(phone)) return false
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => { this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=0&platform=${Setting.platformId}`).then(({ message }) => {
util.successMsg(message) util.successMsg(message)
this.phoneCountdownLogin() this.phoneCountdownLogin()
}).catch(res => { }) }).catch(res => {})
}, },
// //
bindPhone () { bindPhone() {
this.infoVisible = false this.infoVisible = false
this.binding = true this.binding = true
this.sendPhoneCode(1) this.sendPhoneCode(1)
}, },
// //
unbindPhone () { unbindPhone() {
this.infoVisible = false this.infoVisible = false
this.binding = false this.binding = false
this.sendPhoneCode(0) this.sendPhoneCode(0)
}, },
// //
phoneChange () { phoneChange() {
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => { this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => {
const list = userAccounts const list = userAccounts
if (list) { if (list) {
@ -362,29 +386,29 @@ export default {
} else { } else {
this.binding = true this.binding = true
} }
}).catch(res => { }) }).catch(res => {})
}, },
phoneCountdown () { phoneCountdown(){
let count = 60 let count = 60
if (!this.phoneTimer) { if(!this.phoneTimer){
this.phoneDisabled = true this.phoneDisabled = true
this.phoneTimer = setInterval(() => { this.phoneTimer = setInterval(() => {
console.log('倒计时中') console.log('倒计时中')
if (count > 0) { if(count > 0){
count-- count--
this.phoneBtnText = `${count}秒后重试` this.phoneBtnText = `${count}秒后重试`
} else { }else{
this.phoneDisabled = false this.phoneDisabled = false
clearInterval(this.phoneTimer) clearInterval(this.phoneTimer)
this.phoneTimer = null this.phoneTimer = null
this.phoneBtnText = `发送验证码` this.phoneBtnText = `发送验证码`
} }
}, 1000) },1000)
} }
}, },
// //
sendPhoneCode (bind) { sendPhoneCode(bind) {
const { phone } = this const { phone } = this
if (!this.verifyPhone(phone)) return false if (!this.verifyPhone(phone)) return false
// //
@ -400,16 +424,16 @@ export default {
} else { } else {
util.errorMsg(message) util.errorMsg(message)
} }
}).catch(res => { }) }).catch(res => {})
} else { } else {
this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1&platform=${Setting.platformId}`).then(({ message }) => { this.$post(`${this.api.sendPhoneVerificationCode}?phoneOrEmail=${phone}&loginOrBind=1&platform=${Setting.platformId}`).then(({ message }) => {
util.successMsg(message) util.successMsg(message)
this.phoneCountdown() this.phoneCountdown()
}).catch(res => { }) }).catch(res => {})
} }
}, },
// //
unbind () { unbind() {
const { password, platform, schoolId, type, workNumber } = this.form const { password, platform, schoolId, type, workNumber } = this.form
this.$post(this.api.unbindAccounts, { this.$post(this.api.unbindAccounts, {
accountIds: this.accountIds, accountIds: this.accountIds,
@ -423,17 +447,16 @@ export default {
}).then(({ data }) => { }).then(({ data }) => {
this.token = data.token this.token = data.token
this.setLogin() this.setLogin()
}).catch(res => { }) }).catch(res => {})
}, },
// //
phoneSubmit () { phoneSubmit() {
const { phone, phoneCode } = this const { phone, phoneCode } = this
if (!this.verifyPhone(phone)) return false if (!this.verifyPhone(phone)) return false
if (!phoneCode) return util.warningMsg('请输入验证码') if (!phoneCode) return util.warningMsg('请输入验证码')
const { workNumber, schoolId } = this.form const { workNumber, schoolId } = this.form
if (this.binding) { if (this.binding) {
this.$post(this.api.bindPhoneOrEmail, { this.$post(this.api.bindPhoneOrEmail, {
mark: 2,
phone, phone,
types: 2, types: 2,
code: phoneCode, code: phoneCode,
@ -444,7 +467,7 @@ export default {
}).then(({ token }) => { }).then(({ token }) => {
this.token = token this.token = token
this.setLogin() this.setLogin()
}).catch(res => { }) }).catch(res => {})
} else { } else {
this.unbind() this.unbind()
} }
@ -456,99 +479,82 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.wrap { .wrap {
min-height: 100%; min-height: 100%;
background-color: #f3f6fa; background-color: #F3F6FA;
} }
.ver-code { .ver-code {
position: relative; position: relative;
.el-button { .el-button {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
} }
} }
.login{
.login {
min-height: calc(100vh - 70px); min-height: calc(100vh - 70px);
padding-top: calc((100vh - 611px) / 2); padding-top: calc((100vh - 611px) / 2);
background: url(../../../assets/img/shapes/shape1.png) (0 123px) / auto no-repeat, background: url(../../../assets/img/shapes/shape1.png) (0 123px)/auto no-repeat,
url(../../../assets/img/shapes/shape2.png) (35px 238px) / auto no-repeat, url(../../../assets/img/shapes/shape2.png) (35px 238px)/auto no-repeat,
url(../../../assets/img/shapes/shape3.png) (0 485px) / auto no-repeat, url(../../../assets/img/shapes/shape3.png) (0 485px)/auto no-repeat,
url(../../../assets/img/shapes/shape4.png) (right 50%) / auto no-repeat, url(../../../assets/img/shapes/shape4.png) (right 50%)/auto no-repeat,
url(../../../assets/img/shapes/shape5.png) (right 80%) / auto no-repeat, url(../../../assets/img/shapes/shape5.png) (right 80%)/auto no-repeat,
url(../../../assets/img/shapes/shape6.png) (right bottom) / auto no-repeat; url(../../../assets/img/shapes/shape6.png) (right bottom)/auto no-repeat;
.tab{
.tab {
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 24px; margin-bottom: 24px;
border-bottom: 2px solid #e1e6f2; border-bottom: 2px solid #E1E6F2;
li{
li {
padding: 18px 0; padding: 18px 0;
margin-bottom: -1px; margin-bottom: -1px;
font-size: 16px; font-size: 16px;
color: #555; color: #555;
cursor: pointer; cursor: pointer;
border-bottom: 4px solid transparent; border-bottom: 4px solid transparent;
&:last-child{
&:last-child {
margin-right: 0; margin-right: 0;
} }
&.active{
&.active { color: $main-color;;
color: $main-color;
border-bottom-color: $main-color; border-bottom-color: $main-color;
} }
} }
} }
.items { .items {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.form{
.form {
width: 436px; width: 436px;
padding: 38px 38px 60px; padding: 38px 38px 60px;
margin: 0 auto 0; margin: 0 auto 0;
border-radius: 6px; border-radius: 6px;
background-color: #fff; background-color: #fff;
.title{
.title {
margin-bottom: 25px; margin-bottom: 25px;
font-size: 26px; font-size: 26px;
color: #0b1d30; color: #0B1D30;
letter-spacing: 4px; letter-spacing: 4px;
} }
} }
/deep/.el-form-item{
/deep/.el-form-item {
margin-bottom: 20px; margin-bottom: 20px;
} }
/deep/.el-input__inner{
/deep/.el-input__inner {
position: relative; position: relative;
height: 52px; height: 52px;
padding: 0 20px 0 34px; padding: 0 20px 0 34px;
line-height: 50px; line-height: 50px;
background-color: #fbfbfb; background-color: #FBFBFB;
border: 1px solid #e1e6f2; border: 1px solid #E1E6F2;
border-radius: 4px !important; border-radius: 4px !important;
} }
.default-check {
.bottom { text-align: right;
display: flex;
justify-content: space-between;
} }
.el-select { .el-select {
width: 100%; width: 100%;
} }
.label { .label {
z-index: 1; z-index: 1;
position: absolute; position: absolute;
@ -558,40 +564,33 @@ export default {
height: 18px; height: 18px;
background: url(../../../assets/img/login/account.png) 0 0/100% 100% no-repeat; background: url(../../../assets/img/login/account.png) 0 0/100% 100% no-repeat;
} }
.school{
.school {
background-image: url(../../../assets/img/login/school.png); background-image: url(../../../assets/img/login/school.png);
} }
.workNumber{
.workNumber {
width: 17px; width: 17px;
background-image: url(../../../assets/img/login/workNumber.png); background-image: url(../../../assets/img/login/workNumber.png);
} }
.password{
.password {
top: 18px; top: 18px;
background-image: url(../../../assets/img/login/password.png); background-image: url(../../../assets/img/login/password.png);
} }
.code{
.code {
top: 18px; top: 18px;
background-image: url(../../../assets/img/login/code.png); background-image: url(../../../assets/img/login/code.png);
} }
.ver-img{
.ver-img {
position: absolute; position: absolute;
top: 1px; top: 1px;
right: 1px; right: 1px;
} }
/deep/.el-form-item__error{
/deep/.el-form-item__error {
top: 105%; top: 105%;
left: auto; left: auto;
right: 0; right: 0;
color: #ffa94e; color: #FFA94E;
} }
.submit{
.submit {
width: 100%; width: 100%;
height: 48px; height: 48px;
margin-top: 30px; margin-top: 30px;
@ -603,37 +602,31 @@ export default {
border: 0; border: 0;
} }
} }
.copyright{
.copyright {
padding: 18px 0; padding: 18px 0;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
background-color: #f3f6fa; background-color: #F3F6FA;
a{
a { color:#B1B4B8;
color: #b1b4b8;
font-size: 12px; font-size: 12px;
&:hover{
&:hover { opacity: .8;
opacity: 0.8;
} }
} }
} }
.tips { .tips {
margin: 0 0 10px 5px; margin: 0 0 10px 5px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
color: #666; color: #666;
} }
/deep/.user-dia { /deep/.user-dia {
.tips { .tips {
margin-bottom: 20px; margin-bottom: 20px;
text-align: center; text-align: center;
color: #666; color: #666;
} }
.users { .users {
li { li {
display: flex; display: flex;
@ -645,33 +638,27 @@ export default {
font-size: 14px; font-size: 14px;
background-color: #ebeef5; background-color: #ebeef5;
cursor: pointer; cursor: pointer;
&.isEnable { &.isEnable {
color: #c0c4cc; color: #c0c4cc;
background-color: #f5f7fa; background-color: #f5f7fa;
cursor: not-allowed; cursor: not-allowed;
} }
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
&:hover { &:hover {
background-color: #d3e0ff; background-color: #d3e0ff;
} }
i { i {
font-size: 16px; font-size: 16px;
} }
} }
} }
} }
/deep/.info-dia { /deep/.info-dia {
.el-dialog__header { .el-dialog__header {
border-bottom: 0; border-bottom: 0;
} }
.info-header { .info-header {
position: absolute; position: absolute;
top: 20px; top: 20px;
@ -680,46 +667,38 @@ export default {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.el-icon-warning { .el-icon-warning {
margin-right: 10px; margin-right: 10px;
color: #e6a23c; color: #e6a23c;
font-size: 24px; font-size: 24px;
} }
.info-wrap { .info-wrap {
padding: 10px 33px; padding: 10px 33px;
} }
.users { .users {
max-height: 125px; max-height: 125px;
margin-top: 20px; margin-top: 20px;
overflow: auto; overflow: auto;
li { li {
margin: 5px; margin: 5px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
} }
} }
.info-footer { .info-footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
// align-items: center; // align-items: center;
margin-top: 20px; margin-top: 20px;
} }
.el-button { .el-button {
width: 142px; width: 142px;
} }
.unbind { .unbind {
white-space: normal; white-space: normal;
line-height: 1.6; line-height: 1.6;
} }
} }
@media (max-height: 680px) { @media (max-height: 680px) {
.wrap .login { .wrap .login {
padding: 40px 0; padding: 40px 0;

@ -1,8 +1,7 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="left"> <div class="left">
<el-menu class="menu" ref="type" @open="selectType" @select="selectType" unique-opened <el-menu class="menu" ref="type" @open="selectType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType">
:default-active="defaultType" :default-openeds="defaultOpenType">
<menuTree :menuList="typeList"></menuTree> <menuTree :menuList="typeList"></menuTree>
</el-menu> </el-menu>
</div> </div>
@ -15,23 +14,21 @@
<img src="../../../assets/img/search-gray.png" alt="" class="search-icon"> <img src="../../../assets/img/search-gray.png" alt="" class="search-icon">
</div> </div>
</div> </div>
<div class="desc">{{ introduce }}</div> <div class="desc">{{introduce}}</div>
<div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{ dataSource }}</div> <div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{dataSource}}</div>
<div class="page-content"> <div class="page-content">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" <el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange">
highlight-current-row @current-change="previewCurrentChange"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column prop="showName" label="数据表名称" min-width="300" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="showName" label="数据表名称" min-width="220" align="center"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止时间" width="175" align="center"></el-table-column> <el-table-column prop="timeRange" label="起止时间" width="220" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="90" align="center"> <el-table-column prop="dataSize" label="数据大小" width="90" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.dataSize }}M {{scope.row.dataSize}}M
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="155" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" width="170" align="center"></el-table-column>
<el-table-column label="操作" width="100" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button> <el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button>
<el-button type="text" @click="download(scope.row)" v-auth>下载</el-button> <el-button type="text" @click="download(scope.row)" v-auth>下载</el-button>
@ -39,38 +36,31 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" <el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload" <el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload" :close-on-click-modal="false">
:close-on-click-modal="false">
<el-form ref="form" label-width="100px" label-suffix=""> <el-form ref="form" label-width="100px" label-suffix="">
<el-form-item label="数据筛选"> <el-form-item label="数据筛选">
<div class="checkboxs"> <div class="checkboxs">
<el-checkbox v-model="checkAllFields" @change="checkAllFieldsChange">全选</el-checkbox> <el-checkbox v-model="checkAllFields" @change="checkAllFieldsChange">全选</el-checkbox>
<el-checkbox-group v-model="fields"> <el-checkbox-group v-model="fields">
<el-checkbox v-for="(item, index) in fieldsList" :key="index" :label="item.comment"></el-checkbox> <el-checkbox v-for="(item,index) in fieldsList" :key="index" :label="item.comment"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="开始时间"> <el-form-item label="开始时间">
<el-date-picker v-model="startTime" type="date" placeholder="请选择开始时间" size="small" format="yyyy-MM-dd" <el-date-picker v-model="startTime" type="date" placeholder="请选择开始时间" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="timeOptions" :disabled="startTimeDisabled" :default-value="startTimeDefault" @change="timeChange"></el-date-picker>
value-format="yyyy-MM-dd" :picker-options="timeOptions" :disabled="startTimeDisabled"
:default-value="startTimeDefault" @change="timeChange"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="结束时间"> <el-form-item label="结束时间">
<el-date-picker v-model="endTime" type="date" placeholder="请选择结束时间" size="small" format="yyyy-MM-dd" <el-date-picker v-model="endTime" type="date" placeholder="请选择结束时间" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="timeOptions" :disabled="endTimeDisabled" :default-value="endTimeDefault" @change="timeChange"></el-date-picker>
value-format="yyyy-MM-dd" :picker-options="timeOptions" :disabled="endTimeDisabled"
:default-value="endTimeDefault" @change="timeChange"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="数据频率"> <el-form-item label="数据频率">
<el-select v-model="frequency" placeholder="请选择数据频率" size="small"> <el-select v-model="frequency" placeholder="请选择数据频率" size="small">
<el-option v-for="(item, index) in frequencyList" :key="index" :label="item.name" <el-option v-for="(item,index) in frequencyList" :key="index" :label="item.name" :value="item.id"></el-option>
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -81,7 +71,11 @@
</span> </span>
</el-dialog> </el-dialog>
<el-drawer custom-class="preview-dia" size="950px" :with-header="false" :visible.sync="previewVisible"> <el-drawer
custom-class="preview-dia"
size="950px"
:with-header="false"
:visible.sync="previewVisible">
<div class="flex j-between"> <div class="flex j-between">
<div class="l-title" style="margin-bottom: 0"> <div class="l-title" style="margin-bottom: 0">
<img src="@/assets/img/data3.png" alt=""> <img src="@/assets/img/data3.png" alt="">
@ -92,8 +86,7 @@
<div class="preview-wrap"> <div class="preview-wrap">
<el-table :data="previewData" class="table" id="previewTable" stripe header-align="center" row-key="id"> <el-table :data="previewData" class="table" id="previewTable" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column v-for="(item, index) in previewHead" :prop="item.field" :key="index" :label="item.comment" <el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column>
align="center"></el-table-column>
</el-table> </el-table>
</div> </div>
</el-drawer> </el-drawer>
@ -112,7 +105,7 @@ export default {
components: { components: {
menuTree menuTree
}, },
data () { data() {
return { return {
that: this, that: this,
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
@ -147,7 +140,7 @@ export default {
startTimeDefault: '', startTimeDefault: '',
endTimeDefault: '', endTimeDefault: '',
timeOptions: { timeOptions: {
disabledDate (time) { disabledDate(time) {
return time.getTime() < startTimeLimit || time.getTime() > endTimeLimit return time.getTime() < startTimeLimit || time.getTime() > endTimeLimit
}, },
}, },
@ -180,7 +173,7 @@ export default {
]), ]),
}, },
watch: { watch: {
keyword: function (val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
if (!this.rendered) { if (!this.rendered) {
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
@ -190,7 +183,7 @@ export default {
this.rendered = false this.rendered = false
}, },
}, },
mounted () { mounted() {
this.getType() this.getType()
// , // ,
if (this.$route.query.download) { if (this.$route.query.download) {
@ -202,7 +195,7 @@ export default {
} }
}, },
methods: { methods: {
getType () { getType() {
// //
this.$post(this.api.getTableByClassification).then(res => { this.$post(this.api.getTableByClassification).then(res => {
let typeId = this.typeId // id let typeId = this.typeId // id
@ -211,7 +204,7 @@ export default {
let action let action
let isFirst = true // let isFirst = true //
// //
function actionId (arr) {//res function actionId(arr) {//res
arr && arr.map((e, i) => { arr && arr.map((e, i) => {
e.id = String(e.id) e.id = String(e.id)
if (!i && isFirst) { if (!i && isFirst) {
@ -244,7 +237,7 @@ export default {
this.getData() this.getData()
}).catch(res => { }) }).catch(res => { })
}, },
getData () { getData() {
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => { this.$post(`${this.api.getIdQueryTable}?categoryId=${this.defaultType}&showName=${this.keyword}&pageNum=${this.page}&pageSize=${this.pageSize}&updateTime=`).then(res => {
const list = res.pageList.records const list = res.pageList.records
list.map(e => { list.map(e => {
@ -269,26 +262,26 @@ export default {
}) })
this.$router.replace('list') this.$router.replace('list')
} }
}).catch(res => { }) }).catch(res => {})
}, },
initData () { initData() {
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.page = val this.page = val
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.getData() this.getData()
}, },
// //
selectType (index, indexPath) { selectType(index, indexPath) {
let introduce = '' let introduce = ''
let dataSource = '' let dataSource = ''
this.keyword = '' this.keyword = ''
let list = this.typeList let list = this.typeList
let select = '' let select = ''
// id // id
function getDeepest (data) { function getDeepest(data) {
if (data[0].children && data[0].children.length) { if (data[0].children && data[0].children.length) {
getDeepest(data[0].children) getDeepest(data[0].children)
} else { } else {
@ -297,7 +290,7 @@ export default {
if (data[0].dataSource) dataSource = data[0].dataSource if (data[0].dataSource) dataSource = data[0].dataSource
} }
} }
function handleData (data) { function handleData(data) {
data.map((n, i) => { data.map((n, i) => {
// //
if (n.id == index) { if (n.id == index) {
@ -324,10 +317,10 @@ export default {
this.previewData = [] this.previewData = []
this.initData() this.initData()
}, },
previewCurrentChange (val) { previewCurrentChange(val) {
this.currentRow = val this.currentRow = val
}, },
preview (row) { preview(row) {
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
// +1 // +1
this.$post(this.api.saveRecord, { this.$post(this.api.saveRecord, {
@ -354,11 +347,11 @@ export default {
this.previewVisible = true this.previewVisible = true
}).catch(res => { }) }).catch(res => { })
}, },
checkAllFieldsChange (val) { checkAllFieldsChange(val) {
this.fields = val ? this.fieldsList.map(n => n.comment) : [] this.fields = val ? this.fieldsList.map(n => n.comment) : []
}, },
// //
download (row) { download(row) {
// , // ,
this.$get(`${this.api.isDownload}`, { this.$get(`${this.api.isDownload}`, {
tableId: row.id, tableId: row.id,
@ -393,11 +386,11 @@ export default {
}).catch(res => { }) }).catch(res => { })
}, },
// //
timeChange () { timeChange() {
// //
if (this.startTime && this.endTime && new Date(this.startTime) > new Date(this.endTime)) util.warningMsg('结束时间不能小于开始时间') if (this.startTime && this.endTime && new Date(this.startTime) > new Date(this.endTime)) util.warningMsg('结束时间不能小于开始时间')
}, },
closeDownload () { closeDownload() {
this.checkAllFields = false this.checkAllFields = false
this.fields = [] this.fields = []
this.startTime = '' this.startTime = ''
@ -405,7 +398,7 @@ export default {
this.frequency = '' this.frequency = ''
this.$router.push('/data').catch(err => { }) this.$router.push('/data').catch(err => { })
}, },
confirmDown () { confirmDown() {
let fields = this.fields let fields = this.fields
if (!fields.length) return util.warningMsg('请选择字段') if (!fields.length) return util.warningMsg('请选择字段')
if (!this.startTime) return util.warningMsg('请选择开始时间') if (!this.startTime) return util.warningMsg('请选择开始时间')
@ -490,85 +483,68 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap { .wrap{
display: flex; display: flex;
padding-bottom: 20px !important; padding-bottom: 20px !important;
/deep/.left{
/deep/.left { height: calc(100vh - 166px);
width: 239px;
height: calc(100vh - 190px);
margin-right: 20px; margin-right: 20px;
overflow: auto; overflow: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
width: 8px; width: 8px;
height: 8px; height: 8px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
display: none; display: none;
width: 5px; width: 5px;
border-radius: 6px; border-radius: 6px;
background: rgba(173, 173, 173, .7); background: rgba(173,173,173,.7);
} }
.menu{
.menu {
width: 240px; width: 240px;
overflow: hidden; overflow: hidden;
&>.el-menu-item,.el-submenu__title{
&>.el-menu-item, span{
.el-submenu__title {
span {
font-size: 15px; font-size: 15px;
color: #3381d2; color: #3381d2;
} }
} }
&>.el-submenu>.el-menu{
&>.el-submenu>.el-menu {
background-color: #FAFAFA !important; background-color: #FAFAFA !important;
} }
.el-submenu__title i{
.el-submenu__title i {
font-size: 14px; font-size: 14px;
} }
.el-submenu .el-menu{
.el-submenu .el-menu {
background-color: #fff; background-color: #fff;
} }
.el-submenu.is-active{
.el-submenu.is-active { .el-submenu__title{
.el-submenu__title { &+.el-menu .el-submenu__title{
&+.el-menu .el-submenu__title {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
background-color: rgba(147, 184, 255, .15); background-color: rgba(147,184,255,.15);
} }
i{
i {
color: #006EFF; color: #006EFF;
} }
} }
} }
.el-menu-item{
.el-menu-item {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
&.is-active{
&.is-active {
color: #fff; color: #fff;
background-color: #0070FF; background-color: #0070FF;
span { span {
color: #fff; color: #fff;
} }
} }
} }
.level-6 { .level-6 {
padding-right: 0; padding-right: 0;
.el-submenu__title { .el-submenu__title {
padding-left: 10px !important; padding-left: 10px !important;
color: #fff; color: #fff;
@ -576,34 +552,29 @@ export default {
} }
} }
} }
.right{
.right { flex: 1;
width: calc(100% - 260px); max-width: calc(100% - 220px);
.page{
.page {
margin-bottom: 20px; margin-bottom: 20px;
.source { .source {
margin-bottom: 12px; margin-bottom: 12px;
color: #7EB1F3; color: #7EB1F3;
} }
} }
} }
/deep/.el-table__body tr.current-row > td{
/deep/.el-table__body tr.current-row>td {
background-color: #daeaff; background-color: #daeaff;
} }
.desc{
.desc {
padding: 9px 12px; padding: 9px 12px;
margin: 20px 0 10px; margin: 20px 0 10px;
font-size: 12px; font-size: 12px;
color: #333; color: #333;
background-color: #FAFAFA; background-color: #FAFAFA;
} }
} }
.search{
.search {
z-index: 2; z-index: 2;
position: absolute; position: absolute;
top: 10px; top: 10px;
@ -619,46 +590,32 @@ export default {
border: 1px solid #e6e6e6; border: 1px solid #e6e6e6;
border-radius: 5px; border-radius: 5px;
input { input{
width: 260px; width: 260px;
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
&::-webkit-input-placeholder{color: #999}
&::-webkit-input-placeholder { &::-moz-placeholder{color: #999}
color: #999 &:-moz-placeholder{color: #999}
} &:focus{
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none; outline: none;
} }
} }
.remove{
.remove {
cursor: pointer; cursor: pointer;
} }
.search-icon{
.search-icon {
width: 18px; width: 18px;
} }
} }
/deep/.preview-dia{
/deep/.preview-dia {
padding: 20px; padding: 20px;
.preview-wrap{
.preview-wrap {
height: calc(100vh - 80px); height: calc(100vh - 80px);
overflow: auto; overflow: auto;
} }
} }
</style> </style>

@ -1,13 +1,12 @@
<template> <template>
<div class="wrap index" :class="{result: keyword}"> <div class="wrap" :class="{index: !keyword, result: keyword}">
<img class="screen" src="@/assets/img/index/index0.png" alt="首页">
<div class="banner"> <div class="banner">
<video class="video" ref="video" autoplay muted loop> <video class="video" ref="video" autoplay muted loop>
<source src="@/assets/video/sky.mp4" type="video/mp4"> <source src="@/assets/video/sky.mp4" type="video/mp4">
您的浏览器不支持 video 标签 您的浏览器不支持 video 标签
</video> </video>
<div class="banner-inner"> <div class="banner-inner">
<div class="banner-title">准确多元海量数据</div> <div class="title" v-if="!keyword">准确多元海量数据</div>
<div class="search-wrap"> <div class="search-wrap">
<div class="search"> <div class="search">
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词"> <input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词">
@ -25,22 +24,22 @@
</div> </div>
<div class="list-wrap" v-if="keyword"> <div class="list-wrap" v-if="keyword">
<div class="tips"> <div class="tips">
<p class="result-title"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p> <p class="result"><img src="@/assets/img/index/search.png" alt=""> 搜索结果</p>
<p class="num">搜索完成共有{{total}}个结果匹配</p> <p class="num">搜索完成共有{{total}}个结果匹配</p>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center"> <el-table :data="listData" class="table" ref="table" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="showName" label="数据表名称" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column> <el-table-column prop="timeRange" label="起止日期" width="220" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column> <el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="80" align="center"> <el-table-column prop="dataSize" label="数据大小" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.dataSize}}M {{scope.row.dataSize}}M
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="更新时间" width="155" align="center"></el-table-column> <el-table-column prop="createTime" label="更新时间" align="center"></el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览</el-button> <el-button type="text" @click="preview(scope.row)">预览</el-button>
<el-button type="text" @click="download(scope.row)">下载</el-button> <el-button type="text" @click="download(scope.row)">下载</el-button>
@ -232,40 +231,6 @@
<el-button size="small" type="primary" @click="confirmDown">确定</el-button> <el-button size="small" type="primary" @click="confirmDown">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<div class="tool">
<div class="item wechat"></div>
<div class="popup wechat-popup">
<p class="tips">微信扫码添加职站售前咨询</p>
<p class="des">提供付费咨询及解决方案</p>
<img width="150" src="@/assets/img/index/customer.png" alt="">
</div>
<div class="item tel"></div>
<div class="popup tel-popup">
<div class="tel-inner">
<div class="line">
<div>
<img class="icon" src="@/assets/img/index/tel-2.png" alt="">
</div>
<div class="text">
<p class="title">售前咨询</p>
<p class="tel-num" style="margin-bottom: 5px">刘老师</p>
<p class="tel-num">18019930142</p>
</div>
</div>
<div class="line">
<div>
<img class="icon" src="@/assets/img/index/sug.png" alt="">
</div>
<div class="text">
<p class="title" @click="toQues">咨询建议与反馈</p>
<p class="des">您的每一条建议声音我们都认真对待</p>
</div>
</div>
</div>
</div>
<div class="item topping" @click="topping"></div>
</div>
</div> </div>
</template> </template>
@ -381,13 +346,15 @@ export default {
}, },
// //
getHot(){ getHot(){
this.$get(this.api.queryDatabaseInfo).then(({ data }) => { this.$get(this.api.queryDatabaseInfo).then(res => {
let list = res.data
list.map(n => n.download)
// //
data.sort((a,b) => { list.sort((a,b) => {
return b.downloads - a.downloads return b.download - a.download
}) })
// //
this.hotData = data.slice(0,3) this.hotData = list.slice(0,3)
}).catch(res => {}) }).catch(res => {})
}, },
initData(){ initData(){
@ -408,7 +375,7 @@ export default {
// , // ,
if(this.token){ if(this.token){
if (this.routes.find(e => e.path === '/data/list')) { if (this.routes.find(e => e.path === '/data/list')) {
this.$router.push(`/data?typeId=${row.secondId}`) this.$router.push(`/data?typeId=${row.categoryTwoId}`)
} else { } else {
this.keyword = row.categoryTwo this.keyword = row.categoryTwo
} }
@ -423,15 +390,6 @@ export default {
this.active = i this.active = i
document.querySelector(`#part${i}`).scrollIntoView() document.querySelector(`#part${i}`).scrollIntoView()
}, },
//
topping() {
document.documentElement.scrollTop = 0
document.body.scrollTop = 0
},
//
toQues() {
window.open('https://www.wjx.cn/vm/wB0RcMm.aspx')
},
preview(row) { preview(row) {
// //
if(this.token){ if(this.token){
@ -614,10 +572,6 @@ export default {
.wrap{ .wrap{
position: relative; position: relative;
background-color: #F3F6FA; background-color: #F3F6FA;
.screen {
position: absolute;
top: -1000px;
}
.banner{ .banner{
position: relative; position: relative;
height: 518px; height: 518px;
@ -632,7 +586,7 @@ export default {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
} }
.banner-title{ .title{
margin-bottom: 37px; margin-bottom: 37px;
font-size: 45px; font-size: 45px;
color: #fff; color: #fff;
@ -700,11 +654,12 @@ export default {
} }
} }
&.result{ &.result{
.banner{
padding: 46px 0;
}
.tips{ .tips{
margin-bottom: 22px; margin-bottom: 22px;
.result-title{ .result{
display: flex;
align-items: center;
margin: 30px 0 10px; margin: 30px 0 10px;
font-size: 17px; font-size: 17px;
color: $main-color; color: $main-color;
@ -1043,103 +998,4 @@ export default {
overflow: auto; overflow: auto;
} }
} }
.tool {
z-index: 10;
position: fixed;
bottom: 100px;
right: 30px;
.item {
width: 45px;
height: 45px;
margin-bottom: 10px;
border: 1px solid #e5e5e5;
cursor: pointer;
}
.wechat {
background: #fff url(../../../assets/img/index/wechat.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/wechat-1.png);
background-color: #006EFF;
& + .popup {
display: block;
}
}
}
.tel {
background: #fff url(../../../assets/img/index/tel.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/tel-1.png);
background-color: #006EFF;
& + .popup {
display: block;
}
}
}
.topping {
background: #fff url(../../../assets/img/index/top.png) center center/auto no-repeat;
&:hover {
background-image: url(../../../assets/img/index/top-1.png);
background-color: #006EFF;
}
}
.popup {
position: absolute;
display: none;
}
.wechat-popup {
top: -100px;
left: -230px;
padding: 20px;
text-align: center;
background-color: #fff;
box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55);
.tips {
font-size: 14px;
}
.des {
margin: 5px 0 15px;
font-size: 12px;
color: #333;
}
}
.tel-popup {
top: -10px;
left: -250px;
width: 250px;
border-right: 20px solid transparent;
&:hover {
display: block;
}
.tel-inner {
padding: 20px;
background-color: #fff;
box-shadow: 0px 0px 7px 0px rgba(203, 203, 203, 0.55);
}
.line {
display: flex;
&:first-child {
margin-bottom: 20px;
}
}
.text {
margin-left: 15px;
}
.title {
margin-bottom: 5px;
font-size: 14px;
cursor: pointer;
&:hover {
color: #006EFF;
}
}
.tel-num {
font-size: 12px;
color: #006EFF;
}
.des {
font-size: 12px;
color: #686868;
}
}
}
</style> </style>

@ -117,7 +117,7 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
this.$get(`${this.api.listRole}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}&port=0`).then(res => { this.$get(`${this.api.listRole}?page=${this.page}&size=${this.pageSize}&name=${this.keyword}&platformId=${Setting.platformId}`).then(res => {
this.listData = res.rolePage.records this.listData = res.rolePage.records
this.total = res.rolePage.total this.total = res.rolePage.total
if(!this.listData.length && this.total){ if(!this.listData.length && this.total){

@ -1,10 +1,7 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<!-- 全屏 --> <!-- 全屏 -->
<img class="full" <img class="full" src="@/assets/img/screen/full.png" alt="" @click="fullScreen">
src="@/assets/img/screen/full.png"
alt=""
@click="fullScreen">
<!--header--> <!--header-->
<div class="header"> <div class="header">
<div class="bg_header"> <div class="bg_header">
@ -37,13 +34,10 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_1.png" <img src="@/assets/img/screen/t_1.png" alt="">
alt="">
中国宏观杠杆率 中国宏观杠杆率
</div> </div>
<div id="chart1" <div id="chart1" class="chart" style="height: 280px;"></div>
class="chart"
style="height: 280px;"></div>
</div> </div>
<div class="item"> <div class="item">
<div class="t_line_box"> <div class="t_line_box">
@ -63,13 +57,10 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_2.png" <img src="@/assets/img/screen/t_2.png" alt="">
alt="">
新增信贷数据 新增信贷数据
</div> </div>
<div id="chart5" <div id="chart5" class="chart t_btn9" style="height: 280px;"></div>
class="chart t_btn9"
style="height: 280px;"></div>
</div> </div>
<div class="item"> <div class="item">
<div class="t_line_box"> <div class="t_line_box">
@ -89,8 +80,7 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_7.png" <img src="@/assets/img/screen/t_7.png" alt="">
alt="">
{{ goodsSell.length ? goodsSell[0].operation_time.substr(0, 4) : 2021 }}年商品零售价格指数 {{ goodsSell.length ? goodsSell[0].operation_time.substr(0, 4) : 2021 }}年商品零售价格指数
</div> </div>
<div class="main_table"> <div class="main_table">
@ -103,13 +93,10 @@
</thead> </thead>
</table> </table>
</div> </div>
<div class="main_table" <div class="main_table" ref="tableWrap" style="height: 196px;margin-top: 0;overflow: auto">
ref="tableWrap"
style="height: 196px;margin-top: 0;overflow: auto">
<table> <table>
<tbody> <tbody>
<tr v-for="(item, i) in goodsSell" <tr v-for="(item, i) in goodsSell" :key="i">
:key="i">
<td width="70%">{{ item.hct }}</td> <td width="70%">{{ item.hct }}</td>
<td>{{ item.rcpi }}</td> <td>{{ item.rcpi }}</td>
</tr> </tr>
@ -119,8 +106,7 @@
</div> </div>
</div> </div>
<div class="middle"> <div class="middle">
<div class="item" <div class="item" style="height: 350px">
style="height: 350px">
<!--左上边框--> <!--左上边框-->
<div class="t_line_box"> <div class="t_line_box">
<i class="t_l_line"></i> <i class="t_l_line"></i>
@ -142,38 +128,31 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_3.png" <img src="@/assets/img/screen/t_3.png" alt="">
alt=""> 加密货币行情
中国GDP年率报告
</div> </div>
<div class="main_table"> <div class="main_table">
<table> <table>
<thead> <thead>
<tr> <tr>
<th width="50%">时间</th> <th width="30%">币种</th>
<th width="50%">年率</th> <th width="25%">最新价</th>
<th width="25%">24H成交量</th>
<th>24H涨跌</th>
</tr> </tr>
</thead> </thead>
</table>
</div>
<div class="main_table"
ref="gdpList"
style="max-height: 260px;margin-top: 0;overflow: auto;">
<table>
<tbody> <tbody>
<template v-for="(item, i) in gdps"> <tr v-for="(item, i) in cryptoList" :key="i">
<tr v-if="item.value != '0'" <td>{{ item.currencyPair }}</td>
:key="i"> <td>${{ item.amount }}</td>
<td width="50%">{{ item.date_index }}</td> <td>{{ parseInt(item.total) }}M</td>
<td width="50%">${{ item.value }}</td> <td><p :class="['percent', {fall: item.percent < 0}]">{{ (item.percent * 100).toFixed(2) }}%</p></td>
</tr> </tr>
</template>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="item" <div class="item" style="height: 520px;">
style="height: 520px;">
<!--左上边框--> <!--左上边框-->
<div class="t_line_box"> <div class="t_line_box">
<i class="t_l_line"></i> <i class="t_l_line"></i>
@ -195,24 +174,15 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_3.png" <img src="@/assets/img/screen/t_3.png" alt="">
alt="">
主要央行利率 主要央行利率
</div> </div>
<div class="earth"> <div class="earth">
<img class="lbx" <img class="lbx" src="@/assets/img/screen/lbx.png" alt="">
src="@/assets/img/screen/lbx.png" <img class="jt" src="@/assets/img/screen/jt.png" alt="">
alt=""> <img class="map" src="@/assets/img/screen/map.png" alt="">
<img class="jt"
src="@/assets/img/screen/jt.png"
alt="">
<img class="map"
src="@/assets/img/screen/map.png"
alt="">
</div> </div>
<div class="chart" <div class="chart" id="chart7" style="height: 500px"></div>
id="chart7"
style="height: 500px"></div>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@ -238,13 +208,10 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_4.png" <img src="@/assets/img/screen/t_4.png" alt="">
alt="">
全国税收收入 全国税收收入
</div> </div>
<div id="chart3" <div id="chart3" class="echart t_btn7" style="height: 280px;"></div>
class="echart t_btn7"
style="height: 280px;"></div>
</div> </div>
<div class="item"> <div class="item">
<!--左上边框--> <!--左上边框-->
@ -268,12 +235,10 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_5.png" <img src="@/assets/img/screen/t_5.png" alt="">
alt="">
央行货币当局资产负债 央行货币当局资产负债
</div> </div>
<div id="chart4" <div id="chart4" style="height: 280px;"></div>
style="height: 280px;"></div>
</div> </div>
<div class="item"> <div class="item">
<div class="t_line_box"> <div class="t_line_box">
@ -293,13 +258,10 @@
<i class="b_r_line"></i> <i class="b_r_line"></i>
</div> </div>
<div class="main_title"> <div class="main_title">
<img src="@/assets/img/screen/t_7.png" <img src="@/assets/img/screen/t_7.png" alt="">
alt="">
以美元计算进口年率 以美元计算进口年率
</div> </div>
<div id="chart6" <div id="chart6" class="chart" style="height: 270px;"></div>
class="chart"
style="height: 270px;"></div>
</div> </div>
</div> </div>
</div> </div>
@ -314,41 +276,34 @@ import SockJS from 'sockjs-client'
import Stomp from 'stompjs' import Stomp from 'stompjs'
import map from './map' import map from './map'
export default { export default {
data () { data() {
return { return {
stompClientMarket: null, stompClientMarket: null,
stompClient: null, stompClient: null,
goodsSell: [], goodsSell: [],
cryptoList: [], cryptoList: []
gdps: []
} }
}, },
mounted () { mounted() {
this.getList() this.connect()
this.renderChart() this.renderChart()
this.renderMap() this.renderMap()
}, },
methods: { methods: {
// gdp
getList () {
this.$get(`${this.api.visualPreview}?tableName=hg_zg_gm_zhongguogdpnianlvbaogao&tableId=17`).then(({ comment, data }) => {
this.gdps = data
}).catch(res => { })
},
// //
getCrypto () { getCrypto() {
this.$get(`${this.api.getTopList}`).then(res => { this.$get(`${this.api.getTopList}`).then(res => {
this.userCount = res.totalCount this.userCount = res.totalCount
}).catch(res => { }) }).catch(res => {})
}, },
// websocket // websocket
connect () { connect() {
const socket = new SockJS(`${Setting.cryptoBaseURL}currency/websocket`) //广 const socket = new SockJS(`${Setting.cryptoBaseURL}currency/websocket`) //广
// STOMP // STOMP
this.stompClientMarket = new Stomp.over(socket) this.stompClientMarket = new Stomp.over(socket)
this.stompClientMarket.debug = null this.stompClientMarket.debug = null
var this_ = this var this_ = this
this.stompClientMarket.connect({}, function (event) { this.stompClientMarket.connect({}, function(event) {
// //
if (this_.subObjMarket == null) { if (this_.subObjMarket == null) {
this_.subscribeMarket() this_.subscribeMarket()
@ -359,7 +314,7 @@ export default {
}); });
}, },
// //
subscribeMarket () { subscribeMarket() {
const this_ = this const this_ = this
this.subObjMarket = this.stompClientMarket.subscribe( this.subObjMarket = this.stompClientMarket.subscribe(
this_.api.market, this_.api.market,
@ -378,11 +333,11 @@ export default {
} }
); );
}, },
disconnect () { disconnect() {
this.stompClient && this.stompClient.disconnect() this.stompClient && this.stompClient.disconnect()
}, },
// //
fullScreen () { fullScreen() {
// //
if (document.fullscreenElement || if (document.fullscreenElement ||
document.mozFullScreenElement || document.mozFullScreenElement ||
@ -403,10 +358,10 @@ export default {
} }
}, },
// //
renderChart () { renderChart() {
const animateChart = (chart, option, data, num = 6) => { const animateChart = (chart, option, data, num = 6) => {
// //
if (option.dataZoom[0].endValue == data.length) { if (option.dataZoom[0].endValue == data.length ) {
option.dataZoom[0].endValue = num option.dataZoom[0].endValue = num
option.dataZoom[0].startValue = 0 option.dataZoom[0].startValue = 0
} }
@ -438,7 +393,7 @@ export default {
}, },
legend: { legend: {
data: comment.map(e => e.comment), data: comment.map(e => e.comment),
textStyle: { textStyle:{
color: '#fff' color: '#fff'
}, },
top: '8%' top: '8%'
@ -459,7 +414,7 @@ export default {
endValue: 6 // 6 endValue: 6 // 6
} }
], ],
color: ['#6188e9', '#9032f3', '#a57de3', '#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'], color: ['#6188e9','#9032f3','#a57de3','#4BF0FF','#44AFF0','#4E82FF','#584BFF','#BE4DFF','#F845F1'],
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: ['20%', '20%'], boundaryGap: ['20%', '20%'],
@ -495,7 +450,7 @@ export default {
setInterval(function () { setInterval(function () {
animateChart(chart[0], option, series) animateChart(chart[0], option, series)
}, 1500) }, 1500)
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.visualPreview}?tableName=hg_zg_jr_quanguoshuishoushouru&tableId=33`).then(res => { this.$get(`${this.api.visualPreview}?tableName=hg_zg_jr_quanguoshuishoushouru&tableId=33`).then(res => {
@ -533,10 +488,10 @@ export default {
} }
} }
}, },
color: ['#4BF0FF', '#44AFF0', '#4E82FF', '#584BFF', '#BE4DFF', '#F845F1'], color: ['#4BF0FF','#44AFF0','#4E82FF','#584BFF','#BE4DFF','#F845F1'],
legend: { legend: {
data: ['税收收入合计'], data: ['税收收入合计'],
textStyle: { textStyle:{
color: '#fff' color: '#fff'
}, },
top: '8%' top: '8%'
@ -578,7 +533,7 @@ export default {
setInterval(function () { setInterval(function () {
animateChart(chart[1], option, data) animateChart(chart[1], option, data)
}, 1500) }, 1500)
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.previewData}?tableName=hg_zg_jr_guojilvyouwaihuishourugoucheng&tableId=52`).then(res => { this.$get(`${this.api.previewData}?tableName=hg_zg_jr_guojilvyouwaihuishourugoucheng&tableId=52`).then(res => {
@ -619,7 +574,7 @@ export default {
//[0, 360] //[0, 360]
// startAngle: 0, // startAngle: 0,
// //
radius: '45%', radius : '45%',
// //
center: ['50%', '65%'], center: ['50%', '65%'],
// //
@ -628,7 +583,7 @@ export default {
// roseType: 'radius', // roseType: 'radius',
// false // false
// avoidLabelOverlap: false, // avoidLabelOverlap: false,
color: ['#065aab', '#066eab', '#0682ab', '#0696ab', '#06a0ab', '#06b4ab', '#06c8ab', '#06dcab', '#06f0ab'], color: ['#065aab', '#066eab', '#0682ab', '#0696ab', '#06a0ab','#06b4ab','#06c8ab','#06dcab','#06f0ab'],
label: { label: {
normal: { normal: {
show: true, show: true,
@ -650,7 +605,7 @@ export default {
data: series data: series
}] }]
}) })
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.previewData}?tableName=hg_zg_jr_yanghanghuobidangjuzichanfuzhai&tableId=55`).then(res => { this.$get(`${this.api.previewData}?tableName=hg_zg_jr_yanghanghuobidangjuzichanfuzhai&tableId=55`).then(res => {
@ -810,7 +765,7 @@ export default {
setInterval(function () { setInterval(function () {
animateChart(chart[3], option, data, 3) animateChart(chart[3], option, data, 3)
}, 1500) }, 1500)
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.previewData}?tableName=hg_zg_jr_shangpinlingshoujiagezhishu&tableId=60`).then(res => { this.$get(`${this.api.previewData}?tableName=hg_zg_jr_shangpinlingshoujiagezhishu&tableId=60`).then(res => {
@ -824,7 +779,7 @@ export default {
}) })
}) })
this.goodsSell = [...goodsSell, ...goodsSell] this.goodsSell = [...goodsSell, ...goodsSell]
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.previewData}?tableName=hg_zg_jr_xinzengxindaishuju&tableId=34`).then(res => { this.$get(`${this.api.previewData}?tableName=hg_zg_jr_xinzengxindaishuju&tableId=34`).then(res => {
@ -970,7 +925,7 @@ export default {
setInterval(function () { setInterval(function () {
animateChart(chart[4], option, data, 3) animateChart(chart[4], option, data, 3)
}, 1500) }, 1500)
}).catch(res => { }) }).catch(res => {})
// //
this.$get(`${this.api.visualPreview}?tableName=hg_zg_my_yimeiyuanjisuanjinkounianlv&tableId=22`).then(res => { this.$get(`${this.api.visualPreview}?tableName=hg_zg_my_yimeiyuanjisuanjinkounianlv&tableId=22`).then(res => {
@ -1075,7 +1030,7 @@ export default {
setInterval(function () { setInterval(function () {
animateChart(chart[5], option, data) animateChart(chart[5], option, data)
}, 1500) }, 1500)
}).catch(res => { }) }).catch(res => {})
this.scrollTable() this.scrollTable()
@ -1087,20 +1042,20 @@ export default {
}) })
}, },
// //
async renderMap () { async renderMap() {
// idname // idname
const param = [ const param = [
{ tableId: 2, tableName: 'll_yh_usa' }, {tableId: 2, tableName: 'll_yh_usa'},
{ tableId: 3, tableName: 'll_yh_euro' }, {tableId: 3, tableName: 'll_yh_euro'},
{ tableId: 4, tableName: 'll_yh_newzealand' }, {tableId: 4, tableName: 'll_yh_newzealand'},
{ tableId: 5, tableName: 'll_yh_china' }, {tableId: 5, tableName: 'll_yh_china'},
{ tableId: 6, tableName: 'll_yh_switzerland' }, {tableId: 6, tableName: 'll_yh_switzerland'},
{ tableId: 7, tableName: 'll_yh_english' }, {tableId: 7, tableName: 'll_yh_english'},
{ tableId: 8, tableName: 'll_yh_australia' }, {tableId: 8, tableName: 'll_yh_australia'},
{ tableId: 9, tableName: 'll_yh_japan' }, {tableId: 9, tableName: 'll_yh_japan'},
{ tableId: 10, tableName: 'll_yh_russia' }, {tableId: 10, tableName: 'll_yh_russia'},
{ tableId: 11, tableName: 'll_yh_india' }, {tableId: 11, tableName: 'll_yh_india'},
{ tableId: 12, tableName: 'll_yh_brazil' } {tableId: 12, tableName: 'll_yh_brazil'}
] ]
this.$post(this.api.multipleTablePreview, param).then(res => { this.$post(this.api.multipleTablePreview, param).then(res => {
// //
@ -1255,18 +1210,14 @@ export default {
index = -1 index = -1
} }
}, 2000) }, 2000)
}).catch(res => { }) }).catch(res => {})
}, },
// //
scrollTable () { scrollTable() {
const dom = this.$refs.tableWrap const dom = this.$refs.tableWrap
const dom1 = this.$refs.gdpList
setInterval(() => { setInterval(() => {
dom.scrollTop += 1 dom.scrollTop += 1
if (dom.clientHeight + dom.scrollTop === dom.scrollHeight) dom.scrollTop = 0 if (dom.clientHeight + dom.scrollTop === dom.scrollHeight) dom.scrollTop = 0
dom1.scrollTop += 1
if (dom1.clientHeight + dom1.scrollTop === dom1.scrollHeight) dom1.scrollTop = 0
}, 30) }, 30)
} }
} }
@ -1274,5 +1225,5 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/screen.scss'; @import "../../../styles/page/screen.scss";
</style> </style>

@ -8,31 +8,26 @@
<li> <li>
<label>创建时间</label> <label>创建时间</label>
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="flex-1"> <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" <el-option v-for="(item,index) in monthList" :key="index" :label="item.label" :value="item.id"></el-option>
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>时间范围</label> <label>时间范围</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" <el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable size="small"></el-date-picker>
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable
size="small"></el-date-picker>
</li> </li>
<li> <li>
<label>角色</label> <label>角色</label>
<el-select v-model="role" placeholder="请选择角色" size="small" clearable class="flex-1" @change="initData"> <el-select v-model="role" placeholder="请选择角色" size="small" clearable class="flex-1" @change="initData">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<template v-for="(item, index) in roleList"> <template v-for="(item, index) in roleList">
<el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName" <el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName" :value="item.id"></el-option>
:value="item.id"></el-option>
</template> </template>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>状态</label> <label>状态</label>
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="flex-1" @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" <el-option v-for="(item,index) in statusList" :key="index" :label="item.label" :value="item.id"></el-option>
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
</ul> </ul>
@ -46,8 +41,7 @@
<ul class="filter"> <ul class="filter">
<li style="margin-bottom: 0"> <li style="margin-bottom: 0">
<label>搜索</label> <label>搜索</label>
<el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search" <el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input>
clearable size="small"></el-input>
</li> </li>
</ul> </ul>
<div> <div>
@ -58,8 +52,7 @@
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column> <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 type="index" label="序号" width="55" align="center">
</el-table-column> </el-table-column>
@ -67,13 +60,13 @@
<el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column>
<el-table-column label="权限状态" align="center"> <el-table-column label="权限状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isEnable ? '启用' : '禁用' }} {{scope.row.isEnable ? '启用' : '禁用'}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="roleName" 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 prop="loginNumber" label="登录次数" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.loginNumber ? scope.row.loginNumber : 0 }} {{scope.row.loginNumber ? scope.row.loginNumber : 0}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center"></el-table-column> <el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center"></el-table-column>
@ -83,20 +76,16 @@
<el-button type="text" @click="edit(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="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" <el-switch v-model="scope.row.isEnable" :active-value="1" :inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '开' : '关'" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/user/list:禁用'"></el-switch>
:active-text="scope.row.isEnable ? '开' : '关'" @change="switchOff($event, scope.row, scope.$index)"
v-auth="'/user/list:禁用'"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="page" <el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
@current-change="handleCurrentChange" :total="total"></el-pagination>
</div> </div>
</div> </div>
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" <el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false">
@close="closeUser" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix="" :disabled="isDetail"> <el-form ref="form" :model="form" :rules="rules" label-width="110px" label-suffix="" :disabled="isDetail">
<el-form-item prop="workNumber" label="工号/学号"> <el-form-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input> <el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
@ -107,9 +96,8 @@
<el-form-item prop="roleIds" label="账号角色"> <el-form-item prop="roleIds" label="账号角色">
<div class="role-wrap"> <div class="role-wrap">
<el-checkbox-group v-model="form.roleIds"> <el-checkbox-group v-model="form.roleIds">
<template v-for="(item, index) in roleList"> <template v-for="(item,index) in roleList">
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" <el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :title="item.roleName">{{item.roleName}}</el-checkbox>
:title="item.roleName">{{ item.roleName }}</el-checkbox>
</template> </template>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
@ -130,14 +118,10 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" <el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false">
:close-on-click-modal="false"> <div class="upload-wrap" :class="{lg: uploadFaild}">
<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-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> <el-upload ref="import" accept=".xls,.xlsx" :headers="{token}" :on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" :action="this.api.uploadFile" :file-list="uploadList" :data="{schoolId: this.schoolId}" name="file">
模板下载</el-button>
<el-upload ref="import" accept=".xls,.xlsx" :headers="{ token }" :on-remove="handleRemove" :on-error="uploadError"
:on-success="uploadSuccess" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed"
:action="this.api.uploadFile" :file-list="uploadList" :data="{ schoolId: this.schoolId }" name="file">
<el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button> <el-button size="small"><img src="../../../assets/img/upload.png" alt=""> 上传文件</el-button>
</el-upload> </el-upload>
<div class="link" v-if="uploadFaild"> <div class="link" v-if="uploadFaild">
@ -157,7 +141,7 @@ import { mapState } from 'vuex'
import util from '@/libs/util' import util from '@/libs/util'
import axios from 'axios' import axios from 'axios'
export default { export default {
data () { data() {
return { return {
token: util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
month: '', month: '',
@ -165,13 +149,13 @@ export default {
{ {
id: '', id: '',
label: '不限' label: '不限'
}, { },{
id: 3, id: 3,
label: '近3个月' label: '近3个月'
}, { },{
id: 6, id: 6,
label: '近6个月' label: '近6个月'
}, { },{
id: 12, id: 12,
label: '近1年' label: '近1年'
} }
@ -185,10 +169,10 @@ export default {
{ {
id: '', id: '',
label: '不限' label: '不限'
}, { },{
id: 1, id: 1,
label: '启用' label: '启用'
}, { },{
id: 0, id: 0,
label: '禁用' label: '禁用'
} }
@ -269,39 +253,39 @@ export default {
]), ]),
}, },
watch: { watch: {
keyword: function (val) { keyword: function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData()
}, 500) },500)
}, },
month: function (val) { month: function(val){
if (val) { if(val){
let unit = 24 * 60 * 60 * 1000 let unit = 24 * 60 * 60 * 1000
this.date = [util.formatDate('yyyy-MM-dd', new Date(new Date().getTime() - unit * 30 * val)), util.formatDate('yyyy-MM-dd', new Date(new Date().getTime() + unit))] this.date = [util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),util.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
} else { }else{
this.date = [] this.date = []
} }
}, },
date: function (val) { date: function(val){
if (val && val.length) { if(val && val.length){
this.startTime = val[0] this.startTime = val[0]
this.endTime = val[1] this.endTime = val[1]
} else { }else{
this.startTime = '' this.startTime = ''
this.endTime = '' this.endTime = ''
} }
this.initData() this.initData()
} }
}, },
mounted () { mounted(){
this.form.schoolId = this.schoolId this.form.schoolId = this.schoolId
this.getData() this.getData()
this.getRole() this.getRole()
}, },
methods: { methods: {
getData () { getData(){
this.$post(this.api.getUserList, { this.$post(this.api.getUserList,{
createTime: this.startTime, createTime: this.startTime,
isEnable: this.status, isEnable: this.status,
endTime: this.endTime, endTime: this.endTime,
@ -314,82 +298,82 @@ export default {
const { records, total } = pageList const { records, total } = pageList
this.listData = records this.listData = records
this.total = total this.total = total
if (!records.length && total) { if(!records.length && total){
this.page-- this.page--
this.getData() this.getData()
} }
}).catch(res => { }) }).catch(res => {})
}, },
initData () { initData(){
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
// //
getRole () { getRole(){
this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}&port=0`).then(res => { this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}`).then(res => {
const list = res.rolePage.records const list = res.rolePage.records
this.roleList = list this.roleList = list
}).catch(res => { }) }).catch(res => {})
}, },
resetPassword (row) { resetPassword(row){
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', {
type: 'info', type: 'info',
customClass: 'normal' customClass: 'normal'
}).then(() => { }).then(() => {
this.$get(this.api.resetPwd, { this.$get(this.api.resetPwd,{
newPwd: Setting.initialPassword, newPwd: Setting.initialPassword,
userId: row.userId, userId: row.userId,
}).then(res => { }).then(res => {
if (res.message == 'success') { if(res.message == 'success'){
this.$message.success('重置成功') this.$message.success('重置成功')
} else { }else{
this.$message.error('重置失败') this.$message.error('重置失败')
} }
}).catch(res => { }) }).catch(res => {})
}).catch(() => { }) }).catch(() => {})
}, },
// //
renderAccount () { renderAccount() {
const form = this.form const form = this.form
// id-id-schoolId-workNumber // id-id-schoolId-workNumber
form.account = `${Setting.platformId}-${Setting.platformType}-${this.schoolId}-${form.workNumber}` form.account = `${Setting.platformId}-${Setting.platformType}-${this.schoolId}-${form.workNumber}`
}, },
workNumberChange () { workNumberChange(){
if (this.form.workNumber && this.form.workNumber !== this.originalWorkNumber) { if(this.form.workNumber && this.form.workNumber !== this.originalWorkNumber){
this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => { this.$post(`${this.api.checkAccount}?workNumber=${this.form.workNumber}&type=2&platformId=${Setting.platformId}`).then(res => {
this.workNumberRepeat = false this.workNumberRepeat = false
this.renderAccount() this.renderAccount()
}).catch(res => { }).catch(res => {
this.workNumberRepeat = true this.workNumberRepeat = true
}) })
} else { }else{
this.workNumberRepeat = false this.workNumberRepeat = false
this.renderAccount() this.renderAccount()
} }
}, },
phoneChange () { phoneChange(){
if (this.form.phone && this.form.phone !== this.originalPhone) { if(this.form.phone && this.form.phone !== this.originalPhone){
this.$post(`${this.api.checkEmailOrPhone}?phone=${this.form.phone}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { this.$post(`${this.api.checkEmailOrPhone}?phone=${this.form.phone}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => {
this.phoneRepeat = false this.phoneRepeat = false
}).catch(res => { }).catch(res => {
this.phoneRepeat = true this.phoneRepeat = true
}) })
} else { }else{
this.phoneRepeat = false this.phoneRepeat = false
} }
}, },
emailChange () { emailChange(){
if (this.form.email && this.form.email !== this.originalEmail) { if(this.form.email && this.form.email !== this.originalEmail){
this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => { this.$post(`${this.api.checkEmailOrPhone}?email=${this.form.email}${this.form.accountId ? '&accountId=' + this.form.accountId : ''}`).then(res => {
this.emailRepeat = false this.emailRepeat = false
}).catch(res => { }).catch(res => {
this.emailRepeat = true this.emailRepeat = true
}) })
} else { }else{
this.emailRepeat = false this.emailRepeat = false
} }
}, },
closeUser () { closeUser(){
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.form.userId = '' this.form.userId = ''
this.form.accountId = '' this.form.accountId = ''
@ -397,11 +381,11 @@ export default {
this.accountRepeat = false this.accountRepeat = false
this.workNumberRepeat = false this.workNumberRepeat = false
}, },
add () { add(){
this.isDetail = false this.isDetail = false
this.userVisible = true this.userVisible = true
}, },
getDetail (accountId) { getDetail(accountId){
this.userVisible = true this.userVisible = true
this.$post(`${this.api.getDetail}?accountId=${accountId}`).then(res => { this.$post(`${this.api.getDetail}?accountId=${accountId}`).then(res => {
let data = res.data let data = res.data
@ -423,33 +407,33 @@ export default {
this.originalWorkNumber = data.workNumber this.originalWorkNumber = data.workNumber
this.originalPhone = data.phone this.originalPhone = data.phone
this.originalEmail = data.email this.originalEmail = data.email
}).catch(res => { }) }).catch(res => {})
}, },
edit (row) { edit(row){
this.isDetail = false this.isDetail = false
this.getDetail(row.accountId) this.getDetail(row.accountId)
}, },
show (row) { show(row){
this.isDetail = true this.isDetail = true
this.getDetail(row.accountId) this.getDetail(row.accountId)
}, },
confirm () { confirm(){
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
if (this.accountRepeat) return util.errorMsg('该账号已存在!') if(this.accountRepeat) return util.errorMsg('该账号已存在!')
if (this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!') if(this.workNumberRepeat) return util.errorMsg('该学号/工号已存在!')
if (this.phoneRepeat) return util.errorMsg('该手机号已存在!') if(this.phoneRepeat) return util.errorMsg('该手机号已存在!')
if (this.emailRepeat) return util.errorMsg('该邮箱已存在!') if(this.emailRepeat) return util.errorMsg('该邮箱已存在!')
let data = this.form let data = this.form
// ,schoolId // ,schoolId
data.schoolId = data.schoolId ? data.schoolId : this.schoolId data.schoolId = data.schoolId ? data.schoolId : this.schoolId
// , // ,
if (!data.userId) data.uniqueIdentification = new Date().getTime() if(!data.userId) data.uniqueIdentification = new Date().getTime()
if (!data.roleIds.length) return util.errorMsg('请至少选择一个角色') if(!data.roleIds.length) return util.errorMsg('请至少选择一个角色')
this.submiting = true this.submiting = true
if (this.form.userId) { if(this.form.userId){
this.$post(this.api.modifyUser, data).then(res => { this.$post(this.api.modifyUser,data).then(res => {
this.userVisible = false this.userVisible = false
util.successMsg('编辑成功') util.successMsg('编辑成功')
this.getData() this.getData()
@ -457,8 +441,8 @@ export default {
}).catch(res => { }).catch(res => {
this.submiting = false this.submiting = false
}) })
} else { }else{
this.$post(this.api.saveUser, data).then(res => { this.$post(this.api.saveUser,data).then(res => {
this.userVisible = false this.userVisible = false
util.successMsg('添加成功') util.successMsg('添加成功')
this.getData() this.getData()
@ -470,20 +454,20 @@ export default {
} }
}) })
}, },
handleDelete (row) { handleDelete(row){
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteUser}?accountIds=${row.accountId}`).then(res => { this.$post(`${this.api.deleteUser}?accountIds=${row.accountId}`).then(res => {
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => { }) }).catch(res => {})
}).catch(() => { }) }).catch(() => {})
}, },
switchOff (val, row, index) { switchOff(val,row,index) {
this.$post(`${this.api.getDetail}?accountId=${row.accountId}`).then(res => { this.$post(`${this.api.getDetail}?accountId=${row.accountId}`).then(res => {
const { data } = res const { data } = res
this.$post(this.api.modifyUser, { this.$post(this.api.modifyUser,{
account: row.account, account: row.account,
accountId: row.accountId, accountId: row.accountId,
isEnable: val, isEnable: val,
@ -500,13 +484,13 @@ export default {
}).catch((res) => { }).catch((res) => {
row.isEnable = val == 1 ? 0 : 1 row.isEnable = val == 1 ? 0 : 1
}) })
}).catch(res => { }) }).catch(res => {})
}, },
handleSelectionChange (val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
delAllSelection () { delAllSelection() {
if (this.multipleSelection.length != '') { if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection let newArr = this.multipleSelection
let delList = newArr.map(item => { let delList = newArr.map(item => {
return `accountIds=${item.accountId}` return `accountIds=${item.accountId}`
@ -518,71 +502,71 @@ export default {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => { }) }).catch(res => {})
}).catch(() => { }) }).catch(() => {})
} else { }else{
util.errorMsg('请先选择数据 !') util.errorMsg('请先选择数据 !')
} }
}, },
batchImport () { batchImport(){
this.importVisible = true this.importVisible = true
this.uploadList = [] this.uploadList = []
this.uploadFaild = false this.uploadFaild = false
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.page = val this.page = val
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.getData() this.getData()
}, },
downLoad () { downLoad(){
location.href = `${this.api.userTemplate}?id=${Math.random()}` location.href = `${this.api.userTemplate}?id=${Math.random()}`
}, },
showFaild () { showFaild(){
this.importVisible = false this.importVisible = false
axios.get(`${this.api.export_failure}?token=${this.importToken}`, { axios.get(`${this.api.export_failure}?token=${this.importToken}`,{
headers: { headers: {
token: this.token token: this.token
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
util.downloadFileDirect(`导入失败原因.xlsx`, new Blob([res.data])) util.downloadFileDirect(`导入失败原因.xlsx`,new Blob([res.data]))
}).catch(res => { }) }).catch(res => {})
}, },
handleExceed (files, fileList) { handleExceed(files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
uploadSuccess (res, file, fileList) { uploadSuccess(res, file, fileList) {
this.uploadFaild = false this.uploadFaild = false
if (res.status == 200) { if(res.status == 200){
if (res.data.token) { if(res.data.token){
util.errorMsg('导入失败,请下载失败模板查看原因') util.errorMsg('导入失败,请下载失败模板查看原因')
this.importToken = res.data.token this.importToken = res.data.token
this.uploadFaild = true this.uploadFaild = true
} }
} else { }else{
res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据') res.data.message ? util.errorMsg(res.data.message) : util.errorMsg('上传失败,请检查数据')
} }
}, },
uploadError (err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); });
}, },
beforeRemove (file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove (file, fileList) { handleRemove(file, fileList) {
this.uploadList = fileList this.uploadList = fileList
this.uploadFaild = false this.uploadFaild = false
}, },
closeImport () { closeImport(){
this.uploadList = [] this.uploadList = []
}, },
confirmImport () { confirmImport(){
this.importVisible = false this.importVisible = false
this.initData() this.initData()
} }
@ -590,36 +574,29 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.l-title { .l-title{
margin-bottom: 24px; margin-bottom: 24px;
} }
.filter{
.filter {
flex-wrap: wrap; flex-wrap: wrap;
li{
li {
width: 22%; width: 22%;
} }
} }
/deep/.dialog{
/deep/.dialog { .el-form-item{
.el-form-item { .el-form-item__label{
.el-form-item__label {
font-size: 16px; font-size: 16px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
&:before{
&:before {
margin-right: 0; margin-right: 0;
color: #CC221C; color: #CC221C;
} }
} }
} }
.el-input,.el-select{
.el-input,
.el-select {
width: 100%; width: 100%;
} }
.role-wrap { .role-wrap {
max-height: 130px; max-height: 130px;
padding: 10px 12px 0; padding: 10px 12px 0;
@ -627,18 +604,16 @@ export default {
border-radius: 4px; border-radius: 4px;
overflow: auto; overflow: auto;
} }
.el-checkbox { .el-checkbox {
display: inline-flex; display: inline-flex;
width: 33.33%; width: 33.33%;
margin-right: 0; margin-right: 0;
} }
.el-checkbox__label { .el-checkbox__label {
max-width: 108px; max-width: 108px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
</style> </style>

@ -1,10 +1,9 @@
import axios from 'axios' import axios from 'axios'
import Util from '@/libs/util' import util from '@/libs/util'
import router from '@/router/index' import router from '@/router/index'
import Setting from '@/setting' import Setting from '@/setting'
import store from '@/store' import store from '@/store'
import api from '@/api' import api from '@/api'
import { Message } from 'element-ui'
const baseURL = Setting.apiBaseURL const baseURL = Setting.apiBaseURL
const service = axios.create({ const service = axios.create({
@ -18,50 +17,43 @@ let check = true
let checkTimer = null let checkTimer = null
// 检测账号是否被禁用,如果禁用则提示并退出登录 // 检测账号是否被禁用,如果禁用则提示并退出登录
function checkDisabled () { function checkDisabled () {
const token = Util.local.get(Setting.tokenKey) const token = util.local.get(Setting.tokenKey)
if (!token) return false if (!token) return false
check = false check = false
axios.get(baseURL + api.accountIsDisabled + '?token=' + token, { axios.get(baseURL + api.accountIsDisabled + '?token=' + token, {
token: Util.local.get(Setting.tokenKey), token: util.local.get(Setting.tokenKey),
headers: { headers: {
token token
} }
}).then(res => { }).then(res => {
if (res.data.code === 401) { if (res.data) {
Util.local.remove(Setting.storeKey) util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
Util.local.remove(Setting.tokenKey)
Util.errorMsg(res.data.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
location.reload()
}, 1500)
} else if (res.data) {
Util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => { setTimeout(() => {
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1500) }, 1500)
} }
}).catch(res => { }) }).catch(res => {})
} }
// 请求拦截器 // 请求拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
let token = Util.local.get(Setting.tokenKey) let token = util.local.get(Setting.tokenKey)
if (token) config.headers.token = token if(token) config.headers.token = token
let storeSchoolId = store.state.user.schoolId let storeSchoolId = store.state.user.schoolId
let routeSchoolId = router.app._route.query.schoolId let routeSchoolId = router.app._route.query.schoolId
if (routeSchoolId) routeSchoolId = atob(decodeURI(routeSchoolId)) if(routeSchoolId) routeSchoolId = atob(decodeURI(routeSchoolId))
// 如果store里没有schoolId,则取url里的schoolId,从用户跳转到后台的时候因为加载顺序的问题会出现这个情况,所以要做这个处理 // 如果store里没有schoolId,则取url里的schoolId,从用户跳转到后台的时候因为加载顺序的问题会出现这个情况,所以要做这个处理
if (storeSchoolId || routeSchoolId) config.headers.schoolId = storeSchoolId ? storeSchoolId : routeSchoolId if(storeSchoolId || routeSchoolId) config.headers.schoolId = storeSchoolId ? storeSchoolId : routeSchoolId
clearTimeout(checkTimer) clearTimeout(checkTimer)
check && checkDisabled() check && checkDisabled()
checkTimer = setTimeout(() => { checkTimer = setTimeout(() => {
check = true check = true
}, 2000) }, 2000)
return config return config
}, err => { },err => {
Util.errorMsg({ util.errorMsg({
message: '退出登陆', message: '退出登陆',
onClose: function () { onClose: function () {
router.push({ name: '/login' }) router.push({name: '/login'})
} }
}) })
return Promise.reject(err) return Promise.reject(err)
@ -71,35 +63,14 @@ service.interceptors.request.use(config => {
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const res = response.data const res = response.data
if (res.status == 200) { if(res.status == 200) {
return Promise.resolve(res).catch(e => { }) return Promise.resolve(res).catch(e => {})
} else if (res.code === 401) { }else if(res.status == 30001) {
// 账号互踢 return Promise.resolve(res).catch(e => {})
if (!logouted) { }else if(!res.status){
Util.local.remove(Setting.storeKey) return Promise.resolve(res).catch(e => {})
Util.local.remove(Setting.tokenKey) }else {
Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!') util.errorMsg(res.message)
setTimeout(() => {
router.replace({
path: '/login'
})
logouted = 0
}, 1500)
logouted = 1
}
} else if (res.status == 30001) {
return Promise.resolve(res).catch(e => { })
} else if (!res.status) {
return Promise.resolve(res).catch(e => { })
} else if (res.status === 10008) {
Message.error({
message: res.message,
showClose: true,
duration: 1500
})
return Promise.reject(res)
} else {
Util.errorMsg(res.message)
res.message === '该账号无权限!' && setTimeout(() => { res.message === '该账号无权限!' && setTimeout(() => {
store.dispatch('user/logout') store.dispatch('user/logout')
}, 1500) }, 1500)
@ -114,9 +85,9 @@ service.interceptors.response.use(
// 未登录则跳转登录页面,并携带当前页面的路径 // 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。 // 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401: case 401:
Util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录') util.errorMsg('登录过期,请重新登录')
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({
path: '/login' path: '/login'
@ -124,16 +95,16 @@ service.interceptors.response.use(
}, 1000) }, 1000)
break break
case 500: case 500:
Util.errorMsg('网络错误') util.errorMsg('网络错误')
break break
// 403 token过期 // 403 token过期
// 登录过期对用户进行提示 // 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象 // 清除本地token和清空vuex中token对象
// 跳转登录页面 // 跳转登录页面
case 403: case 403:
Util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录') util.errorMsg('登录过期,请重新登录')
// 清除token // 清除token
// store.commit('loginSuccess', null); // store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
@ -148,11 +119,11 @@ service.interceptors.response.use(
break break
// 404请求不存在 // 404请求不存在
case 404: case 404:
Util.errorMsg('网络请求不存在!') util.errorMsg('网络请求不存在!')
break break
// 其他错误,直接抛出错误提示 // 其他错误,直接抛出错误提示
default: default:
Util.errorMsg(error.response.data.message) util.errorMsg(error.response.data.message)
Promise.reject(res) Promise.reject(res)
} }
return Promise.reject(error.response) return Promise.reject(error.response)
@ -160,9 +131,9 @@ service.interceptors.response.use(
} }
); );
function get (url, params) { function get(url, params){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) =>{
service.get(url, { params: params }).then(res => { service.get(url, {params: params}).then(res => {
resolve(res) resolve(res)
}).catch(err => { }).catch(err => {
reject(err) reject(err)
@ -170,9 +141,9 @@ function get (url, params) {
}) })
} }
function post (url, params) { function post(url, params){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) =>{
service.post(url, params).then(res => { service.post(url,params).then(res => {
resolve(res) resolve(res)
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data)
@ -180,8 +151,8 @@ function post (url, params) {
}) })
} }
function del (url, params) { function del(url, params){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) =>{
service.delete(url, { service.delete(url, {
params params
}).then(res => { }).then(res => {
@ -192,8 +163,8 @@ function del (url, params) {
}) })
} }
function put (url, params) { function put(url, params){
return new Promise((resolve, reject) => { return new Promise((resolve, reject) =>{
service.put(url, { service.put(url, {
params params
}).then(res => { }).then(res => {
@ -203,4 +174,4 @@ function put (url, params) {
}) })
}) })
} }
export { get, post, del, put } export { get,post,del,put }

@ -7,14 +7,7 @@
* 业务配置 * 业务配置
* */ * */
const url = location.host const env = process.env.NODE_ENV;
const dev = process.env.NODE_ENV === 'development' // 本地
let host = `${location.origin}/`
if (dev) {
// host = 'https://www.dataforward.cn/'
// host = 'http://118.31.167.228/'
host = 'http://192.168.31.217:9000/'
}
const Setting = { const Setting = {
/** /**
@ -28,11 +21,11 @@ const Setting = {
showProgressBar: true, showProgressBar: true,
/** /**
* 接口地址 * 接口地址
* 测试http://121.37.12.51 * 测试http://39.108.250.202:9000
* 正式https://www.dataforward.cn * 正式http://www.dataforward.cn:9000
* */ * */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://121.37.12.51', // apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
apiBaseURL: host, apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000/' : `${location.origin}:9000/`,
// 加密货币接口地址 // 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`, cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
@ -54,7 +47,7 @@ const Setting = {
/** /**
* 默认密码 * 默认密码
*/ */
initialPassword: '1122aa', initialPassword: '111aaa',
/** /**
* 所属平台1->职站 2->数据平台 3->中台 * 所属平台1->职站 2->数据平台 3->中台
*/ */

@ -9,7 +9,7 @@
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' import util from '@/libs/util'
import { post, get } from '@/plugins/requests/index.js' import {post,get,del,put} from '@/plugins/requests/index.js'
import api from '@/api' import api from '@/api'
/** /**
@ -27,9 +27,9 @@ export default {
}, },
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.avatar if(info.avatar) state.avatar = info.avatar
if (info.schoolId) state.schoolId = info.schoolId if(info.schoolId) state.schoolId = info.schoolId
if (info.userName) state.userName = info.userName if(info.userName) state.userName = info.userName
}, },
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
@ -45,10 +45,10 @@ export default {
}, },
}, },
actions: { actions: {
login ({ state, commit }, userInfo) { login({ state,commit }, userInfo) {
const { account, password, code, random, distinguish } = userInfo const { account, password, code, random, distinguish } = userInfo
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
post(api.logins, { post(api.logins,{
account, account,
password, password,
code, code,
@ -57,20 +57,27 @@ export default {
type: 2, // 平台端区分:0->教师端 1->学生端 2->无端 type: 2, // 平台端区分:0->教师端 1->学生端 2->无端
platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台) platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台)
}).then(res => { }).then(res => {
if (res.status == 200) { if(res.status == 200){
util.local.set(Setting.tokenKey, res.data.token, 43200000) util.local.set(Setting.tokenKey,res.data.token,43200000)
util.successMsg('登录成功') util.successMsg('登录成功')
get(api.isClient).then(res => {
commit('SET_CUSTOMER',res.customer)
const userName = res.customerName
userName && commit('SET_INFO', {
userName
})
}).catch(res => {})
post(api.getSchoolIdByToken).then(res => { post(api.getSchoolIdByToken).then(res => {
commit('SET_INFO', res) commit('SET_INFO',res)
}).catch(res => { }) }).catch(res => {})
setTimeout(() => { setTimeout(() => {
// 登录次数+1 // 登录次数+1
post(api.saveRecord, { post(api.saveRecord,{
type: 3, type: 3,
}).then(res => { }).catch(res => { }) }).then(res => {}).catch(res => {})
}, 3000) },3000)
resolve() resolve()
} else { }else{
util.errorMsg(res.message) util.errorMsg(res.message)
reject(res) reject(res)
} }
@ -79,29 +86,25 @@ export default {
}) })
}) })
}, },
logout ({ commit, state, dispatch }) { logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
post(api.logout).then(() => {
util.local.remove(Setting.storeKey) util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey) util.local.remove(Setting.tokenKey)
location.reload() location.reload()
resolve() resolve()
}).catch(error => {
reject(error)
})
}) })
}, },
setAvatar ({ state, commit }, avatar) { setAvatar({ state,commit },avatar) {
commit('SET_AVATAR', avatar) commit('SET_AVATAR',avatar)
}, },
setInfo ({ state, commit }, info) { setInfo({ state,commit },info) {
commit('SET_INFO', info) commit('SET_INFO',info)
}, },
setManager ({ state, commit }, isManager) { setManager({ state,commit },isManager) {
commit('SET_MANAGER', isManager) commit('SET_MANAGER',isManager)
}, },
setCustomer ({ state, commit }, isCustomer) { setCustomer({ state,commit },isCustomer) {
commit('SET_CUSTOMER', isCustomer) commit('SET_CUSTOMER',isCustomer)
}, },
} }
} }

@ -14,6 +14,5 @@ module.exports = {
  assetsDir: Setting.assetsDir,   assetsDir: Setting.assetsDir,
devServer: { devServer: {
port: 8092 port: 8092
}, }
productionSourceMap: false,
} }
Loading…
Cancel
Save