feat: you can summary screen shot directly
This commit is contained in:
@@ -51,6 +51,10 @@ const emit = defineEmits<{
|
||||
e: 'save-remote',
|
||||
payload: { rect: Rect; annotations: Annotation[] }
|
||||
): void
|
||||
(
|
||||
e: 'summarize',
|
||||
payload: { rect: Rect; annotations: Annotation[] }
|
||||
): void
|
||||
(e: 'cancel'): void
|
||||
}>()
|
||||
|
||||
@@ -112,7 +116,7 @@ const sizeLabel = computed(() => {
|
||||
})
|
||||
|
||||
const MARK_TOOLBAR_W = 190
|
||||
const ACTION_TOOLBAR_W = 180
|
||||
const ACTION_TOOLBAR_W = 216
|
||||
const TOOLBAR_GROUP_GAP = 8
|
||||
|
||||
const rightToolbarPos = computed(() => {
|
||||
@@ -363,7 +367,11 @@ function onSaveRemote() {
|
||||
emitAction('save-remote')
|
||||
}
|
||||
|
||||
function emitAction(action: 'confirm' | 'copy' | 'save' | 'save-remote') {
|
||||
function onSummarize() {
|
||||
emitAction('summarize')
|
||||
}
|
||||
|
||||
function emitAction(action: 'confirm' | 'copy' | 'save' | 'save-remote' | 'summarize') {
|
||||
if (!rect.value) return
|
||||
const payload = {
|
||||
rect: { ...rect.value },
|
||||
@@ -373,6 +381,7 @@ function emitAction(action: 'confirm' | 'copy' | 'save' | 'save-remote') {
|
||||
if (action === 'copy') emit('copy', payload)
|
||||
if (action === 'save') emit('save', payload)
|
||||
if (action === 'save-remote') emit('save-remote', payload)
|
||||
if (action === 'summarize') emit('summarize', payload)
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
@@ -593,8 +602,8 @@ onUnmounted(() => {
|
||||
/>
|
||||
<button
|
||||
class="action-btn"
|
||||
data-tip="复制图标"
|
||||
aria-label="复制图标"
|
||||
data-tip="复制图片"
|
||||
aria-label="复制图片"
|
||||
@click="onCopy"
|
||||
v-html="copyIcon"
|
||||
/>
|
||||
@@ -612,6 +621,19 @@ onUnmounted(() => {
|
||||
@click="onSaveRemote"
|
||||
v-html="saveRemoteIcon"
|
||||
/>
|
||||
<button
|
||||
class="action-btn"
|
||||
data-tip="复制总结"
|
||||
aria-label="复制总结"
|
||||
@click="onSummarize"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path d="M6 3h8l4 4v14H6z" />
|
||||
<path d="M14 3v5h4" />
|
||||
<path d="M9 12h6" />
|
||||
<path d="M9 16h5" />
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="action-btn primary"
|
||||
data-tip="上传云端"
|
||||
@@ -706,7 +728,7 @@ onUnmounted(() => {
|
||||
width: 190px;
|
||||
}
|
||||
.action-toolbar {
|
||||
width: 180px;
|
||||
width: 216px;
|
||||
}
|
||||
|
||||
.icon-btn,
|
||||
@@ -762,6 +784,16 @@ onUnmounted(() => {
|
||||
fill: currentColor;
|
||||
pointer-events: none;
|
||||
}
|
||||
.action-btn > svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
pointer-events: none;
|
||||
}
|
||||
.action-btn::after {
|
||||
content: attr(data-tip);
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user