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 c7cd055f
authored
Apr 24, 2024
by
史敦盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问题修复
1 parent
ccc0cd26
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
76 deletions
public/drawio/extention/js/exFormat.js
public/drawio/extention/js/exGraph.js
src/api/index.js
src/store/modules/graphData.js
src/views/archiViewConfig/index.vue
src/views/meta-model-list/index.vue
public/drawio/extention/js/exFormat.js
View file @
c7cd055
...
...
@@ -73,67 +73,71 @@ const initAttributePanel = function(that) {
//二次开发-保存属性按钮--------------------------------------------------------------------------
const
save_button
=
document
.
createElement
(
'button'
);
save_button
.
innerHTML
=
'保存'
;
save_button
.
style
.
cssText
=
'padding: 12px 20px;line-height: 1;text-align: right;cursor: pointer;background-color: #0d867f;color: #ffffff;'
;
button_container
.
appendChild
(
save_button
);
that
.
container
.
appendChild
(
button_container
);
// save_button.style.display = propertyList.length > 0 ? 'block' : 'none';
save_button
.
addEventListener
(
'click'
,
()
=>
{
let
fieldsValue
=
[];
console
.
log
(
'propertyList'
,
propertyList
)
// propertyList.forEach(item => {
// propertyArray.push({
// propertyId: item.id,
// propertyValue: item.value
// })
// })
if
(
propertyList
.
length
>
0
)
{
propertyList
.
forEach
((
item
)
=>
{
fieldsValue
.
push
({
id
:
item
.
propertyId
,
cnName
:
item
.
cnName
,
value_
:
item
.
value_
,
controlType
:
item
.
controlType
,
dictKey
:
item
.
dictKey
?
item
.
dictKey
:
null
,
if
(
urlParams
.
page
===
'archiViewManageDetails'
)
{
const
save_button
=
document
.
createElement
(
'button'
);
save_button
.
innerHTML
=
'保存'
;
save_button
.
style
.
cssText
=
'padding: 12px 20px;line-height: 1;text-align: right;cursor: pointer;background-color: #0d867f;color: #ffffff;'
;
button_container
.
appendChild
(
save_button
);
that
.
container
.
appendChild
(
button_container
);
// save_button.style.display = propertyList.length > 0 ? 'block' : 'none';
save_button
.
addEventListener
(
'click'
,
()
=>
{
let
fieldsValue
=
[];
console
.
log
(
'propertyList'
,
propertyList
)
if
(
!
propertyList
.
length
)
return
// propertyList.forEach(item => {
// propertyArray.push({
// propertyId: item.id,
// propertyValue: item.value
// })
// })
if
(
propertyList
.
length
>
0
)
{
propertyList
.
forEach
((
item
)
=>
{
fieldsValue
.
push
({
id
:
item
.
propertyId
,
cnName
:
item
.
cnName
,
value_
:
item
.
value_
,
controlType
:
item
.
controlType
,
dictKey
:
item
.
dictKey
?
item
.
dictKey
:
null
,
})
})
}
else
{
fieldsValue
=
[{}]
}
const
assetName
=
document
.
getElementById
(
'assetName_id'
).
value
const
assetNumber
=
document
.
getElementById
(
'assetNumber_id'
).
value
const
archiEleId
=
document
.
getElementById
(
'archiEleId_id'
).
value
const
params
=
{
assetName
,
assetNumber
,
archiEleId
,
archiBelongId
,
assetId
,
archiAssetState
:
2
,
fieldsValue
,
graphId
,
state
}
console
.
log
(
'params'
,
params
)
$
.
ajax
({
method
:
'post'
,
url
:
`http://
${
ajaxUrl
}
/eadc-architecture/arc-ast-info/upd`
,
data
:
JSON
.
stringify
(
params
),
contentType
:
'application/json'
,
success
:
function
(
res
)
{
if
(
res
.
code
===
200
)
{
alert
(
'保存成功'
)
}
},
error
:
function
(
error
)
{
console
.
error
(
error
)
},
})
}
else
{
fieldsValue
=
[{}]
}
const
assetName
=
document
.
getElementById
(
'assetName_id'
).
value
const
assetNumber
=
document
.
getElementById
(
'assetNumber_id'
).
value
const
archiEleId
=
document
.
getElementById
(
'archiEleId_id'
).
value
const
params
=
{
assetName
,
assetNumber
,
archiEleId
,
archiBelongId
,
assetId
,
archiAssetState
:
2
,
fieldsValue
,
graphId
,
state
}
console
.
log
(
'params'
,
params
)
$
.
ajax
({
method
:
'post'
,
url
:
`http://
${
ajaxUrl
}
/eadc-architecture/arc-ast-info/upd`
,
data
:
JSON
.
stringify
(
params
),
contentType
:
'application/json'
,
success
:
function
(
res
)
{
if
(
res
.
code
===
200
)
{
alert
(
'保存成功'
)
}
},
error
:
function
(
error
)
{
console
.
error
(
error
)
},
})
// window.parent.postMessage({ type: 'saveProperty', data: propertyArray }, '*');
});
// window.parent.postMessage({ type: 'saveProperty', data: propertyArray }, '*');
});
}
// button_container.appendChild(save_button);
// that.container.appendChild(button_container);
...
...
@@ -150,14 +154,14 @@ const initAttributePanel = function(that) {
let
infoList
=
[]
// let haveAttrString = cell.style.match(/info__=\[[^\]]*\];/);
// let stringAttr = haveAttrString[0].split('info__=')[1];
let
str
=
cell
.
style
let
str
=
cell
.
style
.
endsWith
(
';'
)
?
cell
.
style
:
cell
.
style
+
';'
let
startChar
=
"info__="
;
let
endChar
=
";"
;
let
regex
=
new
RegExp
(
`
${
startChar
}
(.*)
${
endChar
}
`
);
let
haveAttrString
=
str
.
match
(
regex
)[
1
].
split
(
';'
)[
0
];
let
haveAttrString
=
str
.
match
(
regex
)
&&
str
.
match
(
regex
)
[
1
].
split
(
';'
)[
0
];
console
.
log
(
'haveAttrString'
,
haveAttrString
)
infoList
=
JSON
.
parse
(
haveAttrString
);
infoList
.
forEach
(
item
=>
{
infoList
&&
infoList
.
forEach
(
item
=>
{
fnAddInfoItem
(
infoContain
,
item
.
name
,
item
.
value
)
})
}
...
...
@@ -202,7 +206,7 @@ const initAttributePanel = function(that) {
}
else
{
// 设置单元格内容
if
(
j
===
0
)
{
cellT
.
textContent
=
propertyList
[
i
].
cnName
;
cellT
.
textContent
=
propertyList
[
i
].
cnName
||
propertyList
[
i
].
name
;
}
else
if
(
j
===
1
)
{
cellT
.
textContent
=
propertyList
[
i
].
dataType
;
}
else
if
(
j
===
2
)
{
...
...
@@ -223,13 +227,13 @@ const initAttributePanel = function(that) {
let
infoList1
=
[]
// let haveAttrString1 = cell.style.match(/info__=\[[^\]]*\]/);
// let stringAttr = haveAttrString1[0].split('info__=')[1];
let
str
=
cell
.
style
let
str
=
cell
.
style
.
endsWith
(
';'
)
?
cell
.
style
:
cell
.
style
+
';'
let
startChar
=
"info__="
;
let
endChar
=
";"
;
let
regex
=
new
RegExp
(
`
${
startChar
}
(.*)
${
endChar
}
`
);
let
stringAttr
=
str
.
match
(
regex
)[
1
].
split
(
';'
)[
0
];
let
stringAttr
=
str
.
match
(
regex
)
&&
str
.
match
(
regex
)
[
1
].
split
(
';'
)[
0
];
infoList1
=
JSON
.
parse
(
stringAttr
);
infoList1
.
forEach
(
item
=>
{
infoList1
&&
infoList1
.
forEach
(
item
=>
{
fnAddInfoItemCanEdit
(
that
.
container
,
item
.
name
,
item
.
value
,
100
,
item
.
element
)
})
}
...
...
@@ -358,10 +362,10 @@ const initAttributePanel = function(that) {
const
archiData
=
res
.
data
;
archiData
.
forEach
((
v
,
i
)
=>
{
var
option1
=
document
.
createElement
(
"option"
);
option1
.
value
=
v
.
elementId
;
option1
.
text
=
v
.
elementName
;
if
(
v
.
elementName
==
c
.
value
)
{
c
.
text
=
v
.
elementName
option1
.
value
=
v
.
parentElement
;
option1
.
text
=
v
.
parentElement
;
if
(
v
.
parentElement
==
c
.
value
)
{
c
.
text
=
v
.
parentElement
c
.
options
[
i
].
selected
=
true
}
c
.
appendChild
(
option1
);
...
...
public/drawio/extention/js/exGraph.js
View file @
c7cd055
...
...
@@ -101,7 +101,7 @@
fns
.
push
(
this
.
createVertexTemplateEntry
(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#d2edfd;shape=mxgraph.archimate3.application;appType=rightTopCircleHasLeft;archiType=rounded',
item2
.
iconName
+
';attr='
+
JSON
.
stringify
(
attr_
)
+
';info__='
+
JSON
.
stringify
(
info__
),
item2
.
iconName
+
';attr='
+
JSON
.
stringify
(
attr_
)
+
';info__='
+
JSON
.
stringify
(
info__
)
+
';'
,
item2
.
shapeWidth
?
item2
.
shapeWidth
:
71
,
item2
.
shapeHeight
?
item2
.
shapeHeight
:
41
,
null
,
...
...
src/api/index.js
View file @
c7cd055
...
...
@@ -837,6 +837,10 @@ export function getOrgOption(params) {
export
function
getDeptOption
(
params
)
{
return
post
(
EADC_SHARED_ABILITY
+
`/org/getDeptOption`
,
params
)
}
// 总体架构资产自动图形化
export
function
getAutomaticGraphing
(
params
)
{
return
post
(
EADC_ARRCHITECTURE
+
'/archi-asset-view/automaticGraphing'
,
params
)
}
export
function
postRequest
(
url
,
params
)
{
return
post
(
EADC_ARRCHITECTURE
+
url
,
params
)
}
...
...
src/store/modules/graphData.js
0 → 100644
View file @
c7cd055
const
state
=
{
graphData
:
[]
}
const
mutations
=
{
CHANGE_GRAPH_DATA
:
(
state
,
data
)
=>
{
state
.
graphData
=
data
}
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
}
\ No newline at end of file
src/views/archiViewConfig/index.vue
View file @
c7cd055
...
...
@@ -838,8 +838,8 @@ export default {
this
.
getDicyTable
()
this
.
formData
=
{
...
item
,
archiLevelId
:
this
.
formData
.
archiLevelId
.
toString
(),
archiBelongId
:
this
.
formData
.
archiBelongId
.
toString
(),
archiLevelId
:
item
.
archiLevelId
.
toString
(),
archiBelongId
:
item
.
archiBelongId
.
toString
(),
}
this
.
transferValue1
=
this
.
formData
.
archiEleId
.
split
(
','
)
...
...
@@ -884,8 +884,8 @@ export default {
this
.
getDicyTable
()
this
.
formData
=
{
...
item
,
archiLevelId
:
this
.
formData
.
archiLevelId
.
toString
(),
archiBelongId
:
this
.
formData
.
archiBelongId
.
toString
(),
archiLevelId
:
item
.
archiLevelId
.
toString
(),
archiBelongId
:
item
.
archiBelongId
.
toString
(),
}
this
.
transferValue1
=
this
.
formData
.
archiEleId
.
split
(
','
)
...
...
src/views/meta-model-list/index.vue
View file @
c7cd055
...
...
@@ -305,7 +305,7 @@ export default {
const
version
=
res2
.
data
.
version
;
localStorage
.
setItem
(
'xmlData'
,
xmlData
);
localStorage
.
setItem
(
'xmlTitle'
,
xmlTitle
);
this
.
$router
.
push
(
`/main/metaModelListDetails?id=
${
res
.
data
}
&info=
${
version
}
`
,
()
=>
{},
()
=>
{}
);
this
.
$router
.
push
(
`/main/metaModelListDetails?id=
${
res
.
data
}
&info=
${
version
}
&page=metaModelListDetails&referenceId=
${
res
.
data
}
`
,
()
=>
{},
()
=>
{}
);
}
});
}
else
{
...
...
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