mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-07 22:04:06 +08:00
feat: 添加配合超级粘贴
插件实现的快存
功能 支持图片预览
This commit is contained in:
parent
d2b64d890a
commit
85c82a1902
@ -13,8 +13,13 @@
|
||||
<template v-if="fullData.type === 'text'">
|
||||
<div class="clip-full-content" v-text="fullData.data"></div>
|
||||
</template>
|
||||
<div v-else-if="fullData.type === 'file'" class="clip-full-content">
|
||||
<FileList :data="JSON.parse(fullData.data)"></FileList>
|
||||
<div v-else-if="fullData.type === 'image'">
|
||||
<div class="clip-full-content">
|
||||
<img :src="fullData.data" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="fullData.type === 'file'">
|
||||
<FileList class="clip-full-content" :data="JSON.parse(fullData.data)"></FileList>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
|
@ -7,12 +7,15 @@
|
||||
id !== 'view' &&
|
||||
id !== 'open-folder' &&
|
||||
id !== 'un-collect' &&
|
||||
id !== 'word-break') ||
|
||||
id !== 'word-break' &&
|
||||
id !== 'save-file') ||
|
||||
(id === 'collect' && item.collect !== true) ||
|
||||
(id === 'view' && !isFullData && item.type !== 'image') ||
|
||||
(id === 'view' && !isFullData) ||
|
||||
(id === 'open-folder' && item.type === 'file') ||
|
||||
(id === 'un-collect' && item.collect === true) ||
|
||||
(id === 'save-file' && isFullData && item.type !== 'file') ||
|
||||
(id === 'word-break' &&
|
||||
isFullData &&
|
||||
item.type === 'text' &&
|
||||
item.data.length <= 500 &&
|
||||
item.data.length >= 2)
|
||||
@ -46,6 +49,7 @@ const operation = [
|
||||
{ id: 'collect', title: '收藏', icon: '⭐' },
|
||||
{ id: 'un-collect', title: '取消收藏', icon: '📤' },
|
||||
{ id: 'word-break', title: '分词', icon: '💣' },
|
||||
{ id: 'save-file', title: '保存', icon: '💾' },
|
||||
{ id: 'remove', title: '删除', icon: '❌' }
|
||||
]
|
||||
const handleOperateClick = ({ id, item }) => {
|
||||
@ -66,11 +70,18 @@ const handleOperateClick = ({ id, item }) => {
|
||||
window.db.updateDataBaseLocal(db)
|
||||
break
|
||||
case 'word-break':
|
||||
const success = utools.redirect('超级分词', item.data)
|
||||
if (success) {
|
||||
} else {
|
||||
utools.shellOpenExternal('https://ziuchen.github.io/project/SmartWordBreak/')
|
||||
utools.redirect('超级分词', item.data)
|
||||
break
|
||||
case 'save-file':
|
||||
const typeMap = {
|
||||
text: 'text',
|
||||
file: 'files',
|
||||
image: 'img'
|
||||
}
|
||||
utools.redirect('收集文件', {
|
||||
type: typeMap[item.type],
|
||||
data: item.data
|
||||
})
|
||||
break
|
||||
case 'un-collect':
|
||||
item.collect = undefined
|
||||
|
@ -31,6 +31,9 @@
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
background-color: @text-bg-color;
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
&::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
|
@ -183,10 +183,7 @@ const fullData = ref({ type: 'text', data: '' })
|
||||
const fullDataShow = ref(false)
|
||||
const toggleFullData = (item) => {
|
||||
// 是否显示全部数据 (查看全部)
|
||||
const { type } = item
|
||||
if (type === 'text' || type === 'file') {
|
||||
fullData.value = item
|
||||
}
|
||||
fullData.value = item
|
||||
fullDataShow.value = !fullDataShow.value
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user