This commit is contained in:
GGJ
2024-01-03 14:50:35 +08:00
7 changed files with 26 additions and 23 deletions

View File

@@ -9,5 +9,6 @@ export const defaultAttribute:VxeTableProps = {
columnConfig: { resizable: true }, columnConfig: { resizable: true },
rowConfig: { isCurrent: true, isHover: true }, rowConfig: { isCurrent: true, isHover: true },
scrollX: { scrollToLeftOnChange: true }, scrollX: { scrollToLeftOnChange: true },
scrollY: { scrollToTopOnChange: true,enabled:true },
treeConfig: {} treeConfig: {}
} }

View File

@@ -51,22 +51,17 @@ const onMenuCollapse = () => {
margin: 2px 0 0 4px; margin: 2px 0 0 4px;
color: v-bind('config.getColorVal("headerBarTabColor")') !important; color: v-bind('config.getColorVal("headerBarTabColor")') !important;
} }
.close-icon:hover {
background: v-bind('config.getColorVal("headerBarBackground")');
color: var(--el-border-color) !important;
border-radius: 50%;
}
&.active { &.active {
color: v-bind('config.getColorVal("headerBarTabActiveColor")'); color: v-bind('config.getColorVal("headerBarTabActiveColor")');
.close-icon { .close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important; color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;;
} }
} }
&:hover { &:hover {
color: v-bind('config.getColorVal("headerBarTabActiveColor")'); color: v-bind('config.getColorVal("headerBarTabActiveColor")');
background-color: v-bind('config.getColorVal("headerBarHoverBackground")'); background-color: v-bind('config.getColorVal("headerBarHoverBackground")');
.close-icon { .close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important; color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;;
} }
} }
} }

View File

@@ -37,11 +37,6 @@ const config = useConfig()
margin: 2px 0 0 4px; margin: 2px 0 0 4px;
color: v-bind('config.getColorVal("headerBarTabColor")') !important; color: v-bind('config.getColorVal("headerBarTabColor")') !important;
} }
.close-icon:hover {
background: v-bind('config.getColorVal("headerBarBackground")');
color: var(--el-border-color) !important;
border-radius: 50%;
}
&.active { &.active {
color: v-bind('config.getColorVal("headerBarTabActiveColor")'); color: v-bind('config.getColorVal("headerBarTabActiveColor")');
.close-icon { .close-icon {
@@ -52,7 +47,7 @@ const config = useConfig()
color: v-bind('config.getColorVal("headerBarTabActiveColor")'); color: v-bind('config.getColorVal("headerBarTabActiveColor")');
background-color: v-bind('config.getColorVal("headerBarHoverBackground")'); background-color: v-bind('config.getColorVal("headerBarHoverBackground")');
.close-icon { .close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important; color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;;
} }
} }
} }

View File

@@ -29,7 +29,7 @@
<template #reference> <template #reference>
<div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''"> <div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''">
<el-avatar :size="25" fit="fill"> <el-avatar :size="25" fit="fill">
<img :src="fullUrl(adminInfo.avatar)" alt="" /> <img src="@/assets/avatar.png" alt="" />
</el-avatar> </el-avatar>
<div class="admin-name">{{ adminInfo.nickname }}</div> <div class="admin-name">{{ adminInfo.nickname }}</div>
</div> </div>
@@ -37,7 +37,7 @@
<div> <div>
<div class="admin-info-base"> <div class="admin-info-base">
<el-avatar :size="70" fit="fill"> <el-avatar :size="70" fit="fill">
<img :src="fullUrl(adminInfo.avatar)" alt="" /> <img src="@/assets/avatar.png" alt="" />
</el-avatar> </el-avatar>
<div class="admin-info-other"> <div class="admin-info-other">
<div class="admin-info-name">{{ adminInfo.nickname }}</div> <div class="admin-info-name">{{ adminInfo.nickname }}</div>
@@ -45,8 +45,8 @@
</div> </div>
</div> </div>
<div class="admin-info-footer"> <div class="admin-info-footer">
<el-button @click="onAdminInfo" type="primary" plain>{{ 'layouts.personal data' }}</el-button> <el-button @click="onAdminInfo" type="primary" plain>个人资料</el-button>
<el-button @click="onLogout" type="danger" plain>{{ 'layouts.cancellation' }}</el-button> <el-button @click="onLogout" type="danger" plain>退出登录</el-button>
</div> </div>
</div> </div>
</el-popover> </el-popover>
@@ -106,7 +106,9 @@ const onAdminInfo = () => {
routePush({ name: 'routine/adminInfo' }) routePush({ name: 'routine/adminInfo' })
} }
const onLogout = () => {} const onLogout = () => {
router.push({ name: 'login' })
}
// const onClearCache = (type: string) => { // const onClearCache = (type: string) => {
// if (type == 'storage' || type == 'all') { // if (type == 'storage' || type == 'all') {

