Compare commits

...

8 Commits

  1. 1
      README.md
  2. 27
      public/index.html
  3. 8
      src/api/index.js
  4. BIN
      src/assets/img/index/customer.jpg
  5. BIN
      src/assets/img/index/customer.png
  6. 13
      src/layouts/footer/index.vue
  7. 42
      src/layouts/header/index.vue
  8. 82
      src/layouts/home/index.vue
  9. 208
      src/pages/account/login/index.vue
  10. 79
      src/pages/data/list/index.vue
  11. 4
      src/pages/index/list/index.vue
  12. 119
      src/pages/screen/list/index.vue
  13. 53
      src/pages/user/list/index.vue
  14. 55
      src/plugins/requests/index.js
  15. 6
      src/setting.js
  16. 13
      src/store/modules/user.js
  17. 3
      vue.config.js

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

@ -1,13 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="数据前瞻,数据平台,金融数据,宏观数据,行业经济数据">
<meta name="description" 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">
<title>数据前瞻——海量,真实,易用,动态更新的财经数据库</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="keywords" content="数据前瞻,数据平台,金融数据,宏观数据,行业经济数据" />
<meta
name="description"
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>
<body>
<noscript>
@ -16,5 +28,4 @@
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

@ -3,12 +3,15 @@ const host = Setting.apiBaseURL
export default {
// 登录注册
logins: `users/users/user/login`,
logins: `users/users/user/login`,
verification: `${host}users/users/user/captcha`,
sendPhoneVerificationCode: `users/users/user/sendPhoneVerificationCode`,
getToken: `users/users/user/getToken`,
getOtherAccountByPhone: `users/users/user/getOtherAccountByPhone`,
unbindAccounts: `users/users/user/unbindAccounts`,
logout: `users/users/user/logout`,
checkUserNameOrWorkNumber: `users/users/batchProcessing/checkUserNameOrWorkNumber`,
updateUserNameOrWorkNumber: `users/users/batchProcessing/updateUserNameOrWorkNumber`,
// 加密货币
market: `/topic/market`,
@ -50,11 +53,10 @@ export default {
unbindMobilePhone: `users/users/userAccount/unbindMobilePhone`,
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `users/users/userAccount/examinePassword`,
isClient: `${host}users/users/user/isClient`,
deleteProfile: `users/users/userInfo/deleteProfile`,
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`,
userTemplate: `http://121.37.12.51/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: `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`,
// 角色管理
batchRemove: `users/users/role/batchRemove`,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

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

@ -29,16 +29,19 @@
</div>
</div>
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true" @close="closePassword" width="30%">
<el-dialog title="修改密码" :visible.sync="passwordVisible" :close-on-click-modal="false" :append-to-body="true"
@close="closePassword" width="30%">
<el-form ref="passwordForm" label-width="82px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码"
@keyup.enter.native="editPassword"></el-input>
</el-form-item>
<el-form-item label="确认新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码"
@keyup.enter.native="editPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -114,10 +117,6 @@ export default {
avatar: userInfo.userAvatars,
userName: userInfo.userName
})
//
userInfo.userName || this.$get(this.api.isClient).then(res => {
res.customerName && this.setInfo({userName: res.customerName})
}).catch(res => {})
}).catch(err => { })
},
hideSetting () {
@ -195,6 +194,7 @@ export default {
</script>
<style lang="scss" scoped>
$height: 64px;
.header {
z-index: 10;
position: fixed;
@ -204,6 +204,7 @@ $height: 64px;
height: $height;
background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner {
display: flex;
justify-content: space-between;
@ -212,6 +213,7 @@ $height: 64px;
padding: 0 80px 0 10px;
margin: 0 auto;
}
.logo {
position: absolute;
top: 0;
@ -236,6 +238,7 @@ $height: 64px;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
input {
width: 195px;
margin-left: 10px;
@ -243,26 +246,41 @@ $height: 64px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&::-webkit-input-placeholder {
color: #999
}
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none;
}
}
.remove {
cursor: pointer;
}
.search-icon {
width: 18px;
}
}
.action {
display: inline-flex;
align-items: center;
.icon {
cursor: pointer;
}
.user-wrap {
display: inline-flex;
align-items: center;
@ -271,6 +289,7 @@ $height: 64px;
display: inline-flex;
align-items: center;
cursor: pointer;
.username {
margin-left: 10px;
color: #000;
@ -279,13 +298,16 @@ $height: 64px;
}
}
}
.login {
display: inline-flex;
align-items: center;
cursor: pointer;
&:hover {
opacity: .9;
}
span {
margin-left: 5px;
color: #666;

@ -21,7 +21,9 @@
<img v-if="item.coverUrl" :src="item.coverUrl" alt="" class="cover">
<ul class="detail">
<li v-for="(item, i) in item.logContents" :key="i">
<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>
<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>
<div class="val">
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p>
</div>
@ -35,6 +37,21 @@
</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>
</template>
@ -66,7 +83,18 @@ export default {
name: '优化',
icon: 'optimize'
}
]
],
realNameVisible: false,
realNameForm: {
userName: '',
workNumber: '',
},
realNameRules: {
userName: [
{ required: true, message: '请输入真实姓名', trigger: 'blur' }
],
},
};
},
components: {
@ -81,6 +109,7 @@ export default {
mounted () {
this.autoLogout()
this.logView || this.getLogStatus() // logViewfalse
this.handleRealName()
},
methods: {
...mapMutations("user", [
@ -89,6 +118,14 @@ export default {
...mapActions('user', [
'logout'
]),
//
async handleRealName () {
const res = await this.$post(this.api.checkUserNameOrWorkNumber)
//
if (res.hasName) {
this.realNameVisible = true
}
},
//
getLog () {
this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => {
@ -126,16 +163,30 @@ export default {
setTimeout(this.logout, 1500)
}
}, 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>
<style lang="scss" scoped>
.main {
min-height: calc(100% - 64px);
.layout {
padding-top: 64px;
}
.view {
min-width: $min-width;
min-height: calc(100vh - 134px);
@ -148,10 +199,12 @@ export default {
url(../../assets/img/shapes/shape9.png) right 645px no-repeat,
url(../../assets/img/shapes/shape6.png) 0 1074px no-repeat;
}
.index {
padding: 0;
}
}
.log-mask {
position: fixed;
top: 0;
@ -160,6 +213,7 @@ export default {
right: 0;
background-color: rgba(0, 0, 0, .4);
}
/deep/.log-dia {
z-index: 11;
position: absolute;
@ -169,10 +223,12 @@ export default {
transform: translateX(-50%);
background-color: #fff;
border-radius: 6px;
.bg1 {
width: 100%;
height: 140px;
}
.bg2 {
position: absolute;
top: -130px;
@ -180,6 +236,7 @@ export default {
max-width: 100%;
height: 250px;
}
.log-title {
position: absolute;
top: 65px;
@ -190,53 +247,64 @@ export default {
color: #fff;
font-weight: 600;
}
.log-wrap {
padding-bottom: 30px;
}
.logs {
max-height: 250px;
padding: 0 100px;
margin: 30px 0;
overflow: auto;
}
h6 {
margin-bottom: 15px;
font-size: 16px;
color: #333;
line-height: 1;
}
.more-wrap {
padding: 0 60px;
font-size: 14px;
color: #333;
text-align: center;
}
.know {
margin-top: 15px;
}
.cover {
max-width: 250px;
max-height: 160px;
margin: 10px 0 20px;
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 14px;
img {
width: 20px;
margin-right: 8px;
}
}
.val {
font-size: 15px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
font-size: 13px;
@ -245,4 +313,14 @@ export default {
}
}
}
/deep/.name-dia {
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding-bottom: 10px;
}
}
</style>

@ -4,20 +4,15 @@
<div class="form">
<h6 class="title">欢迎使用请登录</h6>
<ul class="tab">
<li v-for="(item,index) in tabList" :key="index" :class="{active: form.distinguish == item.id}" @click="typeClick(item)">{{item.label}}</li>
<li v-for="(item, index) in tabList" :key="index" :class="{ active: form.distinguish == item.id }"
@click="typeClick(item)">{{ item.label }}</li>
</ul>
<el-form :model="form" :rules="rules" ref="form" style="margin-top: 20px">
<!-- 学号工号 -->
<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>
<div v-show="!form.distinguish && !verCodeLogin" class="items">
<el-form-item class="flex-1" prop="workNumber">
<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>
</div>
<!-- 手机号登录 -->
@ -25,7 +20,7 @@
<label class="label account"></label>
<el-input v-model.trim="form.account" placeholder="请输入账号" @keyup.enter.native="submit"></el-input>
</el-form-item>
<template v-if="form.distinguish === 2">
<template v-if="verCodeLogin">
<el-form-item prop="account">
<label class="label account"></label>
<el-input v-model.trim="form.account" placeholder="请输入手机号/邮箱" @keyup.enter.native="submit"></el-input>
@ -33,36 +28,30 @@
<el-form-item prop="code">
<label class="label code"></label>
<div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input>
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6"
@keyup.enter.native="submit"></el-input>
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin
}}
</el-button>
</div>
</el-form-item>
</template>
<template v-if="form.distinguish !== 2">
<template v-else>
<el-form-item prop="password">
<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-form-item>
<el-form-item prop="code">
<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>
<img @click="getVerImg" :src="verificationIMG" class="ver-img" alt="">
</el-form-item>
</template>
<div v-show="!form.distinguish" class="default-check">
<el-checkbox v-model="setDefault">设置为默认学校</el-checkbox>
<div class="bottom">
<el-link :underline="false" type="primary" @click="switchType">{{ verCodeLogin ? '密码' : '验证码' }}登录</el-link>
<!-- <el-link :underline="false" type="primary" @click="toAccount">没有账号点击申请</el-link> -->
</div>
<el-button class="submit" type="primary" @click="submit">登录</el-button>
</el-form>
@ -78,7 +67,9 @@
<el-form-item label="验证码">
<div class="ver-code">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{phoneBtnText}}</el-button>
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)"
:disabled="binding === '' || phoneDisabled">{{
phoneBtnText }}</el-button>
</div>
</el-form-item>
</el-form>
@ -87,7 +78,8 @@
<el-button size="small" type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" width="500px">
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia"
width="500px">
<p class="tips">该手机号已绑定以下用户信息</p>
<ul class="users">
<li :class="{ isEnable: !user.isEnable }" v-for="(user, i) in users" :key="i" @click="chooseUser(user)">
@ -96,7 +88,8 @@
</li>
</ul>
</el-dialog>
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" :show-close="false" custom-class="info-dia" width="400px">
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" :show-close="false" custom-class="info-dia"
width="400px">
<div class="info-header">
<i class="el-icon-warning"></i>
提示
@ -136,36 +129,30 @@ export default {
tabList: [
{
id: 0,
label: '学号/工号登录'
label: '学生/老师登录'
}, {
id: 1,
label: '学校管理员登录'
}, {
id: 2,
label: '手机号/邮箱'
}
],
setDefault: !!util.local.get(schoolIdKey), // id
verificationIMG: '',
schoolList: [],
form: {
schoolId: '',
workNumber: '',
account: '',
account: '', //
password: '',
code: '', //
random: '', //
distinguish: 0, // ,1,2
type: 2, // 0-> 1-> 2->
platform: Setting.platformId
platform: Setting.platformId,
distinguish: 0,
},
rules: {
schoolId: [{ required: true, message: "请选择学校", trigger: "change" }],
workNumber: [{ required: true, message: "请输入学生学号", trigger: "blur" }],
workNumber: [{ required: true, message: "请输入学号/工号/手机号/邮箱", trigger: "blur" }],
account: [{ required: false, message: "请输入账号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
},
verCodeLogin: false,
phoneDisabledLogin: false,
phoneTimerLogin: null,
phoneBtnTextLogin: '发送验证码',
@ -188,7 +175,6 @@ export default {
},
components: { vHead, vFooter },
mounted () {
this.getSchool()
this.getVerImg()
},
methods: {
@ -198,21 +184,17 @@ export default {
...mapActions('user', [
'login', 'setCustomer'
]),
// id
setSchool(list) {
this.schoolList = list
// id
const schoolId = util.local.get(schoolIdKey)
if (schoolId) this.form.schoolId = schoolId
},
//
getSchool() {
this.$get(this.api.querySchool, {
provinceId: '',
cityId: ''
}).then(({ list }) => {
this.setSchool(list)
}).catch(res => {})
//
handleRule () {
const type = this.form.distinguish
const rules = this.rules
rules.workNumber[0].required = !type && !this.verCodeLogin
rules.account[0].required = (!type && this.verCodeLogin) || type
this.rules.account[0].message = type ?
'请输入账号' :
this.verCodeLogin ?
'请输入手机号/邮箱' :
'请输入学号/工号/手机号/邮箱'
},
//
typeClick (tab) {
@ -231,14 +213,7 @@ export default {
platform: form.platform
}
this.$refs.form.clearValidate()
//
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 ?
'请输入账号' :
'请输入手机号/邮箱'
this.handleRule()
},
//
chooseUser (user) {
@ -276,11 +251,7 @@ export default {
this.$refs.form.validate(valid => {
if (valid) {
const form = JSON.parse(JSON.stringify(this.form))
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
if (this.verCodeLogin) form.distinguish = 2
this.$post(this.api.logins, form).then(({ status, data, message }) => {
//
if (status == 30001) {
@ -288,23 +259,23 @@ export default {
this.getVerImg()
form.code = ''
} else if (status == 200) {
const accounts = data.userAccounts
//
if (data instanceof Array) {
//
if (data.length === 1) {
this.chooseUser(data[0])
} else {
this.users = data
if (accounts instanceof Array) {
this.users = accounts
this.userVisible = true
}
} else {
this.token = data.token
this.setLogin()
}
} else {
form.code = ''
util.errorMsg(message)
}
}).catch(res => {})
}).catch(res => {
this.getVerImg()
form.code = ''
})
}
})
},
@ -326,6 +297,17 @@ export default {
return true
},
//
switchType () {
this.verCodeLogin = !this.verCodeLogin
this.$refs.form.clearValidate()
this.handleRule()
},
//
toAccount () {
this.accountVisible = true
},
//
phoneCountdownLogin () {
let count = 60
@ -474,16 +456,19 @@ export default {
<style scoped lang="scss">
.wrap {
min-height: 100%;
background-color: #F3F6FA;
background-color: #f3f6fa;
}
.ver-code {
position: relative;
.el-button {
position: absolute;
top: 10px;
right: 10px;
}
}
.login {
min-height: calc(100vh - 70px);
padding-top: calc((100vh - 611px) / 2);
@ -493,12 +478,14 @@ export default {
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/shape6.png) (right bottom) / auto no-repeat;
.tab {
display: flex;
justify-content: space-between;
justify-content: space-around;
align-items: center;
margin-bottom: 24px;
border-bottom: 2px solid #E1E6F2;
border-bottom: 2px solid #e1e6f2;
li {
padding: 18px 0;
margin-bottom: -1px;
@ -506,50 +493,62 @@ export default {
color: #555;
cursor: pointer;
border-bottom: 4px solid transparent;
&:last-child {
margin-right: 0;
}
&.active {
color: $main-color;;
color: $main-color;
border-bottom-color: $main-color;
}
}
}
.items {
display: flex;
align-items: center;
}
.form {
width: 436px;
padding: 38px 38px 60px;
margin: 0 auto 0;
border-radius: 6px;
background-color: #fff;
.title {
margin-bottom: 25px;
font-size: 26px;
color: #0B1D30;
color: #0b1d30;
letter-spacing: 4px;
}
}
/deep/.el-form-item {
margin-bottom: 20px;
}
/deep/.el-input__inner {
position: relative;
height: 52px;
padding: 0 20px 0 34px;
line-height: 50px;
background-color: #FBFBFB;
border: 1px solid #E1E6F2;
background-color: #fbfbfb;
border: 1px solid #e1e6f2;
border-radius: 4px !important;
}
.default-check {
text-align: right;
.bottom {
display: flex;
justify-content: space-between;
}
.el-select {
width: 100%;
}
.label {
z-index: 1;
position: absolute;
@ -559,32 +558,39 @@ export default {
height: 18px;
background: url(../../../assets/img/login/account.png) 0 0/100% 100% no-repeat;
}
.school {
background-image: url(../../../assets/img/login/school.png);
}
.workNumber {
width: 17px;
background-image: url(../../../assets/img/login/workNumber.png);
}
.password {
top: 18px;
background-image: url(../../../assets/img/login/password.png);
}
.code {
top: 18px;
background-image: url(../../../assets/img/login/code.png);
}
.ver-img {
position: absolute;
top: 1px;
right: 1px;
}
/deep/.el-form-item__error {
top: 105%;
left: auto;
right: 0;
color: #FFA94E;
color: #ffa94e;
}
.submit {
width: 100%;
height: 48px;
@ -597,31 +603,37 @@ export default {
border: 0;
}
}
.copyright {
padding: 18px 0;
font-size: 12px;
text-align: center;
background-color: #F3F6FA;
background-color: #f3f6fa;
a {
color:#B1B4B8;
color: #b1b4b8;
font-size: 12px;
&:hover {
opacity: .8;
opacity: 0.8;
}
}
}
.tips {
margin: 0 0 10px 5px;
font-size: 14px;
text-align: center;
color: #666;
}
/deep/.user-dia {
.tips {
margin-bottom: 20px;
text-align: center;
color: #666;
}
.users {
li {
display: flex;
@ -633,27 +645,33 @@ export default {
font-size: 14px;
background-color: #ebeef5;
cursor: pointer;
&.isEnable {
color: #c0c4cc;
background-color: #f5f7fa;
cursor: not-allowed;
}
&:last-child {
margin-bottom: 0;
}
&:hover {
background-color: #d3e0ff;
}
i {
font-size: 16px;
}
}
}
}
/deep/.info-dia {
.el-dialog__header {
border-bottom: 0;
}
.info-header {
position: absolute;
top: 20px;
@ -662,38 +680,46 @@ export default {
font-size: 16px;
color: #333;
}
.el-icon-warning {
margin-right: 10px;
color: #e6a23c;
font-size: 24px;
}
.info-wrap {
padding: 10px 33px;
}
.users {
max-height: 125px;
margin-top: 20px;
overflow: auto;
li {
margin: 5px;
font-size: 14px;
color: #333;
}
}
.info-footer {
display: flex;
justify-content: space-between;
// align-items: center;
margin-top: 20px;
}
.el-button {
width: 142px;
}
.unbind {
white-space: normal;
line-height: 1.6;
}
}
@media (max-height: 680px) {
.wrap .login {
padding: 40px 0;

@ -1,7 +1,8 @@
<template>
<div class="wrap">
<div class="left">
<el-menu class="menu" ref="type" @open="selectType" @select="selectType" unique-opened :default-active="defaultType" :default-openeds="defaultOpenType">
<el-menu class="menu" ref="type" @open="selectType" @select="selectType" unique-opened
:default-active="defaultType" :default-openeds="defaultOpenType">
<menuTree :menuList="typeList"></menuTree>
</el-menu>
</div>
@ -17,9 +18,11 @@
<div class="desc">{{ introduce }}</div>
<div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{ dataSource }}</div>
<div class="page-content">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id"
highlight-current-row @current-change="previewCurrentChange">
<el-table-column type="index" width="60" label="序号" align="center"></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="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="timeRange" label="起止时间" width="175" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="90" align="center">
@ -36,13 +39,15 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
</div>
</div>
</div>
<el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload" :close-on-click-modal="false">
<el-dialog title="下载" :visible.sync="downloadVisible" width="540px" @close="closeDownload"
:close-on-click-modal="false">
<el-form ref="form" label-width="100px" label-suffix="">
<el-form-item label="数据筛选">
<div class="checkboxs">
@ -53,14 +58,19 @@
</div>
</el-form-item>
<el-form-item label="开始时间">
<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>
<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>
</el-form-item>
<el-form-item label="结束时间">
<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>
<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>
</el-form-item>
<el-form-item label="数据频率">
<el-select v-model="frequency" placeholder="请选择数据频率" size="small">
<el-option v-for="(item,index) in frequencyList" :key="index" :label="item.name" :value="item.id"></el-option>
<el-option v-for="(item, index) in frequencyList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
@ -71,11 +81,7 @@
</span>
</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="l-title" style="margin-bottom: 0">
<img src="@/assets/img/data3.png" alt="">
@ -86,7 +92,8 @@
<div class="preview-wrap">
<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 v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column>
<el-table-column v-for="(item, index) in previewHead" :prop="item.field" :key="index" :label="item.comment"
align="center"></el-table-column>
</el-table>
</div>
</el-drawer>
@ -486,40 +493,50 @@ export default {
.wrap {
display: flex;
padding-bottom: 20px !important;
/deep/.left {
width: 239px;
height: calc(100vh - 190px);
margin-right: 20px;
overflow: auto;
&::-webkit-scrollbar {
display: none;
width: 8px;
height: 8px;
}
&::-webkit-scrollbar-thumb {
display: none;
width: 5px;
border-radius: 6px;
background: rgba(173, 173, 173, .7);
}
.menu {
width: 240px;
overflow: hidden;
&>.el-menu-item,.el-submenu__title{
&>.el-menu-item,
.el-submenu__title {
span {
font-size: 15px;
color: #3381d2;
}
}
&>.el-submenu>.el-menu {
background-color: #FAFAFA !important;
}
.el-submenu__title i {
font-size: 14px;
}
.el-submenu .el-menu {
background-color: #fff;
}
.el-submenu.is-active {
.el-submenu__title {
&+.el-menu .el-submenu__title {
@ -527,25 +544,31 @@ export default {
line-height: 50px;
background-color: rgba(147, 184, 255, .15);
}
i {
color: #006EFF;
}
}
}
.el-menu-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&.is-active {
color: #fff;
background-color: #0070FF;
span {
color: #fff;
}
}
}
.level-6 {
padding-right: 0;
.el-submenu__title {
padding-left: 10px !important;
color: #fff;
@ -553,19 +576,24 @@ export default {
}
}
}
.right {
width: calc(100% - 260px);
.page {
margin-bottom: 20px;
.source {
margin-bottom: 12px;
color: #7EB1F3;
}
}
}
/deep/.el-table__body tr.current-row>td {
background-color: #daeaff;
}
.desc {
padding: 9px 12px;
margin: 20px 0 10px;
@ -574,6 +602,7 @@ export default {
background-color: #FAFAFA;
}
}
.search {
z-index: 2;
position: absolute;
@ -597,22 +626,36 @@ export default {
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&::-webkit-input-placeholder {
color: #999
}
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none;
}
}
.remove {
cursor: pointer;
}
.search-icon {
width: 18px;
}
}
/deep/.preview-dia {
padding: 20px;
.preview-wrap {
height: calc(100vh - 80px);
overflow: auto;

@ -238,7 +238,7 @@
<div class="popup wechat-popup">
<p class="tips">微信扫码添加职站售前咨询</p>
<p class="des">提供付费咨询及解决方案</p>
<img width="150" src="@/assets/img/index/customer.jpg" alt="">
<img width="150" src="@/assets/img/index/customer.png" alt="">
</div>
<div class="item tel"></div>
<div class="popup tel-popup">
@ -249,7 +249,7 @@
</div>
<div class="text">
<p class="title">售前咨询</p>
<p class="tel-num" style="margin-bottom: 5px"></p>
<p class="tel-num" style="margin-bottom: 5px">老师</p>
<p class="tel-num">18019930142</p>
</div>
</div>

@ -1,7 +1,10 @@
<template>
<div class="wrap">
<!-- 全屏 -->
<img class="full" src="@/assets/img/screen/full.png" alt="" @click="fullScreen">
<img class="full"
src="@/assets/img/screen/full.png"
alt=""
@click="fullScreen">
<!--header-->
<div class="header">
<div class="bg_header">
@ -34,10 +37,13 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_1.png" alt="">
<img src="@/assets/img/screen/t_1.png"
alt="">
中国宏观杠杆率
</div>
<div id="chart1" class="chart" style="height: 280px;"></div>
<div id="chart1"
class="chart"
style="height: 280px;"></div>
</div>
<div class="item">
<div class="t_line_box">
@ -57,10 +63,13 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_2.png" alt="">
<img src="@/assets/img/screen/t_2.png"
alt="">
新增信贷数据
</div>
<div id="chart5" class="chart t_btn9" style="height: 280px;"></div>
<div id="chart5"
class="chart t_btn9"
style="height: 280px;"></div>
</div>
<div class="item">
<div class="t_line_box">
@ -80,7 +89,8 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_7.png" alt="">
<img src="@/assets/img/screen/t_7.png"
alt="">
{{ goodsSell.length ? goodsSell[0].operation_time.substr(0, 4) : 2021 }}年商品零售价格指数
</div>
<div class="main_table">
@ -93,10 +103,13 @@
</thead>
</table>
</div>
<div class="main_table" ref="tableWrap" style="height: 196px;margin-top: 0;overflow: auto">
<div class="main_table"
ref="tableWrap"
style="height: 196px;margin-top: 0;overflow: auto">
<table>
<tbody>
<tr v-for="(item, i) in goodsSell" :key="i">
<tr v-for="(item, i) in goodsSell"
:key="i">
<td width="70%">{{ item.hct }}</td>
<td>{{ item.rcpi }}</td>
</tr>
@ -106,7 +119,8 @@
</div>
</div>
<div class="middle">
<div class="item" style="height: 350px">
<div class="item"
style="height: 350px">
<!--左上边框-->
<div class="t_line_box">
<i class="t_l_line"></i>
@ -128,31 +142,38 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_3.png" alt="">
加密货币行情
<img src="@/assets/img/screen/t_3.png"
alt="">
中国GDP年率报告
</div>
<div class="main_table">
<table>
<thead>
<tr>
<th width="30%">币种</th>
<th width="25%">最新价</th>
<th width="25%">24H成交量</th>
<th>24H涨跌</th>
<th width="50%">时间</th>
<th width="50%">年率</th>
</tr>
</thead>
</table>
</div>
<div class="main_table"
ref="gdpList"
style="max-height: 260px;margin-top: 0;overflow: auto;">
<table>
<tbody>
<tr v-for="(item, i) in cryptoList" :key="i">
<td>{{ item.currencyPair }}</td>
<td>${{ item.amount }}</td>
<td>{{ parseInt(item.total) }}M</td>
<td><p :class="['percent', {fall: item.percent < 0}]">{{ (item.percent * 100).toFixed(2) }}%</p></td>
<template v-for="(item, i) in gdps">
<tr v-if="item.value != '0'"
:key="i">
<td width="50%">{{ item.date_index }}</td>
<td width="50%">${{ item.value }}</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
<div class="item" style="height: 520px;">
<div class="item"
style="height: 520px;">
<!--左上边框-->
<div class="t_line_box">
<i class="t_l_line"></i>
@ -174,15 +195,24 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_3.png" alt="">
<img src="@/assets/img/screen/t_3.png"
alt="">
主要央行利率
</div>
<div class="earth">
<img class="lbx" src="@/assets/img/screen/lbx.png" alt="">
<img class="jt" src="@/assets/img/screen/jt.png" alt="">
<img class="map" src="@/assets/img/screen/map.png" alt="">
<img class="lbx"
src="@/assets/img/screen/lbx.png"
alt="">
<img class="jt"
src="@/assets/img/screen/jt.png"
alt="">
<img class="map"
src="@/assets/img/screen/map.png"
alt="">
</div>
<div class="chart" id="chart7" style="height: 500px"></div>
<div class="chart"
id="chart7"
style="height: 500px"></div>
</div>
</div>
<div class="right">
@ -208,10 +238,13 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_4.png" alt="">
<img src="@/assets/img/screen/t_4.png"
alt="">
全国税收收入
</div>
<div id="chart3" class="echart t_btn7" style="height: 280px;"></div>
<div id="chart3"
class="echart t_btn7"
style="height: 280px;"></div>
</div>
<div class="item">
<!--左上边框-->
@ -235,10 +268,12 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_5.png" alt="">
<img src="@/assets/img/screen/t_5.png"
alt="">
央行货币当局资产负债
</div>
<div id="chart4" style="height: 280px;"></div>
<div id="chart4"
style="height: 280px;"></div>
</div>
<div class="item">
<div class="t_line_box">
@ -258,10 +293,13 @@
<i class="b_r_line"></i>
</div>
<div class="main_title">
<img src="@/assets/img/screen/t_7.png" alt="">
<img src="@/assets/img/screen/t_7.png"
alt="">
以美元计算进口年率
</div>
<div id="chart6" class="chart" style="height: 270px;"></div>
<div id="chart6"
class="chart"
style="height: 270px;"></div>
</div>
</div>
</div>
@ -281,15 +319,22 @@ export default {
stompClientMarket: null,
stompClient: null,
goodsSell: [],
cryptoList: []
cryptoList: [],
gdps: []
}
},
mounted () {
this.connect()
this.getList()
this.renderChart()
this.renderMap()
},
methods: {
// gdp
getList () {
this.$get(`${this.api.visualPreview}?tableName=hg_zg_gm_zhongguogdpnianlvbaogao&tableId=17`).then(({ comment, data }) => {
this.gdps = data
}).catch(res => { })
},
//
getCrypto () {
this.$get(`${this.api.getTopList}`).then(res => {
@ -1215,9 +1260,13 @@ export default {
//
scrollTable () {
const dom = this.$refs.tableWrap
const dom1 = this.$refs.gdpList
setInterval(() => {
dom.scrollTop += 1
if (dom.clientHeight + dom.scrollTop === dom.scrollHeight) dom.scrollTop = 0
dom1.scrollTop += 1
if (dom1.clientHeight + dom1.scrollTop === dom1.scrollHeight) dom1.scrollTop = 0
}, 30)
}
}
@ -1225,5 +1274,5 @@ export default {
</script>
<style lang="scss" scoped>
@import "../../../styles/page/screen.scss";
@import '../../../styles/page/screen.scss';
</style>

@ -8,26 +8,31 @@
<li>
<label>创建时间</label>
<el-select v-model="month" placeholder="请选择创建时间" size="small" clearable class="flex-1">
<el-option v-for="(item,index) in monthList" :key="index" :label="item.label" :value="item.id"></el-option>
<el-option v-for="(item, index) in monthList" :key="index" :label="item.label"
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>时间范围</label>
<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>
<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>
</li>
<li>
<label>角色</label>
<el-select v-model="role" placeholder="请选择角色" size="small" clearable class="flex-1" @change="initData">
<el-option label="不限" value=""></el-option>
<template v-for="(item, index) in roleList">
<el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName" :value="item.id"></el-option>
<el-option v-if="item.roleName != '超级管理员'" :key="index" :label="item.roleName"
:value="item.id"></el-option>
</template>
</el-select>
</li>
<li>
<label>状态</label>
<el-select v-model="status" placeholder="请选择状态" size="small" clearable class="flex-1" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.label" :value="item.id"></el-option>
<el-option v-for="(item, index) in statusList" :key="index" :label="item.label"
:value="item.id"></el-option>
</el-select>
</li>
</ul>
@ -41,7 +46,8 @@
<ul class="filter">
<li style="margin-bottom: 0">
<label>搜索</label>
<el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input>
<el-input style="width: 250px" placeholder="请输入员工姓名/工号" v-model="keyword" suffix-icon="el-icon-search"
clearable size="small"></el-input>
</li>
</ul>
<div>
@ -52,7 +58,8 @@
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table :data="listData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center">
</el-table-column>
@ -76,16 +83,20 @@
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<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>
<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>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total,prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
<el-pagination background layout="total,prev, pager, next" :current-page="page"
@current-change="handleCurrentChange" :total="total"></el-pagination>
</div>
</div>
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px" @close="closeUser" class="dialog" :close-on-click-modal="false">
<el-dialog :title="isDetail ? '查看账号' : (form.userId ? '编辑账号' : '新增账号')" :visible.sync="userVisible" width="576px"
@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-item prop="workNumber" label="工号/学号">
<el-input v-model="form.workNumber" placeholder="请输入工号/学号" @change="workNumberChange"></el-input>
@ -97,7 +108,8 @@
<div class="role-wrap">
<el-checkbox-group v-model="form.roleIds">
<template v-for="(item, index) in roleList">
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :title="item.roleName">{{item.roleName}}</el-checkbox>
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id"
:title="item.roleName">{{ item.roleName }}</el-checkbox>
</template>
</el-checkbox-group>
</div>
@ -118,10 +130,14 @@
</span>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport" :close-on-click-modal="false">
<el-dialog title="批量导入" :visible.sync="importVisible" width="400px" @close="closeImport"
:close-on-click-modal="false">
<div class="upload-wrap" :class="{ lg: uploadFaild }">
<el-button class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt=""> 模板下载</el-button>
<el-upload 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 class="download" size="small" @click="downLoad"><img src="../../../assets/img/download.png" alt="">
模板下载</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-upload>
<div class="link" v-if="uploadFaild">
@ -577,26 +593,33 @@ export default {
.l-title {
margin-bottom: 24px;
}
.filter {
flex-wrap: wrap;
li {
width: 22%;
}
}
/deep/.dialog {
.el-form-item {
.el-form-item__label {
font-size: 16px;
color: rgba(0, 0, 0, 0.65);
&:before {
margin-right: 0;
color: #CC221C;
}
}
}
.el-input,.el-select{
.el-input,
.el-select {
width: 100%;
}
.role-wrap {
max-height: 130px;
padding: 10px 12px 0;
@ -604,11 +627,13 @@ export default {
border-radius: 4px;
overflow: auto;
}
.el-checkbox {
display: inline-flex;
width: 33.33%;
margin-right: 0;
}
.el-checkbox__label {
max-width: 108px;
overflow: hidden;

@ -1,5 +1,5 @@
import axios from 'axios'
import util from '@/libs/util'
import Util from '@/libs/util'
import router from '@/router/index'
import Setting from '@/setting'
import store from '@/store'
@ -18,17 +18,24 @@ let check = true
let checkTimer = null
// 检测账号是否被禁用,如果禁用则提示并退出登录
function checkDisabled () {
const token = util.local.get(Setting.tokenKey)
const token = Util.local.get(Setting.tokenKey)
if (!token) return false
check = false
axios.get(baseURL + api.accountIsDisabled + '?token=' + token, {
token: util.local.get(Setting.tokenKey),
token: Util.local.get(Setting.tokenKey),
headers: {
token
}
}).then(res => {
if (res.data) {
util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
if (res.data.code === 401) {
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg(res.data.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
location.reload()
}, 1500)
} else if (res.data) {
Util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
@ -37,7 +44,7 @@ function checkDisabled () {
}
// 请求拦截器
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
let storeSchoolId = store.state.user.schoolId
let routeSchoolId = router.app._route.query.schoolId
@ -51,7 +58,7 @@ service.interceptors.request.use(config => {
}, 2000)
return config
}, err => {
util.errorMsg({
Util.errorMsg({
message: '退出登陆',
onClose: function () {
router.push({ name: '/login' })
@ -66,6 +73,20 @@ service.interceptors.response.use(
const res = response.data
if (res.status == 200) {
return Promise.resolve(res).catch(e => { })
} else if (res.code === 401) {
// 账号互踢
if (!logouted) {
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
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) {
@ -78,7 +99,7 @@ service.interceptors.response.use(
})
return Promise.reject(res)
} else {
util.errorMsg(res.message)
Util.errorMsg(res.message)
res.message === '该账号无权限!' && setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
@ -93,9 +114,9 @@ service.interceptors.response.use(
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录')
setTimeout(() => {
router.replace({
path: '/login'
@ -103,16 +124,16 @@ service.interceptors.response.use(
}, 1000)
break
case 500:
util.errorMsg('网络错误')
Util.errorMsg('网络错误')
break
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
Util.local.remove(Setting.storeKey)
Util.local.remove(Setting.tokenKey)
Util.errorMsg('登录过期,请重新登录')
// 清除token
// store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
@ -127,11 +148,11 @@ service.interceptors.response.use(
break
// 404请求不存在
case 404:
util.errorMsg('网络请求不存在!')
Util.errorMsg('网络请求不存在!')
break
// 其他错误,直接抛出错误提示
default:
util.errorMsg(error.response.data.message)
Util.errorMsg(error.response.data.message)
Promise.reject(res)
}
return Promise.reject(error.response)

@ -11,7 +11,9 @@ const url = location.host
const dev = process.env.NODE_ENV === 'development' // 本地
let host = `${location.origin}/`
if (dev) {
host = 'http://121.37.12.51/'
// host = 'https://www.dataforward.cn/'
// host = 'http://118.31.167.228/'
host = 'http://192.168.31.217:9000/'
}
const Setting = {
@ -52,7 +54,7 @@ const Setting = {
/**
* 默认密码
*/
initialPassword: '111aaa',
initialPassword: '1122aa',
/**
* 所属平台1->职站 2->数据平台 3->中台
*/

@ -9,7 +9,7 @@
import Setting from '@/setting'
import util from '@/libs/util'
import {post,get,del,put} from '@/plugins/requests/index.js'
import { post, get } from '@/plugins/requests/index.js'
import api from '@/api'
/**
@ -60,13 +60,6 @@ export default {
if (res.status == 200) {
util.local.set(Setting.tokenKey, res.data.token, 43200000)
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 => {
commit('SET_INFO', res)
}).catch(res => { })
@ -88,10 +81,14 @@ export default {
},
logout ({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
post(api.logout).then(() => {
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
location.reload()
resolve()
}).catch(error => {
reject(error)
})
})
},
setAvatar ({ state, commit }, avatar) {

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