@7365admin1/layer-common 3.0.7 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  <v-row no-gutters>
3
3
  <v-expansion-panels multiple v-model="openPanels">
4
4
  <!-- SITE SETTINGS -->
5
- <v-expansion-panel color="primary">
5
+ <v-expansion-panel v-if="canManageSiteInformation" color="primary">
6
6
  <v-expansion-panel-title>
7
7
  <v-icon class="mr-2">mdi-cog</v-icon>
8
8
  Site Information
@@ -14,73 +14,36 @@
14
14
  <v-row>
15
15
  <!-- Cover Photo + Preview -->
16
16
  <v-col cols="12" lg="5" class="pt-0">
17
- <InputLabel
18
- title="Cover Photo (displayed in resident app)"
19
- class="d-block mb-2"
20
- />
21
- <InputFileV2
22
- v-model="coverPhoto"
23
- accept="image/*"
24
- title="Upload cover photo"
25
- :height="120"
26
- />
17
+ <InputLabel title="Cover Photo (displayed in resident app)" class="d-block mb-2" />
18
+ <InputFileV2 v-model="coverPhoto" accept="image/*" title="Upload cover photo" :height="120" />
27
19
  </v-col>
28
20
  <v-col cols="12" lg="7" class="pl-lg-4 pt-4 pt-lg-0">
29
21
  <InputLabel title="Preview" class="d-block mb-2" />
30
- <v-img
31
- v-if="coverPhotoUrl"
32
- :src="coverPhotoUrl"
33
- aspect-ratio="16/9"
34
- cover
35
- rounded="lg"
36
- class="w-100 border"
37
- />
38
- <div
39
- v-else
22
+ <v-img v-if="coverPhotoUrl" :src="coverPhotoUrl" aspect-ratio="16/9" cover rounded="lg"
23
+ class="w-100 border" />
24
+ <div v-else
40
25
  class="w-100 d-flex align-center justify-center rounded-lg bg-grey-lighten-4 border border-dashed"
41
- style="aspect-ratio: 16/9"
42
- >
43
- <span class="text-caption text-medium-emphasis"
44
- >No cover photo uploaded</span
45
- >
26
+ style="aspect-ratio: 16/9">
27
+ <span class="text-caption text-medium-emphasis">No cover photo uploaded</span>
46
28
  </div>
47
29
  </v-col>
48
30
 
49
31
  <!-- Description + Site Documents -->
50
32
  <v-col cols="12" lg="6" class="mt-2">
51
33
  <InputLabel title="Description" class="d-block mb-1" />
52
- <v-textarea
53
- v-model="description"
54
- variant="outlined"
55
- density="compact"
56
- rows="4"
57
- hide-details
58
- no-resize
59
- style="height: 119px"
60
- />
34
+ <v-textarea v-model="description" variant="outlined" density="compact" rows="4" hide-details no-resize
35
+ style="height: 119px" />
61
36
  </v-col>
62
37
  <v-col cols="12" lg="6" class="mt-2 pl-lg-2">
63
38
  <InputLabel title="Site Documents" class="d-block mb-1" />
64
- <InputFileV2
65
- v-model="siteDocuments"
66
- :multiple="true"
67
- accept="*/*"
68
- title="Upload documents"
69
- :height="104"
70
- />
39
+ <InputFileV2 v-model="siteDocuments" :multiple="true" accept="*/*" title="Upload documents"
40
+ :height="104" />
71
41
  </v-col>
72
42
 
73
43
  <!-- Submit -->
74
44
  <v-col cols="12" class="pt-0 d-flex justify-end">
75
- <v-btn
76
- color="primary-button"
77
- class="text-none"
78
- size="large"
79
- variant="flat"
80
- text="Save"
81
- :loading="savingSiteInfo"
82
- @click="saveSiteInfo"
83
- />
45
+ <v-btn color="primary-button" class="text-none" size="large" variant="flat" text="Save"
46
+ :loading="savingSiteInfo" @click="saveSiteInfo" />
84
47
  </v-col>
85
48
 
86
49
  <!-- Divider -->
