|
@@ -38,7 +38,7 @@ export default {
|
|
},
|
|
},
|
|
initColor: {
|
|
initColor: {
|
|
type: Array,
|
|
type: Array,
|
|
- default: function() {
|
|
|
|
|
|
+ default: function () {
|
|
return [
|
|
return [
|
|
"#F9C3C3",
|
|
"#F9C3C3",
|
|
"#FFD1BF",
|
|
"#FFD1BF",
|
|
@@ -88,19 +88,19 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
this.initGraphy('3af6d175c34e11e993ac85337be80696');
|
|
this.initGraphy('3af6d175c34e11e993ac85337be80696');
|
|
let that = this;
|
|
let that = this;
|
|
- eventBus.$on("suitableRatios", function() {
|
|
|
|
|
|
+ eventBus.$on("suitableRatios", function () {
|
|
that.view.fitSceneToView();
|
|
that.view.fitSceneToView();
|
|
});
|
|
});
|
|
- eventBus.$on("changeRatios", function(val) {
|
|
|
|
|
|
+ eventBus.$on("changeRatios", function (val) {
|
|
that.changeRatios(val);
|
|
that.changeRatios(val);
|
|
});
|
|
});
|
|
- eventBus.$on("downImgs", function(val) {
|
|
|
|
|
|
+ eventBus.$on("downImgs", function (val) {
|
|
that.view.saveImage("saveImage" + new Date(), "png");
|
|
that.view.saveImage("saveImage" + new Date(), "png");
|
|
});
|
|
});
|
|
- eventBus.$on("openDrags", function(val) {
|
|
|
|
- if(val){
|
|
|
|
|
|
+ eventBus.$on("openDrags", function (val) {
|
|
|
|
+ if (val) {
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
});
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -123,13 +123,15 @@ export default {
|
|
if (!this.dataKey) {
|
|
if (!this.dataKey) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ let arr = ['3af6d175c34e11e993ac85337be80696', 'bd174039c32311e98359dfc652ba919b', '8544a3c3cd2611e99abc839db1015353']
|
|
|
|
+ let index = Math.floor(Math.random() * 3)
|
|
this.drawMainScene = null;
|
|
this.drawMainScene = null;
|
|
this.view = null;
|
|
this.view = null;
|
|
// 初始化view类
|
|
// 初始化view类
|
|
this.view = new SGraphyView("canvas" + this.indexs);
|
|
this.view = new SGraphyView("canvas" + this.indexs);
|
|
this.drawMainScene = new FloorScene(null);
|
|
this.drawMainScene = new FloorScene(null);
|
|
let that = this;
|
|
let that = this;
|
|
- this.drawMainScene.getFloorData('/modelapi/base-graph/query',{ ModelId:ModelId }).then(res=>{
|
|
|
|
|
|
+ this.drawMainScene.getFloorData('/modelapi/base-graph/query', { ModelId: arr[index] }).then(res => {
|
|
that.view.scene = that.drawMainScene
|
|
that.view.scene = that.drawMainScene
|
|
that.view.fitSceneToView();
|
|
that.view.fitSceneToView();
|
|
})
|
|
})
|