Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
78e65838
authored
Feb 17, 2025
by
lizhixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决流程图预览,控制台v-highlight过多告警问题
parent
903428d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
+16
-6
No files found.
src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
View file @
78e65838
...
...
@@ -188,12 +188,8 @@
:scroll=
"true"
max-height=
"600px"
>
<!-- append-to-body -->
<div
v-highlight
>
<code
class=
"hljs"
>
<!-- 高亮代码块 -->
{{ previewResult }}
</code>
<div>
<pre><code
v-dompurify-html=
"highlightedCode(previewResult)"
class=
"hljs"
></code></pre>
</div>
</Dialog>
</div>
...
...
@@ -237,6 +233,8 @@ import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
// const eventName = reactive({
// name: ''
// })
import
hljs
from
'highlight.js'
// 导入代码高亮文件
import
'highlight.js/styles/github.css'
// 导入代码高亮样式
defineOptions
({
name
:
'MyProcessDesigner'
})
...
...
@@ -308,6 +306,18 @@ const props = defineProps({
}
})
/**
* 代码高亮
*/
const
highlightedCode
=
(
code
:
string
)
=>
{
// 高亮
if
(
previewType
.
value
===
'json'
)
{
code
=
JSON
.
stringify
(
code
,
null
,
2
)
}
const
result
=
hljs
.
highlight
(
code
,
{
language
:
previewType
.
value
,
ignoreIllegals
:
true
})
return
result
.
value
||
' '
}
provide
(
'configGlobal'
,
props
)
let
bpmnModeler
:
any
=
null
const
defaultZoom
=
ref
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment