@feedmepos/mf-order-setting 0.0.16 → 0.0.17

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.
Files changed (49) hide show
  1. package/dist/KioskDevicesView-DkDKK-o-.js +4 -0
  2. package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-uz5kCfDz.js +206 -0
  3. package/dist/KioskSettingView-6Q0qwSTl.js +345 -0
  4. package/dist/KioskView-dXsAOdRK.js +289 -0
  5. package/dist/OrderSettingsView-mw8PFd0W.js +70943 -0
  6. package/dist/app-BsFGRC2y.js +620 -0
  7. package/dist/app.js +5 -4
  8. package/dist/dayjs.min-vPr9KJUN.js +123632 -0
  9. package/dist/frontend/mf-order/src/api/restaurant-setting/index.d.ts +1 -1
  10. package/dist/frontend/mf-order/src/app.d.ts +1 -0
  11. package/dist/frontend/mf-order/src/helpers/map.d.ts +3 -2
  12. package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +6 -6
  13. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +8 -8
  14. package/dist/frontend/mf-order/src/views/all-orders/FilterRestaurant.vue.d.ts +4 -4
  15. package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +2 -2
  16. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  17. package/dist/index-B9mJLWE5.js +70 -0
  18. package/dist/index-CpFXjGaf.js +86 -0
  19. package/dist/package/entity/delivery/delivery.dto.d.ts +6 -6
  20. package/dist/package/entity/delivery/gateway/pandago.dto.d.ts +10 -10
  21. package/dist/package/entity/food-court/order.dto.d.ts +38 -38
  22. package/dist/package/entity/kiosk/kiosk.do.d.ts +20 -20
  23. package/dist/package/entity/kiosk/kiosk.dto.d.ts +24 -24
  24. package/dist/package/entity/order/order.dto.d.ts +278 -278
  25. package/dist/package/entity/order/payment/payment.dto.d.ts +152 -152
  26. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +24 -24
  27. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
  28. package/dist/package/entity/order-platform/grabfood/grabfood-menu.do.d.ts +74 -74
  29. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +106 -106
  30. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +32 -32
  31. package/dist/package/entity/order-platform/menu.dto.d.ts +54 -54
  32. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +238 -238
  33. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +64 -64
  34. package/dist/package/entity/payment/payment.dto.d.ts +2 -2
  35. package/dist/package/entity/printer/printer.do.d.ts +2 -2
  36. package/dist/package/entity/websocket/websocket.dto.d.ts +2 -2
  37. package/package.json +1 -1
  38. package/src/Entry.vue +2 -8
  39. package/src/api/restaurant-setting/index.ts +3 -2
  40. package/src/app.ts +17 -0
  41. package/src/components/GoogleMap.vue +102 -104
  42. package/src/helpers/map.ts +23 -15
  43. package/src/router/routes.ts +4 -8
  44. package/src/stores/restaurant/index.ts +1 -1
  45. package/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue +3 -2
  46. package/src/views/order-settings/pickup/AddressInput.vue +3 -2
  47. package/src/views/order-settings/pickup/PickUpSetting.vue +34 -25
  48. package/dist/KioskSettingView-DGfS1NzO.js +0 -4
  49. package/dist/app-9Q-zRVKD.js +0 -196056
@@ -1,216 +1,214 @@
1
1
  <script setup lang="ts">
2
- import { ref, onMounted, watch, type PropType, toRaw, onUnmounted } from 'vue';
3
- import { coordinates, googleMap } from '@/helpers/map';
4
- import type { MarkerChangeEvent, PolygonChangeEvent, MapCoordinate, MapPolygon } from './type';
2
+ import { ref, onMounted, watch, type PropType, toRaw, onUnmounted } from 'vue'
3
+ import { coordinates, googleMap } from '@/helpers/map'
4
+ import type { MarkerChangeEvent, PolygonChangeEvent, MapCoordinate, MapPolygon } from './type'
5
5
 
