diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm index 9c31d0d6..f12eb2f3 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm @@ -64,7 +64,7 @@ #end #end - 搜索 + 搜索 重置 @@ -73,6 +73,7 @@ - 搜索 + 搜索 重置 @@ -73,6 +73,7 @@ // fuse is a lightweight fuzzy-search module // make search results more in line with expectations -import Fuse from 'fuse.js' +import Fuse from 'fuse.js/dist/fuse.min.js' import path from 'path' export default { diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 9d680d97..e81fda33 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -21,9 +21,6 @@ import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, import Pagination from "@/components/Pagination"; // 自定义表格工具扩展 import RightToolbar from "@/components/RightToolbar" -// 代码高亮插件 -import hljs from 'highlight.js' -import 'highlight.js/styles/github-gist.css' // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -53,7 +50,6 @@ Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) Vue.use(permission) -Vue.use(hljs.vuePlugin); /** * If you don't want to use mock-server diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index 79821257..d11de4a9 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -31,7 +31,7 @@ - 搜索 + 搜索 重置 @@ -40,6 +40,7 @@ - 搜索 + 搜索 重置 @@ -65,6 +65,7 @@ - 搜索 + 搜索 重置 diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index 7c2f3e98..13c71133 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -44,7 +44,7 @@ > - 搜索 + 搜索 重置 @@ -53,6 +53,7 @@ - 搜索 + 搜索 重置 @@ -30,6 +30,7 @@ - 搜索 + 搜索 重置 @@ -40,6 +40,7 @@ - 搜索 + 搜索 重置 @@ -59,6 +59,7 @@ - 搜索 + 搜索 重置 @@ -59,6 +59,7 @@ - 搜索 + 搜索 重置 @@ -30,6 +30,7 @@ - 搜索 + 搜索 重置 @@ -39,6 +39,7 @@ - 搜索 + 搜索 重置 @@ -75,6 +75,7 @@ - 搜索 + 搜索 重置 @@ -39,6 +39,7 @@ - 搜索 + 搜索 重置 @@ -59,6 +59,7 @@ - 搜索 + 搜索 重置 @@ -86,6 +86,7 @@ - 搜索 + 搜索 重置 @@ -41,6 +41,7 @@ - +
@@ -177,6 +181,14 @@ import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; import importTable from "./importTable"; import { downLoadZip } from "@/utils/zipdownload"; +import hljs from "highlight.js/lib/highlight"; +import "highlight.js/styles/github-gist.css"; +hljs.registerLanguage("java", require("highlight.js/lib/languages/java")); +hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); +hljs.registerLanguage("html", require("highlight.js/lib/languages/xml")); +hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml")); +hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript")); +hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql")); export default { name: "Gen", @@ -290,6 +302,13 @@ export default { this.preview.open = true; }); }, + /** 高亮显示 */ + highlightedCode(code, key) { + const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm")); + var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length); + const result = hljs.highlight(language, code || "", true); + return result.value || ' '; + }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.tableId);