日志等优化

dev_2022-04-07
yujialong 3 years ago
parent b9b3878d4c
commit 583496feff
  1. 171
      src/layouts/header/index.vue
  2. 173
      src/layouts/home/index.vue
  3. 121
      src/pages/account/login/index.vue
  4. 2
      src/pages/match/list/index.vue
  5. 2
      src/pages/setting/person/info.vue

@ -24,33 +24,6 @@
</div>
</div>
</div>
<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>
</template>
<script>
@ -58,78 +31,34 @@ import { mapState, mapMutations, mapActions } from "vuex";
import Setting from "@/setting";
import util from "@/libs/util";
import navbar from "../navbar";
import log from '@/components/log'
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
isIndex: Setting.whiteList.find(e => e === this.$route.path), //
logVisible: false,
list: [],
logAll: false,
funcList: [
{
id: 0,
name: '新功能',
icon: 'func'
},
{
id: 1,
name: '修复',
icon: 'bug'
},
{
id: 2,
name: '优化',
icon: 'optimize'
}
]
};
},
components: {
navbar,
log
navbar
},
computed: {
...mapState("user", [
"title", "logoUrl", "avatar", "userName", 'customerName', 'logView'
"title", "logoUrl", "avatar", "userName", 'customerName'
])
},
mounted() {
if (this.token) {
this.getSystemDetail();
this.getUserInfo();
this.logView || this.getLogStatus() // logViewfalse
}
},
methods: {
...mapMutations("user", [
'SET_CUSTOMERNAME', 'SET_LOG'
'SET_CUSTOMERNAME'
]),
...mapActions("user", [
"logout", "setTitle", "setLogoUrl", "setAvatar", "setUserName"
]),
//
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 => {})
},
getSystemDetail () {
this.$get(this.api.logoDetail).then(({ data }) => {
if (data) {
@ -263,98 +192,4 @@ $height: 64px;
}
}
}
.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>

@ -9,12 +9,37 @@
<el-backtop target=".content"></el-backtop>
<v-footer ref="footer"></v-footer>
</div>
<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">
<el-button class="know" type="primary" size="small" @click="logVisible = false">知道了</el-button>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import { mapState, mapMutations, mapActions } from "vuex";
import util from "@/libs/util";
import Setting from "@/setting";
import vHead from "../header";
@ -23,21 +48,71 @@ import vFooter from "../footer";
export default {
data() {
return {
logVisible: false,
list: [],
logAll: false,
funcList: [
{
id: 0,
name: '新功能',
icon: 'func'
},
{
id: 1,
name: '修复',
icon: 'bug'
},
{
id: 2,
name: '优化',
icon: 'optimize'
}
]
};
},
components: {
vHead,
vFooter
},
computed: {},
computed: {
...mapState("user", [
'logView'
])
},
mounted() {
this.autoLogout();
this.logView || this.getLogStatus() // logViewfalse
},
methods: {
...mapMutations("user", [
'SET_LOG'
]),
...mapActions("user", [
"logout"
]),
//
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, {
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();
@ -65,4 +140,96 @@ export default {
padding: 0;
}
}
.log-mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, .4);
}
/deep/.log-dia {
z-index: 11;
position: absolute;
top: 250px;
left: 50%;
width: 450px;
transform: translateX(-50%);
background-color: #fff;
border-radius: 6px;
.bg1 {
width: 100%;
height: 140px;
}
.bg2 {
position: absolute;
top: -130px;
left: 6px;
max-width: 100%;
height: 250px;
}
.log-title {
position: absolute;
top: 65px;
left: 0;
width: 100%;
text-align: center;
font-size: 22px;
color: #fff;
font-weight: 600;
}
.log-wrap {
padding-bottom: 30px;
}
.logs {
max-height: 250px;
padding: 0 100px;
margin: 30px 0;
overflow: auto;
}
h6 {
margin-bottom: 15px;
font-size: 16px;
color: #333;
line-height: 1;
}
.more-wrap {
padding: 0 60px;
font-size: 14px;
color: #333;
text-align: center;
}
.know {
margin-top: 15px;
}
.cover {
max-width: 250px;
margin: 10px 0 20px;
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 14px;
img {
width: 20px;
margin-right: 8px;
}
}
.val {
font-size: 15px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
font-size: 13px;
color: #505050;
}
}
}
}
</style>