6
6
  interface PolygonEventHandler {
7
- click: (ev: google.maps.PolyMouseEvent) => void;
8
- contextmenu: (v: google.maps.PolyMouseEvent) => void;
9
- dblclick: (v: google.maps.PolyMouseEvent) => void;
10
- drag: (v: google.maps.MapMouseEvent) => void;
11
- dragend: (v: google.maps.MapMouseEvent) => void;
12
- dragstart: (v: google.maps.MapMouseEvent) => void;
13
- mousedown: (v: google.maps.PolyMouseEvent) => void;
14
- mousemove: (v: google.maps.PolyMouseEvent) => void;
15
- mouseout: (v: google.maps.PolyMouseEvent) => void;
16
- mouseover: (v: google.maps.PolyMouseEvent) => void;
17
- mouseup: (v: google.maps.PolyMouseEvent) => void;
7
+ click: (ev: google.maps.PolyMouseEvent) => void
8
+ contextmenu: (v: google.maps.PolyMouseEvent) => void
9
+ dblclick: (v: google.maps.PolyMouseEvent) => void
10
+ drag: (v: google.maps.MapMouseEvent) => void
11
+ dragend: (v: google.maps.MapMouseEvent) => void
12
+ dragstart: (v: google.maps.MapMouseEvent) => void
13
+ mousedown: (v: google.maps.PolyMouseEvent) => void
14
+ mousemove: (v: google.maps.PolyMouseEvent) => void
15
+ mouseout: (v: google.maps.PolyMouseEvent) => void
16
+ mouseover: (v: google.maps.PolyMouseEvent) => void
17
+ mouseup: (v: google.maps.PolyMouseEvent) => void
18
18
  }
19
19
 
20
- type Vertex = google.maps.MVCArray<google.maps.LatLng>;
20
+ type Vertex = google.maps.MVCArray<google.maps.LatLng>
21
21
 
22
22
  const props = defineProps({
23
23
  markers: {
24
24
  type: Array as PropType<MapCoordinate[]>,
25
- default: () => [],
25
+ default: () => []
26
26
  },
27
27
  polygons: {
28
28
  type: Array as PropType<MapPolygon[]>,
29
- default: () => [],
29
+ default: () => []
30
30
  },
31
31
  zoom: {
32
32
  type: Number,
33
- default: 14,
33
+ default: 14
34
34
  },
35
35
  editable: {
36
36
  type: Boolean,
37
- default: false,
37
+ default: false
38
38
  },
39
39
  center: {
40
40
  type: Object as PropType<{
41
- lat: number;
42
- lng: number;
41
+ lat: number
42
+ lng: number
43
43
  }>,
44
- default: coordinates.jb,
45
- },
46
- });
44
+ default: coordinates.jb
45
+ }
46
+ })
47
47
 
48
48
  const emits = defineEmits<{
49
- (event: 'map-click', ev: MapCoordinate): void;
50
- (event: 'marker-change', ev: MarkerChangeEvent): void;
51
- (event: 'polygon-change', ev: PolygonChangeEvent): void;
52
- (event: 'polygon-right-click', ev: number): void;
53
- }>();
49
+ (event: 'map-click', ev: MapCoordinate): void
50
+ (event: 'marker-change', ev: MarkerChangeEvent): void
51
+ (event: 'polygon-change', ev: PolygonChangeEvent): void
52
+ (event: 'polygon-right-click', ev: number): void
53
+ }>()
54
54
 
55
55
  defineExpose({
56
56
  setCenter: (coordinate: MapCoordinate) => {
57
- map.value?.setCenter(coordinate);
58
- },
59
- });
57
+ map.value?.setCenter(coordinate)
58
+ }
59
+ })
60
60
 
61
- const mapRef = ref<Element>();
62
- const map = ref<google.maps.Map | null>(null);
63
- const listeners: google.maps.MapsEventListener[] = [];
61
+ const mapRef = ref<Element>()
62
+ const map = ref<google.maps.Map | null>(null)
63
+ const listeners: google.maps.MapsEventListener[] = []
64
64
 
65
65
  function formatCoordinate(ev: google.maps.MapMouseEvent) {
66
66
  return {
67
67
  lat: ev.latLng.lat(),
68
- lng: ev.latLng.lng(),
69
- };
68
+ lng: ev.latLng.lng()
69
+ }
70
70
  }
71
71
 
