-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGrid.vue
136 lines (128 loc) · 4.69 KB
/
Grid.vue
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
<div id="app">
<!--<pre>{{ $data | json }}</pre>-->
<div>
<div class="section has-background">
<div class="content">
<p class="subtitle">
Grid Values displayed as <code>[x, y, w, h]</code>:
</p>
<blockquote>
<p class="text" v-for="(item, index) in layout" :key="index">
<b>{{item.i}}</b>: [{{item.x}}, {{item.y}}, {{item.w}}, {{item.h}}]
</p>
</blockquote>
<input type="checkbox" class="checkbox" v-model="draggable"/> Draggable
<input type="checkbox" v-model="resizable"/> Resizable
</div>
</div>
</div>
<div class="section has-background-light">
<!--<button @click="decreaseWidth">Decrease Width</button>
<button @click="increaseWidth">Increase Width</button>
<button @click="addItem">Add an item</button>-->
<grid-layout :layout="layout"
:col-num="12"
:row-height="30"
:is-draggable="draggable"
:is-resizable="resizable"
:vertical-compact="false"
:use-css-transforms="true"
:responsive="true"
>
<grid-item v-for="(item, index) in layout"
:key="index"
:static="item.static"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:dragAllowFrom="'.drag-icon'"
>
<div class="box">
<div class="container">
<div class="level drag-icon">
<div class="level-item">
</div>
<div class="level-item ">
<span class="icon has-text-grey-light">
<i class="fas fa-grip-lines"></i>
</span>
</div>
<div class="level-item">
</div>
<a class="delete"></a>
</div>
<component :is="item.c" v-bind="item.props"> </component>
</div>
</div>
</grid-item>
</grid-layout>
</div>
</div>
</template>
<script>
import {GridItem, GridLayout} from 'vue-grid-layout'
import ImmunizationComponent from './immunization/Immunization.vue'
import PatientComponent from './patient/Patient.vue'
import defaultConfig from './immunization/default'
import '@fortawesome/fontawesome-free/css/all.css'
import '@fortawesome/fontawesome-free/js/all.js'
var testLayout = [
{"x":0,"y":0,"w":4,"h":11,"i":"0", static: false, "minH":11, c: ImmunizationComponent,
props: {
config: defaultConfig,
patientdata: {
reference: "[email protected]"
},
hospitaldata: {
performer: [
{
actor: {
reference: "[email protected]"
}
}
],
location: {
reference: "1236"
}
},
}},
{"x":4,"y":0,"w":5,"h":25,"i":"1", static: false, "minH":11, c: PatientComponent, props: {
patientdata: {
reference: "[email protected]"
},
hospitaldata: {
performer: [
{
actor: {
reference: "[email protected]"
}
}
],
location: {
reference: "1236"
}
},
}},
];
export default {
components: {
GridItem: GridItem,
GridLayout: GridLayout,
ImmunizationComponent: ImmunizationComponent
},
data() {return {
layout: testLayout,
draggable: true,
resizable: true,
index: 0
}},
methods: {
}
}
</script>
<style>
@import "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css";
</style>