修改输出结果相关函数及界面

This commit is contained in:
fofolee 2024-12-28 19:44:28 +08:00
parent 920301c794
commit 99cadf3130
3 changed files with 15 additions and 15 deletions

View File

@ -13,11 +13,11 @@
<div> <div>
<q-avatar :size="`${headerHeight}`"> <q-avatar :size="`${headerHeight}`">
<q-icon :class="runResultStatus ? 'text-green' : 'text-red'" <q-icon :class="runResultStatus ? 'text-green' : 'text-red'"
:name="runResultStatus ? 'task_alt' : 'error'"></q-icon> :name="runResultStatus ? 'task_alt' : 'error'" size="sm"></q-icon>
</q-avatar> </q-avatar>
<span class="text-weight-bold text-h6">运行结果</span> <span class="text-weight-bold text-h7">运行结果</span>
</div> </div>
<ResultMenu class="no-shadow" :stretch="true" :content="runResult.join('')" :closebtn="!fromUtools" <ResultMenu class="no-shadow q-pa-sm" :stretch="true" :content="runResult.join('')" :closebtn="!fromUtools"
:textbtn="!enableHtml" :imagebtn="!enableHtml && isDataUrl" @showImg="showBase64Img" :style="{ :textbtn="!enableHtml" :imagebtn="!enableHtml && isDataUrl" @showImg="showBase64Img" :style="{
height: headerHeight + 'px', height: headerHeight + 'px',
}" /> }" />

View File

@ -1,16 +1,17 @@
<template> <template>
<q-btn-group :stretch="stretch" class="text-primary"> <q-btn-group :stretch="stretch" class="text-primary">
<q-btn icon="image" @click="dataUrlToImg" v-show="imagebtn" :dense="dense" <q-btn icon="image" @click="dataUrlToImg" v-show="imagebtn" dense size="sm"
><q-tooltip v-if="!dense"> DataUrl 转为图片</q-tooltip></q-btn ><q-tooltip v-if="!dense"> DataUrl 转为图片</q-tooltip></q-btn
> >
<q-btn <q-btn
icon="content_paste" icon="content_paste"
@click="copyResult" @click="copyResult"
v-show="textbtn" v-show="textbtn"
:dense="dense" dense
size="sm"
><q-tooltip v-if="!dense">复制到剪贴板</q-tooltip></q-btn ><q-tooltip v-if="!dense">复制到剪贴板</q-tooltip></q-btn
> >
<q-btn icon="send" @click="sendResult" v-show="textbtn" :dense="dense" <q-btn icon="send" size="sm" @click="sendResult" v-show="textbtn" dense
><q-tooltip v-if="!dense">发送到活动窗口</q-tooltip></q-btn ><q-tooltip v-if="!dense">发送到活动窗口</q-tooltip></q-btn
> >
<q-btn <q-btn
@ -18,7 +19,8 @@
class="text-negative" class="text-negative"
v-close-popup v-close-popup
v-show="closebtn" v-show="closebtn"
:dense="dense" dense
size="sm"
/> />
</q-btn-group> </q-btn-group>
</template> </template>
@ -35,13 +37,11 @@ export default {
}, },
methods: { methods: {
copyResult() { copyResult() {
utools.copyText(this.content); window.utools.copyText(this.content);
quickcommand.showMessageBox("已复制到剪贴板"); quickcommand.showMessageBox("已复制到剪贴板");
}, },
sendResult() { sendResult() {
utools.copyText(this.content); window.utools.hideMainWindowTypeString(this.content);
utools.hideMainWindow();
quickcommand.simulatePaste();
}, },
dataUrlToImg() { dataUrlToImg() {
let imgs = this.content let imgs = this.content

View File

@ -41,22 +41,22 @@ const outputTypes = {
label: "复制到剪贴板", label: "复制到剪贴板",
icon: "content_paste", icon: "content_paste",
outPlugin: true, outPlugin: true,
action: result => window.copyTo(result) action: result => window.utools.copyText(result)
}, },
send: { send: {
name: "send", name: "send",
label: "发送到活动窗口", label: "发送到活动窗口",
icon: "web_asset", icon: "web_asset",
outPlugin: true, outPlugin: true,
action: result => window.send(result) action: result => window.utools.hideMainWindowTypeString(result)
}, },
notice: { notice: {
name: "notice", name: "notice",
label: "发送系统通知", label: "发送系统通知",
icon: "sms", icon: "sms",
outPlugin: true, outPlugin: true,
action: result => window.message(result) action: result => window.utools.showNotification(result)
}, },
}; };
export default outputTypes export default outputTypes