66 <h4 class =" ellipsis" style =" max-width : 300px " :title =" detail?.name" >{{ detail?.name }}</h4 >
77 <div v-if =" showHistory && disablePublic" >
88 <el-text type =" info" class =" ml-16 color-secondary"
9- >{{ $t('workflow.info.previewVersion') }}
9+ >{{ $t('workflow.info.previewVersion') }}
1010 {{ currentVersion.name || datetimeFormat(currentVersion.update_time) }}
11- </el-text
12- >
11+ </el-text >
1312 </div >
1413 <el-text type =" info" class =" ml-16 color-secondary" v-else-if =" saveTime"
15- >{{ $t('workflow.info.saveTime') }}{{ datetimeFormat(saveTime) }}
16- </el-text
17- >
14+ >{{ $t('workflow.info.saveTime') }}{{ datetimeFormat(saveTime) }}
15+ </el-text >
1816 </div >
1917 <div v-if =" showHistory && disablePublic" >
2018 <el-button type =" primary" class =" mr-8" @click =" refreshVersion()" >
2119 {{ $t('workflow.setting.restoreVersion') }}
2220 </el-button >
23- <el-divider direction =" vertical" />
21+ <el-divider direction =" vertical" />
2422 <el-button text @click =" closeHistory" >
2523 <el-icon >
26- <Close />
24+ <Close />
2725 </el-icon >
2826 </el-button >
2927 </div >
3028 <div v-else >
3129 <el-button @click =" showPopover = !showPopover" >
32- <AppIcon iconName =" app-add-outlined" class =" mr-4" />
30+ <AppIcon iconName =" app-add-outlined" class =" mr-4" />
3331 {{ $t('workflow.setting.addComponent') }}
3432 </el-button >
3533 <el-button @click =" clickShowDebug" :disabled =" showDebug" v-if =" permissionPrecise.debug(id)" >
6664 <AppIcon iconName =" app-save-outlined" class =" color-secondary" ></AppIcon >
6765 {{ $t('workflow.setting.autoSave') }}
6866 <div class =" ml-4" >
69- <el-switch size =" small" v-model =" isSave" @change =" changeSave" />
67+ <el-switch size =" small" v-model =" isSave" @change =" changeSave" />
7068 </div >
7169 </el-dropdown-item >
7270 </el-dropdown-menu >
8785 </el-collapse-transition >
8886 <!-- 主画布 -->
8987 <div class =" workflow-main" ref =" workflowMainRef" >
90- <workflow ref =" workflowRef" v-if =" detail" :data =" detail?.work_flow" />
88+ <workflow ref =" workflowRef" v-if =" detail" :data =" detail?.work_flow" />
9189 </div >
9290 <!-- 调试 -->
9391 <el-collapse-transition >
102100 :size =" 32"
103101 style =" background : none "
104102 >
105- <img :src =" resetUrl(detail?.icon)" alt =" " />
103+ <img :src =" resetUrl(detail?.icon)" alt =" " />
106104 </el-avatar >
107- <LogoIcon v-else height =" 32px" />
105+ <LogoIcon v-else height =" 32px" />
108106 </div >
109107
110108 <h4 class =" ellipsis" style =" max-width : 270px " :title =" detail?.name" >
122120 </el-button >
123121 <el-button link @click =" showDebug = false" >
124122 <el-icon :size =" 20" class =" color-secondary" >
125- <Close />
123+ <Close />
126124 </el-icon >
127125 </el-button >
128126 </div >
142140 </div >
143141</template >
144142<script setup lang="ts">
145- import {ref , onBeforeMount , onBeforeUnmount , computed , nextTick , provide } from ' vue'
146- import {useRouter , useRoute } from ' vue-router'
147- import type {Action } from ' element-plus'
143+ import { ref , onBeforeMount , onBeforeUnmount , computed , nextTick , provide } from ' vue'
144+ import { useRouter , useRoute } from ' vue-router'
145+ import type { Action } from ' element-plus'
148146import Workflow from ' @/workflow/index.vue'
149147import DropdownMenu from ' @/components/workflow-dropdown-menu/index.vue'
150- import ExecutionRecord
151- from ' @/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue'
148+ import ExecutionRecord from ' @/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue'
152149import PublishHistory from ' @/views/knowledge-workflow/component/PublishHistory.vue'
153- import {isAppIcon , resetUrl } from ' @/utils/common'
154- import {MsgSuccess , MsgError , MsgConfirm } from ' @/utils/message'
155- import {datetimeFormat } from ' @/utils/time'
156- import {mapToUrlParams } from ' @/utils/application'
150+ import { isAppIcon , resetUrl } from ' @/utils/common'
151+ import { MsgSuccess , MsgError , MsgConfirm } from ' @/utils/message'
152+ import { datetimeFormat } from ' @/utils/time'
153+ import { mapToUrlParams } from ' @/utils/application'
157154import useStore from ' @/stores'
158- import {KnowledgeWorkFlowInstance } from ' @/workflow/common/validate'
159- import {hasPermission } from ' @/utils/permission'
155+ import { KnowledgeWorkFlowInstance } from ' @/workflow/common/validate'
156+ import { hasPermission } from ' @/utils/permission'
160157import DebugVue from ' ./component/DebugDrawer.vue'
161- import {t } from ' @/locales'
162- import {ComplexPermission , Permission } from ' @/utils/permission/type'
163- import {EditionConst , PermissionConst , RoleConst } from ' @/utils/permission/data'
158+ import { t } from ' @/locales'
159+ import { ComplexPermission , Permission } from ' @/utils/permission/type'
160+ import { EditionConst , PermissionConst , RoleConst } from ' @/utils/permission/data'
164161import permissionMap from ' @/permission'
165162import { WorkflowMode } from ' @/enums/application'
166163import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
167164import { knowledgeBaseNode } from ' @/workflow/common/data'
168165provide (' getResourceDetail' , () => detail )
169166provide (' workflowMode' , WorkflowMode .Knowledge )
170167provide (' loopWorkflowMode' , WorkflowMode .KnowledgeLoop )
171- const {theme} = useStore ()
168+ const { theme } = useStore ()
172169const router = useRouter ()
173170const route = useRoute ()
174171const {
175- params : {id, folderId},
172+ params : { id, folderId },
176173 /*
177174 folderId 可以区分 resource-management shared还是 workspace
178175 */
@@ -200,7 +197,6 @@ const DebugRef = ref<InstanceType<typeof DebugVue>>()
200197const ListActionRef = ref <InstanceType <typeof ExecutionRecord >>()
201198let interval: any
202199const workflowRef = ref ()
203- const workflowMainRef = ref ()
204200const loading = ref (false )
205201const detail = ref <any >(null )
206202
@@ -216,10 +212,6 @@ const cloneWorkFlow = ref(null)
216212
217213const apiInputParams = ref ([])
218214
219- const urlParams = computed (() =>
220- mapToUrlParams (apiInputParams .value ) ? ' ?' + mapToUrlParams (apiInputParams .value ) : ' ' ,
221- )
222-
223215const isPublish = computed (() => detail .value ?.is_publish )
224216
225217function back() {
@@ -326,18 +318,14 @@ const publish = () => {
326318 MsgError (e .toString ())
327319 return
328320 }
329- loadSharedApi ({type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
330- .putKnowledgeWorkflow (id , {work_flow: workflow })
321+ loadSharedApi ({ type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
322+ .putKnowledgeWorkflow (id , { work_flow: workflow })
331323 .then (() => {
332324 return loadSharedApi ({
333325 type: ' knowledge' ,
334326 isShared: isShared .value ,
335- systemType: apiType .value
336- }).publish (
337- id ,
338- {},
339- loading ,
340- )
327+ systemType: apiType .value ,
328+ }).publish (id , {}, loading )
341329 })
342330 .then ((ok : any ) => {
343331 detail .value .is_publish = true
@@ -349,15 +337,15 @@ const publish = () => {
349337 if (typeof err_message == ' string' ) {
350338 MsgError (
351339 res .node .properties ?.stepName +
352- ` ${t (' workflow.node' ).toLowerCase ()} ` +
353- err_message .toLowerCase (),
340+ ` ${t (' workflow.node' ).toLowerCase ()} ` +
341+ err_message .toLowerCase (),
354342 )
355343 } else {
356344 const keys = Object .keys (err_message )
357345 MsgError (
358346 node .properties ?.stepName +
359- ` ${t (' workflow.node' ).toLowerCase ()} ` +
360- err_message [keys [0 ]]?.[0 ]?.message .toLowerCase (),
347+ ` ${t (' workflow.node' ).toLowerCase ()} ` +
348+ err_message [keys [0 ]]?.[0 ]?.message .toLowerCase (),
361349 )
362350 }
363351 })
@@ -371,8 +359,8 @@ const publish = () => {
371359 const keys = Object .keys (err_message )
372360 MsgError (
373361 node .properties ?.stepName +
374- ` ${t (' workflow.node' )}, ` +
375- err_message [keys [0 ]]?.[0 ]?.message ,
362+ ` ${t (' workflow.node' )}, ` +
363+ err_message [keys [0 ]]?.[0 ]?.message ,
376364 )
377365 }
378366 })
@@ -406,8 +394,8 @@ const clickShowDebug = () => {
406394 const keys = Object .keys (err_message )
407395 MsgError (
408396 node .properties ?.stepName +
409- ` ${t (' workflow.node' )}, ` +
410- err_message [keys [0 ]]?.[0 ]?.message ,
397+ ` ${t (' workflow.node' )}, ` +
398+ err_message [keys [0 ]]?.[0 ]?.message ,
411399 )
412400 }
413401 })
@@ -422,7 +410,7 @@ const isShared = computed(() => {
422410})
423411
424412function getDetail() {
425- loadSharedApi ({type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
413+ loadSharedApi ({ type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
426414 .getKnowledgeDetail (id )
427415 .then ((res : any ) => {
428416 detail .value = res .data
@@ -431,27 +419,27 @@ function getDetail() {
431419 detail .value .tts_type = res .data .tts_type
432420 saveTime .value = res .data ?.update_time
433421 if (! detail .value .work_flow || ! (' nodes' in detail .value .work_flow )) {
434- detail .value .work_flow = {nodes: [knowledgeBaseNode ]}
422+ detail .value .work_flow = { nodes: [knowledgeBaseNode ] }
435423 }
436424 detail .value .work_flow ?.nodes
437425 ?.filter ((v : any ) => v .id === ' knowledge-base-node' )
438426 .map ((v : any ) => {
439427 apiInputParams .value = v .properties .api_input_field_list
440428 ? v .properties .api_input_field_list .map ((v : any ) => {
441- return {
442- name: v .variable ,
443- value: v .default_value ,
444- }
445- })
429+ return {
430+ name: v .variable ,
431+ value: v .default_value ,
432+ }
433+ })
446434 : v .properties .input_field_list
447435 ? v .properties .input_field_list
448- .filter ((v : any ) => v .assignment_method === ' api_input' )
449- .map ((v : any ) => {
450- return {
451- name: v .variable ,
452- value: v .default_value ,
453- }
454- })
436+ .filter ((v : any ) => v .assignment_method === ' api_input' )
437+ .map ((v : any ) => {
438+ return {
439+ name: v .variable ,
440+ value: v .default_value ,
441+ }
442+ })
455443 : []
456444 })
457445
@@ -468,7 +456,7 @@ function saveknowledge(bool?: boolean, back?: boolean) {
468456 work_flow: getGraphData (),
469457 }
470458 loading .value = back || false
471- loadSharedApi ({type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
459+ loadSharedApi ({ type: ' knowledge' , isShared: isShared .value , systemType: apiType .value })
472460 .putKnowledgeWorkflow (id , obj )
473461 .then (() => {
474462 saveTime .value = new Date ()
@@ -487,11 +475,11 @@ function saveknowledge(bool?: boolean, back?: boolean) {
487475
488476const go = () => {
489477 if (route .path .includes (' resource-management' )) {
490- return router .push ({path: get_resource_management_route ()})
478+ return router .push ({ path: get_resource_management_route () })
491479 } else if (route .path .includes (' shared' )) {
492- return router .push ({path: get_shared_route ()})
480+ return router .push ({ path: get_shared_route () })
493481 } else {
494- return router .push ({path: get_route ()})
482+ return router .push ({ path: get_route () })
495483 }
496484}
497485
@@ -585,10 +573,8 @@ const toImportDoc = () => {
585573 showConfirmButton: false ,
586574 type: ' warning' ,
587575 })
588- .then (() => {
589- })
590- .catch (() => {
591- })
576+ .then (() => {})
577+ .catch (() => {})
592578 }
593579}
594580
0 commit comments