@ozdao/prometheus-framework 0.2.134 → 0.2.135

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  3. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  5. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  7. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  9. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  11. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +73 -43
  13. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -0
  14. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +64 -0
  15. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotSub.vue.cjs +1 -0
  16. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotSub.vue.js +24 -0
  17. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -0
  18. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +181 -0
  19. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -0
  20. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +478 -0
  21. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs +1 -0
  22. package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js +121 -0
  23. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -0
  24. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +203 -0
  25. package/dist/prometheus-framework/src/modules/spots/router/spots.cjs +1 -0
  26. package/dist/prometheus-framework/src/modules/spots/router/spots.js +92 -0
  27. package/dist/prometheus-framework/src/modules/spots/spots.client.cjs +1 -0
  28. package/dist/prometheus-framework/src/modules/spots/spots.client.js +37 -0
  29. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  31. package/dist/spots.server.js +169 -0
  32. package/dist/spots.server.mjs +170 -0
  33. package/dist/style.css +1 -1
  34. package/package.json +1 -1
  35. package/src/modules/globals/components/layouts/Client.vue +10 -8
  36. package/src/modules/globals/components/sections/Walkthrough.vue +4 -4
  37. package/src/modules/globals/globals.client.js +5 -5
  38. package/src/modules/organizations/components/pages/OrganizationEdit.vue +29 -1
  39. package/src/modules/spots/components/layouts/Spots.vue +1 -1
  40. package/src/modules/spots/components/pages/SpotEdit.vue +8 -53
  41. package/src/modules/spots/models/spot.model.js +7 -7
  42. package/src/modules/spots/router/spots.js +65 -61
  43. package/src/modules/spots/spots.client.js +43 -0
  44. package/src/modules/spots/spots.server.js +31 -0
  45. package/src/modules/spots/components/sections/PlaceModify.vue +0 -113
  46. package/src/modules/spots/components/sections/Places.vue +0 -119
@@ -39,6 +39,33 @@
39
39
  <BlockTags
40
40
  @tags-changed="newTags => organization.state.current.profile.tags = newTags"
41
41
  :tags="organization.state.current.profile.tags"
42
+ class="mn-b-small"
43
+ />
44
+
45
+ <h3 class="mn-b-small">Contacts</h3>
46
+ <Field
47
+ v-model:field="organization.state.current.contacts.email"
48
+ label="Email"
49
+ placeholder=""
50
+ class="mn-b-thin bg-light pd-medium radius-small"
51
+ />
52
+ <Field
53
+ v-model:field="organization.state.current.contacts.website"
54
+ label="Website"
55
+ placeholder=""
56
+ class="mn-b-thin bg-light pd-medium radius-small"
57
+ />
58
+ <Field
59
+ v-model:field="organization.state.current.contacts.phone"
60
+ label="Phone"
61
+ placeholder=""
62
+ class="mn-b-thin bg-light pd-medium radius-small"
63
+ />
64
+ <Field
65
+ v-model:field="organization.state.current.contacts.address"
66
+ label="Address"
67
+ placeholder=""
68
+ class="mn-b-thin bg-light pd-medium radius-small"
42
69
  />
43
70
 
44
71
  <h3 class="mn-b-small">Socials</h3>
@@ -70,11 +97,12 @@
70
97
  />
71
98
  <Field
72
99
  v-model:field="organization.state.current.socials.youtube"
73
- label="Telegram"
100
+ label="Youtube"
74
101
  placeholder=""
75
102
  class="mn-b-thin bg-light pd-medium radius-small"
76
103
  />
77
104
 
105
+
78
106
  <Button :submit="onSubmit" :callback="redirectTo" class="bg-main w-100 mn-b-thin">Save</Button>
79
107
  <!-- <Button :submit="onDelete" :callback="redirectDash" class="mn-b-thin bg-fourth">Delete</Button> -->
80
108
 
