mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 17:52:48 +00:00
feat: 工作流
This commit is contained in:
parent
5f82b0d010
commit
2d3a3bd0c6
File diff suppressed because it is too large
Load Diff
|
|
@ -142,7 +142,10 @@ class ApplicationWorkflowSerializer(serializers.Serializer):
|
|||
|
||||
def get_base_node_work_flow(work_flow):
|
||||
node_list = work_flow.get('nodes')
|
||||
[node for node in node_list if node.get('id') == '']
|
||||
base_node_list = [node for node in node_list if node.get('id') == 'base-node']
|
||||
if len(base_node_list) > 0:
|
||||
return base_node_list[-1]
|
||||
return None
|
||||
|
||||
|
||||
class ApplicationSerializer(serializers.Serializer):
|
||||
|
|
@ -535,6 +538,13 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
if work_flow is None:
|
||||
raise AppApiException(500, "work_flow是必填字段")
|
||||
Flow.new_instance(work_flow).is_valid()
|
||||
base_node = get_base_node_work_flow(work_flow)
|
||||
if base_node is not None:
|
||||
node_data = base_node.get('properties').get('node_data')
|
||||
if node_data is not None:
|
||||
application.name = node_data.get('name')
|
||||
application.desc = node_data.get('desc')
|
||||
application.prologue = node_data.get('prologue')
|
||||
application.work_flow = work_flow
|
||||
application.save()
|
||||
work_flow_version = WorkFlowVersion(work_flow=work_flow, application=application)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { iconComponent } from '../icons/utils'
|
||||
const props = defineProps<{
|
||||
nodeModel: any
|
||||
|
|
@ -44,5 +44,8 @@ function getIncomingNode(id: string) {
|
|||
})
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getIncomingNode(props.nodeModel.id)
|
||||
})
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue