Merge branches 'master' and 'master' of http://101.43.238.71:3000/zouju/auto-solution
This commit is contained in:
@@ -42,6 +42,12 @@ public class BehaviortreeController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private BehaviortreeProcessor behaviortreeProcessor;
|
private BehaviortreeProcessor behaviortreeProcessor;
|
||||||
|
|
||||||
|
@GetMapping(value = "/platform/{id}")
|
||||||
|
public AjaxResult fromPlatform(@PathVariable("id") Integer id)
|
||||||
|
{
|
||||||
|
return success(behaviortreeService.findOneByPlatformId(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询行为树主列表
|
* 查询行为树主列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import com.solution.system.domain.Behaviortree;
|
|||||||
*/
|
*/
|
||||||
public interface BehaviortreeMapper
|
public interface BehaviortreeMapper
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Behaviortree findOneByPlatformId(Integer platformId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询行为树主
|
* 查询行为树主
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import com.solution.system.domain.Behaviortree;
|
|||||||
*/
|
*/
|
||||||
public interface IBehaviortreeService
|
public interface IBehaviortreeService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Behaviortree findOneByPlatformId(Integer platformId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询行为树主
|
* 查询行为树主
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ public class BehaviortreeServiceImpl implements IBehaviortreeService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private BehaviortreeMapper behaviortreeMapper;
|
private BehaviortreeMapper behaviortreeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Behaviortree findOneByPlatformId(Integer platformId)
|
||||||
|
{
|
||||||
|
return behaviortreeMapper.findOneByPlatformId(platformId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询行为树主
|
* 查询行为树主
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="xmlContent" column="xml_content" />
|
<result property="xmlContent" column="xml_content" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="findOneByPlatformId" resultMap="BehaviortreeResult">
|
||||||
|
select * from behaviortree
|
||||||
|
where platform_id=#{platformId}
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<sql id="selectBehaviortreeVo">
|
<sql id="selectBehaviortreeVo">
|
||||||
select id, name, description, created_at, updated_at, english_name, xml_content from behaviortree
|
select id, name, description, created_at, updated_at, english_name, xml_content from behaviortree
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
@@ -309,9 +309,18 @@ export default defineComponent({
|
|||||||
currentScenarioEditing.value = null !== currentScenario.value;
|
currentScenarioEditing.value = null !== currentScenario.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
handleGraphEvent('node:dblclick', () => {
|
handleGraphEvent('node:dblclick', (args: any) => {
|
||||||
destroy()
|
const node = args.node as Node<NodeProperties>;
|
||||||
window.location.href = '/app/decision/designer'
|
const element = node.getData() as GraphTaskElement;
|
||||||
|
console.error('element',element)
|
||||||
|
if(element && element.platformId ){
|
||||||
|
window.location.href = `/app/decision/designer?platform=${element.platformId}`
|
||||||
|
} else {
|
||||||
|
window.location.href = '/app/decision/designer'
|
||||||
|
}
|
||||||
|
|
||||||
|
// destroy()
|
||||||
|
// window.location.href = '/app/decision/designer'
|
||||||
// router.push({
|
// router.push({
|
||||||
// path: '/app/decision/designer'
|
// path: '/app/decision/designer'
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ export const findTreesByQuery = (query: Partial<BehaviorTreeRequest> = {}): Prom
|
|||||||
return req.get<BehaviorTreePageResponse>('/system/behaviortree/list', query);
|
return req.get<BehaviorTreePageResponse>('/system/behaviortree/list', query);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const findOneTreeByPlatformId = (platformId: number): Promise<BehaviorTreeDetailsResponse> => {
|
||||||
|
return req.get(`/system/behaviortree/platform/${platformId}`);
|
||||||
|
};
|
||||||
|
|
||||||
export const findOneTreeById = (id: number): Promise<BehaviorTreeDetailsResponse> => {
|
export const findOneTreeById = (id: number): Promise<BehaviorTreeDetailsResponse> => {
|
||||||
return req.get(`/system/behaviortree/${id}`);
|
return req.get(`/system/behaviortree/${id}`);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
import { defineComponent, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { getTeleport } from '@antv/x6-vue-shape';
|
import { getTeleport } from '@antv/x6-vue-shape';
|
||||||
import { Graph, Node, type NodeProperties } from '@antv/x6';
|
import { Graph, Node, type NodeProperties } from '@antv/x6';
|
||||||
@@ -68,7 +69,7 @@ import { createGraphTaskElement, createLineOptions, type GraphContainer, type Gr
|
|||||||
import { registerNodeElement } from './register';
|
import { registerNodeElement } from './register';
|
||||||
import { findAllBasicPlatforms } from '../api';
|
import { findAllBasicPlatforms } from '../api';
|
||||||
import type { Platform } from '../types';
|
import type { Platform } from '../types';
|
||||||
import { createTree, findOneTreeById, updateTree } from './api';
|
import { createTree, findOneTreeById, updateTree, findOneTreeByPlatformId } from './api';
|
||||||
import TressCard from './trees-card.vue';
|
import TressCard from './trees-card.vue';
|
||||||
import NodesCard from './nodes-card.vue';
|
import NodesCard from './nodes-card.vue';
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ export default defineComponent({
|
|||||||
TeleportContainer,
|
TeleportContainer,
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
|
const currentRoute = useRoute();
|
||||||
const canvas = ref<HTMLDivElement | null>(null);
|
const canvas = ref<HTMLDivElement | null>(null);
|
||||||
const graph = ref<Graph | null>(null);
|
const graph = ref<Graph | null>(null);
|
||||||
const currentZoom = ref<number>(1);
|
const currentZoom = ref<number>(1);
|
||||||
@@ -350,6 +352,14 @@ export default defineComponent({
|
|||||||
initGraph();
|
initGraph();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener('resize', handleResize);
|
||||||
console.log('节点挂载完成');
|
console.log('节点挂载完成');
|
||||||
|
|
||||||
|
if(currentRoute.query.platform){
|
||||||
|
findOneTreeByPlatformId(currentRoute.query.platform as number).then(r=> {
|
||||||
|
if(r.data){
|
||||||
|
handleSelectTree(r.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -198,8 +198,6 @@ export default defineComponent({
|
|||||||
const multiableParameters = ref<boolean>(false);
|
const multiableParameters = ref<boolean>(false);
|
||||||
const groupedParametersActiveTab = ref<number>(0);
|
const groupedParametersActiveTab = ref<number>(0);
|
||||||
|
|
||||||
console.error(platforms.value)
|
|
||||||
|
|
||||||
const createEmptyParameters = (): ElementParameter[] => {
|
const createEmptyParameters = (): ElementParameter[] => {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(JSON.stringify(currentElement.value?.parameters ?? [])) as ElementParameter[];
|
return JSON.parse(JSON.stringify(currentElement.value?.parameters ?? [])) as ElementParameter[];
|
||||||
|
|||||||
2
modeler/types/components.d.ts
vendored
2
modeler/types/components.d.ts
vendored
@@ -15,7 +15,6 @@ declare module 'vue' {
|
|||||||
ABadge: typeof import('ant-design-vue/es')['Badge']
|
ABadge: typeof import('ant-design-vue/es')['Badge']
|
||||||
AButton: typeof import('ant-design-vue/es')['Button']
|
AButton: typeof import('ant-design-vue/es')['Button']
|
||||||
ACard: typeof import('ant-design-vue/es')['Card']
|
ACard: typeof import('ant-design-vue/es')['Card']
|
||||||
ACascader: typeof import('ant-design-vue/es')['Cascader']
|
|
||||||
ACol: typeof import('ant-design-vue/es')['Col']
|
ACol: typeof import('ant-design-vue/es')['Col']
|
||||||
ACollapse: typeof import('ant-design-vue/es')['Collapse']
|
ACollapse: typeof import('ant-design-vue/es')['Collapse']
|
||||||
ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
|
ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
|
||||||
@@ -60,7 +59,6 @@ declare global {
|
|||||||
const ABadge: typeof import('ant-design-vue/es')['Badge']
|
const ABadge: typeof import('ant-design-vue/es')['Badge']
|
||||||
const AButton: typeof import('ant-design-vue/es')['Button']
|
const AButton: typeof import('ant-design-vue/es')['Button']
|
||||||
const ACard: typeof import('ant-design-vue/es')['Card']
|
const ACard: typeof import('ant-design-vue/es')['Card']
|
||||||
const ACascader: typeof import('ant-design-vue/es')['Cascader']
|
|
||||||
const ACol: typeof import('ant-design-vue/es')['Col']
|
const ACol: typeof import('ant-design-vue/es')['Col']
|
||||||
const ACollapse: typeof import('ant-design-vue/es')['Collapse']
|
const ACollapse: typeof import('ant-design-vue/es')['Collapse']
|
||||||
const ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
|
const ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
|
||||||
|
|||||||
Reference in New Issue
Block a user