UPDATE: VERSION-20260331

This commit is contained in:
libertyspy
2026-03-31 14:32:54 +08:00
parent 705021b391
commit a0d8f555f9
6 changed files with 110 additions and 11 deletions

View File

@@ -111,6 +111,11 @@
v-else-if="setting.paramKey === 'platforms'" v-model:value="setting.defaultValue">
<a-select-option v-for="pl in platforms" :value="pl.name">{{pl.description}}</a-select-option>
</a-select>
<a-select :placeholder="`请选择${setting.description}`"
allow-clear
v-else-if="setting.paramKey === 'command'" 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" />
</a-form-item>
@@ -127,6 +132,16 @@
<a-form-item v-for="setting in currentElement.parameters" :label="setting.description">
<a-input-number v-if="setting.dataType === 'double'" v-model:value="setting.defaultValue"
:placeholder="setting.description" size="small" style="width:100%;" />
<a-select :placeholder="`请选择${setting.description}`"
allow-clear
v-else-if="setting.paramKey === 'platforms'" v-model:value="setting.defaultValue">
<a-select-option v-for="pl in platforms" :value="pl.name">{{ pl.description }}</a-select-option>
</a-select>
<a-select :placeholder="`请选择${setting.description}`"
allow-clear
v-else-if="setting.paramKey === 'command'" 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" />
</a-form-item>
</template>
@@ -161,7 +176,7 @@ import type { ElementParameter, ElementVariable, GraphTaskElement } from '../gra
import type { BehaviorTree } from './tree';
import type { Graph, Node, NodeProperties } from '@antv/x6';
import { generateKey } from '@/utils/strings';
import type { Platform } from '@/views/decision/types';
import type { NodeCommand, Platform } from '../types';
const actionSpaceColumns = [
{ title: '序号', dataIndex: 'index', key: 'index', width: 40 },
@@ -179,10 +194,12 @@ export default defineComponent({
node: { type: [Object, null] as PropType<Node<NodeProperties> | null | undefined>, required: false },
graph: { type: [Object, null] as PropType<Graph | null | undefined>, required: true },
platforms: { type: Array as PropType<Platform[]>, required: true },
nodeCommands: { type: Array as PropType<NodeCommand[]>, required: true },
},
emits: ['update-element', 'update-tree'],
setup(props, { emit }) {
const platforms = ref<Platform[]>(props.platforms ?? []);
const nodeCommands = ref<NodeCommand[]>(props.nodeCommands ?? []);
const activeTopTabsKey = ref<string>('1');
const activeBottomTabsKey = ref<string>('1');
@@ -370,11 +387,13 @@ export default defineComponent({
watch(() => currentElement.value, () => updateNode(), { deep: true });
watch(() => props.nodeCommands, (n: NodeCommand[] | null | undefined) => nodeCommands.value = n ?? [], { deep: true, immediate: true });
watch(() => props.platforms, (n: Platform[] | null | undefined) => platforms.value = n ?? [], { deep: true, immediate: true });
onMounted(() => load());
return {
nodeCommands,
platforms,
addParameterTab,
groupedParametersActiveTab,