mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-17 00:44:35 +08:00
新增模拟鼠标操作
This commit is contained in:
@@ -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(() =>
|
||||
|
||||
@@ -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,
|
||||
];
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
export const keyCommands = {
|
||||
label: "按键操作",
|
||||
icon: "keyboard",
|
||||
defaultOpened: false,
|
||||
commands: [
|
||||
{
|
||||
value: "keyTap",
|
||||
label: "模拟按键",
|
||||
config: [],
|
||||
component: "KeyEditor",
|
||||
},
|
||||
],
|
||||
};
|
||||
81
src/js/composer/commands/simulateCommands.js
Normal file
81
src/js/composer/commands/simulateCommands.js
Normal 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,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -33,7 +33,7 @@ export const systemCommands = {
|
||||
value: "electron.clipboard.readText",
|
||||
label: "获取剪贴板内容",
|
||||
config: [],
|
||||
icon: "content_copy",
|
||||
allowEmptyArgv: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user