拆分数据处理分类,新增编码加密、数学计算分类

This commit is contained in:
fofolee 2025-01-08 16:13:50 +08:00
parent 430466c38c
commit 8003497e71
18 changed files with 271 additions and 239 deletions

View File

@ -4,6 +4,8 @@ const quickcomposer = {
file: require("./quickcomposer/file"),
system: require("./quickcomposer/system"),
network: require("./quickcomposer/network"),
coding: require("./quickcomposer/coding"),
math: require("./quickcomposer/math"),
};
module.exports = quickcomposer;

View File

@ -0,0 +1,9 @@
const crypto = require("./crypto");
const hash = require("./hash");
const encoder = require("./encoder");
module.exports = {
...crypto,
...hash,
...encoder,
};

View File

@ -1,17 +1,9 @@
const encoder = require("./encoder");
const hash = require("./hash");
const string = require("./string");
const crypto = require("./crypto");
const buffer = require("./buffer");
const zlib = require("./zlib");
const random = require("./random");
module.exports = {
...encoder,
...hash,
...string,
...crypto,
buffer,
zlib,
random,
};

View File

@ -0,0 +1,5 @@
const random = require("./random");
module.exports = {
random,
};

View File

@ -44,10 +44,10 @@ export const RegexEditor = defineAsyncComponent(() =>
// Crypto Components
export const SymmetricCryptoEditor = defineAsyncComponent(() =>
import("src/components/composer/data/SymmetricCryptoEditor.vue")
import("src/components/composer/coding/SymmetricCryptoEditor.vue")
);
export const AsymmetricCryptoEditor = defineAsyncComponent(() =>
import("src/components/composer/data/AsymmetricCryptoEditor.vue")
import("src/components/composer/coding/AsymmetricCryptoEditor.vue")
);
// File Components

View File

@ -0,0 +1,120 @@
export const codingCommands = {
label: "编码加密",
icon: "lock",
defaultOpened: false,
commands: [
{
value: "quickcomposer.coding.base64Encode",
label: "编解码",
desc: "文本编解码",
icon: "code",
outputVariable: "processedText",
saveOutput: true,
config: [
{
label: "要编解码的文本",
icon: "text_fields",
type: "varInput",
},
],
functionSelector: [
{
label: "Base64编码",
value: "quickcomposer.coding.base64Encode",
icon: "title",
},
{
label: "Base64解码",
value: "quickcomposer.coding.base64Decode",
icon: "title",
},
{
label: "十六进制编码",
value: "quickcomposer.coding.hexEncode",
icon: "code",
},
{
label: "十六进制解码",
value: "quickcomposer.coding.hexDecode",
icon: "code",
},
{
label: "URL编码",
value: "quickcomposer.coding.urlEncode",
icon: "link",
},
{
label: "URL解码",
value: "quickcomposer.coding.urlDecode",
icon: "link",
},
{
label: "HTML编码",
value: "quickcomposer.coding.htmlEncode",
icon: "html",
},
{
label: "HTML解码",
value: "quickcomposer.coding.htmlDecode",
icon: "html",
},
],
},
{
value: "quickcomposer.coding.symmetricCrypto",
label: "对称加解密",
component: "SymmetricCryptoEditor",
outputVariable: "processedText",
saveOutput: true,
},
{
value: "quickcomposer.coding.asymmetricCrypto",
label: "非对称加解密",
component: "AsymmetricCryptoEditor",
outputVariable: "processedText",
saveOutput: true,
},
{
value: "quickcomposer.coding.md5Hash",
label: "哈希计算",
desc: "计算文本的哈希值",
icon: "enhanced_encryption",
outputVariable: "hashValue",
saveOutput: true,
config: [
{
label: "要计算哈希的文本",
icon: "text_fields",
type: "varInput",
},
],
functionSelector: [
{
label: "MD5",
value: "quickcomposer.coding.md5Hash",
icon: "functions",
},
{
label: "SHA1",
value: "quickcomposer.coding.sha1Hash",
icon: "functions",
},
{
label: "SHA256",
value: "quickcomposer.coding.sha256Hash",
icon: "functions",
},
{
label: "SHA512",
value: "quickcomposer.coding.sha512Hash",
icon: "functions",
},
{
label: "SM3",
value: "quickcomposer.coding.sm3Hash",
icon: "functions",
},
],
},
],
};

View File

@ -5,232 +5,6 @@ export const dataCommands = {
icon: "format_color_text",
defaultOpened: false,
commands: [
{
value: "quickcomposer.data.base64Encode",
label: "编解码",
desc: "文本编解码",
icon: "code",
outputVariable: "processedText",
saveOutput: true,
config: [
{
label: "要编解码的文本",
icon: "text_fields",
type: "varInput",
},
],
functionSelector: [
{
label: "Base64编码",
value: "quickcomposer.data.base64Encode",
icon: "title",
},
{
label: "Base64解码",
value: "quickcomposer.data.base64Decode",
icon: "title",
},
{
label: "十六进制编码",
value: "quickcomposer.data.hexEncode",
icon: "code",
},
{
label: "十六进制解码",
value: "quickcomposer.data.hexDecode",
icon: "code",
},
{
label: "URL编码",
value: "quickcomposer.data.urlEncode",
icon: "link",
},
{
label: "URL解码",
value: "quickcomposer.data.urlDecode",
icon: "link",
},
{
label: "HTML编码",
value: "quickcomposer.data.htmlEncode",
icon: "html",
},
{
label: "HTML解码",
value: "quickcomposer.data.htmlDecode",
icon: "html",
},
],
},
{
value: "quickcomposer.data.symmetricCrypto",
label: "对称加解密",
component: "SymmetricCryptoEditor",
outputVariable: "processedText",
saveOutput: true,
},
{
value: "quickcomposer.data.asymmetricCrypto",
label: "非对称加解密",
component: "AsymmetricCryptoEditor",
outputVariable: "processedText",
saveOutput: true,
},
{
value: "quickcomposer.data.md5Hash",
label: "哈希计算",
desc: "计算文本的哈希值",
icon: "enhanced_encryption",
outputVariable: "hashValue",
saveOutput: true,
config: [
{
label: "要计算哈希的文本",
icon: "text_fields",
type: "varInput",
},
],
functionSelector: [
{
label: "MD5",
value: "quickcomposer.data.md5Hash",
icon: "functions",
},
{
label: "SHA1",
value: "quickcomposer.data.sha1Hash",
icon: "functions",
},
{
label: "SHA256",
value: "quickcomposer.data.sha256Hash",
icon: "functions",
},
{
label: "SHA512",
value: "quickcomposer.data.sha512Hash",
icon: "functions",
},
{
label: "SM3",
value: "quickcomposer.data.sm3Hash",
icon: "functions",
},
],
},
{
value: "Math.sin",
label: "数学计算",
desc: "数学函数计算",
icon: "calculate",
outputVariable: "calculatedText",
saveOutput: true,
config: [
{
label: "要计算的数值",
icon: "numbers",
type: "numInput",
},
],
functionSelector: [
{
label: "正弦(sin)",
value: "Math.sin",
icon: "functions",
},
{
label: "余弦(cos)",
value: "Math.cos",
icon: "functions",
},
{
label: "正切(tan)",
value: "Math.tan",
icon: "functions",
},
{
label: "反正弦(asin)",
value: "Math.asin",
icon: "functions",
},
{
label: "反余弦(acos)",
value: "Math.acos",
icon: "functions",
},
{
label: "反正切(atan)",
value: "Math.atan",
icon: "functions",
},
{
label: "平方根(sqrt)",
value: "Math.sqrt",
icon: "functions",
},
{
label: "自然对数(ln)",
value: "Math.log",
icon: "functions",
},
{
label: "10对数(log10)",
value: "Math.log10",
icon: "functions",
},
{
label: "绝对值(abs)",
value: "Math.abs",
icon: "functions",
},
{
label: "向上取整(ceil)",
value: "Math.ceil",
icon: "functions",
},
{
label: "向下取整(floor)",
value: "Math.floor",
icon: "functions",
},
{
label: "四舍五入(round)",
value: "Math.round",
icon: "functions",
},
{
label: "幂运算(pow)",
value: "Math.pow",
icon: "functions",
},
],
},
{
value: "quickcomposer.data.random",
label: "随机数",
config: [
{
label: "整数",
type: "switch",
defaultValue: false,
width: 2,
},
{
label: "起始值",
icon: "last_page",
type: "numInput",
width: 5,
},
{
label: "结束值",
icon: "first_page",
type: "numInput",
width: 5,
},
],
outputVariable: "randomNumber",
saveOutput: true,
},
{
value: "quickcomposer.data.reverseString",
label: "字符串反转",

View File

@ -7,6 +7,8 @@ import { otherCommands } from "./otherCommands";
import { simulateCommands } from "./simulateCommands";
import { controlCommands } from "./controlCommands";
import { uiCommands } from "./uiCommands";
import { codingCommands } from "./codingCommand";
import { mathCommands } from "./mathCommands";
export const commandCategories = [
fileCommands,
@ -14,8 +16,10 @@ export const commandCategories = [
systemCommands,
notifyCommands,
dataCommands,
codingCommands,
controlCommands,
uiCommands,
simulateCommands,
mathCommands,
otherCommands,
];

View File

@ -0,0 +1,120 @@
export const mathCommands = {
label: "数学计算",
icon: "calculate",
defaultOpened: false,
commands: [
{
value: "Math.sin",
label: "数学计算",
desc: "数学函数计算",
icon: "calculate",
outputVariable: "calculatedText",
saveOutput: true,
config: [
{
label: "要计算的数值",
icon: "numbers",
type: "numInput",
},
],
functionSelector: [
{
label: "正弦(sin)",
value: "Math.sin",
icon: "functions",
},
{
label: "余弦(cos)",
value: "Math.cos",
icon: "functions",
},
{
label: "正切(tan)",
value: "Math.tan",
icon: "functions",
},
{
label: "反正弦(asin)",
value: "Math.asin",
icon: "functions",
},
{
label: "反余弦(acos)",
value: "Math.acos",
icon: "functions",
},
{
label: "反正切(atan)",
value: "Math.atan",
icon: "functions",
},
{
label: "平方根(sqrt)",
value: "Math.sqrt",
icon: "functions",
},
{
label: "自然对数(ln)",
value: "Math.log",
icon: "functions",
},
{
label: "10对数(log10)",
value: "Math.log10",
icon: "functions",
},
{
label: "绝对值(abs)",
value: "Math.abs",
icon: "functions",
},
{
label: "向上取整(ceil)",
value: "Math.ceil",
icon: "functions",
},
{
label: "向下取整(floor)",
value: "Math.floor",
icon: "functions",
},
{
label: "四舍五入(round)",
value: "Math.round",
icon: "functions",
},
{
label: "幂运算(pow)",
value: "Math.pow",
icon: "functions",
},
],
},
{
value: "quickcomposer.math.random",
label: "随机数",
config: [
{
label: "整数",
type: "switch",
defaultValue: false,
width: 2,
},
{
label: "起始值",
icon: "last_page",
type: "numInput",
width: 5,
},
{
label: "结束值",
icon: "first_page",
type: "numInput",
width: 5,
},
],
outputVariable: "randomNumber",
saveOutput: true,
},
],
};

View File

@ -1,6 +1,6 @@
export const notifyCommands = {
label: "消息通知",
icon: "chat_bubble_outline",
label: "输出消息",
icon: "output",
defaultOpened: false,
commands: [
{

View File

@ -1,7 +1,7 @@
import { newVarInputVal } from "js/composer/varInputValManager";
export const uiCommands = {
label: "UI操作",
label: "用户交互",
icon: "web",
defaultOpened: false,
commands: [
@ -52,6 +52,12 @@ export const uiCommands = {
},
],
},
{
label: "标题",
type: "varInput",
defaultValue: newVarInputVal("str", "请选择"),
width: 12,
},
],
},
{