mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-05 07:28:42 +08:00
🔨 Refactor(custom): remove unused file
This commit is contained in:
@@ -51,4 +51,5 @@ app.use(pinia)
|
|||||||
app.use(hljsVuePlugin)
|
app.use(hljsVuePlugin)
|
||||||
app.use(VueVideoPlayer)
|
app.use(VueVideoPlayer)
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
||||||
initTalkingData()
|
initTalkingData()
|
||||||
|
|||||||
@@ -384,13 +384,13 @@ const fileSortExtReverse = ref(false)
|
|||||||
const isShowBatchRenameDialog = ref(false)
|
const isShowBatchRenameDialog = ref(false)
|
||||||
const batchRenameMatch = ref('')
|
const batchRenameMatch = ref('')
|
||||||
const batchRenameReplace = ref('')
|
const batchRenameReplace = ref('')
|
||||||
const mathcedCount = computed(() => {
|
|
||||||
const matchedFiles = filterList.value.filter((item: any) => {
|
|
||||||
return customStrMatch(item.imgUrl, batchRenameMatch.value)
|
|
||||||
})
|
|
||||||
return matchedFiles.length
|
|
||||||
})
|
|
||||||
const dateRange = ref('')
|
const dateRange = ref('')
|
||||||
|
const mathcedCount = computed(() => {
|
||||||
|
return filterList.value.filter((item: any) => {
|
||||||
|
return customStrMatch(item.imgUrl, batchRenameMatch.value)
|
||||||
|
}).length
|
||||||
|
})
|
||||||
|
|
||||||
onBeforeRouteUpdate((to, from) => {
|
onBeforeRouteUpdate((to, from) => {
|
||||||
if (from.name === 'gallery') {
|
if (from.name === 'gallery') {
|
||||||
clearChoosedList()
|
clearChoosedList()
|
||||||
@@ -400,10 +400,8 @@ onBeforeRouteUpdate((to, from) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// init deleteCloud
|
|
||||||
async function initDeleteCloud() {
|
async function initDeleteCloud() {
|
||||||
const config = (await getConfig()) as any
|
deleteCloud.value = (await getConfig<boolean>(configPaths.settings.deleteCloudFile)) || false
|
||||||
deleteCloud.value = config.settings.deleteCloudFile || false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
@@ -420,28 +418,16 @@ onBeforeMount(async () => {
|
|||||||
|
|
||||||
function handleDetectShiftKey(event: KeyboardEvent) {
|
function handleDetectShiftKey(event: KeyboardEvent) {
|
||||||
if (event.key === 'Shift') {
|
if (event.key === 'Shift') {
|
||||||
if (event.type === 'keydown') {
|
isShiftKeyPress.value = event.type === 'keydown'
|
||||||
isShiftKeyPress.value = true
|
|
||||||
} else if (event.type === 'keyup') {
|
|
||||||
isShiftKeyPress.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterList = computed(() => {
|
const filterList = computed(() => {
|
||||||
return getGallery()
|
return getGallery()
|
||||||
})
|
})
|
||||||
console.log(filterList)
|
|
||||||
|
|
||||||
const isAllSelected = computed(() => {
|
const isAllSelected = computed(() => {
|
||||||
const values = Object.values(choosedList)
|
return Object.values(choosedList).length > 0 && filterList.value.every(item => choosedList[item.id!])
|
||||||
if (values.length === 0) {
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
return filterList.value.every(item => {
|
|
||||||
return choosedList[item.id!]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function formatFileName(name: string) {
|
function formatFileName(name: string) {
|
||||||
@@ -558,8 +544,6 @@ async function copy(item: ImgInfo) {
|
|||||||
const obj = {
|
const obj = {
|
||||||
title: $T('COPY_LINK_SUCCEED'),
|
title: $T('COPY_LINK_SUCCEED'),
|
||||||
body: copyLink
|
body: copyLink
|
||||||
// sometimes will cause lagging
|
|
||||||
// icon: item.url || item.imgUrl
|
|
||||||
}
|
}
|
||||||
const myNotification = new Notification(obj.title, obj)
|
const myNotification = new Notification(obj.title, obj)
|
||||||
myNotification.onclick = () => {
|
myNotification.onclick = () => {
|
||||||
@@ -662,7 +646,6 @@ function toggleSelectAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function multiRemove() {
|
function multiRemove() {
|
||||||
// choosedList -> { [id]: true or false }; true means choosed. false means not choosed.
|
|
||||||
const multiRemoveNumber = Object.values(choosedList).filter(item => item).length
|
const multiRemoveNumber = Object.values(choosedList).filter(item => item).length
|
||||||
if (multiRemoveNumber) {
|
if (multiRemoveNumber) {
|
||||||
$confirm(
|
$confirm(
|
||||||
@@ -917,11 +900,13 @@ onActivated(async () => {
|
|||||||
initDeleteCloud()
|
initDeleteCloud()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'GalleryPage'
|
name: 'GalleryPage'
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus">
|
<style lang="stylus">
|
||||||
.PhotoSlider
|
.PhotoSlider
|
||||||
&__BannerIcon
|
&__BannerIcon
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ const latestVersionMap = reactive<{ [key: string]: string }>({})
|
|||||||
const pluginListToolTip = $T('PLUGIN_LIST')
|
const pluginListToolTip = $T('PLUGIN_LIST')
|
||||||
const importLocalPluginToolTip = $T('PLUGIN_IMPORT_LOCAL')
|
const importLocalPluginToolTip = $T('PLUGIN_IMPORT_LOCAL')
|
||||||
const updateAllToolTip = $T('PLUGIN_UPDATE_ALL')
|
const updateAllToolTip = $T('PLUGIN_UPDATE_ALL')
|
||||||
// const id = ref('')
|
|
||||||
const defaultLogo = ref(`this.src="file://${__static.replace(/\\/g, '/')}/roundLogo.png"`)
|
const defaultLogo = ref(`this.src="file://${__static.replace(/\\/g, '/')}/roundLogo.png"`)
|
||||||
const $configForm = ref<InstanceType<typeof ConfigForm> | null>(null)
|
const $configForm = ref<InstanceType<typeof ConfigForm> | null>(null)
|
||||||
const npmSearchText = computed(() => {
|
const npmSearchText = computed(() => {
|
||||||
|
|||||||
+10
-16
@@ -6,38 +6,32 @@ import { IRPCActionType } from '#/types/enum'
|
|||||||
import { IGalleryDB } from '#/types/extra-vue'
|
import { IGalleryDB } from '#/types/extra-vue'
|
||||||
|
|
||||||
export class GalleryDB implements IGalleryDB {
|
export class GalleryDB implements IGalleryDB {
|
||||||
|
async #actionHandler<T>(method: IRPCActionType, ...args: any[]): Promise<T | undefined> {
|
||||||
|
return await triggerRPC<T>(method, ...args)
|
||||||
|
}
|
||||||
|
|
||||||
async get<T>(filter?: IFilter): Promise<IGetResult<T> | undefined> {
|
async get<T>(filter?: IFilter): Promise<IGetResult<T> | undefined> {
|
||||||
const res = await this.#msgHandler<IGetResult<T>>(IRPCActionType.GALLERY_GET_DB, filter)
|
return await this.#actionHandler<IGetResult<T>>(IRPCActionType.GALLERY_GET_DB, filter)
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async insert<T>(value: T): Promise<IResult<T> | undefined> {
|
async insert<T>(value: T): Promise<IResult<T> | undefined> {
|
||||||
const res = await this.#msgHandler<IResult<T>>(IRPCActionType.GALLERY_INSERT_DB, value)
|
return await this.#actionHandler<IResult<T>>(IRPCActionType.GALLERY_INSERT_DB, value)
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async insertMany<T>(value: T[]): Promise<IResult<T>[] | undefined> {
|
async insertMany<T>(value: T[]): Promise<IResult<T>[] | undefined> {
|
||||||
const res = await this.#msgHandler<IResult<T>[]>(IRPCActionType.GALLERY_INSERT_DB_BATCH, value)
|
return await this.#actionHandler<IResult<T>[]>(IRPCActionType.GALLERY_INSERT_DB_BATCH, value)
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateById(id: string, value: IObject): Promise<boolean> {
|
async updateById(id: string, value: IObject): Promise<boolean> {
|
||||||
const res = (await this.#msgHandler<boolean>(IRPCActionType.GALLERY_UPDATE_BY_ID_DB, id, value)) || false
|
return (await this.#actionHandler<boolean>(IRPCActionType.GALLERY_UPDATE_BY_ID_DB, id, value)) || false
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getById<T>(id: string): Promise<IResult<T> | undefined> {
|
async getById<T>(id: string): Promise<IResult<T> | undefined> {
|
||||||
const res = await this.#msgHandler<IResult<T> | undefined>(IRPCActionType.GALLERY_GET_BY_ID_DB, id)
|
return await this.#actionHandler<IResult<T> | undefined>(IRPCActionType.GALLERY_GET_BY_ID_DB, id)
|
||||||
return res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeById(id: string): Promise<void> {
|
async removeById(id: string): Promise<void> {
|
||||||
const res = await this.#msgHandler<void>(IRPCActionType.GALLERY_REMOVE_BY_ID_DB, id)
|
return await this.#actionHandler<void>(IRPCActionType.GALLERY_REMOVE_BY_ID_DB, id)
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
async #msgHandler<T>(method: IRPCActionType, ...args: any[]): Promise<T | undefined> {
|
|
||||||
return await triggerRPC<T>(method, ...args)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
|
|
||||||
export const completeUploaderMetaConfig = (originData: IStringKeyMap): IStringKeyMap => {
|
|
||||||
return Object.assign(
|
|
||||||
{
|
|
||||||
_configName: 'Default'
|
|
||||||
},
|
|
||||||
originData,
|
|
||||||
{
|
|
||||||
_id: uuid(),
|
|
||||||
_createdAt: Date.now(),
|
|
||||||
_updatedAt: Date.now()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import yaml from 'js-yaml'
|
import yaml from 'js-yaml'
|
||||||
|
|
||||||
import { RELEASE_URL, RELEASE_URL_BACKUP } from '#/utils/static'
|
import { RELEASE_URL, RELEASE_URL_BACKUP } from '#/utils/static'
|
||||||
|
|
||||||
export const getLatestVersion = async (): Promise<string> => {
|
export const getLatestVersion = async (): Promise<string> => {
|
||||||
|
|||||||
Reference in New Issue
Block a user