@ozdao/prometheus-framework 0.2.93 → 0.2.95

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. package/dist/auth.server.js +15 -14
  2. package/dist/auth.server.mjs +15 -14
  3. package/dist/main-BJvlNekm.mjs +13631 -0
  4. package/dist/main-pGo7JpSP.js +92 -0
  5. package/dist/orders.server.js +31 -27
  6. package/dist/orders.server.mjs +31 -27
  7. package/dist/organizations.server.js +31 -10
  8. package/dist/organizations.server.mjs +31 -10
  9. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  11. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
  12. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
  13. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
  15. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
  17. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
  18. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
  20. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  21. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
  22. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +58 -58
  24. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
  26. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  27. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
  28. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
  30. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +49 -48
  32. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
  34. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
  35. package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
  36. package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
  37. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
  39. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +20 -20
  41. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
  47. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
  49. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
  55. package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
  57. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
  61. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +155 -187
  63. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +18 -18
  65. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
  69. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +66 -63
  71. package/dist/prometheus-framework.cjs.js +1 -1
  72. package/dist/prometheus-framework.es.js +1 -1
  73. package/dist/style.css +1 -1
  74. package/dist/web-B2xhKZNK.js +1 -0
  75. package/dist/web-DTzbVshr.mjs +54 -0
  76. package/package.json +1 -1
  77. package/src/components/Block/Block.vue +1 -1
  78. package/src/modules/auth/controllers/auth.controller.js +19 -16
  79. package/src/modules/auth/router/auth.js +4 -0
  80. package/src/modules/backoffice/router/backoffice.js +3 -3
  81. package/src/modules/chats/routes/chats.routes.js +1 -2
  82. package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
  83. package/src/modules/icons/navigation/IconCross.vue +11 -7
  84. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
  85. package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
  86. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +7 -3
  87. package/src/modules/orders/components/pages/Orders.vue +1 -1
  88. package/src/modules/orders/controllers/orders.controller.js +25 -25
  89. package/src/modules/orders/models/order.model.js +1 -1
  90. package/src/modules/orders/routes/orders.routes.js +6 -0
  91. package/src/modules/orders/store/models/order.js +33 -0
  92. package/src/modules/orders/store/orders.js +7 -28
  93. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
  94. package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
  95. package/src/modules/organizations/components/pages/Members.vue +50 -38
  96. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  97. package/src/modules/organizations/controllers/invites.controller.js +2 -0
  98. package/src/modules/organizations/controllers/memberships.controller.js +35 -11
  99. package/src/modules/organizations/models/invite.model.js +4 -0
  100. package/src/modules/organizations/organizations.client.js +0 -2
  101. package/src/modules/organizations/router/members.router.js +1 -1
  102. package/src/modules/organizations/store/departments.js +0 -1
  103. package/src/modules/organizations/store/memberships.js +1 -8
  104. package/src/modules/products/components/pages/ProductEdit.vue +39 -33
  105. package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
  106. package/src/modules/users/components/blocks/CardUser.vue +9 -5
  107. package/src/modules/users/components/pages/Profile.vue +5 -3
  108. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const f=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs");require("../../../mobile/components/Menu/Menu.vue2.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");require("../blocks/DepartmentSub.vue2.cjs");const v=require("../../../events/components/sections/Feed.vue.cjs"),h=require("../../../community/components/sections/Feed.vue.cjs"),q=require("../../../spots/components/blocks/CardSpot.vue.cjs"),g=require("../sections/DetailsTab.vue.cjs"),w=require("../../../products/components/pages/Products.vue.cjs"),o=require("../../../auth/store/auth.cjs"),a=require("../../store/organizations.cjs"),y=require("../../store/memberships.cjs");require("../../store/departments.cjs");const C=require("../../../spots/store/spots.cjs");require("./Organization.vue2.cjs");const N={key:0,class:"pd-thin for-transition w-100"},V={class:"pos-relative"},B={key:0},x={__name:"Organization",setup(z){const c=d.useRouter(),t=d.useRoute();let m=t.query.tab?t.query.tab:"products";const i=e.ref(null);e.onMounted(async()=>{i.value=await a.actions.read({_id:t.params._id,user:o.state.user._id}),await y.actions.read(t.params._id)});const r=e.ref(m);return t.query.tab=r.value,e.watch(r,l=>{c.replace({query:null})}),(l,n)=>{const u=e.resolveComponent("router-link");return i.value?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(g.default,{organization:a.state.current,user:o.state.user,class:"mn-b-semi"},null,8,["organization","user"]),e.createVNode(f.default,{selected:r.value,"onUpdate:selected":n[0]||(n[0]=s=>r.value=s),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createElementVNode("div",V,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="community"?(e.openBlock(),e.createBlock(h.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="events"?(e.openBlock(),e.createBlock(v.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),r.value==="products"&&o.state.user._id===a.state.current.owner?(e.openBlock(),e.createBlock(k.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="products"?(e.openBlock(),e.createBlock(w.default,{key:0,organization:a.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="spots"?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(b.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:s=>C.actions.read(e.unref(t).params._id),state:a.state},options:{user:o.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(p,_)=>(e.openBlock(),e.createBlock(q.default,{key:_,spot:p,organization:a.state.current,class:"radius-big bg-grey mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["store","options"]),o.state.user._id===a.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=s=>l.$router.push(`/spots/${a.state.current._id}/spots/create`)),class:"mn-b-thin bg-main button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const f=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs");require("../../../mobile/components/Menu/Menu.vue2.cjs");require("../../../mobile/components/Menu/MenuItem.vue.cjs");require("../blocks/DepartmentSub.vue2.cjs");const v=require("../../../events/components/sections/Feed.vue.cjs"),h=require("../../../community/components/sections/Feed.vue.cjs"),g=require("../../../spots/components/blocks/CardSpot.vue.cjs"),q=require("../sections/DetailsTab.vue.cjs"),w=require("../../../products/components/pages/Products.vue.cjs"),o=require("../../../auth/store/auth.cjs"),a=require("../../store/organizations.cjs"),y=require("../../store/memberships.cjs");require("../../store/departments.cjs");const C=require("../../../spots/store/spots.cjs");require("./Organization.vue2.cjs");const N={key:0,class:"pd-thin for-transition w-100"},V={class:"pos-relative"},B={key:0},x={__name:"Organization",setup(z){const c=d.useRouter(),t=d.useRoute();let m=t.query.tab?t.query.tab:"products";const i=e.ref(null);e.onMounted(async()=>{i.value=await a.actions.read({_id:t.params._id,user:o.state.user._id}),await y.actions.read({target:t.params._id})});const r=e.ref(m);return t.query.tab=r.value,e.watch(r,l=>{c.replace({query:null})}),(l,n)=>{const u=e.resolveComponent("router-link");return i.value?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(q.default,{organization:a.state.current,user:o.state.user,class:"mn-b-semi"},null,8,["organization","user"]),e.createVNode(f.default,{selected:r.value,"onUpdate:selected":n[0]||(n[0]=s=>r.value=s),tabs:[{name:"Community",value:"community"},{name:"Menu",value:"products"},{name:"Events",value:"events"},{name:"Spots",value:"spots"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createElementVNode("div",V,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="community"?(e.openBlock(),e.createBlock(h.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="events"?(e.openBlock(),e.createBlock(v.default,{key:0,user:o.state.user._id,owner:e.unref(t).params._id,sortOrder:"desc",sortParam:"date.start"},null,8,["user","owner"])):e.createCommentVNode("",!0)]),_:1}),r.value==="products"&&o.state.user._id===a.state.current.owner?(e.openBlock(),e.createBlock(k.default,{key:0,class:"flex-nowrap gap-thin mn-b-small flex"},{default:e.withCtx(()=>[e.createVNode(u,{class:"bg-black t-white uppercase t-semi pd-thin radius-extra",to:{name:"ProductAdd",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Add Product ")]),_:1},8,["to"]),e.createVNode(u,{class:"uppercase t-semi pd-thin radius-extra",to:{name:"Leftovers",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Change Invetory ")]),_:1},8,["to"]),e.createVNode(u,{class:"d-block mn-l-auto uppercase t-semi bg-white pd-thin radius-extra",to:{name:"Backoffice",params:{_id:e.unref(t).params._id}}},{default:e.withCtx(()=>[e.createTextVNode(" Go to Backoffice ")]),_:1},8,["to"])]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="products"?(e.openBlock(),e.createBlock(w.default,{key:0,organization:a.state.current},null,8,["organization"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[r.value==="spots"?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(b.default,{states:{empty:{title:"No Spots Found",description:"Currently, there are no spots available."}},store:{read:s=>C.actions.read(e.unref(t).params._id),state:a.state},options:{user:o.state.user._id,sort:"numberOfMemberships",contain:["blogposts"],limit:10}},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(p,_)=>(e.openBlock(),e.createBlock(g.default,{key:_,spot:p,organization:a.state.current,class:"radius-big bg-grey mn-b-thin"},null,8,["spot","organization"]))),128))]),_:1},8,["store","options"]),o.state.user._id===a.state.current.owner?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:n[1]||(n[1]=s=>l.$router.push(`/spots/${a.state.current._id}/spots/create`)),class:"mn-b-thin bg-main button w-100"}," Add spot ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})])])):e.createCommentVNode("",!0)}}};exports.default=x;
@@ -33,7 +33,7 @@ const G = {
33
33
  b.value = await R.read({
34
34
  _id: e.params._id,
35
35
  user: n.user._id
36
- }), await T.read(e.params._id);
36
+ }), await T.read({ target: e.params._id });
37
37
  });
38
38
  const r = g(k);
39
39
  return e.query.tab = r.value, z(r, (v) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),m=require("../../../../components/Field/Field.vue.cjs");require("vue-i18n");const _=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue2.cjs");require("./Documents.vue2.cjs");const f=o=>(e.pushScopeId("data-v-f93fcad7"),o=o(),e.popScopeId(),o),v={class:"documents"},h=f(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Список документов",-1)),k={class:"mn-b-big cols-4"},b=["onClick"],y={class:"mn-b-small"},E={class:"t-semi t-transp radius-small"},B={__name:"Documents",setup(o){r.useRouter(),r.useRoute();let l=[{name:"Паспорт",status:"Не добавлен",inputs:[{type:"text",name:"Номер и серия"},{type:"text",name:"Место выдачи"},{type:"text",name:"Дата выдачи"}]},{name:"ИНН",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"СНИЛС",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"Военный билет",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]}];const s=e.ref(!1),a=e.ref(null),p=u=>{a.value=u,s.value=!0},c=()=>{s.value=!1},i=()=>{c()};return e.watchEffect(()=>{}),(u,q)=>{const d=e.resolveComponent("Popup");return e.openBlock(),e.createElementBlock("div",v,[h,e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,onClick:x=>p(n),class:"h-100 pd-medium bg-white radius-small"},[e.createElementVNode("h3",y,e.toDisplayString(t.name),1),e.createElementVNode("p",E,e.toDisplayString(t.status),1)],8,b))),128))]),e.createVNode(d,{title:"Добавить документ",onClosePopup:c,isPopupOpen:s.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l)[a.value].inputs,t=>(e.openBlock(),e.createElementBlock("div",{key:t.name},[e.createVNode(m.default,{field:t.value,"onUpdate:field":n=>t.value=n,label:t.name,_id:t.name,placeholder:t.name,class:"w-100"},null,8,["field","onUpdate:field","label","_id","placeholder"])]))),128)),e.createElementVNode("button",{onClick:i,class:"w-100 mn-b-small button"},"Отправить на верификацию")]),_:1},8,["isPopupOpen"])])}}},g=_.default(B,[["__scopeId","data-v-f93fcad7"]]);exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),m=require("../../../../components/Field/Field.vue.cjs");require("vue-i18n");require("../../../../components/Popup/Popup.vue2.cjs");require("../../../../components/Loader/Loader.vue.cjs");const _=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");require("../../../../components/Button/Button.vue2.cjs");require("./Documents.vue2.cjs");const f=o=>(e.pushScopeId("data-v-f93fcad7"),o=o(),e.popScopeId(),o),v={class:"documents"},h=f(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Список документов",-1)),k={class:"mn-b-big cols-4"},b=["onClick"],y={class:"mn-b-small"},E={class:"t-semi t-transp radius-small"},B={__name:"Documents",setup(o){r.useRouter(),r.useRoute();let l=[{name:"Паспорт",status:"Не добавлен",inputs:[{type:"text",name:"Номер и серия"},{type:"text",name:"Место выдачи"},{type:"text",name:"Дата выдачи"}]},{name:"ИНН",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"СНИЛС",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]},{name:"Военный билет",status:"Не добавлен",inputs:[{type:"text",name:"Дата регистрации"}]}];const s=e.ref(!1),a=e.ref(null),p=u=>{a.value=u,s.value=!0},c=()=>{s.value=!1},i=()=>{c()};return e.watchEffect(()=>{}),(u,q)=>{const d=e.resolveComponent("Popup");return e.openBlock(),e.createElementBlock("div",v,[h,e.createElementVNode("div",k,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(t,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,onClick:x=>p(n),class:"h-100 pd-medium bg-white radius-small"},[e.createElementVNode("h3",y,e.toDisplayString(t.name),1),e.createElementVNode("p",E,e.toDisplayString(t.status),1)],8,b))),128))]),e.createVNode(d,{title:"Добавить документ",onClosePopup:c,isPopupOpen:s.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l)[a.value].inputs,t=>(e.openBlock(),e.createElementBlock("div",{key:t.name},[e.createVNode(m.default,{field:t.value,"onUpdate:field":n=>t.value=n,label:t.name,_id:t.name,placeholder:t.name,class:"w-100"},null,8,["field","onUpdate:field","label","_id","placeholder"])]))),128)),e.createElementVNode("button",{onClick:i,class:"w-100 mn-b-small button"},"Отправить на верификацию")]),_:1},8,["isPopupOpen"])])}}},g=_.default(B,[["__scopeId","data-v-f93fcad7"]]);exports.default=g;
