Compare commits

...

8 Commits

  1. 1
      README.md
  2. 45
      public/index.html
  3. 92
      src/api/index.js
  4. BIN
      src/assets/img/index/customer.jpg
  5. BIN
      src/assets/img/index/customer.png
  6. 83
      src/layouts/footer/index.vue
  7. 314
      src/layouts/header/index.vue
  8. 380
      src/layouts/home/index.vue
  9. 1172
      src/pages/account/login/index.vue
  10. 513
      src/pages/data/list/index.vue
  11. 4
      src/pages/index/list/index.vue
  12. 2243
      src/pages/screen/list/index.vue
  13. 1205
      src/pages/user/list/index.vue
  14. 313
      src/plugins/requests/index.js
  15. 150
      src/setting.js
  16. 177
      src/store/modules/user.js
  17. 3
      vue.config.js

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

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

@ -3,12 +3,15 @@ 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`,
@ -29,70 +32,69 @@ 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/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/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/occupationlab/architecture/checkEmailOrPhone`,
accountIsDisabled: `users/users/user/accountIsDisabled`, 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`, batchRemove: `users/users/role/batchRemove`,
getRole:`users/users/role/obtainDetails`, getRole: `users/users/role/obtainDetails`,
getName:`data/data/role/getName`, getName: `data/data/role/getName`,
listRole:`users/users/role/list`, listRole: `users/users/role/list`,
removeRole:`data/data/role/remove`, removeRole: `data/data/role/remove`,
saveOrUpdate:`users/users/role/saveOrUpdate`, saveOrUpdate: `users/users/role/saveOrUpdate`,
getPermissions:`users/users/user-role/getUserRolesPermissionMenu`, getPermissions: `users/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/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/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: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@ -6,58 +6,59 @@
* @Description: In User Settings Edit * @Description: In User Settings Edit
--> -->
<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>联系人孙经理 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>
</div>
</div> </div>
<div class="copyright">
<span>© Copyright 2021 Dataforward 数据前瞻</span>
<a href="https://beian.miit.gov.cn/#/Integrated/index"
target="_blank">粤ICP备20072679号</a>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
data() { data () {
return { return {
}; };
}, },
mounted(){ mounted () {
}, },
methods: { methods: {
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.footer{ .footer {
padding: 17px 0 9px; padding: 17px 0 9px;
text-align: center;
background-color: #0f1d2e;
.info {
margin-bottom: 7px;
font-size: 14px;
line-height: 20px;
color: #d7dfe7;
}
.copyright {
font-size: 12px;
text-align: center; text-align: center;
background-color: #0F1D2E; line-height: 17px;
.info{ span {
margin-bottom: 7px; margin-right: 20px;
font-size: 14px; color: #757f8a;
line-height: 20px;
color: #D7DFE7;
} }
.copyright{ a {
color: #757f8a;
font-size: 12px; font-size: 12px;
text-align: center; &:hover {
line-height: 17px; color: #c7c7c7;
span{
margin-right: 20px;
color: #757F8A;
}
a{
color:#757F8A;
font-size: 12px;
&:hover{
color: #c7c7c7;
}
} }
} }
} }
}
</style> </style>

@ -1,52 +1,55 @@
<template> <template>
<div class="header"> <div class="header">
<a class="logo" @click="toIndex"> <a class="logo" @click="toIndex">
<img src="@/assets/img/logo.png" alt=""> <img src="@/assets/img/logo.png" alt="">
</a> </a>
<div class="inner"> <div class="inner">
<div style="height: 64px;"></div> <div style="height: 64px;"></div>
<navbar ref="nav" @hideSetting="hideSetting"></navbar> <navbar ref="nav" @hideSetting="hideSetting"></navbar>
<div class="action" v-if="token"> <div class="action" v-if="token">
<img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager"> <img v-if="showSetting" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<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>
<template v-else> <template v-else>
<el-dropdown-item command="resetPw">修改密码</el-dropdown-item> <el-dropdown-item command="resetPw">修改密码</el-dropdown-item>
<el-dropdown-item command="myDownload">我的下载</el-dropdown-item> <el-dropdown-item command="myDownload">我的下载</el-dropdown-item>
</template> </template>
<el-dropdown-item command="logout">退出登录</el-dropdown-item> <el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
<div class="login" v-else-if="!isLogin" @click="toLogin"> <div class="login" v-else-if="!isLogin" @click="toLogin">
<img src="@/assets/img/user.png" alt=""> <img src="@/assets/img/user.png" alt="">
<span>登录</span> <span>登录</span>
</div> </div>
</div>
<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-form-item>
<el-form-item label="确认新密码">
<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">
<el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button size="small" type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
</div> </div>
<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-form-item>
<el-form-item label="确认新密码">
<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">
<el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button size="small" type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import navbar from '../navbar' import navbar from '../navbar'
@ -54,7 +57,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',
@ -79,7 +82,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
@ -104,7 +107,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
@ -114,16 +117,12 @@ 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()
@ -132,11 +131,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({
@ -154,7 +153,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') {
@ -165,10 +164,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('请确认新密码')
@ -183,7 +182,7 @@ export default {
this.passwordVisible = false this.passwordVisible = false
}).catch(err => { }) }).catch(err => { })
}, },
closePassword() { closePassword () {
this.passwordForm = { this.passwordForm = {
password: '', password: '',
newPassword: '', newPassword: '',
@ -195,102 +194,125 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 64px; $height: 64px;
.header{
z-index: 10; .header {
position: fixed; z-index: 10;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: $height;
background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner {
display: flex;
justify-content: space-between;
align-items: center;
min-width: $min-width;
padding: 0 80px 0 10px;
margin: 0 auto;
}
.logo {
position: absolute;
top: 0; top: 0;
left: 0; left: 80px;
width: 100%; font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer;
}
.search {
z-index: 2;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: $height; height: $height;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff; background-color: #fff;
box-shadow: 0px 0px 6px 0px rgba(178, 178, 178, 0.32);
.inner{ input {
display: flex; width: 195px;
justify-content: space-between; margin-left: 10px;
align-items: center; font-size: 14px;
min-width: $min-width; color: #333;
padding: 0 80px 0 10px; background-color: transparent;
margin: 0 auto; border: 0;
&::-webkit-input-placeholder {
color: #999
}
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none;
}
} }
.logo{
position: absolute; .remove {
top: 0; cursor: pointer;
left: 80px;
font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer;
} }
.search{ .search-icon {
z-index: 2; width: 18px;
position: absolute;
top: 0;
left: 70%;
transform: translate(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 300px;
height: $height;
padding: 7px 20px;
margin: 0 auto;
background-color: #fff;
input{
width: 195px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&:focus{
outline: none;
}
}
.remove{
cursor: pointer;
}
.search-icon{
width: 18px;
}
} }
.action{ }
display: inline-flex;
align-items: center;
.icon{
cursor: pointer;
}
.user-wrap {
display: inline-flex;
align-items: center;
.user{ .action {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer;
.username{ .icon {
margin-left: 10px; cursor: pointer;
color: #000;
font-size: 16px;
}
}
}
} }
.login{
.user-wrap {
display: inline-flex;
align-items: center;
.user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
&:hover{
opacity: .9; .username {
} margin-left: 10px;
span{ color: #000;
margin-left: 5px; font-size: 16px;
color: #666;
font-size: 14px;
} }
}
}
}
.login {
display: inline-flex;
align-items: center;
cursor: pointer;
&:hover {
opacity: .9;
}
span {
margin-left: 5px;
color: #666;
font-size: 14px;
} }
}
} }
</style> </style>

@ -1,41 +1,58 @@
<template> <template>
<div class="main"> <div class="main">
<v-head></v-head> <v-head></v-head>
<div class="layout"> <div class="layout">
<div class="content"> <div class="content">
<transition name="move" mode="out-in"> <transition name="move" mode="out-in">
<router-view class="view"></router-view> <router-view class="view"></router-view>
</transition> </transition>
<el-backtop target=".content"></el-backtop> <el-backtop target=".content"></el-backtop>
<v-footer></v-footer> <v-footer></v-footer>
</div> </div>
<div class="log-mask" v-if="logVisible"></div> <div class="log-mask" v-if="logVisible"></div>
<div class="log-dia" v-if="logVisible"> <div class="log-dia" v-if="logVisible">
<img class="bg1" src="@/assets/img/log-bg.png" alt=""> <img class="bg1" src="@/assets/img/log-bg.png" alt="">
<img class="bg2" src="@/assets/img/log-bg1.png" alt=""> <img class="bg2" src="@/assets/img/log-bg1.png" alt="">
<p class="log-title">更新日志</p> <p class="log-title">更新日志</p>
<div class="log-wrap"> <div class="log-wrap">
<div class="logs"> <div class="logs">
<div class="item" v-for="(item, i) in list" :key="i" v-show="!i || (i && logAll)"> <div class="item" v-for="(item, i) in list" :key="i" v-show="!i || (i && logAll)">
<h6>{{ item.versionName }}</h6> <h6>{{ item.versionName }}</h6>
<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 :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
<div class="val"> :src="require('@/assets/img/' + funcList.find(e => e.id === item.type).icon + '.png')" alt=""> {{
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p> funcList.find(e => e.id === item.type).name }}</p>
</div> <div class="val">
</li> <p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p>
</ul>
</div> </div>
</div> </li>
<div class="more-wrap"> </ul>
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button>
</div>
</div>
</div> </div>
</div>
<div class="more-wrap">
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button>
</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>
</template> </template>
<script> <script>
@ -45,113 +62,149 @@ 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: [],
logAll: false, logAll: false,
funcList: [ funcList: [
{ {
id: 0, id: 0,
name: '新功能', name: '新功能',
icon: 'func' icon: 'func'
}, },
{ {
id: 1, id: 1,
name: '修复', name: '修复',
icon: 'bug' icon: 'bug'
}, },
{ {
id: 2, id: 2,
name: '优化', name: '优化',
icon: 'optimize' icon: 'optimize'
} }
] ],
};
realNameVisible: false,
realNameForm: {
userName: '',
workNumber: '',
},
realNameRules: {
userName: [
{ required: true, message: '请输入真实姓名', trigger: 'blur' }
],
},
};
},
components: {
vHead,
vFooter
},
computed: {
...mapState("user", [
'logView'
])
},
mounted () {
this.autoLogout()
this.logView || this.getLogStatus() // logViewfalse
this.handleRealName()
},
methods: {
...mapMutations("user", [
'SET_LOG'
]),
...mapActions('user', [
'logout'
]),
//
async handleRealName () {
const res = await this.$post(this.api.checkUserNameOrWorkNumber)
//
if (res.hasName) {
this.realNameVisible = true
}
}, },
components: { //
vHead, getLog () {
vFooter this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => {
logList.map((e, i) => {
e.logContents.map(n => {
n.content = n.content.split('\n')
})
})
this.list = logList
}).catch(res => { })
}, },
computed: { //
...mapState("user", [ getLogStatus () {
'logView' util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, {
]) platformId: Setting.platformId
}).then(({ notification }) => {
this.SET_LOG() // true
if (notification) {
this.logVisible = true // true
this.getLog()
}
}).catch(res => { })
}, },
mounted() { // ,退
this.autoLogout() autoLogout () {
this.logView || this.getLogStatus() // logViewfalse let lastTime = new Date().getTime()
document.onmousedown = () => {
lastTime = new Date().getTime()
};
const autoLogoutTime = Setting.autoLogoutTime
const timer = setInterval(() => {
if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > autoLogoutTime) {
util.errorMsg('用户登录过期,请重新登录')
clearInterval(timer)
setTimeout(this.logout, 1500)
}
}, 1000)
}, },
methods: { //
...mapMutations("user", [ realNameSubmit () {
'SET_LOG' this.$refs.realNameForm.validate(async (valid) => {
]), if (valid) {
...mapActions('user', [ const form = this.realNameForm
'logout' await this.$post(`${this.api.updateUserNameOrWorkNumber}?userName=${form.userName}&workNumber=${form.workNumber}`)
]), this.realNameVisible = false
// } else {
getLog() { return false
this.$get(`${this.api.platformLogList}?platformId=${Setting.platformId}&port=1&versionName=`).then(({ logList }) => {
logList.map((e, i) => {
e.logContents.map(n => {
n.content = n.content.split('\n')
})
})
this.list = logList
}).catch(res => {})
},
//
getLogStatus() {
util.local.get(Setting.tokenKey) && this.$get(this.api.logNotification, {
platformId: Setting.platformId
}).then(({ notification }) => {
this.SET_LOG() // true
if (notification) {
this.logVisible = true // true
this.getLog()
}
}).catch(res => {})
},
// ,退
autoLogout() {
let lastTime = new Date().getTime()
document.onmousedown = () => {
lastTime = new Date().getTime()
};
const autoLogoutTime = Setting.autoLogoutTime
const timer = setInterval(() => {
if (util.local.get(Setting.tokenKey) && (new Date().getTime() - lastTime) > autoLogoutTime) {
util.errorMsg('用户登录过期,请重新登录')
clearInterval(timer)
setTimeout(this.logout, 1500)
}
}, 1000)
} }
} })
},
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main{ .main {
min-height: calc(100% - 64px); min-height: calc(100% - 64px);
.layout{
padding-top: 64px; .layout {
} padding-top: 64px;
.view{ }
min-width: $min-width;
min-height: calc(100vh - 134px); .view {
padding: 12px 80px 0; min-width: $min-width;
margin: 0 auto; min-height: calc(100vh - 134px);
background-color: #F3F6FA; padding: 12px 80px 0;
background: url(../../assets/img/shapes/shape1.png) 0 50px no-repeat, margin: 0 auto;
url(../../assets/img/shapes/shape7.png) right 70px no-repeat, background-color: #F3F6FA;
url(../../assets/img/shapes/shape8.png) 0 574px no-repeat, background: url(../../assets/img/shapes/shape1.png) 0 50px no-repeat,
url(../../assets/img/shapes/shape9.png) right 645px no-repeat, url(../../assets/img/shapes/shape7.png) right 70px no-repeat,
url(../../assets/img/shapes/shape6.png) 0 1074px no-repeat; url(../../assets/img/shapes/shape8.png) 0 574px no-repeat,
} url(../../assets/img/shapes/shape9.png) right 645px no-repeat,
.index{ url(../../assets/img/shapes/shape6.png) 0 1074px no-repeat;
padding: 0; }
}
.index {
padding: 0;
}
} }
.log-mask { .log-mask {
position: fixed; position: fixed;
top: 0; top: 0;
@ -160,6 +213,7 @@ 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;
@ -169,10 +223,12 @@ 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;
@ -180,6 +236,7 @@ export default {
max-width: 100%; max-width: 100%;
height: 250px; height: 250px;
} }
.log-title { .log-title {
position: absolute; position: absolute;
top: 65px; top: 65px;
@ -190,59 +247,80 @@ 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 {
width: 20px; img {
margin-right: 8px; width: 20px;
} 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 {
position: relative; p {
font-size: 13px; position: relative;
color: #727272; font-size: 13px;
} color: #727272;
}
} }
} }
} }
/deep/.name-dia {
.el-dialog__header {
display: none;
}
.el-dialog__body {
padding-bottom: 10px;
}
}
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,96 +1,103 @@
<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 :default-active="defaultType" :default-openeds="defaultOpenType"> <el-menu class="menu" ref="type" @open="selectType" @select="selectType" unique-opened
<menuTree :menuList="typeList"></menuTree> :default-active="defaultType" :default-openeds="defaultOpenType">
</el-menu> <menuTree :menuList="typeList"></menuTree>
</el-menu>
</div>
<div class="right">
<div class="page">
<h6 class="l-title"><img src="@/assets/img/data1.png" alt=""> 数据介绍</h6>
<div>
<div class="search">
<input v-model="keyword" type="text" placeholder="请输入数据表名称">
<img src="../../../assets/img/search-gray.png" alt="" class="search-icon">
</div>
</div> </div>
<div class="right"> <div class="desc">{{ introduce }}</div>
<div class="page"> <div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{ dataSource }}</div>
<h6 class="l-title"><img src="@/assets/img/data1.png" alt=""> 数据介绍</h6> <div class="page-content">
<div> <el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id"
<div class="search"> highlight-current-row @current-change="previewCurrentChange">
<input v-model="keyword" type="text" placeholder="请输入数据表名称"> <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<img src="../../../assets/img/search-gray.png" alt="" class="search-icon"> <el-table-column prop="showName" label="数据表名称" min-width="220" align="center"
</div> :show-overflow-tooltip="true"></el-table-column>
</div> <el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column>
<div class="desc">{{introduce}}</div> <el-table-column prop="timeRange" label="起止时间" width="175" align="center"></el-table-column>
<div class="source"><img src="@/assets/img/data2.png" alt=""> 数据来源{{dataSource}}</div> <el-table-column prop="dataSize" label="数据大小" width="90" align="center">
<div class="page-content"> <template slot-scope="scope">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="id" highlight-current-row @current-change="previewCurrentChange"> {{ scope.row.dataSize }}M
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> </template>
<el-table-column prop="showName" label="数据表名称" min-width="220" align="center" :show-overflow-tooltip="true"></el-table-column> </el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="90" align="center"></el-table-column> <el-table-column prop="updateTime" label="更新时间" width="155" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止时间" width="175" align="center"></el-table-column> <el-table-column label="操作" width="100" align="center">
<el-table-column prop="dataSize" label="数据大小" width="90" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> <el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button>
{{scope.row.dataSize}}M <el-button type="text" @click="download(scope.row)" v-auth>下载</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="155" align="center"></el-table-column> </el-table>
<el-table-column label="操作" width="100" align="center"> <div class="pagination">
<template slot-scope="scope"> <el-pagination background @current-change="handleCurrentChange" :current-page="page"
<el-button type="text" @click="preview(scope.row)" v-auth>预览</el-button> layout="total, prev, pager, next, jumper" :total="total"></el-pagination>
<el-button type="text" @click="download(scope.row)" v-auth>下载</el-button> </div>
</template>
</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>
</div>
</div>
</div>
</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"
<el-form ref="form" label-width="100px" label-suffix=""> :close-on-click-modal="false">
<el-form-item label="数据筛选"> <el-form ref="form" label-width="100px" label-suffix="">
<div class="checkboxs"> <el-form-item label="数据筛选">
<el-checkbox v-model="checkAllFields" @change="checkAllFieldsChange">全选</el-checkbox> <div class="checkboxs">
<el-checkbox-group v-model="fields"> <el-checkbox v-model="checkAllFields" @change="checkAllFieldsChange">全选</el-checkbox>
<el-checkbox v-for="(item,index) in fieldsList" :key="index" :label="item.comment"></el-checkbox> <el-checkbox-group v-model="fields">
</el-checkbox-group> <el-checkbox v-for="(item, index) in fieldsList" :key="index" :label="item.comment"></el-checkbox>
</div> </el-checkbox-group>
</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-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-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-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="downloadVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="confirmDown">确定</el-button>
</span>
</el-dialog>
<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="">
数据预览
</div>
<img width="52" src="@/assets/img/close.png" style="cursor: pointer" alt="" @click="previewVisible = false">
</div>
<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>
</div> </div>
</el-drawer> </el-form-item>
</div> <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-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-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-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="downloadVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="confirmDown">确定</el-button>
</span>
</el-dialog>
<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="">
数据预览
</div>
<img width="52" src="@/assets/img/close.png" style="cursor: pointer" alt="" @click="previewVisible = false">
</div>
<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>
</div>
</el-drawer>
</div>
</template> </template>
<script> <script>
@ -105,7 +112,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),
@ -140,7 +147,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
}, },
}, },
@ -173,7 +180,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(() => {
@ -183,7 +190,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) {
@ -195,7 +202,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
@ -204,7 +211,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) {
@ -237,7 +244,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 => {
@ -262,26 +269,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 {
@ -290,7 +297,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) {
@ -317,10 +324,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, {
@ -347,11 +354,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,
@ -386,11 +393,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 = ''
@ -398,7 +405,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('请选择开始时间')
@ -483,139 +490,175 @@ 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{
width: 239px; /deep/.left {
height: calc(100vh - 190px); width: 239px;
margin-right: 20px; height: calc(100vh - 190px);
overflow: auto; margin-right: 20px;
&::-webkit-scrollbar { overflow: auto;
display: none;
width: 8px; &::-webkit-scrollbar {
height: 8px; display: none;
} width: 8px;
&::-webkit-scrollbar-thumb { height: 8px;
display: none;
width: 5px;
border-radius: 6px;
background: rgba(173,173,173,.7);
}
.menu{
width: 240px;
overflow: hidden;
&>.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{
height: 50px;
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;
}
}
}
}
.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;
font-size: 12px;
color: #333;
background-color: #FAFAFA;
}
} }
.search{
z-index: 2; &::-webkit-scrollbar-thumb {
position: absolute; display: none;
top: 10px; width: 5px;
right: 16px; border-radius: 6px;
display: flex; background: rgba(173, 173, 173, .7);
justify-content: space-between; }
align-items: center;
width: 345px; .menu {
height: 34px; width: 240px;
padding: 7px 10px; overflow: hidden;
margin: 0 auto;
&>.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; background-color: #fff;
border: 1px solid #e6e6e6; }
border-radius: 5px;
.el-submenu.is-active {
input{ .el-submenu__title {
width: 260px; &+.el-menu .el-submenu__title {
margin-left: 10px; height: 50px;
font-size: 14px; line-height: 50px;
color: #333; background-color: rgba(147, 184, 255, .15);
background-color: transparent; }
border: 0;
&::-webkit-input-placeholder{color: #999} i {
&::-moz-placeholder{color: #999} color: #006EFF;
&:-moz-placeholder{color: #999} }
&:focus{
outline: none;
}
} }
.remove{ }
cursor: pointer;
.el-menu-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
&.is-active {
color: #fff;
background-color: #0070FF;
span {
color: #fff;
}
} }
.search-icon{ }
width: 18px;
.level-6 {
padding-right: 0;
.el-submenu__title {
padding-left: 10px !important;
color: #fff;
} }
}
} }
/deep/.preview-dia{ }
padding: 20px;
.preview-wrap{ .right {
height: calc(100vh - 80px); width: calc(100% - 260px);
overflow: auto;
.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;
font-size: 12px;
color: #333;
background-color: #FAFAFA;
}
}
.search {
z-index: 2;
position: absolute;
top: 10px;
right: 16px;
display: flex;
justify-content: space-between;
align-items: center;
width: 345px;
height: 34px;
padding: 7px 10px;
margin: 0 auto;
background-color: #fff;
border: 1px solid #e6e6e6;
border-radius: 5px;
input {
width: 260px;
margin-left: 10px;
font-size: 14px;
color: #333;
background-color: transparent;
border: 0;
&::-webkit-input-placeholder {
color: #999
}
&::-moz-placeholder {
color: #999
}
&:-moz-placeholder {
color: #999
}
&:focus {
outline: none;
}
}
.remove {
cursor: pointer;
}
.search-icon {
width: 18px;
}
}
/deep/.preview-dia {
padding: 20px;
.preview-wrap {
height: calc(100vh - 80px);
overflow: auto;
}
}
</style> </style>

@ -238,7 +238,7 @@
<div class="popup wechat-popup"> <div class="popup wechat-popup">
<p class="tips">微信扫码添加职站售前咨询</p> <p class="tips">微信扫码添加职站售前咨询</p>
<p class="des">提供付费咨询及解决方案</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>
<div class="item tel"></div> <div class="item tel"></div>
<div class="popup tel-popup"> <div class="popup tel-popup">
@ -249,7 +249,7 @@
</div> </div>
<div class="text"> <div class="text">
<p class="title">售前咨询</p> <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> <p class="tel-num">18019930142</p>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
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'
@ -8,8 +8,8 @@ import { Message } from 'element-ui'
const baseURL = Setting.apiBaseURL const baseURL = Setting.apiBaseURL
const service = axios.create({ const service = axios.create({
baseURL, baseURL,
timeout: 10000000 timeout: 10000000
}) })
// post请求头 // post请求头
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
@ -18,168 +18,189 @@ 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) { if (res.data.code === 401) {
util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员') Util.local.remove(Setting.storeKey)
setTimeout(() => { Util.local.remove(Setting.tokenKey)
store.dispatch('user/logout') Util.errorMsg(res.data.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
}, 1500) setTimeout(() => {
} location.reload()
}).catch(res => {}) }, 1500)
} else if (res.data) {
Util.errorMsg('账号被禁用,已强制退出,有疑问请联系管理员')
setTimeout(() => {
store.dispatch('user/logout')
}, 1500)
}
}).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)
}) })
// 响应拦截器 // 响应拦截器
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.status == 30001) { } else if (res.code === 401) {
return Promise.resolve(res).catch(e => {}) // 账号互踢
}else if(!res.status){ if (!logouted) {
return Promise.resolve(res).catch(e => {}) Util.local.remove(Setting.storeKey)
} else if (res.status === 10008) { Util.local.remove(Setting.tokenKey)
Message.error({ Util.errorMsg(res.msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
message: res.message, setTimeout(() => {
showClose: true, router.replace({
duration: 1500 path: '/login'
}) })
return Promise.reject(res) logouted = 0
}else { }, 1500)
util.errorMsg(res.message) logouted = 1
res.message === '该账号无权限!' && setTimeout(() => { }
store.dispatch('user/logout') } else if (res.status == 30001) {
}, 1500) return Promise.resolve(res).catch(e => { })
return Promise.reject(res) } else if (!res.status) {
} return Promise.resolve(res).catch(e => { })
}, } else if (res.status === 10008) {
// 服务器状态码不是200的情况 Message.error({
error => { message: res.message,
if (error.response.status) { showClose: true,
switch (error.response.status) { duration: 1500
// 401: 未登录 })
// 未登录则跳转登录页面,并携带当前页面的路径 return Promise.reject(res)
// 在登录成功后返回当前页面,这一步需要在登录页操作。 } else {
case 401: Util.errorMsg(res.message)
util.local.remove(Setting.storeKey) res.message === '该账号无权限!' && setTimeout(() => {
util.local.remove(Setting.tokenKey) store.dispatch('user/logout')
util.errorMsg('登录过期,请重新登录') }, 1500)
setTimeout(() => { return Promise.reject(res)
router.replace({ }
path: '/login' },
}) // 服务器状态码不是200的情况
}, 1000) error => {
break if (error.response.status) {
case 500: switch (error.response.status) {
util.errorMsg('网络错误') // 401: 未登录
break // 未登录则跳转登录页面,并携带当前页面的路径
// 403 token过期 // 在登录成功后返回当前页面,这一步需要在登录页操作。
// 登录过期对用户进行提示 case 401:
// 清除本地token和清空vuex中token对象 Util.local.remove(Setting.storeKey)
// 跳转登录页面 Util.local.remove(Setting.tokenKey)
case 403: Util.errorMsg('登录过期,请重新登录')
util.local.remove(Setting.storeKey) setTimeout(() => {
util.local.remove(Setting.tokenKey) router.replace({
util.errorMsg('登录过期,请重新登录') path: '/login'
// 清除token })
// store.commit('loginSuccess', null); }, 1000)
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面 break
setTimeout(() => { case 500:
router.replace({ Util.errorMsg('网络错误')
path: '/login', break
// query: { // 403 token过期
// redirect: router.currentRoute.fullPath // 登录过期对用户进行提示
// } // 清除本地token和清空vuex中token对象
}) // 跳转登录页面
}, 1000) case 403:
break Util.local.remove(Setting.storeKey)
// 404请求不存在 Util.local.remove(Setting.tokenKey)
case 404: Util.errorMsg('登录过期,请重新登录')
util.errorMsg('网络请求不存在!') // 清除token
break // store.commit('loginSuccess', null);
// 其他错误,直接抛出错误提示 // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
default: setTimeout(() => {
util.errorMsg(error.response.data.message) router.replace({
Promise.reject(res) path: '/login',
} // query: {
return Promise.reject(error.response) // redirect: router.currentRoute.fullPath
} // }
})
}, 1000)
break
// 404请求不存在
case 404:
Util.errorMsg('网络请求不存在!')
break
// 其他错误,直接抛出错误提示
default:
Util.errorMsg(error.response.data.message)
Promise.reject(res)
}
return Promise.reject(error.response)
} }
}
); );
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)
})
}) })
})
} }
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)
})
}) })
})
} }
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 => {
resolve(res) resolve(res)
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data)
})
}) })
})
} }
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 => {
resolve(res) resolve(res)
}).catch(err => { }).catch(err => {
reject(err.data) reject(err.data)
})
}) })
})
} }
export { get,post,del,put } export { get, post, del, put }

