Commit adc1aae5 by songchangcheng

增加动态读取架构设计要素信息

1 parent 7bd34f4a
{
"eadata": [{
"id" : "busi-archi-chart",
"type" : "business-ea",
"title" : "业务架构",
"elements" : [{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "长方形",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "长方形",
"w" : 100,
"h" : 50,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "矩形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "appl-archi-chart",
"type" : "appl-ea",
"title" : "应用架构",
"elements" : [{
"name" : "原型",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "菱形",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "data-archi-chart",
"type" : "data-ea",
"title" : "数据架构",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"id" : "tech-archi-chart",
"type" : "tech-ea",
"title" : "技术架构",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
},{
"type" : "secr-ea",
"title" : "安全架构",
"id" : "secr-archi-chart",
"elements" : [{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
},{
"name" : "",
"w" : 50,
"h" : 100,
"showLable" : "",
"styles" : "strokeWidth=2;html=1;shape=mxgraph.eachart.annotation_2;align=left;labelPosition=right;pointerEvents=1;"
}]
}]
}
\ No newline at end of file
...@@ -158,7 +158,7 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-AlliedTelesis.js'); ...@@ -158,7 +158,7 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-AlliedTelesis.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Android.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Android.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate.js');
// 20231122 汪皖苏 自定义更多图形 // 20231122 汪皖苏 自定义更多图形
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate4.js'); // mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate4.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate3.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiMate3.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Arrows2.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Arrows2.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Atlassian.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Atlassian.js');
...@@ -185,6 +185,8 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Electrical.js'); ...@@ -185,6 +185,8 @@ mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Electrical.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ER.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ER.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Floorplan.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Floorplan.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Flowchart.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-Flowchart.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-ArchiEA.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-FluidPower.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-FluidPower.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP.js');
mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP2.js'); mxscript(drawDevUrl + 'js/diagramly/sidebar/Sidebar-GCP2.js');
......
(function()
{
Sidebar.prototype.addEAPalette = function()
{
this.setCurrentSearchEntryLibrary('eachart');
$.ajax({
url: '/drawio/eachart.json', // 代表请求的服务器地址
method: 'get', // 使用的请求方法
contentType: 'application/x-www-form-urlencoded', // 请求的 enctype
dataType: 'json', // 默认根据 response 头部的信息自动推测
async: true, // 是否使用异步请求的方式
}).done((data) => {
var ea = data.eadata;
if(ea) {
ea.forEach(ele => {
var ii = ele.elements;
var items = [];
ii.forEach(element => {
items.push(this.createVertexTemplateEntry(element.styles, element.w, element.h, null, element.name, null, null, element.name));
});
this.addPaletteFunctions(ea.id, ele.title, false, items);
});
}
});
this.setCurrentSearchEntryLibrary();
};
})();
...@@ -75,9 +75,7 @@ ...@@ -75,9 +75,7 @@
'Data Object', null, null, this.getTagsForStencil(gn, '', dt + 'data object').join(' ')) 'Data Object', null, null, this.getTagsForStencil(gn, '', dt + 'data object').join(' '))
]; ];
// this.addPalette('archimate3Application', 'Archimate 3.0 / Application', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Application', 'Archimate 3.0 / Application', false, mxUtils.bind(this, function(content)
// 二次开发 20231117 wangwansu ArchiMate 3.0英文改中文
this.addPalette('archimate3Application', '架构 / 应用', false, mxUtils.bind(this, function(content)
{ {
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
...@@ -148,8 +146,7 @@ ...@@ -148,8 +146,7 @@
w * 150, h * 90, '', 'Representation', null, null, this.getTagsForStencil(gn, '', dt + 'representation').join(' ')) w * 150, h * 90, '', 'Representation', null, null, this.getTagsForStencil(gn, '', dt + 'representation').join(' '))
]; ];
// this.addPalette('archimate3Business', 'archimate 3.0 / Business', true, mxUtils.bind(this, function(content) this.addPalette('archimate3Business', 'Archimate 3.0 / Business', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Business', '架构 / 业务', true, mxUtils.bind(this, function(content)
{ {
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
...@@ -178,8 +175,7 @@ ...@@ -178,8 +175,7 @@
w * 150, h * 105, '', 'Group', null, null, this.getTagsForStencil(gn, '', dt + 'actor').join(' ')) w * 150, h * 105, '', 'Group', null, null, this.getTagsForStencil(gn, '', dt + 'actor').join(' '))
]; ];
// this.addPalette('archimate3Composite', 'Archimate 3.0 / Composite', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Composite', 'Archimate 3.0 / Composite', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Composite', '架构 / 组合', false, mxUtils.bind(this, function(content)
{ {
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
...@@ -217,9 +213,8 @@ ...@@ -217,9 +213,8 @@
w * 150, h * 60, '', 'Gap', null, null, this.getTagsForStencil(gn, '', dt + 'gap').join(' ')) w * 150, h * 60, '', 'Gap', null, null, this.getTagsForStencil(gn, '', dt + 'gap').join(' '))
]; ];
// this.addPalette('archimate3Implementation and Migration', 'Archimate 3.0 / Implementation and Migration', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Implementation and Migration', 'Archimate 3.0 / Implementation and Migration', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Implementation and Migration', '架构 / 实施和迁移', false, mxUtils.bind(this, function(content) {
{
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
content.appendChild(fns[i](content)); content.appendChild(fns[i](content));
...@@ -267,9 +262,8 @@ ...@@ -267,9 +262,8 @@
w * 100, h * 50, '', 'Constraint', null, null, this.getTagsForStencil(gn, '', dt + 'constraint').join(' ')) w * 100, h * 50, '', 'Constraint', null, null, this.getTagsForStencil(gn, '', dt + 'constraint').join(' '))
]; ];
// this.addPalette('archimate3Motivation', 'Archimate 3.0 / Motivation', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Motivation', 'Archimate 3.0 / Motivation', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Motivation', '架构 / 动机', false, mxUtils.bind(this, function(content) {
{
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
content.appendChild(fns[i](content)); content.appendChild(fns[i](content));
...@@ -303,8 +297,7 @@ ...@@ -303,8 +297,7 @@
w * 90, h * 40, '', 'Distribution Network', null, null, this.getTagsForStencil(gn, '', dt + 'distribution').join(' ')) w * 90, h * 40, '', 'Distribution Network', null, null, this.getTagsForStencil(gn, '', dt + 'distribution').join(' '))
]; ];
// this.addPalette('archimate3Physical', 'Archimate 3.0 / Physical', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Physical', 'Archimate 3.0 / Physical', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Physical', '架构 / 物理', false, mxUtils.bind(this, function(content)
{ {
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
...@@ -369,9 +362,8 @@ ...@@ -369,9 +362,8 @@
10, 10, '', 'Or Junction', null, this.getTagsForStencil(gn, '', dt + 'junction').join(' ')) 10, 10, '', 'Or Junction', null, this.getTagsForStencil(gn, '', dt + 'junction').join(' '))
]; ];
// this.addPalette('archimate3Relationships', 'Archimate 3.0 / Relationships', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Relationships', 'Archimate 3.0 / Relationships', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Relationships', '架构 / 关系', false, mxUtils.bind(this, function(content) {
{
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
content.appendChild(fns[i](content)); content.appendChild(fns[i](content));
...@@ -401,9 +393,8 @@ ...@@ -401,9 +393,8 @@
w * 150, h * 75, '', 'Course of Action', null, null, this.getTagsForStencil(gn, '', dt + 'course action').join(' ')) w * 150, h * 75, '', 'Course of Action', null, null, this.getTagsForStencil(gn, '', dt + 'course action').join(' '))
]; ];
// this.addPalette('archimate3Strategy', 'Archimate 3.0 / Strategy', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Strategy', 'Archimate 3.0 / Strategy', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Strategy', '架构 / 战略', false, mxUtils.bind(this, function(content) {
{
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
content.appendChild(fns[i](content)); content.appendChild(fns[i](content));
...@@ -479,9 +470,8 @@ ...@@ -479,9 +470,8 @@
w * 100, h * 30, '', 'Path', null, null, this.getTagsForStencil(gn, '', dt + 'path').join(' ')) w * 100, h * 30, '', 'Path', null, null, this.getTagsForStencil(gn, '', dt + 'path').join(' '))
]; ];
// this.addPalette('archimate3Technology', 'Archimate 3.0 / Technology', false, mxUtils.bind(this, function(content) this.addPalette('archimate3Technology', 'Archimate 3.0 / Technology', false, mxUtils.bind(this, function(content)
this.addPalette('archimate3Technology', '架构 / 技术', false, mxUtils.bind(this, function(content) {
{
for (var i = 0; i < fns.length; i++) for (var i = 0; i < fns.length; i++)
{ {
content.appendChild(fns[i](content)); content.appendChild(fns[i](content));
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
Sidebar.prototype.veeam2 = ['Auxiliary', 'Data Center', 'Features', 'General', 'Products and Components', 'Software', 'States', 'Storage', '3D']; Sidebar.prototype.veeam2 = ['Auxiliary', 'Data Center', 'Features', 'General', 'Products and Components', 'Software', 'States', 'Storage', '3D'];
Sidebar.prototype.archimate3 = ['Application', 'Business', 'Composite', 'Implementation and Migration', 'Motivation', 'Physical', 'Relationships', 'Strategy', 'Technology']; Sidebar.prototype.archimate3 = ['Application', 'Business', 'Composite', 'Implementation and Migration', 'Motivation', 'Physical', 'Relationships', 'Strategy', 'Technology'];
Sidebar.prototype.archimate4 = ['Application']; // Sidebar.prototype.archimate4 = ['Application'];
Sidebar.prototype.electrical = ['LogicGates', 'Resistors', 'Capacitors', 'Inductors', 'SwitchesRelays', 'Diodes', 'Sources', 'Transistors', 'Misc', 'Audio', 'PlcLadder', 'Abstract', 'Optical', 'VacuumTubes', 'Waveforms', 'Instruments', 'RotMech', 'Transmission']; Sidebar.prototype.electrical = ['LogicGates', 'Resistors', 'Capacitors', 'Inductors', 'SwitchesRelays', 'Diodes', 'Sources', 'Transistors', 'Misc', 'Audio', 'PlcLadder', 'Abstract', 'Optical', 'VacuumTubes', 'Waveforms', 'Instruments', 'RotMech', 'Transmission'];
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
{id: 'atlassian', libs: ['atlassian']}, {id: 'atlassian', libs: ['atlassian']},
{id: 'fluid_power', libs: ['fluid_power']}, {id: 'fluid_power', libs: ['fluid_power']},
{id: 'gmdl', prefix: 'gmdl', libs: Sidebar.prototype.gmdl}, {id: 'gmdl', prefix: 'gmdl', libs: Sidebar.prototype.gmdl},
{id: 'archimate4', prefix: 'archimate4', libs: Sidebar.prototype.archimate4}, // {id: 'archimate4', prefix: 'archimate4', libs: Sidebar.prototype.archimate4},
{id: 'archimate_define', prefix: 'archimate_define', libs: Sidebar.prototype.archimate_define}, {id: 'archimate_define', prefix: 'archimate_define', libs: Sidebar.prototype.archimate_define},
{id: 'archimate', libs: ['archimate']}, {id: 'archimate', libs: ['archimate']},
{id: 'webicons', libs: ['webicons', 'weblogos']}, {id: 'webicons', libs: ['webicons', 'weblogos']},
...@@ -1191,7 +1191,7 @@ ...@@ -1191,7 +1191,7 @@
this.addVeeam2Palette(); this.addVeeam2Palette();
this.addVVDPalette(); this.addVVDPalette();
this.addArchimate3Palette(); this.addArchimate3Palette();
this.addArchimate4Palette(); // this.addArchimate4Palette();
this.addArchiMatePalette(); this.addArchiMatePalette();
this.addBpmn2Palette(); this.addBpmn2Palette();
this.addSysMLPalette(sysml, dir); this.addSysMLPalette(sysml, dir);
...@@ -1208,6 +1208,7 @@ ...@@ -1208,6 +1208,7 @@
this.addWebIconsPalette(); this.addWebIconsPalette();
this.addWebLogosPalette(); this.addWebLogosPalette();
this.addSignsPalette(signs, dir); this.addSignsPalette(signs, dir);
this.addEAPalette(); //二次开发,增加动态读取架构设计要素
// LATER: Check if conflicts with restore libs after loading file // LATER: Check if conflicts with restore libs after loading file
this.showEntries(); this.showEntries();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!