Compare commits
2 Commits
7909ea8acb
...
e12c3c0302
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e12c3c0302 | ||
|
|
d8c429d000 |
@@ -7,6 +7,11 @@ import java.util.stream.Collectors;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.solution.common.core.domain.R;
|
import com.solution.common.core.domain.R;
|
||||||
|
import com.solution.system.domain.NodeTemplateEntity;
|
||||||
|
import com.solution.system.domain.Nodeparameter;
|
||||||
|
import com.solution.system.domain.Templateparameterdef;
|
||||||
|
import com.solution.system.service.INodeparameterService;
|
||||||
|
import com.solution.system.service.ITemplateparameterdefService;
|
||||||
import com.solution.web.controller.behaviour.vo.NodetemplateDTO;
|
import com.solution.web.controller.behaviour.vo.NodetemplateDTO;
|
||||||
import com.solution.web.controller.behaviour.vo.NodetemplateVO;
|
import com.solution.web.controller.behaviour.vo.NodetemplateVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -45,6 +50,12 @@ public class NodetemplateController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private INodetemplateService nodetemplateService;
|
private INodetemplateService nodetemplateService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private INodeparameterService nodeparameterService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ITemplateparameterdefService templateparameterdefService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询节点模板列表
|
* 查询节点模板列表
|
||||||
*/
|
*/
|
||||||
@@ -56,6 +67,25 @@ public class NodetemplateController extends BaseController {
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("节点模板列表")
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:nodetemplate:all')")
|
||||||
|
@GetMapping("/all")
|
||||||
|
public R<List<NodeTemplateEntity>> all() {
|
||||||
|
Nodetemplate nodetemplate = new Nodetemplate();
|
||||||
|
List<Nodetemplate> list = nodetemplateService.selectNodetemplateList(nodetemplate);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
return R.ok(null);
|
||||||
|
}
|
||||||
|
List<NodeTemplateEntity> entities = new ArrayList<>();
|
||||||
|
for (Nodetemplate template : list) {
|
||||||
|
Templateparameterdef def = new Templateparameterdef();
|
||||||
|
def.setTemplateId(template.getId());
|
||||||
|
List<Templateparameterdef> parameters = templateparameterdefService.selectTemplateparameterdefList(def);
|
||||||
|
entities.add(new NodeTemplateEntity(template, parameters));
|
||||||
|
}
|
||||||
|
return R.ok(entities);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("节点模板列表")
|
@ApiOperation("节点模板列表")
|
||||||
@PreAuthorize("@ss.hasPermi('system:nodetemplate:list')")
|
@PreAuthorize("@ss.hasPermi('system:nodetemplate:list')")
|
||||||
@GetMapping("/listAll")
|
@GetMapping("/listAll")
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.solution.system.domain;
|
||||||
|
/*
|
||||||
|
* 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 java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NodeTemplateEntity extends Nodetemplate {
|
||||||
|
|
||||||
|
private List<Templateparameterdef> parameters = new ArrayList<>();
|
||||||
|
|
||||||
|
public NodeTemplateEntity() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public NodeTemplateEntity(List<Templateparameterdef> parameters) {
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public NodeTemplateEntity(NodeTemplateEntity entity) {
|
||||||
|
super(entity);
|
||||||
|
this.parameters = entity.getParameters();
|
||||||
|
}
|
||||||
|
|
||||||
|
public NodeTemplateEntity(Nodetemplate entity, List<Templateparameterdef> parameters) {
|
||||||
|
super(entity);
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Templateparameterdef> getParameters() {
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParameters(List<Templateparameterdef> parameters) {
|
||||||
|
this.parameters = parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,7 +42,20 @@ public class Nodetemplate extends BaseEntity
|
|||||||
@Excel(name = "模版类型,节点模版或者条件判断,例如“node”,precondition“")
|
@Excel(name = "模版类型,节点模版或者条件判断,例如“node”,precondition“")
|
||||||
private String templeteType;
|
private String templeteType;
|
||||||
|
|
||||||
public void setId(Long id)
|
public Nodetemplate() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Nodetemplate(Nodetemplate template) {
|
||||||
|
this.id = template.id;
|
||||||
|
this.type = template.type;
|
||||||
|
this.name = template.name;
|
||||||
|
this.logicHandler = template.logicHandler;
|
||||||
|
this.description = template.description;
|
||||||
|
this.englishName = template.englishName;
|
||||||
|
this.templeteType = template.templeteType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -938,7 +938,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ant-collapse-content-box {
|
.ant-collapse-content-box {
|
||||||
max-height: 38vh;
|
max-height: 37vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const req = HttpRequestClient.create<BasicResponse>({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const findNodeTemplates = (): Promise<NodeTemplatesResponse> => {
|
export const findNodeTemplates = (): Promise<NodeTemplatesResponse> => {
|
||||||
return req.get('/system/nodetemplate/listAll');
|
return req.get('/system/nodetemplate/all');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const findTreesByQuery = (query: Partial<BehaviorTree> = {}): Promise<BehaviorTreePageResponse> => {
|
export const findTreesByQuery = (query: Partial<BehaviorTree> = {}): Promise<BehaviorTreePageResponse> => {
|
||||||
|
|||||||
@@ -81,9 +81,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
const activeKey = ref<number>(1);
|
const activeKey = ref<number>(1);
|
||||||
const templateData = ref<NodeTemplate[]>([]);
|
const templateData = ref<NodeTemplate[]>([]);
|
||||||
const isDraggingOver = ref(false);
|
const isDraggingOver = ref<boolean>(false);
|
||||||
const draggedNodeData = ref<NodeTemplate | null>(null);
|
const draggedNodeData = ref<NodeTemplate | null>(null);
|
||||||
|
|
||||||
// 控制节点
|
// 控制节点
|
||||||
const controlTemplates = ref<NodeTemplate[]>([]);
|
const controlTemplates = ref<NodeTemplate[]>([]);
|
||||||
// 条件节点
|
// 条件节点
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<p>说明: {{item.description}}</p>
|
<p>说明: {{item.description}}</p>
|
||||||
</template>
|
</template>
|
||||||
<a-list-item @click="()=> handleSelect(item)">
|
<a-list-item @click="()=> handleSelect(item)">
|
||||||
{{ substring(item.name, 25) }}
|
{{ substring(item.name, 15) }}
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,6 +9,16 @@
|
|||||||
|
|
||||||
import type { ApiDataResponse, NullableString } from '@/types';
|
import type { ApiDataResponse, NullableString } from '@/types';
|
||||||
|
|
||||||
|
export interface NodeTemplateParameter {
|
||||||
|
id: number,
|
||||||
|
templateId: number,
|
||||||
|
paramKey: NullableString,
|
||||||
|
dataType: NullableString,
|
||||||
|
defaultValue: NullableString,
|
||||||
|
description: NullableString,
|
||||||
|
templateType: NullableString,
|
||||||
|
}
|
||||||
|
|
||||||
export interface NodeTemplate {
|
export interface NodeTemplate {
|
||||||
id: number;
|
id: number;
|
||||||
name: NullableString;
|
name: NullableString;
|
||||||
@@ -17,6 +27,7 @@ export interface NodeTemplate {
|
|||||||
description: NullableString;
|
description: NullableString;
|
||||||
templeteType: NullableString;
|
templeteType: NullableString;
|
||||||
englishName: NullableString;
|
englishName: NullableString;
|
||||||
|
parameters: NodeTemplateParameter[],
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NodeTemplatesResponse extends ApiDataResponse<NodeTemplate[]> {
|
export interface NodeTemplatesResponse extends ApiDataResponse<NodeTemplate[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user