@@ -56,7 +56,7 @@
56
56
  import Breadcrumbs from '@pf/src/components/Breadcrumbs/Breadcrumbs.vue'
57
57
  import Dropdown from "@pf/src/components/Dropdown/Dropdown.vue";
58
58
 
59
- import Filters from '@pf/src/modules/marketplace/components/sections/Filters.vue'
59
+ // import Filters from '@pf/src/modules/marketplace/components/sections/Filters.vue'
60
60
 
61
61
 
62
62
  import * as globals from '@pf/src/modules/globals/store/globals';
@@ -155,7 +155,6 @@ import { useRoute, useRouter } from "vue-router";
155
155
  import Block from '@pf/src/components/Block/Block.vue';
156
156
  import UploadImage from '@pf/src/components/UploadImage/UploadImage.vue';
157
157
 
158
-
159
158
  import Tab from "@pf/src/components/Tab/Tab.vue";
160
159
  import Field from "@pf/src/components/Field/Field.vue";
161
160
  import Select from "@pf/src/components/Select/Select.vue";
@@ -165,72 +164,28 @@ import LocationMarker from "@pf/src/components/LocationMarker/LocationMarker.vue
165
164
  import Button from "@pf/src/components/Button/Button.vue";
166
165
  import Popup from "@pf/src/components/Popup/Popup.vue";
167
166
 
168
- import EditArray from "@pf/src/modules/organizations/components/blocks/EditArray.vue";
169
- import SpotSub from "@pf/src/modules/spots/components/blocks/SpotSub.vue";
170
- import SpotMemberModify from "@pf/src/modules/spots/components/blocks/SpotMemberModify.vue";
171
- // import SpotSubSpotModify from "@pf/src/modules/spots/components/blocks/SpotSubSpotModify.vue";
172
- import User from '@pf/src/modules/users/components/blocks/CardUser.vue';
173
-
174
167
  import * as spots from "@pf/src/modules/spots/store/spots";
175
- import * as memberships from "@pf/src/modules/organizations/store/memberships";
176
168
 
177
169
  const router = useRouter();
178
170
  const route = useRoute();
179
171
  const tabOrganization = ref("details");
180
172
  const showAddNew = ref(false);
181
173
 
