Commit d74e0b78 by 史敦盼

便签本添加参数

1 parent 36758108
function initSetScratchpad() { function initSetScratchpad() {
console.log('urlParams', urlParams)
//左侧便签本初始化数据 //左侧便签本初始化数据
$.ajax({ $.ajax({
method: 'post', method: 'post',
url: `http://${ajaxUrl}/eadc-architecture/short-cut-model/qSCMList`, url: `http://${ajaxUrl}/eadc-architecture/short-cut-model/qSCMList`,
data: JSON.stringify({}), data: {
referenceId: urlParams.referenceId,
referenceType: isMetaModel()
},
success: function (result) { success: function (result) {
let images = [] let images = []
result.data.forEach((item) => { result.data.forEach((item) => {
...@@ -54,6 +58,13 @@ function initSetScratchpad() { ...@@ -54,6 +58,13 @@ function initSetScratchpad() {
// 若为压缩的xml,则内容是diagram的内容 // 若为压缩的xml,则内容是diagram的内容
} }
function isMetaModel() {
if(urlParams.page === 'metaModelListDetails') {
return 1
} else {
return 2
}
}
function saveScratchpad(data) { function saveScratchpad(data) {
//左侧便签本保存数据 //左侧便签本保存数据
......
...@@ -1043,7 +1043,7 @@ ...@@ -1043,7 +1043,7 @@
} }
// 二次开发-画布只保留五大架构元素关系图标 // 二次开发-画布只保留五大架构元素关系图标
const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph')); const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
if(joinGraph_ && joinGraph_.state == 2) { if(joinGraph_ && joinGraph_.state == 2 && urlParams.page !== 'metaModelListDetails') {
this.addGeneralPalette(this.customEntries == null);//通用图形 this.addGeneralPalette(this.customEntries == null);//通用图形
} }
// this.addMiscPalette(false); //杂项图形 // this.addMiscPalette(false); //杂项图形
......
<template> <template>
<iframe <iframe
id="drawioGraph" id="drawioGraph"
name="content_frame" name="content_frame"
:src="'/drawio/index.html?id='+id+'&info='+info+'&page='+page" :src="getSrc"
frameborder=0 frameborder="0"
scrolling="no"> scrolling="no"
</iframe> >
</iframe>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
initGraphId: Object initGraphId: Object,
}, },
data() { data() {
return { return {
id: null, id: null,
info: null, info: null,
page: null page: null,
}; referenceId: null,
}, }
watch: { },
initGraphId: { watch: {
handler(newVal, oldVal) { initGraphId: {
this.id = newVal.id; handler(newVal, oldVal) {
this.info = newVal.info; this.id = newVal.id
this.page = newVal.page; this.info = newVal.info
}, this.page = newVal.page
} this.referenceId = newVal.referenceId
}, },
mounted(){ },
},
}, computed: {
} getSrc() {
return `/drawio/index.html?id=${this.id}&info=${this.info}&page=${this.page}&referenceId=${this.referenceId}`
},
},
mounted() {},
}
</script> </script>
<style scoped> <style scoped>
#drawioGraph{ #drawioGraph {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
</style> </style>
...@@ -98,11 +98,13 @@ ...@@ -98,11 +98,13 @@
this.getQingDanTable(); this.getQingDanTable();
this.get_search_select1(); this.get_search_select1();
const id = this.$route.query.id; // const id = this.$route.query.id;
const graphGroup = this.$route.query.info; // const graphGroup = this.$route.query.info;
const { id, info, referenceId } = this.$route.query
this.routerId = { this.routerId = {
id: id, id: id,
info: graphGroup info,
referenceId
} }
window.onmessage = e => { window.onmessage = e => {
......
...@@ -563,10 +563,7 @@ export default { ...@@ -563,10 +563,7 @@ export default {
JSON.stringify({ state: 2, graph: res2[2].dataEle }), JSON.stringify({ state: 2, graph: res2[2].dataEle }),
) )
this.$router.push( this.$router.push(
`/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}`, `/main/archiViewManageDetails?id=${id}&info=${this.graphGroup}&viewId=${this.viewId}&assetConstant=${this.archiType}&referenceId=${item.viewDetailsId}`)
() => {},
() => {},
)
}) })
} }
}) })
......
...@@ -73,11 +73,12 @@ ...@@ -73,11 +73,12 @@
this.get_search_select1(); this.get_search_select1();
// const id = this.$route.query.id; // const id = this.$route.query.id;
// const version = this.$route.query.info; // const version = this.$route.query.info;
const {id, info, page } = this.$route.query const {id, info, page, referenceId } = this.$route.query
this.routerId = { this.routerId = {
id, id,
info, info,
page page,
referenceId
} }
window.onmessage = e => { window.onmessage = e => {
......
...@@ -318,7 +318,7 @@ export default { ...@@ -318,7 +318,7 @@ export default {
localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle })); localStorage.setItem('commonGraph', JSON.stringify({ show: false, graph: res2[0].dataEle }));
localStorage.setItem('standardGraph', JSON.stringify({ show: true, graph: res2[0].dataEle })); localStorage.setItem('standardGraph', JSON.stringify({ show: true, graph: res2[0].dataEle }));
localStorage.setItem('metaModelJoinGraph', JSON.stringify({ state: 1, graph: res2[0].dataEle })); localStorage.setItem('metaModelJoinGraph', JSON.stringify({ state: 1, graph: res2[0].dataEle }));
this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}&page=metaModelListDetails`); this.$router.push( `/main/metaModelListDetails?id=${item.metaModelId}&info=${item.version}&page=metaModelListDetails&referenceId=${item.metaModelId}`);
}); });
} }
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!