View File

@@ -10,7 +10,7 @@ export const useAdminInfo = defineStore('adminInfo', {
nickname: '', nickname: '',
avatar: '', avatar: '',
last_login_time: '', last_login_time: '',
token: localStorage.getItem('token') || '', token: '',
refresh_token: '', refresh_token: '',
super: false super: false
} }
@@ -26,7 +26,6 @@ export const useAdminInfo = defineStore('adminInfo', {
setToken(token: string, type: 'auth' | 'refresh') { setToken(token: string, type: 'auth' | 'refresh') {
const field = type == 'auth' ? 'token' : 'refresh_token' const field = type == 'auth' ? 'token' : 'refresh_token'
this[field] = token this[field] = token
window.localStorage.setItem(field, token)
}, },
getToken(type: 'auth' | 'refresh' = 'auth') { getToken(type: 'auth' | 'refresh' = 'auth') {
return type === 'auth' ? this.token : this.refresh_token return type === 'auth' ? this.token : this.refresh_token

View File

@@ -48,6 +48,7 @@ export default class TableStore {
} }
index() { index() {
this.table.data = []
this.table.loading = true this.table.loading = true
// 重置用的数据数据 // 重置用的数据数据
if (!this.initData) { if (!this.initData) {
@@ -124,7 +125,10 @@ export default class TableStore {
() => { () => {
this.table.params.pageNum = data.page this.table.params.pageNum = data.page
if (this.isWebPaging) { if (this.isWebPaging) {
this.table.data = this.table.webPagingData[data.page - 1] this.table.data = []
requestAnimationFrame(() => {
this.table.data = this.table.webPagingData[data.page - 1]
})
} else { } else {
this.index() this.index()
} }

View File

@@ -73,13 +73,19 @@ import { gongkey, login } from '@/api/user'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import type { FormInstance, InputInstance, FormRules } from 'element-plus' import type { FormInstance, InputInstance, FormRules } from 'element-plus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
import { Local } from '@/utils/storage'
const router = useRouter() const router = useRouter()
let timer: number let timer: number
const formRef = ref<FormInstance>() const formRef = ref<FormInstance>()
const usernameRef = ref<InputInstance>() const usernameRef = ref<InputInstance>()
const passwordRef = ref<InputInstance>() const passwordRef = ref<InputInstance>()
const useInfo = useAdminInfo() const userInfo = useAdminInfo()
Local.remove(ADMIN_INFO)
Local.remove(ADMIN_INFO)
userInfo.removeToken()
interface RuleForm { interface RuleForm {
username: string username: string
password: string password: string
@@ -107,6 +113,7 @@ const focusInput = () => {
} }
onMounted(() => { onMounted(() => {
timer = window.setTimeout(() => { timer = window.setTimeout(() => {
pageBubble.init() pageBubble.init()
}, 0) }, 0)
@@ -134,7 +141,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
}).then(res => { }).then(res => {
console.log('🚀 ~ file: login.vue:134 ~ gongkey ~ res:', res) console.log('🚀 ~ file: login.vue:134 ~ gongkey ~ res:', res)
useInfo.setToken(res.data.token_type + ' ' + res.data.access_token, 'auth') userInfo.setToken(res.data.token_type + ' ' + res.data.access_token, 'auth')
state.submitLoading = false state.submitLoading = false
router.push({ router.push({
path: 'admin/dashboard' path: 'admin/dashboard'