Files
Rasadyar_FrontEnd/build/assets/GuildManageGuildsPage-D2fbeDME.js

2 lines
8.8 KiB
JavaScript
Raw Normal View History

2026-01-19 15:40:45 +03:30
import{j as r,T as L,b as V,bq as q,bs as S,ak as uu,B as M,d as eu}from"./mui-vendor-CkIVaoQP.js";import{G as s,S as i,X as P,O as ru,j as $,L as au,h as su,lQ as nu}from"./index-CeyyVc1v.js";import{r as n,f as tu}from"./react-vendor-CmFgShSM.js";import{R as lu,a as ou}from"./index.esm-Bu7XMDZU.js";import{u as cu,f as du}from"./redux-vendor-B7uoacJt.js";import{M as J}from"./ManageGuildsOperations-DTKLlkN3.js";import{C as pu}from"./CreateGuilds-CCT3R9v5.js";import{P as Cu}from"./PageTable-C16Ol94B.js";import"./iconBase-BEJYyZsk.js";import"./Edit-CqBj1Y2L.js";import"./Visibility-DeyjG-oI.js";import"./CheckCircle-zgBvZQ-b.js";import"./Send-CA1iNvJP.js";import"./Person-Q1IHBezR.js";import"./Business-J-mGuLnc.js";import"./Phone-Dv2y8iMM.js";import"./Badge-u1S44abW.js";import"./Cake-CkaTUHNX.js";import"./Tune-D4M2CAhp.js";import"./Done-Dp5awdte.js";import"./DialogAlert-BfXcr-Kr.js";import"./LabelField-B6eRSoQP.js";import"./styled-components.browser.esm-gS9mh05b.js";const K=({columns:o,data:t,ignore:h,paginated:j,name:c})=>{const O=Math.ceil((t==null?void 0:t.length)/2),[l,b]=n.useState(1);function w(p){return h==null?void 0:h.includes(p)}const F=(l-1)*2,I=F+2,d=j?t.slice(F,I):t;return r.jsxs(r.Fragment,{children:[r.jsxs(s,{container:!0,xs:12,mb:i.SMALL,spacing:1,justifyContent:"space-between",children:[c&&r.jsx(L,{m:2,xs:12,variant:"body2",children:c}),!t.length&&r.jsx(s,{xs:12,display:"grid",justifyContent:"center",mt:4,children:r.jsx(L,{xs:12,variant:"body1",color:"error",children:"موردی وجود ندارد!"})}),d.map((p,x)=>{let C=0;return r.jsx(s,{xs:t.length===1?12:6,children:r.jsx(V,{display:"flex",flexDirection:"column",border:1,borderRadius:3,children:p.map((T,f)=>{var y;return!w(f)&&r.jsxs(s,{alignItems:"center",justifyContent:"space-between",display:"flex",xs:12,sx:{backgroundColor:C++%2===0?"rgba(148,148,148,0.1)":"ffff"},children:[r.jsx(s,{item:!0,xs:5,children:r.jsx(L,{sx:{fontSize:((y=o[f])==null?void 0:y.length)<=15?13:10},children:`${o[f]}`})}),r.jsx(s,{item:!0,xs:7,style:{fontSize:12,width:"100%"},children:T})]},f)})})},x)})]}),j&&r.jsx(s,{container:!0,mb:i.SMALL,justifyContent:"center",children:r.jsx(q,{count:O,page:l,variant:"outlined",onChange:(p,x)=>b(x)})})]})};K.propTypes={columns:S.any,data:S.any,ignore:S.array,paginated:S.any};const fu=()=>{const o=cu(),[t,h]=n.useState([]),j=du(u=>u.userSlice.userProfile.key),[c,A]=n.useState([]),[O,l]=n.useState(!1),[b,w]=n.useState(0),[F,I]=n.useState(10),[d,p]=n.useState(""),x=u=>{p(u.target.value)},C=async(u,e)=>{l(!0);let a=await $.get(`total_guilds/?role=Guilds&steward=true&search=filter&value=${e}&page=${u}&page_size=${F}`);A(a.data.results),w(a.data.count),l(!1)},T=u=>{C(u,d)},f=async(u,e)=>{l(!0);let a=await $.get(`total_guilds/?role=Guilds&steward=true&search=filter&value=${d}&page=${e}&page_size=${u}`);A(a.data.results),w(a.data.count),I(u),l(!1),o(su())},[y,Q]=n.useState(0),X=(u,e)=>{o(au()),Q(e),C(e+1,d)};n.useEffect(()=>{C(1)},[]);const E=()=>{C(1)},D=[{name:"شناسه صنف",selector:u=>u.guildsId,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"نام واحد صنفی",selector:u=>u==null?void 0:u.guildsName,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"نام شخص/شرکت",selector:u=>{var e,a;return`${(e=u==null?void 0:u.user)==null?void 0:e.fullname} (${(a=u==null?void 0:u.user)==null?void 0:a.mobile})`},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"کدملی",selector:u=>{var e;return(e=u==null?void 0:u.user)==null?void 0:e.nationalId},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"100px"},{name:"نوع فعالیت",selector:u=>u==null?void 0:u.typeActivity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"حوزه فعالیت",selector:u=>u==null?void 0:u.areaActivity,sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"کدپستی",selector:u=>{var e;return(e=u==null?void 0:u.address)==null?void 0:e.postalCode},sortable:!1,wrap:!0,allowOverflow:!0,center:!0,width:"80px"},{name:"استان/شهر/آدرس",selector:u=>{var e,a,