添加反向树加载功能,重构节点和树的选择逻辑

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-17 19:30:19 +08:00
parent 65d99bb7a8
commit 1de4f9db8d
15 changed files with 611 additions and 139 deletions

View File

@@ -113,7 +113,7 @@
</a-select>
<a-select :placeholder="`请选择${setting.description}`"
allow-clear
v-else-if="setting.paramKey === 'command'" v-model:value="setting.defaultValue">
v-else-if="isNodeCommandParameter(setting.paramKey as string | null | undefined)" v-model:value="setting.defaultValue">
<a-select-option v-for="pl in nodeCommands" :value="pl.command">{{pl.chineseName}}</a-select-option>
</a-select>
<a-input v-else v-model:value="setting.defaultValue"
@@ -148,7 +148,7 @@
</a-select>
<a-select :placeholder="`请选择${setting.description}`"
allow-clear
v-else-if="setting.paramKey === 'command'" v-model:value="setting.defaultValue">
v-else-if="isNodeCommandParameter(setting.paramKey as string | null | undefined)" v-model:value="setting.defaultValue">
<a-select-option v-for="pl in nodeCommands" :value="pl.command">{{pl.chineseName}}</a-select-option>
</a-select>
<a-input v-else v-model:value="setting.defaultValue" :placeholder="setting.description" size="small" />
@@ -209,6 +209,10 @@ export default defineComponent({
},
emits: ['update-element', 'update-tree'],
setup(props, { emit }) {
const isNodeCommandParameter = (paramKey: string | null | undefined): boolean => {
return ['command', 'should_task'].includes(paramKey ?? '');
};
const platforms = ref<Platform[]>(props.platforms ?? []);
const subPlatforms = ref<Platform[]>(props.subPlatforms ?? []);
const nodeCommands = ref<NodeCommand[]>(props.nodeCommands ?? []);
@@ -448,6 +452,7 @@ export default defineComponent({
groupedParameters,
getPlatformTabName,
getAvailablePlatforms,
isNodeCommandParameter,
actionSpaceColumns,
activeTopTabsKey,
activeBottomTabsKey,