@ -11,83 +11,85 @@ const url = location.host
const dev = process.env.NODE_ENV === 'development' // 本地 const dev = process.env.NODE_ENV === 'development' // 本地
let host = `${location.origin}/` let host = `${location.origin}/`
if (dev) { 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 = { const Setting = {
/** /**
* 基础配置 * 基础配置
* */ * */
// 网页标题的后缀 // 网页标题的后缀
titleSuffix: '数据前瞻', titleSuffix: '数据前瞻',
// 路由模式,可选值为 history 或 hash // 路由模式,可选值为 history 或 hash
routerMode: 'hash', routerMode: 'hash',
// 页面切换时,是否显示模拟的进度条 // 页面切换时,是否显示模拟的进度条
showProgressBar: true, showProgressBar: true,
/** /**
* 接口地址 * 接口地址
* 测试http://121.37.12.51 * 测试http://121.37.12.51
* 正式https://www.dataforward.cn * 正式https://www.dataforward.cn
* */ * */
// apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://121.37.12.51', // apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://121.37.12.51',
apiBaseURL: host, apiBaseURL: host,
// 加密货币接口地址 // 加密货币接口地址
cryptoBaseURL: `http://159.138.53.111/`, cryptoBaseURL: `http://159.138.53.111/`,
// 接口请求返回错误时,弹窗的持续时间,单位:秒 // 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3, modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice // 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
errorModalType: 'Message', errorModalType: 'Message',
// Cookies 默认保存时间,单位:天 // Cookies 默认保存时间,单位:天
cookiesExpires: 1, cookiesExpires: 1,
// 长时间未操作,自动退出登录时间 // 长时间未操作,自动退出登录时间
autoLogoutTime: 3600000, autoLogoutTime: 3600000,
/** /**
* localStorage里保存的token的key * localStorage里保存的token的key
*/ */
tokenKey: 'data_token', tokenKey: 'data_token',
/** /**
* localStorage里保存的vuex的key * localStorage里保存的vuex的key
*/ */
storeKey: 'data_store', storeKey: 'data_store',
/** /**
* 默认密码 * 默认密码
*/ */
initialPassword: '111aaa', initialPassword: '1122aa',
/** /**
* 所属平台1->职站 2->数据平台 3->中台 * 所属平台1->职站 2->数据平台 3->中台
*/ */
platformId: 2, platformId: 2,
/** /**
* 平台端区分0->教师端 1->学生端 2->无端 * 平台端区分0->教师端 1->学生端 2->无端
*/ */
platformType: 2, platformType: 2,
/** /**
* 多语言配置 * 多语言配置
* */ * */
i18n: { i18n: {
// 默认语言 // 默认语言
default: 'zh', default: 'zh',
// 是否根据用户电脑配置自动设置语言(仅第一次有效) // 是否根据用户电脑配置自动设置语言(仅第一次有效)
auto: false auto: false
}, },
/** /**
* 布局配置 * 布局配置
* */ * */
layout: { layout: {
}, },
/** /**
* 功能配置 * 功能配置
* */ * */
// 相同路由,不同参数间进行切换,是否强力更新 // 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false, sameRouteForceUpdate: false,
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: true, dynamicRoute: true,
// 文件上传 // 文件上传
upload: { upload: {
apiURL: 'http://8.134.8.197:8001', apiURL: 'http://8.134.8.197:8001',
maxSize: 30, maxSize: 30,
}, },
}; };
export default Setting; export default Setting;

@ -9,102 +9,99 @@
import Setting from '@/setting' import Setting from '@/setting'
import util from '@/libs/util' 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' import api from '@/api'
/** /**
* 用户信息 * 用户信息
* */ * */
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
schoolId: '', schoolId: '',
userName: '', userName: '',
isManager: false, isManager: false,
isCustomer: false, isCustomer: false,
logView: false // 是否查询过日志状态,如果有,则不再调接口 logView: false // 是否查询过日志状态,如果有,则不再调接口
},
mutations: {
SET_INFO: (state, info) => {
if (info.avatar) state.avatar = info.avatar
if (info.schoolId) state.schoolId = info.schoolId
if (info.userName) state.userName = info.userName
}, },
mutations: { SET_AVATAR: (state, avatar) => {
SET_INFO: (state, info) => { state.avatar = avatar
if(info.avatar) state.avatar = info.avatar
if(info.schoolId) state.schoolId = info.schoolId
if(info.userName) state.userName = info.userName
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_MANAGER: (state, isManager) => {
state.isManager = isManager
},
SET_CUSTOMER: (state, isCustomer) => {
state.isCustomer = isCustomer
},
SET_LOG: (state) => {
state.logView = true
},
}, },
actions: { SET_MANAGER: (state, isManager) => {
login({ state,commit }, userInfo) { state.isManager = isManager
const { account, password, code, random, distinguish } = userInfo },
return new Promise((resolve, reject) => { SET_CUSTOMER: (state, isCustomer) => {
post(api.logins,{ state.isCustomer = isCustomer
account, },
password, SET_LOG: (state) => {
code, state.logView = true
random, },
distinguish, },
type: 2, // 平台端区分:0->教师端 1->学生端 2->无端 actions: {
platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台) login ({ state, commit }, userInfo) {
}).then(res => { const { account, password, code, random, distinguish } = userInfo
if(res.status == 200){ return new Promise((resolve, reject) => {
util.local.set(Setting.tokenKey,res.data.token,43200000) post(api.logins, {
util.successMsg('登录成功') account,
get(api.isClient).then(res => { password,
commit('SET_CUSTOMER',res.customer) code,
const userName = res.customerName random,
userName && commit('SET_INFO', { distinguish,
userName type: 2, // 平台端区分:0->教师端 1->学生端 2->无端
}) platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台)
}).catch(res => {}) }).then(res => {
post(api.getSchoolIdByToken).then(res => { if (res.status == 200) {
commit('SET_INFO',res) util.local.set(Setting.tokenKey, res.data.token, 43200000)
}).catch(res => {}) util.successMsg('登录成功')
setTimeout(() => { post(api.getSchoolIdByToken).then(res => {
// 登录次数+1 commit('SET_INFO', res)
post(api.saveRecord,{ }).catch(res => { })
type: 3, setTimeout(() => {
}).then(res => {}).catch(res => {}) // 登录次数+1
},3000) post(api.saveRecord, {
resolve() type: 3,
}else{ }).then(res => { }).catch(res => { })
util.errorMsg(res.message) }, 3000)
reject(res) resolve()
} } else {
}).catch(error => { util.errorMsg(res.message)
reject(error) reject(res)
}) }
}) }).catch(error => {
}, reject(error)
logout({ commit, state, dispatch }) { })
return new Promise((resolve, reject) => { })
util.local.remove(Setting.storeKey) },
util.local.remove(Setting.tokenKey) logout ({ commit, state, dispatch }) {
location.reload() return new Promise((resolve, reject) => {
resolve() post(api.logout).then(() => {
}) util.local.remove(Setting.storeKey)
}, util.local.remove(Setting.tokenKey)
setAvatar({ state,commit },avatar) { location.reload()
commit('SET_AVATAR',avatar) resolve()
}, }).catch(error => {
setInfo({ state,commit },info) { reject(error)
commit('SET_INFO',info) })
}, })
setManager({ state,commit },isManager) { },
commit('SET_MANAGER',isManager) setAvatar ({ state, commit }, avatar) {
}, commit('SET_AVATAR', avatar)
setCustomer({ state,commit },isCustomer) { },
commit('SET_CUSTOMER',isCustomer) setInfo ({ state, commit }, info) {
}, commit('SET_INFO', info)
} },
setManager ({ state, commit }, isManager) {
commit('SET_MANAGER', isManager)
},
setCustomer ({ state, commit }, isCustomer) {
commit('SET_CUSTOMER', isCustomer)
},
}
} }

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