182
- onMounted(() => {
183
- // spots.state.spot.location = spots.state.spot.location
174
+ onMounted(async () => {
175
+ await fetchData();
184
176
  })
185
177
 
186
178
  async function fetchData() {
187
- if (route.params.spot) {
188
- await memberships.actions.read(route.params.spot);
189
- }
190
- const users = ref(memberships.state.memberships);
191
179
 
192
180
  if (route.params.spot) await spots.actions.readOne(route.params.spot);
193
181
 
194
- }
195
-
196
- await fetchData();
197
-
198
- // const [ lng, lat ] = spots.state.spot.location?.coordinates
199
-
200
- const lng = spots.state.spot.location?.coordinates[0]
201
- const lat = spots.state.spot.location?.coordinates[1]
202
-
203
- spots.state.spot.location = {
204
- lat: lat || 1,
205
- lng: lng || 1
206
- }
207
-
208
- const members = ref(spots.state.spot.members);
182
+ const lng = spots.state.spot.location?.coordinates[0]
183
+ const lat = spots.state.spot.location?.coordinates[1]
209
184
 
210
- const isOpenAddMemberPopup = ref(false);
211
- const selectedMember = ref(null);
212
-
213
- function openMemberPopup(member) {
214
- isOpenAddMemberPopup.value = true;
215
- if (typeof member === "number") selectedMember.value = member;
216
- }
217
-
218
- function closeMemberPopup() {
219
- isOpenAddMemberPopup.value = false;
220
- selectedMember.value = null;
221
- }
222
-
223
- const isOpenSpotPopup = ref(false);
224
- const selectedSpot = ref(null);
225
-
226
- function openSpotPopup(spot) {
227
- isOpenSpotPopup.value = true;
228
- if (typeof spot === "number") selectedSpot.value = spot;
229
- }
230
-
231
- function closeSpotPopup() {
232
- isOpenSpotPopup.value = false;
233
- selectedSpot.value = null;
185
+ spots.state.spot.location = {
186
+ lat: lat || 1,
187
+ lng: lng || 1
188
+ }
234
189
  }
235
190
 
236
191
  async function onSubmit() {
@@ -1,12 +1,12 @@
1
- module.exports = (mongoose) => {
1
+ module.exports = (db) => {
2
2
  // Схема отдела
3
- const spotSchema = new mongoose.Schema({
3
+ const spotSchema = new db.mongoose.Schema({
4
4
  owner: {
5
- type: mongoose.Schema.Types.ObjectId,
5
+ type: db.mongoose.Schema.Types.ObjectId,
6
6
  ref: 'User',
7
7
  },
8
8
  organization: {
9
- type: mongoose.Schema.Types.ObjectId,
9
+ type: db.mongoose.Schema.Types.ObjectId,
10
10
  ref: 'Organization',
11
11
  },
12
12
  profile: {
@@ -47,7 +47,7 @@ module.exports = (mongoose) => {
47
47
  members: [
48
48
  {
49
49
  user: {
50
- type: mongoose.Schema.Types.ObjectId,
50
+ type: db.mongoose.Schema.Types.ObjectId,
51
51
  ref: 'User',
52
52
  },
53
53
  position: {
@@ -58,7 +58,7 @@ module.exports = (mongoose) => {
58
58
  ],
59
59
  subspots: [
60
60
  {
61
- type: mongoose.Schema.Types.ObjectId,
61
+ type: db.mongoose.Schema.Types.ObjectId,
62
62
  ref: 'Spot',
63
63
  },
64
64
  ],
@@ -69,7 +69,7 @@ module.exports = (mongoose) => {
69
69
  spotSchema.index({ location: '2dsphere' });
70
70
 
71
71
 
72
- const Spot = mongoose.model('Spot', spotSchema);
72
+ const Spot = db.mongoose.model('Spot', spotSchema);
73
73
 
74
74
  return Spot
75
75
  }
@@ -3,70 +3,74 @@ import layoutSpots from '../components/layouts/Spots.vue'
3
3
 
4
4
  import * as validationAuth from '@pf/src/modules/middlewares/client/auth.validation.js';
5
5
 
6
- const spots = [
7
- {
8
- path: 'spots',
9
- component: layoutEmpty,
10
- meta: {
11
- title: {
12
- en: 'Spots',
13
- ru: 'Места'
6
+ const spots = {
7
+ path: 'spots',
8
+ component: layoutEmpty,
9
+ meta: {
10
+ title: {
11
+ en: 'Spots',
12
+ ru: 'Места'
13
+ },
14
+ },
15
+ children: [
16
+ {
17
+ path: ':country?',
18
+ component: layoutSpots,
19
+ meta: {
20
+ title: {
21
+ en: 'Spots',
22
+ ru: 'Места'
23
+ },
24
+ header_theme: 'dark',
25
+ footer_theme: 'dark'
14
26
  },
15
- header_theme: 'dark',
16
- footer_theme: 'dark'
27
+ children: [
28
+ {
29
+ path: ':state?',
30
+ name: 'Spots tate',
31
+ component: () => import(/* webpackChunkName: 'Deliveries' */ '../components/pages/Map.vue'),
32
+ children: [
33
+ {
34
+ path: ':city?',
35
+ name: 'Spots City',
36
+ component: () => import(/* webpackChunkName: 'Deliveries' */ '../components/pages/Map.vue'),
37
+ }
38
+ ]
39
+ }
40
+ ]
17
41
  },
18
- children: [
19
- {
20
- path: ':country?',
21
- component: layoutSpots,
22
- children: [
23
- {
24
- path: ':state?',
25
- name: 'Spots tate',
26
- component: () => import(/* webpackChunkName: 'Deliveries' */ '../components/pages/Map.vue'),
27
- children: [
28
- {
29
- path: ':city?',
30
- name: 'Spots City',
31
- component: () => import(/* webpackChunkName: 'Deliveries' */ '../components/pages/Map.vue'),
32
- }
33
- ]
34
- }
35
- ]
42
+ {
43
+ path: ':_id/spots/create',
44
+ name: 'Spot Creation',
45
+ meta: {
46
+ title: 'Создание точки',
36
47
  },
37
- {
38
- path: ':_id/spots/create',
39
- name: 'Spot Creation',
40
- meta: {
41
- title: 'Создание отдела',
42
- },
43
- beforeEnter: [
44
- validationAuth.requiresAuth,
45
- ],
46
- component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/SpotEdit.vue'),
47
- }, {
48
- path: ':_id/spots/:deparment',
49
- name: 'Spot',
50
- meta: {
51
- title: 'Отдел',
52
- },
53
- beforeEnter: [
54
- validationAuth.requiresAuth,
55
- ],
56
- component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/Spot.vue'),
57
- }, {
58
- path: ':_id/spots/:spot/edit',
59
- name: 'Spot Edit',
60
- meta: {
61
- title: 'Редактирование отдела',
62
- },
63
- beforeEnter: [
64
- validationAuth.requiresAuth,
65
- ],
66
- component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/SpotEdit.vue'),
48
+ beforeEnter: [
49
+ validationAuth.requiresAuth,
50
+ ],
51
+ component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/SpotEdit.vue'),
52
+ }, {
53
+ path: ':_id/spots/:deparment',
54
+ name: 'Spot',
55
+ meta: {
56
+ title: 'Точка',
57
+ },
58
+ beforeEnter: [
59
+ validationAuth.requiresAuth,
60
+ ],
61
+ component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/Spot.vue'),
62
+ }, {
63
+ path: ':_id/spots/:spot/edit',
64
+ name: 'Spot Edit',
65
+ meta: {
66
+ title: 'Редактирование точки',
67
67
  },
68
- ]
69
- }
70
- ];
68
+ beforeEnter: [
69
+ validationAuth.requiresAuth,
70
+ ],
71
+ component: () => import(/* webpackChunkName: "spot" */ '@pf/src/modules/spots/components/pages/SpotEdit.vue'),
72
+ },
73
+ ]
74
+ }
71
75
 
72
76
  export default spots;
@@ -0,0 +1,43 @@
1
+ // Store
2
+ import * as storeSpots from './store/spots.js';
3
+ // Router
4
+ import routerSpots from './router/spots.js';
5
+ // Views
6
+ import Spots from './components/layouts/Spots.vue';
7
+ import Spot from './components/pages/Spot.vue';
8
+ import SpotEdit from './components/pages/SpotEdit.vue';
9
+ import Map from './components/pages/Map.vue';
10
+ // Importing blocks components
11
+ import CardSpot from './components/blocks/CardSpot.vue';
12
+ import SpotMemberModify from './components/blocks/SpotMemberModify.vue';
13
+ import SpotSub from './components/blocks/SpotSub.vue';
14
+
15
+ function initializeSpots(app, store, router) {
16
+ router.addRoute('Home', routerSpots);
17
+ store.addStore('spots', storeSpots);
18
+ }
19
+
20
+ const ModuleSpot = {
21
+ initialize: initializeSpots,
22
+ views: {
23
+ store: {
24
+ storeSpots
25
+ },
26
+ router: {
27
+ routerSpots
28
+ },
29
+ components: {
30
+ // Pages
31
+ Spots,
32
+ Spot,
33
+ SpotEdit,
34
+ Map,
35
+ // Blocks
36
+ CardSpot,
37
+ SpotMemberModify,
38
+ SpotSub,
39
+ }
40
+ }
41
+ }
42
+
43
+ export default ModuleSpot;
@@ -0,0 +1,31 @@
1
+ const ModelSpot = require('./models/spot.model.js');
2
+
3
+ const RoutesSpot = require('./routes/spots.routes.js');
4
+
5
+ const FactorySpot = require('./controllers/spots.controller.js');
6
+
7
+ const CRUD = require('@pf/src/modules/globals/services/globals.crud');
8
+
9
+ function initializeSpots(app, db, origins, publicPath) {
10
+ // Setup models in the database object
11
+ db.spot = ModelSpot(db);
12
+
13
+ // Setup routes if the app object is provided
14
+ if (app) {
15
+ RoutesSpot(app, db, origins, publicPath);
16
+ }
17
+ }
18
+
19
+ // Exporting controllers, routes, and models
20
+ module.exports = {
21
+ initialize: initializeSpots,
22
+ models: {
23
+ ModelSpot,
24
+ },
25
+ routes: {
26
+ RoutesSpot,
27
+ },
28
+ controllers: {
29
+ FactorySpot
30
+ }
31
+ };
@@ -1,113 +0,0 @@
1
- <template>
2
- <div>
3
- <div class="br-grey-transp-25 radius-small mn-b-small">
4
- <Select
5
- :options="[
6
- {name: 'Кафе', value: 'cafe'},
7
- {name: 'Бар', value: 'bar'},
8
- {name: 'Ресторан', value: 'restaraunt'},
9
- {name: 'Пиццерия', value: 'pizzeria'},
10
- {name: 'Ночной клуб', value: 'night-club'},
11
- {name: 'Шаверма', value: 'shaverma'},
12
- {name: 'Кофейня', value: 'coffee'}
13
- ]"
14
- :prop="placeForm"
15
- content="type"
16
- label="Тип"
17
- placeholder="Тип заведения"
18
- size="small"
19
- />
20
-
21
- <Field
22
- v-model:field="placeForm.name"
23
- label="Название"
24
- :validation="placeValidation"
25
- placeholder="Введите название места"
26
- />
27
-
28
- <Field
29
- v-model:field="placeForm.address"
30
- label="Адрес"
31
- :validation="placeValidation"
32
- placeholder="Введите адрес места"
33
- />
34
-
35
- <Field
36
- v-model:field="placeForm.phone"
37
- label="Телефон"
38
- :validation="placeValidation"
39
- placeholder="Введите телефон места"
40
- />
41
- </div>
42
-
43
- <button @click="submitForm" class="w-100 button bg-second t-white">
44
- {{ props.place !== null ? "Редактировать заведение" : "Добавить заведение" }}
45
- </button>
46
- </div>
47
- </template>
48
- <script setup>
49
- import { ref } from 'vue';
50
- import Field from '@pf/src/components/Field/Field.vue';
51
- import Select from '@pf/src/components/Select/Select.vue';
52
- import * as inputsValidation from '@pf/src/modules/validations/client/inputs.validation';
53
-
54
- const props = defineProps({
55
- isPopupOpen: Boolean,
56
- place: Number,
57
- places: Array,
58
- });
59
-
60
- const emits = defineEmits(['callback']);
61
-
62
- const placeForm = ref({
63
- logo: '',
64
- name: '',
65
- address: '',
66
- });
67
-
68
- const placeValidation = ref(null);
69
-
70
- if (props.place !== null) {
71
- placeForm.value = props.places[props.place];
72
- }
73
-
74
- async function submitForm() {
75
- try {
76
- await inputsValidation.validateInputs(
77
- placeValidation,
78
- inputsValidation.validateLength,
79
- placeForm.value.name,
80
- 'Некорректное название'
81
- );
82
- } catch (error) {
83
- throw new Error();
84
- }
85
-
86
- if (props.place !== null) {
87
- props.places[props.place] = placeForm.value;
88
- emits('callback');
89
- } else {
90
- props.places.push(placeForm.value);
91
- emits('callback');
92
- }
93
- }
94
- </script>
95
-
96
-
97
- <style scoped>
98
- .form-group {
99
- margin-bottom: 1rem;
100
- }
101
-
102
- label {
103
- display: block;
104
- margin-bottom: 0.5rem;
105
- }
106
-
107
- input {
108
- width: 100%;
109
- padding: 0.5rem;
110
- border: 1px solid #ccc;
111
- border-radius: 5px;
112
- }
113
- </style>
@@ -1,119 +0,0 @@
1
- <template>
2
- <div>
3
-
4
- <div class="br-grey-transp-25 radius-small mn-b-small">
5
- <Select
6
- :options="[
7
- {name: 'Кафе', value: 'cafe'},
8
- {name: 'Бар', value: 'bar'},
9
- {name: 'Ресторан', value: 'restaraunt'},
10
- {name: 'Пиццерия', value: 'pizzeria'},
11
- {name: 'Ночной клуб', value: 'night-club'},
12
- {name: 'Шаверма', value: 'shaverma'},
13
- {name: 'Кофейня', value: 'coffee'}
14
- ]"
15
- :prop="placeForm"
16
- content="type"
17
- label="Тип"
18
- placeholder="Тип заведения"
19
- size="small"
20
- />
21
-
22
- <Field
23
- v-model:field="placeForm.name"
24
- label="Название"
25
- :validation="placeValidation"
26
- placeholder="Введите название места"
27
-
28
- />
29
-
30
- <Field
31
- v-model:field="placeForm.address"
32
- label="Адрес"
33
- :validation="placeValidation"
34
- placeholder="Введите адрес места"
35
-
36
- />
37
-
38
- <Field
39
- v-model:field="placeForm.phone"
40
- label="Телефон"
41
- :validation="placeValidation"
42
- placeholder="Введите телефон места"
43
-
44
- />
45
- </div>
46
-
47
- <button @click="submitForm" class="w-100 button bg-second t-white">
48
- {{ props.place !== null ? "Редактировать заведение" : "Добавить заведение" }}
49
- </button>
50
- </div>
51
- </template>
52
-
53
- <script setup>
54
- import { ref, watch } from "vue";
55
-
56
- import * as inputsValidation from '@pf/src/modules/middlewares/client/inputs.validation'
57
- import Field from "@pf/src/components/Field/Field.vue";
58
- import Select from "@pf/src/components/Select/Select.vue";
59
-
60
- const props = defineProps({
61
- isPopupOpen: Boolean,
62
- place: Number,
63
- places: Array,
64
- });
65
-
66
- const emits = defineEmits(['callback'])
67
-
68
- const placeForm = ref({
69
- logo: "",
70
- name: "",
71
- address: "",
72
- });
73
-
74
- if (props.place !== null) {
75
- placeForm.value = props.places[props.place]
76
- }
77
-
78
-
79
- const placeValidation = ref(null)
80
-
81
- async function submitForm() {
82
- try {
83
- await inputsValidation.validateInputs(
84
- placeValidation,
85
- inputsValidation.validateLength,
86
- placeForm.value.name,
87
- 'Некорректное название'
88
- )
89
- } catch (error) {
90
- throw new Error
91
- }
92
-
93
- if (props.place !== null) {
94
- props.places[props.place] = placeForm.value
95
- emits("callback");
96
- } else {
97
- props.places.push(placeForm.value);
98
- emits("callback");
99
- }
100
- }
101
- </script>
102
-
103
- <style scoped>
104
- .form-group {
105
- margin-bottom: 1rem;
106
- }
107
-
108
- label {
109
- display: block;
110
- margin-bottom: 0.5rem;
111
- }
112
-
113
- input {
114
- width: 100%;
115
- padding: 0.5rem;
116
- border: 1px solid #ccc;
117
- border-radius: 5px;
118
- }
119
- </style>