Commit dcb5157f by 前端

增加登录鉴权,修改样式

1 parent 808ef0b6
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
margin: 0 3px; margin: 0 3px;
.rank-wrap { .rank-wrap {
height: 9%; height: 8.9%;
display: grid; display: grid;
grid-template-columns: 8% 77% 15%; grid-template-columns: 8% 77% 15%;
color: #FFFFFF; color: #FFFFFF;
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<el-form-item label='品牌' size='mini'> <el-form-item label='品牌' size='mini'>
<el-select <el-select
size='mini' size='mini'
class='gl-select'
:popper-append-to-body='false'
v-model='renewalSearchForm.brandName' v-model='renewalSearchForm.brandName'
placeholder='请选择品牌' placeholder='请选择品牌'
...@@ -35,6 +37,7 @@ ...@@ -35,6 +37,7 @@
</el-form-item> </el-form-item>
<el-form-item label='查询时间' size='mini'> <el-form-item label='查询时间' size='mini'>
<el-date-picker <el-date-picker
class="top-date"
size='mini' size='mini'
value-format='yyyy-MM-dd' value-format='yyyy-MM-dd'
v-model='renewalSearchForm.withdrawalTime' v-model='renewalSearchForm.withdrawalTime'
...@@ -365,9 +368,62 @@ export default { ...@@ -365,9 +368,62 @@ export default {
} }
</script> </script>
<style lang='scss'>
/* 日历样式 */
.el-picker-panel {
background: #333 !important;
color: #ffffff;
//border: 1px solid #93bee7 !important;
}
//.el-picker-panel .el-date-range-picker__time-header {
// border-bottom: 1px solid #93bee7 !important;
//}
.el-picker-panel__icon-btn {
width: 8px;
height: 10px;
color: #EB6001 !important;
}
.el-picker-panel .el-input__inner {
background-color: #333;
//border: #75ebf2;
color: #fff;
}
.el-picker-panel .el-date-range-picker__header {
color: #fff;
}
.el-picker-panel .el-date-table th {
color: #fff;
}
.el-picker-panel .el-date-table td.available {
//width: 14px;
//height: 14px;
//font-size: 16px;
//font-family: Source Han Sans CN;
font-weight: bold;
color: #fff;
}
.el-picker-panel .el-date-table td.available:hover {
color: #ffffff;
}
.el-date-table td.end-date span, .el-date-table td.start-date span{
background-color: #EB6001 !important;
}
.el-date-table td.today span{
color: #EB6001 !important;
}
.el-picker-panel .el-date-table td.available{
color: #c5c5c5;
}
.el-select-dropdown__list{
background: #333;
}
</style>
<style lang='scss' scoped> <style lang='scss' scoped>
.high-light-num{ .high-light-num{
color: #EB6001; color: #FFF;
//font-weight: 700;
} }
.activity-Name { .activity-Name {
//width: 100%; //width: 100%;
...@@ -398,6 +454,12 @@ export default { ...@@ -398,6 +454,12 @@ export default {
height: 76px; height: 76px;
display: flex; display: flex;
align-items: center; align-items: center;
/deep/.el-select-dropdown__item.selected{
color: #EB6001;
}
/deep/ .el-date-table td.available today span{
color: red !important;
}
/deep/ .el-form-item__label { /deep/ .el-form-item__label {
color: #E8E8E8; color: #E8E8E8;
...@@ -465,7 +527,7 @@ export default { ...@@ -465,7 +527,7 @@ export default {
/deep/ .el-table tr { /deep/ .el-table tr {
background-color: #353535; background-color: #353535;
color: #FFFFFF; color: #C2C2C2;
} }
/deep/ .el-table .cell { /deep/ .el-table .cell {
......
...@@ -32,9 +32,7 @@ export default { ...@@ -32,9 +32,7 @@ export default {
getRank(){ getRank(){
this.api.renewal.getRanking().then(res => { this.api.renewal.getRanking().then(res => {
if (res.code == 0) { if (res.code == 0) {
console.log(res)
this.totalRank = res.data.dataList this.totalRank = res.data.dataList
console.log(this.totalRank)
} }
}) })
} }
...@@ -44,7 +42,7 @@ export default { ...@@ -44,7 +42,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.right { .right {
width: 98%;
display: grid; display: grid;
grid-template-columns: 25% 25% 25% 25%; grid-template-columns: 25% 25% 25% 25%;
} }
......
...@@ -8,5 +8,17 @@ ...@@ -8,5 +8,17 @@
*/ */
import router from './router' import router from './router'
import { keeps } from './routes' import { keeps } from './routes'
export const keepAlives = keeps export const keepAlives = keeps
router.beforeEach((to, from, next) => {
// 如果用户访问的登录页,直接放行
if (to.path === '/login') return next()
// 从sessionStorage中获取到保存的token值
const tokenStr = window.sessionStorage.getItem('token')
// 没有token,强制跳转到登录页
if (!tokenStr) return next('/login')
next()
})
export default router export default router
...@@ -63,7 +63,7 @@ const getPages = _ => { ...@@ -63,7 +63,7 @@ const getPages = _ => {
if (e.meta && e.meta.keepAlive) keepAlives.push(name) if (e.meta && e.meta.keepAlive) keepAlives.push(name)
return route return route
}) })
console.log(router)
return [...router] return [...router]
} }
......
...@@ -5,7 +5,7 @@ import { Toast, Dialog } from 'vant' ...@@ -5,7 +5,7 @@ import { Toast, Dialog } from 'vant'
* 日期格式化 * 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss') * let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/ */
Date.prototype.format = function (fmt) { Date.prototype.format = function(fmt) {
let o = { let o = {
'M+': this.getMonth() + 1, //月份 'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日 'd+': this.getDate(), //日
...@@ -31,7 +31,7 @@ const throttle = (fn, gapTime) => { ...@@ -31,7 +31,7 @@ const throttle = (fn, gapTime) => {
gapTime = 1500 gapTime = 1500
} }
let _lastTime = null let _lastTime = null
return function () { return function() {
let _nowTime = +new Date() let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) { if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) fn.apply(this, arguments)
...@@ -45,7 +45,6 @@ const decimal = (num, fixed) => { ...@@ -45,7 +45,6 @@ const decimal = (num, fixed) => {
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
const toTop = () => { const toTop = () => {
let bodySrcollTop = document.body.scrollTop let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) { if (bodySrcollTop !== 0) {
...@@ -98,9 +97,9 @@ const getNMonth = (n, fmt = 'yyyy-MM-dd') => { ...@@ -98,9 +97,9 @@ const getNMonth = (n, fmt = 'yyyy-MM-dd') => {
return new Date(new Date().setMonth(new Date().getMonth() + n)).format(fmt) return new Date(new Date().setMonth(new Date().getMonth() + n)).format(fmt)
} }
const debounce = function (func, wait = 200) { const debounce = function(func, wait = 200) {
let timeout let timeout
return function (event) { return function(event) {
clearTimeout(timeout) clearTimeout(timeout)
timeout = setTimeout(() => { timeout = setTimeout(() => {
func.call(this, event) func.call(this, event)
...@@ -112,6 +111,14 @@ const setChartFontSize = fontSize => { ...@@ -112,6 +111,14 @@ const setChartFontSize = fontSize => {
if (!clientWidth) return fontSize if (!clientWidth) return fontSize
return fontSize * clientWidth / 1440 return fontSize * clientWidth / 1440
} }
const toThousands = n => {
return n && n.toString().replace(/\d+/, function(m) {
return m.replace(/(\d)(?=(\d{3})+$)/g, function(y) {
return y + ','
})
})
}
const utils = { const utils = {
getParams, getParams,
getQuery, getQuery,
...@@ -123,7 +130,8 @@ const utils = { ...@@ -123,7 +130,8 @@ const utils = {
getNDate, getNDate,
getNMonth, getNMonth,
debounce, debounce,
setChartFontSize setChartFontSize,
toThousands
} }
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
......
...@@ -51,6 +51,7 @@ export default { ...@@ -51,6 +51,7 @@ export default {
} else { } else {
if (Object.keys(this.accountPassword).includes(user)) { if (Object.keys(this.accountPassword).includes(user)) {
if (pwd == this.accountPassword[user]) { if (pwd == this.accountPassword[user]) {
window.sessionStorage.setItem('token', 'xixixihhhhhxixixi12345sfascasf')
this.$router.push('./home') this.$router.push('./home')
} else { } else {
this.$message.error('密码错误') this.$message.error('密码错误')
...@@ -118,18 +119,22 @@ export default { ...@@ -118,18 +119,22 @@ export default {
justify-content: center; justify-content: center;
//align-items: center; //align-items: center;
position: relative; position: relative;
.authorization-wrap { .authorization-wrap {
margin-bottom: 10%; margin-bottom: 10%;
.password-wrap{
.password-wrap {
margin-top: 20px; margin-top: 20px;
} }
.user-input{
.user-input {
/deep/ .el-input__inner { /deep/ .el-input__inner {
background: linear-gradient(269deg, #ff660000 0%, #fb6900c7 51%, #FA6A00 98%); background: linear-gradient(269deg, #ff660000 0%, #fb6900c7 51%, #FA6A00 98%);
border: none; border: none;
//opacity: 0.67; //opacity: 0.67;
color: #FFFFFF; color: #FFFFFF;
} }
/deep/ .el-input__inner::placeholder { /deep/ .el-input__inner::placeholder {
color: #FFFFFF; color: #FFFFFF;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!