change icons-collection
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
import{L as e,Z as t,ct as n,rt as r,vt as i,yt as a,z as o}from"./index-9Ae_VOzQ.js";import{t as s}from"./BaseSwitch-D8k_9W00.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(e){let t=i(null),n=i(null),r=o();async function a(i,a){if(t.value)return a;let o=!a;if(!o&&e.confirmOff&&!await e.confirmOff())return a;t.value=i,n.value=null;let s=a;try{return await e.onPersist(o),r.success(e.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return n.value=i,r.error(e.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{t.value=null}}function s(e){return t.value===e}function c(e){return n.value===e}return{toggle:a,isLoading:s,hasError:c}}var u=r({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(r,{emit:i}){let o=r,u=i,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{o.persist?await o.persist(o.id,e):await c()},successMessage:e=>e?`${o.entityType??`مورد`} «${o.entityName}» فعال شد.`:`${o.entityType??`مورد`} «${o.entityName}» غیرفعال شد.`});async function m(t){if(t===o.modelValue)return;let n=o.entityType??`مورد`;if(!await e({title:t?`فعالسازی ${n}`:`غیرفعالسازی ${n}`,message:t?`آیا از فعال کردن «${o.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${o.entityName}» مطمئن هستید؟`,tone:t?`primary`:`danger`,confirmLabel:t?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let r=await d(o.id,o.modelValue);u(`update:modelValue`,r)}return(e,i)=>(n(),t(s,{"model-value":r.modelValue,loading:a(f)(r.id),error:a(p)(r.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
|
||||
import{L as e,Q as t,bt as n,it as r,lt as i,yt as a,z as o}from"./index-Ce0o2VuJ.js";import{t as s}from"./BaseSwitch-C9HY6KUs.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(e){let t=a(null),n=a(null),r=o();async function i(i,a){if(t.value)return a;let o=!a;if(!o&&e.confirmOff&&!await e.confirmOff())return a;t.value=i,n.value=null;let s=a;try{return await e.onPersist(o),r.success(e.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return n.value=i,r.error(e.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{t.value=null}}function s(e){return t.value===e}function c(e){return n.value===e}return{toggle:i,isLoading:s,hasError:c}}var u=r({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(r,{emit:a}){let o=r,u=a,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{o.persist?await o.persist(o.id,e):await c()},successMessage:e=>e?`${o.entityType??`مورد`} «${o.entityName}» فعال شد.`:`${o.entityType??`مورد`} «${o.entityName}» غیرفعال شد.`});async function m(t){if(t===o.modelValue)return;let n=o.entityType??`مورد`;if(!await e({title:t?`فعالسازی ${n}`:`غیرفعالسازی ${n}`,message:t?`آیا از فعال کردن «${o.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${o.entityName}» مطمئن هستید؟`,tone:t?`primary`:`danger`,confirmLabel:t?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let r=await d(o.id,o.modelValue);u(`update:modelValue`,r)}return(e,a)=>(i(),t(s,{"model-value":r.modelValue,loading:n(f)(r.id),error:n(p)(r.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{V as e,X as t,et as n,it as r,lt as i,o as a,t as o,xt as s}from"./index-Ce0o2VuJ.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=e(r({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(e,{emit:r}){let l=e,u=r,d=t(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:a(l.modelValue));function f(e){let t=e.target,n=o(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=a(r)}return(t,r)=>(i(),n(`input`,{id:e.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:s([`admin-currency-input`,e.inputClass]),value:d.value,placeholder:e.placeholder,disabled:e.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,Y as n,bt as r,ct as i,o as a,rt as o,t as s}from"./index-9Ae_VOzQ.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=t(o({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(t,{emit:o}){let l=t,u=o,d=n(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:a(l.modelValue));function f(e){let t=e.target,n=s(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=a(r)}return(n,a)=>(i(),e(`input`,{id:t.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:r([`admin-currency-input`,t.inputClass]),value:d.value,placeholder:t.placeholder,disabled:t.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,Q as n,St as r,X as i,bt as a,ct as o,rt as s,vt as c,xt as l,yt as u}from"./index-9Ae_VOzQ.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={class:`image-picker`},v={key:0,class:`image-picker__label`},y={class:`image-picker__row`},b={class:`image-picker__actions`},x=[`disabled`],S=[`disabled`],C={key:1,class:`image-picker__error`},w={key:2,class:`image-picker__ok`},T=t(s({__name:`AdminImagePicker`,props:{modelValue:{},label:{}},emits:[`update:modelValue`],setup(t,{emit:s}){let d=t,f=s,h=c(null),g=c(!1),T=c(``),E=c(!1);function D(){h.value?.click()}async function O(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,T.value=``,E.value=!1;try{f(`update:modelValue`,await m(n)),E.value=!0}catch(e){T.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function k(){f(`update:modelValue`,null)}return(s,c)=>(o(),e(`div`,_,[t.label?(o(),e(`p`,v,r(t.label),1)):n(``,!0),i(`div`,y,[i(`div`,{class:a([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:l(d.modelValue?{backgroundImage:u(p)(d.modelValue)}:void 0)},null,6),i(`div`,b,[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:D},r(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),9,x),d.modelValue?(o(),e(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:k},` حذف `,8,S)):n(``,!0),T.value?(o(),e(`p`,C,r(T.value),1)):E.value?(o(),e(`p`,w,`تصویر انتخاب شد — برای ثبت نهایی «ذخیره» را بزنید.`)):n(``,!0)])]),i(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:O},null,544)]))}}),[[`__scopeId`,`data-v-05db5be7`]]);export{m as n,p as r,T as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,Ct as t,St as n,V as r,Z as i,bt as a,et as o,it as s,lt as c,xt as l,yt as u}from"./index-Ce0o2VuJ.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={class:`image-picker`},v={key:0,class:`image-picker__label`},y={class:`image-picker__row`},b={class:`image-picker__actions`},x=[`disabled`],S=[`disabled`],C={key:1,class:`image-picker__error`},w={key:2,class:`image-picker__ok`},T=r(s({__name:`AdminImagePicker`,props:{modelValue:{},label:{}},emits:[`update:modelValue`],setup(r,{emit:s}){let d=r,f=s,h=u(null),g=u(!1),T=u(``),E=u(!1);function D(){h.value?.click()}async function O(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,T.value=``,E.value=!1;try{f(`update:modelValue`,await m(n)),E.value=!0}catch(e){T.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function k(){f(`update:modelValue`,null)}return(s,u)=>(c(),o(`div`,_,[r.label?(c(),o(`p`,v,t(r.label),1)):e(``,!0),i(`div`,y,[i(`div`,{class:l([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:n(d.modelValue?{backgroundImage:a(p)(d.modelValue)}:void 0)},null,6),i(`div`,b,[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:D},t(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),9,x),d.modelValue?(c(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:k},` حذف `,8,S)):e(``,!0),T.value?(c(),o(`p`,C,t(T.value),1)):E.value?(c(),o(`p`,w,`تصویر انتخاب شد — برای ثبت نهایی «ذخیره» را بزنید.`)):e(``,!0)])]),i(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:O},null,544)]))}}),[[`__scopeId`,`data-v-05db5be7`]]);export{m as n,p as r,T as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,X as n,ct as r,et as i,q as a,rt as o,ut as s}from"./index-9Ae_VOzQ.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=t(o({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(t){return(o,p)=>(r(),e(`div`,c,[t.variant===`table`?(r(),e(a,{key:0},[p[1]||=n(`div`,{class:`admin-page-skeleton__toolbar`},[n(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),n(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),n(`div`,l,[(r(!0),e(a,null,s(t.rows,t=>(r(),e(`div`,{key:t,class:`admin-page-skeleton__tr`},[...p[0]||=[i(`<span class="admin-skeleton" style="width:18%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:22%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:14%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:16%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:12%;height:12px;" data-v-8283cd1d></span>`,5)]]))),128))])],64)):t.variant===`form`?(r(),e(`div`,u,[(r(!0),e(a,null,s(t.rows,t=>(r(),e(`div`,{key:t,class:`admin-page-skeleton__field`},[...p[2]||=[n(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):t.variant===`detail`?(r(),e(`div`,d,[...p[3]||=[i(`<span class="admin-skeleton" style="width:40%;height:18px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:70%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:120px;border-radius:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:88%;height:12px;" data-v-8283cd1d></span>`,5)]])):(r(),e(`div`,f,[(r(!0),e(a,null,s(t.rows,t=>(r(),e(`div`,{key:t,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[n(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{J as e,V as t,Z as n,dt as r,et as i,it as a,lt as o,tt as s}from"./index-Ce0o2VuJ.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=t(a({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(t){return(a,p)=>(o(),i(`div`,c,[t.variant===`table`?(o(),i(e,{key:0},[p[1]||=n(`div`,{class:`admin-page-skeleton__toolbar`},[n(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),n(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),n(`div`,l,[(o(!0),i(e,null,r(t.rows,e=>(o(),i(`div`,{key:e,class:`admin-page-skeleton__tr`},[...p[0]||=[s(`<span class="admin-skeleton" style="width:18%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:22%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:14%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:16%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:12%;height:12px;" data-v-8283cd1d></span>`,5)]]))),128))])],64)):t.variant===`form`?(o(),i(`div`,u,[(o(!0),i(e,null,r(t.rows,e=>(o(),i(`div`,{key:e,class:`admin-page-skeleton__field`},[...p[2]||=[n(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):t.variant===`detail`?(o(),i(`div`,d,[...p[3]||=[s(`<span class="admin-skeleton" style="width:40%;height:18px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:70%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:120px;border-radius:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:88%;height:12px;" data-v-8283cd1d></span>`,5)]])):(o(),i(`div`,f,[(o(!0),i(e,null,r(t.rows,e=>(o(),i(`div`,{key:e,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[n(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,G as n,J as r,K as i,O as a,P as o,Q as s,St as c,W as l,X as u,Y as d,Z as f,at as p,bt as m,ct as h,ht as g,nt as _,pt as v,q as y,rt as b,st as x,ut as S,vt as C,xt as w}from"./index-9Ae_VOzQ.js";var T=[`id`],E=[`aria-label`,`aria-expanded`],D={class:`admin-select__value`},O={class:`admin-select__chevron`,"aria-hidden":`true`},k=[`aria-label`],A={key:0,class:`admin-select__search`,role:`presentation`},j=[`placeholder`],M={key:1,class:`admin-select__empty`,role:`presentation`},N=[`aria-selected`,`onClick`],P=t(b({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(t,{emit:b}){let P=t,F=b,I=C(!1),L=C(``),R=C(null),z=C(null),B=C(null),V=C({});a(R,()=>{I.value=!1,L.value=``},{ignore:[z]});let H=d(()=>P.options.find(e=>e.value===P.modelValue)?.label??P.placeholder),U=d(()=>{let e=L.value.trim().toLowerCase();return e?P.options.filter(t=>t.label.toLowerCase().includes(e)):P.options});function W(){let e=R.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=r<Math.min(160,n)&&i>r,o=Math.max(120,Math.min(n,a?i:r));V.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function G(e){e?(window.addEventListener(`resize`,W),window.addEventListener(`scroll`,W,!0)):(window.removeEventListener(`resize`,W),window.removeEventListener(`scroll`,W,!0))}async function K(){I.value=!I.value,I.value&&(await p(),W(),P.searchable&&(L.value=``,await p(),B.value?.focus()))}function q(e){F(`update:modelValue`,e),I.value=!1,L.value=``}return v(I,e=>{G(e),e&&p(()=>W())}),x(()=>{G(!1)}),(a,d)=>(h(),e(`div`,{id:t.id,ref_key:`rootRef`,ref:R,class:m([`admin-select`,{"admin-select--open":I.value,"admin-select--block":t.block}])},[u(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":t.ariaLabel,"aria-expanded":I.value,"aria-haspopup":`listbox`,onClick:K},[u(`span`,D,c(H.value),1),u(`span`,O,[_(o,{name:`chevron-down`,size:16})])],8,E),(h(),f(r,{to:`body`},[I.value?(h(),e(`ul`,{key:0,ref_key:`menuRef`,ref:z,class:`admin-select__menu`,role:`listbox`,"aria-label":t.ariaLabel,style:w(V.value)},[t.searchable?(h(),e(`li`,A,[g(u(`input`,{ref_key:`searchInputRef`,ref:B,"onUpdate:modelValue":d[0]||=e=>L.value=e,type:`search`,class:`admin-select__search-input`,placeholder:t.searchPlaceholder,onClick:d[1]||=i(()=>{},[`stop`]),onKeydown:d[2]||=n(i(e=>I.value=!1,[`stop`]),[`esc`])},null,40,j),[[l,L.value]])])):s(``,!0),U.value.length?s(``,!0):(h(),e(`li`,M,` موردی یافت نشد `)),(h(!0),e(y,null,S(U.value,n=>(h(),e(`li`,{key:n.value,role:`presentation`},[u(`button`,{type:`button`,class:m([`admin-select__option`,{"admin-select__option--active":n.value===t.modelValue}]),role:`option`,"aria-selected":n.value===t.modelValue,onClick:e=>q(n.value)},[u(`span`,null,c(n.label),1),n.value===t.modelValue?(h(),f(o,{key:0,name:`check`,size:16,class:`admin-select__check`})):s(``,!0)],10,N)]))),128))],12,k)):s(``,!0)]))],10,T))}}),[[`__scopeId`,`data-v-7f43c8c3`]]);export{P as t};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.admin-select[data-v-4623e322]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-4623e322]{width:100%;min-width:0}.admin-select__trigger[data-v-4623e322]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-4623e322]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-4623e322],.admin-select__trigger[data-v-4623e322]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__trigger-content[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__value[data-v-4623e322]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__option-label[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__chevron[data-v-4623e322]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-4623e322]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-4623e322]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-4623e322]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-4623e322]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-4623e322]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-4623e322]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-4623e322]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-4623e322]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-4623e322]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-4623e322]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-4623e322]{color:var(--color-primary);flex-shrink:0}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,Ct as t,G as n,J as r,K as i,O as a,P as o,Q as s,St as c,V as l,X as u,Y as d,Z as f,ct as p,dt as m,et as h,ft as g,gt as _,it as v,lt as y,mt as b,ot as x,q as S,rt as C,xt as w,yt as T}from"./index-Ce0o2VuJ.js";var E=[`id`],D=[`aria-label`,`aria-expanded`],O={class:`admin-select__trigger-content`},k={class:`admin-select__value`},A={class:`admin-select__chevron`,"aria-hidden":`true`},j=[`aria-label`],M={key:0,class:`admin-select__search`,role:`presentation`},N=[`placeholder`],P={key:1,class:`admin-select__empty`,role:`presentation`},F=[`aria-selected`,`onClick`],I={class:`admin-select__option-label`},L=l(v({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(l,{emit:v}){let L=l,R=v,z=T(!1),B=T(``),V=T(null),H=T(null),U=T(null),W=T({});a(V,()=>{z.value=!1,B.value=``},{ignore:[H]});let G=u(()=>L.options.find(e=>e.value===L.modelValue)),K=u(()=>G.value?.label??L.placeholder),q=u(()=>{let e=B.value.trim().toLowerCase();return e?L.options.filter(t=>t.label.toLowerCase().includes(e)):L.options});function J(){let e=V.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=r<Math.min(160,n)&&i>r,o=Math.max(120,Math.min(n,a?i:r));W.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function Y(e){e?(window.addEventListener(`resize`,J),window.addEventListener(`scroll`,J,!0)):(window.removeEventListener(`resize`,J),window.removeEventListener(`scroll`,J,!0))}async function X(){z.value=!z.value,z.value&&(await x(),J(),L.searchable&&(B.value=``,await x(),U.value?.focus()))}function Z(e){R(`update:modelValue`,e),z.value=!1,B.value=``}return b(z,e=>{Y(e),e&&x(()=>J())}),p(()=>{Y(!1)}),(a,u)=>(y(),h(`div`,{id:l.id,ref_key:`rootRef`,ref:V,class:w([`admin-select`,{"admin-select--open":z.value,"admin-select--block":l.block}])},[f(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":l.ariaLabel,"aria-expanded":z.value,"aria-haspopup":`listbox`,onClick:X},[f(`span`,O,[g(a.$slots,`option-leading`,{option:G.value},void 0,!0),f(`span`,k,t(K.value),1)]),f(`span`,A,[C(o,{name:`chevron-down`,size:16})])],8,D),(y(),s(d,{to:`body`},[z.value?(y(),h(`ul`,{key:0,ref_key:`menuRef`,ref:H,class:`admin-select__menu`,role:`listbox`,"aria-label":l.ariaLabel,style:c(W.value)},[l.searchable?(y(),h(`li`,M,[_(f(`input`,{ref_key:`searchInputRef`,ref:U,"onUpdate:modelValue":u[0]||=e=>B.value=e,type:`search`,class:`admin-select__search-input`,placeholder:l.searchPlaceholder,onClick:u[1]||=S(()=>{},[`stop`]),onKeydown:u[2]||=i(S(e=>z.value=!1,[`stop`]),[`esc`])},null,40,N),[[n,B.value]])])):e(``,!0),q.value.length?e(``,!0):(y(),h(`li`,P,` موردی یافت نشد `)),(y(!0),h(r,null,m(q.value,n=>(y(),h(`li`,{key:n.value,role:`presentation`},[f(`button`,{type:`button`,class:w([`admin-select__option`,{"admin-select__option--active":n.value===l.modelValue}]),role:`option`,"aria-selected":n.value===l.modelValue,onClick:e=>Z(n.value)},[f(`span`,I,[g(a.$slots,`option-leading`,{option:n},void 0,!0),f(`span`,null,t(n.label),1)]),n.value===l.modelValue?(y(),s(o,{key:0,name:`check`,size:16,class:`admin-select__check`})):e(``,!0)],10,F)]))),128))],12,j)):e(``,!0)]))],10,E))}}),[[`__scopeId`,`data-v-4623e322`]]);export{L as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
.admin-select[data-v-7f43c8c3]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-7f43c8c3]{width:100%;min-width:0}.admin-select__trigger[data-v-7f43c8c3]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-7f43c8c3]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-7f43c8c3],.admin-select__trigger[data-v-7f43c8c3]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__value[data-v-7f43c8c3]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__chevron[data-v-7f43c8c3]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-7f43c8c3]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-7f43c8c3]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-7f43c8c3]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-7f43c8c3]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-7f43c8c3]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-7f43c8c3]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-7f43c8c3]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-7f43c8c3]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-7f43c8c3]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-7f43c8c3]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-7f43c8c3]{color:var(--color-primary);flex-shrink:0}
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,P as n,Q as r,St as i,X as a,bt as o,ct as s,dt as c,nt as l,rt as u}from"./index-9Ae_VOzQ.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=t(u({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(t){return(u,h)=>(s(),e(`div`,{class:o([`base-empty`,{"base-empty--compact":t.compact}])},[a(`div`,d,[l(n,{name:t.icon,size:t.compact?28:36},null,8,[`name`,`size`])]),a(`h3`,f,i(t.title),1),t.description?(s(),e(`p`,p,i(t.description),1)):r(``,!0),u.$slots.default||u.$slots.secondary?(s(),e(`div`,m,[c(u.$slots,`default`,{},void 0,!0),c(u.$slots,`secondary`,{},void 0,!0)])):r(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,Ct as t,P as n,V as r,Z as i,et as a,ft as o,it as s,lt as c,rt as l,xt as u}from"./index-Ce0o2VuJ.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=r(s({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(r){return(s,h)=>(c(),a(`div`,{class:u([`base-empty`,{"base-empty--compact":r.compact}])},[i(`div`,d,[l(n,{name:r.icon,size:r.compact?28:36},null,8,[`name`,`size`])]),i(`h3`,f,t(r.title),1),r.description?(c(),a(`p`,p,t(r.description),1)):e(``,!0),s.$slots.default||s.$slots.secondary?(c(),a(`div`,m,[o(s.$slots,`default`,{},void 0,!0),o(s.$slots,`secondary`,{},void 0,!0)])):e(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,Ct as t,V as n,X as r,Z as i,et as a,it as o,lt as s,xt as c}from"./index-Ce0o2VuJ.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=n(o({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(n,{emit:o}){let g=n,_=o,v=r(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=r(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(r,o)=>(s(),a(`label`,{class:c([`base-switch`,{"base-switch--disabled":n.disabled||n.loading,"base-switch--error":n.error}]),title:y.value},[n.label?(s(),a(`span`,u,t(n.label),1)):e(``,!0),i(`span`,d,[i(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:n.modelValue,disabled:n.disabled||n.loading,"aria-checked":n.modelValue,"aria-label":n.label||y.value,onChange:b},null,40,f),i(`span`,p,[i(`span`,m,[n.loading?(s(),a(`span`,h)):e(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,Q as n,St as r,X as i,Y as a,bt as o,ct as s,rt as c}from"./index-9Ae_VOzQ.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=t(c({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(t,{emit:c}){let g=t,_=c,v=a(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=a(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(a,c)=>(s(),e(`label`,{class:o([`base-switch`,{"base-switch--disabled":t.disabled||t.loading,"base-switch--error":t.error}]),title:y.value},[t.label?(s(),e(`span`,u,r(t.label),1)):n(``,!0),i(`span`,d,[i(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:t.modelValue,disabled:t.disabled||t.loading,"aria-checked":t.modelValue,"aria-label":t.label||y.value,onChange:b},null,40,f),i(`span`,p,[i(`span`,m,[t.loading?(s(),e(`span`,h)):n(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{Ct as e,G as t,J as n,N as r,Q as i,R as a,V as o,X as s,Z as c,dt as l,et as u,gt as d,ht as f,it as p,lt as m,nt as h,rt as g,st as _,u as v,vt as y,yt as b,z as x}from"./index-Ce0o2VuJ.js";import{t as S}from"./AdminPageSkeleton-CeCa2h-t.js";import{t as C}from"./BaseSwitch-C9HY6KUs.js";import{t as w}from"./BaseEmptyState-SjEY4tIJ.js";var T={class:`admin-page`},E={key:2,class:`admin-table`},D={dir:`ltr`},O=[`onClick`],k={class:`field`},A={class:`field`},j={class:`field`},M={class:`field`},N=[`disabled`],P=o(p({__name:`BrandsView`,setup(o){let p=b([]),P=b(!0),F=b(!1),I=b(null),L=x(),R=y({name:``,slug:``,description:``,displayOrder:0,isActive:!0}),z=s(()=>I.value?`ویرایش برند`:`افزودن برند`);async function B(){P.value=!0;try{p.value=await v.list()}catch(e){L.error(e instanceof r?e.message:`بارگذاری برندها ناموفق بود`)}finally{P.value=!1}}function V(){I.value=null,Object.assign(R,{name:``,slug:``,description:``,displayOrder:p.value.length+1,isActive:!0}),F.value=!0}function H(e){I.value=e.id,Object.assign(R,{name:e.name,slug:e.slug??``,description:e.description??``,displayOrder:e.displayOrder,isActive:e.isActive}),F.value=!0}async function U(){try{let e={name:R.name.trim(),slug:R.slug.trim()||void 0,description:R.description.trim()||void 0,displayOrder:R.displayOrder,isActive:R.isActive};I.value?await v.update(I.value,e):await v.create(e),F.value=!1,L.success(`ذخیره شد`),await B()}catch(e){L.error(e instanceof r?e.message:`ذخیره ناموفق بود`)}}return _(()=>{B()}),(r,o)=>(m(),u(`div`,T,[c(`header`,{class:`admin-page__head`},[o[6]||=c(`div`,null,[c(`h1`,null,`برندها`)],-1),c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`افزودن برند`)]),P.value?(m(),i(S,{key:0,variant:`table`})):p.value.length?(m(),u(`table`,E,[o[7]||=c(`thead`,null,[c(`tr`,null,[c(`th`,null,`نام`),c(`th`,null,`شناسه لاتین`),c(`th`,null,`مشتریان`),c(`th`,null,`فعال`),c(`th`)])],-1),c(`tbody`,null,[(m(!0),u(n,null,l(p.value,t=>(m(),u(`tr`,{key:t.id},[c(`td`,null,e(t.name),1),c(`td`,D,e(t.slug||`—`),1),c(`td`,null,e(t.customersCount??0),1),c(`td`,null,e(t.isActive?`بله`:`خیر`),1),c(`td`,null,[c(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,O)])]))),128))])])):(m(),i(w,{key:1,title:`برندی ثبت نشده`})),g(a,{open:F.value,title:z.value,onClose:o[5]||=e=>F.value=!1},{footer:f(()=>[c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!R.name.trim(),onClick:U},`ذخیره`,8,N)]),default:f(()=>[c(`label`,k,[o[8]||=h(`نام`,-1),d(c(`input`,{"onUpdate:modelValue":o[0]||=e=>R.name=e,class:`admin-input`},null,512),[[t,R.name]])]),c(`label`,A,[o[9]||=h(`شناسه لاتین`,-1),d(c(`input`,{"onUpdate:modelValue":o[1]||=e=>R.slug=e,class:`admin-input`,dir:`ltr`,placeholder:`مثلاً nademi-silk`},null,512),[[t,R.slug]])]),c(`label`,j,[o[10]||=h(`توضیح`,-1),d(c(`textarea`,{"onUpdate:modelValue":o[2]||=e=>R.description=e,class:`admin-input`,rows:`3`},null,512),[[t,R.description]])]),c(`label`,M,[o[11]||=h(`ترتیب`,-1),d(c(`input`,{"onUpdate:modelValue":o[3]||=e=>R.displayOrder=e,type:`number`,class:`admin-input`},null,512),[[t,R.displayOrder,void 0,{number:!0}]])]),g(C,{modelValue:R.isActive,"onUpdate:modelValue":o[4]||=e=>R.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-88043806`]]);export{P as default};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,N as n,R as r,St as i,W as a,X as o,Y as s,Z as c,_t as l,ct as u,ht as d,mt as f,nt as p,ot as m,q as h,rt as g,tt as _,u as v,ut as y,vt as b,z as x}from"./index-9Ae_VOzQ.js";import{t as S}from"./AdminPageSkeleton-CKg1wrlm.js";import{t as C}from"./BaseSwitch-D8k_9W00.js";import{t as w}from"./BaseEmptyState-DLwJ8N61.js";var T={class:`admin-page`},E={key:2,class:`admin-table`},D={dir:`ltr`},O=[`onClick`],k={class:`field`},A={class:`field`},j={class:`field`},M={class:`field`},N=[`disabled`],P=t(g({__name:`BrandsView`,setup(t){let g=b([]),P=b(!0),F=b(!1),I=b(null),L=x(),R=l({name:``,slug:``,description:``,displayOrder:0,isActive:!0}),z=s(()=>I.value?`ویرایش برند`:`افزودن برند`);async function B(){P.value=!0;try{g.value=await v.list()}catch(e){L.error(e instanceof n?e.message:`بارگذاری برندها ناموفق بود`)}finally{P.value=!1}}function V(){I.value=null,Object.assign(R,{name:``,slug:``,description:``,displayOrder:g.value.length+1,isActive:!0}),F.value=!0}function H(e){I.value=e.id,Object.assign(R,{name:e.name,slug:e.slug??``,description:e.description??``,displayOrder:e.displayOrder,isActive:e.isActive}),F.value=!0}async function U(){try{let e={name:R.name.trim(),slug:R.slug.trim()||void 0,description:R.description.trim()||void 0,displayOrder:R.displayOrder,isActive:R.isActive};I.value?await v.update(I.value,e):await v.create(e),F.value=!1,L.success(`ذخیره شد`),await B()}catch(e){L.error(e instanceof n?e.message:`ذخیره ناموفق بود`)}}return m(()=>{B()}),(t,n)=>(u(),e(`div`,T,[o(`header`,{class:`admin-page__head`},[n[6]||=o(`div`,null,[o(`h1`,null,`برندها`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`افزودن برند`)]),P.value?(u(),c(S,{key:0,variant:`table`})):g.value.length?(u(),e(`table`,E,[n[7]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`نام`),o(`th`,null,`شناسه لاتین`),o(`th`,null,`مشتریان`),o(`th`,null,`فعال`),o(`th`)])],-1),o(`tbody`,null,[(u(!0),e(h,null,y(g.value,t=>(u(),e(`tr`,{key:t.id},[o(`td`,null,i(t.name),1),o(`td`,D,i(t.slug||`—`),1),o(`td`,null,i(t.customersCount??0),1),o(`td`,null,i(t.isActive?`بله`:`خیر`),1),o(`td`,null,[o(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,O)])]))),128))])])):(u(),c(w,{key:1,title:`برندی ثبت نشده`})),p(r,{open:F.value,title:z.value,onClose:n[5]||=e=>F.value=!1},{footer:f(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!R.name.trim(),onClick:U},`ذخیره`,8,N)]),default:f(()=>[o(`label`,k,[n[8]||=_(`نام`,-1),d(o(`input`,{"onUpdate:modelValue":n[0]||=e=>R.name=e,class:`admin-input`},null,512),[[a,R.name]])]),o(`label`,A,[n[9]||=_(`شناسه لاتین`,-1),d(o(`input`,{"onUpdate:modelValue":n[1]||=e=>R.slug=e,class:`admin-input`,dir:`ltr`,placeholder:`مثلاً nademi-silk`},null,512),[[a,R.slug]])]),o(`label`,j,[n[10]||=_(`توضیح`,-1),d(o(`textarea`,{"onUpdate:modelValue":n[2]||=e=>R.description=e,class:`admin-input`,rows:`3`},null,512),[[a,R.description]])]),o(`label`,M,[n[11]||=_(`ترتیب`,-1),d(o(`input`,{"onUpdate:modelValue":n[3]||=e=>R.displayOrder=e,type:`number`,class:`admin-input`},null,512),[[a,R.displayOrder,void 0,{number:!0}]])]),p(C,{modelValue:R.isActive,"onUpdate:modelValue":n[4]||=e=>R.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-88043806`]]);export{P as default};
|
||||
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,Ct as t,J as n,N as r,Q as i,V as a,Z as o,bt as s,dt as c,et as l,f as u,i as d,it as f,lt as p,nt as m,rt as h,st as g,yt as _,z as v}from"./index-Ce0o2VuJ.js";import{t as y}from"./AdminPageSkeleton-CeCa2h-t.js";import{t as b}from"./BaseEmptyState-SjEY4tIJ.js";import{t as x}from"./AdminSelect-DW0RlAc0.js";var S={class:`admin-page`},C={class:`admin-page__head`},w={class:`request-card__top`},T={class:`muted`,dir:`ltr`},E={class:`badge`},D={key:0,class:`muted`},O={class:`admin-table`},k={dir:`ltr`},A={key:0,class:`movements`},j={class:`muted`},M=a(f({__name:`CatalogRequestsView`,setup(a){let f=[{value:``,label:`همه وضعیتها`},{value:`new`,label:`درخواست جدید`},{value:`approved`,label:`تأیید شده`},{value:`ready_to_ship`,label:`آماده ارسال`},{value:`delivered`,label:`تحویل به مشتری`},{value:`returned`,label:`بازگردانده شده`},{value:`cancelled`,label:`لغو شده`}],M=[{value:`warehouse`,label:`انبار`},{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],N=Object.fromEntries(f.filter(e=>e.value).map(e=>[e.value,e.label])),P=Object.fromEntries(M.map(e=>[e.value,e.label])),F=_([]),I=_(``),L=_(!0),R=_(null),z=v();async function B(){L.value=!0;try{F.value=await u.list(I.value||void 0)}catch(e){z.error(e instanceof r?e.message:`بارگذاری انجام نشد`)}finally{L.value=!1}}async function V(e,t){try{await u.updateStatus(e,t),z.success(`وضعیت بهروز شد`),await B()}catch(e){z.error(e instanceof r?e.message:`بهروزرسانی ناموفق بود`)}}async function H(e,t){if(!R.value){R.value=e;try{await u.updateHolder(e,{holderType:t}),z.success(`محل نگهداری بهروز شد`),await B()}catch(e){z.error(e instanceof r?e.message:`بهروزرسانی محل ناموفق بود`)}finally{R.value=null}}}function U(e){return P[e]??e}return g(()=>{B()}),(r,a)=>(p(),l(`div`,S,[o(`header`,C,[a[1]||=o(`div`,null,[o(`h1`,null,`درخواست کالیته فیزیکی`),o(`p`,null,`بررسی، گردش وضعیت و محل نگهداری اقلام`)],-1),h(x,{modelValue:I.value,"onUpdate:modelValue":[a[0]||=e=>I.value=e,B],options:f},null,8,[`modelValue`])]),L.value?(p(),i(y,{key:0,variant:`cards`})):F.value.length?(p(!0),l(n,{key:2},c(F.value,r=>(p(),l(`div`,{key:r.id,class:`request-card`},[o(`div`,w,[o(`div`,null,[o(`strong`,null,t(r.customerName),1),o(`span`,T,t(r.customerPhone),1),o(`span`,E,t(s(N)[r.status]??r.status),1)]),h(x,{"model-value":r.status,options:f.filter(e=>e.value),"onUpdate:modelValue":e=>V(r.id,String(e))},null,8,[`model-value`,`options`,`onUpdate:modelValue`])]),r.note?(p(),l(`p`,D,t(r.note),1)):e(``,!0),o(`table`,O,[a[2]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`محصول`),o(`th`,null,`کد`),o(`th`,null,`تعداد`),o(`th`,null,`محل`)])],-1),o(`tbody`,null,[(p(!0),l(n,null,c(r.items,r=>(p(),l(`tr`,{key:r.id},[o(`td`,null,t(r.productName),1),o(`td`,k,t(r.productCode),1),o(`td`,null,t(r.quantity),1),o(`td`,null,[h(x,{"model-value":r.holderType,options:M,"onUpdate:modelValue":e=>H(r.id,String(e))},null,8,[`model-value`,`onUpdate:modelValue`]),r.movements?.length?(p(),l(`ul`,A,[(p(!0),l(n,null,c(r.movements,e=>(p(),l(`li`,{key:e.id},[m(t(U(e.fromHolder))+` → `+t(U(e.toHolder))+` `,1),o(`span`,j,t(s(d)(e.movedAt)),1)]))),128))])):e(``,!0)])]))),128))])])]))),128)):(p(),i(b,{key:1,title:`درخواستی نیست`}))]))}}),[[`__scopeId`,`data-v-747d8f88`]]);export{M as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,N as n,Q as r,St as i,X as a,Z as o,ct as s,f as c,i as l,nt as u,ot as d,q as f,rt as p,tt as m,ut as h,vt as g,yt as _,z as v}from"./index-9Ae_VOzQ.js";import{t as y}from"./AdminPageSkeleton-CKg1wrlm.js";import{t as b}from"./BaseEmptyState-DLwJ8N61.js";import{t as x}from"./AdminSelect-BCHHmDtL.js";var S={class:`admin-page`},C={class:`admin-page__head`},w={class:`request-card__top`},T={class:`muted`,dir:`ltr`},E={class:`badge`},D={key:0,class:`muted`},O={class:`admin-table`},k={dir:`ltr`},A={key:0,class:`movements`},j={class:`muted`},M=t(p({__name:`CatalogRequestsView`,setup(t){let p=[{value:``,label:`همه وضعیتها`},{value:`new`,label:`درخواست جدید`},{value:`approved`,label:`تأیید شده`},{value:`ready_to_ship`,label:`آماده ارسال`},{value:`delivered`,label:`تحویل به مشتری`},{value:`returned`,label:`بازگردانده شده`},{value:`cancelled`,label:`لغو شده`}],M=[{value:`warehouse`,label:`انبار`},{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],N=Object.fromEntries(p.filter(e=>e.value).map(e=>[e.value,e.label])),P=Object.fromEntries(M.map(e=>[e.value,e.label])),F=g([]),I=g(``),L=g(!0),R=g(null),z=v();async function B(){L.value=!0;try{F.value=await c.list(I.value||void 0)}catch(e){z.error(e instanceof n?e.message:`بارگذاری انجام نشد`)}finally{L.value=!1}}async function V(e,t){try{await c.updateStatus(e,t),z.success(`وضعیت بهروز شد`),await B()}catch(e){z.error(e instanceof n?e.message:`بهروزرسانی ناموفق بود`)}}async function H(e,t){if(!R.value){R.value=e;try{await c.updateHolder(e,{holderType:t}),z.success(`محل نگهداری بهروز شد`),await B()}catch(e){z.error(e instanceof n?e.message:`بهروزرسانی محل ناموفق بود`)}finally{R.value=null}}}function U(e){return P[e]??e}return d(()=>{B()}),(t,n)=>(s(),e(`div`,S,[a(`header`,C,[n[1]||=a(`div`,null,[a(`h1`,null,`درخواست کالیته فیزیکی`),a(`p`,null,`بررسی، گردش وضعیت و محل نگهداری اقلام`)],-1),u(x,{modelValue:I.value,"onUpdate:modelValue":[n[0]||=e=>I.value=e,B],options:p},null,8,[`modelValue`])]),L.value?(s(),o(y,{key:0,variant:`cards`})):F.value.length?(s(!0),e(f,{key:2},h(F.value,t=>(s(),e(`div`,{key:t.id,class:`request-card`},[a(`div`,w,[a(`div`,null,[a(`strong`,null,i(t.customerName),1),a(`span`,T,i(t.customerPhone),1),a(`span`,E,i(_(N)[t.status]??t.status),1)]),u(x,{"model-value":t.status,options:p.filter(e=>e.value),"onUpdate:modelValue":e=>V(t.id,String(e))},null,8,[`model-value`,`options`,`onUpdate:modelValue`])]),t.note?(s(),e(`p`,D,i(t.note),1)):r(``,!0),a(`table`,O,[n[2]||=a(`thead`,null,[a(`tr`,null,[a(`th`,null,`محصول`),a(`th`,null,`کد`),a(`th`,null,`تعداد`),a(`th`,null,`محل`)])],-1),a(`tbody`,null,[(s(!0),e(f,null,h(t.items,t=>(s(),e(`tr`,{key:t.id},[a(`td`,null,i(t.productName),1),a(`td`,k,i(t.productCode),1),a(`td`,null,i(t.quantity),1),a(`td`,null,[u(x,{"model-value":t.holderType,options:M,"onUpdate:modelValue":e=>H(t.id,String(e))},null,8,[`model-value`,`onUpdate:modelValue`]),t.movements?.length?(s(),e(`ul`,A,[(s(!0),e(f,null,h(t.movements,t=>(s(),e(`li`,{key:t.id},[m(i(U(t.fromHolder))+` → `+i(U(t.toHolder))+` `,1),a(`span`,j,i(_(l)(t.movedAt)),1)]))),128))])):r(``,!0)])]))),128))])])]))),128)):(s(),o(b,{key:1,title:`درخواستی نیست`}))]))}}),[[`__scopeId`,`data-v-747d8f88`]]);export{M as default};
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.category-icon[data-v-76e4dc13]{color:var(--color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.admin-page-header__sub[data-v-092c0b6f]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-092c0b6f]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-092c0b6f]{padding:20px}.categories-panel__head[data-v-092c0b6f]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-092c0b6f]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-092c0b6f]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-092c0b6f]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-092c0b6f]{gap:12px;display:grid}.category-row[data-v-092c0b6f]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-092c0b6f]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-092c0b6f]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__line[data-v-092c0b6f] .admin-select{min-width:0}.category-row__id[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-092c0b6f]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-092c0b6f] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-092c0b6f]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-092c0b6f]{grid-template-columns:1fr}.category-row__remove[data-v-092c0b6f]{justify-self:start}}
|
||||
-1
@@ -1 +0,0 @@
|
||||
.admin-page-header__sub[data-v-bdf23952]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-bdf23952]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-bdf23952]{padding:20px}.categories-panel__head[data-v-bdf23952]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-bdf23952]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-bdf23952]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-bdf23952]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-bdf23952]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-bdf23952]{gap:12px;display:grid}.category-row[data-v-bdf23952]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-bdf23952]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-bdf23952]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__id[data-v-bdf23952]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-bdf23952]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-bdf23952] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-bdf23952]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-bdf23952]{grid-template-columns:1fr}.category-row__remove[data-v-bdf23952]{justify-self:start}}
|
||||
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import{Ct as e,G as t,J as n,N as r,Q as i,R as a,V as o,X as s,Z as c,dt as l,et as u,gt as d,ht as f,it as p,lt as m,nt as h,rt as g,st as _,v,vt as y,yt as b,z as x}from"./index-Ce0o2VuJ.js";import{t as S}from"./AdminPageSkeleton-CeCa2h-t.js";import{t as C}from"./BaseEmptyState-SjEY4tIJ.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=o(p({__name:`LevelsView`,setup(o){let p=b([]),N=b(!0),P=b(!1),F=b(null),I=x(),L=y({code:``,label:``,sortOrder:0,benefitsText:``}),R=s(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
|
||||
`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{p.value=await v.list()}catch(e){I.error(e instanceof r?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:p.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
|
||||
`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await v.update(F.value,e):await v.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof r?e.message:`ذخیره ناموفق بود`)}}return _(()=>{B()}),(r,o)=>(m(),u(`div`,w,[c(`header`,{class:`admin-page__head`},[o[5]||=c(`div`,null,[c(`h1`,null,`سطوح و مزایای مشتری`),c(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(m(),i(S,{key:0,variant:`table`})):p.value.length?(m(),u(`table`,T,[o[6]||=c(`thead`,null,[c(`tr`,null,[c(`th`,null,`کد`),c(`th`,null,`عنوان`),c(`th`,null,`مزایا`),c(`th`,null,`مشتریان`),c(`th`)])],-1),c(`tbody`,null,[(m(!0),u(n,null,l(p.value,t=>(m(),u(`tr`,{key:t.id},[c(`td`,E,e(t.code),1),c(`td`,null,e(t.label),1),c(`td`,null,e(t.benefits.map(e=>e.title).join(`، `)||`—`),1),c(`td`,null,e(t.customersCount),1),c(`td`,null,[c(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,D)])]))),128))])])):(m(),i(C,{key:1,title:`سطحی تعریف نشده`})),g(a,{open:P.value,title:R.value,onClose:o[4]||=e=>P.value=!1},{footer:f(()=>[c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:f(()=>[c(`label`,O,[o[7]||=h(`کد`,-1),d(c(`input`,{"onUpdate:modelValue":o[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[t,L.code]])]),c(`label`,k,[o[8]||=h(`عنوان`,-1),d(c(`input`,{"onUpdate:modelValue":o[1]||=e=>L.label=e,class:`admin-input`},null,512),[[t,L.label]])]),c(`label`,A,[o[9]||=h(`ترتیب`,-1),d(c(`input`,{"onUpdate:modelValue":o[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[t,L.sortOrder,void 0,{number:!0}]])]),c(`label`,j,[o[10]||=h(` مزایا (هر خط یک مورد) `,-1),d(c(`textarea`,{"onUpdate:modelValue":o[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[t,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import{$ as e,B as t,N as n,R as r,St as i,W as a,X as o,Y as s,Z as c,_t as l,ct as u,ht as d,mt as f,nt as p,ot as m,q as h,rt as g,tt as _,ut as v,v as y,vt as b,z as x}from"./index-9Ae_VOzQ.js";import{t as S}from"./AdminPageSkeleton-CKg1wrlm.js";import{t as C}from"./BaseEmptyState-DLwJ8N61.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=t(g({__name:`LevelsView`,setup(t){let g=b([]),N=b(!0),P=b(!1),F=b(null),I=x(),L=l({code:``,label:``,sortOrder:0,benefitsText:``}),R=s(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
|
||||
`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{g.value=await y.list()}catch(e){I.error(e instanceof n?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:g.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
|
||||
`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await y.update(F.value,e):await y.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof n?e.message:`ذخیره ناموفق بود`)}}return m(()=>{B()}),(t,n)=>(u(),e(`div`,w,[o(`header`,{class:`admin-page__head`},[n[5]||=o(`div`,null,[o(`h1`,null,`سطوح و مزایای مشتری`),o(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(u(),c(S,{key:0,variant:`table`})):g.value.length?(u(),e(`table`,T,[n[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`کد`),o(`th`,null,`عنوان`),o(`th`,null,`مزایا`),o(`th`,null,`مشتریان`),o(`th`)])],-1),o(`tbody`,null,[(u(!0),e(h,null,v(g.value,t=>(u(),e(`tr`,{key:t.id},[o(`td`,E,i(t.code),1),o(`td`,null,i(t.label),1),o(`td`,null,i(t.benefits.map(e=>e.title).join(`، `)||`—`),1),o(`td`,null,i(t.customersCount),1),o(`td`,null,[o(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,D)])]))),128))])])):(u(),c(C,{key:1,title:`سطحی تعریف نشده`})),p(r,{open:P.value,title:R.value,onClose:n[4]||=e=>P.value=!1},{footer:f(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:f(()=>[o(`label`,O,[n[7]||=_(`کد`,-1),d(o(`input`,{"onUpdate:modelValue":n[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[a,L.code]])]),o(`label`,k,[n[8]||=_(`عنوان`,-1),d(o(`input`,{"onUpdate:modelValue":n[1]||=e=>L.label=e,class:`admin-input`},null,512),[[a,L.label]])]),o(`label`,A,[n[9]||=_(`ترتیب`,-1),d(o(`input`,{"onUpdate:modelValue":n[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[a,L.sortOrder,void 0,{number:!0}]])]),o(`label`,j,[n[10]||=_(` مزایا (هر خط یک مورد) `,-1),d(o(`textarea`,{"onUpdate:modelValue":n[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[a,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{$ as e,A as t,Ct as n,F as r,G as i,H as a,I as o,M as s,P as c,U as l,V as u,X as d,Z as f,bt as p,et as m,gt as h,it as g,j as _,lt as v,nt as y,q as b,rt as x,tt as S,yt as C,z as w}from"./index-Ce0o2VuJ.js";var T={class:`login-page`},E={class:`login-page__form-wrap`},D={class:`login-page__card admin-card`},O={class:`login-page__header`},k={key:0,class:`login-page__mock-hint`},A={dir:`ltr`},j={dir:`ltr`},M={key:0,class:`admin-form__error`,role:`alert`},N={class:`admin-form__field`},P={class:`login-page__input-wrap`},F={class:`login-page__field-icon`,"aria-hidden":`true`},I={class:`admin-form__field`},L={class:`login-page__input-wrap login-page__input-wrap--password`},R={class:`login-page__field-icon`,"aria-hidden":`true`},z=[`type`],B=[`aria-label`],V={class:`login-page__remember`},H=[`disabled`],U={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},W=u(g({__name:`LoginView`,setup(u){let g=o(),W=r(),G=t(),K=w(),q=C(s()?_.phone:``),J=C(s()?_.password:``),Y=C(!0),X=C(!1),Z=s(),Q=d(()=>q.value.trim().length>0&&J.value.length>0);function $(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function ee(){if(!Q.value){G.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await G.login($(q.value.trim()),J.value,Y.value))return;K.success(`خوش آمدید، ${G.fullName}`);let e=typeof W.query.redirect==`string`?W.query.redirect:`/`;g.replace(e)}return(t,r)=>(v(),m(`div`,T,[f(`div`,E,[f(`div`,D,[f(`div`,O,[r[8]||=f(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),r[9]||=f(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),p(Z)?(v(),m(`p`,k,[r[6]||=y(` حالت موک فعال است — `,-1),f(`span`,A,n(p(_).phone),1),r[7]||=y(` / `,-1),f(`span`,j,n(p(_).password),1)])):e(``,!0)]),f(`form`,{class:`admin-form login-page__form`,onSubmit:b(ee,[`prevent`])},[p(G).error?(v(),m(`p`,M,n(p(G).error),1)):e(``,!0),f(`div`,N,[r[10]||=f(`label`,{for:`login-phone`},`شماره موبایل`,-1),f(`div`,P,[f(`span`,F,[x(c,{name:`phone`,size:18})]),h(f(`input`,{id:`login-phone`,"onUpdate:modelValue":r[0]||=e=>q.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:r[1]||=e=>p(G).clearError()},null,544),[[i,q.value]])])]),f(`div`,I,[r[11]||=f(`label`,{for:`login-password`},`رمز عبور`,-1),f(`div`,L,[f(`span`,R,[x(c,{name:`lock`,size:18})]),h(f(`input`,{id:`login-password`,"onUpdate:modelValue":r[2]||=e=>J.value=e,type:X.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:r[3]||=e=>p(G).clearError()},null,40,z),[[l,J.value]]),f(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":X.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:r[4]||=e=>X.value=!X.value},[x(c,{name:X.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,B)])]),f(`label`,V,[h(f(`input`,{"onUpdate:modelValue":r[5]||=e=>Y.value=e,type:`checkbox`},null,512),[[a,Y.value]]),r[12]||=f(`span`,null,`مرا به خاطر بسپار`,-1)]),f(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Q.value||p(G).loading},[p(G).loading?(v(),m(`span`,U)):e(``,!0),r[13]||=y(` ورود به پنل `,-1)],8,H)],32)])]),r[14]||=S(`<div class="login-page__brand" data-v-3c4fbd85><div class="login-page__brand-inner" data-v-3c4fbd85><p class="login-page__brand-badge" data-v-3c4fbd85>پارچه</p><h1 class="login-page__brand-title" data-v-3c4fbd85>پنل مدیریت سفارشهای عمده</h1><p class="login-page__brand-text" data-v-3c4fbd85> مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. </p></div></div>`,1)]))}}),[[`__scopeId`,`data-v-3c4fbd85`]]);export{W as default};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,A as t,B as n,F as r,H as i,I as a,K as o,M as s,P as c,Q as l,St as u,V as d,W as f,X as p,Y as m,ct as h,et as g,ht as _,j as v,nt as y,rt as b,tt as x,vt as S,yt as C,z as w}from"./index-9Ae_VOzQ.js";var T={class:`login-page`},E={class:`login-page__form-wrap`},D={class:`login-page__card admin-card`},O={class:`login-page__header`},k={key:0,class:`login-page__mock-hint`},A={dir:`ltr`},j={dir:`ltr`},M={key:0,class:`admin-form__error`,role:`alert`},N={class:`admin-form__field`},P={class:`login-page__input-wrap`},F={class:`login-page__field-icon`,"aria-hidden":`true`},I={class:`admin-form__field`},L={class:`login-page__input-wrap login-page__input-wrap--password`},R={class:`login-page__field-icon`,"aria-hidden":`true`},z=[`type`],B=[`aria-label`],V={class:`login-page__remember`},H=[`disabled`],U={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},W=n(b({__name:`LoginView`,setup(n){let b=a(),W=r(),G=t(),K=w(),q=S(s()?v.phone:``),J=S(s()?v.password:``),Y=S(!0),X=S(!1),Z=s(),Q=m(()=>q.value.trim().length>0&&J.value.length>0);function $(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function ee(){if(!Q.value){G.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await G.login($(q.value.trim()),J.value,Y.value))return;K.success(`خوش آمدید، ${G.fullName}`);let e=typeof W.query.redirect==`string`?W.query.redirect:`/`;b.replace(e)}return(t,n)=>(h(),e(`div`,T,[p(`div`,E,[p(`div`,D,[p(`div`,O,[n[8]||=p(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),n[9]||=p(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),C(Z)?(h(),e(`p`,k,[n[6]||=x(` حالت موک فعال است — `,-1),p(`span`,A,u(C(v).phone),1),n[7]||=x(` / `,-1),p(`span`,j,u(C(v).password),1)])):l(``,!0)]),p(`form`,{class:`admin-form login-page__form`,onSubmit:o(ee,[`prevent`])},[C(G).error?(h(),e(`p`,M,u(C(G).error),1)):l(``,!0),p(`div`,N,[n[10]||=p(`label`,{for:`login-phone`},`شماره موبایل`,-1),p(`div`,P,[p(`span`,F,[y(c,{name:`phone`,size:18})]),_(p(`input`,{id:`login-phone`,"onUpdate:modelValue":n[0]||=e=>q.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:n[1]||=e=>C(G).clearError()},null,544),[[f,q.value]])])]),p(`div`,I,[n[11]||=p(`label`,{for:`login-password`},`رمز عبور`,-1),p(`div`,L,[p(`span`,R,[y(c,{name:`lock`,size:18})]),_(p(`input`,{id:`login-password`,"onUpdate:modelValue":n[2]||=e=>J.value=e,type:X.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:n[3]||=e=>C(G).clearError()},null,40,z),[[i,J.value]]),p(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":X.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:n[4]||=e=>X.value=!X.value},[y(c,{name:X.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,B)])]),p(`label`,V,[_(p(`input`,{"onUpdate:modelValue":n[5]||=e=>Y.value=e,type:`checkbox`},null,512),[[d,Y.value]]),n[12]||=p(`span`,null,`مرا به خاطر بسپار`,-1)]),p(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Q.value||C(G).loading},[C(G).loading?(h(),e(`span`,U)):l(``,!0),n[13]||=x(` ورود به پنل `,-1)],8,H)],32)])]),n[14]||=g(`<div class="login-page__brand" data-v-3c4fbd85><div class="login-page__brand-inner" data-v-3c4fbd85><p class="login-page__brand-badge" data-v-3c4fbd85>پارچه</p><h1 class="login-page__brand-title" data-v-3c4fbd85>پنل مدیریت سفارشهای عمده</h1><p class="login-page__brand-text" data-v-3c4fbd85> مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. </p></div></div>`,1)]))}}),[[`__scopeId`,`data-v-3c4fbd85`]]);export{W as default};
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,St as n,bt as r,ct as i,rt as a,yt as o}from"./index-9Ae_VOzQ.js";import{t as s}from"./orderStatus-CYVblRJB.js";var c=t(a({__name:`StatusBadge`,props:{status:{}},setup(t){let a={active:{label:`فعال`,tone:`success`},inactive:{label:`غیرفعال`,tone:`neutral`},pending_check_review:{label:`در انتظار بررسی`,tone:`warning`},check_approved:{label:`تأیید شده`,tone:`success`},check_rejected:{label:`رد شده`,tone:`danger`}};return(c,l)=>(i(),e(`span`,{class:r([`admin-badge status-badge`,`admin-badge--${(o(s)[t.status]??a[t.status])?.tone??`neutral`}`])},n((o(s)[t.status]??a[t.status])?.label??t.status),3))}}),[[`__scopeId`,`data-v-23aa055a`]]);export{c as t};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{Ct as e,V as t,bt as n,et as r,it as i,lt as a,xt as o}from"./index-Ce0o2VuJ.js";import{t as s}from"./orderStatus-CYVblRJB.js";var c=t(i({__name:`StatusBadge`,props:{status:{}},setup(t){let i={active:{label:`فعال`,tone:`success`},inactive:{label:`غیرفعال`,tone:`neutral`},pending_check_review:{label:`در انتظار بررسی`,tone:`warning`},check_approved:{label:`تأیید شده`,tone:`success`},check_rejected:{label:`رد شده`,tone:`danger`}};return(c,l)=>(a(),r(`span`,{class:o([`admin-badge status-badge`,`admin-badge--${(n(s)[t.status]??i[t.status])?.tone??`neutral`}`])},e((n(s)[t.status]??i[t.status])?.label??t.status),3))}}),[[`__scopeId`,`data-v-23aa055a`]]);export{c as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{Ct as e,E as t,J as n,N as r,Q as i,V as a,Z as o,dt as s,et as c,it as l,lt as u,nt as d,st as f,yt as p,z as m}from"./index-Ce0o2VuJ.js";import{t as h}from"./AdminPageSkeleton-CeCa2h-t.js";import{t as g}from"./BaseEmptyState-SjEY4tIJ.js";var _={class:`admin-page`},v={key:2,class:`admin-table`},y={class:`muted`,dir:`ltr`},b={class:`muted`,dir:`ltr`},x=[`onClick`],S=a(l({__name:`StockAlertsView`,setup(a){let l=p([]),S=p(!0),C=m();async function w(){S.value=!0;try{l.value=await t.list()}catch(e){C.error(e instanceof r?e.message:`بارگذاری ناموفق بود`)}finally{S.value=!1}}async function T(e){try{await t.notify(e),C.success(`اعلان موجودی ارسال شد`),await w()}catch(e){C.error(e instanceof r?e.message:`ارسال ناموفق بود`)}}return f(()=>{w()}),(t,r)=>(u(),c(`div`,_,[r[1]||=o(`header`,{class:`admin-page__head`},[o(`div`,null,[o(`h1`,null,`درخواست خبر موجودی`),o(`p`,null,`مشتریانی که برای محصول ناموجود درخواست اطلاع دادهاند`)])],-1),S.value?(u(),i(h,{key:0,variant:`table`})):l.value.length?(u(),c(`table`,v,[r[0]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`مشتری`),o(`th`,null,`محصول`),o(`th`,null,`موجودی فعلی`),o(`th`)])],-1),o(`tbody`,null,[(u(!0),c(n,null,s(l.value,t=>(u(),c(`tr`,{key:t.id},[o(`td`,null,[d(e(t.customerName)+` `,1),o(`span`,y,e(t.customerPhone),1)]),o(`td`,null,[d(e(t.productName)+` `,1),o(`span`,b,`(`+e(t.productCode)+`)`,1)]),o(`td`,null,e(t.stock??`—`),1),o(`td`,null,[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:e=>T(t.id)},`ارسال اعلان`,8,x)])]))),128))])])):(u(),i(g,{key:1,title:`درخواستی فعال نیست`}))]))}}),[[`__scopeId`,`data-v-61131544`]]);export{S as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,E as n,N as r,St as i,X as a,Z as o,ct as s,ot as c,q as l,rt as u,tt as d,ut as f,vt as p,z as m}from"./index-9Ae_VOzQ.js";import{t as h}from"./AdminPageSkeleton-CKg1wrlm.js";import{t as g}from"./BaseEmptyState-DLwJ8N61.js";var _={class:`admin-page`},v={key:2,class:`admin-table`},y={class:`muted`,dir:`ltr`},b={class:`muted`,dir:`ltr`},x=[`onClick`],S=t(u({__name:`StockAlertsView`,setup(t){let u=p([]),S=p(!0),C=m();async function w(){S.value=!0;try{u.value=await n.list()}catch(e){C.error(e instanceof r?e.message:`بارگذاری ناموفق بود`)}finally{S.value=!1}}async function T(e){try{await n.notify(e),C.success(`اعلان موجودی ارسال شد`),await w()}catch(e){C.error(e instanceof r?e.message:`ارسال ناموفق بود`)}}return c(()=>{w()}),(t,n)=>(s(),e(`div`,_,[n[1]||=a(`header`,{class:`admin-page__head`},[a(`div`,null,[a(`h1`,null,`درخواست خبر موجودی`),a(`p`,null,`مشتریانی که برای محصول ناموجود درخواست اطلاع دادهاند`)])],-1),S.value?(s(),o(h,{key:0,variant:`table`})):u.value.length?(s(),e(`table`,v,[n[0]||=a(`thead`,null,[a(`tr`,null,[a(`th`,null,`مشتری`),a(`th`,null,`محصول`),a(`th`,null,`موجودی فعلی`),a(`th`)])],-1),a(`tbody`,null,[(s(!0),e(l,null,f(u.value,t=>(s(),e(`tr`,{key:t.id},[a(`td`,null,[d(i(t.customerName)+` `,1),a(`span`,y,i(t.customerPhone),1)]),a(`td`,null,[d(i(t.productName)+` `,1),a(`span`,b,`(`+i(t.productCode)+`)`,1)]),a(`td`,null,i(t.stock??`—`),1),a(`td`,null,[a(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:e=>T(t.id)},`ارسال اعلان`,8,x)])]))),128))])])):(s(),o(g,{key:1,title:`درخواستی فعال نیست`}))]))}}),[[`__scopeId`,`data-v-61131544`]]);export{S as default};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{Ct as e,D as t,G as n,J as r,N as i,Q as a,R as o,S as s,V as c,X as l,Z as u,dt as d,et as f,g as p,gt as m,ht as h,it as g,lt as _,nt as v,rt as y,st as b,vt as x,yt as S,z as C}from"./index-Ce0o2VuJ.js";import{t as w}from"./AdminPageSkeleton-CeCa2h-t.js";import{t as T}from"./BaseEmptyState-SjEY4tIJ.js";import{t as E}from"./AdminSelect-DW0RlAc0.js";var D={class:`admin-page`},O={class:`admin-page__head`},k={key:2,class:`admin-table`},A={class:`muted`,dir:`ltr`},j=[`onClick`],M={class:`field`},N={class:`field`},P={class:`field`},F=[`disabled`],I=c(g({__name:`SuggestionsView`,setup(c){let g=S([]),I=S(!0),L=S([]),R=S([]),z=S(!1),B=C(),V=x({customerId:``,productId:``,note:``}),H=l(()=>L.value.map(e=>({value:e.id,label:e.name?.trim()||e.phone}))),U=l(()=>R.value.map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function W(){I.value=!0;try{let[e,n,r]=await Promise.all([t.list(),p.list(),s.list()]);g.value=e,L.value=n,R.value=r}catch(e){B.error(e instanceof i?e.message:`بارگذاری ناموفق بود`)}finally{I.value=!1}}async function G(){try{await t.create({customerId:V.customerId,productId:V.productId,note:V.note.trim()||void 0}),z.value=!1,V.note=``,B.success(`پیشنهاد ثبت شد`),await W()}catch(e){B.error(e instanceof i?e.message:`ثبت ناموفق بود`)}}async function K(e){try{await t.setActive(e.id,!e.isActive),await W()}catch(e){B.error(e instanceof i?e.message:`بهروزرسانی ناموفق بود`)}}return b(()=>{W()}),(t,i)=>(_(),f(`div`,D,[u(`header`,O,[i[5]||=u(`div`,null,[u(`h1`,null,`پیشنهاد محصول`),u(`p`,null,`پیشنهاد دستی محصول به مشتری`)],-1),u(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:i[0]||=e=>z.value=!0},`پیشنهاد جدید`)]),I.value?(_(),a(w,{key:0,variant:`table`})):g.value.length?(_(),f(`table`,k,[i[6]||=u(`thead`,null,[u(`tr`,null,[u(`th`,null,`مشتری`),u(`th`,null,`محصول`),u(`th`,null,`یادداشت`),u(`th`,null,`وضعیت`),u(`th`)])],-1),u(`tbody`,null,[(_(!0),f(r,null,d(g.value,t=>(_(),f(`tr`,{key:t.id},[u(`td`,null,e(t.customerName),1),u(`td`,null,[v(e(t.productName)+` `,1),u(`span`,A,`(`+e(t.productCode)+`)`,1)]),u(`td`,null,e(t.note||`—`),1),u(`td`,null,e(t.isActive?`فعال`:`غیرفعال`),1),u(`td`,null,[u(`button`,{type:`button`,class:`link`,onClick:e=>K(t)},e(t.isActive?`غیرفعال`:`فعال`),9,j)])]))),128))])])):(_(),a(T,{key:1,title:`پیشنهادی ثبت نشده`})),y(o,{open:z.value,title:`پیشنهاد محصول`,onClose:i[4]||=e=>z.value=!1},{footer:h(()=>[u(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!V.customerId||!V.productId,onClick:G},` ثبت `,8,F)]),default:h(()=>[u(`label`,M,[i[7]||=v(`مشتری `,-1),y(E,{modelValue:V.customerId,"onUpdate:modelValue":i[1]||=e=>V.customerId=e,options:H.value},null,8,[`modelValue`,`options`])]),u(`label`,N,[i[8]||=v(`محصول `,-1),y(E,{modelValue:V.productId,"onUpdate:modelValue":i[2]||=e=>V.productId=e,options:U.value},null,8,[`modelValue`,`options`])]),u(`label`,P,[i[9]||=v(`یادداشت`,-1),m(u(`textarea`,{"onUpdate:modelValue":i[3]||=e=>V.note=e,class:`admin-input`,rows:`3`},null,512),[[n,V.note]])])]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-56e3e728`]]);export{I as default};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,B as t,D as n,N as r,R as i,S as a,St as o,W as s,X as c,Y as l,Z as u,_t as d,ct as f,g as p,ht as m,mt as h,nt as g,ot as _,q as v,rt as y,tt as b,ut as x,vt as S,z as C}from"./index-9Ae_VOzQ.js";import{t as w}from"./AdminPageSkeleton-CKg1wrlm.js";import{t as T}from"./BaseEmptyState-DLwJ8N61.js";import{t as E}from"./AdminSelect-BCHHmDtL.js";var D={class:`admin-page`},O={class:`admin-page__head`},k={key:2,class:`admin-table`},A={class:`muted`,dir:`ltr`},j=[`onClick`],M={class:`field`},N={class:`field`},P={class:`field`},F=[`disabled`],I=t(y({__name:`SuggestionsView`,setup(t){let y=S([]),I=S(!0),L=S([]),R=S([]),z=S(!1),B=C(),V=d({customerId:``,productId:``,note:``}),H=l(()=>L.value.map(e=>({value:e.id,label:e.name?.trim()||e.phone}))),U=l(()=>R.value.map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function W(){I.value=!0;try{let[e,t,r]=await Promise.all([n.list(),p.list(),a.list()]);y.value=e,L.value=t,R.value=r}catch(e){B.error(e instanceof r?e.message:`بارگذاری ناموفق بود`)}finally{I.value=!1}}async function G(){try{await n.create({customerId:V.customerId,productId:V.productId,note:V.note.trim()||void 0}),z.value=!1,V.note=``,B.success(`پیشنهاد ثبت شد`),await W()}catch(e){B.error(e instanceof r?e.message:`ثبت ناموفق بود`)}}async function K(e){try{await n.setActive(e.id,!e.isActive),await W()}catch(e){B.error(e instanceof r?e.message:`بهروزرسانی ناموفق بود`)}}return _(()=>{W()}),(t,n)=>(f(),e(`div`,D,[c(`header`,O,[n[5]||=c(`div`,null,[c(`h1`,null,`پیشنهاد محصول`),c(`p`,null,`پیشنهاد دستی محصول به مشتری`)],-1),c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:n[0]||=e=>z.value=!0},`پیشنهاد جدید`)]),I.value?(f(),u(w,{key:0,variant:`table`})):y.value.length?(f(),e(`table`,k,[n[6]||=c(`thead`,null,[c(`tr`,null,[c(`th`,null,`مشتری`),c(`th`,null,`محصول`),c(`th`,null,`یادداشت`),c(`th`,null,`وضعیت`),c(`th`)])],-1),c(`tbody`,null,[(f(!0),e(v,null,x(y.value,t=>(f(),e(`tr`,{key:t.id},[c(`td`,null,o(t.customerName),1),c(`td`,null,[b(o(t.productName)+` `,1),c(`span`,A,`(`+o(t.productCode)+`)`,1)]),c(`td`,null,o(t.note||`—`),1),c(`td`,null,o(t.isActive?`فعال`:`غیرفعال`),1),c(`td`,null,[c(`button`,{type:`button`,class:`link`,onClick:e=>K(t)},o(t.isActive?`غیرفعال`:`فعال`),9,j)])]))),128))])])):(f(),u(T,{key:1,title:`پیشنهادی ثبت نشده`})),g(i,{open:z.value,title:`پیشنهاد محصول`,onClose:n[4]||=e=>z.value=!1},{footer:h(()=>[c(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!V.customerId||!V.productId,onClick:G},` ثبت `,8,F)]),default:h(()=>[c(`label`,M,[n[7]||=b(`مشتری `,-1),g(E,{modelValue:V.customerId,"onUpdate:modelValue":n[1]||=e=>V.customerId=e,options:H.value},null,8,[`modelValue`,`options`])]),c(`label`,N,[n[8]||=b(`محصول `,-1),g(E,{modelValue:V.productId,"onUpdate:modelValue":n[2]||=e=>V.productId=e,options:U.value},null,8,[`modelValue`,`options`])]),c(`label`,P,[n[9]||=b(`یادداشت`,-1),m(c(`textarea`,{"onUpdate:modelValue":n[3]||=e=>V.note=e,class:`admin-input`,rows:`3`},null,512),[[s,V.note]])])]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-56e3e728`]]);export{I as default};
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -5,7 +5,7 @@
|
||||
<link rel="icon" href="/admin/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>پنل مدیریت | پارچه</title>
|
||||
<script type="module" crossorigin src="/admin/assets/index-9Ae_VOzQ.js"></script>
|
||||
<script type="module" crossorigin src="/admin/assets/index-Ce0o2VuJ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/admin/assets/index-C3X1YgAk.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
name: string
|
||||
size?: number
|
||||
color?: string
|
||||
strokeWidth?: number
|
||||
}>(),
|
||||
{
|
||||
size: 18,
|
||||
color: 'currentColor',
|
||||
strokeWidth: 1.5,
|
||||
},
|
||||
)
|
||||
|
||||
const VUESAX_MAP: Record<string, string> = {
|
||||
bolt: 'vuesax-linear:flash',
|
||||
feather: 'vuesax-linear:pen-add',
|
||||
diamond: 'vuesax-linear:diamonds',
|
||||
grid: 'vuesax-linear:element-3',
|
||||
bag: 'vuesax-linear:shopping-bag',
|
||||
weight: 'vuesax-linear:shopping-bag',
|
||||
'id-card': 'vuesax-linear:personalcard',
|
||||
catalog: 'vuesax-linear:category',
|
||||
headset: 'vuesax-linear:headphone',
|
||||
home: 'vuesax-linear:home',
|
||||
}
|
||||
|
||||
const vuesaxKey = computed(() => VUESAX_MAP[props.name])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="category-icon" aria-hidden="true">
|
||||
<BasicIcon
|
||||
v-if="vuesaxKey"
|
||||
:icon="vuesaxKey"
|
||||
:size="size"
|
||||
:stroke-width="strokeWidth"
|
||||
:color="color"
|
||||
/>
|
||||
<svg
|
||||
v-else-if="name === 'shirt'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
:stroke-width="strokeWidth"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M8.25 5.25 12 7.75l3.75-2.5 2.25 2.75L16 9.5V18.5a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9.5L6 8l2.25-2.75Z" />
|
||||
<path d="M12 7.75V18.5" />
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="name === 'suit'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
:stroke-width="strokeWidth"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M7.5 5.5h9l2 3v10.5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1V8.5l2-3Z" />
|
||||
<path d="M12 5.5v13" />
|
||||
<path d="M7.5 9 12 11.75 16.5 9" />
|
||||
<path d="M10.25 5.5V4a1.75 1.75 0 0 1 3.5 0v1.5" />
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="name === 'trousers'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
:stroke-width="strokeWidth"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M8 4.5h8v4.25l-1.75 11H13l-1-9.5-1 9.5H7.75L6 8.75V4.5Z" />
|
||||
<path d="M12 8.75v11" />
|
||||
<path d="M8 7.25h8" />
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="name === 'ruler'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
stroke-width="1.6"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<rect x="3" y="8" width="18" height="8" rx="1.5" />
|
||||
<path d="M7 8v3" />
|
||||
<path d="M10 8v4" />
|
||||
<path d="M13 8v3" />
|
||||
<path d="M16 8v4" />
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="name === 'composition'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
stroke-width="1.6"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M12 3.5 20 8v8l-8 4.5L4 16V8l8-4.5Z" />
|
||||
</svg>
|
||||
<svg
|
||||
v-else-if="name === 'weave'"
|
||||
:width="size"
|
||||
:height="size"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
:stroke="color"
|
||||
stroke-width="1.6"
|
||||
stroke-linecap="round"
|
||||
>
|
||||
<path d="M6 4v16" />
|
||||
<path d="M10 4v16" />
|
||||
<path d="M14 4v16" />
|
||||
<path d="M18 4v16" />
|
||||
<path d="M4 8h16" />
|
||||
<path d="M4 12h16" />
|
||||
<path d="M4 16h16" />
|
||||
</svg>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.category-icon {
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
</style>
|
||||
@@ -49,10 +49,12 @@ onClickOutside(
|
||||
{ ignore: [menuRef] },
|
||||
)
|
||||
|
||||
const selectedLabel = computed(
|
||||
() => props.options.find((option) => option.value === props.modelValue)?.label ?? props.placeholder,
|
||||
const selectedOption = computed(() =>
|
||||
props.options.find((option) => option.value === props.modelValue),
|
||||
)
|
||||
|
||||
const selectedLabel = computed(() => selectedOption.value?.label ?? props.placeholder)
|
||||
|
||||
const filteredOptions = computed(() => {
|
||||
const q = searchQuery.value.trim().toLowerCase()
|
||||
if (!q) return props.options
|
||||
@@ -144,7 +146,10 @@ onUnmounted(() => {
|
||||
aria-haspopup="listbox"
|
||||
@click="toggle"
|
||||
>
|
||||
<span class="admin-select__value">{{ selectedLabel }}</span>
|
||||
<span class="admin-select__trigger-content">
|
||||
<slot name="option-leading" :option="selectedOption" />
|
||||
<span class="admin-select__value">{{ selectedLabel }}</span>
|
||||
</span>
|
||||
<span class="admin-select__chevron" aria-hidden="true">
|
||||
<AdminIcon name="chevron-down" :size="16" />
|
||||
</span>
|
||||
@@ -182,7 +187,10 @@ onUnmounted(() => {
|
||||
:aria-selected="option.value === modelValue"
|
||||
@click="pick(option.value)"
|
||||
>
|
||||
<span>{{ option.label }}</span>
|
||||
<span class="admin-select__option-label">
|
||||
<slot name="option-leading" :option="option" />
|
||||
<span>{{ option.label }}</span>
|
||||
</span>
|
||||
<AdminIcon
|
||||
v-if="option.value === modelValue"
|
||||
name="check"
|
||||
@@ -242,6 +250,14 @@ onUnmounted(() => {
|
||||
box-shadow: var(--focus-ring);
|
||||
}
|
||||
|
||||
.admin-select__trigger-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.admin-select__value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -251,6 +267,14 @@ onUnmounted(() => {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.admin-select__option-label {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.admin-select__chevron {
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import AdminPageSkeleton from '@/components/ui/AdminPageSkeleton.vue'
|
||||
import AdminImagePicker from '@/components/ui/AdminImagePicker.vue'
|
||||
import AdminSelect from '@/components/ui/AdminSelect.vue'
|
||||
import CategoryIcon from '@/components/icons/CategoryIcon.vue'
|
||||
import BaseSwitch from '@/components/ui/BaseSwitch.vue'
|
||||
import { settingsApi } from '@/services/api'
|
||||
import { ApiError } from '@/services/http'
|
||||
@@ -51,6 +53,10 @@ const ICON_OPTIONS = [
|
||||
{ value: 'catalog', label: 'کالیته' },
|
||||
{ value: 'headset', label: 'پشتیبانی' },
|
||||
{ value: 'home', label: 'خانه' },
|
||||
{ value: 'ruler', label: 'عرض' },
|
||||
{ value: 'composition', label: 'جنس' },
|
||||
{ value: 'weight', label: 'وزن' },
|
||||
{ value: 'weave', label: 'نوع بافت' },
|
||||
]
|
||||
|
||||
function defaultUsageIcon(id: string) {
|
||||
@@ -461,11 +467,16 @@ onMounted(() => {
|
||||
/>
|
||||
</div>
|
||||
<div class="category-row__line">
|
||||
<select v-model="item.icon" class="admin-input" aria-label="آیکون">
|
||||
<option v-for="opt in ICON_OPTIONS" :key="opt.value" :value="opt.value">
|
||||
آیکون: {{ opt.label }}
|
||||
</option>
|
||||
</select>
|
||||
<AdminSelect
|
||||
v-model="item.icon"
|
||||
:options="ICON_OPTIONS"
|
||||
aria-label="آیکون"
|
||||
block
|
||||
>
|
||||
<template #option-leading="{ option }">
|
||||
<CategoryIcon v-if="option" :name="option.value" :size="18" />
|
||||
</template>
|
||||
</AdminSelect>
|
||||
<BaseSwitch
|
||||
v-model="item.showIcon"
|
||||
active-text="نمایش"
|
||||
@@ -536,11 +547,16 @@ onMounted(() => {
|
||||
/>
|
||||
</div>
|
||||
<div class="category-row__line">
|
||||
<select v-model="item.icon" class="admin-input" aria-label="آیکون">
|
||||
<option v-for="opt in ICON_OPTIONS" :key="opt.value" :value="opt.value">
|
||||
آیکون: {{ opt.label }}
|
||||
</option>
|
||||
</select>
|
||||
<AdminSelect
|
||||
v-model="item.icon"
|
||||
:options="ICON_OPTIONS"
|
||||
aria-label="آیکون"
|
||||
block
|
||||
>
|
||||
<template #option-leading="{ option }">
|
||||
<CategoryIcon v-if="option" :name="option.value" :size="18" />
|
||||
</template>
|
||||
</AdminSelect>
|
||||
<BaseSwitch
|
||||
v-model="item.showIcon"
|
||||
active-text="نمایش"
|
||||
@@ -645,6 +661,10 @@ onMounted(() => {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.category-row__line :deep(.admin-select) {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.category-row__id {
|
||||
margin: 0;
|
||||
color: var(--color-text-muted);
|
||||
|
||||
Reference in New Issue
Block a user