72
72
  function addListenerToMap(instance: object, eventName: string, callback: (...args: any[]) => void) {
73
- const listener = googleMap.maps.event.addListener(instance, eventName, callback);
74
- listeners.push(listener);
73
+ const listener = googleMap()!.maps.event.addListener(instance, eventName, callback)
74
+ listeners.push(listener)
75
75
  }
76
76
 
77
- const markers = ref<google.maps.Marker[]>([]);
77
+ const markers = ref<google.maps.Marker[]>([])
78
78
 
79
79
  function addMarkerListener<N extends keyof google.maps.MarkerHandlerMap<google.maps.Marker>>(
80
80
  marker: google.maps.Marker,
81
81
  event: N,
82
- callback: google.maps.MarkerHandlerMap<google.maps.Marker>[N],
82
+ callback: google.maps.MarkerHandlerMap<google.maps.Marker>[N]
83
83
  ) {
84
- addListenerToMap(marker, event, callback);
84
+ addListenerToMap(marker, event, callback)
85
85
  }
86
86
 
87
87
  function setMarkers(newMarkers: MapCoordinate[]) {
88
- setMapOnAllMarkers(null);
88
+ setMapOnAllMarkers(null)
89
89
  markers.value = newMarkers.map((m, index) => {
90
- const marker = new googleMap.maps.Marker({
90
+ const map = googleMap()
91
+ const marker = new map.maps.Marker({
91
92
  position: m,
92
- draggable: true,
93
- });
93
+ draggable: true
94
+ })
94
95
  addMarkerListener(marker, 'dragend', (ev) => {
95
- emits('marker-change', { index, position: formatCoordinate(ev) });
96
- });
97
- return marker;
98
- });
99
- setMapOnAllMarkers(map.value);
96
+ emits('marker-change', { index, position: formatCoordinate(ev) })
97
+ })
98
+ return marker
99
+ })
100
+ setMapOnAllMarkers(map.value)
100
101
  }
101
102
 
102
103
  function setMapOnAllMarkers(map: google.maps.Map | null) {
103
- markers.value.map((marker) => toRaw(marker).setMap(map));
104
+ markers.value.map((marker) => toRaw(marker).setMap(map))
104
105
  }
105
106
 
106
- const polygons = ref<google.maps.Polygon[]>([]);
107
+ const polygons = ref<google.maps.Polygon[]>([])
107
108
 
108
109
  function addPolygonListener<N extends keyof PolygonEventHandler>(
109
110
  polygon: google.maps.Polygon,
110
111
  event: N,
111
- callback: PolygonEventHandler[N],
112
+ callback: PolygonEventHandler[N]
112
113
  ) {
113
- addListenerToMap(polygon, event, callback);
114
+ addListenerToMap(polygon, event, callback)
114
115
  }
115
116
 
116
- function addVertexListener<N extends keyof google.maps.MVCArrayHandlerMap<Vertex, google.maps.LatLng>>(
117
- path: Vertex,
118
- event: N,
119
- callback: google.maps.MVCArrayHandlerMap<Vertex, google.maps.LatLng>[N],
120
- ) {
121
- addListenerToMap(path, event, callback);
117
+ function addVertexListener<
118
+ N extends keyof google.maps.MVCArrayHandlerMap<Vertex, google.maps.LatLng>
119
+ >(path: Vertex, event: N, callback: google.maps.MVCArrayHandlerMap<Vertex, google.maps.LatLng>[N]) {
120
+ addListenerToMap(path, event, callback)
122
121
  }
123
122
 
124
123
  function getPolygonPath(index: number) {
125
- const path = polygons.value[index].getPath().getArray();
124
+ const path = polygons.value[index].getPath().getArray()
126
125
  return path.map(({ lat, lng }) => ({
127
126
  lat: lat(),
128
- lng: lng(),
129
- }));
127
+ lng: lng()
128
+ }))
130
129
  }
131
130
 
132
131
  function polygonChanged(polygonIndex: number) {
133
- const newPath = getPolygonPath(polygonIndex);
134
- emits('polygon-change', { index: polygonIndex, path: newPath });
132
+ const newPath = getPolygonPath(polygonIndex)
133
+ emits('polygon-change', { index: polygonIndex, path: newPath })
135
134
  }
136
135
 
