diff --git a/package.json b/package.json index 2a3048c2..95b86a11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.6.1-1", + "version": "1.6.1-2", "private": true, "bin": "dist/service.js", "scripts": { @@ -24,6 +24,7 @@ "@floating-ui/dom": "1.2.8", "@vueuse/core": "^10.1.2", "@vueuse/math": "^10.1.2", + "ace-builds": "^1.32.6", "apexcharts-clevision": "^3.28.5", "axios": "1.4.0", "axios-mock-adapter": "^1.21.4", @@ -48,6 +49,7 @@ "vue-prism-component": "^2.0.0", "vue-router": "^4.2.0", "vue-toast-notification": "^3", + "vue3-ace-editor": "^2.2.4", "vue3-apexcharts": "^1.4.1", "vue3-perfect-scrollbar": "^1.6.0", "vuetify": "3.3.5", diff --git a/src/ace-config.ts b/src/ace-config.ts new file mode 100644 index 00000000..aa58127f --- /dev/null +++ b/src/ace-config.ts @@ -0,0 +1,54 @@ +import ace from 'ace-builds' + +import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url' + +import modeJavascriptUrl from 'ace-builds/src-noconflict/mode-javascript?url' + +import modeHtmlUrl from 'ace-builds/src-noconflict/mode-html?url' + +import modeYamlUrl from 'ace-builds/src-noconflict/mode-yaml?url' + +import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url' + +import themeChromeUrl from 'ace-builds/src-noconflict/theme-chrome?url' + +import themeMonokaiUrl from 'ace-builds/src-noconflict/theme-monokai?url' + +import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url' + +import workerJsonUrl from 'ace-builds/src-noconflict/worker-json?url' + +import workerJavascriptUrl from 'ace-builds/src-noconflict/worker-javascript?url' + +import workerHtmlUrl from 'ace-builds/src-noconflict/worker-html?url' + +import workerYamlUrl from 'ace-builds/src-noconflict/worker-yaml?url' + +import snippetsHtmlUrl from 'ace-builds/src-noconflict/snippets/html?url' + +import snippetsJsUrl from 'ace-builds/src-noconflict/snippets/javascript?url' + +import snippetsYamlUrl from 'ace-builds/src-noconflict/snippets/yaml?url' + +import snippetsJsonUrl from 'ace-builds/src-noconflict/snippets/json?url' + +import 'ace-builds/src-noconflict/ext-language_tools' + +ace.config.setModuleUrl('ace/mode/json', modeJsonUrl) +ace.config.setModuleUrl('ace/mode/javascript', modeJavascriptUrl) +ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl) +ace.config.setModuleUrl('ace/mode/yaml', modeYamlUrl) +ace.config.setModuleUrl('ace/theme/github', themeGithubUrl) +ace.config.setModuleUrl('ace/theme/chrome', themeChromeUrl) +ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl) +ace.config.setModuleUrl('ace/mode/base', workerBaseUrl) +ace.config.setModuleUrl('ace/mode/json_worker', workerJsonUrl) +ace.config.setModuleUrl('ace/mode/javascript_worker', workerJavascriptUrl) +ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl) +ace.config.setModuleUrl('ace/mode/yaml_worker', workerYamlUrl) +ace.config.setModuleUrl('ace/snippets/html', snippetsHtmlUrl) +ace.config.setModuleUrl('ace/snippets/javascript', snippetsJsUrl) +ace.config.setModuleUrl('ace/snippets/javascript', snippetsYamlUrl) +ace.config.setModuleUrl('ace/snippets/json', snippetsJsonUrl) + +ace.require('ace/ext/language_tools') diff --git a/src/components/render/FormRender.vue b/src/components/render/FormRender.vue index 23fdc252..9c2e950e 100644 --- a/src/components/render/FormRender.vue +++ b/src/components/render/FormRender.vue @@ -35,12 +35,14 @@ const formData = ref(elementProps.form || {}) v-if="!formItem.html" v-bind="formItem.props" v-model="formData[formItem.props?.model || '']" + v-model:value="formData[formItem.props?.modelvalue || '']" > {{ formItem.text }} diff --git a/src/main.ts b/src/main.ts index e917d889..fe7cf9ac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,9 @@ +import { VAceEditor } from 'vue3-ace-editor' import { createApp } from 'vue' import '@/@iconify/icons-bundle' import ToastPlugin from 'vue-toast-notification' import VuetifyUseDialog from 'vuetify-use-dialog' +import './ace-config' import { removeEl } from './@core/utils/dom' import App from '@/App.vue' import vuetify from '@/plugins/vuetify' @@ -15,10 +17,13 @@ import 'vue-toast-notification/dist/theme-bootstrap.css' loadFonts() -// Create vue app +// 创建Vue实例 const app = createApp(App) -// Use plugins Mount vue app +// 注册全局组件 +app.component('VAceEditor', VAceEditor) + +// 注册插件 app .use(vuetify) .use(router) diff --git a/yarn.lock b/yarn.lock index 9e90312e..75d7a5e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2422,6 +2422,11 @@ accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" +ace-builds@^1.32.6: + version "1.32.6" + resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.32.6.tgz#454ec8bc9235fbb960b8d8b86e698f941c104de2" + integrity sha512-dO5BnyDOhCnznhOpILzXq4jqkbhRXxNkf3BuVTmyxGyRLrhddfdyk6xXgy+7A8LENrcYoFi/sIxMuH3qjNUN4w== + acorn-jsx@^5.2.0, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -6651,6 +6656,11 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +resize-observer-polyfill@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -7912,6 +7922,13 @@ vue-tsc@^1.6.5: "@volar/vue-typescript" "1.6.5" semver "^7.3.8" +vue3-ace-editor@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/vue3-ace-editor/-/vue3-ace-editor-2.2.4.tgz#1f2a787f91cf7979f27fab29e0e0604bb3ee1c17" + integrity sha512-FZkEyfpbH068BwjhMyNROxfEI8135Sc+x8ouxkMdCNkuj/Tuw83VP/gStFQqZHqljyX9/VfMTCdTqtOnJZGN8g== + dependencies: + resize-observer-polyfill "^1.5.1" + vue3-apexcharts@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/vue3-apexcharts/-/vue3-apexcharts-1.4.1.tgz#ea561308430a1c5213b7f17c44ba3c845f6c490d"