Validate sessions against the API, honor configurable base paths, and route unknown pages to 404. Keep development ports stable so user and admin apps cannot be confused. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
import{E as e,Et as t,G as n,J as r,N as i,O as a,P as o,T as s,Xt as c,Z as l,at as u,b as d,g as f,h as p,t as m,vt as h,w as g}from"./_plugin-vue_export-helper-Bo3WtfwJ.js";import{t as _}from"./catalog-CIw6in_a.js";import{T as v}from"./index-BAQfYU-Q.js";import{t as y}from"./EmptyState-D-8eFOUi.js";import{t as b}from"./PageHeader-DTO8lja2.js";import{t as x}from"./SearchField-BMLbKLPW.js";import{t as S}from"./PageSkeleton-DHtB6RUa.js";import{t as C}from"./catalogNavigation-BKzzgMwI.js";var w={class:`page catalog-list-page`},T={class:`catalog-list-page__desk-head desktop-only`},E={class:`page__scroll page__scroll--with-nav catalog-list-page__scroll`},D={key:1,class:`catalog-list`},O=[`onClick`],k={class:`catalog-card__icon`},A={class:`catalog-card__info`},j={class:`catalog-card__count`},M=m(o({__name:`CatalogListView`,setup(o){let m=p(),M=f(),N=_(),P=h(!0),F=g(()=>m.params.companyId),I=g(()=>N.getCompany(F.value)),L=h(``),R=g(()=>N.fetchCatalogs(F.value,L.value));async function z(){P.value=!0,N.getCompany(F.value)||await N.loadCompanies(),await N.loadCatalogs(F.value),P.value=!1}n(z),u(F,z);function B(e){C(M,e)}function V(e){let t=N.getCatalog(e);return t?.productCount==null?N.fetchProducts(e).length:t.productCount}return(n,o)=>(r(),a(`div`,w,[i(b,{class:`mobile-only`,title:I.value?.name??`کالیتهها`,subtitle:`کالیته مورد نظر را انتخاب کنید`,"show-back":``,centered:``,onBack:o[0]||=e=>t(M).push(`/catalogs`)},null,8,[`title`]),s(`header`,T,[s(`h1`,null,c(I.value?.name??`کالیتهها`),1),o[2]||=s(`p`,null,`کالیته مورد نظر را انتخاب کنید`,-1)]),i(x,{modelValue:L.value,"onUpdate:modelValue":o[1]||=e=>L.value=e,placeholder:`جستجو بر اساس کد یا نام کالیته...`,class:`catalog-list-page__search`},null,8,[`modelValue`]),s(`div`,E,[P.value?(r(),e(S,{key:0,variant:`cards`,rows:5})):R.value.length>0?(r(),a(`div`,D,[(r(!0),a(d,null,l(R.value,e=>(r(),a(`button`,{key:e.id,type:`button`,class:`catalog-card`,onClick:t=>B(e.id)},[s(`span`,k,[i(v,{size:22})]),s(`div`,A,[s(`h3`,null,`کالیته کد `+c(e.code),1),s(`p`,null,c(e.name),1)]),s(`span`,j,c(V(e.id))+` محصول`,1)],8,O))),128))])):(r(),e(y,{key:2,variant:L.value?`search`:`catalogs`,message:L.value?`با این جستجو کالیتهای پیدا نشد`:`برای این شرکت هنوز کالیتهای ثبت نشده است`},null,8,[`variant`,`message`]))])]))}}),[[`__scopeId`,`data-v-a8edb49d`]]);export{M as default}; |