137
136
  function removePolygonVertex(polygonIndex: number, vertexIndex: number) {
138
- const path = getPolygonPath(polygonIndex);
139
- const newPath = path.filter((_, i) => i !== vertexIndex);
140
- emits('polygon-change', { index: polygonIndex, path: newPath });
137
+ const path = getPolygonPath(polygonIndex)
138
+ const newPath = path.filter((_, i) => i !== vertexIndex)
139
+ emits('polygon-change', { index: polygonIndex, path: newPath })
141
140
  }
142
141
 
143
142
  function polygonRightClick(polygonIndex: number, ev: google.maps.PolyMouseEvent) {
144
143
  if (ev.vertex !== undefined) {
145
- removePolygonVertex(polygonIndex, ev.vertex);
144
+ removePolygonVertex(polygonIndex, ev.vertex)
146
145
  } else {
147
- emits('polygon-right-click', polygonIndex);
146
+ emits('polygon-right-click', polygonIndex)
148
147
  }
149
148
  }
150
149
 
151
150
  function setPolygons(newPolygons: MapPolygon[]) {
152
- setMapOnAllPolygons(null);
151
+ setMapOnAllPolygons(null)
153
152
  polygons.value = newPolygons.map((p, index) => {
154
- const polygon = new googleMap.maps.Polygon({
153
+ const map = googleMap()
154
+ const polygon = new map.maps.Polygon({
155
155
  paths: p.paths,
156
156
  strokeColor: p.strokeColor,
157
157
  fillColor: p.fillColor,
158
158
  fillOpacity: 0.5,
159
- editable: props.editable,
160
- });
161
- addPolygonListener(polygon, 'contextmenu', (v) => polygonRightClick(index, v));
162
- polygon.getPaths().forEach(path => {
163
- addVertexListener(path, 'insert_at', () => polygonChanged(index));
164
- addVertexListener(path, 'set_at', () => polygonChanged(index));
165
- });
166
- return polygon;
167
- });
168
- setMapOnAllPolygons(map.value);
159
+ editable: props.editable
160
+ })
161
+ addPolygonListener(polygon, 'contextmenu', (v) => polygonRightClick(index, v))
162
+ polygon.getPaths().forEach((path) => {
163
+ addVertexListener(path, 'insert_at', () => polygonChanged(index))
164
+ addVertexListener(path, 'set_at', () => polygonChanged(index))
165
+ })
166
+ return polygon
167
+ })
168
+ setMapOnAllPolygons(map.value)
169
169
  }
170
170
 
171
171
  function setMapOnAllPolygons(map: google.maps.Map | null) {
172
- polygons.value.map((polygon) => toRaw(polygon).setMap(map));
172
+ polygons.value.map((polygon) => toRaw(polygon).setMap(map))
173
173
  }
174
174
 
175
175
  function addMapListener<N extends keyof google.maps.MapHandlerMap<google.maps.Map>>(
176
176
  map: google.maps.Map,
177
177
  event: N,
178
- callback: google.maps.MapHandlerMap<google.maps.Map>[N],
178
+ callback: google.maps.MapHandlerMap<google.maps.Map>[N]
179
179
  ) {
180
- addListenerToMap(map, event, callback);
180
+ addListenerToMap(map, event, callback)
181
181
  }
182
182
 
183
183
  function setMap() {
184
- map.value = new googleMap.maps.Map(mapRef.value as Element, {
184
+ const Map = googleMap().maps.Map
185
+ map.value = new Map(mapRef.value as Element, {
185
186
  center: props.center,
186
187
  zoom: props.zoom,
187
188
  mapTypeControl: false,
188
189
  streetViewControl: false,
189
190
  draggable: true,
190
- scrollwheel: true,
191
- });
191
+ scrollwheel: true
192
+ })
192
193
 
193
- addMapListener(map.value, 'click', (ev) => emits('map-click', formatCoordinate(ev)));
194
+ addMapListener(map.value, 'click', (ev) => emits('map-click', formatCoordinate(ev)))
194
195
  }
195
196
 
196
- watch(() => props.markers, setMarkers, { deep: true });
197
- watch(() => props.polygons, setPolygons, { deep: true });
197
+ watch(() => props.markers, setMarkers, { deep: true })
198
+ watch(() => props.polygons, setPolygons, { deep: true })
198
199
 
