/
home
/
maktab
/
pwa
/
assets
/
File Upload :
llllll
Current File: //home/maktab/pwa/assets/MasterList-21e6ccf6.js
import{d as G,r as l,a as H,y as j,l as J,c as n,b as a,e as r,N as Q,u as i,w as v,L as W,F as z,t as X,I as y,_ as A,g as _,h as b,i as Y,E as Z,o as s,j as h,z as C,q as S,x as N,m as P}from"./index-b702d2bf.js";import{_ as B}from"./default_image-3c98eb2d.js";import{_ as ee}from"./NavBar.vue_vue_type_script_setup_true_lang-d06a6254.js";import{u as ae,b as se}from"./service-22b78ea4.js";import{u as te}from"./index-147327bf.js";const oe={dir:"ltr"},le={class:"fixed top-0 w-full max-w-3xl bg-white"},ne={dir:"rtl",class:"px-4 pt-4"},ie={dir:"rtl",class:"pt-28 p-4 divide-y divide-gray-200"},ce=["onClick"],re=["src"],de={key:1,class:"rounded-full w-11 h-11",src:B,alt:""},ue={key:1,class:"pl-2"},pe=["src"],ve={key:1,class:"rounded-full w-11 h-11",src:B,alt:""},_e={class:"flex-1 grid grid-rows-2 text-right"},fe={class:"font-semibold"},me={key:0,class:"text-xs font-thin"},ye={class:"px-1.5 pb-1 bg-green-100 text-green-600 rounded-md"},he={class:"col-span-1 flex gap-2"},ge={class:"fixed bottom-20 pl-6"},xe={dir:"rtl"},we={class:"text-base py-3"},ke={class:"font-bold px-1"},be={class:"grid gap-4 pt-3"},Le=G({__name:"MasterList",setup(Ce){const d=l([]);l([]);const M=l(),D=l(),f=l(!1),T=l(),c=Y();let $=0;const g=l(""),w=l(),u=l(),V=l(null),p=H({filters:[],limit:60,page:1}),E=j(()=>c.isTeacher());j(()=>c.isClone());function F(t,o){t.stopPropagation(),u.value=d.value.find(k=>k.id===o),M.value=u.value.name,D.value=u.value.id,console.log(u.value,"oooooo"),f.value=!0}async function K(){c.isTeacher()?(await ae(Object.defineProperty(u.value,"active",{value:!1})),P.success("کاربر از لیست کاربران حذف شد"),d.value=[],await m()):(await se(Object.defineProperty(u.value,"active",{value:!1})),P.success("کاربر از لیست کاربران حذف شد"),d.value=[],await m()),f.value=!1}async function m(){if(console.log("salam"),c.isSuperAdmin()){const{data:t}=await A.get(`api/cloony/master/${_.currentRoute.value.params.id}`);d.value.push(...t),$=t.query.total,console.log(d.value)}}async function U(){const{data:t}=await Z();w.value=t.cloony.id,console.log(w.value,"ididididi")}async function q(){if(c.isClone()){await U();const{data:t}=await A.get(`api/cloony/maktab/${w.value}`);T.value=t,console.log(T.value,"mcmcmcmc")}}async function I(){try{g.value!=""?p.search=g.value:delete p.search,d.value=[],p.page=1,await m()}catch(t){console.log(t)}finally{}}return te(V,async()=>{p.page<Math.ceil($/p.limit)&&(p.page++,await m())},{distance:10}),J(async()=>{await m(),await q()}),(t,o)=>{const k=b("a-input"),L=b("a-button"),O=b("a-drawer");return s(),n(z,null,[a("div",oe,[a("div",le,[r(ee,{dir:"rtl"},Q({IconLeft:v(()=>[]),_:2},[i(E)?{name:"Title",fn:v(()=>[h(" عوامل ")]),key:"0"}:void 0]),1024),a("div",ne,[r(k,{size:"large",value:g.value,"onUpdate:value":o[0]||(o[0]=e=>g.value=e),onKeydown:W(I,["enter"])},{prefix:v(()=>[r(y,{onClick:I,class:"pl-1 text-primary",size:"16px",icon:"vuesax-linear:search-normal-1"})]),_:1},8,["value","onKeydown"])])]),a("div",ie,[(s(!0),n(z,null,X(d.value,(e,R)=>(s(),n("div",{key:R,class:"flex py-2 items-center divide-gray-500"},[i(c).isSuperAdmin()?(s(),n("div",{key:0,class:"pl-2",onClick:x=>i(_).push({name:"Personinfo",params:{id:e.id}})},[e.file?(s(),n("img",{key:0,class:"rounded-full w-11 h-11 object-cover",src:e.file.full_src,alt:""},null,8,re)):(s(),n("img",de))],8,ce)):(s(),n("div",ue,[e.file?(s(),n("img",{key:0,class:"rounded-full w-11 h-11 object-cover",src:e.file.full_src,alt:""},null,8,pe)):(s(),n("img",ve))])),a("div",_e,[a("div",fe,C(e.name),1),e.type_cnt?(s(),n("div",me,[a("span",ye,C(e.type_cnt.value),1)])):S("",!0)]),a("div",he,[i(c).isSuperAdmin()?(s(),N(y,{key:0,onClick:x=>F(x,e.id),class:"text-primary p-2 cursor-pointer",icon:"vuesax-linear:trash"},null,8,["onClick"])):S("",!0),i(c).isSuperAdmin()?(s(),N(y,{key:1,class:"text-primary p-2 cursor-pointer",icon:"vuesax-linear:info-circle",onClick:x=>i(_).push({name:"Personinfo",params:{id:e.id}})},null,8,["onClick"])):S("",!0),r(y,{onClick:x=>i(_).push({name:"MaktabListStudent",params:{maktab_id:i(_).currentRoute.value.params.id,id:e.id}}),class:"text-primary p-2 cursor-pointer",icon:"vuesax-linear:arrow-left"},null,8,["onClick"])])]))),128))]),a("div",ge,[r(y,{onClick:o[1]||(o[1]=e=>i(_).push({name:"AddStudent"})),class:"text-white shadow shadow-primary rounded-xl",icon:"vuesax-linear:addFrame"})])]),r(O,{visible:f.value,"onUpdate:visible":o[3]||(o[3]=e=>f.value=e),placement:"bottom",closable:!1,height:"200"},{default:v(()=>[a("div",xe,[a("div",we,[h(" آیا از حذف "),a("span",ke,C(M.value),1),h(" اطمینان دارید؟ ")]),a("div",be,[r(L,{type:"primary",class:"w-full",size:"large",onClick:K},{default:v(()=>[h("تایید")]),_:1}),r(L,{class:"w-full",size:"large",onClick:o[2]||(o[2]=e=>f.value=!1)},{default:v(()=>[h("انصراف")]),_:1})])])]),_:1},8,["visible"])],64)}}});export{Le as default};
Copyright ©2k19 -
Hexid
|
Tex7ure