UPDATE: VERSION-20260331
This commit is contained in:
@@ -1204,7 +1204,7 @@
|
|||||||
.ant-tabs-content {
|
.ant-tabs-content {
|
||||||
//padding: 15px;
|
//padding: 15px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background: #041b36db;
|
background: #041832;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.settings-tab,
|
&.settings-tab,
|
||||||
@@ -1508,9 +1508,7 @@
|
|||||||
border-inline-end-width: 1px;
|
border-inline-end-width: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-select:not(.ant-select-customize-input) .ant-select-selector{
|
|
||||||
border: 1px solid #2c2a2a;
|
|
||||||
}
|
|
||||||
.ant-select .ant-select-selection-placeholder,
|
.ant-select .ant-select-selection-placeholder,
|
||||||
.ant-select .ant-select-selection-search-input{
|
.ant-select .ant-select-selection-search-input{
|
||||||
background: transparent
|
background: transparent
|
||||||
@@ -1832,3 +1830,44 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ks-add-parameter-action{
|
||||||
|
color: #eee;
|
||||||
|
position: absolute;
|
||||||
|
right: 14px;
|
||||||
|
top: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ks-parameter-setting-tabs{
|
||||||
|
.ant-tabs-nav{
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
.ant-tabs-nav-list{
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
&.ant-tabs-left >.ant-tabs-content-holder,
|
||||||
|
&.ant-tabs-left >div>.ant-tabs-content-holder{
|
||||||
|
border-left-color: #09264b;
|
||||||
|
}
|
||||||
|
.ant-tabs-tab-remove{
|
||||||
|
//position: absolute;
|
||||||
|
//right: 10px;
|
||||||
|
//top: 7px;
|
||||||
|
.anticon{
|
||||||
|
color: rgb(173 206 224);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.ant-tabs-left >.ant-tabs-nav .ant-tabs-tab{
|
||||||
|
border-radius: 0!important;
|
||||||
|
}
|
||||||
|
&.ant-tabs-card >.ant-tabs-nav .ant-tabs-tab-active,
|
||||||
|
&.ant-tabs-card >div>.ant-tabs-nav .ant-tabs-tab-active {
|
||||||
|
background: #09264c;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.ant-tabs-left >.ant-tabs-content-holder >.ant-tabs-content>.ant-tabs-tabpane,
|
||||||
|
&.ant-tabs-left >div>.ant-tabs-content-holder >.ant-tabs-content>.ant-tabs-tabpane{
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import { HttpRequestClient } from '@/utils/request';
|
import { HttpRequestClient } from '@/utils/request';
|
||||||
import type { BasicResponse } from '@/types';
|
import type { BasicResponse } from '@/types';
|
||||||
import type { PlatformListableResponse } from './types';
|
import type { NodeCommandListResponse, PlatformListableResponse } from './types';
|
||||||
|
|
||||||
const req = HttpRequestClient.create<BasicResponse>({
|
const req = HttpRequestClient.create<BasicResponse>({
|
||||||
baseURL: '/api',
|
baseURL: '/api',
|
||||||
@@ -19,3 +19,7 @@ const req = HttpRequestClient.create<BasicResponse>({
|
|||||||
export const findAllBasicPlatforms = (): Promise<PlatformListableResponse> => {
|
export const findAllBasicPlatforms = (): Promise<PlatformListableResponse> => {
|
||||||
return req.get<PlatformListableResponse>('/system/firerule/platforms/basic');
|
return req.get<PlatformListableResponse>('/system/firerule/platforms/basic');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const findAllNodeCommands = (): Promise<NodeCommandListResponse> => {
|
||||||
|
return req.get<NodeCommandListResponse>('/node/command/all')
|
||||||
|
}
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
<Properties
|
<Properties
|
||||||
v-if="graph"
|
v-if="graph"
|
||||||
:platforms="platforms"
|
:platforms="platforms"
|
||||||
|
:nodeCommands="nodeCommands"
|
||||||
:element="selectedNodeTaskElement"
|
:element="selectedNodeTaskElement"
|
||||||
:graph="graph as any"
|
:graph="graph as any"
|
||||||
:node="selectedModelNode as any"
|
:node="selectedModelNode as any"
|
||||||
@@ -72,7 +73,7 @@ import { createGraphTaskElementFromTemplate } from './utils';
|
|||||||
|
|
||||||
import { createGraphTaskElement, createLineOptions, type GraphContainer, type GraphTaskElement, hasElements, hasRootElementNode, resolveGraph, useGraphCanvas } from '../graph';
|
import { createGraphTaskElement, createLineOptions, type GraphContainer, type GraphTaskElement, hasElements, hasRootElementNode, resolveGraph, useGraphCanvas } from '../graph';
|
||||||
import { registerNodeElement } from './register';
|
import { registerNodeElement } from './register';
|
||||||
import { findAllBasicPlatforms } from '../api';
|
import { findAllBasicPlatforms, findAllNodeCommands } from '../api';
|
||||||
import type { Platform } from '../types';
|
import type { Platform } from '../types';
|
||||||
import { createTree, findOneTreeById, findOneTreeByPlatformId, updateTree } from './api';
|
import { createTree, findOneTreeById, findOneTreeByPlatformId, updateTree } from './api';
|
||||||
import TressCard from './trees-card.vue';
|
import TressCard from './trees-card.vue';
|
||||||
@@ -111,6 +112,7 @@ export default defineComponent({
|
|||||||
const changed = ref<boolean>(false);
|
const changed = ref<boolean>(false);
|
||||||
const treesCardRef = ref<InstanceType<typeof TressCard> | null>(null);
|
const treesCardRef = ref<InstanceType<typeof TressCard> | null>(null);
|
||||||
const platforms = ref<Platform[]>([]);
|
const platforms = ref<Platform[]>([]);
|
||||||
|
const nodeCommands = ref<NodeCommand[]>([])
|
||||||
const currentScenarioId = ref<number | null>(null);
|
const currentScenarioId = ref<number | null>(null);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -138,6 +140,18 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const loadNodeCommands = ()=> {
|
||||||
|
nodeCommands.value = []
|
||||||
|
findAllNodeCommands().then(r=> {
|
||||||
|
nodeCommands.value = r.data ?? []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const loadDatasource = ()=> {
|
||||||
|
loadPlatforms();
|
||||||
|
loadNodeCommands();
|
||||||
|
}
|
||||||
|
|
||||||
// 处理拖动开始
|
// 处理拖动开始
|
||||||
const handleDragStart = (nm: NodeDragTemplate) => {
|
const handleDragStart = (nm: NodeDragTemplate) => {
|
||||||
draggedNodeData.value = nm;
|
draggedNodeData.value = nm;
|
||||||
@@ -449,13 +463,14 @@ export default defineComponent({
|
|||||||
// 初始化
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
init();
|
init();
|
||||||
loadPlatforms();
|
loadDatasource();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 清理
|
// 清理
|
||||||
onBeforeUnmount(() => destroy());
|
onBeforeUnmount(() => destroy());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
nodeCommands,
|
||||||
currentScenarioId,
|
currentScenarioId,
|
||||||
platforms,
|
platforms,
|
||||||
treesCardRef,
|
treesCardRef,
|
||||||
|
|||||||
@@ -111,6 +111,11 @@
|
|||||||
v-else-if="setting.paramKey === 'platforms'" v-model:value="setting.defaultValue">
|
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-option v-for="pl in platforms" :value="pl.name">{{pl.description}}</a-select-option>
|
||||||
</a-select>
|
</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"
|
<a-input v-else v-model:value="setting.defaultValue"
|
||||||
:placeholder="setting.description" size="small" />
|
:placeholder="setting.description" size="small" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -127,6 +132,16 @@
|
|||||||
<a-form-item v-for="setting in currentElement.parameters" :label="setting.description">
|
<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"
|
<a-input-number v-if="setting.dataType === 'double'" v-model:value="setting.defaultValue"
|
||||||
:placeholder="setting.description" size="small" style="width:100%;" />
|
: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-input v-else v-model:value="setting.defaultValue" :placeholder="setting.description" size="small" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -161,7 +176,7 @@ import type { ElementParameter, ElementVariable, GraphTaskElement } from '../gra
|
|||||||
import type { BehaviorTree } from './tree';
|
import type { BehaviorTree } from './tree';
|
||||||
import type { Graph, Node, NodeProperties } from '@antv/x6';
|
import type { Graph, Node, NodeProperties } from '@antv/x6';
|
||||||
import { generateKey } from '@/utils/strings';
|
import { generateKey } from '@/utils/strings';
|
||||||
import type { Platform } from '@/views/decision/types';
|
import type { NodeCommand, Platform } from '../types';
|
||||||
|
|
||||||
const actionSpaceColumns = [
|
const actionSpaceColumns = [
|
||||||
{ title: '序号', dataIndex: 'index', key: 'index', width: 40 },
|
{ 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 },
|
node: { type: [Object, null] as PropType<Node<NodeProperties> | null | undefined>, required: false },
|
||||||
graph: { type: [Object, null] as PropType<Graph | null | undefined>, required: true },
|
graph: { type: [Object, null] as PropType<Graph | null | undefined>, required: true },
|
||||||
platforms: { type: Array as PropType<Platform[]>, required: true },
|
platforms: { type: Array as PropType<Platform[]>, required: true },
|
||||||
|
nodeCommands: { type: Array as PropType<NodeCommand[]>, required: true },
|
||||||
},
|
},
|
||||||
emits: ['update-element', 'update-tree'],
|
emits: ['update-element', 'update-tree'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const platforms = ref<Platform[]>(props.platforms ?? []);
|
const platforms = ref<Platform[]>(props.platforms ?? []);
|
||||||
|
const nodeCommands = ref<NodeCommand[]>(props.nodeCommands ?? []);
|
||||||
|
|
||||||
const activeTopTabsKey = ref<string>('1');
|
const activeTopTabsKey = ref<string>('1');
|
||||||
const activeBottomTabsKey = ref<string>('1');
|
const activeBottomTabsKey = ref<string>('1');
|
||||||
@@ -370,11 +387,13 @@ export default defineComponent({
|
|||||||
|
|
||||||
watch(() => currentElement.value, () => updateNode(), { deep: true });
|
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 });
|
watch(() => props.platforms, (n: Platform[] | null | undefined) => platforms.value = n ?? [], { deep: true, immediate: true });
|
||||||
|
|
||||||
onMounted(() => load());
|
onMounted(() => load());
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
nodeCommands,
|
||||||
platforms,
|
platforms,
|
||||||
addParameterTab,
|
addParameterTab,
|
||||||
groupedParametersActiveTab,
|
groupedParametersActiveTab,
|
||||||
|
|||||||
21
modeler/src/views/decision/types/command.ts
Normal file
21
modeler/src/views/decision/types/command.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the kernelstudio package.
|
||||||
|
*
|
||||||
|
* (c) 2014-2026 zlin <admin@kernelstudio.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE file
|
||||||
|
* that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { ApiDataResponse, NullableString } from '@/types';
|
||||||
|
|
||||||
|
export interface NodeCommand {
|
||||||
|
id: number,
|
||||||
|
command: NullableString,
|
||||||
|
chineseName: NullableString,
|
||||||
|
description: NullableString,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NodeCommandListResponse extends ApiDataResponse<NodeCommand[]> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,3 +8,4 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './platform'
|
export * from './platform'
|
||||||
|
export * from './command'
|
||||||
Reference in New Issue
Block a user