4646 </el-button >
4747 <template #dropdown >
4848 <el-dropdown-menu >
49+ <el-dropdown-item :href =" shareUrl" >
50+ <AppIcon iconName =" app-create-chat" class =" mr-4" ></AppIcon >
51+ {{ $t('views.application.operation.toChat') }}
52+ </el-dropdown-item >
53+
4954 <el-dropdown-item @click =" openHistory" >
5055 <AppIcon iconName =" app-history-outlined" ></AppIcon >
5156 {{ $t('views.applicationWorkflow.setting.releaseHistory') }}
@@ -138,6 +143,7 @@ import applicationApi from '@/api/application/application'
138143import { isAppIcon } from ' @/utils/common'
139144import { MsgSuccess , MsgError , MsgConfirm } from ' @/utils/message'
140145import { datetimeFormat } from ' @/utils/time'
146+ import { mapToUrlParams } from ' @/utils/application'
141147import useStore from ' @/stores'
142148import { WorkFlowInstance } from ' @/workflow/common/validate'
143149import { hasPermission } from ' @/utils/permission'
@@ -170,6 +176,15 @@ const disablePublic = ref(false)
170176const currentVersion = ref <any >({})
171177const cloneWorkFlow = ref (null )
172178
179+ const apiInputParams = ref ([])
180+
181+ const urlParams = computed (() =>
182+ mapToUrlParams (apiInputParams .value ) ? ' ?' + mapToUrlParams (apiInputParams .value ) : ' ' ,
183+ )
184+ const shareUrl = computed (
185+ () => ` ${window .location .origin }/chat/ ` + detail .value .access_token + urlParams .value ,
186+ )
187+
173188function back() {
174189 if (JSON .stringify (cloneWorkFlow .value ) !== JSON .stringify (getGraphData ())) {
175190 MsgConfirm (t (' common.tip' ), t (' views.applicationWorkflow.tip.saveMessage' ), {
@@ -227,9 +242,9 @@ function renderGraphData(item: any) {
227242
228243function closeHistory() {
229244 getDetail ()
230- // if (hasPermission(`APPLICATION:MANAGE:${id}`, 'AND') && isSave.value) {
231- // initInterval()
232- // }
245+ if (isSave .value ) {
246+ initInterval ()
247+ }
233248 showHistory .value = false
234249 disablePublic .value = false
235250}
@@ -244,12 +259,10 @@ function changeSave(bool: boolean) {
244259}
245260
246261function clickNodes(item : any ) {
247- // workflowRef.value?.addNode(item)
248262 showPopover .value = false
249263}
250264
251265function onmousedown(item : any ) {
252- // workflowRef.value?.onmousedown(item)
253266 showPopover .value = false
254267}
255268
@@ -328,12 +341,6 @@ const clickShowDebug = () => {
328341 }
329342 })
330343}
331- // function clickoutsideDebug(e: any) {
332- // if (workflowMainRef.value && e && e.target && workflowMainRef.value.contains(e?.target)) {
333- // showDebug.value = false
334- // }
335- // }
336-
337344function getGraphData() {
338345 return workflowRef .value ?.getGraphData ()
339346}
@@ -348,6 +355,27 @@ function getDetail() {
348355 detail .value .tts_model_id = res .data .tts_model
349356 detail .value .tts_type = res .data .tts_type
350357 saveTime .value = res .data ?.update_time
358+ detail .value .work_flow ?.nodes
359+ ?.filter ((v : any ) => v .id === ' base-node' )
360+ .map ((v : any ) => {
361+ apiInputParams .value = v .properties .api_input_field_list
362+ ? v .properties .api_input_field_list .map ((v : any ) => {
363+ return {
364+ name: v .variable ,
365+ value: v .default_value ,
366+ }
367+ })
368+ : v .properties .input_field_list
369+ ? v .properties .input_field_list
370+ .filter ((v : any ) => v .assignment_method === ' api_input' )
371+ .map ((v : any ) => {
372+ return {
373+ name: v .variable ,
374+ value: v .default_value ,
375+ }
376+ })
377+ : []
378+ })
351379 application .asyncGetAccessToken (id , loading ).then ((res : any ) => {
352380 detail .value = { ... detail .value , ... res .data }
353381 })
@@ -404,9 +432,9 @@ onMounted(() => {
404432 const workflowAutoSave = localStorage .getItem (' workflowAutoSave' )
405433 isSave .value = workflowAutoSave === ' true' ? true : false
406434 // 初始化定时任务
407- // if (hasPermission(`APPLICATION:MANAGE:${id}`, 'AND') && isSave.value) {
408- // initInterval()
409- // }
435+ if (isSave .value ) {
436+ initInterval ()
437+ }
410438})
411439
412440onBeforeUnmount (() => {
0 commit comments