右上角客户名称等

dev
Jo 3 years ago
parent d978432dc6
commit 93b8dbfc06
  1. 10
      src/layouts/header/index.vue
  2. 25
      src/pages/index/list/index.vue
  3. 6
      src/pages/role/list/index.vue
  4. 8
      src/pages/user/list/index.vue
  5. 8
      src/store/modules/user.js
  6. 2
      src/styles/layout/index.scss

@ -11,8 +11,7 @@
<el-dropdown class="user-wrap" @command="userCommand"> <el-dropdown class="user-wrap" @command="userCommand">
<div class="user"> <div class="user">
<el-avatar :size="40" :src="avatar"></el-avatar> <el-avatar :size="40" :src="avatar"></el-avatar>
<span class="username" v-if="isCustomer">**大学</span> <span class="username">{{userName}}</span>
<span class="username" v-else>{{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>
@ -67,7 +66,6 @@ export default {
rendered: false, rendered: false,
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
userName: '',
showSetting: true, showSetting: true,
id: '', id: '',
schoolName: '', schoolName: '',
@ -82,7 +80,7 @@ export default {
components: { navbar }, components: { navbar },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'avatar', 'schoolId', 'isCustomer' 'avatar', 'schoolId', 'isCustomer', 'userName'
]), ]),
...mapState('auth', [ ...mapState('auth', [
'routes' 'routes'
@ -131,11 +129,11 @@ export default {
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
this.userName = userAccount.account
this.id = userAccount.id this.id = userAccount.id
this.schoolName = res.schoolName this.schoolName = res.schoolName
this.setInfo({ this.setInfo({
avatar: userInfo.userAvatars avatar: userInfo.userAvatars,
userName: userAccount.account
}) })
}).catch(err => { }) }).catch(err => { })
}, },

@ -6,10 +6,6 @@
<div class="search"> <div class="search">
<input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词"> <input ref="keyword" v-model="keyword" type="text" placeholder="请输入关键词">
<img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="keyword = ''"> <img v-if="keyword" src="../../../assets/img/remove-gray.png" alt="" class="remove" @click="keyword = ''">
<div class="icon-wrap">
<img src="../../../assets/img/search-white.png" alt="">
搜索
</div>
</div> </div>
<div class="hot" v-if="hotData.length"> <div class="hot" v-if="hotData.length">
<span class="name">热门下载</span> <span class="name">热门下载</span>
@ -79,8 +75,8 @@
<!-- 关于 --> <!-- 关于 -->
<div class="about" id="part1"> <div class="about" id="part1">
<div class="inner"> <div class="inner">
<h6 class="i-title">关于数据平台</h6> <h6 class="i-title">关于Dataforward</h6>
<div class="desc">欢迎使用数据平台这是我们的财经数据库我们的数据涵盖股票数据期货数据债券数据期权数据利率数据公募数据和宏观数据拥有超40年的历史数据可为您解读预测分析模拟市场趋势经济周期和世界事件影响提供必要的数据支持我们的数据均来源于各大专业财经权威网站和数据官方发布平台并经过专业的数据分类和整理可让用户轻松便捷地搜索并批量下载到自己研究所需的数据极大地减轻自己搜索整理数据的时间提高研究效率, 从而高效的输出研究成果</div> <div class="desc">欢迎使用 Dataforward数据前瞻这是我们的财经数据库我们的数据涵盖股票数据期货数据债券数据期权数据利率数据公募数据和宏观数据拥有超40年的历史数据可为您解读预测分析模拟市场趋势经济周期和世界事件影响提供必要的数据支持我们的数据均来源于各大专业财经权威网站和数据官方发布平台并经过专业的数据分类和整理可让用户轻松便捷地搜索并批量下载到自己研究所需的数据极大地减轻自己搜索整理数据的时间提高研究效率, 从而高效的输出研究成果</div>
</div> </div>
</div> </div>
<!-- 特色与优势 --> <!-- 特色与优势 -->
@ -300,24 +296,11 @@ export default {
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
.icon-wrap{
display: inline-flex;
align-items: center;
height: 100%;
padding: 0 30px;
font-size: 18px;
text-align: center;
color: #fff;
background-color: #006EFF;
img{
margin-right: 5px;
}
}
input{ input{
flex: 1; flex: 1;
padding-left: 15px; padding-left: 15px;
font-size: 18px; font-size: 18px;
color: #333; color: #919191;
background-color: transparent; background-color: transparent;
border: 0; border: 0;
border-left: 2px solid #fff; border-left: 2px solid #fff;
@ -401,7 +384,7 @@ export default {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
&.active{ &.active, &:hover{
h6, .desc{ h6, .desc{
color: #006EFF; color: #006EFF;
} }

@ -267,6 +267,12 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.l-title{
margin-bottom: 24px;
}
.page .page-content .tool{
margin-bottom: 30px;
}
.per-wrap{ .per-wrap{
max-height: 400px; max-height: 400px;
overflow: auto; overflow: auto;

@ -32,7 +32,7 @@
<div></div> <div></div>
</div> </div>
<div class="tool" style="margin-bottom: 16px;"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li style="margin-bottom: 0"> <li style="margin-bottom: 0">
<label>搜索</label> <label>搜索</label>
@ -544,6 +544,12 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.l-title{
margin-bottom: 24px;
}
.page .page-content .tool{
margin-bottom: 30px;
}
.filter{ .filter{
flex-wrap: wrap; flex-wrap: wrap;
li{ li{

@ -1,5 +1,5 @@
/* /*
* @Author: your name * @Author: Yujialong
* @Date: 2021-11-03 14:33:21 * @Date: 2021-11-03 14:33:21
* @LastEditTime: 2021-11-08 19:20:52 * @LastEditTime: 2021-11-08 19:20:52
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
@ -20,6 +20,7 @@ export default {
state: { state: {
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
schoolId: '', schoolId: '',
userName: '',
isManager: false, isManager: false,
isCustomer: false isCustomer: false
}, },
@ -27,6 +28,7 @@ export default {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
if(info.avatar) state.avatar = info.avatar if(info.avatar) state.avatar = info.avatar
if(info.schoolId) state.schoolId = info.schoolId if(info.schoolId) state.schoolId = info.schoolId
if(info.userName) state.userName = info.userName
}, },
SET_AVATAR: (state, avatar) => { SET_AVATAR: (state, avatar) => {
state.avatar = avatar state.avatar = avatar
@ -56,6 +58,10 @@ export default {
util.successMsg('登录成功') util.successMsg('登录成功')
get(api.isClient).then(res => { get(api.isClient).then(res => {
commit('SET_CUSTOMER',res.customer) commit('SET_CUSTOMER',res.customer)
const userName = res.customerName
userName && commit('SET_INFO', {
userName
})
}).catch(res => {}) }).catch(res => {})
post(api.getSchoolIdByToken).then(res => { post(api.getSchoolIdByToken).then(res => {
commit('SET_INFO',res) commit('SET_INFO',res)

@ -12,5 +12,5 @@ body {
min-width: $min-width; min-width: $min-width;
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-size: 14px; font-size: 14px;
background: rgba(0, 0, 0, 0.02); background-color: #F3F6FA;
} }
Loading…
Cancel
Save