feat: 单节点执行
This commit is contained in:
parent
f59998d520
commit
67fa6342a2
@ -1,55 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 发布流程
|
||||
export function flowDeploy(data) {
|
||||
return request({
|
||||
url: '/flow/publish',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowExecute(data) {
|
||||
return request({
|
||||
url: '/flow/execute',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowExecuteTrial(data) {
|
||||
return request({
|
||||
url: '/flow/executeTrial',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowView(data) {
|
||||
return request({
|
||||
url: '/flow/view',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowPause(instId) {
|
||||
return request({
|
||||
url: `/flow/pause/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function flowResume(instId) {
|
||||
return request({
|
||||
url: `/flow/resume/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function flowStop(instId) {
|
||||
return request({
|
||||
url: `/flow/stop/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 发布流程
|
||||
export function flowDeploy(data) {
|
||||
return request({
|
||||
url: '/flow/publish',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowExecute(data) {
|
||||
return request({
|
||||
url: '/flow/execute',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowAction(data) {
|
||||
return request({
|
||||
url: '/flow/action',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowExecuteTrial(data) {
|
||||
return request({
|
||||
url: '/flow/executeTrial',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowView(data) {
|
||||
return request({
|
||||
url: '/flow/view',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function flowPause(instId) {
|
||||
return request({
|
||||
url: `/flow/pause/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function flowResume(instId) {
|
||||
return request({
|
||||
url: `/flow/resume/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function flowStop(instId) {
|
||||
return request({
|
||||
url: `/flow/stop/${instId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@ -32,13 +32,25 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
content="执行"
|
||||
placement="top"
|
||||
>
|
||||
<el-button v-if="nodeType && nodeType !=='NONE'" circle @click="execute">
|
||||
<el-icon>
|
||||
<VideoPlay />
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
:content="zoomState ? '缩小' : '放大'"
|
||||
placement="top"
|
||||
>
|
||||
<el-button v-if="showZoom" circle size="small" @click="zoom">
|
||||
<el-button v-if="showZoom" circle @click="zoom">
|
||||
<el-icon>
|
||||
<ZoomOut v-if="zoomState" />
|
||||
<ZoomIn v-else />
|
||||
@ -51,7 +63,7 @@
|
||||
content="删除"
|
||||
placement="top"
|
||||
>
|
||||
<el-button circle size="small" @click="deleteNode">
|
||||
<el-button circle @click="deleteNode">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
@ -62,7 +74,7 @@
|
||||
</template>
|
||||
<script setup lang="js">
|
||||
import { ref } from 'vue'
|
||||
import { EditPen, Select, CloseBold, Delete, ZoomOut, ZoomIn } from '@element-plus/icons-vue'
|
||||
import { EditPen, Select, CloseBold, Delete, ZoomOut, ZoomIn, VideoPlay } from '@element-plus/icons-vue'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
@ -144,6 +156,15 @@ const deleteNode = () => {
|
||||
const zoom = () => {
|
||||
emits('zoom', !props.zoomState)
|
||||
}
|
||||
|
||||
const execute = () => {
|
||||
const myEvent = new CustomEvent('singleNodeExecution', {
|
||||
bubbles: false, // 是否冒泡(默认 false)
|
||||
cancelable: false, // 是否可被 preventDefault() 取消(默认 false)
|
||||
detail: { ...props.nodeProperties } // 自定义数据(任意类型,通过 event.detail 读取)
|
||||
});
|
||||
document.dispatchEvent(myEvent);
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.title__container {
|
||||
@ -204,6 +225,7 @@ const zoom = () => {
|
||||
|
||||
.el-button {
|
||||
border: none;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,6 +125,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "在获取相机照片时,需要先启动相机",
|
||||
action: 'CAMERA_START',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -136,6 +137,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "获取相机拍摄的照片",
|
||||
action: 'CAMERA_GETRGBIMAGE',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -148,6 +150,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "获取相机照片后,关闭该相机",
|
||||
action: 'CAMERA_STOP',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -164,6 +167,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "开启摄像头,并开始录像",
|
||||
action: 'CAMERA_RECORDING_START',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -175,6 +179,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "停止录像,并关闭摄像头",
|
||||
action: 'CAMERA_RECORDING_STOP',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -259,6 +264,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "用于启动麦克风的节点",
|
||||
action: 'MICROPHONE_START',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -270,6 +276,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "用于停止麦克风的节点",
|
||||
action: 'MICROPHONE_START',
|
||||
nodeType: 'EDGE',
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", componentType: 'select', selectOptions: deviceOptions(), disabled: true }
|
||||
],
|
||||
@ -297,6 +304,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "用于获取触控坐标的节点",
|
||||
action: 'TOUCH_COORDINATES',
|
||||
nodeType: "LLM",
|
||||
nodeParams: [
|
||||
{ name: "targetFeature", type: "input", input: "运动模式", disabled: true },
|
||||
{ name: "manufacturer", type: "input", input: "xiaomi", disabled: true },
|
||||
@ -310,6 +318,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "将指令文本(text)处理合成语音,输出语音路径(audioPath)",
|
||||
action: 'GENERATE_ADVANCED_AUDIO',
|
||||
nodeType: "LLM",
|
||||
outputType: 'json',
|
||||
nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }],
|
||||
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
||||
@ -319,6 +328,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "意图识别,输出类型(type) 1: 语音交互 2: 触控交互 3: 闲聊 4: 知识问答",
|
||||
action: 'INTENT_RECOGNITION',
|
||||
nodeType: "LLM",
|
||||
outputType: 'json',
|
||||
nodeParams: [{ name: 'text', type: "input", input: "", disabled: true }],
|
||||
outputParams: [{ name: 'type', type: 'string', desc: '1:语音交互 2:触控交互 3: 闲聊 4:知识问答', disabled: true}]
|
||||
@ -347,6 +357,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "唤醒语料处理,输入唤醒语料(wakeCorpus),输出语音路径(audioPath)",
|
||||
action: 'VI_CORPUS_WAKE',
|
||||
nodeType: "EDGE",
|
||||
outputType: 'json',
|
||||
nodeParams: [{ name: 'wakeCorpus', type: "input", input: "", disabled: true }],
|
||||
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
||||
@ -357,6 +368,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "测试语料-单次对话语料处理,输入单次对话语料(testCorpus),输出语音路径(audioPath)",
|
||||
action: 'VI_CORPUS_SINGLE',
|
||||
nodeType: "EDGE",
|
||||
outputType: 'json',
|
||||
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
|
||||
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
||||
@ -367,6 +379,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "测试语料-连续对话语料处理,输入连续对话语料(testCorpus),输出语音路径(audioPath)",
|
||||
action: 'VI_CORPUS_CONTINUOUS',
|
||||
nodeType: "EDGE",
|
||||
outputType: 'json',
|
||||
nodeParams: [{ name: 'testCorpus', type: "input", input: "", disabled: true }],
|
||||
outputParams: [{ name: 'audioPath', type: 'string', desc: '语音路径', disabled: true}]
|
||||
@ -377,6 +390,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "用于播放语料的节点,需要输入语音路径(audioPath)和播放语音的设备id(deviceId)",
|
||||
action: 'VI_PLAY_CORPUS',
|
||||
nodeType: "EDGE",
|
||||
outputType: 'json',
|
||||
nodeParams: [
|
||||
{ name: 'audioPath', type: "input", input: "", disabled: true },
|
||||
@ -394,6 +408,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "去触控坐标的点位",
|
||||
action: 'TOUCH',
|
||||
nodeType: "EDGE",
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", disabled: true },
|
||||
{ name: "touchParams", type: "input", input: "", disabled: true }
|
||||
@ -406,6 +421,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "控制机器人说话",
|
||||
action: 'BIO_HEAD_SPEAK_START',
|
||||
nodeType: "EDGE",
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", disabled: true }
|
||||
],
|
||||
@ -417,6 +433,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "停止机器人说话",
|
||||
action: 'BIO_HEAD_SPEAK_STOP',
|
||||
nodeType: "EDGE",
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", disabled: true }
|
||||
],
|
||||
@ -428,6 +445,7 @@ export const collapseList = [
|
||||
type: "serviceNode",
|
||||
desc: "控制机器人的面部表情",
|
||||
action: 'BIO_HEAD_SPECIAL_EXPRESSION',
|
||||
nodeType: "EDGE",
|
||||
nodeParams: [
|
||||
{ name: "deviceId", type: "input", input: "", disabled: true },
|
||||
{ name: "expressKey", type: "input",componentType: 'select', selectOptions: expressOptions(), disabled: true },
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,7 @@
|
||||
:icon="props.properties.icon"
|
||||
:nodeId="props.model.id"
|
||||
:nodeProperties="props.properties"
|
||||
:nodeType="props.properties.nodeType || 'NONE'"
|
||||
:nodeName="props.properties.name"
|
||||
:nodeDesc="props.properties.desc"
|
||||
:zoom-state="nodeZoom"
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
:content="nodeZoom ? '缩小' : '放大'"
|
||||
placement="top"
|
||||
>
|
||||
<el-button circle size="small" @click="zoom">
|
||||
<el-button circle @click="zoom">
|
||||
<el-icon>
|
||||
<ZoomOut v-if="nodeZoom" />
|
||||
<ZoomIn v-else />
|
||||
@ -262,6 +262,13 @@ defineExpose({
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
.el-button {
|
||||
border: none;
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.subTitle {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user