@@ -91,14 +54,8 @@
91
54
  <v-col cols="12">
92
55
  <v-row no-gutters>
93
56
  <v-col cols="12" lg="4" class="mt-2">
94
- <NumberSettingField
95
- v-model="blocks"
96
- title="No. of blocks"
97
- type="blocks"
98
- :site-id="siteId"
99
- :disabled="existingBlockNumber === blocks"
100
- @success="refreshSiteData"
101
- />
57
+ <NumberSettingField v-model="blocks" title="No. of blocks" type="blocks" :site-id="siteId"
58
+ :disabled="existingBlockNumber === blocks" @success="refreshSiteData" />
102
59
  </v-col>
103
60
  </v-row>
104
61
  </v-col>
@@ -106,14 +63,9 @@
106
63
  <v-col cols="12">
107
64
  <v-row no-gutters>
108
65
  <v-col cols="12" lg="4" class="mt-2">
109
- <NumberSettingField
110
- v-model="guardPosts"
111
- title="No. of guard posts"
112
- type="guard_posts"
113
- :site-id="siteId"
114
- :disabled="existingGuardPostNumber === guardPosts"
115
- @success="refreshSiteData"
116
- />
66
+ <NumberSettingField v-model="guardPosts" title="No. of guard posts" type="guard_posts"
67
+ :site-id="siteId" :disabled="existingGuardPostNumber === guardPosts"
68
+ @success="refreshSiteData" />
117
69
  </v-col>
118
70
  </v-row>
119
71
  </v-col>
@@ -124,7 +76,7 @@
124
76
  </v-expansion-panel>
125
77
 
126
78
  <!-- ANPR CAMERA -->
127
- <v-expansion-panel v-if="showAnprCamera" color="primary">
79
+ <v-expansion-panel v-if="showAnprCamera && canManageANPRCamera" color="primary">
128
80
  <v-expansion-panel-title>
129
81
  <v-icon class="mr-2">mdi-camera</v-icon>
130
82
  ANPR Camera
@@ -134,45 +86,24 @@
134
86
  <v-container fluid class="px-0">
135
87
  <v-row dense>
136
88
  <v-col cols="6">
137
- <v-switch
138
- v-model="ANPRSwitches.enableUnregistered"
139
- :disabled="!canManageSiteSettings"
140
- label="Enable Unregistered Vehicles"
141
- color="primary"
142
- hide-details
143
- ></v-switch>
89
+ <v-switch v-model="ANPRSwitches.enableUnregistered" :disabled="!canManageSiteSettings"
90
+ label="Enable Unregistered Vehicles" color="primary" hide-details></v-switch>
144
91
  </v-col>
145
92
 
146
93
  <v-col cols="6">
147
- <v-switch
148
- v-model="ANPRSwitches.openBarrierPickUpDropOff"
149
- :disabled="!canManageSiteSettings"
150
- label="Open Barrier for Pick-up and Drop-off"
151
- color="primary"
152
- hide-details
153
- ></v-switch>
94
+ <v-switch v-model="ANPRSwitches.openBarrierPickUpDropOff" :disabled="!canManageSiteSettings"
95
+ label="Open Barrier for Pick-up and Drop-off" color="primary" hide-details></v-switch>
154
96
  </v-col>
155
97
 
156
98
  <v-col cols="6">
157
- <v-switch
158
- v-model="ANPRSwitches.vehicleSnapshot"
159
- :disabled="!canManageSiteSettings"
160
- label="Capture Vehicle Snapshot"
161
- color="primary"
162
- hide-details
163
- ></v-switch>
99
+ <v-switch v-model="ANPRSwitches.vehicleSnapshot" :disabled="!canManageSiteSettings"
100
+ label="Capture Vehicle Snapshot" color="primary" hide-details></v-switch>
164
101
  </v-col>
165
102
  </v-row>
166
103
 
167
104
  <v-row v-if="canManageSiteSettings">
168
105
  <v-col cols="auto">
