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 a874dd7e
authored
Apr 18, 2024
by
史敦盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
架构视图属性修改,架构视图管理修改
1 parent
44be0b50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
123 additions
and
51 deletions
public/drawio/extention/js/exFormat.js
public/drawio/extention/js/exGraph.js
src/views/archi-view-manage/canvas/index.vue
src/views/archi-view-manage/index.vue
src/views/busi-assets-list/index.vue
public/drawio/extention/js/exFormat.js
View file @
a874dd7
...
...
@@ -103,14 +103,12 @@ const initAttributePanel = function(that) {
let
stringAttr
=
haveAttrString
[
0
].
split
(
'info__='
)[
1
];
infoList
=
JSON
.
parse
(
stringAttr
);
infoList
.
forEach
(
item
=>
{
fnAddInfoItem
(
that
,
item
.
name
,
item
.
value
)
fnAddInfoItem
(
infoContain
,
item
.
name
,
item
.
value
)
})
}
}
// 添加基本信息方法
function
fnAddInfoItem
(
that
,
name
,
value
)
{
function
fnAddInfoItem
(
contain
,
name
,
value
)
{
const
infoItemContain
=
document
.
createElement
(
'div'
);
infoItemContain
.
style
.
cssText
=
'display: flex;padding: 4px 0'
;
const
nameSpan
=
document
.
createElement
(
'span'
);
...
...
@@ -121,17 +119,65 @@ const initAttributePanel = function(that) {
valueSpan
.
innerHTML
=
value
infoItemContain
.
appendChild
(
nameSpan
);
infoItemContain
.
appendChild
(
valueSpan
);
infoC
ontain
.
appendChild
(
infoItemContain
);
c
ontain
.
appendChild
(
infoItemContain
);
}
// 添加属性信息
if
(
propertyList
.
length
>
0
)
{
let
propertyTitleDom
=
document
.
createElement
(
'div'
);
propertyTitleDom
.
style
.
cssText
=
'font-weight: bold;padding-left: 10px;padding-top: 10px;'
;
propertyTitleDom
.
innerHTML
=
'属性信息'
;
that
.
container
.
appendChild
(
propertyTitleDom
);
propertyList
.
forEach
(
item
=>
{
addListPanel
(
that
,
propertyList
,
item
.
name
,
item
.
value
,
item
.
controlType
);
})
if
(
urlParams
.
page
===
'metaModelListDetails'
)
{
let
propertyTitleDom
=
document
.
createElement
(
'div'
);
propertyTitleDom
.
style
.
cssText
=
'font-weight: bold;padding-left: 10px;padding-top: 10px;'
;
propertyTitleDom
.
innerHTML
=
'属性信息'
;
that
.
container
.
appendChild
(
propertyTitleDom
);
var
table
=
document
.
createElement
(
"table"
);
table
.
style
.
borderCollapse
=
'collapse'
;
// 边框合并
table
.
style
.
whiteSpace
=
'normal'
;
// 边框合并
const
tableColumn
=
[
'属性名称'
,
'属性类型'
,
'值选项'
]
for
(
var
i
=
0
;
i
<
propertyList
.
length
;
i
++
)
{
var
row
=
document
.
createElement
(
"tr"
);
row
.
style
.
border
=
'1px solid black'
;
// 设置行边框
console
.
log
(
'propertyList[i]'
,
propertyList
[
i
])
// 创建表格单元格
for
(
var
j
=
0
;
j
<
tableColumn
.
length
;
j
++
)
{
var
cellT
=
document
.
createElement
(
"td"
);
cellT
.
style
.
cssText
=
'text-align: left;'
;
cellT
.
style
.
border
=
'1px solid black'
;
if
(
i
===
0
)
{
cellT
.
textContent
=
tableColumn
[
j
]
}
else
{
// 设置单元格内容
if
(
j
===
0
)
{
cellT
.
textContent
=
propertyList
[
i
].
name
;
}
else
if
(
j
===
1
)
{
cellT
.
textContent
=
propertyList
[
i
].
dataType
;
}
else
if
(
j
===
2
)
{
cellT
.
textContent
=
propertyList
[
i
].
dictKey
}
}
// 将单元格添加到行
row
.
appendChild
(
cellT
);
}
// 将行添加到表格
table
.
appendChild
(
row
);
}
that
.
container
.
appendChild
(
table
);
}
else
{
if
(
urlParams
.
page
===
'archiViewManageDetails'
)
{
if
(
cell
.
style
.
includes
(
'info__='
))
{
//属性列表
let
infoList
=
[]
let
haveAttrString
=
cell
.
style
.
match
(
/info__=
\[[^\]]
*
\]
/
);
let
stringAttr
=
haveAttrString
[
0
].
split
(
'info__='
)[
1
];
infoList
=
JSON
.
parse
(
stringAttr
);
infoList
.
forEach
(
item
=>
{
fnAddInfoItem
(
that
.
container
,
item
.
name
,
item
.
value
)
})
}
}
propertyList
.
forEach
(
item
=>
{
addListPanel
(
that
,
propertyList
,
item
.
name
,
item
.
value
,
item
.
controlType
);
})
}
}
// let currentNode = graph.getModel().getValue(cell);//获取没有属性的节点,返回的是文字
...
...
@@ -167,16 +213,16 @@ const initAttributePanel = function(that) {
}
const
addListPanel
=
function
(
that
,
originAttr
,
attrName_
,
attrValue_
,
controlType
)
{
const
add_item_container
=
document
.
createElement
(
'div'
);
add_item_container
.
style
.
cssText
=
'display: flex;justify-content: space-between;padding: 10px;'
;
add_item_container
.
style
.
cssText
=
'display: flex;justify-content: space-between;padding:
4px
10px;'
;
add_item_container
.
className
=
'add_item_container'
;
//属性名--------------------------------------------------------------------
const
item_left_container
=
document
.
createElement
(
'div'
);
item_left_container
.
style
.
cssText
=
'display: flex;width: 100%;'
;
const
item_left_span
=
document
.
createElement
(
'span'
);
item_left_span
.
innerHTML
=
attrName_
+
': '
;
const
item_left_span
=
document
.
createElement
(
'span'
);
item_left_span
.
innerHTML
=
attrName_
;
// + ': ';
// const item_left_input = document.createElement('input');
// item_left_input.type = "text";
...
...
@@ -197,6 +243,11 @@ const addListPanel = function(that, originAttr, attrName_, attrValue_, controlTy
const
item_right_container
=
document
.
createElement
(
'div'
);
item_right_container
.
style
.
cssText
=
'margin-right: 15px;;margin-left: 5px;display: flex;justify-content: space-between;width: 70%;'
;
const
valueSpan
=
document
.
createElement
(
'span'
);
valueSpan
.
style
.
cssText
=
'white-space: normal;'
valueSpan
.
innerHTML
=
attrValue_
item_right_container
.
appendChild
(
valueSpan
);
// const item_right_span = document.createElement('span');
// item_right_span.innerHTML = '属性值: ';
...
...
public/drawio/extention/js/exGraph.js
View file @
a874dd7
...
...
@@ -78,22 +78,24 @@
value
:
res
.
propertyValue
,
id
:
res
.
propertyId
,
controlType
:
res
.
controlType
,
dataType
:
res
.
dataType
,
dictKey
:
res
.
dictKey
,
}
)
}
})
let
info__
=
[{
name
:
'元素名称'
,
value
:
item2
.
eleName
value
:
item2
.
eleName
||
''
},{
name
:
'定义'
,
value
:
item2
.
definition
value
:
item2
.
definition
||
''
},{
name
:
'引用关系'
,
value
:
item2
.
referenceRelationship
value
:
item2
.
referenceRelationship
||
''
},{
name
:
'示例'
,
value
:
item2
.
example
value
:
item2
.
example
||
''
}];
fns
.
push
(
...
...
@@ -154,11 +156,27 @@
})
item2
.
assets
.
forEach
(
item3
=>
{
let
info__
=
[{
name
:
'资产名称'
,
value
:
item3
.
assetName
||
''
},{
name
:
'资产编号'
,
value
:
item3
.
assetNumber
||
''
},{
name
:
'所属元素'
,
value
:
item3
.
eleName
||
''
},{
name
:
'上级元素'
,
value
:
item3
.
parentElement
||
''
},{
name
:
'上级资产'
,
value
:
item3
.
parentAssetName
||
''
}];
// console.log(item3.fieldsValue)
fns
.
push
(
this
.
createVertexTemplateEntry
(
// 'html=1;outlineConnect=0;whiteSpace=wrap;fillColor=#99ffff;shape=mxgraph.archimate3.application;appType=rightTopTriangle;archiType=rounded',
item3
.
iconName
+
(
item3
.
color
?
`;fillColor=
${
item3
.
color
}
;`
:
''
)
+
'attr='
+
JSON
.
stringify
(
attr
_
)
+
';assetId='
+
item3
.
assetId
+
';archiBelongId='
+
item3
.
archiBelongId
+
';assetName=['
+
item3
.
assetName
+
'];eleName='
+
item2
.
eleName
+
';elementId='
+
item2
.
elementId
+
';eaLevel='
+
item2
.
eaLevel
+
';'
,
item3
.
iconName
+
(
item3
.
color
?
`;fillColor=
${
item3
.
color
}
;`
:
''
)
+
'attr='
+
JSON
.
stringify
(
attr_
)
+
';info__='
+
JSON
.
stringify
(
info_
_
)
+
';assetId='
+
item3
.
assetId
+
';archiBelongId='
+
item3
.
archiBelongId
+
';assetName=['
+
item3
.
assetName
+
'];eleName='
+
item2
.
eleName
+
';elementId='
+
item2
.
elementId
+
';eaLevel='
+
item2
.
eaLevel
+
';'
,
item2
.
shapeWidth
?
item2
.
shapeWidth
:
150
,
item2
.
shapeHeight
?
item2
.
shapeHeight
:
75
,
null
,
...
...
src/views/archi-view-manage/canvas/index.vue
View file @
a874dd7
...
...
@@ -100,11 +100,12 @@
// const id = this.$route.query.id;
// const graphGroup = this.$route.query.info;
const
{
id
,
info
,
referenceId
}
=
this
.
$route
.
query
const
{
id
,
info
,
referenceId
,
page
}
=
this
.
$route
.
query
this
.
routerId
=
{
id
:
id
,
info
,
referenceId
referenceId
,
page
}
window
.
onmessage
=
e
=>
{
...
...
src/views/archi-view-manage/index.vue
View file @
a874dd7
...
...
@@ -584,7 +584,7 @@ export default {
JSON
.
stringify
({
state
:
2
,
graph
:
res2
[
2
].
dataEle
}),
)
this
.
$router
.
push
(
`/main/archiViewManageDetails?id=
${
id
}
&info=
${
this
.
graphGroup
}
&viewId=
${
this
.
viewId
}
&assetConstant=
${
this
.
archiType
}
&referenceId=
${
item
.
viewDetailsId
}
`
)
`/main/archiViewManageDetails?id=
${
id
}
&info=
${
this
.
graphGroup
}
&viewId=
${
this
.
viewId
}
&assetConstant=
${
this
.
archiType
}
&referenceId=
${
item
.
viewDetailsId
}
&page=archiViewManageDetails
`
)
})
}
}).
catch
(()
=>
{
...
...
src/views/busi-assets-list/index.vue
View file @
a874dd7
...
...
@@ -1059,7 +1059,7 @@ export default {
this
.
getZuJianLeiXingSelect
(
null
).
then
((
res
)
=>
{
this
.
zuJianLeiXingSelect
=
res
if
(
this
.
ruleForm
.
let3
)
{
this
.
zuJianLeiXingSelectChange
(
this
.
ruleForm
.
let3
)
this
.
zuJianLeiXingSelectChange
(
this
.
ruleForm
.
let3
,
true
)
}
})
this
.
ruleForm
.
let4
=
row
.
sort
...
...
@@ -1135,7 +1135,7 @@ export default {
(
item
)
=>
item
.
elementId
==
this
.
ruleForm
.
let3
,
)
if
(
this
.
ruleForm
.
let3
)
{
this
.
zuJianLeiXingSelectChange
(
this
.
ruleForm
.
let3
)
this
.
zuJianLeiXingSelectChange
(
this
.
ruleForm
.
let3
,
true
)
}
if
(
currentItem
&&
currentItem
.
eaLevel
==
1
)
{
this
.
disabled1
=
true
...
...
@@ -1307,7 +1307,7 @@ export default {
this
.
getShangJiJieDianSelect
(
data
)
},
zuJianLeiXingSelectChange
(
data
)
{
zuJianLeiXingSelectChange
(
data
,
flag
)
{
//所属元素选择后
// console.log(data)
...
...
@@ -1322,31 +1322,33 @@ export default {
}
else
{
this
.
disabled1
=
false
}
// if (data) {
// const params = {
// type: '1',
// typeId: data,
// }
// queryZuJianLeiXingBelongForm(params).then((res) => {
// if (res.code == 200) {
// if (res.data.length > 0) {
// res.data.map((item) => {
// if (item.controlType == 2) {
// this.get_key(item.dictKey).then((res2) => {
// this.$set(item, 'dictArray_', res2)
// })
// }
// item['value_'] = ''
// })
// this.ruleForm.dynamicForm_ = res.data
// } else {
// this.ruleForm.dynamicForm_ = []
// }
// }
// })
// } else {
// this.ruleForm.dynamicForm_ = []
// }
if
(
data
&&
!
flag
)
{
console
.
log
(
'------'
)
const
params
=
{
type
:
'1'
,
typeId
:
data
,
}
queryZuJianLeiXingBelongForm
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
if
(
res
.
data
.
length
>
0
)
{
res
.
data
.
map
((
item
)
=>
{
if
(
item
.
controlType
==
2
)
{
this
.
get_key
(
item
.
dictKey
).
then
((
res2
)
=>
{
this
.
$set
(
item
,
'dictArray_'
,
res2
)
})
}
item
[
'value_'
]
=
''
})
this
.
ruleForm
.
dynamicForm_
=
res
.
data
}
else
{
this
.
ruleForm
.
dynamicForm_
=
[]
}
}
})
}
else
{
if
(
!
flag
)
{
this
.
ruleForm
.
dynamicForm_
=
[]
}
}
},
queryZuJianLeiXingSelect
(
data
)
{
//所属元素搜索
...
...
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