@@ -176,14 +176,17 @@ const currentVersion = ref<any>({})
176176function clickoutsideHistory() {
177177 if (! disablePublic .value ) {
178178 showHistory .value = false
179+ disablePublic .value = false
179180 }
180181}
181182
182183function refreshVersion(item ? : any ) {
183184 if (item ) {
184185 getHistortyDetail (item .id )
185186 }
186- initInterval ()
187+ if (hasPermission (` APPLICATION:MANAGE:${id } ` , ' AND' ) && isSave .value ) {
188+ initInterval ()
189+ }
187190 showHistory .value = false
188191 disablePublic .value = false
189192}
@@ -204,13 +207,19 @@ function getHistortyDetail(versionId: string) {
204207 detail .value .tts_model_id = res .data .tts_model
205208 detail .value .tts_type = res .data .tts_type
206209 saveTime .value = res .data ?.update_time
207- workflowRef .value ?.renderGraphData ()
210+ setTimeout (() => {
211+ workflowRef .value ?.renderGraphData ()
212+ }, 200 )
208213 })
209214}
210215
211216function closeHistory() {
212217 getDetail ()
218+ if (hasPermission (` APPLICATION:MANAGE:${id } ` , ' AND' ) && isSave .value ) {
219+ initInterval ()
220+ }
213221 showHistory .value = false
222+ disablePublic .value = false
214223}
215224
216225function openHistory() {
@@ -317,6 +326,9 @@ function getDetail() {
317326 detail .value .tts_model_id = res .data .tts_model
318327 detail .value .tts_type = res .data .tts_type
319328 saveTime .value = res .data ?.update_time
329+ setTimeout (() => {
330+ workflowRef .value ?.renderGraphData ()
331+ }, 200 )
320332 })
321333}
322334
@@ -355,7 +367,7 @@ onMounted(() => {
355367 const workflowAutoSave = localStorage .getItem (' workflowAutoSave' )
356368 isSave .value = workflowAutoSave === ' true' ? true : false
357369 // 初始化定时任务
358- if (hasPermission (` APPLICATION:MANAGE:${id } ` , ' AND' ) && workflowAutoSave ) {
370+ if (hasPermission (` APPLICATION:MANAGE:${id } ` , ' AND' ) && isSave . value ) {
359371 initInterval ()
360372 }
361373})
0 commit comments