completed create all filters type

This commit is contained in:
kur0nek-o
2023-11-02 17:00:17 +07:00
parent 4635106e5d
commit c9e200c174
30 changed files with 770 additions and 119 deletions

24
src/stores/filters.ts Normal file
View File

@ -0,0 +1,24 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { dispatchNotification } from '@/components/Notification'
import { readData, removeData, writeData } from '@/utils/storage'
import router from '@/router'
export const useFiltersStore = defineStore('filters', () => {
const config = ref({
reportButton: false,
type: 'type-1'
})
const setConfig = (test: {reportButton: boolean, type: string}) => {
config.value = {
reportButton: test.reportButton,
type: test.type
}
}
return {
config,
setConfig
}
})

View File

@ -6,8 +6,10 @@ import { routes } from '@/router'
import type { MenuItemModel } from '@/types/menu'
import { splitRoutePath } from '@/utils/texts'
import { useCommandPalattesStore } from '@/stores/command'
import { useFiltersStore } from './filters'
export const useMenuStore = defineStore('menu', () => {
const filters = useFiltersStore()
const route = useRoute()
const navigation = ref<MenuItemModel[]>([])
const sidebarOpen = ref(false)
@ -56,11 +58,16 @@ export const useMenuStore = defineStore('menu', () => {
}
} else {
collapseAllMenu()
filters.setConfig({
type: '',
reportButton: false
})
}
})
const expandCurrentActiveMenu = (): void => {
const menuData = convertRouteToMenu(routes.at(0)?.children || [])
const menuData = convertRouteToMenu(routes[0]?.children || [])
navigation.value = menuData
menuSelected.value = router.currentRoute.value.fullPath