diff --git a/src/components/Upload/index.vue b/src/components/Upload/index.vue
index 41f12c1193580b21a55e303563af202fb9887f94..71bb0015a856ef68f945cba1d383cdd9a36d6f7a 100644
--- a/src/components/Upload/index.vue
+++ b/src/components/Upload/index.vue
@@ -15,7 +15,7 @@ const handleCreateapi = () => {
data:yamlToJsonContent.value,
})
.then(res => {
- getServiceJson.value = res[1].result.apis;
+ getServiceJson.value = res[1]?.result?.apis;
uploadtype.value = 'get';
});
};
@@ -81,7 +81,7 @@ const uploadtype = ref(props.type);
const getServiceYaml = ref('');
const yamlToJsonContent = ref('');
const getServiceJson = ref('');
-const activeServiceName = ref('');
+const activeServiceNameList = ref([]);
const imageUrl = ref('');
const progressVal = ref(0);
const uploadDone = ref(false);
@@ -184,7 +184,7 @@ watch(
getServiceYaml.value = props.getServiceYaml;
console.log(props, 'props---result')
if (getServiceJson.value?.length) {
- activeServiceName.value = getServiceJson.value?.[0]?.name;
+ activeServiceNameList.value = [getServiceJson.value?.[0]?.name];
}
if (props.type === 'edit' && props) {
getServiceYamlFun(props.serviceId);
@@ -256,13 +256,13 @@ watch(
/>
-
+
{{ item.name }}
-
+
diff --git a/src/store/conversation.ts b/src/store/conversation.ts
index c0aa626e8ee8ab97d1a0238f9af0fc3c3cfcc6ae..4ed4b8bc2f6926d669218566a8948f22df574385 100644
--- a/src/store/conversation.ts
+++ b/src/store/conversation.ts
@@ -233,7 +233,6 @@ export const useSessionStore = defineStore('conversation', () => {
break;
}
const { done, value } = await reader.read();
- console.log(value, 'value')
const decodedValue = decoder.decode(value, { stream: true });
const isLegal = judgeMessage(answerIndex, decodedValue);
if (!isLegal) {
@@ -258,12 +257,10 @@ export const useSessionStore = defineStore('conversation', () => {
// const line3 = lines2.map(item => {
// item = 'data: {' + item;
// })
- console.log(decodedValue, '---finally')
// return;
lines.forEach((line) => {
// const message = Object(JSON.parse(line.replace(/^data:\s*/, '').trim()));
// 这里json解析
- console.log(line, 'lines=-------------------')
const message = Object(JSON.parse(line.replace(/^data:\s*/, '').trim()));
if( 'metadata' in message){
if(conversationItem.metadata?.time {
//事件流开始--后续验证对话无下拉连接后则完全替换
let flow = message.flow;
conversationItem.flowdata = {
- id: flow?.stepName||"",
+ id: flow?.stepName + flow?.stepId || "",
title: i18n.global.t('flow.flow_start'),
// 工作流这里stepName代替step_progresss,为不影响首页对话暂且用||
progress: flow?.stepProgress || "",
@@ -313,7 +310,7 @@ export const useSessionStore = defineStore('conversation', () => {
// target.data.input = message
// }
conversationItem.flowdata?.data[0].push({
- id:message.flow?.stepName,
+ id:message.flow?.stepName + message.flow?.stepId,
title:message.flow?.stepName,
status:message.flow?.stepStatus,
data:{
@@ -326,7 +323,7 @@ export const useSessionStore = defineStore('conversation', () => {
}
}
else if(message["event"] === "step.output") {
- const target = conversationItem.flowdata?.data[0].find(item => item.id === message.flow.stepName);
+ const target = conversationItem.flowdata?.data[0].find(item => item.id === message.flow?.stepName + message.flow?.stepId);
if (target) {
target.data.output = message.content
target.status = message.flow?.stepStatus;
@@ -386,7 +383,6 @@ export const useSessionStore = defineStore('conversation', () => {
}
}
} catch (err: any) {
- // console.log(err, 'errr')
isPaused.value = true;
isAnswerGenerating.value = false;
(conversationList.value[answerIndex] as RobotConversationItem).isFinish = true;
diff --git a/src/views/createapp/components/workFlow.vue b/src/views/createapp/components/workFlow.vue
index b99fbc5bc025f81d5ee5f4f89da2ddd51ff53b84..59db808875c34af40c81b23864ce0223516ad428 100644
--- a/src/views/createapp/components/workFlow.vue
+++ b/src/views/createapp/components/workFlow.vue
@@ -272,7 +272,9 @@ const handleDebugDialogOps = (visible) => {
if (visible) {
saveFlow();
}
- debugDialogVisible.value = visible;
+ if (typeof visible === 'boolean') {
+ debugDialogVisible.value = visible;
+ }
// 调试弹窗关闭时---结果清空
debugStatus.value = '';
// 调试弹窗关闭时---节点状态清空
@@ -463,8 +465,11 @@ $bus.on('getNodesStatue', lines => {
if (newLines.data.event === 'step.output') {
totalTime.value += newLines.data?.metadata?.time_cost;
constTime = `${newLines.data?.metadata?.time_cost?.toFixed(3)}s`
+ // 此处获取output的数据,并将此数据传给节点显示
+ updateNodeFunc(newLines.data.flow.stepId, newLines.data.flow?.stepStatus, constTime, newLines.data?.content);
+ } else {
+ updateNodeFunc(newLines.data.flow.stepId, newLines.data.flow?.stepStatus, constTime);
}
- updateNodeFunc(newLines.data.flow.stepId, newLines.data.flow?.stepStatus, constTime);
} else if (newLines?.data?.event === 'flow.stop') {
emits('updateFlowsDebug')
debugStatus.value = newLines.data.flow?.stepStatus;
@@ -477,15 +482,14 @@ $bus.on('getNodesStatue', lines => {
} catch (error) {
ElMessage.error('请检查格式是否正确');
}
-
// 修改节点时,需要将对应节点的边也进行修改
});
// 更新节点状态--这里是测试第一个成功节点改变状态的方法【同时边也随之改变】
-const updateNodeFunc = (id, status, constTime) => {
+const updateNodeFunc = (id, status, constTime, content?) => {
// 获取到当前的nodeId,更新状态
const node = findNode(id);
- const data = node?.data;
+ const data = content ? {...node?.data, content} : node?.data;
// 更新当前节点的状态,以及运行时间
updateNode(id, { data: { ...data, status, constTime } });
// 遍历获取以当前节点为起源节点的边和为目的节点的边
@@ -670,12 +674,12 @@ defineExpose({
-
+
-
+
@@ -722,7 +726,7 @@ defineExpose({
-
+
props.data,
() => {
const isInclude = statusList.value.includes(props.data?.status);
+ // 设置节点的状态-默认以及成功、失败、运行中
if (!isInclude) {
curStatus.value = 'default';
} else {
curStatus.value = props.data?.status;
}
+ // 节点调试消耗时间【目前只有调试接口返回的节点step.output才有值,其余状态为''不显示】
costTime.value = props.data?.constTime || '';
+ // 这里是分支节点独有的,需要根据接口拖拽节点里的choices决定有几个handle节点
if (props.data?.parameters?.input_parameters?.choices) {
branchIdList.value = props.data?.parameters?.input_parameters?.choices.map(
item => item?.branchId,
);
}
+ // 默认的输入赋值
+ inputAndOutput.value.input_parameters = props.data?.parameters?.input_parameters || {};
+ // 判断是否有调试的输出,有调试的输出,需要将其显示/否则显示默认的输出
+ if (props.data?.content) {
+ // 将paramaters里的output换为接口返回的output_parameters
+ inputAndOutput.value.output_parameters = props.data.content;
+ } else {
+ inputAndOutput.value.output_parameters = props.data?.parameters?.output_parameters || {};
+ }
},
{ deep: true, immediate: true },
);
@@ -72,8 +94,8 @@ const editYaml = (nodeName, yamlCode) => {
{{ props.data.name }}
-
-
+
+
···
编辑
删除
@@ -99,7 +121,7 @@ const editYaml = (nodeName, yamlCode) => {
v-if="curStatus !== 'default'"
:status="curStatus"
:costTime="costTime"
- :inputAndOutput="props.data?.parameters"
+ :inputAndOutput="inputAndOutput"
style="display: block"
>
diff --git a/src/views/createapp/components/workFlowConfig/CustomNode.vue b/src/views/createapp/components/workFlowConfig/CustomNode.vue
index 0e1198e2c6e6ff2115a454f21a5f597b95fe4a15..27ddcbfc4361b637dff856e4fc97f0c32816f38d 100644
--- a/src/views/createapp/components/workFlowConfig/CustomNode.vue
+++ b/src/views/createapp/components/workFlowConfig/CustomNode.vue
@@ -19,10 +19,10 @@ const props = defineProps({
type: Object,
required: false,
},
- mark: {
- type: String,
+ disabled: {
+ type: Boolean,
required: false,
- },
+ }
});
const emits = defineEmits(['delNode', 'editYamlDrawer']);
@@ -34,16 +34,33 @@ const curStatus = ref('');
// 当前节点运行耗时
const costTime = ref('');
+// 定义传给mirror展示输入输出的存储量
+const inputAndOutput = ref({
+ input_parameters: {},
+ output_parameters: {},
+});
+
watch(
() => props.data,
() => {
const isInclude = statusList.value.includes(props.data?.status);
+ // 设置节点的状态-默认以及成功、失败、运行中
if (!isInclude) {
curStatus.value = 'default';
} else {
curStatus.value = props.data?.status;
}
+ // 节点调试消耗时间【目前只有调试接口返回的节点step.output才有值,其余状态为''不显示】
costTime.value = props.data?.constTime || '';
+ // 默认的输入赋值
+ inputAndOutput.value.input_parameters = props.data?.parameters?.input_parameters || {};
+ // 判断是否有调试的输出,有调试的输出,需要将其显示/否则显示默认的输出
+ if (props.data?.content) {
+ // 将paramaters里的output换为接口返回的output_parameters
+ inputAndOutput.value.output_parameters = props.data.content;
+ } else {
+ inputAndOutput.value.output_parameters = props.data?.parameters?.output_parameters || {};
+ }
},
{ deep: true, immediate: true },
);
@@ -68,8 +85,8 @@ const editYaml = (nodeName, yamlCode) => {
{{ props.data.name }}
-
-
+
+
···
编辑
删除
@@ -89,7 +106,7 @@ const editYaml = (nodeName, yamlCode) => {
v-if="curStatus !== 'default'"
:status="curStatus"
:costTime="costTime"
- :inputAndOutput="props.data?.parameters"
+ :inputAndOutput="inputAndOutput"
style="display: block"
>
diff --git a/src/views/createapp/components/workFlowDebug.vue b/src/views/createapp/components/workFlowDebug.vue
index db54ce4cba3db1d2792f0d3c85a74a01cf083ff6..7693d3776f7955fd7f59fe95406c4d12b55dca6a 100644
--- a/src/views/createapp/components/workFlowDebug.vue
+++ b/src/views/createapp/components/workFlowDebug.vue
@@ -56,7 +56,7 @@
diff --git a/src/views/createapp/index.vue b/src/views/createapp/index.vue
index bf2635ad72c8e221ae4503be0d1e8ecd73cae68b..7dc6c24abc568689babb07e678a6e55bc35476ca 100644
--- a/src/views/createapp/index.vue
+++ b/src/views/createapp/index.vue
@@ -116,18 +116,6 @@ const getPublishStatus = (status) => {
publishStatus.value = '已发布'
}
}
-watch(
- () => router,
- () => {
- if (!route.query?.appId) {
- router.push('/app');
- }
- },
- {
- deep: true,
- immediate: true,
- },
-);
const handleJumperAppCenter = () => {
router.push('/app');
diff --git a/src/views/dialogue/components/AppInitalPreview.vue b/src/views/dialogue/components/AppInitalPreview.vue
index fc02a51d10b97ef8c825054b3bd449a1461bdba8..2093057aa348877b5572c033614d1aa17e1f5e35 100644
--- a/src/views/dialogue/components/AppInitalPreview.vue
+++ b/src/views/dialogue/components/AppInitalPreview.vue
@@ -6,13 +6,11 @@

@@ -48,7 +46,7 @@ watch(
border-radius: 8px;
bottom: 0px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
- margin: 12px;
+ margin: 12px 104px;
}
.dialogue-conversation-bottom-sendbox {
@@ -140,10 +138,6 @@ watch(
top: 0;
background-color: transparent;
}
-
- img:hover {
- filter: invert(50%) sepia(66%) saturate(446%) hue-rotate(182deg) brightness(100%) contrast(103%);
- }
}
}
diff --git a/src/views/styles/workFlowArrange.scss b/src/views/styles/workFlowArrange.scss
index a1cf5b3c01db0fab693963acce864ba193c21bb5..de09ad9f0a8452962f7fd2a4d8216ba155abb6be 100644
--- a/src/views/styles/workFlowArrange.scss
+++ b/src/views/styles/workFlowArrange.scss
@@ -309,6 +309,9 @@
color: #6395fd;
}
}
+ .notAllow {
+ cursor: not-allowed;
+ }
}
.desc {
font-size: 12px;