refactor: vue3 axios api ...

This commit is contained in:
xingyu
2022-07-19 22:33:54 +08:00
parent ba96eef51a
commit 9e2e220b69
121 changed files with 1022 additions and 9700 deletions

View File

@ -94,8 +94,8 @@ const dialogStyle = computed(() => {
<style lang="less">
.@{elNamespace}-dialog__header {
border-bottom: 1px solid var(--tags-view-border-color);
margin-right: 0 !important;
border-bottom: 1px solid var(--tags-view-border-color);
}
.@{elNamespace}-dialog__footer {

View File

@ -293,7 +293,7 @@ export default defineComponent({
<style lang="less" scoped>
.@{elNamespace}-form.@{namespace}-form .@{elNamespace}-row {
margin-left: 0 !important;
margin-right: 0 !important;
margin-left: 0 !important;
}
</style>

View File

@ -55,34 +55,31 @@ watch(
</script>
<template>
<div>
<router-link
<router-link
:class="[
prefixCls,
layout !== 'classic' ? `${prefixCls}__Top` : '',
'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative',
'dark:bg-[var(--el-bg-color)]'
]"
to="/"
>
<img
src="@/assets/imgs/logo.png"
class="w-[calc(var(--logo-height)-10px)] h-[calc(var(--logo-height)-10px)]"
/>
<div
v-if="show"
:class="[
prefixCls,
layout !== 'classic' ? `${prefixCls}__Top` : '',
'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative',
'dark:bg-[var(--el-bg-color)]'
'ml-10px text-16px font-700',
{
'text-[var(--logo-title-text-color)]': layout === 'classic',
'text-[var(--top-header-text-color)]':
layout === 'topLeft' || layout === 'top' || layout === 'cutMenu'
}
]"
to="/"
>
<img
src="@/assets/imgs/logo.png"
class="w-[calc(var(--logo-height)-10px)] h-[calc(var(--logo-height)-10px)]"
alt=""
/>
<div
v-if="show"
:class="[
'ml-10px text-16px font-700',
{
'text-[var(--logo-title-text-color)]': layout === 'classic',
'text-[var(--top-header-text-color)]':
layout === 'topLeft' || layout === 'top' || layout === 'cutMenu'
}
]"
>
{{ title }}
</div>
</router-link>
</div>
{{ title }}
</div>
</router-link>
</template>

View File

@ -13,7 +13,7 @@ export default defineComponent({
pageSize: propTypes.number.def(10),
currentPage: propTypes.number.def(1),
// 是否多选
selection: propTypes.bool.def(true),
selection: propTypes.bool.def(false),
// 是否所有的超出隐藏优先级低于schema中的showOverflowTooltip,
showOverflowTooltip: propTypes.bool.def(true),
// 表头
@ -294,9 +294,3 @@ export default defineComponent({
}
})
</script>
<style lang="less" scoped>
:deep(.el-button.is-text) {
margin-left: 0;
padding: 8px 10px;
}
</style>

View File

@ -84,7 +84,7 @@ const refreshSelectedTag = async (view?: RouteLocationNormalizedLoaded) => {
tagsViewStore.delCachedView()
const { path, query } = view
await nextTick()
await replace({
replace({
path: '/redirect' + path,
query: query
})
@ -107,7 +107,15 @@ const toLastView = () => {
if (latestView) {
push(latestView)
} else {
push('/')
if (
unref(currentRoute).path === permissionStore.getAddRouters[0].path ||
unref(currentRoute).path === permissionStore.getAddRouters[0].redirect
) {
addTags()
return
}
// You can set another route
push(permissionStore.getAddRouters[0].path)
}
}

View File

@ -22,9 +22,9 @@ const { push, replace } = useRouter()
const user = wsCache.get('user')
const avatar = user ? user.user.avatar : '@/assets/imgs/avatar.gif'
const avatar = user?.user?.avatar ? user.user.avatar : '@/assets/imgs/avatar.gif'
const userName = user ? user.user.nickname : 'Admin'
const userName = user?.user?.nickname ? user.user.nickname : 'Admin'
const loginOut = () => {
ElMessageBox.confirm(t('common.loginOutMessage'), t('common.reminder'), {
@ -38,7 +38,6 @@ const loginOut = () => {
removeToken()
tagsViewStore.delAllViews()
replace('/login')
// }
})
.catch(() => {})
}