Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
liangzhen
/
framework-tools-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 379ee7f3
authored
Dec 11, 2023
by
liuyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改资产管理
1 parent
d991924a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
24 deletions
public/drawio/js/diagramly/App.js
public/drawio/js/diagramly/EditorUi.js
src/components/drawio.vue
src/views/busi-assets-list/index.vue
public/drawio/js/diagramly/App.js
View file @
379ee7f
...
...
@@ -3764,27 +3764,34 @@ App.prototype.showSplash = function(force)
this
.
showSplash
();
}));
}
else
if
(
urlParams
[
'id'
])
{
//二次开发,初始化画面内容
$
.
ajax
({
method
:
"post"
,
url
:
'http://43.143.211.42:7003/ynMol/getByMetaModelId'
,
data
:
{
metaModelId
:
urlParams
[
'id'
]
},
// dataType: "xml",
// contentType: "application/xml",
// crossDomain: true,
success
:
result
=>
{
// console.log(result)
const
xmlData
=
result
.
data
.
metaModelData
;
const
xmlTitle
=
result
.
data
.
verName
;
const
file
=
new
LocalFile
(
this
,
xmlData
,
xmlTitle
,
this
.
mode
);
this
.
loadFile
(
`-1`
,
true
,
file
);
},
error
:
error
=>
{
}
});
if
(
urlParams
[
'id'
]
==
2
)
{
var
mockFile
=
loadDiagram
(
urlParams
[
'id'
],
'业务架构资产管理'
);
const
file
=
new
LocalFile
(
this
,
mockFile
.
data
,
mockFile
.
title
,
this
.
mode
);
this
.
loadFile
(
`-2`
,
true
,
file
);
}
else
{
$
.
ajax
({
method
:
"post"
,
url
:
'http://43.143.211.42:7003/ynMol/getByMetaModelId'
,
data
:
{
metaModelId
:
urlParams
[
'id'
]
},
// dataType: "xml",
// contentType: "application/xml",
// crossDomain: true,
success
:
result
=>
{
// console.log(result)
const
xmlData
=
result
.
data
.
metaModelData
;
const
xmlTitle
=
result
.
data
.
verName
;
const
file
=
new
LocalFile
(
this
,
xmlData
,
xmlTitle
,
this
.
mode
);
this
.
loadFile
(
`-1`
,
true
,
file
);
},
error
:
error
=>
{
}
});
}
}
else
if
(
!
mxClient
.
IS_CHROMEAPP
&&
(
this
.
mode
==
null
||
force
))
{
var
rowLimit
=
(
serviceCount
==
4
)
?
2
:
3
;
...
...
public/drawio/js/diagramly/EditorUi.js
View file @
379ee7f
...
...
@@ -2029,6 +2029,7 @@
if
(
format
==
'svg'
)
{
var
bg
=
this
.
editor
.
graph
.
background
;
if
(
transparent
||
bg
==
mxConstants
.
NONE
)
...
...
@@ -2055,6 +2056,7 @@
}
else
{
filename
=
basename
+
'.svg'
;
svg
=
this
.
getFileData
(
false
,
true
,
null
,
mxUtils
.
bind
(
this
,
function
(
svg
)
...
...
@@ -5638,13 +5640,14 @@
bg
=
(
theme
==
'dark'
&&
!
Editor
.
enableSvgDarkMode
)
?
Editor
.
darkColor
:
'#ffffff'
;
}
//二次开发,保存的时候保存为svg格式
// Sets or disables alternate text for foreignObjects. Disabling is needed
// because PhantomJS seems to ignore switch statements and paint all text.
var
svgRoot
=
this
.
editor
.
graph
.
getSvg
(
bg
,
scale
,
border
,
noCrop
,
null
,
ignoreSelection
,
null
,
null
,
(
linkTarget
==
'blank'
)
?
'_blank'
:
((
linkTarget
==
'self'
)
?
'_top'
:
null
),
null
,
!
embedFonts
,
theme
,
exportType
);
// console.log(svgRoot)
if
(
addShadow
)
{
this
.
editor
.
graph
.
addSvgShadow
(
svgRoot
);
...
...
@@ -5678,7 +5681,7 @@
svgRoot
.
setAttribute
(
'content'
,
this
.
getFileData
(
true
,
null
,
null
,
null
,
ignoreSelection
,
currentPage
,
null
,
null
,
null
,
false
));
}
saveFn
(
Graph
.
xmlDeclaration
+
'\n'
+
((
editable
)
?
Graph
.
svgFileComment
+
'\n'
:
''
)
+
Graph
.
svgDoctype
+
'\n'
+
mxUtils
.
getXml
(
svgRoot
));
});
...
...
src/components/drawio.vue
View file @
379ee7f
...
...
@@ -23,6 +23,7 @@
watch
:
{
initGraphId
:
{
handler
(
newVal
,
oldVal
)
{
// console.log(newVal)
this
.
id
=
newVal
.
id
;
this
.
version
=
newVal
.
version
;
this
.
state
=
newVal
.
state
;
...
...
src/views/busi-assets-list/index.vue
View file @
379ee7f
...
...
@@ -12,7 +12,7 @@
</el-tree>
</div>
<div
class=
"right_container"
>
<Drawio
initGraphId=
"2
"
></Drawio>
<Drawio
:initGraphId=
"routerId
"
></Drawio>
</div>
</div>
</
template
>
...
...
@@ -32,6 +32,7 @@
},
data
()
{
return
{
routerId
:
null
,
filterText
:
''
,
treeData
:
[
{
...
...
@@ -87,6 +88,16 @@
]
};
},
mounted
(){
const
id
=
2
;
// const version = window.location.href.split("id=")[1].split("&")[1].split("=")[1];
// const state = window.location.href.split("id=")[1].split("&")[2].split("=")[1];
this
.
routerId
=
{
id
:
id
,
version
:
0
,
state
:
0
}
},
methods
:
{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment