style: format code for all

This commit is contained in:
LZHD
2021-07-06 01:01:42 +08:00
committed by 踏学吾痕
parent e1200f2dbe
commit 77a1a47110
114 changed files with 7068 additions and 1068 deletions

View File

@@ -4,10 +4,10 @@ import { store } from "/@/store";
interface AppState {
sidebar: {
opened: Boolean;
withoutAnimation: Boolean;
opened: boolean;
withoutAnimation: boolean;
};
device: String;
device: string;
}
export const useAppStore = defineStore({
@@ -17,9 +17,9 @@ export const useAppStore = defineStore({
opened: storageLocal.getItem("sidebarStatus")
? !!+storageLocal.getItem("sidebarStatus")
: true,
withoutAnimation: false,
withoutAnimation: false
},
device: "desktop",
device: "desktop"
}),
getters: {
getSidebarStatus() {
@@ -27,7 +27,7 @@ export const useAppStore = defineStore({
},
getDevice() {
return this.device;
},
}
},
actions: {
TOGGLE_SIDEBAR() {
@@ -39,12 +39,12 @@ export const useAppStore = defineStore({
storageLocal.setItem("sidebarStatus", 0);
}
},
CLOSE_SIDEBAR(withoutAnimation: Boolean) {
CLOSE_SIDEBAR(withoutAnimation: boolean) {
storageLocal.setItem("sidebarStatus", 0);
this.sidebar.opened = false;
this.sidebar.withoutAnimation = withoutAnimation;
},
TOGGLE_DEVICE(device: String) {
TOGGLE_DEVICE(device: string) {
this.device = device;
},
async toggleSideBar() {
@@ -55,8 +55,8 @@ export const useAppStore = defineStore({
},
toggleDevice(device) {
this.TOGGLE_DEVICE(device);
},
},
}
}
});
export function useAppStoreHook() {

View File

@@ -8,13 +8,13 @@ export const usePermissionStore = defineStore({
state: () => ({
constantRoutes: constantRoutesArr, //静态路由
wholeRoutes: [],
buttonAuth: [],
buttonAuth: []
}),
actions: {
asyncActionRoutes(routes) {
if (this.wholeRoutes.length > 0) return;
this.wholeRoutes = ascending(this.constantRoutes.concat(routes)).filter(
(v) => v.meta.showLink
v => v.meta.showLink
);
const getButtonAuth = (arrRoutes: Array<string>) => {
@@ -33,8 +33,8 @@ export const usePermissionStore = defineStore({
},
async changeSetting(routes) {
await this.asyncActionRoutes(routes);
},
},
}
}
});
export function usePermissionStoreHook() {

View File

@@ -3,15 +3,15 @@ import { defineStore } from "pinia";
import { store } from "/@/store";
interface SettingState {
title: String;
fixedHeader: Boolean;
title: string;
fixedHeader: boolean;
}
export const useSettingStore = defineStore({
id: "pure-setting",
state: (): SettingState => ({
title: defaultSettings.title,
fixedHeader: defaultSettings.fixedHeader,
fixedHeader: defaultSettings.fixedHeader
}),
getters: {
getTitle() {
@@ -19,18 +19,19 @@ export const useSettingStore = defineStore({
},
getFixedHeader() {
return this.fixedHeader;
},
}
},
actions: {
CHANGE_SETTING({ key, value }) {
// eslint-disable-next-line no-prototype-builtins
if (this.hasOwnProperty(key)) {
this[key] = value;
}
},
changeSetting(data) {
this.CHANGE_SETTING(data);
},
},
}
}
});
export function useSettingStoreHook() {