@ozdao/prometheus-framework 0.2.51 → 0.2.53

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/dist/main-0a2437f4.js +91 -0
  2. package/dist/main-482dc398.mjs +13626 -0
  3. package/dist/main-4fnApBsF.js +91 -0
  4. package/dist/main-b2JI9sFg.js +91 -0
  5. package/dist/main-c56d4c09.js +91 -0
  6. package/dist/main-cdd0be68.mjs +13628 -0
  7. package/dist/main-kjbLXQEa.mjs +13606 -0
  8. package/dist/main-x-9D8zvb.mjs +13604 -0
  9. package/dist/main.css +1 -1
  10. package/dist/organizations.server.js +2 -2
  11. package/dist/organizations.server.mjs +2 -2
  12. package/dist/products.server.js +81 -56
  13. package/dist/products.server.mjs +81 -56
  14. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +18 -20
  16. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +19 -19
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +28 -26
  20. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +2 -2
  22. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Map/Map.vue.js +35 -2
  24. package/dist/prometheus-framework/src/components/Map/Map.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Map/Map.vue2.js +2 -35
  26. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  28. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -0
  29. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +37 -0
  30. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.js +21 -14
  32. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.cjs +1 -0
  33. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.js +24 -0
  34. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  36. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
  38. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
  40. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +49 -101
  42. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +25 -25
  43. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +68 -39
  45. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +38 -48
  47. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +69 -62
  49. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +131 -126
  51. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +117 -146
  55. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +13 -13
  57. package/dist/prometheus-framework/src/modules/organizations/router/products.router.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/router/products.router.js +22 -0
  59. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +1 -0
  60. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +45 -0
  61. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.cjs +1 -0
  62. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.js +4 -0
  63. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -0
  64. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +79 -0
  65. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -0
  66. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +193 -0
  67. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.cjs +1 -0
  68. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.js +4 -0
  69. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +43 -43
  71. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +65 -55
  73. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +64 -51
  75. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +35 -33
  77. package/dist/prometheus-framework/src/modules/products/products.client.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/products/products.client.js +2 -2
  79. package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/products/store/categories.js +39 -27
  81. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/products/store/products.js +23 -23
  83. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  87. package/dist/prometheus-framework.cjs.js +1 -1
  88. package/dist/prometheus-framework.es.js +1 -1
  89. package/dist/style.css +1 -1
  90. package/dist/web-0066fd51.mjs +55 -0
  91. package/dist/web-6b9fa713.js +1 -0
  92. package/dist/web-6dcbb74b.mjs +55 -0
  93. package/dist/web-caJAdsxy.js +1 -0
  94. package/dist/web-ee302c1d.js +1 -0
  95. package/dist/web-i08OVMw9.mjs +55 -0
  96. package/dist/web-ngl7bNhF.js +1 -0
  97. package/dist/web-t91TrxXa.mjs +55 -0
  98. package/package.json +1 -1
  99. package/src/components/Button/Button.vue +4 -6
  100. package/src/components/Feed/Feed.vue +2 -1
  101. package/src/components/Field/Field.vue +3 -1
  102. package/src/components/LocationMarker/LocationMarker.vue +1 -0
  103. package/src/modules/applications/applications.client.js +0 -1
  104. package/src/modules/globals/components/blocks/BlockSearch.vue +42 -0
  105. package/src/modules/icons/entities/IconProfile.vue +10 -1
  106. package/src/modules/icons/entities/IconShopcart.vue +12 -2
  107. package/src/modules/marketplace/components/layouts/Marketplace.vue +7 -14
  108. package/src/modules/marketplace/components/sections/Filters.vue +7 -1
  109. package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +27 -7
  110. package/src/modules/orders/components/partials/ShopCart.vue +4 -1
  111. package/src/modules/organizations/components/blocks/CardDepartment.vue +34 -66
  112. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +50 -13
  113. package/src/modules/organizations/components/blocks/User.vue +18 -9
  114. package/src/modules/organizations/components/pages/Department.vue +19 -3
  115. package/src/modules/organizations/components/pages/DepartmentEdit.vue +14 -10
  116. package/src/modules/organizations/components/pages/Organization.vue +38 -71
  117. package/src/modules/organizations/components/sections/Feed.vue +1 -1
  118. package/src/modules/organizations/controllers/memberships.controller.js +2 -2
  119. package/src/modules/organizations/controllers/organizations.controller.js +0 -1
  120. package/src/modules/organizations/router/products.router.js +24 -4
  121. package/src/modules/products/components/blocks/CardCategory.vue +53 -0
  122. package/src/modules/products/components/pages/Categories.vue +90 -0
  123. package/src/modules/products/components/pages/CategoryEdit.vue +214 -0
  124. package/src/modules/products/components/pages/EditLeftover.vue +6 -4
  125. package/src/modules/products/components/pages/ProductEdit.vue +9 -1
  126. package/src/modules/products/components/pages/Products.vue +58 -38
  127. package/src/modules/products/components/sections/FilterProducts.vue +9 -6
  128. package/src/modules/products/controllers/categories.controller.js +30 -13
  129. package/src/modules/products/controllers/leftovers.controller.js +12 -5
  130. package/src/modules/products/controllers/products.controller.js +18 -0
  131. package/src/modules/products/models/category.model.js +42 -32
  132. package/src/modules/products/products.client.js +4 -2
  133. package/src/modules/products/store/categories.js +17 -3
  134. package/src/modules/products/store/products.js +4 -0
  135. package/src/modules/backoffice/components/admin/Categories.vue +0 -53
  136. package/src/modules/backoffice/components/admin/CategoryEdit.vue +0 -98
  137. package/src/modules/products/components/blocks/CategoryCard.vue +0 -42
  138. package/src/modules/products/router/products.router.js +0 -48
  139. /package/src/modules/{products → organizations}/components/pages/OrganizationCreate.vue +0 -0
  140. /package/src/modules/{products → organizations}/components/pages/OrganizationDetails.vue +0 -0
  141. /package/src/modules/{products → organizations}/components/pages/OrganizationDocuments.vue +0 -0
  142. /package/src/modules/{products → organizations}/components/pages/OrganizationPeople.vue +0 -0