@ -23,7 +23,7 @@
<el-option label="老师工号" :value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="workNumber">
<el-form-item class="flex-1" prop="workNumber">
<label class="label account"></label>
<el-input v-model.trim="form.workNumber" :placeholder="'请输入' + (form.type ? '学生学号' : '老师工号')" @keyup.enter.native="submit"></el-input>
</el-form-item>
@ -41,9 +41,9 @@
</el-form-item>
<el-form-item prop="code">
<label class="label code"></label>
<div class="flex">
<div class="ver-code">
<el-input v-model="form.code" placeholder="请输入验证码" maxlength="6" @keyup.enter.native="submit"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
<el-button type="text" @click="sendPhoneCodeLogin" :disabled="phoneDisabledLogin">{{ phoneBtnTextLogin }}
</el-button>
</div>
</el-form-item>
@ -81,14 +81,14 @@
<div style='padding: 0 13px 20px 13px;'>
依据国家政策法规需绑定手机号进行实网络实名才可登录使用本平台
</div>
<el-form ref="form" label-width="60px">
<el-form label-width="60px">
<el-form-item label="手机号">
<el-input style="width: 100%;" placeholder="请输入手机号" v-model="phone" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display: flex;">
<div class="ver-code">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left: 10px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{ phoneBtnText }}
<el-button style="top: 1px" type="text" @click="sendPhoneCode(1)" :disabled="binding === '' || phoneDisabled">{{ phoneBtnText }}
</el-button>
</div>
</el-form-item>
@ -119,6 +119,24 @@
</li>
</ul>
</el-dialog>
<el-dialog :visible.sync="infoVisible" :close-on-click-modal="false" custom-class="info-dia" :show-close="false" width="400px">
<div class="info-header">
<i class="el-icon-warning"></i>
提示
</div>
<div class="info-wrap">
<p class="tips">该手机号已与以下用户绑定</p>
<ul class="users">
<li v-for="(user, i) in infos" :key="i">
<span>{{ user.userName }}{{ user.schoolName }}</span>
</li>
</ul>
<div class="info-footer">
<el-button size="small" type="primary" @click="bindPhone">是本人继续绑定</el-button>
<el-button class="unbind" size="small" @click="unbindPhone">不是本人解绑以上用户并绑定新用户</el-button>
</div>
</div>
</el-dialog>
<v-footer ref="footer"></v-footer>
</div>
</template>
@ -182,7 +200,9 @@ export default {
userVisible: false,
users: [],
accountIds: [],
binding: ''
binding: '',
infoVisible: false,
infos: []
};
},
components: {
@ -299,7 +319,8 @@ export default {
util.successMsg('登录成功')
this.$router.replace('/station')
},
submit() { //
//
submit() {
this.$refs.form.validate(valid => {
if (valid) {
const form = JSON.parse(JSON.stringify(this.form))
@ -389,27 +410,30 @@ export default {
this.phoneCountdownLogin()
}).catch(res => {})
},
//
bindPhone() {
this.infoVisible = false
this.binding = true
this.sendPhoneCode(1)
},
//
unbindPhone() {
this.infoVisible = false
this.binding = false
this.sendPhoneCode(0)
},
//
phoneChange() {
this.$post(`${this.api.getOtherAccountByPhone}?phone=${this.phone}&platform=${Setting.platformId}`).then(({ userAccounts }) => {
const list = userAccounts
if (list) {
const msg = []
list.map(e => {
msg.push(`${e.userName}${e.schoolName},学号${e.workNumber}`)
const { userName } = e
if (userName.length > 1) e.userName = userName[0] + '*' + userName.substring(2)
})
this.infos = list
this.accountIds = list.map(e => e.id)
this.$confirm(`该手机号已与${msg.join(';')}的用户绑定,是否为本人?选择否,则解绑以上用户信息,并授权手机号绑定新用户信息。`, '提示', {
type: 'warning',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(() => {
this.binding = true
this.sendPhoneCode(1)
}).catch(() => {
this.binding = false
this.sendPhoneCode(0)
})
this.infoVisible = true
} else {
this.binding = true
}
@ -480,6 +504,7 @@ export default {
const { phone, phoneCode } = this
if (!this.verifyPhone(phone)) return false
if (!phoneCode) return util.warningMsg('请输入验证码')
const { workNumber, schoolId } = this.form
if (this.binding) {
this.$post(this.api.bindPhoneOrEmail, {
phone,
@ -487,7 +512,8 @@ export default {
code: phoneCode,
opener: this.phoneOpener,
platform: Setting.platformId,
account: this.form.workNumber
account: workNumber,
schoolId
}).then(({ token }) => {
this.token = token
this.setLogin()
@ -505,6 +531,14 @@ export default {
min-height: 100%;
background-color: #F3F6FA;
}
.ver-code {
position: relative;
.el-button {
position: absolute;
top: 10px;
right: 10px;
}
}
.login{
min-height: calc(100vh - 43px);
padding-top: calc((100vh - 584px) / 2);
@ -698,6 +732,49 @@ export default {
}
}
}
/deep/.info-dia {
.el-dialog__header {
border-bottom: 0;
}
.info-header {
position: absolute;
top: 20px;
display: flex;
align-items: center;
font-size: 16px;
color: #333;
}
.el-icon-warning {
margin-right: 10px;
color: #e6a23c;
font-size: 24px;
}
.info-wrap {
padding: 10px 33px;
}
.users {
max-height: 125px;
margin-top: 20px;
overflow: auto;
li {
margin: 5px;
font-size: 14px;
color: #333;
}
}
.info-footer {
display: flex;
justify-content: space-between;
margin-top: 20px;
}
.el-button {
width: 142px;
}
.unbind {
white-space: normal;
line-height: 1.6;
}
}
@media (max-height: 680px) {
.wrap .login {
padding: 40px 0;

@ -432,7 +432,7 @@ export default {
}
&.signing {
background-color: #9076FF;
background-color: $main-color;
}
&.signed {

@ -188,7 +188,7 @@
<el-dialog :title="form.phone ? '更换手机号' : '绑定手机号'" :visible.sync="phoneVisible" :close-on-click-modal="false" @close="closePhone" width="30%">
<el-form ref="form" :model="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
<el-input style="width: 404px;" placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div class="flex">

Loading…
Cancel
Save