优化
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import '@/styles/adminDensity.css'
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -32,7 +33,7 @@ async function confirmDiscard(tabIds: readonly string[]) {
|
||||
await ElMessageBox.confirm(
|
||||
`以下内容尚未保存:${labels.join('、')}。关闭页签后将放弃这些修改。`,
|
||||
'放弃未保存的修改?',
|
||||
{ confirmButtonText: '放弃并关闭', cancelButtonText: '继续编辑', type: 'warning' },
|
||||
{ confirmButtonText: '放弃并关闭', cancelButtonText: '继续编辑', type: 'warning', customClass: 'admin-density-confirm' },
|
||||
)
|
||||
return true
|
||||
} catch {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import '@/styles/adminDensity.css'
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -57,7 +58,7 @@ async function pruneInaccessibleTabs() {
|
||||
await ElMessageBox.alert(
|
||||
`账号权限已变化,以下未保存内容无法继续编辑:${[...new Set(discardedDirtyWork.map((entry) => entry.label))].join('、')}。相关页签将关闭。`,
|
||||
'权限已变化',
|
||||
{ confirmButtonText: '知道了', type: 'warning' },
|
||||
{ confirmButtonText: '知道了', type: 'warning', customClass: 'admin-density-confirm' },
|
||||
).catch(() => undefined)
|
||||
}
|
||||
const previousActiveId = workspace.activeId
|
||||
@@ -76,6 +77,7 @@ async function handleLogout() {
|
||||
const dirtyNotice = dirtyLabels.length ? ` 当前还有未保存内容:${[...new Set(dirtyLabels)].join('、')},退出后将丢失。` : ''
|
||||
await ElMessageBox.confirm(`确定退出管理后台吗?${dirtyNotice}`, '退出登录', {
|
||||
confirmButtonText: '退出',
|
||||
customClass: 'admin-density-confirm',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
} catch {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import '@/styles/adminDensity.css'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import AppLayout from '@/app/layouts/AppLayout.vue'
|
||||
@@ -99,7 +100,7 @@ router.beforeEach(async (to, from) => {
|
||||
await ElMessageBox.confirm(
|
||||
`当前页面还有未保存内容:${[...new Set(blocking.map((entry) => entry.label))].join('、')}。继续后将放弃这些修改。`,
|
||||
'放弃未保存的修改?',
|
||||
{ confirmButtonText: '放弃并继续', cancelButtonText: '继续编辑', type: 'warning' },
|
||||
{ confirmButtonText: '放弃并继续', cancelButtonText: '继续编辑', type: 'warning', customClass: 'admin-density-confirm' },
|
||||
)
|
||||
unsaved.removeWorkspaces([fromId])
|
||||
useWorkspaceTabsStore().bumpCacheEpoch(fromId)
|
||||
|
||||
Reference in New Issue
Block a user