@@ -1,73 +1,80 @@
1
- import { withAsyncContext as g, openBlock as t, createElementBlock as r, createElementVNode as e, toDisplayString as L, unref as u, createCommentVNode as l, Fragment as c, renderList as _, createBlock as h } from "vue";
2
- import { useRouter as f, useRoute as C } from "vue-router";
1
+ import { withAsyncContext as y, resolveComponent as p, openBlock as t, createElementBlock as n, createElementVNode as e, toDisplayString as w, createVNode as c, unref as u, withCtx as C, createCommentVNode as a, Fragment as _, renderList as h, createBlock as b } from "vue";
2
+ import { useRouter as v, useRoute as $ } from "vue-router";
3
3
  import "../../../../components/Spoiler/Spoiler.vue.js";
4
- import k from "../blocks/DepartmentSub.vue.js";
5
- import w from "../blocks/User.vue.js";
6
- import { actions as y, state as n } from "../../store/departments.js";
7
- const v = { class: "for-transition w-100" }, $ = {
4
+ import x from "../blocks/DepartmentSub.vue.js";
5
+ import E from "../blocks/User.vue.js";
6
+ import { actions as D, state as s } from "../../store/departments.js";
7
+ const B = { class: "for-transition w-100" }, L = {
8
8
  key: 0,
9
9
  id: "dash",
10
10
  class: "pd-medium bg-grey"
11
- }, M = { class: "mn-b-medium radius-medium pd-semi bg-white" }, x = { class: "flex-nowrap flex mn-b-small" }, B = { class: "w-100" }, Z = /* @__PURE__ */ e("path", {
12
- d: "M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z",
13
- fill: "rgb(var(--black))"
14
- }, null, -1), D = [
15
- Z
16
- ], H = ["innerHTML"], z = { class: "mn-b-medium radius-medium pd-semi bg-white" }, E = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Команда", -1), N = { key: 0 }, R = { class: "mn-b-medium radius-medium pd-semi bg-white" }, S = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Подотделы", -1), T = { key: 0 }, G = {
11
+ }, N = { class: "mn-b-medium radius-medium pd-semi bg-white" }, V = { class: "flex-nowrap flex mn-b-small" }, H = { class: "w-100" }, I = ["innerHTML"], M = { class: "mn-b-medium radius-medium pd-semi bg-white" }, R = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Команда", -1), S = { key: 0 }, T = { class: "mn-b-medium radius-medium pd-semi bg-white" }, z = /* @__PURE__ */ e("h3", { class: "mn-b-regular" }, "Подотделы", -1), A = { key: 0 }, P = {
17
12
  __name: "Department",
