Skip to content

Commit 365f69b

Browse files
committed
chore: manually format code
1 parent ae02573 commit 365f69b

30 files changed

Lines changed: 113 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 全局 ts 类型检查(此操作会增加 git commit 时长)
22
npx vue-tsc
3+
34
# 执行 lint-staged 中配置的任务
45
npx lint-staged

src/App.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ import { useTheme } from "@@/composables/useTheme"
55
import zhCn from "element-plus/es/locale/lang/zh-cn" // Element Plus 中文包
66
77
const { initTheme } = useTheme()
8+
89
const { initGreyAndColorWeakness } = useGreyAndColorWeakness()
10+
911
const { initStarNotification, initStoreNotification, initMobileNotification } = usePany()
1012
1113
// 初始化主题
1214
initTheme()
15+
1316
// 初始化灰色模式和色弱模式
1417
initGreyAndColorWeakness()
15-
// 初始化通知
18+
19+
// #region 初始化通知
1620
initStarNotification()
21+
1722
initStoreNotification()
23+
1824
initMobileNotification()
25+
// #endregion
1926
</script>
2027

2128
<template>

src/common/components/Screenfull/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ const classList = document.body.classList
2222
2323
// #region 全屏
2424
const isEnabled = screenfull.isEnabled
25+
2526
const isFullscreen = ref<boolean>(false)
27+
2628
const fullscreenTips = computed(() => (isFullscreen.value ? exitTips : openTips))
29+
2730
const fullscreenSvgName = computed(() => (isFullscreen.value ? "fullscreen-exit" : "fullscreen"))
2831
2932
function handleFullscreenClick() {
@@ -51,7 +54,9 @@ watchEffect(() => {
5154
5255
// #region 内容区
5356
const isContentLarge = ref<boolean>(false)
57+
5458
const contentLargeTips = computed(() => (isContentLarge.value ? "内容区复原" : "内容区放大"))
59+
5560
const contentLargeSvgName = computed(() => (isContentLarge.value ? "fullscreen-exit" : "fullscreen"))
5661
5762
function handleContentLargeClick() {

src/common/components/SearchMenu/Modal.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,27 @@ import Result from "./Result.vue"
1111
const modelValue = defineModel<boolean>({ required: true })
1212
1313
const router = useRouter()
14+
1415
const { isMobile } = useDevice()
1516
1617
const inputRef = useTemplateRef("inputRef")
18+
1719
const scrollbarRef = useTemplateRef("scrollbarRef")
20+
1821
const resultRef = useTemplateRef("resultRef")
1922
2023
const keyword = ref<string>("")
24+
2125
const result = shallowRef<RouteRecordRaw[]>([])
26+
2227
const activeRouteName = ref<RouteRecordNameGeneric | undefined>(undefined)
28+
2329
/** 是否按下了上键或下键(用于解决和 mouseenter 事件的冲突) */
2430
const isPressUpOrDown = ref<boolean>(false)
2531
2632
/** 控制搜索对话框宽度 */
2733
const modalWidth = computed(() => (isMobile.value ? "80vw" : "40vw"))
34+
2835
/** 树形菜单 */
2936
const menus = computed(() => cloneDeep(usePermissionStore().routes))
3037

src/common/composables/useDevice.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useAppStore } from "@/pinia/stores/app"
44
const appStore = useAppStore()
55

66
const isMobile = computed(() => appStore.device === DeviceEnum.Mobile)
7+
78
const isDesktop = computed(() => appStore.device === DeviceEnum.Desktop)
89

910
/** 设备类型 Composable */

src/common/composables/useFetchSelect.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export function useFetchSelect(props: FetchSelectProps) {
2020
const { api } = props
2121

2222
const loading = ref<boolean>(false)
23+
2324
const options = ref<SelectOption[]>([])
25+
2426
const value = ref<OptionValue>("")
2527

2628
// 调用接口获取数据

src/common/composables/useGreyAndColorWeakness.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useSettingsStore } from "@/pinia/stores/settings"
22

33
const GREY_MODE = "grey-mode"
4+
45
const COLOR_WEAKNESS = "color-weakness"
56

67
const classList = document.documentElement.classList

src/common/composables/useLayoutMode.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { useSettingsStore } from "@/pinia/stores/settings"
44
const settingsStore = useSettingsStore()
55

66
const isLeft = computed(() => settingsStore.layoutMode === LayoutModeEnum.Left)
7+
78
const isTop = computed(() => settingsStore.layoutMode === LayoutModeEnum.Top)
9+
810
const isLeftTop = computed(() => settingsStore.layoutMode === LayoutModeEnum.LeftTop)
911

1012
function setLayoutMode(mode: LayoutModeEnum) {

src/common/composables/usePagination.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ const DEFAULT_PAGINATION_DATA = {
1919
export function usePagination(initPaginationData: PaginationData = {}) {
2020
// 合并分页参数
2121
const paginationData = reactive({ ...DEFAULT_PAGINATION_DATA, ...initPaginationData })
22+
2223
// 改变当前页码
2324
const handleCurrentChange = (value: number) => {
2425
paginationData.currentPage = value
2526
}
27+
2628
// 改变每页显示条数
2729
const handleSizeChange = (value: number) => {
2830
paginationData.pageSize = value

src/common/composables/useWatermark.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ const bodyEl = ref<HTMLElement>(document.body)
4040
export function useWatermark(parentEl: Ref<HTMLElement | null> = bodyEl) {
4141
// 备份文本
4242
let backupText: string
43+
4344
// 最终配置
4445
let mergeConfig: DefaultConfig
46+
4547
// 水印元素
4648
let watermarkEl: HTMLElement | null = null
49+
4750
// 观察器
4851
const observer: Observer = {
4952
watermarkElMutationObserver: undefined,

0 commit comments

Comments
 (0)