/
home
/
liman
/
app
/
assets
/
File Upload :
llllll
Current File: //home/liman/app/assets/CustomerList.4a38e1c1.js
import{u as V}from"./NavBar.8dc74e52.js";import{u as E,_ as M,E as T}from"./Empty.c38f5095.js";import{_ as U,g as q}from"./DefaultButton.6f0645fb.js";import{C as x,a as y,A as G,_ as H}from"./avatar.33a9f99b.js";import{d as N,o as s,h as u,w as c,i as e,t as l,a as r,u as o,f as $,j as J,g as K,k as b,l as O,c as f,F as P,m as B,n as w}from"./index.1049dc6d.js";import{c as k}from"./baseColor.d55f65ad.js";import{I as v}from"./Icon.a51c9930.js";import{C as S}from"./Card.f9c1a664.js";import"./index.54dfb863.js";import{S as Q}from"./Skeleton.93e5b106.js";x.Panel=y;x.install=function(i){return i.component(x.name,x),i.component(y.name,y),i};const R={class:"font-bold select-none"},W={class:"p-6 rounded flex justify-around !bg-gray-10"},X={class:"text-center"},Y=e("span",{class:"text-small block text-gray-400 mb-1"},"\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 :",-1),Z={class:"text-sm font-bold"},ee={class:"text-center"},te=e("span",{class:"text-small block text-gray-400 mb-1"},"\u0646\u0627\u0645 \u0641\u0631\u0648\u0634\u06AF\u0627\u0647 :",-1),se={class:"text-sm font-bold"},oe={class:"grid grid-cols-3 gap-1 mt-3"},ae={class:"flex items-center justify-center"},le={class:"mr-1 text-xs font-bold text-danger"},ne=e("span",{class:"mr-1 text-small text-danger"},"\u06AF\u0631\u0645 \u0628\u062F\u0647\u06CC",-1),re={class:"flex items-center justify-center"},ie={class:"mr-1 text-xs font-bold text-warning"},ce=e("span",{class:"mr-1 text-small text-warning"},"\u0633\u0646\u062F",-1),ue={class:"flex items-center justify-center"},me={class:"mr-1 text-xs font-bold text-info"},de=e("span",{class:"mr-1 text-small text-info"},"\u0645\u0630\u0627\u06A9\u0631\u0647",-1),pe={class:"mt-4"},_e=J(" \u0645\u0634\u0627\u0647\u062F\u0647 \u062C\u0632\u0626\u06CC\u0627\u062A "),fe={class:"flex justify-between items-center"},xe={class:"flex gap-2 items-center"},ge=e("img",{alt:"",src:H},null,-1),he={class:"flex flex-col gap-1"},ve={class:"font-bold"},L=N({__name:"CustomerItem",props:{type:{default:"item"},showDetailIcon:{type:Boolean,default:!0},user:null},setup(i){const t=i;function p(m){K.push({name:"customerDetail",params:{id:m}})}return(m,a)=>t.type=="collapse"?(s(),u(o(y),{key:0},{header:c(()=>[e("span",R,l(t.user.user__first_name)+" "+l(t.user.user__last_name),1)]),default:c(()=>[e("div",W,[e("div",X,[Y,e("span",Z,l(t.user.user__mobile),1)]),e("div",ee,[te,e("span",se,l(t.user.shop_name),1)])]),e("div",oe,[e("div",ae,[r(v,{icon:"vuesax-linear:card-send",color:o(k).danger,size:"16",class:"mr-1"},null,8,["color"]),e("span",le,l(t.user.depit),1),ne]),e("div",re,[r(v,{icon:"vuesax-linear:note-2",size:"16",color:o(k).warning,class:"mr-1"},null,8,["color"]),e("span",ie,l(t.user.get_docs_count),1),ce]),e("div",ue,[r(v,{icon:"vuesax-linear:messages-1",size:"16",color:o(k).info,class:"mr-1"},null,8,["color"]),e("span",me,l(t.user.get_conversation_count),1),de])]),e("div",pe,[r(U,{onClick:a[0]||(a[0]=d=>p(t.user.user)),class:"w-full",size:"large"},{default:c(()=>[_e]),_:1})])]),_:1})):(s(),u(o(S),{key:1,class:"cursor-pointer card-padding-8-16"},{default:c(()=>[e("div",fe,[e("div",xe,[r(o(G),{size:45},{icon:c(()=>[ge]),_:1}),e("div",he,[e("span",ve,l(t.user.user__first_name)+" "+l(t.user.user__last_name),1),e("span",null,l(t.user.user__mobile),1)])]),e("div",null,[t.showDetailIcon?(s(),u(v,{key:0,icon:"vuesax-linear:arrow-left",size:"18",class:"text-info",onClick:a[1]||(a[1]=d=>p(t.user.user))})):$("",!0)])])]),_:1}))}});const ye={key:1},Ce={key:1},be={class:"flex flex-col gap-2"},Le=N({__name:"CustomerList",props:{type:{default:"item"}},emits:["select"],setup(i,{emit:t}){const p=i,{prefixCls:m}=V("customer-list"),a=b(),d={page:1,limit:10,filters:[]},C=b(!0),I=b();function A(n){t("select",n)}async function z(){try{C.value=!0;const{data:n}=await q(d);a.value=n}catch(n){console.log(n)}finally{C.value=!1}}return E(I,async()=>{var n;try{const g=Math.ceil(((n=a.value)==null?void 0:n.count)/d.limit);d.page<g&&(d.page++,await z())}catch(g){console.log(g)}},{distance:50}),O(async()=>{await z()}),(n,g)=>{var F,j;return s(),f("div",{class:w(["p-2",[`${o(m)}`]])},[r(M,{placeholder:"\u062C\u0633\u062A\u062C\u0648 \u0645\u0634\u062A\u0631\u06CC"}),((F=a.value)==null?void 0:F.rows[0].length)===0?(s(),u(T,{key:0})):(s(),f("div",ye,[p.type=="collapse"?(s(),u(o(S),{key:0,ref_key:"el",ref:I,class:w([[`${o(m)}-card-list`],"overflow-auto"]),style:{"max-height":"calc(100vh - 120px)"}},{default:c(()=>[r(o(x),{class:w([`${o(m)}-collapse-list`]),expandIconPosition:"right"},{default:c(()=>{var _;return[(s(!0),f(P,null,B((_=a.value)==null?void 0:_.rows[0],(h,D)=>(s(),u(L,{onClick:we=>A(h),key:D,type:"collapse",user:h},null,8,["onClick","user"]))),128))]}),_:1},8,["class"]),r(o(Q),{active:"",loading:C.value},null,8,["loading"])]),_:1},8,["class"])):$("",!0),p.type=="item"?(s(),f("div",Ce,[e("div",be,[(s(!0),f(P,null,B((j=a.value)==null?void 0:j.rows[0],(_,h)=>(s(),u(L,{key:h,onClick:D=>A(_),user:_,showDetailIcon:!1},null,8,["onClick","user"]))),128))])])):$("",!0)]))],2)}}});export{Le as _,L as a};
Copyright ©2k19 -
Hexid
|
Tex7ure