mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-02 20:50:02 +08:00
🔨 Refactor: refactored the import section of the code
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'],
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ComponentOptions } from 'vue'
|
||||
|
||||
export const dragMixin: ComponentOptions = {
|
||||
mounted () {
|
||||
this.disableDragEvent()
|
||||
|
||||
Reference in New Issue
Block a user