From 6815a7288e740411fbc46bc65e9a93e9ac875984 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Thu, 29 Feb 2024 18:45:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=A8=A1=E6=9D=BF=E5=88=9D=E6=AD=A5?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/entity/gencodeTemplateObj.ts | 1 + src/components/AceEditor/src/config.ts | 8 + .../devtools/template/TemplateModal.vue | 188 ++++++++++++++++-- .../devtools/template/TemplatePromptModal.vue | 81 ++++++++ 4 files changed, 261 insertions(+), 17 deletions(-) create mode 100644 src/views/system/devtools/template/TemplatePromptModal.vue diff --git a/src/api/platform/system/entity/gencodeTemplateObj.ts b/src/api/platform/system/entity/gencodeTemplateObj.ts index 24890b3..60a10a3 100644 --- a/src/api/platform/system/entity/gencodeTemplateObj.ts +++ b/src/api/platform/system/entity/gencodeTemplateObj.ts @@ -11,6 +11,7 @@ export interface GencodeTemplateObj extends CommonEntity { defaultContents: string; sort: string; isChild: string; + index?: string; [key: string]: any; } diff --git a/src/components/AceEditor/src/config.ts b/src/components/AceEditor/src/config.ts index 4b9196a..116b7e4 100644 --- a/src/components/AceEditor/src/config.ts +++ b/src/components/AceEditor/src/config.ts @@ -1,3 +1,5 @@ + +// 语言配置 import ace from 'ace-builds'; import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url'; @@ -12,6 +14,10 @@ ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl); import modeYamlUrl from 'ace-builds/src-noconflict/mode-yaml?url'; ace.config.setModuleUrl('ace/mode/yaml', modeYamlUrl); +import modeVelocityUrl from 'ace-builds/src-noconflict/mode-velocity?url'; +ace.config.setModuleUrl('ace/mode/velocity', modeVelocityUrl); + +// 主题配置 import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url'; ace.config.setModuleUrl('ace/theme/github', themeGithubUrl); @@ -24,6 +30,7 @@ ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl); import themeDraculaUrl from 'ace-builds/src-noconflict/theme-dracula?url'; ace.config.setModuleUrl('ace/theme/dracula', themeDraculaUrl); +// 浏览器后台多线程配置 import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url'; ace.config.setModuleUrl('ace/mode/base', workerBaseUrl); @@ -39,6 +46,7 @@ ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl); import workerYamlUrl from 'ace-builds/src-noconflict/worker-yaml?url'; ace.config.setModuleUrl('ace/mode/yaml_worker', workerYamlUrl); +// 快速补全代码段配置 import snippetsHtmlUrl from 'ace-builds/src-noconflict/snippets/html?url'; ace.config.setModuleUrl('ace/snippets/html', snippetsHtmlUrl); diff --git a/src/views/system/devtools/template/TemplateModal.vue b/src/views/system/devtools/template/TemplateModal.vue index 3fd9e92..64d0aa7 100644 --- a/src/views/system/devtools/template/TemplateModal.vue +++ b/src/views/system/devtools/template/TemplateModal.vue @@ -1,27 +1,91 @@ + diff --git a/src/views/system/devtools/template/TemplatePromptModal.vue b/src/views/system/devtools/template/TemplatePromptModal.vue new file mode 100644 index 0000000..dfda8c9 --- /dev/null +++ b/src/views/system/devtools/template/TemplatePromptModal.vue @@ -0,0 +1,81 @@ + + +