feat: 清除上一次运行结果
This commit is contained in:
parent
8c1820e1a6
commit
783e54bab0
@ -1,51 +1,57 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="state__container" :class="`nodeState-${props.state}`">
|
<div class="state__container" :class="`nodeState-${props.state}`">
|
||||||
<div class="context">
|
<div class="context" v-show="showState !== 'NORMAL'">
|
||||||
<div class="state">
|
<div class="state">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<SuccessFilled v-if="props.state === 'SUCCESS'" />
|
<SuccessFilled v-if="props.state === 'SUCCESS'" />
|
||||||
<CircleCloseFilled v-if="['FAILED', 'STOPPED'].includes(props.state)" />
|
<CircleCloseFilled v-if="['FAILED', 'STOPPED'].includes(props.state)" />
|
||||||
<VideoPause v-if="props.state === 'PAUSED'" />
|
<VideoPause v-if="props.state === 'PAUSED'" />
|
||||||
<Loading v-if="props.state === 'RUNNING'" />
|
<Loading v-if="props.state === 'RUNNING'" />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<div class="text">{{ getStateText() }}</div>
|
<div class="text">{{ getStateText() }}</div>
|
||||||
<el-tag :type="props.state === 'SUCCESS' ? 'success' : 'danger'">
|
<el-tag :type="props.state === 'SUCCESS' ? 'success' : 'danger'">
|
||||||
{{ props.runtimes }}ms
|
{{ props.runtimes }}ms
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
|
||||||
<div class="resultText" v-popover="popoverRef" @click="popoverVisible = !popoverVisible">{{ popoverVisible ? '隐藏结果' : '展示结果' }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
class="resultText"
|
||||||
|
v-popover="popoverRef"
|
||||||
|
@click="popoverVisible = !popoverVisible"
|
||||||
|
>
|
||||||
|
{{ popoverVisible ? "隐藏结果" : "展示结果" }}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<el-popover
|
|
||||||
ref="popoverRef"
|
|
||||||
virtual-triggering
|
|
||||||
persistent
|
|
||||||
placement="right-start"
|
|
||||||
:visible="popoverVisible"
|
|
||||||
:teleported="false"
|
|
||||||
popper-class="popover__container"
|
|
||||||
>
|
|
||||||
<template #default>
|
|
||||||
<div class="params__container input">
|
|
||||||
<div class="paramsTitle">输入</div>
|
|
||||||
<div>
|
|
||||||
<slot name="input"></slot>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="params__container output" v-if="slots.output">
|
|
||||||
<div class="paramsTitle">输出</div>
|
|
||||||
<div>
|
|
||||||
<slot name="output"></slot>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-popover>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-popover
|
||||||
|
ref="popoverRef"
|
||||||
|
virtual-triggering
|
||||||
|
persistent
|
||||||
|
placement="right-start"
|
||||||
|
:visible="popoverVisible"
|
||||||
|
:teleported="false"
|
||||||
|
popper-class="popover__container"
|
||||||
|
>
|
||||||
|
<template #default>
|
||||||
|
<div class="params__container input">
|
||||||
|
<div class="paramsTitle">输入</div>
|
||||||
|
<div>
|
||||||
|
<slot name="input"></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="params__container output" v-if="slots.output">
|
||||||
|
<div class="paramsTitle">输出</div>
|
||||||
|
<div>
|
||||||
|
<slot name="output"></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="js">
|
<script setup lang="js">
|
||||||
import { ref, useSlots } from 'vue'
|
import { ref, useSlots, watch } from 'vue'
|
||||||
import { SuccessFilled, CircleCloseFilled, Loading, VideoPause } from '@element-plus/icons-vue'
|
import { SuccessFilled, CircleCloseFilled, Loading, VideoPause } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -56,7 +62,7 @@ const props = defineProps({
|
|||||||
runtimes: {
|
runtimes: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const slots = useSlots()
|
const slots = useSlots()
|
||||||
@ -76,83 +82,95 @@ const getStateText = () => {
|
|||||||
const popoverRef = ref();
|
const popoverRef = ref();
|
||||||
const popoverVisible = ref(false);
|
const popoverVisible = ref(false);
|
||||||
|
|
||||||
|
const showState = ref('NORMAL')
|
||||||
|
|
||||||
|
watch(() => props.state, (newVal) => {
|
||||||
|
showState.value = newVal;
|
||||||
|
});
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
showState.value = 'NORMAL';
|
||||||
|
popoverVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.state__container {
|
.state__container {
|
||||||
display: none;
|
display: none;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
|
|
||||||
.context {
|
.context {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
.state {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
padding: 4px;
|
|
||||||
font-size: 12px;
|
|
||||||
|
|
||||||
.state {
|
.text {
|
||||||
display: flex;
|
margin: 0 8px;
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
margin: 0 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.resultText {
|
|
||||||
color: #1664ff;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.nodeState-SUCCESS {
|
.resultText {
|
||||||
display: block;
|
color: #1664ff;
|
||||||
background-color: #eef9f1;
|
cursor: pointer;
|
||||||
|
|
||||||
.el-icon {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #309256;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nodeState-FAILED {
|
.nodeState-SUCCESS {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #fdf5f5;
|
background-color: #eef9f1;
|
||||||
|
|
||||||
.el-icon {
|
.el-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #ee3f38;
|
color: #309256;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nodeState-STOPPED {
|
.nodeState-FAILED {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #fdf5f5;
|
background-color: #fdf5f5;
|
||||||
|
|
||||||
.el-icon {
|
.el-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #ee3f38;
|
color: #ee3f38;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nodeState-PAUSED {
|
.nodeState-STOPPED {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #cbcbcb;
|
background-color: #fdf5f5;
|
||||||
|
|
||||||
.el-icon {
|
.el-icon {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #666;
|
color: #ee3f38;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.nodeState-RUNNING {
|
.nodeState-PAUSED {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #f4f7ff;
|
background-color: #cbcbcb;
|
||||||
|
|
||||||
.el-icon {
|
.el-icon {
|
||||||
color: #68a2e4;
|
font-size: 16px;
|
||||||
font-size: 16px;
|
color: #666;
|
||||||
animation: rotateAnimation 2s linear infinite;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.nodeState-RUNNING {
|
||||||
|
display: block;
|
||||||
|
background-color: #f4f7ff;
|
||||||
|
|
||||||
|
.el-icon {
|
||||||
|
color: #68a2e4;
|
||||||
|
font-size: 16px;
|
||||||
|
animation: rotateAnimation 2s linear infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -8,21 +8,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btn__container">
|
<div class="btn__container">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
|
<el-button v-if="['testRunError', 'testRunFinish', 'stop'].includes(flowState)" @click="clearRun">清除上一次运行结果</el-button>
|
||||||
<el-button @click="group">分组</el-button>
|
<el-button @click="group">分组</el-button>
|
||||||
<el-button v-if="flowState !== 'testRunning'" @click="testRun"
|
<el-button v-if="flowState !== 'testRunning'" @click="testRun">试运行</el-button>
|
||||||
>试运行</el-button
|
<el-button v-if="flowState === 'testRunning'" @click="flowPauseFn">暂停</el-button>
|
||||||
>
|
<el-button v-if="flowState === 'pause'" @click="flowResumeFn">恢复</el-button>
|
||||||
<el-button v-if="flowState === 'testRunning'" @click="flowPauseFn"
|
<el-button v-if="['testRunning', 'pause'].includes(flowState)" @click="flowStopFn">终止</el-button>
|
||||||
>暂停</el-button
|
|
||||||
>
|
|
||||||
<el-button v-if="flowState === 'pause'" @click="flowResumeFn"
|
|
||||||
>恢复</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-if="['testRunning', 'pause'].includes(flowState)"
|
|
||||||
@click="flowStopFn"
|
|
||||||
>终止</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
@ -34,9 +25,7 @@
|
|||||||
>
|
>
|
||||||
<el-button type="primary" :disabled="true">发布</el-button>
|
<el-button type="primary" :disabled="true">发布</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button v-else @click="deployFlow" type="primary"
|
<el-button v-else @click="deployFlow" type="primary">发布</el-button>
|
||||||
>发布</el-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<el-popover
|
<el-popover
|
||||||
:width="260"
|
:width="260"
|
||||||
@ -123,9 +112,7 @@
|
|||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '参数名' : ''"
|
:label="index === 0 ? '参数名' : ''"
|
||||||
:prop="`nodeParams.${index}.name`"
|
:prop="`nodeParams.${index}.name`"
|
||||||
:rules="[
|
:rules="[{ required: true, message: '请输入参数名', trigger: 'blur' }]"
|
||||||
{ required: true, message: '请输入参数名', trigger: 'blur' },
|
|
||||||
]"
|
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
:disabled="property?.disabled || false"
|
:disabled="property?.disabled || false"
|
||||||
@ -137,9 +124,7 @@
|
|||||||
<el-form-item
|
<el-form-item
|
||||||
:label="index === 0 ? '参数值' : ''"
|
:label="index === 0 ? '参数值' : ''"
|
||||||
:prop="`nodeParams.${index}.input`"
|
:prop="`nodeParams.${index}.input`"
|
||||||
:rules="[
|
:rules="[{ required: true, message: '请输入参数值', trigger: 'blur' }]"
|
||||||
{ required: true, message: '请输入参数值', trigger: 'blur' },
|
|
||||||
]"
|
|
||||||
>
|
>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-if="property.componentType === 'number'"
|
v-if="property.componentType === 'number'"
|
||||||
@ -176,9 +161,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button @click="visible = false">取消</el-button>
|
<el-button @click="visible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="execute">
|
<el-button type="primary" @click="execute"> 确定 </el-button>
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -203,7 +186,7 @@ import {
|
|||||||
flowPause,
|
flowPause,
|
||||||
flowResume,
|
flowResume,
|
||||||
flowStop,
|
flowStop,
|
||||||
flowAction
|
flowAction,
|
||||||
} from "@/api/device/flow";
|
} from "@/api/device/flow";
|
||||||
import { getDetect } from "@/api/test/detect";
|
import { getDetect } from "@/api/test/detect";
|
||||||
import { Location } from "@element-plus/icons-vue";
|
import { Location } from "@element-plus/icons-vue";
|
||||||
@ -233,9 +216,11 @@ const drop = (e) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!["selectArea", 'branch', 'stopLoop', 'subStart', 'subEnd'].includes(newNode.type)) {
|
if (
|
||||||
|
!["selectArea", "branch", "stopLoop", "subStart", "subEnd"].includes(newNode.type)
|
||||||
|
) {
|
||||||
showParamsDrawer.value = true;
|
showParamsDrawer.value = true;
|
||||||
console.log('newNode', newNode)
|
console.log("newNode", newNode);
|
||||||
paramsDrawerData.value = newNode;
|
paramsDrawerData.value = newNode;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -444,8 +429,7 @@ const loopFlowView = async (instId, taskId = null) => {
|
|||||||
} else {
|
} else {
|
||||||
if (!flowInfoData.value.isLog) {
|
if (!flowInfoData.value.isLog) {
|
||||||
if (["PAUSED", "STOPPED"].includes(arr[arr.length - 1]?.status)) {
|
if (["PAUSED", "STOPPED"].includes(arr[arr.length - 1]?.status)) {
|
||||||
flowState.value =
|
flowState.value = arr[arr.length - 1]?.status === "PAUSED" ? "pause" : "stop";
|
||||||
arr[arr.length - 1]?.status === "PAUSED" ? "pause" : "stop";
|
|
||||||
} else {
|
} else {
|
||||||
flowState.value = "testRunError";
|
flowState.value = "testRunError";
|
||||||
flowStore.updateDisableForm(false);
|
flowStore.updateDisableForm(false);
|
||||||
@ -562,10 +546,7 @@ const initFlow = () => {
|
|||||||
keys: ["backspace", "delete"], // 覆盖删除键
|
keys: ["backspace", "delete"], // 覆盖删除键
|
||||||
callback: () => {
|
callback: () => {
|
||||||
const activeElem = document.activeElement;
|
const activeElem = document.activeElement;
|
||||||
if (
|
if (activeElem.tagName === "INPUT" || activeElem.tagName === "TEXTAREA") {
|
||||||
activeElem.tagName === "INPUT" ||
|
|
||||||
activeElem.tagName === "TEXTAREA"
|
|
||||||
) {
|
|
||||||
return; // 不处理输入框内的删除
|
return; // 不处理输入框内的删除
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -657,10 +638,12 @@ const initFlow = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
lf.on("node:dbclick", ({ data, e }) => {
|
lf.on("node:dbclick", ({ data, e }) => {
|
||||||
if (["selectArea", 'branch', 'stopLoop', 'subStart', 'subEnd'].includes(data.type)) {
|
if (
|
||||||
|
["selectArea", "branch", "stopLoop", "subStart", "subEnd"].includes(data.type)
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('data', data)
|
console.log("data", data);
|
||||||
showParamsDrawer.value = true;
|
showParamsDrawer.value = true;
|
||||||
paramsDrawerData.value = data;
|
paramsDrawerData.value = data;
|
||||||
});
|
});
|
||||||
@ -734,55 +717,65 @@ const fitView = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const nodeName = ref("");
|
const nodeName = ref("");
|
||||||
const visible = ref(false)
|
const visible = ref(false);
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
nodeParams: [],
|
nodeParams: [],
|
||||||
})
|
});
|
||||||
const rules = reactive({})
|
const rules = reactive({});
|
||||||
const executeForm = ref()
|
const executeForm = ref();
|
||||||
const nodeAction = ref('')
|
const nodeAction = ref("");
|
||||||
|
|
||||||
const singleNodeExecution = (e) => {
|
const singleNodeExecution = (e) => {
|
||||||
const { name, nodeType, nodeParams, action } = e.detail;
|
const { name, nodeType, nodeParams, action } = e.detail;
|
||||||
nodeName.value = name;
|
nodeName.value = name;
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nodeAction.value = action
|
nodeAction.value = action;
|
||||||
if (nodeType === 'EDGE') {
|
if (nodeType === "EDGE") {
|
||||||
formData.nodeParams = [
|
formData.nodeParams = [
|
||||||
{
|
{
|
||||||
disabled: true,
|
disabled: true,
|
||||||
input: "",
|
input: "",
|
||||||
name: "terminalId",
|
name: "terminalId",
|
||||||
type: "input"
|
type: "input",
|
||||||
},
|
},
|
||||||
...nodeParams
|
...nodeParams,
|
||||||
]
|
];
|
||||||
} else {
|
} else {
|
||||||
formData.nodeParams = nodeParams
|
formData.nodeParams = nodeParams;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const execute = async () => {
|
const execute = async () => {
|
||||||
const result = await executeForm.value.validate();
|
const result = await executeForm.value.validate();
|
||||||
if (result) {
|
if (result) {
|
||||||
const obj = {}
|
const obj = {};
|
||||||
formData.nodeParams.forEach(item => {
|
formData.nodeParams.forEach((item) => {
|
||||||
obj[item.name] = item.input
|
obj[item.name] = item.input;
|
||||||
})
|
});
|
||||||
const res = await flowAction({
|
const res = await flowAction({
|
||||||
action: nodeAction.value,
|
action: nodeAction.value,
|
||||||
payload: obj
|
payload: obj,
|
||||||
})
|
});
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
ElMessage.success('执行成功')
|
ElMessage.success("执行成功");
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const showParamsDrawer = ref(false);
|
const showParamsDrawer = ref(false);
|
||||||
const paramsDrawerData = ref({})
|
const paramsDrawerData = ref({});
|
||||||
|
|
||||||
|
const clearRun = () => {
|
||||||
|
const { nodes } = lf.getGraphData();
|
||||||
|
nodes.forEach((item) => {
|
||||||
|
const node = lf.getNodeModelById(item.id);
|
||||||
|
if (node.closePopover) {
|
||||||
|
node.closePopover();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
justLoadFlow();
|
justLoadFlow();
|
||||||
@ -876,8 +869,6 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.node-relationship-network-popover {
|
.node-relationship-network-popover {
|
||||||
@ -903,16 +894,16 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog {
|
.el-dialog {
|
||||||
.el-input {
|
.el-input {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-select {
|
.el-select {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-textarea {
|
.el-textarea {
|
||||||
width: 200px
|
width: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -144,16 +144,10 @@ class ServiceNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
closePopover() {
|
||||||
async validateForm() {
|
this.componentInstance.closePopover()
|
||||||
const result = this.componentInstance.validateForm()
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// setCustomProperties() {
|
|
||||||
// this.componentInstance.setNodeProperties()
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -78,6 +78,14 @@ const inputJsonData = ref({});
|
|||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
const errorInfoData = ref('');
|
const errorInfoData = ref('');
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
@ -124,6 +132,8 @@ onUnmounted(() => {
|
|||||||
emitter.off("setProperties");
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -142,6 +142,10 @@ class StartNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closePopover() {
|
||||||
|
this.componentInstance.closePopover()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -40,6 +40,14 @@ const runtimes = ref(0);
|
|||||||
const inputJsonData = ref({});
|
const inputJsonData = ref({});
|
||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
if (data.nodeId === props.model.id) {
|
if (data.nodeId === props.model.id) {
|
||||||
@ -87,6 +95,8 @@ onUnmounted(() => {
|
|||||||
emitter.off("setProperties");
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -144,6 +144,10 @@ class CodeNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closePopover() {
|
||||||
|
this.componentInstance.closePopover()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -74,6 +74,15 @@ const inputJsonData = ref({});
|
|||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
const errorInfoData = ref('');
|
const errorInfoData = ref('');
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
if (data.nodeId === props.model.id) {
|
if (data.nodeId === props.model.id) {
|
||||||
@ -119,6 +128,7 @@ onUnmounted(() => {
|
|||||||
emitter.off("setProperties");
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -46,12 +46,6 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emits = defineEmits(["contentChange"]);
|
const emits = defineEmits(["contentChange"]);
|
||||||
|
|
||||||
|
|
||||||
const formData = reactive({
|
|
||||||
nodeParams: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
const setNodeName = (name) => {
|
const setNodeName = (name) => {
|
||||||
const properties = lf.getProperties(props.model.id);
|
const properties = lf.getProperties(props.model.id);
|
||||||
lf.setProperties(props.model.id, {
|
lf.setProperties(props.model.id, {
|
||||||
@ -66,6 +60,14 @@ const runtimes = ref(0);
|
|||||||
const inputJsonData = ref({});
|
const inputJsonData = ref({});
|
||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
if (data.nodeId === props.model.id) {
|
if (data.nodeId === props.model.id) {
|
||||||
@ -96,13 +98,22 @@ onMounted(() => {
|
|||||||
emits("contentChange");
|
emits("contentChange");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
emitter.on("setProperties", (data) => {
|
||||||
|
if (data.id === props.model.id) {
|
||||||
|
emits("contentChange");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
emitter.off("changeNodeState");
|
emitter.off("changeNodeState");
|
||||||
emitter.off("contentChange");
|
emitter.off("contentChange");
|
||||||
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -150,9 +150,9 @@ class CurrentLoopNodeHtmlModel extends HtmlNodeModel {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// setCustomProperties() {
|
closePopover() {
|
||||||
// this.componentInstance.setNodeProperties()
|
this.componentInstance.closePopover()
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
|
|||||||
@ -144,15 +144,9 @@ class HttpNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
closePopover() {
|
||||||
// async validateForm() {
|
this.componentInstance.closePopover()
|
||||||
// const result = this.componentInstance.validateForm()
|
}
|
||||||
// return result
|
|
||||||
// }
|
|
||||||
|
|
||||||
// setCustomProperties() {
|
|
||||||
// this.componentInstance.setNodeProperties()
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -77,6 +77,13 @@ const inputJsonData = ref({});
|
|||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
const errorInfoData = ref('');
|
const errorInfoData = ref('');
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
@ -122,6 +129,8 @@ onUnmounted(() => {
|
|||||||
emitter.off("contentChange");
|
emitter.off("contentChange");
|
||||||
emitter.off("setProperties");
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -144,14 +144,8 @@ class SleepNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
closePopover() {
|
||||||
async validateForm() {
|
this.componentInstance.closePopover()
|
||||||
const result = this.componentInstance.validateForm()
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
setCustomProperties() {
|
|
||||||
this.componentInstance.setNodeProperties()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" :class="props.model.id">
|
<div class="node__container" :class="props.model.id">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted } from "vue";
|
import { ref, onMounted, onUnmounted } from "vue";
|
||||||
import NodeTitle from "../../components/NodeTitle.vue";
|
import NodeTitle from "../../components/NodeTitle.vue";
|
||||||
import NodeState from "../../components/NodeState.vue";
|
import NodeState from "../../components/NodeState.vue";
|
||||||
import "vue3-json-viewer/dist/index.css";
|
import "vue3-json-viewer/dist/index.css";
|
||||||
@ -61,6 +61,14 @@ const runtimes = ref(0);
|
|||||||
const inputJsonData = ref({});
|
const inputJsonData = ref({});
|
||||||
const outputJsonData = ref({});
|
const outputJsonData = ref({});
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emitter.on("changeNodeState", (data) => {
|
emitter.on("changeNodeState", (data) => {
|
||||||
if (data.nodeId === props.model.id) {
|
if (data.nodeId === props.model.id) {
|
||||||
@ -105,6 +113,8 @@ onUnmounted(() => {
|
|||||||
emitter.off("setProperties");
|
emitter.off("setProperties");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -133,23 +133,6 @@ class StopLoopHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
|
||||||
async validateForm() {
|
|
||||||
if (this.componentInstance && this.componentInstance.validate) {
|
|
||||||
try {
|
|
||||||
const result = await this.componentInstance.validate();
|
|
||||||
if (result) {
|
|
||||||
return { valid: true, message: "验证通过" };
|
|
||||||
} else {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { valid: true, message: "无验证方法" };
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -128,23 +128,6 @@ class SubEndNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
|
||||||
async validateForm() {
|
|
||||||
if (this.componentInstance && this.componentInstance.validate) {
|
|
||||||
try {
|
|
||||||
const result = await this.componentInstance.validate();
|
|
||||||
if (result) {
|
|
||||||
return { valid: true, message: "验证通过" };
|
|
||||||
} else {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { valid: true, message: "无验证方法" };
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -128,23 +128,6 @@ class SubStartNodeHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证表单
|
|
||||||
async validateForm() {
|
|
||||||
if (this.componentInstance && this.componentInstance.validate) {
|
|
||||||
try {
|
|
||||||
const result = await this.componentInstance.validate();
|
|
||||||
if (result) {
|
|
||||||
return { valid: true, message: "验证通过" };
|
|
||||||
} else {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
return { valid: false, message: "验证失败" };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { valid: true, message: "无验证方法" };
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置节点属性
|
* 设置节点属性
|
||||||
* 包括宽度、高度、文本编辑属性等
|
* 包括宽度、高度、文本编辑属性等
|
||||||
|
|||||||
@ -211,6 +211,10 @@ class SwitchHtmlModel extends HtmlNodeModel {
|
|||||||
this.componentInstance = instance;
|
this.componentInstance = instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closePopover() {
|
||||||
|
this.componentInstance.closePopover()
|
||||||
|
}
|
||||||
|
|
||||||
// 验证表单
|
// 验证表单
|
||||||
async validateForm() {
|
async validateForm() {
|
||||||
if (this.componentInstance && this.componentInstance.validate) {
|
if (this.componentInstance && this.componentInstance.validate) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="node__container" ref="switchRef" @mouseleave="setNodeProperties">
|
<div class="node__container" ref="switchRef" @mouseleave="setNodeProperties">
|
||||||
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes">
|
<NodeState :state="nodeOperatingStatus" :runtimes="runtimes" ref="nodeStateRef">
|
||||||
<template #input>
|
<template #input>
|
||||||
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
<JsonViewer :value="inputJsonData" copyable boxed sort theme="light" />
|
||||||
</template>
|
</template>
|
||||||
@ -407,6 +407,14 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const nodeStateRef = ref(null);
|
||||||
|
|
||||||
|
const closePopover = () => {
|
||||||
|
if (nodeStateRef.value) {
|
||||||
|
nodeStateRef.value.closePopover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
emits("addAnchor", 280, "".concat(props.model.id, "_else"));
|
emits("addAnchor", 280, "".concat(props.model.id, "_else"));
|
||||||
|
|
||||||
@ -450,6 +458,8 @@ onUnmounted(() => {
|
|||||||
emitter.off("changeNodeState");
|
emitter.off("changeNodeState");
|
||||||
emitter.off("contentChange");
|
emitter.off("contentChange");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ closePopover })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.node__container {
|
.node__container {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export default defineConfig(({mode, command}) => {
|
|||||||
//李小龙 http://192.168.0.5:13080
|
//李小龙 http://192.168.0.5:13080
|
||||||
// dev http://10.148.20.34:13080
|
// dev http://10.148.20.34:13080
|
||||||
// target: VITE_API_URL,
|
// target: VITE_API_URL,
|
||||||
target: command === 'build' ? VITE_API_URL : 'http://192.168.0.5:13080',
|
target: command === 'build' ? VITE_API_URL : 'http://192.168.0.100:13080',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user