diff --git a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue index f45dc194c..ddd9a4da6 100644 --- a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue +++ b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue @@ -80,8 +80,8 @@
- - + +
@@ -107,6 +107,12 @@ import flowableModdleExtension from "./plugins/extension-moddle/flowable"; // 引入json转换与高亮 import convert from "xml-js"; +// 代码高亮插件 +import hljs from "highlight.js/lib/highlight"; +import "highlight.js/styles/github-gist.css"; +hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml")); +hljs.registerLanguage("json", require("highlight.js/lib/languages/json")); + export default { name: "MyProcessDesigner", componentName: "MyProcessDesigner", @@ -463,7 +469,12 @@ export default { } // 触发 save 事件 this.$emit('save', xml) - } + }, + /** 高亮显示 */ + highlightedCode(previewType, previewResult) { + const result = hljs.highlight(previewType, previewResult || "", true); + return result.value || ' '; + }, } }; diff --git a/yudao-admin-ui/src/views/tool/codegen/index.vue b/yudao-admin-ui/src/views/tool/codegen/index.vue index c2e1b439b..56ebeecf9 100644 --- a/yudao-admin-ui/src/views/tool/codegen/index.vue +++ b/yudao-admin-ui/src/views/tool/codegen/index.vue @@ -125,8 +125,6 @@ import importTable from "./importTable"; // 代码高亮插件 import hljs from "highlight.js/lib/highlight"; import "highlight.js/styles/github-gist.css"; -import {SysCommonStatusEnum} from "@/utils/constants"; -import {createTestDemo, updateTestDemo} from "@/api/tool/testDemo"; 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"));