🔨 Refactor: refactored the import section of the code

This commit is contained in:
萌萌哒赫萝
2023-08-07 01:36:27 -07:00
parent 33b36d63c6
commit cb131d5250
64 changed files with 778 additions and 195 deletions

View File

@@ -1,7 +1,16 @@
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
// 事件常量
import { PICGO_SAVE_CONFIG, PICGO_GET_CONFIG, RPC_ACTIONS } from '#/events/constants'
// UUID
import { v4 as uuid } from 'uuid'
// 枚举类型声明
import { IRPCActionType } from '~/universal/types/enum'
// 公共工具函数
import { getRawData } from './common'
export function saveConfig (config: IObj | string, value?: any) {

View File

@@ -1,6 +1,13 @@
// Picgo Store 相关类型
import { IObject, IResult, IGetResult, IFilter } from '@picgo/store/dist/types'
// Electron 相关
import { ipcRenderer, IpcRendererEvent } from 'electron'
// UUID
import { v4 as uuid } from 'uuid'
// 数据库操作常量
import {
PICGO_GET_DB,
PICGO_INSERT_DB,
@@ -9,8 +16,13 @@ import {
PICGO_GET_BY_ID_DB,
PICGO_REMOVE_BY_ID_DB
} from '#/events/constants'
// 数据库类型声明
import { IGalleryDB } from '#/types/extra-vue'
// 公共工具函数
import { getRawData } from './common'
export class GalleryDB implements IGalleryDB {
async get<T> (filter?: IFilter): Promise<IGetResult<T>> {
const res = await this.msgHandler<IGetResult<T>>(PICGO_GET_DB, filter)

View File

@@ -1,7 +1,15 @@
// Vue 组件选项
import { ComponentOptions } from 'vue'
// 事件常量
import { FORCE_UPDATE, GET_PICBEDS } from '~/universal/events/constants'
// 事件总线
import bus from '~/renderer/utils/bus'
// Electron 相关
import { ipcRenderer } from 'electron'
export const mainMixin: ComponentOptions = {
inject: ['forceUpdateTime'],

View File

@@ -1,4 +1,5 @@
import { ComponentOptions } from 'vue'
export const dragMixin: ComponentOptions = {
mounted () {
this.disableDragEvent()