显示后台图标等

dev
Joel 3 years ago
parent b8e70d8bb2
commit bc4b696dd7
  1. 29
      src/layouts/header/index.vue
  2. 7
      src/layouts/navbar/index.vue
  3. 22
      src/pages/data/list/index.vue
  4. 4
      src/pages/index/list/index.vue
  5. 12
      src/pages/stat/list/index.vue
  6. 6
      src/setting.js
  7. 2
      src/store/modules/user.js
  8. 4
      src/styles/common.scss

@ -1,17 +1,16 @@
<template>
<div class="header">
<a class="logo" @click="toIndex">
<!-- <span v-if="token && isManager && !showSetting">{{schoolName}}</span> -->
<img src="@/assets/img/logo.png" alt="">
</a>
<div class="inner">
<div style="height: 64px;"></div>
<navbar ref="nav"></navbar>
<div class="action" v-if="token">
<img v-if="isManager && showSetting" class="icon" :class="{'m-r-20': !isCustomer}" src="../../assets/img/setting.png" alt="" @click="toManager">
<img v-if="showSetting && isCustomer" class="icon m-r-20" src="../../assets/img/setting.png" alt="" @click="toManager">
<el-dropdown class="user-wrap" @command="userCommand">
<div class="user">
<el-avatar :size="40" :src="avatar" v-if="!isCustomer"></el-avatar>
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="username">{{userName}}</span>
</div>
<el-dropdown-menu slot="dropdown">
@ -68,7 +67,6 @@ export default {
keyword: '',
searchTimer: null,
userName: '',
isUser: false,
showSetting: true,
id: '',
schoolName: '',
@ -83,7 +81,7 @@ export default {
components: { navbar },
computed: {
...mapState('user', [
'avatar', 'isManager', 'schoolId', 'isCustomer'
'avatar', 'schoolId', 'isCustomer'
]),
...mapState('auth', [
'routes'
@ -114,8 +112,15 @@ export default {
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
this.setCustomer(customer)
}
//
let mg = this.$route.query.mg
if (mg && atob(decodeURI(mg)) === 'true') {
this.showSetting = false
}
// ,
this.token && this.isCustomer && this.getUserInfo()
setTimeout(() => {
this.token && !this.isCustomer && this.getUserInfo()
}, 1000)
},
methods: {
...mapActions('user', [
@ -125,13 +130,6 @@ export default {
this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo ? res.userInfo : {}
let userAccount = res.userAccount
let isManager = userAccount.roleId != '0' //
this.isUser = isManager
let mg = this.$route.query.mg
//
if (mg && atob(decodeURI(mg)) === 'true') {
this.showSetting = false
}
this.userName = userAccount.account
this.id = userAccount.id
this.schoolName = res.schoolName
@ -139,11 +137,12 @@ export default {
avatar: userInfo.userAvatars,
schoolId: userAccount.schoolId,
})
this.setManager(isManager)
}).catch(err => { })
},
toIndex() {
this.$refs.nav.jump({
this.$route.path === '/index/list'
? location.reload()
: this.$refs.nav.jump({
index: '/index/list',
title: '首页'
})

@ -44,6 +44,9 @@ export default {
};
},
computed: {
...mapState('user', [
'isCustomer'
]),
...mapState('auth', [
'routes'
])
@ -59,7 +62,9 @@ export default {
},
mounted() {
if (util.local.get(Setting.tokenKey)) {//
this.getPer()
setTimeout(() => {
this.isCustomer ? this.getPer() : this.initMenu()
}, 100)
if (this.managerStr && atob(decodeURI(this.managerStr)) === 'true') {
this.isManager = true
this.setManager(false)

@ -104,7 +104,7 @@
<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-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" 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 label="起止时间" width="220" align="center">
<template slot-scope="scope">
@ -125,7 +125,7 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :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>
@ -403,26 +403,20 @@ export default {
}).then(res => {
this.curRow = row
this.downloadVisible = true
// ,,
this.$get(`${this.api.getTableTime}`, {
tableId: row.id
}).then(res => {
let list = res.message
if (list.startTime) {
startTimeLimit = new Date(list.startTime).getTime()
// ,,
if (row.startTime) {
startTimeLimit = new Date(row.startTime).getTime()
} else {
// ,
this.startTimeDisabled = true
}
if (list.endTime) {
endTimeLimit = new Date(list.endTime).getTime()
this.timeDefault = list.endTime
if (row.endTime) {
endTimeLimit = new Date(row.endTime).getTime()
this.timeDefault = row.endTime
} else {
// ,
this.endTimeDisabled = true
}
}).catch(res => { })
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
let comment = res.comment

@ -27,7 +27,7 @@
<el-table :data="listData" class="table" ref="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center"></el-table-column>
<el-table-column prop="showName" label="数据表名称" align="center" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createTime" label="起止日期" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" align="center">
@ -44,7 +44,7 @@
</el-table-column>
</el-table>
<div class="pagination" v-show="total">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :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 class="none" v-if="!total">
<img src="@/assets/img/index/index19.png" alt="">

@ -69,7 +69,7 @@
<el-table-column prop="download" label="下载量" align="center"></el-table-column>
<el-table-column prop="click" label="点击量" align="center"></el-table-column>
</el-table>
<div class="fold" v-if="listData.length > 10">
<div class="fold" v-if="listData.length > initShowLen">
<span :class="{active}" @click="toggleList">
展开更多
<i class="el-icon-arrow-down"></i>
@ -131,6 +131,7 @@ export default {
listData: [],
listDataKeyword: [],
listDataAll: [],
initShowLen: 5, // 使
multipleSelection: [],
monthData: [
{
@ -242,7 +243,7 @@ export default {
this.$get(`${this.api.queryDatabaseInfo}?schoolId=${this.schoolId}&startTime=${this.startTime}&endTime=${this.endTime}`).then(res => {
let list = JSON.parse(res.databaseInfo)
//
this.listData = list.slice(0,10)
this.listData = list.slice(0,this.initShowLen)
this.listDataAll = list //
}).catch(res => {})
},
@ -253,7 +254,7 @@ export default {
list.map(n => {
(n.categoryOne.includes(this.keyword) || n.categoryTwo.includes(this.keyword)) && result.push(n)
})
this.listData = this.active ? result : result.slice(0,10)
this.listData = this.active ? result : result.slice(0,this.initShowLen)
this.listDataKeyword = result
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@ -279,16 +280,17 @@ export default {
},
//
toggleList(){
const len = this.initShowLen
// listDataAll listDataKeyword
if(this.keyword){
if(this.active){
this.listData = this.listDataKeyword.slice(0,10)
this.listData = this.listDataKeyword.slice(0,len)
}else{
this.listData = this.listDataKeyword
}
}else{
if(this.active){
this.listData = this.listDataAll.slice(0,10)
this.listData = this.listDataAll.slice(0,len)
}else{
this.listData = this.listDataAll
}

@ -1,8 +1,8 @@
/*
* @Author: your name
* @Date: 2021-11-03 14:33:21
* @LastEditTime: 2021-11-08 15:41:55
* @LastEditors: your name
* @LastEditTime: 2021-11-08 16:19:17
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \questionnaired:\code\FE_huoran_data\src\setting.js
*/
@ -24,7 +24,7 @@ const Setting = {
showProgressBar: true,
// 接口请求地址
// apiBaseURL: env === 'development' ? 'http://192.168.31.125:9000' : 'http://39.108.250.202:9000',// 佳坤
apiBaseURL: env === 'development' ? 'http://192.168.31.151:9000' : 'http://39.108.250.202:9000',
apiBaseURL: env === 'development' ? 'http://39.108.250.202:9000' : 'http://39.108.250.202:9000',
// 接口请求返回错误时,弹窗的持续时间,单位:秒
modalDuration: 3,
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-11-03 14:33:21
* @LastEditTime: 2021-11-08 15:26:33
* @LastEditTime: 2021-11-08 19:20:52
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \questionnaired:\code\FE_huoran_data\src\store\modules\user.js

@ -156,9 +156,9 @@
.pagination {
margin: 20px 0;
text-align: center;
button,.number,.more{
button,.number,.more,.el-input__inner{
min-width: 32px !important;
height: 32px;
height: 32px !important;
line-height: 32px;
color: #333 !important;
background-color: transparent !important;

Loading…
Cancel
Save