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
9febee7a
authored
Jan 16, 2025
by
zws
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 用download.json 替换模型json下载
parent
e44f48c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
+2
-12
No files found.
src/components/SimpleProcessDesignerV2/src/SimpleProcessModel.vue
View file @
9febee7a
...
...
@@ -51,6 +51,7 @@ import { SimpleFlowNode, NodeType, NODE_DEFAULT_TEXT } from './consts'
import
{
useWatchNode
}
from
'./node'
import
{
ZoomOut
,
ZoomIn
,
ScaleToOriginal
}
from
'@element-plus/icons-vue'
import
{
isString
}
from
'@/utils/is'
import
download
from
"@/utils/download"
;
defineOptions
({
name
:
'SimpleProcessModel'
...
...
@@ -174,18 +175,7 @@ defineExpose({
/** 导出 JSON */
// TODO @zws:增加一个 download 里面搞个 json 更好
const
exportJson
=
()
=>
{
const
blob
=
new
Blob
([
JSON
.
stringify
(
processNodeTree
.
value
)])
const
tempLink
=
document
.
createElement
(
'a'
)
// 创建a标签
const
href
=
window
.
URL
.
createObjectURL
(
blob
)
// 创建下载的链接
// filename
const
fileName
=
`model.json`
tempLink
.
href
=
href
tempLink
.
target
=
'_blank'
tempLink
.
download
=
fileName
document
.
body
.
appendChild
(
tempLink
)
tempLink
.
click
()
// 点击下载
document
.
body
.
removeChild
(
tempLink
)
// 下载完成移除元素
window
.
URL
.
revokeObjectURL
(
href
)
// 释放掉 blob 对象
download
.
json
(
new
Blob
([
JSON
.
stringify
(
processNodeTree
.
value
)]),
'model.json'
)
}
/** 导入 JSON */
...
...
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