编排配置文件优化

This commit is contained in:
fofolee
2024-12-30 09:16:12 +08:00
parent c94256c14d
commit dfc1c7e2e3
13 changed files with 342 additions and 209 deletions

View File

@@ -217,7 +217,7 @@ export default defineComponent({
/* 输入框标签字体大小,占位时的位置 */
.command-composer :deep(.q-field--filled .q-field__label) {
font-size: 11px;
top: 8px;
top: 10px;
}
/* 输入框标签悬浮的位置 */

View File

@@ -76,27 +76,28 @@
<!-- 参数输入 -->
<div class="row items-center">
<!-- 按键编辑器 -->
<template v-if="command.hasKeyRecorder">
<KeyEditor v-model="argvLocal" class="col" />
</template>
<!-- UBrowser编辑器 -->
<template v-else-if="command.hasUBrowserEditor">
<UBrowserEditor v-model="argvLocal" class="col" />
</template>
<!-- Axios编辑器 -->
<template v-else-if="command.hasAxiosEditor">
<AxiosConfigEditor v-model="argvLocal" class="col" />
</template>
<!-- 普通参数输入 -->
<template v-else-if="!command.hasNoArgs">
<VariableInput
v-model="argvLocal"
:label="placeholder"
:command="command"
class="col"
ref="variableInput"
/>
<!-- 单独写组件的参数 -->
<component
:is="command.component"
v-model="argvLocal"
class="col"
v-if="!!command.component"
/>
<!-- 通用组件参数 -->
<template v-else>
<div
v-for="item in command.config"
:key="item.key"
class="col-12 row q-col-gutter-xs"
>
<VariableInput
v-model="argvLocal"
:label="item.label"
:command="command"
:class="`col-${item.width || 12}`"
v-if="item.type === 'input'"
/>
</div>
</template>
</div>
</div>

View File

@@ -272,12 +272,12 @@ export default defineComponent({
const args = [this.mainKey, ...activeModifiers];
// 为每个参数添加引号
this.$emit("update:modelValue", `"${args.join('","')}"`);
this.$emit("update:modelValue", `keyTap("${args.join('","')}")`);
},
parseKeyString(val) {
try {
// 移除开头和结尾的引号
const cleanVal = val.replace(/^"|"$/g, "");
// 移除 keyTap 和引号
const cleanVal = val.replace(/^keyTap\("/, "").replace(/"\)$/, "");
// 分割并移除每个参数的引号
const args = cleanVal
.split('","')