diff --git a/src/views/createapp/components/appConfig.vue b/src/views/createapp/components/appConfig.vue index f6f02a9106be01fd4429a4fd86bd67900b6ba26c..1d14c3a5c0a4c650c869495e8cdc5a3906d83bc8 100644 --- a/src/views/createapp/components/appConfig.vue +++ b/src/views/createapp/components/appConfig.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; const { t } = useI18n(); import { IconCaretRight, IconPlusCircle, IconDelete, IconSearch } from '@computing/opendesign-icons'; import DialogueSession from '../../dialogue/components/DialogueSession.vue'; -const activeName = ref([1,2,3]); +const activeName = ref([1, 2, 3]); const activeNames = ref([1, 2, 3]); const createAppForm = ref({ icon: '', @@ -17,6 +17,7 @@ const createAppForm = ref({ selectedPeople: [], }); const searchName = ref(''); +const imageUrl = ref('') const permissionTypeList = [ { label: '公开(所有人可见)', @@ -69,144 +70,152 @@ const delRecommendItem = idx => { const searchPerson = () => { curPersonList.value = permissionList.value.filter(item => item.toLowerCase().includes(searchName.value)); }; + +const handleAvatarSuccess = (res,file)=>{ + console.log(res,file) +} + diff --git a/src/views/createapp/components/workFlow.vue b/src/views/createapp/components/workFlow.vue index 9044a44e3711b0b4bfb6ea297ace07c8b6096db2..66bd43507816225a0cab3448c9cb279dab44baf4 100644 --- a/src/views/createapp/components/workFlow.vue +++ b/src/views/createapp/components/workFlow.vue @@ -10,7 +10,8 @@ import CustomEdge from './workFlowConfig/CustomEdge.vue'; import CustomNode from './workFlowConfig/CustomNode.vue'; import CustomSaENode from './workFlowConfig/CustomSaENode.vue'; import useDragAndDrop from './workFlowConfig/useDnD'; -import { IconSearch, IconCaretRight } from '@computing/opendesign-icons'; +import WorkFlowDialog from './workFlowConfig/workFlowDialog.vue'; +import { IconSearch, IconCaretRight, IconCaretDown, IconPlusCircle } from '@computing/opendesign-icons'; const { t } = useI18n(); const copilotAside = ref(); @@ -18,6 +19,10 @@ const isCopilotAsideVisible = ref(true); const apiSearchValue = ref(); const activeNames = ref([1]); const activeName = ref(1); +const workFlowItem = ref(); +const isAddWorkFlow = ref(false); +const editData = ref(); +const dialogType = ref(''); function hanleAsideVisible(): void { if (!copilotAside.value) return; if (isCopilotAsideVisible.value) { @@ -27,7 +32,7 @@ function hanleAsideVisible(): void { } } -const { onInit, onNodeDragStop, onConnect, addEdges, updateNode, getNodes, getEdges, removeNodes } = useVueFlow(); +const { onInit, onConnect, addEdges, updateNode, getNodes, getEdges, findNode, removeNodes } = useVueFlow(); const { onDragOver, onDrop, onDragLeave, isDragOver, onDragStart } = useDragAndDrop(); // 这里是初始化的开始结束的节点 @@ -56,12 +61,13 @@ const nodes = ref([ }, ]); // 开始的边默认为空数组【当然回显时应该有值】 -const edges = ref([] as any); +const edges = ref([]); // 下方为死数据--之后有接口请将其替换为接口 const nodeStancesList = ref([ { id: '11', type: 'custom', + mark: 'iiiiii', data: { label: '知识库(成功节点)', desc: '这里是知识库说明', @@ -71,6 +77,7 @@ const nodeStancesList = ref([ { id: '12', type: 'custom', + mark: 'iiiiii', data: { label: 'LLM(失败节点)', desc: '调用大模型,生成自然语言报告', @@ -80,6 +87,7 @@ const nodeStancesList = ref([ { id: '13', type: 'custom', + mark: 'iiiiii', data: { label: '条件(正常初始化节点)', desc: '条件说明', @@ -94,20 +102,24 @@ onConnect(e => { }); }); -// 这里设置/更新节点状态,更新所有-nodes.value = 新节点列表, edges.value = 新连线列表 -const setNodeStatus = () => { - // 通过使用updateNode方法对节点进行更新【包含状态以及位置等】如updateNode('1', { position:{ x: 400, y: 400 } }) - const curNodeList = getNodes.value; - const curEdgeList = getEdges.value; - curNodeList.forEach(item => { - if (item.id) { - updateNode(item.id, { - data: { ...item.data, status: 'error' }, - }); - } - }); -}; const handleChange = () => {}; +// 打开新增工作流弹窗 +const addWorkFlow = () => { + // 待增加新增弹窗 + dialogType.value = '新增'; + isAddWorkFlow.value = true; +}; +// 关闭工作流弹出 +const handleClose = () => { + isAddWorkFlow.value = false; +}; +// 删除节点 +const delNode = (id) => { + if (id) { + const node = findNode(id); + node ? removeNodes(node) : ''; + } +}