From 18cb0d396fcda623e5738deb3c329e61033d7454 Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 14 Mar 2024 17:00:21 +0800 Subject: [PATCH] fix: graph node terminal not work --- components.d.ts | 5 ----- src/components/ace-editor/index.vue | 22 ++----------------- .../tab-graph/components/graph-g6.vue | 2 +- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/components.d.ts b/components.d.ts index ad16d299..ed0d8a1d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -29,23 +29,18 @@ declare module 'vue' { AInputSearch: typeof import('@arco-design/web-vue')['InputSearch']; ALayout: typeof import('@arco-design/web-vue')['Layout']; ALayoutContent: typeof import('@arco-design/web-vue')['LayoutContent']; - ALayoutFooter: typeof import('@arco-design/web-vue')['LayoutFooter']; ALayoutSider: typeof import('@arco-design/web-vue')['LayoutSider']; ALink: typeof import('@arco-design/web-vue')['Link']; - AList: typeof import('@arco-design/web-vue')['List']; - AListItemMeta: typeof import('@arco-design/web-vue')['ListItemMeta']; AMenu: typeof import('@arco-design/web-vue')['Menu']; AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']; AModal: typeof import('@arco-design/web-vue')['Modal']; AOption: typeof import('@arco-design/web-vue')['Option']; APagination: typeof import('@arco-design/web-vue')['Pagination']; AProgress: typeof import('@arco-design/web-vue')['Progress']; - ARangePicker: typeof import('@arco-design/web-vue')['RangePicker']; AResult: typeof import('@arco-design/web-vue')['Result']; ASelect: typeof import('@arco-design/web-vue')['Select']; ASpace: typeof import('@arco-design/web-vue')['Space']; ASpin: typeof import('@arco-design/web-vue')['Spin']; - AStatistic: typeof import('@arco-design/web-vue')['Statistic']; ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']; ASwitch: typeof import('@arco-design/web-vue')['Switch']; ATable: typeof import('@arco-design/web-vue')['Table']; diff --git a/src/components/ace-editor/index.vue b/src/components/ace-editor/index.vue index 68035f32..d7ed8032 100644 --- a/src/components/ace-editor/index.vue +++ b/src/components/ace-editor/index.vue @@ -313,24 +313,6 @@ }; const setLanguageTools = () => { langTools.setCompleters(); - // langTools.addCompleter({ - // identifierRegexps: [identifer], - // getCompletions( - // editor: any, - // session: any, - // pos: Position, - // prefix: any, - // callback: any - // ) { - // const wordRange = editor.session.getTextRange({ - // start: { row: 0, column: 0 }, - // end: pos - // }); - // const valuePath = getValuePath(wordRange) || ''; - // const list = getCompletionList(valuePath); - // callback(null, list); - // } - // }); }; const handleInput = (val) => { emits('change', val); @@ -396,6 +378,7 @@ () => props.readOnly, (newVal) => { aceEditor?.setOption('readOnly', newVal); + aceEditor?.setOption('useWorker', !newVal); }, { immediate: false } ); @@ -417,7 +400,6 @@ emits('input', val); emits('update:modelValue', val); clearDiffRowDecoration(args); - console.log('editor=====', val); }); aceEditor.on('blur', function (args: any) { const val = aceEditor.getValue(); @@ -428,7 +410,7 @@ // maxLines: Infinity, // minLines: 10, wrap: true, - useWorker: true, + useWorker: !props.readOnly, showPrintMargin: false, fontSize: 14, readOnly: props.readOnly, diff --git a/src/views/application-management/services/components/instance/tab-graph/components/graph-g6.vue b/src/views/application-management/services/components/instance/tab-graph/components/graph-g6.vue index 27907f1a..bc879b92 100644 --- a/src/views/application-management/services/components/instance/tab-graph/components/graph-g6.vue +++ b/src/views/application-management/services/components/instance/tab-graph/components/graph-g6.vue @@ -149,7 +149,7 @@ const renderExecHtml = () => { if (!executable) return ''; return `
  • - ${i18n.global.t( + ${i18n.global.t( 'applications.instance.tab.term' )}
  • `;