diff --git a/src/App.vue b/src/App.vue index dc19361..1e529e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -206,10 +206,10 @@ export default defineComponent({ border-radius: 10px; box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); background: rgba(194, 194, 194, 0.4); + border: rgba(194, 194, 194, 0.4); } -::-webkit-scrollbar-track { - border-radius: 10px; - box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); +::-webkit-scrollbar-track-piece { + background: rgba(194, 194, 194, 0.1); } diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index e88a421..ef33acf 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -1,47 +1,86 @@ @@ -91,7 +130,13 @@ export default { return ["edit", "new", "config"].includes(this.action.type); }, maxHeight() { - return this.fromUtools ? 600 : 300; + return this.fromUtools ? 600 : 400; + }, + headerHeight() { + return this.enableHtml && this.fromUtools ? 0 : 40; + }, + isDataUrl() { + return this.runResult.join("").includes("data:image/"); }, }, methods: { @@ -270,7 +315,10 @@ export default { // 根据输出自动滚动及调整 utools 高度 autoHeight(e) { if (!this.fromUtools) return; - let pluginHeight = e.height < this.maxHeight ? e.height : this.maxHeight; + let pluginHeight = + e.height + this.headerHeight < this.maxHeight + ? e.height + this.headerHeight + : this.maxHeight; utools.setExpendHeight(pluginHeight); }, autoScroll() { @@ -292,6 +340,7 @@ export default { document.removeEventListener("keydown", this.subInputListener, true); } this.clear(); + this.frameInitHeight = 0; }, clear() { !!this.ctrlCListener && @@ -315,6 +364,25 @@ export default { } return [html.documentElement.innerHTML]; }, + copyResult() { + utools.copyText(this.runResult.join("\n")); + quickcommand.showMessageBox("已复制到剪贴板"); + }, + sendResult() { + utools.copyText(this.runResult.join("\n")); + utools.hideMainWindow(); + quickcommand.simulatePaste(); + }, + dataUrlToImg() { + let imgs = this.runResult + .join("\n") + .match(/data:image\/.*?;base64,.*/g) + ?.map((dataUrl) => `
`); + if (!imgs) return quickcommand.showMessageBox("dataUrl 格式不正确!"); + this.runResult = []; + this.enableHtml = true; + this.showRunResult(imgs, true); + }, }, unmounted() { this.stopRun(); diff --git a/src/components/ResultArea.vue b/src/components/ResultArea.vue index 73e9eb3..f4b25e3 100644 --- a/src/components/ResultArea.vue +++ b/src/components/ResultArea.vue @@ -13,7 +13,7 @@ v-else v-show="!!runResult" :class="{ 'text-red': !runResultStatus }" - class="text q-pa-md" + class="text q-px-md q-py-sm" >
diff --git a/src/components/quickcommandUI/SelectList.vue b/src/components/quickcommandUI/SelectList.vue index dab6b1c..30ece99 100644 --- a/src/components/quickcommandUI/SelectList.vue +++ b/src/components/quickcommandUI/SelectList.vue @@ -1,5 +1,5 @@