169
- <v-btn
170
- variant="flat"
171
- color="primary"
172
- class="text-none"
173
- :loading="isSaving"
174
- @click="saveANPRSettings"
175
- >
106
+ <v-btn variant="flat" color="primary" class="text-none" :loading="isSaving" @click="saveANPRSettings">
176
107
  Save
177
108
  </v-btn>
178
109
  </v-col>
@@ -181,47 +112,35 @@
181
112
 
182
113
  <v-divider class="my-4"></v-divider>
183
114
 
184
- <CameraMain
185
- :site="siteId"
186
- :read-only="!canManageSiteSettings"
187
- :guard-posts="siteData?.metadata?.guardPosts"
188
- />
115
+ <CameraMain :site="siteId" :read-only="!canManageSiteSettings"
116
+ :guard-posts="siteData?.metadata?.guardPosts" />
189
117
  </v-expansion-panel-text>
190
118
  </v-expansion-panel>
191
119
 
192
120
  <!-- CCTV CAMERA -->
193
- <v-expansion-panel v-if="showCctvCamera" color="primary">
121
+ <v-expansion-panel v-if="showCctvCamera && canManageCCTVCamera" color="primary">
194
122
  <v-expansion-panel-title>
195
123
  <v-icon class="mr-2">mdi-cctv</v-icon>
196
124
  CCTV Camera
197
125
  </v-expansion-panel-title>
198
126
 
199
127
  <v-expansion-panel-text>
200
- <CameraMain
201
- :site="siteId"
202
- type="ip"
203
- :read-only="!canManageSiteSettings"
204
- />
128
+ <CameraMain :site="siteId" type="ip" :read-only="!canManageSiteSettings" />
205
129
  </v-expansion-panel-text>
206
130
  </v-expansion-panel>
207
131
 
208
- <v-expansion-panel v-if="showDeliveryCompanies" color="primary">
132
+ <v-expansion-panel v-if="showDeliveryCompanies && canManageDeliveryCompanies" color="primary">
209
133
  <v-expansion-panel-title>
210
134
  <v-icon class="mr-2">mdi-truck</v-icon>
211
135
  Delivery Companies
212
136
  </v-expansion-panel-title>
213
137
  <v-expansion-panel-text class="">
214
- <DeliveryCompany
215
- :site="siteId"
216
- v-model:initial="deliveryCompanies"
217
- @refresh-site="refreshSiteData"
218
- @update:companiesValue="handleUpdateCompanies"
219
- :read-only="!canManageSiteSettings"
220
- />
138
+ <DeliveryCompany :site="siteId" v-model:initial="deliveryCompanies" @refresh-site="refreshSiteData"
139
+ @update:companiesValue="handleUpdateCompanies" :read-only="!canManageSiteSettings" />
221
140
  </v-expansion-panel-text>
222
141
  </v-expansion-panel>
223
142
 
224
- <v-expansion-panel v-if="showResidentVisitors" color="primary">
143
+ <v-expansion-panel v-if="showResidentVisitors && canManageResidentVisitors" color="primary">
225
144
  <v-expansion-panel-title>
226
145
  <v-icon class="mr-2">mdi-car</v-icon>
227
146
  Resident Visitors
@@ -231,11 +150,7 @@
231
150
  </v-expansion-panel-text>
232
151
  </v-expansion-panel>
233
152
 
234
- <slot
235
- name="panels"
236
- :can-manage="canManageSiteSettings"
237
- :site-id="siteId"
238
- />
153
+ <slot name="panels" :can-manage="canManageSiteSettings" :site-id="siteId" />
239
154
  </v-expansion-panels>
240
155
 
241
156
  <Snackbar v-model="toast.show" :text="toast.message" :color="toast.color" />
@@ -259,6 +174,12 @@ const props = defineProps({
259
174
  });
260
175
 
261
176
  const openPanels = ref([]); // default open first
177
+ const { canManageSiteInformation,
178
+ canManageANPRCamera,
179
+ canManageCCTVCamera,
180
+ canManageDeliveryCompanies,
181
+ canManageResidentVisitors,
182
+ } = useSettingsPermission();
262
183
 
263
184
  const { getSiteById, updateSitebyId, updateSiteInformation } =
264
185
  useSiteSettings();