加强变量校验,重复和非法时自动重命名,优化变量管理,实时获取最新变量,不再进行增删操作

This commit is contained in:
fofolee
2025-01-07 00:41:28 +08:00
parent 25be7f4926
commit 5947e537fe
10 changed files with 269 additions and 78 deletions

View File

@@ -79,7 +79,7 @@
}"
class="variable-dropdown prepend-btn"
size="sm"
v-if="variables.length"
@click="variables = getCurrentVariables()"
>
<q-list class="variable-list">
<q-item-label header class="variable-label">
@@ -108,6 +108,15 @@
</q-item-section>
</q-item>
</template>
<template v-else>
<q-item>
<q-item-section>
<q-item-label
>无可用变量请先点击命令卡片输出变量按钮设置变量</q-item-label
>
</q-item-section>
</q-item>
</template>
</q-list>
</q-btn-dropdown>
</template>
@@ -176,13 +185,14 @@ export default defineComponent({
emits: ["update:modelValue"],
setup() {
const variables = inject("composerVariables", []);
return { variables };
const getCurrentVariables = inject("getCurrentVariables");
return { getCurrentVariables };
},
data() {
return {
selectedVariable: null,
variables: [],
};
},