From 85c82a1902f7082bbe3384953f0bd5aecddafa65 Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Fri, 16 Sep 2022 13:06:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=85=8D=E5=90=88`?= =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=B2=98=E8=B4=B4`=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E7=9A=84`=E5=BF=AB=E5=AD=98`=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E6=94=AF=E6=8C=81=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cpns/ClipFullData.vue | 9 +++++++-- src/cpns/ClipOperate.vue | 23 +++++++++++++++++------ src/style/cpns/clip-full-data.less | 3 +++ src/views/Main.vue | 5 +---- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/cpns/ClipFullData.vue b/src/cpns/ClipFullData.vue index f8d8c9c..74724b2 100644 --- a/src/cpns/ClipFullData.vue +++ b/src/cpns/ClipFullData.vue @@ -13,8 +13,13 @@ -
- +
+
+ +
+
+
+
diff --git a/src/cpns/ClipOperate.vue b/src/cpns/ClipOperate.vue index c7f5e68..657c279 100644 --- a/src/cpns/ClipOperate.vue +++ b/src/cpns/ClipOperate.vue @@ -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 diff --git a/src/style/cpns/clip-full-data.less b/src/style/cpns/clip-full-data.less index 2adc4b1..bb09ead 100644 --- a/src/style/cpns/clip-full-data.less +++ b/src/style/cpns/clip-full-data.less @@ -31,6 +31,9 @@ padding: 20px; border-radius: 5px; background-color: @text-bg-color; + img { + max-width: 100%; + } } &::-webkit-scrollbar { width: 10px; diff --git a/src/views/Main.vue b/src/views/Main.vue index 4097a08..52f5894 100644 --- a/src/views/Main.vue +++ b/src/views/Main.vue @@ -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 }