A:菜单栏增加“相似照片”,功能暂未实现
This commit is contained in:
1 parent
bc0053e051
commit
94ed0d5acb
4 files changed
+20
-35
No files matched your search
@@ -83,7 +83,7 @@ import {
|
|||||||
CalendarOutline,
|
CalendarOutline,
|
||||||
PricetagOutline,
|
PricetagOutline,
|
||||||
LibraryOutline,
|
LibraryOutline,
|
||||||
SettingsOutline,
|
SettingsOutline, EyeOffOutline
|
||||||
} from '@vicons/ionicons5'
|
} from '@vicons/ionicons5'
|
||||||
import { menuOptions, type MenuOption, type MenuItem, type MenuGroup } from '@/types/menu'
|
import { menuOptions, type MenuOption, type MenuItem, type MenuGroup } from '@/types/menu'
|
||||||
|
|
||||||
@@ -101,6 +101,7 @@ const iconMap = {
|
|||||||
'pricetag-outline': PricetagOutline,
|
'pricetag-outline': PricetagOutline,
|
||||||
'library-outline': LibraryOutline,
|
'library-outline': LibraryOutline,
|
||||||
'settings-outline': SettingsOutline,
|
'settings-outline': SettingsOutline,
|
||||||
|
'eye-off-outline': EyeOffOutline,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 渲染图标
|
// 渲染图标
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ export const menuOptions: MenuOption[] = [
|
|||||||
icon: 'pricetag-outline',
|
icon: 'pricetag-outline',
|
||||||
path: '/tags',
|
path: '/tags',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'similar',
|
||||||
|
label: '相似照片',
|
||||||
|
icon: 'eye-off-outline',
|
||||||
|
path: '/similar',
|
||||||
|
},
|
||||||
|
|
||||||
// 管理分组
|
// 管理分组
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,45 +23,23 @@ const libraryPaths = ref<LibraryPath[]>([
|
|||||||
])
|
])
|
||||||
|
|
||||||
// 选择文件夹
|
// 选择文件夹
|
||||||
// const selectFolder = async () => {
|
|
||||||
// // 这里应该调用 Electron 或其他桌面框架的文件选择 API
|
|
||||||
// // 示例代码,实际需要根据你的环境调整
|
|
||||||
// try {
|
|
||||||
// // const result = await window.electronAPI.selectFolder()
|
|
||||||
// // if (result) {
|
|
||||||
// // inputPath.value = result
|
|
||||||
// // }
|
|
||||||
//
|
|
||||||
// // 临时模拟
|
|
||||||
// inputPath.value = 'C:\\Users\\Documents\\示例路径'
|
|
||||||
// message.info('请在实际环境中实现文件夹选择功能')
|
|
||||||
// } catch (error) {
|
|
||||||
// message.error('选择文件夹失败')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// 选择文件夹(使用浏览器 File System Access API)
|
|
||||||
const selectFolder = async () => {
|
const selectFolder = async () => {
|
||||||
|
// 这里应该调用 Electron 或其他桌面框架的文件选择 API
|
||||||
|
// 示例代码,实际需要根据你的环境调整
|
||||||
try {
|
try {
|
||||||
// 检查浏览器是否支持
|
// const result = await window.electronAPI.selectFolder()
|
||||||
if (!('showDirectoryPicker' in window)) {
|
// if (result) {
|
||||||
message.warning('您的浏览器不支持文件夹选择功能,请手动输入路径')
|
// inputPath.value = result
|
||||||
return
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// 临时模拟
|
||||||
//@ts-expect-error
|
// inputPath.value = 'C:\\Users\\Documents\\示例路径'
|
||||||
const dirHandle = await window.showDirectoryPicker()
|
message.error('该功能暂不可用!')
|
||||||
// 获取文件夹名称作为路径(实际项目中可能需要完整路径)
|
} catch (error) {
|
||||||
inputPath.value = dirHandle.name
|
message.error('选择文件夹失败')
|
||||||
} catch (err) {
|
|
||||||
// 用户取消选择
|
|
||||||
console.log('用户取消选择文件夹')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 添加路径
|
// 添加路径
|
||||||
const addPath = async () => {
|
const addPath = async () => {
|
||||||
if (!inputPath.value.trim()) {
|
if (!inputPath.value.trim()) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<h1>照片!!!!!11</h1>
|
<h1>11</h1>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts"></script>
|
<script setup lang="ts"></script>
|
||||||
|
|||||||
Reference in new issue
Block a user