App.vue
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
<div id="app">
<setting/>
<!-- <layout/> -->
</div>
</template>
<script>
import setting from "./components/setting";
// import layout from "./components/layout";
export default {
name: "app",
components: {
setting,
// layout
},
mounted() {
this.$inventory
.list({
fragmentType: "dashboard!name!home"
})
.then(list => {
if (list.managedObjects.length === 0) {
return this.$inventory
.create({
"dashboard!name!home": {}
})
.then(detail => {
this.$store.commit("layout/setDashboardId", detail.id);
});
} else {
this.$store.commit(
"layout/setDashboardId",
list.managedObjects[0].id
);
}
});
},
methods: {
// isLock: function(val) {
// this.$store.commit("setLock", detail.id);
// this.isDraggable = val.isDraggable;
// this.isResizable = val.isResizable;
// this.$message.success(
// val.isResizable && val.isDraggable ? "编辑已解锁" : "编辑已锁定"
// );
// }
}
};
</script>
<style>
html,
body {
margin: 0;
padding: 0;
}
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
}
</style>