!492 解决XTable接口报错时loading不消失等一些问题
Merge pull request !492 from clockdotnet/master-vxepull/497/MERGE
commit
c5fba310a2
|
@ -160,26 +160,42 @@ const getProxyConfig = (options: XTableProps) => {
|
||||||
queryParams.pageSize = page.pageSize
|
queryParams.pageSize = page.pageSize
|
||||||
queryParams.pageNo = page.currentPage
|
queryParams.pageNo = page.currentPage
|
||||||
}
|
}
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
resolve(await getListApi(queryParams))
|
resolve(await getListApi(queryParams))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
delete: ({ body }) => {
|
delete: ({ body }) => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (options.deleteApi) {
|
if (options.deleteApi) {
|
||||||
|
try {
|
||||||
resolve(await options.deleteApi(JSON.stringify(body)))
|
resolve(await options.deleteApi(JSON.stringify(body)))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Promise.reject('未设置deleteApi')
|
reject('未设置deleteApi')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
queryAll: ({ form }) => {
|
queryAll: ({ form }) => {
|
||||||
const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form)))
|
const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form)))
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (options.getAllListApi) {
|
if (options.getAllListApi) {
|
||||||
|
try {
|
||||||
resolve(await options.getAllListApi(queryParams))
|
resolve(await options.getAllListApi(queryParams))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
resolve(await getListApi(queryParams))
|
resolve(await getListApi(queryParams))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -196,8 +212,12 @@ const getProxyConfig = (options: XTableProps) => {
|
||||||
if (options?.params) {
|
if (options?.params) {
|
||||||
queryParams = Object.assign(queryParams, options.params)
|
queryParams = Object.assign(queryParams, options.params)
|
||||||
}
|
}
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
resolve(await getListApi(queryParams))
|
resolve(await getListApi(queryParams))
|
||||||
|
} catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,17 +65,17 @@ const toDocument = () => {
|
||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<ElDropdownMenu>
|
<ElDropdownMenu>
|
||||||
<ElDropdownItem>
|
<ElDropdownItem @click="toProfile">
|
||||||
<Icon icon="ep:tools" />
|
<Icon icon="ep:tools" />
|
||||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
<div>{{ t('common.profile') }}</div>
|
||||||
</ElDropdownItem>
|
</ElDropdownItem>
|
||||||
<ElDropdownItem>
|
<ElDropdownItem @click="toDocument">
|
||||||
<Icon icon="ep:menu" />
|
<Icon icon="ep:menu" />
|
||||||
<div @click="toDocument">{{ t('common.document') }}</div>
|
<div>{{ t('common.document') }}</div>
|
||||||
</ElDropdownItem>
|
</ElDropdownItem>
|
||||||
<ElDropdownItem divided>
|
<ElDropdownItem divided @click="lockScreen">
|
||||||
<Icon icon="ep:lock" />
|
<Icon icon="ep:lock" />
|
||||||
<div @click="lockScreen">{{ t('lock.lockScreen') }}</div>
|
<div>{{ t('lock.lockScreen') }}</div>
|
||||||
</ElDropdownItem>
|
</ElDropdownItem>
|
||||||
<ElDropdownItem divided @click="loginOut">
|
<ElDropdownItem divided @click="loginOut">
|
||||||
<Icon icon="ep:switch-button" />
|
<Icon icon="ep:switch-button" />
|
||||||
|
|
|
@ -53,9 +53,9 @@ async function goLogin() {
|
||||||
// 登出后清理
|
// 登出后清理
|
||||||
deleteUserCache() // 清空用户缓存
|
deleteUserCache() // 清空用户缓存
|
||||||
tagsViewStore.delAllViews()
|
tagsViewStore.delAllViews()
|
||||||
resetRouter() // 重置静态路由表
|
// resetRouter() // 重置静态路由表
|
||||||
lockStore.resetLockInfo()
|
lockStore.resetLockInfo()
|
||||||
replace('/login')
|
replace('/login?redirect=/index')
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleShowForm(show = false) {
|
function handleShowForm(show = false) {
|
||||||
|
|
|
@ -69,7 +69,11 @@ router.beforeEach(async (to, from, next) => {
|
||||||
const userStore = useUserStoreWithOut()
|
const userStore = useUserStoreWithOut()
|
||||||
const permissionStore = usePermissionStoreWithOut()
|
const permissionStore = usePermissionStoreWithOut()
|
||||||
if (!dictStore.getIsSetDict) {
|
if (!dictStore.getIsSetDict) {
|
||||||
|
try {
|
||||||
await dictStore.setDictMap()
|
await dictStore.setDictMap()
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!userStore.getIsSetUser) {
|
if (!userStore.getIsSetUser) {
|
||||||
isRelogin.show = true
|
isRelogin.show = true
|
||||||
|
|
Loading…
Reference in New Issue