新增模拟鼠标操作

This commit is contained in:
fofolee
2025-01-02 18:25:35 +08:00
parent 64b6a2a6d9
commit 9e213f7b65
11 changed files with 243 additions and 209 deletions

View File

@@ -4,9 +4,6 @@ import { defineAsyncComponent } from "vue";
export const KeyEditor = defineAsyncComponent(() =>
import("components/composer/ui/KeyEditor.vue")
);
export const FunctionSelector = defineAsyncComponent(() =>
import("components/composer/ui/FunctionSelector.vue")
);
// Control Flow Components
export const ConditionalJudgment = defineAsyncComponent(() =>

View File

@@ -4,7 +4,7 @@ import { systemCommands } from "./systemCommands";
import { notifyCommands } from "./notifyCommands";
import { textProcessingCommands } from "./textProcessingCommands";
import { otherCommands } from "./otherCommands";
import { keyCommands } from "./keyCommands";
import { simulateCommands } from "./simulateCommands";
import { controlCommands } from "./controlCommands";
export const commandCategories = [
@@ -15,5 +15,5 @@ export const commandCategories = [
textProcessingCommands,
controlCommands,
otherCommands,
keyCommands,
simulateCommands,
];

View File

@@ -1,13 +0,0 @@
export const keyCommands = {
label: "按键操作",
icon: "keyboard",
defaultOpened: false,
commands: [
{
value: "keyTap",
label: "模拟按键",
config: [],
component: "KeyEditor",
},
],
};

View File

@@ -0,0 +1,81 @@
export const simulateCommands = {
label: "模拟操作",
icon: "keyboard",
defaultOpened: false,
commands: [
{
value: "keyTap",
label: "模拟按键",
config: [],
component: "KeyEditor",
},
{
value: "utools",
label: "鼠标点击",
allowEmptyArgv: true,
config: [
{
label: "X坐标留空则原地点击",
icon: "drag_handle",
type: "input",
inputType: "number",
width: 8,
},
{
label: "Y坐标留空则原地点击",
icon: "drag_handle",
type: "input",
inputType: "number",
width: 8,
},
],
functionSelector: {
selectLabel: "鼠标动作",
options: [
{
label: "单击",
value: "utools.simulateMouseClick",
},
{
label: "右击",
value: "utools.simulateMouseRightClick",
},
{
label: "双击",
value: "utools.simulateMouseDoubleClick",
},
],
width: 2,
allowEmptyArgv: true,
},
},
{
value: "utools.simulateMouseMove",
label: "鼠标移动",
config: [
{
label: "X坐标",
icon: "drag_handle",
defaultValue: 0,
type: "input",
inputType: "number",
width: 8,
},
{
label: "Y坐标",
icon: "drag_handle",
defaultValue: 0,
type: "input",
inputType: "number",
width: 8,
},
],
},
{
value: "utools.getCursorScreenPoint",
label: "获取鼠标坐标",
config: [],
allowEmptyArgv: true,
},
],
};

View File

@@ -33,7 +33,7 @@ export const systemCommands = {
value: "electron.clipboard.readText",
label: "获取剪贴板内容",
config: [],
icon: "content_copy",
allowEmptyArgv: true,
},
],
};

View File

@@ -8,9 +8,15 @@ export const textProcessingCommands = {
label: "编解码",
desc: "文本编解码",
icon: "code",
component: "FunctionSelector",
componentProps: {
inputLabel: "要编解码的文本",
config: [
{
label: "要编解码的文本",
icon: "text_fields",
type: "input",
width: 8,
},
],
functionSelector: {
selectLabel: "编解码方式",
options: [
{
@@ -40,6 +46,7 @@ export const textProcessingCommands = {
value: "quickcomposer.textProcessing.htmlDecode",
},
],
width: 3,
},
},
{
@@ -57,9 +64,15 @@ export const textProcessingCommands = {
label: "哈希计算",
desc: "计算文本的哈希值",
icon: "enhanced_encryption",
component: "FunctionSelector",
componentProps: {
inputLabel: "要计算哈希的文本",
config: [
{
label: "要计算哈希的文本",
icon: "text_fields",
type: "input",
width: 8,
},
],
functionSelector: {
selectLabel: "哈希算法",
options: [
{ label: "MD5", value: "quickcomposer.textProcessing.md5Hash" },
@@ -69,6 +82,7 @@ export const textProcessingCommands = {
{ label: "SM3", value: "quickcomposer.textProcessing.sm3Hash" },
],
},
width: 3,
},
{
value: "quickcomposer.textProcessing.reverseString",