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
aba4705b
authored
Jan 14, 2025
by
lizhixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:表单构建页面,json显示和生成问题
parent
e9950929
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
src/views/infra/build/index.vue
+7
-5
No files found.
src/views/infra/build/index.vue
View file @
aba4705b
...
...
@@ -135,7 +135,8 @@ const makeTemplate = () => {
/** 复制 **/
const
copy
=
async
(
text
:
string
)
=>
{
const
{
copy
,
copied
,
isSupported
}
=
useClipboard
({
source
:
text
})
const
textToCopy
=
JSON
.
stringify
(
text
,
null
,
2
)
const
{
copy
,
copied
,
isSupported
}
=
useClipboard
({
source
:
textToCopy
})
if
(
!
isSupported
)
{
message
.
error
(
t
(
'common.copyError'
))
}
else
{
...
...
@@ -149,18 +150,19 @@ const copy = async (text: string) => {
/**
* 代码高亮
*/
const
highlightedCode
=
(
code
)
=>
{
const
highlightedCode
=
(
code
:
string
)
=>
{
// 处理语言和代码
let
language
=
'json'
if
(
formType
.
value
===
2
)
{
language
=
'xml'
}
// debugger
if
(
!
isString
(
code
))
{
code
=
JSON
.
stringify
(
code
)
code
=
JSON
.
stringify
(
code
,
null
,
2
)
}
// 高亮
const
result
=
hljs
.
highlight
(
language
,
code
,
true
)
return
result
.
value
||
' '
const
result
=
hljs
.
highlight
(
code
,
{
language
:
language
,
ignoreIllegals
:
true
}
)
return
result
.
value
}
/** 初始化 **/
...
...
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