18
- async setup(V) {
19
- let m, d;
20
- f();
21
- const o = C();
22
- return [m, d] = g(() => y.readOne(o.params.department)), await m, d(), (i, p) => (t(), r("div", v, [
23
- n.department ? (t(), r("div", $, [
24
- e("section", M, [
25
- e("div", x, [
26
- e("h2", B, L(n.department.profile.name), 1),
27
- (t(), r("svg", {
28
- onClick: p[0] || (p[0] = (s) => i.$router.push(`/organizations/${u(o).params._id}/departments/${u(o).params.department}/edit`)),
29
- class: "i-regular t-transp",
30
- width: "652",
31
- height: "652",
32
- viewBox: "0 0 652 652",
33
- fill: "none",
34
- xmlns: "http://www.w3.org/2000/svg"
35
- }, D))
13
+ async setup(F) {
14
+ let m, l;
15
+ v();
16
+ const o = $();
17
+ return [m, l] = y(() => D.readOne(o.params.department)), await m, l(), (d, O) => {
18
+ const g = p("IconEdit"), f = p("router-link");
19
+ return t(), n("div", B, [
20
+ s.department ? (t(), n("div", L, [
21
+ e("section", N, [
22
+ e("div", V, [
23
+ e("h2", H, w(s.department.profile.name), 1),
24
+ c(f, {
25
+ to: {
26
+ name: "Department Edit",
27
+ params: {
28
+ _id: u(o).params._id,
29
+ department: u(o).params.department
30
+ }
31
+ },
32
+ class: "cursor-pointer pos-absolute pos-t-regular pos-r-regular radius-extra pd-thin bg-second"
33
+ }, {
34
+ default: C(() => [
35
+ c(g, {
36
+ class: "i-regular",
37
+ classes: "fill-white"
38
+ })
39
+ ]),
40
+ _: 1
41
+ }, 8, ["to"])
42
+ ]),
43
+ e("p", {
44
+ class: "t-transp p-big",
45
+ innerHTML: s.department.description
46
+ }, null, 8, I)
36
47
  ]),
37
- e("p", {
38
- class: "t-transp p-big",
39
- innerHTML: n.department.description
40
- }, null, 8, H)
41
- ]),
42
- e("section", z, [
43
- E,
44
- e("ul", null, [
45
- n.department.members.length < 1 ? (t(), r("li", N, "В отделе еще нет участников")) : l("", !0),
46
- (t(!0), r(c, null, _(n.department.members, (s, a) => (t(), h(w, {
47
- class: "br-b br-solid br-grey",
48
- key: a,
49
- user: s,
50
- position: s.position,
51
- onClick: (b) => i.$router.push(`/app/profile/${s.user._id}`)
52
- }, null, 8, ["user", "position", "onClick"]))), 128))
53
- ])
54
- ]),
55
- e("section", R, [
56
- S,
57
- e("ul", null, [
58
- n.department.subdepartments.length < 1 ? (t(), r("li", T, "В отделе еще нет подотделов")) : l("", !0),
59
- (t(!0), r(c, null, _(n.department.subdepartments, (s, a) => (t(), h(k, {
60
- onClick: (b) => i.$router.push(`/app/organization/departments/${s._id}`),
61
- key: a,
62
- class: "br-b br-solid br-grey",
63
- department: s
64
- }, null, 8, ["onClick", "department"]))), 128))
48
+ e("section", M, [
49
+ R,
50
+ e("ul", null, [
51
+ s.department.members.length < 1 ? (t(), n("li", S, "В отделе еще нет участников")) : a("", !0),
52
+ (t(!0), n(_, null, h(s.department.members, (r, i) => (t(), b(E, {
53
+ class: "br-b br-solid br-grey",
54
+ key: i,
55
+ user: r,
56
+ position: r.position,
57
+ onClick: (k) => d.$router.push(`/app/profile/${r.user._id}`)
58
+ }, null, 8, ["user", "position", "onClick"]))), 128))
59
+ ])
60
+ ]),
61
+ e("section", T, [
62
+ z,
63
+ e("ul", null, [
64
+ s.department.subdepartments.length < 1 ? (t(), n("li", A, "В отделе еще нет подотделов")) : a("", !0),
65
+ (t(!0), n(_, null, h(s.department.subdepartments, (r, i) => (t(), b(x, {
66
+ onClick: (k) => d.$router.push(`/app/organization/departments/${r._id}`),
67
+ key: i,
68
+ class: "br-b br-solid br-grey",
69
+ department: r
70
+ }, null, 8, ["onClick", "department"]))), 128))
71
+ ])
65
72
  ])
66
- ])
67
- ])) : l("", !0)
68
- ]));
73
+ ])) : a("", !0)
74
+ ]);
75
+ };
69
76
  }
70
77
  };
71
78
  export {
72
- G as default
79
+ P as default
73
80
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),N=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const P=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const g=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const C=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),o=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const V=require("../../../../components/Button/Button.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),S=require("../../../../components/Block/Block.vue.cjs");require("../../../../../../node_modules/vue-select/dist/vue-select.es.cjs");require("../blocks/EditArray.vue2.cjs");const O=require("../blocks/DepartmentSub.vue.cjs"),w=require("../blocks/DepartmentMemberModify.vue.cjs"),M=require("../blocks/User.vue.cjs"),t=require("../../store/departments.cjs"),f=require("../../store/memberships.cjs");require("./DepartmentEdit.vue2.cjs");const s=i=>(e.pushScopeId("data-v-e983b0b2"),i=i(),e.popScopeId(),i),T={class:"for-transition pd-thin w-100"},I={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},U={key:0,class:"mn-r-auto"},z={key:1,class:"mn-r-auto"},F={class:"flex-nowrap flex pd-thin"},R={class:"mn-b-thin bg-grey pd-medium o-hidden radius-big"},$=s(()=>e.createElementVNode("h3",{class:"mn-b-semi"},"Profile",-1)),A={key:0,class:"radius-small flex-nowrap flex"},H={class:"w-100 flex-child-grow-1 flex-child"},L={class:"cols-2 gap-thin"},j={class:"bg-grey pd-medium o-hidden radius-big"},G=s(()=>e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1)),J=s(()=>e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1)),K={class:"cols-1 gap-thin"},Q=s(()=>e.createElementVNode("h4",null,"Products",-1)),W={class:"bg-grey pd-medium o-hidden radius-big"},X=s(()=>e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1)),Y=s(()=>e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1)),Z={class:"cols-1 gap-thin"},ee=s(()=>e.createElementVNode("h4",null,"Products",-1)),te=s(()=>e.createElementVNode("h4",null,"Orders",-1)),ae={key:0,class:"flex-nowrap flex pd-thin"},le={id:"dash",class:"pd-medium bg-white"},re={class:"mn-b-regular flex-v-center flex-nowrap flex"},se=s(()=>e.createElementVNode("h3",{class:"mn-r-small"},"Подотделы ",-1)),ne={class:"mn-b-small"},oe={key:0},de={__name:"DepartmentEdit",setup(i){const y=N.useRouter(),a=N.useRoute();e.ref("details"),e.ref(!1);async function E(){a.params.department&&await f.actions.read({target:a.params._id}),e.ref(f.state.memberships),await t.actions.read(a.params._id),a.params.department&&await t.actions.readOne(a.params.department)}E();const m=e.ref(!1),c=e.ref(null);function h(r){m.value=!0,typeof r=="number"&&(c.value=r)}function b(){m.value=!1,c.value=null}const p=e.ref(!1),u=e.ref(null);function _(r){p.value=!0,typeof r=="number"&&(u.value=r)}function v(){p.value=!1,u.value=null}async function D(){a.params.department&&await t.actions.update(a.params._id,t.state.department),a.params.department||await t.actions.create(a.params._id,t.state.department)}function q(){y.replace({name:"Department",params:{_id:a.params._id,department:t.state.department._id}})}async function B(){await t.actions.delete(a.params._id,t.state.department)}return(r,n)=>(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("header",I,[e.unref(a).params.department?(e.openBlock(),e.createElementBlock("h1",U,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",z,"Create Department")),e.createElementVNode("section",F,[e.createVNode(V.default,{submit:D,callback:q,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save Department")]),_:1})])]),e.createElementVNode("div",R,[$,t.state.department.profile?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(P.default,{photo:t.state.department.profile.photo,"onUpdate:photo":n[0]||(n[0]=l=>t.state.department.profile.photo=l),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",H,[e.createVNode(g.default,{field:t.state.department.profile.name,"onUpdate:field":n[1]||(n[1]=l=>t.state.department.profile.name=l),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"]),e.createVNode(g.default,{field:t.state.department.profile.description,"onUpdate:field":n[2]||(n[2]=l=>t.state.department.profile.description=l),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"])])])):e.createCommentVNode("",!0)]),e.createVNode(S.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>h()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(l,d)=>(e.openBlock(),e.createBlock(M.default,{class:"bg-grey o-hidden radius-small mn-b-thin",key:d,user:l.user,position:l.position,onClick:x=>h(d)},null,8,["user","position","onClick"]))),128))]),_:1},8,["actions"]),e.createVNode(k.default,{title:"Добавить участника",onClosePopup:b,isPopupOpen:m.value},{default:e.withCtx(()=>[e.createVNode(w.default,{members:t.state.department.members,member:c.value,users:f.state.memberships,onCallback:b},null,8,["members","member","users"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",L,[e.createElementVNode("div",j,[G,J,e.createElementVNode("div",K,[Q,e.createVNode(o.default,{label:"Hidden department",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])]),e.createElementVNode("div",W,[X,Y,e.createElementVNode("div",Z,[ee,e.createVNode(o.default,{label:"See products",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Edit products",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),te,e.createVNode(o.default,{label:"See orders",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Confirm orders",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])])]),e.unref(a).params.department?(e.openBlock(),e.createElementBlock("section",ae,[e.createVNode(V.default,{submit:B,callback:r.redirectToDash,class:"bg-grey"},{default:e.withCtx(()=>[e.createTextVNode("Delete Department")]),_:1},8,["callback"])])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[e.createVNode(k.default,{title:"Добавить подотдел",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createVNode(w.default,{departments:t.state.department.subdepartments,department:u.value,maindepartment:t.state.department,alldepartments:t.state.departments,onCallback:v},null,8,["departments","department","maindepartment","alldepartments"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",re,[se,e.createElementVNode("div",null,[e.createElementVNode("a",{class:"t-main h5",onClick:n[3]||(n[3]=l=>_())},"+")])]),e.createElementVNode("ul",ne,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",oe,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(l,d)=>(e.openBlock(),e.createBlock(O.default,{key:d,class:"bg-grey o-hidden radius-small mn-b-thin",department:l,onClick:x=>_(d)},null,8,["department","onClick"]))),128))])])]))}},ie=C.default(de,[["__scopeId","data-v-e983b0b2"]]);exports.default=ie;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),g=require("vue-router");require("../../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const P=require("../../../../components/UploadImage/UploadImage.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const N=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const S=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),o=require("../../../../components/Checkbox/Checkbox.vue.cjs");require("../../../../components/Address/Address.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/LocationMarker/LocationMarker.vue.cjs");const V=require("../../../../components/Button/Button.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),w=require("../../../../components/Block/Block.vue.cjs");require("../../../../../../node_modules/vue-select/dist/vue-select.es.cjs");require("../blocks/EditArray.vue2.cjs");const O=require("../blocks/DepartmentSub.vue.cjs"),y=require("../blocks/DepartmentMemberModify.vue.cjs"),M=require("../blocks/User.vue.cjs"),t=require("../../store/departments.cjs"),f=require("../../store/memberships.cjs");require("./DepartmentEdit.vue2.cjs");const n=i=>(e.pushScopeId("data-v-7ec9277b"),i=i(),e.popScopeId(),i),T={class:"for-transition pd-thin w-100"},I={class:"mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big"},U={key:0,class:"mn-r-auto"},z={key:1,class:"mn-r-auto"},F={class:"flex-nowrap flex pd-thin"},R={class:"cols-2-fit-content"},$={class:"w-100 flex-child-grow-1 flex-child"},A={class:"cols-2 gap-thin"},H={class:"bg-grey pd-medium o-hidden radius-big"},L=n(()=>e.createElementVNode("h3",{class:"mn-b-semi"},"Department Settings",-1)),j=n(()=>e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please settings for your department:",-1)),G={class:"cols-1 gap-thin"},J=n(()=>e.createElementVNode("h4",null,"Products",-1)),K={class:"bg-grey pd-medium o-hidden radius-big"},Q=n(()=>e.createElementVNode("h3",{class:"mn-b-semi"},"Acessess",-1)),W=n(()=>e.createElementVNode("p",{class:"p-medium mn-b-small"},"Please select organization accesses for user in department:",-1)),X={class:"cols-1 gap-thin"},Y=n(()=>e.createElementVNode("h4",null,"Products",-1)),Z=n(()=>e.createElementVNode("h4",null,"Orders",-1)),ee={key:1,class:"flex-nowrap flex pd-thin"},te={id:"dash",class:"pd-medium bg-white"},ae={class:"mn-b-regular flex-v-center flex-nowrap flex"},le=n(()=>e.createElementVNode("h3",{class:"mn-r-small"},"Подотделы ",-1)),re={class:"mn-b-small"},se={key:0},ne={__name:"DepartmentEdit",setup(i){const E=g.useRouter(),l=g.useRoute();async function D(){l.params.department&&await f.actions.read({target:l.params._id}),e.ref(f.state.memberships),await t.actions.read(l.params._id),l.params.department&&await t.actions.readOne(l.params.department)}D();const m=e.ref(!1),c=e.ref(null);function h(r){m.value=!0,typeof r=="number"&&(c.value=r)}function b(){m.value=!1,c.value=null}const p=e.ref(!1),u=e.ref(null);function _(r){p.value=!0,typeof r=="number"&&(u.value=r)}function v(){p.value=!1,u.value=null}async function q(){l.params.department&&await t.actions.update(l.params._id,t.state.department),l.params.department||await t.actions.create(l.params._id,t.state.department)}function B(){E.replace({name:"Department",params:{_id:l.params._id,department:t.state.department._id}})}async function x(){await t.actions.delete(l.params._id,t.state.department)}return(r,s)=>(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("header",I,[e.unref(l).params.department?(e.openBlock(),e.createElementBlock("h1",U,"Edit Department")):(e.openBlock(),e.createElementBlock("h1",z,"Create Department")),e.createElementVNode("section",F,[e.createVNode(V.default,{submit:q,callback:B,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode("Save Department")]),_:1})])]),t.state.department.profile?(e.openBlock(),e.createBlock(w.default,{key:0,title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",R,[e.createVNode(P.default,{photo:t.state.department.profile.photo,"onUpdate:photo":s[0]||(s[0]=a=>t.state.department.profile.photo=a),uploadPath:"organizations/"+t.state.department.name+"/avatars",class:"w-8r aspect-1x1 o-hidden mn-r-small radius-extra"},null,8,["photo","uploadPath"]),e.createElementVNode("div",$,[e.createVNode(N.default,{field:t.state.department.profile.name,"onUpdate:field":s[1]||(s[1]=a=>t.state.department.profile.name=a),label:"Name",placeholder:"Department Name",class:"mn-b-small bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"]),e.createVNode(N.default,{field:t.state.department.profile.description,"onUpdate:field":s[2]||(s[2]=a=>t.state.department.profile.description=a),label:"Description",placeholder:"Department description (max 120 symbols)",class:"bg-white radius-small pd-medium",validation:r.organizationName},null,8,["field","validation"])])])]),_:1})):e.createCommentVNode("",!0),e.createVNode(w.default,{title:"Team",placeholder:"No members added yet",actions:[{label:"+",function:()=>h()}],class:"cols-1 gap-thin mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.members,(a,d)=>(e.openBlock(),e.createBlock(M.default,{class:"bg-grey o-hidden radius-small mn-b-thin",key:d,user:a.user,photo:a.user.profile.photo,name:a.user.profile.name||a.user.phone||a.user.email||a.user._id,position:a.position,onClick:C=>h(d)},null,8,["user","photo","name","position","onClick"]))),128))]),_:1},8,["actions"]),e.createVNode(k.default,{title:"Добавить участника",onClosePopup:b,isPopupOpen:m.value,class:"bg-white w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(y.default,{members:t.state.department.members,member:c.value,users:f.state.memberships,onCallback:b},null,8,["members","member","users"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",A,[e.createElementVNode("div",H,[L,j,e.createElementVNode("div",G,[J,e.createVNode(o.default,{label:"Hidden department",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])]),e.createElementVNode("div",K,[Q,W,e.createElementVNode("div",X,[Y,e.createVNode(o.default,{label:"See products",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Edit products",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),Z,e.createVNode(o.default,{label:"See orders",name:"Delivery",value:"pickup",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Confirm orders",name:"Delivery",value:"courier",class:"w-100 mn-r-small bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"]),e.createVNode(o.default,{label:"Delete orders",name:"Delivery",value:"post",class:"w-100 bg-white radius-small pd-small",radio:t.state.department.delivery},null,8,["radio"])])])]),e.unref(l).params.department?(e.openBlock(),e.createElementBlock("section",ee,[e.createVNode(V.default,{submit:x,callback:r.redirectToDash,class:"bg-grey"},{default:e.withCtx(()=>[e.createTextVNode("Delete Department")]),_:1},8,["callback"])])):e.createCommentVNode("",!0),e.createElementVNode("div",te,[e.createVNode(k.default,{title:"Добавить подотдел",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createVNode(y.default,{departments:t.state.department.subdepartments,department:u.value,maindepartment:t.state.department,alldepartments:t.state.departments,onCallback:v},null,8,["departments","department","maindepartment","alldepartments"])]),_:1},8,["isPopupOpen"]),e.createElementVNode("div",ae,[le,e.createElementVNode("div",null,[e.createElementVNode("a",{class:"t-main h5",onClick:s[3]||(s[3]=a=>_())},"+")])]),e.createElementVNode("ul",re,[t.state.department.subdepartments.length<1?(e.openBlock(),e.createElementBlock("li",se,"В отделе еще нет подотделов")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.department.subdepartments,(a,d)=>(e.openBlock(),e.createBlock(O.default,{key:d,class:"bg-grey o-hidden radius-small mn-b-thin",department:a,onClick:C=>_(d)},null,8,["department","onClick"]))),128))])])]))}},oe=S.default(ne,[["__scopeId","data-v-7ec9277b"]]);exports.default=oe;
@@ -1,172 +1,177 @@
1
- import { ref as d, openBlock as r, createElementBlock as m, createElementVNode as t, unref as x, createVNode as a, withCtx as c, createTextVNode as C, createCommentVNode as y, Fragment as S, renderList as N, createBlock as $, pushScopeId as R, popScopeId as H } from "vue";
2
- import { useRouter as L, useRoute as j } from "vue-router";
1
+ import { ref as c, openBlock as r, createElementBlock as m, createElementVNode as t, unref as C, createVNode as a, withCtx as p, createTextVNode as S, createBlock as y, createCommentVNode as w, Fragment as N, renderList as $, pushScopeId as H, popScopeId as L } from "vue";
2
+ import { useRouter as j, useRoute as q } from "vue-router";
3
3
  import "../../../../../../node_modules/js-cookie/dist/js.cookie.js";
4
4
  import "vue-i18n";
5
5
  import "../../../globals/localization/vue-i18n.js";
6
6
  import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
7
- import q from "../../../../components/UploadImage/UploadImage.vue.js";
7
+ import G from "../../../../components/UploadImage/UploadImage.vue.js";
8
8
  import "../../../../components/Tab/Tab.vue.js";
9
9
  import O from "../../../../components/Field/Field.vue2.js";
10
10
  import "../../../../components/Select/Select.vue.js";
11
- import G from "../../../../../../_virtual/_plugin-vue_export-helper.js";
12
- import p from "../../../../components/Checkbox/Checkbox.vue.js";
11
+ import J from "../../../../../../_virtual/_plugin-vue_export-helper.js";
12
+ import d from "../../../../components/Checkbox/Checkbox.vue.js";
13
13
  import "../../../../components/Address/Address.vue.js";
14
14
  import "../../../../components/Loader/Loader.vue.js";
15
15
  import "../../../../components/LocationMarker/LocationMarker.vue.js";
16
16
  import E from "../../../../components/Button/Button.vue2.js";
17
17
  import M from "../../../../components/Popup/Popup.vue2.js";
18
- import J from "../../../../components/Block/Block.vue.js";
18
+ import z from "../../../../components/Block/Block.vue.js";
19
19
  import "../../../../../../node_modules/vue-select/dist/vue-select.es.js";
20
20
  import "../blocks/EditArray.vue2.js";
21
21
  import K from "../blocks/DepartmentSub.vue.js";
22
- import z from "../blocks/DepartmentMemberModify.vue.js";
22
+ import I from "../blocks/DepartmentMemberModify.vue.js";
23
23
  import Q from "../blocks/User.vue.js";
24
24
  import { state as e, actions as f } from "../../store/departments.js";
25
- import { state as I, actions as W } from "../../store/memberships.js";
25
+ import { state as T, actions as W } from "../../store/memberships.js";
26
26
  import "./DepartmentEdit.vue2.js";
27
- const n = (h) => (R("data-v-e983b0b2"), h = h(), H(), h), X = { class: "for-transition pd-thin w-100" }, Y = { class: "mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big" }, Z = {
27
+ const o = (h) => (H("data-v-7ec9277b"), h = h(), L(), h), X = { class: "for-transition pd-thin w-100" }, Y = { class: "mn-b-thin flex-nowrap flex bg-grey pd-medium radius-big" }, Z = {
28
28
  key: 0,
29
29
  class: "mn-r-auto"
30
30
  }, ee = {
31
31
  key: 1,
32
32
  class: "mn-r-auto"
33
- }, te = { class: "flex-nowrap flex pd-thin" }, ae = { class: "mn-b-thin bg-grey pd-medium o-hidden radius-big" }, se = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h3", { class: "mn-b-semi" }, "Profile", -1)), le = {
34
- key: 0,
35
- class: "radius-small flex-nowrap flex"
36
- }, re = { class: "w-100 flex-child-grow-1 flex-child" }, ie = { class: "cols-2 gap-thin" }, ne = { class: "bg-grey pd-medium o-hidden radius-big" }, oe = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h3", { class: "mn-b-semi" }, "Department Settings", -1)), me = /* @__PURE__ */ n(() => /* @__PURE__ */ t("p", { class: "p-medium mn-b-small" }, "Please settings for your department:", -1)), de = { class: "cols-1 gap-thin" }, pe = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h4", null, "Products", -1)), ue = { class: "bg-grey pd-medium o-hidden radius-big" }, ce = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h3", { class: "mn-b-semi" }, "Acessess", -1)), fe = /* @__PURE__ */ n(() => /* @__PURE__ */ t("p", { class: "p-medium mn-b-small" }, "Please select organization accesses for user in department:", -1)), he = { class: "cols-1 gap-thin" }, be = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h4", null, "Products", -1)), _e = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h4", null, "Orders", -1)), ve = {
37
- key: 0,
33
+ }, te = { class: "flex-nowrap flex pd-thin" }, ae = { class: "cols-2-fit-content" }, se = { class: "w-100 flex-child-grow-1 flex-child" }, le = { class: "cols-2 gap-thin" }, re = { class: "bg-grey pd-medium o-hidden radius-big" }, ie = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h3", { class: "mn-b-semi" }, "Department Settings", -1)), ne = /* @__PURE__ */ o(() => /* @__PURE__ */ t("p", { class: "p-medium mn-b-small" }, "Please settings for your department:", -1)), oe = { class: "cols-1 gap-thin" }, me = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h4", null, "Products", -1)), de = { class: "bg-grey pd-medium o-hidden radius-big" }, pe = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h3", { class: "mn-b-semi" }, "Acessess", -1)), ue = /* @__PURE__ */ o(() => /* @__PURE__ */ t("p", { class: "p-medium mn-b-small" }, "Please select organization accesses for user in department:", -1)), ce = { class: "cols-1 gap-thin" }, fe = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h4", null, "Products", -1)), he = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h4", null, "Orders", -1)), _e = {
34
+ key: 1,
38
35
  class: "flex-nowrap flex pd-thin"
