diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue
index ef33acf..7cc06f4 100644
--- a/src/components/CommandRunResult.vue
+++ b/src/components/CommandRunResult.vue
@@ -30,39 +30,15 @@
运行结果
-
- 将 DataUrl 转为图片
- 复制到剪贴板
- 发送到活动窗口
-
-
+
+
+
+
@@ -90,12 +70,14 @@ import outputTypes from "../js/options/outputTypes.js";
import specialVars from "../js/options/specialVars.js";
import commandTypes from "../js/options/commandTypes.js";
import ResultArea from "components/ResultArea.vue";
+import ResultMenu from "components/popup/ResultMenu.vue";
export default {
- components: { ResultArea },
+ components: { ResultArea, ResultMenu },
data() {
return {
isResultShow: false,
+ selectText: null,
runResult: [],
runResultStatus: true,
subInputValue: "",
@@ -364,21 +346,14 @@ export default {
}
return [html.documentElement.innerHTML];
},
- copyResult() {
- utools.copyText(this.runResult.join("\n"));
- quickcommand.showMessageBox("已复制到剪贴板");
+ selectHandler() {
+ this.selectText = window.getSelection().toString().trim();
},
- sendResult() {
- utools.copyText(this.runResult.join("\n"));
- utools.hideMainWindow();
- quickcommand.simulatePaste();
+ clearSelect() {
+ window.getSelection().removeAllRanges();
+ this.selectText = null;
},
- dataUrlToImg() {
- let imgs = this.runResult
- .join("\n")
- .match(/data:image\/.*?;base64,.*/g)
- ?.map((dataUrl) => `
`);
- if (!imgs) return quickcommand.showMessageBox("dataUrl 格式不正确!");
+ showBase64Img(imgs) {
this.runResult = [];
this.enableHtml = true;
this.showRunResult(imgs, true);
diff --git a/src/components/popup/ResultMenu.vue b/src/components/popup/ResultMenu.vue
new file mode 100644
index 0000000..0745a77
--- /dev/null
+++ b/src/components/popup/ResultMenu.vue
@@ -0,0 +1,55 @@
+
+
+ 将 DataUrl 转为图片
+ 复制到剪贴板
+ 发送到活动窗口
+
+
+
+
+