@@ -2,9 +2,9 @@ import { ref as r, watchEffect as y, resolveComponent as P, openBlock as t, crea
2
2
  import { useRouter as I, useRoute as g } from "vue-router";
3
3
  import D from "../../../../components/Field/Field.vue.js";
4
4
  import "vue-i18n";
5
- import S from "../../../../../../_virtual/_plugin-vue_export-helper.js";
6
5
  import "../../../../components/Popup/Popup.vue2.js";
7
6
  import "../../../../components/Loader/Loader.vue.js";
7
+ import S from "../../../../../../_virtual/_plugin-vue_export-helper.js";
8
8
  import "../../../../components/Button/Button.vue2.js";
9
9
  import "./Documents.vue2.js";
10
10
  const E = (a) => (w("data-v-f93fcad7"), a = a(), C(), a), B = { class: "documents" }, F = /* @__PURE__ */ E(() => /* @__PURE__ */ o("h3", { class: "mn-b-small" }, "Список документов", -1)), N = { class: "mn-b-big cols-4" }, O = ["onClick"], R = { class: "mn-b-small" }, U = { class: "t-semi t-transp radius-small" }, V = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/pages/Organization.vue.cjs"),t=require("./components/pages/Department.vue.cjs"),r=require("./components/pages/OrganizationEdit.vue.cjs"),i=require("./components/pages/Organizations.vue.cjs"),a=require("./components/pages/DepartmentEdit.vue.cjs"),n=require("./components/blocks/CardOrganization.vue.cjs"),o=require("./components/blocks/EditArray.vue.cjs"),u=require("./components/blocks/Unit.vue.cjs"),s=require("./components/blocks/DepartmentSub.vue.cjs"),d=require("./components/blocks/DepartmentMemberModify.vue.cjs"),c=require("./components/blocks/CardDepartment.vue.cjs"),l=require("./components/blocks/Rating.vue.cjs"),m=require("./components/blocks/EmptyState.vue.cjs"),q=require("./components/blocks/Contacts.vue.cjs"),f=require("./components/blocks/Socials.vue.cjs"),g=require("./components/sections/MembersAdd.vue.cjs"),p=require("./components/sections/DetailsTab.vue.cjs"),b=require("./components/sections/Organizations.vue.cjs"),z=require("./components/sections/Publics.vue.cjs"),D=require("./components/sections/Documents.vue.cjs"),S=require("./components/elements/ButtonToggleMembership.vue.cjs"),O=require("./store/departments.cjs"),M=require("./store/memberships.cjs"),y=require("./store/organizations.cjs"),E=require("./store/invites.cjs"),C=require("./router/organizations.cjs");exports.Organization=e.default;exports.Department=t.default;exports.OrganizationEdit=r.default;exports.Organizations=i.default;exports.DepartmentEdit=a.default;exports.CardOrganization=n.default;exports.EditArray=o.default;exports.Unit=u.default;exports.DepartmentSub=s.default;exports.DepartmentMemberModify=d.default;exports.CardDepartment=c.default;exports.Rating=l.default;exports.EmptyState=m.default;exports.Contacts=q.default;exports.Socials=f.default;exports.MembersAdd=g.default;exports.DetailsTab=p.default;exports.OrganizationsSection=b.default;exports.Publics=z.default;exports.Documents=D.default;exports.ButtonToggleMembership=S.default;exports.departmentsStore=O;exports.membershipsStore=M;exports.organizationStore=y;exports.invitesStore=E;exports.organizationsRouter=C.default;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./components/pages/Organization.vue.cjs"),t=require("./components/pages/Department.vue.cjs"),r=require("./components/pages/OrganizationEdit.vue.cjs"),i=require("./components/pages/Organizations.vue.cjs"),a=require("./components/pages/DepartmentEdit.vue.cjs"),n=require("./components/blocks/CardOrganization.vue.cjs"),o=require("./components/blocks/EditArray.vue.cjs"),u=require("./components/blocks/Unit.vue.cjs"),s=require("./components/blocks/DepartmentSub.vue.cjs"),d=require("./components/blocks/CardDepartment.vue.cjs"),c=require("./components/blocks/Rating.vue.cjs"),l=require("./components/blocks/EmptyState.vue.cjs"),q=require("./components/blocks/Contacts.vue.cjs"),m=require("./components/blocks/Socials.vue.cjs"),f=require("./components/sections/MembersAdd.vue.cjs"),g=require("./components/sections/DetailsTab.vue.cjs"),p=require("./components/sections/Organizations.vue.cjs"),b=require("./components/sections/Publics.vue.cjs"),z=require("./components/sections/Documents.vue.cjs"),S=require("./components/elements/ButtonToggleMembership.vue.cjs"),D=require("./store/departments.cjs"),O=require("./store/memberships.cjs"),E=require("./store/organizations.cjs"),y=require("./store/invites.cjs"),C=require("./router/organizations.cjs");exports.Organization=e.default;exports.Department=t.default;exports.OrganizationEdit=r.default;exports.Organizations=i.default;exports.DepartmentEdit=a.default;exports.CardOrganization=n.default;exports.EditArray=o.default;exports.Unit=u.default;exports.DepartmentSub=s.default;exports.CardDepartment=d.default;exports.Rating=c.default;exports.EmptyState=l.default;exports.Contacts=q.default;exports.Socials=m.default;exports.MembersAdd=f.default;exports.DetailsTab=g.default;exports.OrganizationsSection=p.default;exports.Publics=b.default;exports.Documents=z.default;exports.ButtonToggleMembership=S.default;exports.departmentsStore=D;exports.membershipsStore=O;exports.organizationStore=E;exports.invitesStore=y;exports.organizationsRouter=C.default;
