Skip to content

Commit

Permalink
Merge pull request #106 from bhabgs/master
Browse files Browse the repository at this point in the history
ID随机化
  • Loading branch information
mengziwen authored Jul 23, 2021
2 parents eaf256d + 47a7347 commit 2f5ed72
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package/vitevui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitevui",
"version": "1.0.0-beta.45",
"version": "1.0.0-beta.46",
"description": "vue3.0 ui",
"main": "lib/index.js",
"homepage": "https://bhabgs.github.io/vite-vui-docs/",
Expand Down
23 changes: 8 additions & 15 deletions package/vitevui/src/flow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const viFlow = defineComponent({
diaVisible: false,
selectedObj: undefined as any,
diaObj: {} as any,
domNum: 0,
};
},
watch: {
Expand All @@ -82,6 +83,9 @@ const viFlow = defineComponent({
immediate: true,
},
},
created() {
this.domNum = Math.floor(Math.random() * 1000);
},
mounted() {
this.initGraph();
},
Expand All @@ -98,7 +102,7 @@ const viFlow = defineComponent({
// 节点缩放
resizing: true,
// height:document.getElementById('graph')!.clientHeight,
container: document.getElementById('graph')!,
container: document.getElementById(`graph${this.domNum}`)!,
background: { color: '#ffffff' },
// 禁止出画布
translating: {
Expand Down Expand Up @@ -171,7 +175,7 @@ const viFlow = defineComponent({
stencilGraphHeight:
document.getElementsByClassName('vuiFlow')[0].clientHeight - 32,
});
const stencilContainer = document.querySelector('#module');
const stencilContainer = document.querySelector(`#module${this.domNum}`);
stencilContainer!.appendChild(this.stencil.container);
this.stencil.load([
fac.getRectRadius(),
Expand Down Expand Up @@ -253,14 +257,7 @@ const viFlow = defineComponent({
nodeCode: selected.id,
rulesComponent: selected.data,
};

// const res: any = await this.$axios.post(
// '/fsmEdge/v1/componentGraph/toView',
// param,
// );
// this.selectedObj.attr('label/text', res.data.viewStr?.substr(0, 6));
}

this.diaVisible = false;
},

Expand Down Expand Up @@ -316,10 +313,6 @@ const viFlow = defineComponent({
par.nodeList.push(resNode);
});
return par;
// const res: any = await this.$axios.post(
// `/fsmEdge/v1/componentGraph/${this.id ? 'modify' : 'create'}`,
// par,
// );
},
closeDrawer() {
this.diaObj = {};
Expand Down Expand Up @@ -367,8 +360,8 @@ const viFlow = defineComponent({
return (
<div class='vuiFlow'>
<div class='flex drag'>
<div id='module'></div>
<div id='graph'></div>
<div id={`module${this.domNum}`}></div>
<div id={`graph${this.domNum}`}></div>
</div>

{this.renderDia()}
Expand Down
6 changes: 5 additions & 1 deletion package/vitevui/src/flowRes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const viFlowRes = defineComponent({
selectedObj: undefined as any,
cells: [],
nodeList: [],
domNum: 0,
};
},
watch: {
Expand All @@ -51,6 +52,9 @@ const viFlowRes = defineComponent({
immediate: true,
},
},
created() {
this.domNum = Math.floor(Math.random() * 1000);
},
mounted() {
this.initGraph();
if (this.type === 'template') {
Expand Down Expand Up @@ -186,7 +190,7 @@ const viFlowRes = defineComponent({
return (
<div class='vuiFlow'>
<div class='flex drag'>
<div id='graph'></div>
<div id={`graph${this.domNum}`}></div>
</div>
</div>
);
Expand Down

0 comments on commit 2f5ed72

Please sign in to comment.