Kaynağa Gözat

删除store文件夹

lighter 1 yıl önce
ebeveyn
işleme
aab5ceda85

+ 0 - 18
src/store/modules/charts.js

@@ -1,18 +0,0 @@
-const state = () => ({
-  echartsZhuTi: 'customed',
-})
-// mutations
-const mutations = {
-  setEchartsZhuTi(state, echartsZhuTi) {
-    state.echartsZhuTi = echartsZhuTi
-  },
-}
-
-const actions = {}
-
-export default {
-  namespaced: true,
-  state,
-  actions,
-  mutations,
-}

+ 0 - 37
src/store/modules/keepAlive.js

@@ -1,37 +0,0 @@
-const state = () => ({
-  keepAliveComponentsName: [], // 需要缓存的组件名称
-})
-
-// mutations
-const mutations = {
-  // 重置,Push, splice keep-alive对象
-  setKeepAliveComponentsName(state, nameArr) {
-    state.keepAliveComponentsName = nameArr
-  },
-  addKeepAliveComponentsName(state, name) {
-    state.keepAliveComponentsName.push(name)
-  },
-  delKeepAliveComponentsName(state, name) {
-    const key = state.keepAliveComponentsName.indexOf(name)
-    if (key !== -1) {
-      state.keepAliveComponentsName.splice(key, 1)
-    }
-  },
-}
-
-const getters = {
-  keepAliveComponentsName(state) {
-    return state.keepAliveComponentsName
-  },
-}
-
-// actions
-const actions = {}
-
-export default {
-  namespaced: true,
-  state,
-  getters,
-  actions,
-  mutations,
-}

+ 0 - 62
src/store/noLocalStorage.ts

@@ -1,62 +0,0 @@
-// @ts-ignore
-import {fetchMenusApi} from "@/api/login";
-import {Ref, ref} from "vue";
-import {isDev} from "@/utils/public";
-
-declare type RoutesType = {
-    id: number;
-    path: string;
-    completeRoute: string;
-    metaTitle: string;
-    metaIcon: string | null;
-    parent: number;
-    hideTabs: null;
-    hideMenu: null;
-    redirect: null;
-    meta: {
-        icon: string | null;
-        title: string;
-    };
-    children: RoutesType[] | null;
-}
-
-declare type MenusData = {
-    flatRoutes: {
-        id: null | string;
-        path: null | string;
-        completeRoute: string;
-        metaTitle: string;
-        metaIcon: null | string;
-        parent: null | string;
-        hideTabs: null | string;
-        hideMenu: null | string;
-        redirect: null | string;
-        meta: null | string;
-        children: null | string;
-    }[],
-    paths: string[],
-    routes: RoutesType[]
-}
-
-export const menusData: Ref<MenusData> = ref({
-    routes: [],
-    flatRoutes: [],
-    paths: [],
-})
-
-let once = false
-
-export const initStoreData = async () => {
-    if (once) {
-        return
-    }
-    await fetchMenusApi().then((res: MenusData) => {
-        isDev && console.log(res)
-        menusData.value = res
-    }).catch(() => {
-
-    }).finally(() => {
-        once = true
-    })
-    return once
-}

+ 0 - 40
src/store/plugins/persistent.js

@@ -1,40 +0,0 @@
-export default function Persistent({key, modules, modulesKeys}) {
-    return (theStore) => {
-        if (localStorage) {
-            const localOldState = JSON.parse(localStorage[key] || '{}');
-            const sessionOldState = JSON.parse(sessionStorage[key] || '{}');
-            let oldState = {};
-            Object.assign(oldState, localOldState, sessionOldState);
-            if (Object.keys(oldState).length > 0) {
-                for (const oldKey in oldState) {
-                    modules[oldKey] = oldState[oldKey]
-                }
-                theStore.replaceState(modules)
-            }
-            theStore.subscribe((mutation, state) => {
-                // 判断是否需要缓存数据至localStorage
-                if (modulesKeys.local.length > 0) {
-                    const localData = setData(theStore.state, modulesKeys.local)
-                    localStorage.setItem(key, JSON.stringify(localData))
-                } else {
-                    localStorage.removeItem(key)
-                }
-                // 判断是否需要缓存数据至sessionStorage
-                if (modulesKeys.session.length > 0) {
-                    const sessionData = setData(theStore.state, modulesKeys.session)
-                    sessionStorage.setItem(key, JSON.stringify(sessionData))
-                } else {
-                    sessionStorage.removeItem(key)
-                }
-            });
-        }
-    }
-}
-
-function setData(state, module) {
-    let data = {}
-    for (const i of module) {
-        data[i] = state[i]
-    }
-    return data
-}