@@ -1,54 +1,52 @@
1
- import { default as s } from "./components/pages/Organization.vue.js";
1
+ import { default as f } from "./components/pages/Organization.vue.js";
2
2
  import { default as p } from "./components/pages/Department.vue.js";
3
3
  import { default as d } from "./components/pages/OrganizationEdit.vue.js";
4
4
  import { default as u } from "./components/pages/Organizations.vue.js";
5
5
  import { default as x } from "./components/pages/DepartmentEdit.vue.js";
6
- import { default as b } from "./components/blocks/CardOrganization.vue.js";
7
- import { default as S } from "./components/blocks/EditArray.vue.js";
6
+ import { default as z } from "./components/blocks/CardOrganization.vue.js";
7
+ import { default as b } from "./components/blocks/EditArray.vue.js";
8
8
  import { default as c } from "./components/blocks/Unit.vue.js";
9
9
  import { default as E } from "./components/blocks/DepartmentSub.vue.js";
10
- import { default as h } from "./components/blocks/DepartmentMemberModify.vue.js";
11
10
  import { default as C } from "./components/blocks/CardDepartment.vue.js";
12
- import { default as A } from "./components/blocks/Rating.vue.js";
13
- import { default as T } from "./components/blocks/EmptyState.vue.js";
14
- import { default as P } from "./components/blocks/Contacts.vue.js";
15
- import { default as j } from "./components/blocks/Socials.vue.js";
16
- import { default as q } from "./components/sections/MembersAdd.vue.js";
17
- import { default as F } from "./components/sections/DetailsTab.vue.js";
18
- import { default as H } from "./components/sections/Organizations.vue.js";
19
- import { default as J } from "./components/sections/Publics.vue.js";
20
- import { default as L } from "./components/sections/Documents.vue.js";
21
- import { default as Q } from "./components/elements/ButtonToggleMembership.vue.js";
11
+ import { default as y } from "./components/blocks/Rating.vue.js";
12
+ import { default as M } from "./components/blocks/EmptyState.vue.js";
13
+ import { default as T } from "./components/blocks/Contacts.vue.js";
14
+ import { default as P } from "./components/blocks/Socials.vue.js";
15
+ import { default as j } from "./components/sections/MembersAdd.vue.js";
16
+ import { default as q } from "./components/sections/DetailsTab.vue.js";
17
+ import { default as F } from "./components/sections/Organizations.vue.js";
18
+ import { default as H } from "./components/sections/Publics.vue.js";
19
+ import { default as J } from "./components/sections/Documents.vue.js";
20
+ import { default as L } from "./components/elements/ButtonToggleMembership.vue.js";
22
21
  import * as t from "./store/departments.js";
