|
|
@ -3,8 +3,9 @@ import type { WorkbenchTodoItem, WorkbenchTrendItem } from '@vben/common-ui'; |
|
|
|
|
|
|
|
|
import type { FavoriteMenu } from './types'; |
|
|
import type { FavoriteMenu } from './types'; |
|
|
|
|
|
|
|
|
import { computed, onMounted, ref } from 'vue'; |
|
|
import { computed, defineAsyncComponent, onMounted, ref } from 'vue'; |
|
|
|
|
|
|
|
|
|
|
|
import { useVbenModal } from '@vben/common-ui'; |
|
|
import { useAppConfig } from '@vben/hooks'; |
|
|
import { useAppConfig } from '@vben/hooks'; |
|
|
import { $t } from '@vben/locales'; |
|
|
import { $t } from '@vben/locales'; |
|
|
import { preferences } from '@vben/preferences'; |
|
|
import { preferences } from '@vben/preferences'; |
|
|
@ -16,7 +17,7 @@ import { |
|
|
useMyNotifilersApi, |
|
|
useMyNotifilersApi, |
|
|
useNotificationSerializer, |
|
|
useNotificationSerializer, |
|
|
} from '@abp/notifications'; |
|
|
} from '@abp/notifications'; |
|
|
import { Empty } from 'ant-design-vue'; |
|
|
import { Empty, message } from 'ant-design-vue'; |
|
|
|
|
|
|
|
|
import { useMyFavoriteMenusApi } from '../../api/useMyFavoriteMenusApi'; |
|
|
import { useMyFavoriteMenusApi } from '../../api/useMyFavoriteMenusApi'; |
|
|
import WorkbenchHeader from './components/WorkbenchHeader.vue'; |
|
|
import WorkbenchHeader from './components/WorkbenchHeader.vue'; |
|
|
@ -30,7 +31,8 @@ defineEmits<{ |
|
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
const userStore = useUserStore(); |
|
|
const { getMyNotifilersApi } = useMyNotifilersApi(); |
|
|
const { getMyNotifilersApi } = useMyNotifilersApi(); |
|
|
const { getListApi: getFavoriteMenusApi } = useMyFavoriteMenusApi(); |
|
|
const { getListApi: getFavoriteMenusApi, deleteApi: deleteFavoriteMenuApi } = |
|
|
|
|
|
useMyFavoriteMenusApi(); |
|
|
const { deserialize } = useNotificationSerializer(); |
|
|
const { deserialize } = useNotificationSerializer(); |
|
|
const { uiFramework } = useAppConfig(import.meta.env, import.meta.env.PROD); |
|
|
const { uiFramework } = useAppConfig(import.meta.env, import.meta.env.PROD); |
|
|
|
|
|
|
|
|
@ -107,6 +109,13 @@ const getWelcomeTitle = computed(() => { |
|
|
} |
|
|
} |
|
|
return ''; |
|
|
return ''; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const [WorkbenchQuickNavModal, quickNavModalApi] = useVbenModal({ |
|
|
|
|
|
connectedComponent: defineAsyncComponent( |
|
|
|
|
|
() => import('./components/WorkbenchQuickNavModal.vue'), |
|
|
|
|
|
), |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
async function onInit() { |
|
|
async function onInit() { |
|
|
await Promise.all([ |
|
|
await Promise.all([ |
|
|
onInitFavoriteMenus(), |
|
|
onInitFavoriteMenus(), |
|
|
@ -119,6 +128,7 @@ async function onInitFavoriteMenus() { |
|
|
favoriteMenus.value = items.map((item) => { |
|
|
favoriteMenus.value = items.map((item) => { |
|
|
return { |
|
|
return { |
|
|
...item, |
|
|
...item, |
|
|
|
|
|
id: item.menuId, |
|
|
isDefault: false, |
|
|
isDefault: false, |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
@ -144,6 +154,16 @@ async function onInitTodoList() { |
|
|
todoList.value = []; |
|
|
todoList.value = []; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function onCreatingFavoriteMenu() { |
|
|
|
|
|
quickNavModalApi.open(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function onDeleteFavoriteMenu(menu: FavoriteMenu) { |
|
|
|
|
|
await deleteFavoriteMenuApi(menu.id); |
|
|
|
|
|
await onInitFavoriteMenus(); |
|
|
|
|
|
message.success($t('AbpUi.SuccessfullyDeleted')); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
onMounted(onInit); |
|
|
onMounted(onInit); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
@ -166,6 +186,8 @@ onMounted(onInit); |
|
|
:items="getFavoriteMenus" |
|
|
:items="getFavoriteMenus" |
|
|
class="mt-5 lg:mt-0" |
|
|
class="mt-5 lg:mt-0" |
|
|
:title="$t('workbench.content.favoriteMenu.title')" |
|
|
:title="$t('workbench.content.favoriteMenu.title')" |
|
|
|
|
|
@add="onCreatingFavoriteMenu" |
|
|
|
|
|
@delete="onDeleteFavoriteMenu" |
|
|
@click="(menu: FavoriteMenu) => $emit('navTo', menu)" |
|
|
@click="(menu: FavoriteMenu) => $emit('navTo', menu)" |
|
|
/> |
|
|
/> |
|
|
<WorkbenchTodo |
|
|
<WorkbenchTodo |
|
|
@ -189,6 +211,7 @@ onMounted(onInit); |
|
|
</WorkbenchTrends> |
|
|
</WorkbenchTrends> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<WorkbenchQuickNavModal @change="onInitFavoriteMenus" /> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
|