199
200
  onMounted(() => {
200
- if (!mapRef.value || !googleMap) return;
201
- setMap();
202
- setMarkers(props.markers);
203
- setPolygons(props.polygons);
204
- });
201
+ if (!mapRef.value || !googleMap()) return
202
+ setMap()
203
+ setMarkers(props.markers)
204
+ setPolygons(props.polygons)
205
+ })
205
206
 
206
207
  onUnmounted(() => {
207
- listeners.forEach((listener) => listener.remove());
208
- });
208
+ listeners.forEach((listener) => listener.remove())
209
+ })
209
210
  </script>
210
211
 
211
212
  <template>
212
- <div
213
- ref="mapRef"
214
- class="map app-map"
215
- />
216
- </template>
213
+ <div ref="mapRef" class="map app-map" />
214
+ </template>
@@ -1,9 +1,16 @@
1
+ /// <reference types="googlemaps" />
1
2
  import { type MapCoordinate } from '@/components/type';
3
+ import { ref } from "vue"
2
4
 
3
- let googleMap: typeof google;
5
+ const _googleMap = ref<typeof google | null>(null)
6
+
7
+ // defines a getter
8
+ const googleMap = (): typeof google => {
9
+ return _googleMap.value!
10
+ }
4
11
 
5
12
  export function setGoogleMap(map: typeof google) {
6
- if (!googleMap) googleMap = map;
13
+ if (!_googleMap.value) _googleMap.value = map
7
14
  }
8
15
 