23
- import * as r from "./store/memberships.js";
24
- import * as a from "./store/organizations.js";
22
+ import * as a from "./store/memberships.js";
23
+ import * as r from "./store/organizations.js";
25
24
  import * as e from "./store/invites.js";
26
- import { default as W } from "./router/organizations.js";
25
+ import { default as Q } from "./router/organizations.js";
27
26
  export {
28
- Q as ButtonToggleMembership,
27
+ L as ButtonToggleMembership,
29
28
  C as CardDepartment,
30
- b as CardOrganization,
31
- P as Contacts,
29
+ z as CardOrganization,
30
+ T as Contacts,
32
31
  p as Department,
33
32
  x as DepartmentEdit,
34
- h as DepartmentMemberModify,
35
33
  E as DepartmentSub,
36
- F as DetailsTab,
37
- L as Documents,
38
- S as EditArray,
39
- T as EmptyState,
40
- q as MembersAdd,
41
- s as Organization,
34
+ q as DetailsTab,
35
+ J as Documents,
36
+ b as EditArray,
37
+ M as EmptyState,
38
+ j as MembersAdd,
39
+ f as Organization,
42
40
  d as OrganizationEdit,
43
41
  u as Organizations,
44
- H as OrganizationsSection,
45
- J as Publics,
46
- A as Rating,
47
- j as Socials,
42
+ F as OrganizationsSection,
43
+ H as Publics,
44
+ y as Rating,
45
+ P as Socials,
48
46
  c as Unit,
49
47
  t as departmentsStore,
50
48
  e as invitesStore,
51
- r as membershipsStore,
52
- a as organizationStore,
53
- W as organizationsRouter
49
+ a as membershipsStore,
50
+ r as organizationStore,
51
+ Q as organizationsRouter
54
52
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("../../auth/store/auth.cjs");const e=[{path:"members",name:"Organization Members",meta:{title:{en:"Members",ru:"Участникb"}},component:()=>Promise.resolve().then(()=>require("../components/pages/Members.vue.cjs"))},{path:"members/invite",name:"Invite Member",component:()=>Promise.resolve().then(()=>require("../components/sections/MembersAdd.vue.cjs"))}];exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("../../auth/store/auth.cjs");const e=[{path:"members",name:"Organization Members",meta:{title:{en:"Members",ru:"Участники"}},component:()=>Promise.resolve().then(()=>require("../components/pages/Members.vue.cjs"))},{path:"members/invite",name:"Invite Member",component:()=>Promise.resolve().then(()=>require("../components/sections/MembersAdd.vue.cjs"))}];exports.default=e;
@@ -5,7 +5,7 @@ const m = [{
5
5
  meta: {
6
6
  title: {
7
7
  en: "Members",
8
- ru: "Участникb"
8
+ ru: "Участники"
9
9
  }
10
10
  },
11
11
  component: () => import("../components/pages/Members.vue.js")
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const o=require("vue"),n=require("../../globals/store/globals.cjs"),s=l.default.create({baseURL:process.env.API_URL,withCredentials:!0});s.defaults.withCredentials=!0;const a=o.reactive({departments:[],department:{organization:"",profile:{photo:"",name:"",description:"",categories:[]},address:"",location:{lat:null,lng:null},worktime:[],delivery:[],payment:[],members:[],subdepartments:[],hidden:!1,accesses:{products:{read:!1,edit:!1,delete:!1},orders:{read:!1,confirm:!1,delete:!1},departments:{read:!1,edit:!1,delete:!1}}},error:null}),d={async readOne(r){try{const e=await s.get(`/api/departments/get/${r}`);return a.department=e.data,a.error=null,e.data}catch(e){return n.setError(e),null}},async read(r={}){try{const e=await s.get("/api/departments/read",{params:r});return console.log("Response:",e),a.departments=e.data,a.error=null,e.data}catch(e){return console.log(e),n.setError(e),null}},async create(r,e){try{const t=await s.post(`/api/departments/${r}/create`,e);return a.error=null,a.department=t.data,t.data}catch(t){return n.setError(t),null}},async update(r,e){try{const t=await s.post(`/api/departments/${r}/update`,e);return a.error=null,t}catch(t){return n.setError(t),null}},async delete(r,e){try{return await s.delete(`/api/departments/${r}/delete`,{data:{_id:e}}),a.error=null,!0}catch(t){return n.setError(t),!1}}};o.watch(a,(r,e)=>{});exports.actions=d;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../../node_modules/axios/lib/axios.cjs");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");const o=require("vue"),n=require("../../globals/store/globals.cjs"),s=l.default.create({baseURL:process.env.API_URL,withCredentials:!0});s.defaults.withCredentials=!0;const a=o.reactive({departments:[],department:{organization:"",profile:{photo:"",name:"",description:"",categories:[]},address:"",location:{lat:null,lng:null},worktime:[],delivery:[],payment:[],members:[],subdepartments:[],hidden:!1,accesses:{products:{read:!1,edit:!1,delete:!1},orders:{read:!1,confirm:!1,delete:!1},departments:{read:!1,edit:!1,delete:!1}}},error:null}),d={async readOne(r){try{const e=await s.get(`/api/departments/get/${r}`);return a.department=e.data,a.error=null,e.data}catch(e){return n.setError(e),null}},async read(r={}){try{const e=await s.get("/api/departments/read",{params:r});return console.log("Response:",e),a.departments=e.data,a.error=null,e.data}catch(e){return console.log(e),n.setError(e),null}},async create(r,e){try{const t=await s.post(`/api/departments/${r}/create`,e);return a.error=null,t.data}catch(t){return n.setError(t),null}},async update(r,e){try{const t=await s.post(`/api/departments/${r}/update`,e);return a.error=null,t}catch(t){return n.setError(t),null}},async delete(r,e){try{return await s.delete(`/api/departments/${r}/delete`,{data:{_id:e}}),a.error=null,!0}catch(t){return n.setError(t),!1}}};o.watch(a,(r,e)=>{});exports.actions=d;exports.state=a;
@@ -66,7 +66,7 @@ const a = l({
66
66
  async create(r, e) {
67
67
  try {
68
68
  const t = await s.post(`/api/departments/${r}/create`, e);
69
- return a.error = null, a.department = t.data, t.data;
69
+ return a.error = null, t.data;
70
70
  } catch (t) {
71
71
  return n(t), null;
72
72
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../../../node_modules/axios/lib/axios.cjs"),l=require("vue"),o=require("../../globals/store/globals.cjs"),n=d.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=l.reactive({memberships:[],error:null}),p={async read(r={}){let e={};r._id&&(e._id=r._id),r.user&&(e.user=r.user),r.target&&(e.target=r.target),r.role&&(e.role=r.role);try{const s=await n.get("/api/memberships",{params:e});return a.error=null,a.memberships=s.data,Promise.resolve(s.data)}catch(s){return o.setError(s),Promise.reject(s)}},async create(r){try{const e=await n.post("/api/memberships/create",r);return a.error=null,Promise.resolve(e.data)}catch(e){return o.setError(e),Promise.reject(e)}},async update(r){try{const e=await n.post("/api/memberships/update",r);return a.error=null,Promise.resolve(e.data)}catch(e){return o.setError(e),Promise.reject(e)}},async delete(r){try{const e=await n.post("/api/memberships/delete",{_id:r});return a.error=null,Promise.resolve(e.data)}catch(e){return o.setError(e),Promise.reject(e)}}},h={handleMembershipUpdate(r,e,s,f,u,c){let t;if(Array.isArray(r)?t=r.find(i=>i._id===e.target):typeof r=="object"&&r._id===e.target&&(t=r),t)if(t[u]=s,s)t.memberships.push(e),t[c]+=1;else{const i=t.memberships.findIndex(m=>m._id===e._id);i!==-1&&(t.memberships.splice(i,1),t[c]-=1)}}};l.watch(a,r=>{});exports.actions=p;exports.mutations=h;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../../../node_modules/axios/lib/axios.cjs"),l=require("vue"),i=require("../../globals/store/globals.cjs"),a=u.default.create({baseURL:process.env.API_URL,withCredentials:!0}),s=l.reactive({memberships:[],error:null}),d={async read(r={}){try{const e=await a.get("/api/memberships",{params:r});return s.error=null,s.memberships=e.data,Promise.resolve(e.data)}catch(e){return i.setError(e),Promise.reject(e)}},async create(r){try{const e=await a.post("/api/memberships/create",r);return s.error=null,Promise.resolve(e.data)}catch(e){return i.setError(e),Promise.reject(e)}},async update(r){try{const e=await a.post("/api/memberships/update",r);return s.error=null,Promise.resolve(e.data)}catch(e){return i.setError(e),Promise.reject(e)}},async delete(r){try{const e=await a.post("/api/memberships/delete",{_id:r});return s.error=null,Promise.resolve(e.data)}catch(e){return i.setError(e),Promise.reject(e)}}},h={handleMembershipUpdate(r,e,n,y,p,c){let t;if(Array.isArray(r)?t=r.find(o=>o._id===e.target):typeof r=="object"&&r._id===e.target&&(t=r),t)if(t[p]=n,n)t.memberships.push(e),t[c]+=1;else{const o=t.memberships.findIndex(m=>m._id===e._id);o!==-1&&(t.memberships.splice(o,1),t[c]-=1)}}};l.watch(s,r=>{});exports.actions=d;exports.mutations=h;exports.state=s;
@@ -1,63 +1,61 @@
1
- import p from "../../../../node_modules/axios/lib/axios.js";
2
- import { reactive as d, watch as u } from "vue";
3
- import { setError as o } from "../../globals/store/globals.js";
4
- const c = p.create({
1
+ import l from "../../../../node_modules/axios/lib/axios.js";
2
+ import { reactive as d, watch as h } from "vue";
3
+ import { setError as i } from "../../globals/store/globals.js";
4
+ const a = l.create({
5
5
  baseURL: process.env.API_URL,
6
6
  withCredentials: !0
7
- }), a = d({
7
+ }), s = d({
8
8
  memberships: [],
9
9
  error: null
10
- }), _ = {
10
+ }), b = {
11
11
  async read(r = {}) {
12
- let e = {};
13
- r._id && (e._id = r._id), r.user && (e.user = r.user), r.target && (e.target = r.target), r.role && (e.role = r.role);
14
12
  try {
15
- const s = await c.get("/api/memberships", { params: e });
16
- return a.error = null, a.memberships = s.data, Promise.resolve(s.data);
17
- } catch (s) {
18
- return o(s), Promise.reject(s);
13
+ const e = await a.get("/api/memberships", { params: r });
14
+ return s.error = null, s.memberships = e.data, Promise.resolve(e.data);
15
+ } catch (e) {
16
+ return i(e), Promise.reject(e);
19
17
  }
20
18
  },
21
19
  async create(r) {
22
20
  try {
23
- const e = await c.post("/api/memberships/create", r);
24
- return a.error = null, Promise.resolve(e.data);
21
+ const e = await a.post("/api/memberships/create", r);
22
+ return s.error = null, Promise.resolve(e.data);
25
23
  } catch (e) {
26
- return o(e), Promise.reject(e);
24
+ return i(e), Promise.reject(e);
27
25
  }
28
26
  },
29
27
  async update(r) {
30
28
  try {
31
- const e = await c.post("/api/memberships/update", r);
32
- return a.error = null, Promise.resolve(e.data);
29
+ const e = await a.post("/api/memberships/update", r);
30
+ return s.error = null, Promise.resolve(e.data);
33
31
  } catch (e) {
34
- return o(e), Promise.reject(e);
32
+ return i(e), Promise.reject(e);
35
33
  }
36
34
  },
37
35
  async delete(r) {
38
36
  try {
39
- const e = await c.post("/api/memberships/delete", { _id: r });
40
- return a.error = null, Promise.resolve(e.data);
37
+ const e = await a.post("/api/memberships/delete", { _id: r });
38
+ return s.error = null, Promise.resolve(e.data);
41
39
  } catch (e) {
42
- return o(e), Promise.reject(e);
40
+ return i(e), Promise.reject(e);
43
41
  }
44
42
  }
45
- }, b = {
46
- handleMembershipUpdate(r, e, s, f, m, n) {
43
+ }, w = {
44
+ handleMembershipUpdate(r, e, n, u, p, c) {
47
45
  let t;
48
- if (Array.isArray(r) ? t = r.find((i) => i._id === e.target) : typeof r == "object" && r._id === e.target && (t = r), t)
49
- if (t[m] = s, s)
50
- t.memberships.push(e), t[n] += 1;
46
+ if (Array.isArray(r) ? t = r.find((o) => o._id === e.target) : typeof r == "object" && r._id === e.target && (t = r), t)
47
+ if (t[p] = n, n)
48
+ t.memberships.push(e), t[c] += 1;
51
49
  else {
52
- const i = t.memberships.findIndex((l) => l._id === e._id);
53
- i !== -1 && (t.memberships.splice(i, 1), t[n] -= 1);
50
+ const o = t.memberships.findIndex((m) => m._id === e._id);
51
+ o !== -1 && (t.memberships.splice(o, 1), t[c] -= 1);
54
52
  }
55
53
  }
56
54
  };
57
- u(a, (r) => {
55
+ h(s, (r) => {
58
56
  });
59
57
  export {
60
- _ as actions,
61
- b as mutations,
62
- a as state
58
+ b as actions,
59
+ w as mutations,
60
+ s as state
63
61
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const o=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const s=require("../../../../components/Field/Field.vue.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue.cjs"),B=require("../../../../components/Popup/Popup.vue.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),m=require("../../../icons/navigation/IconDelete.vue.cjs"),b=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),w=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},P={class:"cols-2 gap-thin"},U={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},D={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},z={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},I={class:"cols-1 gap-thin"},F={__name:"ProductEdit",setup(L){const n=k.useRoute(),g=k.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function N(c){f.value=!0}function d(){f.value=!1}e.onMounted(async()=>{t.mutations.resetProduct(),n.params.product&&await t.actions.read({_id:n.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[]),await w.actions.fetchCategories();try{const c=await t.actions.read({organization:n.params._id,limit:100});p.value=c}catch{console.error("error")}});function v(){n.params.product?t.actions.update(n.params.product,t.state.current):t.actions.create(n.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function h(){g.push({name:"Organization",params:{_id:n.params._id}})}return(c,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(n).params.product?t.state.current.name:"Create Product"),1),e.unref(n).params.product?(e.openBlock(),e.createBlock(_.default,{key:0,submit:x,callback:h,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(_.default,{submit:v,callback:h,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(C.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":i[0]||(i[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",P,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(q.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(g).push({name:"Categories Organization",params:{_id:e.unref(n).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,r)=>(e.openBlock(),e.createBlock(V.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",U,[e.createVNode(m.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(m.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(m.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:d,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(b.default,{onAdd:i[1]||(i[1]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"]),e.createVNode(o.default,{title:"Ingredients",placeholder:"No positions added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,r)=>(e.openBlock(),e.createBlock(b.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[2]||(i[2]=l=>{u.actions.add(t.state.current.ingredients,l),d()}),onUpdate:l=>{u.actions.update(t.state.current.ingredients,l,r),d()},onDelete:l=>{u.actions.delete(t.state.current.ingredients,l,r),d()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])]),_:1},8,["actions"])]))}};exports.default=F;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const o=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const c=require("../../../../components/Field/Field.vue.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../components/Button/Button.vue.cjs"),B=require("../../../../components/Popup/Popup.vue.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),_=require("../../../icons/navigation/IconDelete.vue.cjs"),b=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),N=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const P={class:"for-transition w-100 cols-1 pd-thin gap-thin"},y={class:"mn-r-auto"},E={class:"cols-2 gap-thin"},U={key:0,class:"cols-1 gap-thin"},z={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},I={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},D={__name:"ProductEdit",setup(O){const l=h.useRoute(),m=h.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function v(d){f.value=!0}function s(){f.value=!1}e.onMounted(async()=>{t.mutations.resetProduct(),l.params.product&&await t.actions.read({_id:l.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[]),await N.actions.fetchCategories();try{const d=await t.actions.read({organization:l.params._id,limit:100});p.value=d}catch{console.error("error")}});function w(){l.params.product?t.actions.update(l.params.product,t.state.current):t.actions.create(l.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){m.push({name:"Organization",params:{_id:l.params._id}})}return(d,i)=>(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",y,e.toDisplayString(e.unref(l).params.product?t.state.current.name:"Create Product"),1),e.unref(l).params.product?(e.openBlock(),e.createBlock(k.default,{key:0,submit:x,callback:g,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(k.default,{submit:w,callback:g,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(C.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":i[0]||(i[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",E,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(q.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Ingredients",placeholder:"No ingridients added yet",actions:[{label:"+",function:()=>v()}]},{default:e.withCtx(()=>[t.state.current.ingredients.length>0?(e.openBlock(),e.createElementBlock("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,n)=>(e.openBlock(),e.createBlock(b.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[1]||(i[1]=r=>{u.actions.add(t.state.current.ingredients,r),s()}),onUpdate:r=>{u.actions.update(t.state.current.ingredients,r,n),s()},onDelete:r=>{u.actions.delete(t.state.current.ingredients,r,n),s()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(m).push({name:"Categories Organization",params:{_id:e.unref(l).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.state.all,(a,n)=>(e.openBlock(),e.createBlock(V.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":r=>t.state.current.category=r},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:n},[e.createVNode(c.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(_.default,{onClick:()=>t.state.current.information.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:n},[e.createVNode(c.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",I,[e.createVNode(_.default,{onClick:()=>t.state.current.localization.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:s,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(b.default,{onAdd:i[2]||(i[2]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"])]))}};exports.default=D;