dev_2022-04-07
yujialong 3 years ago
parent f7bf73d9b1
commit 3e56616c63
  1. 2
      src/api/index.js
  2. BIN
      src/assets/img/log-bg.png
  3. BIN
      src/assets/img/log-bg1.png
  4. 336
      src/layouts/header/index.vue
  5. 13
      src/pages/account/login/index.vue
  6. 3
      src/pages/user/list/index.vue
  7. 6
      src/store/modules/user.js

@ -11,7 +11,7 @@ export default {
unbindAccounts: `users/users/user/unbindAccounts`, unbindAccounts: `users/users/user/unbindAccounts`,
// 加密货币 // 加密货币
market: `topic/market`, market: `/topic/market`,
getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`, getTopList: `${Setting.cryptoBaseURL}currency/market/getTopList`,
platformLogList: `nakadai/log/platformLogList`, platformLogList: `nakadai/log/platformLogList`,

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -46,11 +46,38 @@
<el-button size="small" type="primary" @click="editPassword"> </el-button> <el-button size="small" type="primary" @click="editPassword"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<div class="log-mask" v-if="logVisible"></div>
<div class="log-dia" v-if="logVisible">
<img class="bg1" src="@/assets/img/log-bg.png" alt="">
<img class="bg2" src="@/assets/img/log-bg1.png" alt="">
<p class="log-title">更新日志</p>
<div class="log-wrap">
<div class="logs">
<div class="item" v-for="(item, i) in list" :key="i" v-show="!i || (i && logAll)">
<h6>{{ item.versionName }}</h6>
<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>
<div class="val">
<p v-for="(item, i) in item.content" :key="i">{{ i + 1 }}{{ item }}</p>
</div>
</li>
</ul>
</div>
</div>
<div class="more-wrap">
<p>更多功能介绍点击 <span class="more" @click="logAll = !logAll">了解更多</span></p>
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import navbar from '../navbar' import navbar from '../navbar'
import { mapState, mapActions } from 'vuex' 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 {
@ -68,12 +95,32 @@ export default {
newPassword: '', newPassword: '',
reNewPassword: '' reNewPassword: ''
}, },
logVisible: false,
list: [],
logAll: false,
funcList: [
{
id: 0,
name: '新功能',
icon: 'func'
},
{
id: 1,
name: '修复',
icon: 'bug'
},
{
id: 2,
name: '优化',
icon: 'optimize'
}
]
}; };
}, },
components: { navbar }, components: { navbar },
computed: { computed: {
...mapState('user', [ ...mapState('user', [
'avatar', 'schoolId', 'isCustomer', 'userName' 'avatar', 'schoolId', 'isCustomer', 'userName', 'logView'
]), ]),
...mapState('auth', [ ...mapState('auth', [
'routes' 'routes'
@ -94,15 +141,40 @@ export default {
userName userName
}) })
} }
this.logView || this.getLogStatus() // logViewfalse
// , // ,
setTimeout(() => { setTimeout(() => {
this.token && !this.isCustomer && this.getUserInfo() this.token && !this.isCustomer && this.getUserInfo()
}, 1000) }, 1000)
}, },
methods: { methods: {
...mapMutations('user', [
'SET_LOG'
]),
...mapActions('user', [ ...mapActions('user', [
'setInfo', 'logout', 'setManager', 'setCustomer' 'setInfo', 'logout', 'setManager', 'setCustomer'
]), ]),
//
getLog() {
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() {
this.$get(this.api.logNotification).then(({ notification }) => {
this.SET_LOG() // true
if (notification) {
this.logVisible = true // true
this.getLog()
}
}).catch(res => {})
},
// //
getUserInfo() { getUserInfo() {
this.$get(this.api.userInfo).then(res => { this.$get(this.api.userInfo).then(res => {
@ -194,103 +266,197 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$height: 64px; $height: 64px;
.header{ .header{
z-index: 10; z-index: 10;
position: fixed; position: fixed;
top: 0;
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;
left: 80px;
font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer;
}
.search{
z-index: 2;
position: absolute;
top: 0; top: 0;
left: 0; left: 70%;
width: 100%; 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); input{
.inner{ width: 195px;
display: flex; margin-left: 10px;
justify-content: space-between; font-size: 14px;
align-items: center; color: #333;
min-width: $min-width; background-color: transparent;
padding: 0 80px 0 10px; border: 0;
margin: 0 auto; &::-webkit-input-placeholder{color: #999}
&::-moz-placeholder{color: #999}
&:-moz-placeholder{color: #999}
&:focus{
outline: none;
}
} }
.logo{ .remove{
position: absolute;
top: 0;
left: 80px;
font-size: 28px;
color: #568DF2;
line-height: $height;
cursor: pointer; cursor: pointer;
} }
.search-icon{
.search{ width: 18px;
z-index: 2; }
position: absolute; }
top: 0; .action{
left: 70%; display: inline-flex;
transform: translate(-50%); align-items: center;
display: flex; .icon{
justify-content: space-between; cursor: pointer;
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{ .user-wrap {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
.icon{
cursor: pointer; .user{
}
.user-wrap {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer;
.user{ .username{
display: inline-flex; margin-left: 10px;
align-items: center; color: #000;
cursor: pointer; font-size: 16px;
.username{
margin-left: 10px;
color: #000;
font-size: 16px;
}
} }
} }
} }
.login{ }
display: inline-flex; .login{
align-items: center; display: inline-flex;
cursor: pointer; align-items: center;
&:hover{ cursor: pointer;
opacity: .9; &:hover{
} opacity: .9;
span{ }
margin-left: 5px; span{
color: #666; margin-left: 5px;
font-size: 14px; color: #666;
} font-size: 14px;
}
}
}
.log-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .4);
}
/deep/.log-dia {
position: absolute;
top: calc((100vh - 500px) / 2);
left: 50%;
width: 500px;
transform: translateX(-50%);
background-color: #fff;
border-radius: 6px;
.bg1 {
width: 100%;
height: 200px;
}
.bg2 {
position: absolute;
top: -150px;
left: 0;
max-width: 100%;
}
.log-title {
position: absolute;
top: 90px;
left: 130px;
font-size: 40px;
color: #fff;
font-weight: 600;
}
.log-wrap {
padding-bottom: 30px;
}
.logs {
max-height: 300px;
padding: 0 60px;
margin: 30px 0;
overflow: auto;
}
h6 {
margin-bottom: 15px;
font-size: 18px;
color: #333;
line-height: 1;
}
.more-wrap {
padding: 0 60px;
font-size: 14px;
color: #333;
}
.more {
font-size: 14px;
color: $main-color;
cursor: pointer;
&:hover {
opacity: .9;
}
}
.know {
margin-top: 15px;
}
.cover {
max-width: 400px;
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;
color: #505050;
} }
} }
}
}
</style> </style>

@ -253,17 +253,8 @@ export default {
this.$post(this.api.saveRecord,{ this.$post(this.api.saveRecord,{
type: 3, type: 3,
}).then(res => {}).catch(res => {}) }).then(res => {}).catch(res => {})
// true util.successMsg('登录成功')
this.$get(this.api.logNotification).then(res => { this.$router.replace('/index')
const history = this.$route.query.redirect
const redirect = res.notification ?
'/log' :
history ?
decodeURIComponent(history) :
'/index'
util.successMsg('登录成功')
this.$router.replace(redirect)
}).catch(res => {})
}, },
submit() { submit() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {

@ -41,7 +41,7 @@
<ul class="filter"> <ul class="filter">
<li style="margin-bottom: 0"> <li style="margin-bottom: 0">
<label>搜索</label> <label>搜索</label>
<el-input style="width: 250px" placeholder="请输入员工账号/姓名/工号" v-model="keyword" suffix-icon="el-icon-search" 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> </li>
</ul> </ul>
<div> <div>
@ -56,7 +56,6 @@
<el-table-column type="selection" width="80" align="center"></el-table-column> <el-table-column type="selection" width="80" align="center"></el-table-column>
<el-table-column type="index" label="序号" width="55" align="center"> <el-table-column type="index" label="序号" width="55" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="account" label="账号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column> <el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column> <el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column>
<el-table-column label="权限状态" align="center"> <el-table-column label="权限状态" align="center">

@ -22,7 +22,8 @@ export default {
schoolId: '', schoolId: '',
userName: '', userName: '',
isManager: false, isManager: false,
isCustomer: false isCustomer: false,
logView: false // 是否查询过日志状态,如果有,则不再调接口
}, },
mutations: { mutations: {
SET_INFO: (state, info) => { SET_INFO: (state, info) => {
@ -39,6 +40,9 @@ export default {
SET_CUSTOMER: (state, isCustomer) => { SET_CUSTOMER: (state, isCustomer) => {
state.isCustomer = isCustomer state.isCustomer = isCustomer
}, },
SET_LOG: (state) => {
state.logView = true
},
}, },
actions: { actions: {
login({ state,commit }, userInfo) { login({ state,commit }, userInfo) {

Loading…
Cancel
Save