9
16
  const coordinates = Object.freeze({
@@ -27,25 +34,26 @@ function arrayToCoordinate(arr: number[]) {
27
34
 
28
35
  function generateAreaPaths({
29
36
  center,
30
- radius,
37
+ radius
31
38
  }: {
32
- radius: number;
39
+ radius: number
33
40
  center: {
34
- lng: number;
35
- lat: number;
41
+ lng: number
42
+ lat: number
36
43
  }
37
44
  }): { lat: number; lng: number }[] {
38
- const searchPoint = [];
39
- const radiusLat = (radius / 6371) * (180 / Math.PI);
40
- const radiusLng = radiusLat / Math.cos(center.lat * (Math.PI / 180));
45
+ const searchPoint: google.maps.LatLng[] = []
46
+ const radiusLat = (radius / 6371) * (180 / Math.PI)
47
+ const radiusLng = radiusLat / Math.cos(center.lat * (Math.PI / 180))
41
48
  for (let a = 0; a < 361; a += 45) {
42
- const aRad = a * (Math.PI / 180);
43
- const x = center.lng + (radiusLng * Math.cos(aRad));
44
- const y = center.lat + (radiusLat * Math.sin(aRad));
45
- const point = new googleMap.maps.LatLng(y, x, true);
46
- searchPoint.push(point);
49
+ const aRad = a * (Math.PI / 180)
50
+ const x = center.lng + radiusLng * Math.cos(aRad)
51
+ const y = center.lat + radiusLat * Math.sin(aRad)
52
+ const map = googleMap()
53
+ const point = new map.maps.LatLng(y, x, true)
54
+ searchPoint.push(point)
47
55
  }
48
- return searchPoint.map(v => ({ lat: v.lat(), lng: v.lng() }));
56
+ return searchPoint.map((v) => ({ lat: v.lat(), lng: v.lng() }))
49
57
  }
50
58
 
51
59
  function pathToPolygon(path: MapCoordinate[]): number[][] {
@@ -1,30 +1,26 @@
1
1
  import { type RouteRecordRaw } from 'vue-router'
2
- import KioskDevicesView from '@/views/kiosk/devices/KioskDevicesView.vue';
3
- import KioskSettingView from '@/views/kiosk/settings/KioskSettingView.vue';
4
2
  import { PortalRoute } from '@/utils/constants/route';
5
- import KioskView from '@/views/kiosk/KioskView.vue';
6
- import OrderSettingsView from '@/views/order-settings/OrderSettingsView.vue';
7
3
 
8
4
  const routes: RouteRecordRaw[] = [
9
5
  {
10
6
  path: PortalRoute.KioskRoute,
11
7
  name: 'Kiosk',
12
- component: KioskView,
8
+ component: () => import('@/views/kiosk/KioskView.vue')
13
9
  },
14
10
  {
15
11
  path: PortalRoute.KioskDeviceRoute,
16
12
  name: 'Kiosk Device',
17
- component: KioskDevicesView
13
+ component: () => import('@/views/kiosk/devices/KioskDevicesView.vue')
18
14
  },
19
15
  {
20
16
  path: PortalRoute.KioskOrderSettingRoute,
21
17
  name: 'Kiosk Order Setting',
22
- component: KioskSettingView
18
+ component: () => import('@/views/kiosk/settings/KioskSettingView.vue')
23
19
  },
24
20
  {
25
21
  path: PortalRoute.OrderSettingView,
26
22
  name: 'Order Setting View',
27
- component: OrderSettingsView
23
+ component: () => import('@/views/order-settings/OrderSettingsView.vue')
28
24
  },
29
25
  ];
30
26
 
@@ -72,7 +72,7 @@ export const useRestaurantStore = defineStore('restaurant', {
72
72
  },
73
73
  actions: {
74
74
  async readRestaurantSetting(restaurantId: string) {
75
- const restaurantSetting = await restaurantApi.readRestaurantSetting()
75
+ const restaurantSetting = await restaurantApi.readRestaurantSetting(restaurantId)
76
76
  this.restaurantSettings = {
77
77
  ...this.restaurantSettings,
78
78
  [restaurantId]: restaurantSetting
@@ -2,7 +2,7 @@
2
2
  import type { MapPolygon } from '@/components/type'
3
3
  import { useLoading } from '@/composables/loading'
4
4
  import { formatCurrency } from '@/helpers/currency'
5
- import { arrayToCoordinate, getPolygonCenter, googleMap as gm } from '@/helpers/map'
5
+ import { arrayToCoordinate, getPolygonCenter, googleMap } from '@/helpers/map'
6
6
  import { clone } from '@/helpers/object'
7
7
  import type { FdoAddress, FdoDeliveryArea } from '@feedmepos/core/entity'
8
8
  import GoogleMap from '@/components/GoogleMap.vue'
@@ -147,7 +147,8 @@ async function getCenter() {
147
147
  center.value = arrayToCoordinate(coordinates || [])
148
148
  gmRef.value?.setCenter(center.value)
149
149
  } catch (err) {
150
- const geocoder = new gm.maps.Geocoder()
150
+ const map = googleMap()
151
+ const geocoder = new map.maps.Geocoder()
151
152
  await startAsyncCallWithErr(async () => {
152
153
  await new Promise((resolve) => {
153
154
  geocoder.geocode({ address: formatted }, (res) => {
@@ -22,7 +22,8 @@ function input(v: string) {
22
22
 
23
23
  const modelValue = ref(props.initialValue || '')
24
24
  const placeOptions = ref<string[]>([])
25
- const autocomplete = new googleMap.maps.places.AutocompleteService()
25
+ const map = googleMap()
26
+ const autocomplete = new map.maps.places.AutocompleteService()
26
27
 
27
28
  function filterFn(val: string) {
28
29
  autocomplete.getPlacePredictions({ input: val }, (res) => {
@@ -34,7 +35,7 @@ function filterFn(val: string) {
34
35
 
35
36
  watch(modelValue, (newVal) => {
36
37
  filterFn(newVal)
37
- if (googleMap) {
38
+ if (googleMap()) {
38
39
  input(newVal)
39
40
  }
40
41
  })
@@ -6,10 +6,20 @@
6
6
  <div class="flex justify-end items-center mb-3">
7
7
  <FmSearch v-model="searchKey" :placeholder="t('order.search')" />
8
8
  </div>
9
- <PickupList :pickupSettingData="pickupSettingData" @toggleSideSheet="toggleSideSheet"
10
- class="mt-5 md:hidden lg:hidden xl:hidden" />
11
- <FmTable class="h-[500px] xs:hidden sm:hidden" :row-data="pickupSettingData" :hideFooter="true"
12
- :column-defs="columns" :loading="isLoading" @row-click="toggleSideSheet" :pageSize="pickupSettingData.length">
9
+ <PickupList
10
+ :pickupSettingData="pickupSettingData"
11
+ @toggleSideSheet="toggleSideSheet"
12
+ class="mt-5 md:hidden lg:hidden xl:hidden"
13
+ />
14
+ <FmTable
15
+ class="h-[500px] xs:hidden sm:hidden"
16
+ :row-data="pickupSettingData"
17
+ :hideFooter="true"
18
+ :column-defs="columns"
19
+ :loading="isLoading"
20
+ @row-click="toggleSideSheet"
21
+ :pageSize="pickupSettingData.length"
22
+ >
13
23
  </FmTable>
14
24
  <PickUpSettingDialog :showPickupDialog="sideSheet" @closeSideSheet="closeSideSheet" />
15
25
  </div>
@@ -54,7 +64,6 @@ onMounted(async () => {
54
64
  await startAsyncCallWithErr(async () => {
55
65
  await Promise.all(
56
66
  restaurants.value.map(async (r) => {
57
- await changeRestaurant(r)
58
67
  await restaurantStore.readRestaurantSetting(r._id)
59
68
  })
60
69
  )
@@ -65,7 +74,7 @@ async function onUpdate() {
65
74
  await startAsyncCallWithErr(async () => {
66
75
  await Promise.all(
67
76
  restaurants.value.map(async (r) => {
68
- changeRestaurant(r)
77
+ await changeRestaurant(r)
69
78
  await restaurantStore.readRestaurantSetting(r._id)
70
79
  })
71
80
  )
@@ -80,7 +89,7 @@ async function toggleSideSheet(rowData: any) {
80
89
 
81
90
  const restaurant = restaurants.value.find((r) => r._id === v)
82
91
  if (restaurant) {
83
- changeRestaurant(restaurant)
92
+ await changeRestaurant(restaurant)
84
93
  }
85
94
  sideSheet.value = true
86
95
  }
@@ -88,7 +97,7 @@ async function toggleSideSheet(rowData: any) {
88
97
  async function closeSideSheet(refresh = false) {
89
98
  sideSheet.value = false
90
99
  if (originalRestaurant) {
91
- changeRestaurant(originalRestaurant)
100
+ await changeRestaurant(originalRestaurant)
92
101
  }
93
102
  if (refresh) {
94
103
  await onUpdate()
@@ -112,16 +121,16 @@ const pickupSettingData = computed<PickupSettingData[]>(() => {
112
121
  const paymentMethod = !hasCustomOfflinePayment
113
122
  ? (item.paymentTypes || []).map((p) => sentenceCase(p)).join(', ')
114
123
  : [
115
- (item.paymentTypes || [])
116
- .filter((p) => p !== 'cash')
117
- .map((p) => sentenceCase(p))
118
- .join(', '),
119
- canOfflinePayment
120
- ? (item.offlinePaymentTypes || []).map((p) => sentenceCase(p.name)).join(', ')
121
- : ''
122
- ]
123
- .filter((v) => !!v)
124
- .join(', ')
124
+ (item.paymentTypes || [])
125
+ .filter((p) => p !== 'cash')
126
+ .map((p) => sentenceCase(p))
127
+ .join(', '),
128
+ canOfflinePayment
129
+ ? (item.offlinePaymentTypes || []).map((p) => sentenceCase(p.name)).join(', ')
130
+ : ''
131
+ ]
132
+ .filter((v) => !!v)
133
+ .join(', ')
125
134
 
126
135
  const onlineStatus = item.enable ? t('order.activated') : t('order.inactive')
127
136
 
@@ -143,13 +152,13 @@ const pickupSettingData = computed<PickupSettingData[]>(() => {
143
152
  })
144
153
 
145
154
  export interface PickupSettingData {
146
- restaurantId: string;
147
- restaurant: string;
148
- paymentmethod: string;
149
- online: string;
150
- enable: boolean;
151
- preorder: string;
152
- pickuppoint: string;
155
+ restaurantId: string
156
+ restaurant: string
157
+ paymentmethod: string
158
+ online: string
159
+ enable: boolean
160
+ preorder: string
161
+ pickuppoint: string
153
162
  }
154
163
 
155
164
  export interface RestaurantPickup extends FdoRestaurantPickup {
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./app-9Q-zRVKD.js";
2
- export {
3
- f as default
4
- };