diff --git a/src/components/composer/ComposerCard.vue b/src/components/composer/ComposerCard.vue index ebfdf87..9c08e88 100644 --- a/src/components/composer/ComposerCard.vue +++ b/src/components/composer/ComposerCard.vue @@ -99,26 +99,12 @@ v-bind="command.componentProps || {}" /> - + @@ -131,6 +117,7 @@ import { defineComponent, inject } from "vue"; import KeyEditor from "components/composer/ui/KeyEditor.vue"; import UBrowserEditor from "components/composer/ubrowser/UBrowserEditor.vue"; import VariableInput from "components/composer/ui/VariableInput.vue"; +import MultiParamInput from "components/composer/ui/MultiParamInput.vue"; import AxiosConfigEditor from "components/composer/http/AxiosConfigEditor.vue"; import SymmetricCryptoEditor from "components/composer/crypto/SymmetricCryptoEditor.vue"; import AsymmetricCryptoEditor from "components/composer/crypto/AsymmetricCryptoEditor.vue"; @@ -143,6 +130,7 @@ export default defineComponent({ KeyEditor, UBrowserEditor, VariableInput, + MultiParamInput, AxiosConfigEditor, SymmetricCryptoEditor, AsymmetricCryptoEditor, @@ -317,6 +305,7 @@ export default defineComponent({ diff --git a/src/components/composer/ui/MultiParamInput.vue b/src/components/composer/ui/MultiParamInput.vue new file mode 100644 index 0000000..7365391 --- /dev/null +++ b/src/components/composer/ui/MultiParamInput.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/src/js/composer/commands/textProcessingCommands.js b/src/js/composer/commands/textProcessingCommands.js index 5bc64b9..ce496da 100644 --- a/src/js/composer/commands/textProcessingCommands.js +++ b/src/js/composer/commands/textProcessingCommands.js @@ -3,24 +3,6 @@ export const textProcessingCommands = { icon: "code", defaultOpened: false, commands: [ - { - value: "quickcomposer.textProcessing", - label: "哈希计算", - desc: "计算文本的哈希值", - icon: "enhanced_encryption", - component: "FunctionSelector", - componentProps: { - inputLabel: "要计算哈希的文本", - selectLabel: "哈希算法", - options: [ - { label: "MD5", value: "quickcomposer.textProcessing.md5Hash" }, - { label: "SHA1", value: "quickcomposer.textProcessing.sha1Hash" }, - { label: "SHA256", value: "quickcomposer.textProcessing.sha256Hash" }, - { label: "SHA512", value: "quickcomposer.textProcessing.sha512Hash" }, - { label: "SM3", value: "quickcomposer.textProcessing.sm3Hash" }, - ], - }, - }, { value: "quickcomposer.textProcessing", label: "编解码", @@ -60,6 +42,34 @@ export const textProcessingCommands = { ], }, }, + { + value: "quickcomposer.textProcessing.symmetricCrypto", + label: "对称加解密", + component: "SymmetricCryptoEditor", + }, + { + value: "quickcomposer.textProcessing.asymmetricCrypto", + label: "非对称加解密", + component: "AsymmetricCryptoEditor", + }, + { + value: "quickcomposer.textProcessing", + label: "哈希计算", + desc: "计算文本的哈希值", + icon: "enhanced_encryption", + component: "FunctionSelector", + componentProps: { + inputLabel: "要计算哈希的文本", + selectLabel: "哈希算法", + options: [ + { label: "MD5", value: "quickcomposer.textProcessing.md5Hash" }, + { label: "SHA1", value: "quickcomposer.textProcessing.sha1Hash" }, + { label: "SHA256", value: "quickcomposer.textProcessing.sha256Hash" }, + { label: "SHA512", value: "quickcomposer.textProcessing.sha512Hash" }, + { label: "SM3", value: "quickcomposer.textProcessing.sm3Hash" }, + ], + }, + }, { value: "quickcomposer.textProcessing.reverseString", label: "字符串反转", @@ -83,6 +93,7 @@ export const textProcessingCommands = { type: "input", defaultValue: "", icon: "text_fields", + width: 4, }, { key: "oldStr", @@ -90,6 +101,7 @@ export const textProcessingCommands = { type: "input", defaultValue: "", icon: "find_replace", + width: 4, }, { key: "newStr", @@ -97,6 +109,7 @@ export const textProcessingCommands = { type: "input", defaultValue: "", icon: "text_fields", + width: 4, }, ], }, @@ -110,22 +123,23 @@ export const textProcessingCommands = { type: "input", defaultValue: "", icon: "text_fields", + width: 6, }, { key: "start", label: "起始位置", type: "input", inputType: "number", - defaultValue: "0", icon: "first_page", + width: 3, }, { key: "end", label: "结束位置", type: "input", inputType: "number", - defaultValue: "", icon: "last_page", + width: 3, }, ], }, @@ -149,15 +163,5 @@ export const textProcessingCommands = { }, ], }, - { - value: "quickcomposer.textProcessing.symmetricCrypto", - label: "对称加解密", - component: "SymmetricCryptoEditor", - }, - { - value: "quickcomposer.textProcessing.asymmetricCrypto", - label: "非对称加解密", - component: "AsymmetricCryptoEditor", - }, ], }; diff --git a/src/js/composer/generateCode.js b/src/js/composer/generateCode.js index 986e2b9..a9631bd 100644 --- a/src/js/composer/generateCode.js +++ b/src/js/composer/generateCode.js @@ -13,12 +13,7 @@ export function generateCode(commandFlow) { } let awaitCmd = cmd.isAsync ? "await " : ""; - - if (!!cmd.component) { - line += `${awaitCmd}${cmd.argv}`; - } else { - line += `${awaitCmd}${cmd.value}(${cmd.argv})`; - } + line += `${awaitCmd}${cmd.value}(${cmd.argv})`; code.push(line); });