feat: 集成超级分词跳转功能

This commit is contained in:
ZiuChen 2022-09-12 12:50:56 +08:00
parent 09468449fe
commit 7e71c7845c
2 changed files with 12 additions and 3 deletions

View File

@ -37,11 +37,16 @@
<template v-for="{ id, title, icon } of operation">
<div
v-if="
(id !== 'collect' && id !== 'view' && id !== 'open-folder' && id !== 'un-collect') ||
(id !== 'collect' &&
id !== 'view' &&
id !== 'open-folder' &&
id !== 'un-collect' &&
id !== 'word-break') ||
(id === 'collect' && item.collect !== true) ||
(id === 'view' && item.type !== 'image') ||
(id === 'open-folder' && item.type === 'file') ||
(id === 'un-collect' && item.collect === true)
(id === 'un-collect' && item.collect === true) ||
(id === 'word-break' && item.type === 'text' && item.data.length <= 500)
"
:class="id"
:title="title"
@ -177,6 +182,7 @@ const operation = [
{ id: 'view', title: '查看全部', icon: '💬' },
{ id: 'open-folder', title: '打开文件夹', icon: '📁' },
{ id: 'collect', title: '收藏', icon: '⭐' },
{ id: 'word-break', title: '分词', icon: '💣' },
{ id: 'un-collect', title: '取消收藏', icon: '📤' },
{ id: 'remove', title: '删除', icon: '❌' }
]
@ -197,6 +203,9 @@ const handleOperateClick = ({ id, item }) => {
item.collect = true
window.db.updateDataBaseLocal(db)
break
case 'word-break':
utools.redirect('超级分词', item.data)
break
case 'un-collect':
item.collect = undefined
window.db.updateDataBaseLocal(db)

View File

@ -55,7 +55,7 @@
overflow: hidden;
word-break: break-all;
max-height: 120px;
max-width: 500px;
max-width: 490px;
padding: 5px;
white-space: pre-wrap;
flex-direction: column;