Commit 379ee7f3 by liuyong

修改资产管理

1 parent d991924a
......@@ -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;
......
......@@ -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));
});
......
......@@ -23,6 +23,7 @@
watch: {
initGraphId: {
handler(newVal, oldVal) {
// console.log(newVal)
this.id = newVal.id;
this.version = newVal.version;
this.state = newVal.state;
......
......@@ -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;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!