????

Your IP : 216.73.216.130


Current Path : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/
Upload File :
Current File : C:/inetpub/vhost/donthu.nextform.vn/wwwroot/assets/Analytics-Hs4YDGa2.js

var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});import{k as jsxRuntimeExports,B as Box,ak as SimpleCard,N as Small$1,al as MatxProgressBar,p as useTheme,s as styled,S as Span$1,ag as Avatar,h as useTheme$1,r as reactExports,C as Card,am as Grid,I as Icon,an as format,x as IconButton,ao as useService,ap as Dashboard,aq as getCurrentDate,ar as Typography,as as Select,ad as MenuItem,q as Paragraph}from"./index-y1X-EiI1.js";import{E as EChartsReact}from"./index-zwfUrVj9.js";import{F as Fab}from"./Fab-BPCNM9bU.js";import{C as Checkbox}from"./Checkbox-B8nePMFP.js";import{H as Hidden}from"./Hidden-CoqcMFa3.js";import{T as Tooltip}from"./Tooltip-C0pwvyhl.js";import{l as lighten}from"./colorManipulator-DvIuWqAp.js";import{T as Table,a as TableHead,b as TableRow,c as TableCell,d as TableBody}from"./TableRow-BfZy-RM-.js";import"./SwitchBase-HB81Uehs.js";import"./useMediaQuery-BtRkfgHg.js";import"./Popper-BN0GgV3z.js";const Campaigns=__name(()=>jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsxs(SimpleCard,{title:"Lưu lượng tiếp công dân",children:[jsxRuntimeExports.jsx(Small$1,{color:"text.secondary",children:"Hôm nay"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:75,color:"primary",text:"Tiếp CD (102)"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:45,color:"secondary",text:"Nhận đơn (40)"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:75,color:"primary",text:"Đã xử lý (80)"}),jsxRuntimeExports.jsx(Small$1,{color:"text.secondary",display:"block",pt:4,children:"Hôm qua"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:75,color:"primary",text:"Tiếp CD (102)"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:45,color:"secondary",text:"Nhận đơn (40)"}),jsxRuntimeExports.jsx(MatxProgressBar,{value:75,color:"primary",text:"Đã xử lý (80)"})]})}),"Campaigns"),DoughnutChart=__name(({height,color=[]})=>{const theme=useTheme(),option={legend:{show:!0,itemGap:20,icon:"circle",bottom:0,textStyle:{color:theme.palette.text.secondary,fontSize:13,fontFamily:"roboto"}},tooltip:{show:!1,trigger:"item",formatter:"{a} <br/>{b}: {c} ({d}%)"},xAxis:[{axisLine:{show:!1},splitLine:{show:!1}}],yAxis:[{axisLine:{show:!1},splitLine:{show:!1}}],series:[{name:"Traffic Rate",type:"pie",radius:["45%","72.55%"],center:["50%","50%"],avoidLabelOverlap:!1,hoverOffset:5,stillShowZeroSum:!1,label:{normal:{show:!1,position:"center",textStyle:{color:theme.palette.text.secondary,fontSize:13,fontFamily:"roboto"},formatter:"{a}"},emphasis:{show:!0,textStyle:{fontSize:"14",fontWeight:"normal"},formatter:`{b} 
{c} ({d}%)`}},labelLine:{normal:{show:!1}},data:[{value:65,name:"Tiếp nhận"},{value:20,name:"Đã xử lý"},{value:15,name:"Trả đơn"}],itemStyle:{emphasis:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};return jsxRuntimeExports.jsx(EChartsReact,{style:{height},option:{...option,color:[...color]}})},"DoughnutChart"),ProjectName=styled(Span$1)(({theme})=>({marginLeft:24,fontWeight:"500",[theme.breakpoints.down("sm")]:{marginLeft:4}})),StarOutline=styled(Fab)(()=>({marginLeft:0,boxShadow:"none",background:"#08ad6c !important",backgroundColor:"rgba(9, 182, 109, 1) !important"})),DateRange=styled(Fab)(({theme})=>({marginLeft:0,boxShadow:"none",color:"white !important",background:`${theme.palette.error.main} !important`})),StyledAvatar=styled(Avatar)(()=>({width:"32px !important",height:"32px !important"})),RowCards=__name(()=>{const{palette}=useTheme$1(),textMuted=palette.text.secondary;return[1,2,3,4].map(id=>jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(Card,{sx:{py:1,px:2},className:"project-card",children:jsxRuntimeExports.jsxs(Grid,{container:!0,alignItems:"center",children:[jsxRuntimeExports.jsx(Grid,{item:!0,md:5,xs:7,children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",children:[jsxRuntimeExports.jsx(Checkbox,{}),jsxRuntimeExports.jsx(Hidden,{smDown:!0,children:id%2===1?jsxRuntimeExports.jsx(StarOutline,{size:"small",children:jsxRuntimeExports.jsx(Icon,{children:"star_outline"})}):jsxRuntimeExports.jsx(DateRange,{size:"small",children:jsxRuntimeExports.jsx(Icon,{children:"date_range"})})}),jsxRuntimeExports.jsxs(ProjectName,{children:["Đơn số ",id]})]})}),jsxRuntimeExports.jsx(Grid,{item:!0,md:3,xs:4,children:jsxRuntimeExports.jsx(Box,{color:textMuted,children:format(new Date().getTime(),"MM/dd/yyyy hh:mma")})}),jsxRuntimeExports.jsx(Hidden,{smDown:!0,children:jsxRuntimeExports.jsx(Grid,{item:!0,xs:3,children:jsxRuntimeExports.jsxs(Box,{display:"flex",position:"relative",marginLeft:"-0.875rem !important",children:[jsxRuntimeExports.jsx(StyledAvatar,{src:"/assets/images/face-4.jpg"}),jsxRuntimeExports.jsx(StyledAvatar,{src:"/assets/images/face-4.jpg"}),jsxRuntimeExports.jsx(StyledAvatar,{src:"/assets/images/face-4.jpg"}),jsxRuntimeExports.jsx(StyledAvatar,{sx:{fontSize:"14px"},children:"+3"})]})})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:1,children:jsxRuntimeExports.jsx(Box,{display:"flex",justifyContent:"flex-end",children:jsxRuntimeExports.jsx(IconButton,{children:jsxRuntimeExports.jsx(Icon,{children:"more_vert"})})})})]})}),jsxRuntimeExports.jsx(Box,{py:1})]},id))},"RowCards");function useDashboard(){const allow=useService(Dashboard,"allow");return{getData:__name(data=>allow.post({url:"/Dashboard",body:data}),"getData")}}__name(useDashboard,"useDashboard");const StyledCard=styled(Card)(({theme})=>({display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",padding:"12px !important",background:theme.palette.background.paper,[theme.breakpoints.down("sm")]:{padding:"16px !important"}})),ContentBox$2=styled(Box)(({theme})=>({display:"flex",flexWrap:"wrap",alignItems:"center","& small":{color:theme.palette.text.secondary},"& .icon":{borderRadius:"0.4rem",opacity:.6,fontSize:"4rem"}})),Heading=styled("h6")(({theme})=>({margin:0,fontSize:"2rem",fontWeight:"bold",color:theme.palette.text.secondary})),cardList=[{key:"soDonTiepDan",name:"Số đơn tiếp nhận công dân",amount:0,icon:"drafts_rounded",color:"info"},{key:"soDonDaXuLy",name:"Số đơn đã xử lý",amount:0,icon:"mark_email_read_rounded",color:"success"},{key:"soDonChuyenXuLy",name:"Số đơn đã chuyển xử lý",amount:0,icon:"store",color:"warning"},{key:"soDonFromDonViKhac",name:"Số đơn từ đơn vị khác",amount:0,icon:"drive_file_move",color:"error"}],NumberAnimation=__name(({index,amount})=>{const increaseNumberAnimation=__name((elementId,endNumber,speed=10)=>{const element=document.getElementById(elementId);!element||JSON.parse(element.dataset.animationRunning??!1)||(element.dataset.animationRunning=!0,incNbrRec(0,endNumber,element,speed))},"increaseNumberAnimation"),incNbrRec=__name((currentNumber,endNumber,element,speed)=>{currentNumber<=endNumber?(element.innerHTML=currentNumber,setTimeout(function(){incNbrRec(currentNumber+1,endNumber,element,speed)},speed)):element.dataset.animationRunning=!1},"incNbrRec");return reactExports.useEffect(()=>{amount&&increaseNumberAnimation("nbr"+index,amount)},[amount,index]),jsxRuntimeExports.jsx(Heading,{id:"nbr"+index,children:"0"})},"NumberAnimation"),StatCards=__name(()=>{const[condition,setCondition]=reactExports.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),[currentTime,setCurrentTime]=reactExports.useState(getCurrentDate({}).format("DD-MM-YYYY HH:mm:ss")),[dataDashboard,setDataDashboard]=reactExports.useState([]),{getData}=useDashboard();reactExports.useEffect(()=>{const intervalId=setInterval(()=>{const curr=getCurrentDate({date:new Date}).format("DD-MM-YYYY HH:mm:ss");setCurrentTime(curr)},1e3);return()=>clearInterval(intervalId)},[]);const getDataDashboard=reactExports.useCallback(async()=>{try{const{resultObj}=await getData(condition),dataCard=[...cardList];dataCard.forEach(cur=>{cur.amount=resultObj[cur.key]}),setDataDashboard(dataCard)}catch{}},[condition]);return reactExports.useEffect(()=>{getDataDashboard()},[]),jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,sx:{mb:"24px"},children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:12,children:jsxRuntimeExports.jsxs(Typography,{variant:"h6",children:["Hôm nay: ",currentTime]})}),dataDashboard.map((item,index)=>jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:6,children:jsxRuntimeExports.jsxs(StyledCard,{elevation:6,children:[jsxRuntimeExports.jsxs(ContentBox$2,{children:[jsxRuntimeExports.jsx(Icon,{className:"icon",color:item.color,children:item.icon}),jsxRuntimeExports.jsxs(Box,{ml:"12px",children:[jsxRuntimeExports.jsx(Small$1,{children:item.name}),jsxRuntimeExports.jsx(NumberAnimation,{index:index+1,amount:parseInt(item.amount)})]})]}),jsxRuntimeExports.jsx(Tooltip,{title:"Xem chi tiết",placement:"top",children:jsxRuntimeExports.jsx(IconButton,{children:jsxRuntimeExports.jsx(Icon,{children:"arrow_right_alt"})})})]})},index))]})},"StatCards"),ContentBox$1=styled("div")(()=>({display:"flex",flexWrap:"wrap",alignItems:"center"})),FabIcon=styled(Fab)(()=>({width:"44px !important",height:"44px !important",boxShadow:"none !important"})),H3=styled("h3")(({textcolor})=>({margin:0,color:textcolor,fontWeight:"500",marginLeft:"12px"})),H1=styled("h1")(({theme})=>({margin:0,flexGrow:1,color:theme.palette.text.secondary})),Span=styled("span")(({textcolor})=>({fontSize:"13px",color:textcolor,marginLeft:"4px"})),IconBox=styled("div")(()=>({width:16,height:16,color:"#fff",display:"flex",overflow:"hidden",borderRadius:"300px ",justifyContent:"center","& .icon":{fontSize:"14px"}})),StatCards2=__name(()=>{const{palette}=useTheme$1(),textError=palette.error.main,bgError=lighten(palette.error.main,.85);return jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,sx:{mb:3},children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:6,children:jsxRuntimeExports.jsxs(Card,{elevation:3,sx:{p:2},children:[jsxRuntimeExports.jsxs(ContentBox$1,{children:[jsxRuntimeExports.jsx(FabIcon,{size:"medium",sx:{background:"rgba(9, 182, 109, 0.15)"},children:jsxRuntimeExports.jsx(Icon,{sx:{color:"#08ad6c"},children:"trending_up"})}),jsxRuntimeExports.jsx(H3,{textcolor:"#08ad6c",children:"Tiếp công dân"})]}),jsxRuntimeExports.jsxs(ContentBox$1,{sx:{pt:2},children:[jsxRuntimeExports.jsx(H1,{children:"150"}),jsxRuntimeExports.jsx(IconBox,{sx:{background:"rgba(9, 182, 109, 0.15)"},children:jsxRuntimeExports.jsx(Icon,{className:"icon",children:"expand_less"})}),jsxRuntimeExports.jsx(Span,{textcolor:"#08ad6c",children:"(+21%)"})]})]})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:6,children:jsxRuntimeExports.jsxs(Card,{elevation:3,sx:{p:2},children:[jsxRuntimeExports.jsxs(ContentBox$1,{children:[jsxRuntimeExports.jsx(FabIcon,{size:"medium",sx:{background:bgError,overflow:"hidden"},children:jsxRuntimeExports.jsx(Icon,{sx:{color:textError},children:"star_outline"})}),jsxRuntimeExports.jsx(H3,{textcolor:textError,children:"Đã Xử lý"})]}),jsxRuntimeExports.jsxs(ContentBox$1,{sx:{pt:2},children:[jsxRuntimeExports.jsx(H1,{children:"50"}),jsxRuntimeExports.jsx(IconBox,{sx:{background:bgError},children:jsxRuntimeExports.jsx(Icon,{className:"icon",children:"expand_less"})}),jsxRuntimeExports.jsx(Span,{textcolor:textError,children:"(-21%)"})]})]})})]})},"StatCards2"),CardHeader=styled(Box)(()=>({display:"flex",paddingLeft:"24px",paddingRight:"24px",marginBottom:"12px",alignItems:"center",justifyContent:"space-between"})),Title$1=styled("span")(()=>({fontSize:"1rem",fontWeight:"500",textTransform:"capitalize"})),ProductTable=styled(Table)(()=>({minWidth:400,whiteSpace:"pre","& small":{width:50,height:15,borderRadius:500,boxShadow:"0 0 2px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24)"},"& td":{borderBottom:"none"},"& td:first-of-type":{paddingLeft:"16px !important"}})),Small=styled("small")(({bgcolor})=>({width:50,height:15,color:"#fff",padding:"2px 8px",borderRadius:"4px",overflow:"hidden",background:bgcolor,boxShadow:"0 0 2px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24)"})),TopSellingTable=__name(()=>{const{palette}=useTheme$1(),bgError=palette.error.main,bgPrimary=palette.primary.main,bgSecondary=palette.secondary.main;return jsxRuntimeExports.jsxs(Card,{elevation:3,sx:{pt:"20px",mb:3},children:[jsxRuntimeExports.jsxs(CardHeader,{children:[jsxRuntimeExports.jsx(Title$1,{children:"Top cán bộ tiếp nhận"}),jsxRuntimeExports.jsxs(Select,{size:"small",defaultValue:"this_month",children:[jsxRuntimeExports.jsx(MenuItem,{value:"this_month",children:"Tháng này"}),jsxRuntimeExports.jsx(MenuItem,{value:"last_month",children:"Tháng trước"})]})]}),jsxRuntimeExports.jsx(Box,{overflow:"auto",children:jsxRuntimeExports.jsxs(ProductTable,{children:[jsxRuntimeExports.jsx(TableHead,{children:jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{sx:{px:3},colSpan:4,children:"Tên"}),jsxRuntimeExports.jsx(TableCell,{sx:{px:0},colSpan:2,children:"Chức vụ"}),jsxRuntimeExports.jsx(TableCell,{sx:{px:0},colSpan:2,children:"Số đơn nhận"}),jsxRuntimeExports.jsx(TableCell,{sx:{px:0},colSpan:1,children:"Chi tiết"})]})}),jsxRuntimeExports.jsx(TableBody,{children:productList.map((product,index)=>jsxRuntimeExports.jsxs(TableRow,{hover:!0,children:[jsxRuntimeExports.jsx(TableCell,{colSpan:4,align:"left",sx:{px:0,textTransform:"capitalize"},children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",children:[jsxRuntimeExports.jsx(Avatar,{src:product.imgUrl}),jsxRuntimeExports.jsx(Paragraph,{sx:{m:0,ml:4},children:product.name})]})}),jsxRuntimeExports.jsx(TableCell,{align:"left",colSpan:2,sx:{px:0,textTransform:"capitalize"},children:product.price>999?(product.price/1e3).toFixed(1)+"k":product.price}),jsxRuntimeExports.jsx(TableCell,{sx:{px:0},align:"left",colSpan:2,children:product.available?product.available<20?jsxRuntimeExports.jsxs(Small,{bgcolor:bgSecondary,children:[product.available," Đơn"]}):jsxRuntimeExports.jsxs(Small,{bgcolor:bgPrimary,children:[" ",product.available," Đơn"]}):jsxRuntimeExports.jsxs(Small,{bgcolor:bgError,children:[" ",product.available," Đơn"]})}),jsxRuntimeExports.jsx(TableCell,{sx:{px:0},colSpan:1,children:jsxRuntimeExports.jsx(IconButton,{children:jsxRuntimeExports.jsx(Icon,{color:"primary",children:"edit"})})})]},index))})]})})]})},"TopSellingTable"),productList=[{imgUrl:"/assets/images/avatars/001-man.svg",name:"Nguyễn Văn A",price:"Cán bộ",available:15},{imgUrl:"/assets/images/avatars/001-man.svg",name:"Nguyễn Văn B",price:"Cán bộ",available:30},{imgUrl:"/assets/images/avatars/002-woman.svg",name:"Lê Thị Hồng",price:"Cán bộ",available:35},{imgUrl:"/assets/images/avatars/002-woman.svg",name:"Nguyễn Danh Hồng",price:"Cán bộ",available:0},{imgUrl:"/assets/images/avatars/001-man.svg",name:"Nguyễn Hồng Hà",price:"Cán bộ",available:5}],ContentBox=styled("div")(({theme})=>({margin:"30px",[theme.breakpoints.down("sm")]:{margin:"16px"}})),Title=styled("span")(()=>({fontSize:"1rem",fontWeight:"500",marginRight:".5rem",textTransform:"capitalize"})),SubTitle=styled("span")(({theme})=>({fontSize:"0.875rem",color:theme.palette.text.secondary})),H4=styled("h4")(({theme})=>({fontSize:"1rem",fontWeight:"500",marginBottom:"16px",textTransform:"capitalize",color:theme.palette.text.secondary})),Analytics=__name(()=>{const{palette}=useTheme$1();return jsxRuntimeExports.jsx(reactExports.Fragment,{children:jsxRuntimeExports.jsx(ContentBox,{className:"analytics",children:jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,children:[jsxRuntimeExports.jsxs(Grid,{item:!0,lg:8,md:8,sm:12,xs:12,children:[jsxRuntimeExports.jsx(StatCards,{}),jsxRuntimeExports.jsx(TopSellingTable,{}),jsxRuntimeExports.jsx(H4,{children:"Top đơn đang xử lý"}),jsxRuntimeExports.jsx(RowCards,{})]}),jsxRuntimeExports.jsxs(Grid,{item:!0,lg:4,md:4,sm:12,xs:12,children:[jsxRuntimeExports.jsxs(Card,{sx:{px:3,py:2,mb:3},children:[jsxRuntimeExports.jsx(Title,{children:"Lưu lượng tiếp nhận"}),jsxRuntimeExports.jsx(SubTitle,{children:"(30 ngày)"}),jsxRuntimeExports.jsx(DoughnutChart,{height:"300px",color:[palette.primary.dark,palette.primary.main,palette.primary.light]})]}),jsxRuntimeExports.jsx(StatCards2,{}),jsxRuntimeExports.jsx(Campaigns,{})]})]})})})},"Analytics");export{Analytics as default};