39
- }, ge = {
36
+ }, be = {
40
37
  id: "dash",
41
38
  class: "pd-medium bg-white"
42
- }, ye = { class: "mn-b-regular flex-v-center flex-nowrap flex" }, we = /* @__PURE__ */ n(() => /* @__PURE__ */ t("h3", { class: "mn-r-small" }, "Подотделы ", -1)), De = { class: "mn-b-small" }, ke = { key: 0 }, Pe = {
39
+ }, ve = { class: "mn-b-regular flex-v-center flex-nowrap flex" }, ge = /* @__PURE__ */ o(() => /* @__PURE__ */ t("h3", { class: "mn-r-small" }, "Подотделы ", -1)), ye = { class: "mn-b-small" }, we = { key: 0 }, De = {
43
40
  __name: "DepartmentEdit",
44
41
  setup(h) {
45
- const T = L(), s = j();
46
- d("details"), d(!1);
47
- async function U() {
48
- s.params.department && await W.read({ target: s.params._id }), d(I.memberships), await f.read(s.params._id), s.params.department && await f.readOne(s.params.department);
42
+ const U = j(), l = q();
43
+ async function V() {
44
+ l.params.department && await W.read({ target: l.params._id }), c(T.memberships), await f.read(l.params._id), l.params.department && await f.readOne(l.params.department);
49
45
  }
50
- U();
51
- const b = d(!1), _ = d(null);
52
- function w(i) {
53
- b.value = !0, typeof i == "number" && (_.value = i);
46
+ V();
47
+ const _ = c(!1), b = c(null);
48
+ function D(i) {
49
+ _.value = !0, typeof i == "number" && (b.value = i);
54
50
  }
55
- function D() {
56
- b.value = !1, _.value = null;
51
+ function k() {
52
+ _.value = !1, b.value = null;
57
53
  }
58
- const v = d(!1), g = d(null);
59
- function k(i) {
54
+ const v = c(!1), g = c(null);
55
+ function P(i) {
60
56
  v.value = !0, typeof i == "number" && (g.value = i);
61
57
  }
62
- function P() {
58
+ function x() {
63
59
  v.value = !1, g.value = null;
64
60
  }
65
- async function V() {
66
- s.params.department && await f.update(
67
- s.params._id,
61
+ async function B() {
62
+ l.params.department && await f.update(
63
+ l.params._id,
68
64
  e.department
69
- ), s.params.department || await f.create(
70
- s.params._id,
65
+ ), l.params.department || await f.create(
66
+ l.params._id,
71
67
  e.department
72
68
  );
73
69
  }
74
- function B() {
75
- T.replace({ name: "Department", params: { _id: s.params._id, department: e.department._id } });
70
+ function A() {
71
+ U.replace({ name: "Department", params: { _id: l.params._id, department: e.department._id } });
76
72
  }
77
- async function A() {
73
+ async function F() {
78
74
  await f.delete(
79
- s.params._id,
75
+ l.params._id,
80
76
  e.department
81
77
  );
82
78
  }
83
- return (i, o) => (r(), m("div", X, [
79
+ return (i, n) => (r(), m("div", X, [
84
80
  t("header", Y, [
85
- x(s).params.department ? (r(), m("h1", Z, "Edit Department")) : (r(), m("h1", ee, "Create Department")),
81
+ C(l).params.department ? (r(), m("h1", Z, "Edit Department")) : (r(), m("h1", ee, "Create Department")),
86
82
  t("section", te, [
87
83
  a(E, {
88
- submit: V,
89
- callback: B,
84
+ submit: B,
85
+ callback: A,
90
86
  class: "bg-main"
91
87
  }, {
92
- default: c(() => [
93
- C("Save Department")
88
+ default: p(() => [
89
+ S("Save Department")
94
90
  ]),
95
91
  _: 1
96
92
  })
97
93
  ])
98
94
  ]),
99
- t("div", ae, [
100
- se,
101
- e.department.profile ? (r(), m("div", le, [
102
- a(q, {
103
- photo: e.department.profile.photo,
104
- "onUpdate:photo": o[0] || (o[0] = (l) => e.department.profile.photo = l),
105
- uploadPath: "organizations/" + e.department.name + "/avatars",
106
- class: "w-8r aspect-1x1 o-hidden mn-r-small radius-extra"
107
- }, null, 8, ["photo", "uploadPath"]),
108
- t("div", re, [
109
- a(O, {
110
- field: e.department.profile.name,
111
- "onUpdate:field": o[1] || (o[1] = (l) => e.department.profile.name = l),
112
- label: "Name",
113
- placeholder: "Department Name",
114
- class: "mn-b-small bg-white radius-small pd-medium",
115
- validation: i.organizationName
116
- }, null, 8, ["field", "validation"]),
117
- a(O, {
118
- field: e.department.profile.description,
119
- "onUpdate:field": o[2] || (o[2] = (l) => e.department.profile.description = l),
120
- label: "Description",
121
- placeholder: "Department description (max 120 symbols)",
122
- class: "bg-white radius-small pd-medium",
123
- validation: i.organizationName
124
- }, null, 8, ["field", "validation"])
95
+ e.department.profile ? (r(), y(z, {
96
+ key: 0,
97
+ title: "Profile",
98
+ class: "mn-b-thin"
99
+ }, {
100
+ default: p(() => [
101
+ t("div", ae, [
102
+ a(G, {
103
+ photo: e.department.profile.photo,
104
+ "onUpdate:photo": n[0] || (n[0] = (s) => e.department.profile.photo = s),
105
+ uploadPath: "organizations/" + e.department.name + "/avatars",
106
+ class: "w-8r aspect-1x1 o-hidden mn-r-small radius-extra"
107
+ }, null, 8, ["photo", "uploadPath"]),
108
+ t("div", se, [
109
+ a(O, {
110
+ field: e.department.profile.name,
111
+ "onUpdate:field": n[1] || (n[1] = (s) => e.department.profile.name = s),
112
+ label: "Name",
113
+ placeholder: "Department Name",
114
+ class: "mn-b-small bg-white radius-small pd-medium",
115
+ validation: i.organizationName
116
+ }, null, 8, ["field", "validation"]),
117
+ a(O, {
118
+ field: e.department.profile.description,
119
+ "onUpdate:field": n[2] || (n[2] = (s) => e.department.profile.description = s),
120
+ label: "Description",
121
+ placeholder: "Department description (max 120 symbols)",
122
+ class: "bg-white radius-small pd-medium",
123
+ validation: i.organizationName
124
+ }, null, 8, ["field", "validation"])
125
+ ])
125
126
  ])
126
- ])) : y("", !0)
127
- ]),
128
- a(J, {
127
+ ]),
128
+ _: 1
129
+ })) : w("", !0),
130
+ a(z, {
129
131
  title: "Team",
130
132
  placeholder: "No members added yet",
131
133
  actions: [{
132
134
  label: "+",
133
- function: () => w()
135
+ function: () => D()
134
136
  }],
135
137
  class: "cols-1 gap-thin mn-b-thin"
136
138
  }, {
137
- default: c(() => [
138
- (r(!0), m(S, null, N(e.department.members, (l, u) => (r(), $(Q, {
139
+ default: p(() => [
140
+ (r(!0), m(N, null, $(e.department.members, (s, u) => (r(), y(Q, {
139
141
  class: "bg-grey o-hidden radius-small mn-b-thin",
140
142
  key: u,
141
- user: l.user,
142
- position: l.position,
143
- onClick: (F) => w(u)
144
- }, null, 8, ["user", "position", "onClick"]))), 128))
143
+ user: s.user,
144
+ photo: s.user.profile.photo,
145
+ name: s.user.profile.name || s.user.phone || s.user.email || s.user._id,
146
+ position: s.position,
147
+ onClick: (R) => D(u)
148
+ }, null, 8, ["user", "photo", "name", "position", "onClick"]))), 128))
145
149
  ]),
146
150
  _: 1
147
151
  }, 8, ["actions"]),
148
152
  a(M, {
149
153
  title: "Добавить участника",
150
- onClosePopup: D,
151
- isPopupOpen: b.value
154
+ onClosePopup: k,
155
+ isPopupOpen: _.value,
156
+ class: "bg-white w-max-30r radius-big pd-big"
152
157
  }, {
153
- default: c(() => [
154
- a(z, {
158
+ default: p(() => [
159
+ a(I, {
155
160
  members: e.department.members,
156
- member: _.value,
157
- users: I.memberships,
158
- onCallback: D
161
+ member: b.value,
162
+ users: T.memberships,
163
+ onCallback: k
159
164
  }, null, 8, ["members", "member", "users"])
160
165
  ]),
161
166
  _: 1
162
167
  }, 8, ["isPopupOpen"]),
163
- t("div", ie, [
164
- t("div", ne, [
165
- oe,
166
- me,
167
- t("div", de, [
168
- pe,
169
- a(p, {
168
+ t("div", le, [
169
+ t("div", re, [
170
+ ie,
171
+ ne,
172
+ t("div", oe, [
173
+ me,
174
+ a(d, {
170
175
  label: "Hidden department",
171
176
  name: "Delivery",
172
177
  value: "pickup",
@@ -175,48 +180,48 @@ const n = (h) => (R("data-v-e983b0b2"), h = h(), H(), h), X = { class: "for-tran
175
180
  }, null, 8, ["radio"])
176
181
  ])
177
182
  ]),
178
- t("div", ue, [
179
- ce,
180
- fe,
181
- t("div", he, [
182
- be,
183
- a(p, {
183
+ t("div", de, [
184
+ pe,
185
+ ue,
186
+ t("div", ce, [
187
+ fe,
188
+ a(d, {
184
189
  label: "See products",
185
190
  name: "Delivery",
186
191
  value: "pickup",
187
192
  class: "w-100 mn-r-small bg-white radius-small pd-small",
188
193
  radio: e.department.delivery
189
194
  }, null, 8, ["radio"]),
190
- a(p, {
195
+ a(d, {
191
196
  label: "Edit products",
192
197
  name: "Delivery",
193
198
  value: "courier",
194
199
  class: "w-100 mn-r-small bg-white radius-small pd-small",
195
200
  radio: e.department.delivery
196
201
  }, null, 8, ["radio"]),
197
- a(p, {
202
+ a(d, {
198
203
  label: "Delete orders",
199
204
  name: "Delivery",
200
205
  value: "post",
201
206
  class: "w-100 bg-white radius-small pd-small",
202
207
  radio: e.department.delivery
203
208
  }, null, 8, ["radio"]),
204
- _e,
205
- a(p, {
209
+ he,
210
+ a(d, {
206
211
  label: "See orders",
207
212
  name: "Delivery",
208
213
  value: "pickup",
209
214
  class: "w-100 mn-r-small bg-white radius-small pd-small",
210
215
  radio: e.department.delivery
211
216
  }, null, 8, ["radio"]),
212
- a(p, {
217
+ a(d, {
213
218
  label: "Confirm orders",
214
219
  name: "Delivery",
215
220
  value: "courier",
216
221
  class: "w-100 mn-r-small bg-white radius-small pd-small",
217
222
  radio: e.department.delivery
218
223
  }, null, 8, ["radio"]),
219
- a(p, {
224
+ a(d, {
220
225
  label: "Delete orders",
221
226
  name: "Delivery",
222
227
  value: "post",
@@ -226,57 +231,57 @@ const n = (h) => (R("data-v-e983b0b2"), h = h(), H(), h), X = { class: "for-tran
226
231
  ])
227
232
  ])
228
233
  ]),
229
- x(s).params.department ? (r(), m("section", ve, [
234
+ C(l).params.department ? (r(), m("section", _e, [
230
235
  a(E, {
231
- submit: A,
236
+ submit: F,
232
237
  callback: i.redirectToDash,
233
238
  class: "bg-grey"
234
239
  }, {
235
- default: c(() => [
236
- C("Delete Department")
240
+ default: p(() => [
241
+ S("Delete Department")
237
242
  ]),
238
243
  _: 1
239
244
  }, 8, ["callback"])
240
- ])) : y("", !0),
241
- t("div", ge, [
245
+ ])) : w("", !0),
246
+ t("div", be, [
242
247
  a(M, {
243
248
  title: "Добавить подотдел",
244
- onClosePopup: P,
249
+ onClosePopup: x,
245
250
  isPopupOpen: v.value
246
251
  }, {
247
- default: c(() => [
248
- a(z, {
252
+ default: p(() => [
253
+ a(I, {
249
254
  departments: e.department.subdepartments,
250
255
  department: g.value,
251
256
  maindepartment: e.department,
252
257
  alldepartments: e.departments,
253
- onCallback: P
258
+ onCallback: x
254
259
  }, null, 8, ["departments", "department", "maindepartment", "alldepartments"])
255
260
  ]),
256
261
  _: 1
257
262
  }, 8, ["isPopupOpen"]),
258
- t("div", ye, [
259
- we,
263
+ t("div", ve, [
264
+ ge,
260
265
  t("div", null, [
261
266
  t("a", {
262
267
  class: "t-main h5",
263
- onClick: o[3] || (o[3] = (l) => k())
268
+ onClick: n[3] || (n[3] = (s) => P())
264
269
  }, "+")
265
270
  ])
266
271
  ]),
267
- t("ul", De, [
268
- e.department.subdepartments.length < 1 ? (r(), m("li", ke, "В отделе еще нет подотделов")) : y("", !0),
269
- (r(!0), m(S, null, N(e.department.subdepartments, (l, u) => (r(), $(K, {
272
+ t("ul", ye, [
273
+ e.department.subdepartments.length < 1 ? (r(), m("li", we, "В отделе еще нет подотделов")) : w("", !0),
274
+ (r(!0), m(N, null, $(e.department.subdepartments, (s, u) => (r(), y(K, {
270
275
  key: u,
271
276
  class: "bg-grey o-hidden radius-small mn-b-thin",
272
- department: l,
273
- onClick: (F) => k(u)
277
+ department: s,
278
+ onClick: (R) => P(u)
274
279
  }, null, 8, ["department", "onClick"]))), 128))
275
280
  ])
276
281
  ])
277
282
  ]));
278
283
  }
279
- }, Xe = /* @__PURE__ */ G(Pe, [["__scopeId", "data-v-e983b0b2"]]);
284
+ }, Qe = /* @__PURE__ */ J(De, [["__scopeId", "data-v-7ec9277b"]]);
280
285
  export {
281
- Xe as default
286
+ Qe as default
282
287
  };