PageSourceSearch

https://www.dunkindonuts.co.kr/build/assets/Recommend-6159493f.js

js dunkindonuts.co.kr collected 2026-09-24 22:29:15 UTC 17,506 bytes, 1 lines download raw bytes

1import{j as e,x as re,a as t,F as Y,r as d,_ as Ie,b as j,S as we}from"./app-de874c55.js";import{S as be,B as E,A as Te}from"./AuthenticatedLayout-1cf934f7.js";import{A as X,b as q,c as ye,E as Oe,d as Pe,e as Ae,a as G,f as Me,M as Ee,g as Re}from"./react-icons.esm-d4f15552.js";import{c as y}from"./index-4180030f.js";import{B as h}from"./button-497dfebc.js";import{D as le,a as Fe,b as ie,c as D,d as Le,e as _e,f as Ve}from"./dropdown-menu-40c1b9b4.js";import{C as J}from"./checkbox-1206c9d9.js";import{P as $e}from"./pin-214ea7ee.js";import{P as ke}from"./pin-off-8dff2a35.js";import{U as oe,L as ze}from"./unlock-39fb04e0.js";import{f}from"./index-83894486.js";import{u as De,g as Ue,a as Ye,b as je,c as Ge,d as Be,e as He,f as Q}from"./index-aa1fa5a8.js";import{T as Ke,d as We,b as R,e as Z,a as Xe,c as F}from"./table-d3800fb9.js";import{C as qe,a as Je,b as Qe,c as Ze,d as ee,e as ae,f as ea}from"./command-c7b23504.js";import{I as aa}from"./input-c01b5075.js";import{S as sa,a as na,b as ta,c as ra,d as la}from"./select-f7dd617b.js";import{P as ce,a as de,b as me}from"./popover-7fc4f0df.js";import{M as ia}from"./monitor-f38a8d85.js";import{C as oa}from"./ConfirmModal-278bd7e9.js";import{C as ca}from"./calendar-725423db.js";import{C as da}from"./calendar-check-f3a54e30.js";import{k as ma}from"./index-338cd0f8.js";import{u as T}from"./index-0467f6fa.js";import{S as ga,a as ua}from"./react-responsive-4678f4ff.js";import{u as ha,a as U,D as pa,c as Na,S as fa,v as xa,b as se,C as Sa,d as va,K as Ca,T as Ia,M as wa}from"./sortable.esm-23bdf61b.js";import{r as ba,G as Ta}from"./modifiers.esm-39435144.js";import{F as ya}from"./filter-x-33e9a8c4.js";import{L as ne}from"./loader-2-67cca4d6.js";import"./ThemeButton-e00b02f2.js";import"./sonner-42d757ec.js";import"./createLucideIcon-7e88a5d4.js";import"./index-4bb9a49c.js";import"./index-05417dd3.js";import"./index-fb0a7497.js";import"./index-a27f1d54.js";import"./index-6f294826.js";import"./index-0d06db37.js";import"./index-b6238bce.js";import"./dialog-edc47031.js";import"./index-20f5dcbf.js";import"./alert-dialog-231d1312.js";import"./index-db981948.js";import"./index-ea379f75.js";const Oa=[{value:1,label:"고정",icon:$e},{value:0,label:"일반",icon:ke}],ge=[{value:1,label:"공개",icon:oe},{value:0,label:"비공개",icon:ze}];function v({column:a,title:n,className:i}){return a.getCanSort()?e("div",{className:y("flex items-center",i),children:t(le,{children:[e(Fe,{asChild:!0,children:t(h,{variant:"ghost",size:"md",className:"h-8 data-[state=open]:bg-accent px-1",children:[e("span",{children:n}),a.getIsSorted()==="desc"?e(X,{className:"ml-1 h-4 w-4"}):a.getIsSorted()==="asc"?e(q,{className:"ml-1 h-4 w-4"}):e(ye,{className:"ml-1 h-4 w-4"})]})}),t(ie,{align:"start",children:[t(D,{className:"text-xs",onClick:()=>a.toggleSorting(!1),children:[e(q,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"오름차순"]}),t(D,{className:"text-xs",onClick:()=>a.toggleSorting(!0),children:[e(X,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"내림차순"]}),e(Le,{}),t(D,{className:"text-xs",onClick:()=>a.toggleVisibility(!1),children:[e(Oe,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"숨기기"]})]})]})}):e("div",{className:y(i,"px-1"),children:n})}const Pa=[{id:"select",header:({table:a})=>e(J,{checked:a.getIsAllPageRowsSelected(),onCheckedChange:n=>a.toggleAllPageRowsSelected(!!n),"aria-label":"Select all"}),cell:({row:a})=>e(J,{checked:a.getIsSelected(),onCheckedChange:n=>a.toggleSelected(!!n),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1},{accessorKey:"SIDO",header:({column:a})=>e(v,{column:a,title:"지역",className:"w-[60px]"}),cell:({row:a})=>e("div",{className:"w-[60px] text-center",children:a.getValue("SIDO")})},{accessorKey:"LOCATION_INFO",header:({column:a})=>e(v,{column:a,title:"상권&입지",className:"w-[30px]"}),cell:({row:a})=>e("div",{className:"w-[300px]",children:e(re,{href:route("franchise/recommend/edit",{id:a.original.id}),data:{id:a.original.id},className:"leading-[2.5] flex items-center gap-1.5",children:a.getValue("LOCATION_INFO")})})},{accessorKey:"NAME",header:({column:a})=>e(v,{column:a,title:"담당자",className:"w-[80px]"}),cell:({row:a})=>e("div",{className:"w-[80px] text-center",children:a.getValue("NAME")})},{accessorKey:"created_at",header:({column:a})=>e(v,{column:a,title:"등록일",className:"w-[90px]"}),cell:({row:a})=>e("div",{className:"w-[80px]",children:f(new Date(a.getValue("created_at")),"y-LL-dd")})},{accessorKey:"CNT",header:({column:a})=>e(v,{column:a,title:"조회",className:"w-[60px]"}),cell:({row:a})=>e("div",{className:"w-[60px] text-center",children:a.getValue("CNT")})},{accessorKey:"VIEW_YN",header:({column:a})=>e(v,{column:a,title:"노출",className:"w-[80px]"}),cell:({row:a})=>{const n=ge.find(i=>i.value===a.getValue("VIEW_YN"));return n?t("div",{className:"flex items-center w-[80px]",children:[n.icon&&e(n.icon,{color:`${n.value===1?"hsl(var(--primary))":"hsl(var(--muted-foreground))"}`,className:"mr-1 h-4 w-4 text-muted-foreground"}),e("span",{children:n.label})]}):null}},{accessorKey:"TOP_YN",enableHiding:!1,enableSorting:!1,header:({column:a})=>null,cell:({row:a})=>null}];function Aa({table:a}){return t("div",{className:"flex items-center justify-between px-2",children:[t("div",{className:"flex-1 text-sm text-muted-foreground",children:[a.getFilteredRowModel().rows.length,"개 중"," ",a.getFilteredSelectedRowModel().rows.length,"개 선택됨"]}),t("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[t("div",{className:"flex items-center space-x-2",children:[e("p",{className:"text-sm font-medium",children:"페이지당 행 수"}),t(sa,{value:`${a.getState().pagination.pageSize}`,onValueChange:n=>{a.setPageSize(Number(n))},children:[e(na,{className:"h-8 w-[70px]",children:e(ta,{placeholder:a.getState().pagination.pageSize})}),e(ra,{side:"top",children:[10,20,50,100,500].map(n=>e(la,{value:`${n}`,children:n},n))})]})]}),t("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["페이지 ",a.getState().pagination.pageIndex+1," /"," ",a.getPageCount()]}),t("div",{className:"flex items-center space-x-2",children:[t(h,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>a.setPageIndex(0),disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"첫 페이지로"}),e(Pe,{className:"h-4 w-4"})]}),t(h,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>a.previousPage(),disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"전 페이지로"}),e(Ae,{className:"h-4 w-4"})]}),t(h,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>a.nextPage(),disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"다음 페이지로"}),e(G,{className:"h-4 w-4"})]}),t(h,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>a.setPageIndex(a.getPageCount()-1),disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"마지막 페이지로"}),e(Me,{className:"h-4 w-4"})]})]})]})]})}function Ma({table:a}){const n={SIDO:"지역",LOCATION_INFO:"상권&입지",NAME:"담당자",created_at:"등록일",CNT:"조회",VIEW_YN:"노출"};return t(le,{children:[e(_e,{asChild:!0,children:t(h,{variant:"outline",className:"h-9 flex",children:[e(Ee,{className:"mr-2 h-4 w-4"}),"보기"]})}),e(ie,{align:"end",className:"",children:a.getAllColumns().filter(i=>typeof i.accessorFn<"u"&&i.getCanHide()).map(i=>e(Ve,{className:"capitalize",checked:i.getIsVisible(),onCheckedChange:o=>i.toggleVisibility(!!o),children:n[i.id]},i.id))})]})}function te({column:a,title:n,options:i}){const o=new Set(a==null?void 0:a.getFilterValue());return t(ce,{children:[e(de,{asChild:!0,children:t(h,{variant:"outline",className:"h-9 border-dashed px-3.5",children:[n==="분류"?e(ia,{size:16,className:"mr-1.5"}):e(oe,{size:16,className:"mr-1.5"}),n,(o==null?void 0:o.size)>0&&t(Y,{children:[e(be,{orientation:"vertical",className:"mx-2 h-4"}),e(E,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:o.size}),e("div",{className:"hidden space-x-1 lg:flex",children:o.size>2?t(E,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[o.size,"개 선택됨"]}):i.filter(r=>o.has(r.value)).map(r=>e(E,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:r.label},r.value))})]})]})}),e(me,{className:"w-[150px] p-0",align:"start",children:t(qe,{children:[e(Je,{placeholder:n}),t(Qe,{children:[e(Ze,{children:"결과 없음"}),e(ee,{children:i.map(r=>{const g=o.has(r.value);return t(ae,{value:r.label,onSelect:()=>{g?o.delete(r.value):o.add(r.value);const S=Array.from(o);a==null||a.setFilterValue(S.length?S:void 0)},children:[e("div",{className:y("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",g?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e(Re,{className:y("h-4 w-4")})}),r.icon&&e(r.icon,{className:"mr-2 h-4 w-4 text-muted-foreground",color:`${r.value===1?"hsl(var(--primary))":"hsl(var(--muted-foreground))"}`}),n==="분류"?e(E,{variant:"outline",className:`${r.value=="A0"?"bg-red-100":r.value=="A1"?"bg-yellow-100":r.value=="A2"?"bg-orange-100":r.value=="A3"?"bg-blue-100":"bg-purple-100"} text-black`,children:r.label}):e("span",{children:r.label})]},r.value)})}),o.size>0&&t(Y,{children:[e(ea,{}),e(ee,{children:e(ae,{onSelect:()=>a==null?void 0:a.setFilterValue(void 0),className:"justify-center text-center",children:"필터 해제"})})]})]})]})})]})}function Ea({created_at:a,date:n,setDate:i}){function o(r){if(i(r),r.to){let g=new Date(r.to);g.setDate(g.getDate()+1),a==null||a.setFilterValue([f(r.from,"y-LL-dd"),f(g,"y-LL-dd")])}else{let g=new Date(r.from);g.setDate(g.getDate()+1),a==null||a.setFilterValue([f(r.from,"y-LL-dd"),f(g,"y-LL-dd")])}}return t(ce,{children:[e(de,{asChild:!0,children:t(h,{id:"date",variant:"outline",className:y("justify-start text-left !mt-0 border-dashed h-9 px-3.5"),children:[e(da,{size:16,className:"mr-1.5"}),n!=null&&n.from?n.to?t(Y,{children:[f(n.from,"y년 LL월 d일")," -"," ",f(n.to,"y년 LL월 d일")]}):f(n.from,"y년 LL월 d일"):e("span",{children:"기간"})]})}),e(me,{className:"w-auto p-0",align:"start",children:e(ca,{initialFocus:!0,mode:"range",defaultMonth:n==null?void 0:n.from,selected:n,onSelect:r=>o(r),numberOfMonths:2,locale:ma})})]})}function Ra({columns:a,data:n,setData:i,isLoading:o,handleEventData:r,pageCount:g}){var W;
1const[S,C]=d.useState(!1),[x,L]=d.useState([]),[N,s]=d.useState([]),[_,O]=d.useState({}),[I,p]=d.useState({}),[w,V]=d.useState([]),[ue,B]=d.useState({show:!1,type:"delete",value:""}),[he,H]=d.useState({from:"",to:""}),[$,K]=d.useState(""),c=De({data:n,columns:a,getCoreRowModel:Ue(),getPaginationRowModel:Ye(),onSortingChange:L,getSortedRowModel:je(),onColumnFiltersChange:s,getFilteredRowModel:Ge(),onColumnVisibilityChange:O,onRowSelectionChange:p,getFacetedRowModel:Be(),getFacetedUniqueValues:He(),manualFiltering:!0,manualPagination:!0,manualSorting:!0,pageCount:g,state:{sorting:x,columnFilters:N,columnVisibility:_,rowSelection:I,selectedEventId:w},initialState:{pagination:{pageSize:20,pageIndex:0}}}),pe=c.getState().columnFilters.length>0;function Ne(l,m){j.delete("/api/recommend",{data:{data:m.value}}).then(u=>{r({pageIndex:c.getState().pagination.pageIndex+1,pageSize:c.getState().pagination.pageSize},N,x),p({}),V([]),T.success("삭제되었습니다.")}).catch(u=>{T.error("오류로 인해 삭제하지 못했습니다.",{description:u.response.data.message})})}d.useEffect(()=>{V(c.getSelectedRowModel().rows.map(({original:l})=>l.id))},[I]),d.useEffect(()=>{p({}),V([]),r({pageIndex:c.getState().pagination.pageIndex+1,pageSize:c.getState().pagination.pageSize},N,x)},[c.getState().pagination.pageIndex,c.getState().pagination.pageSize,N,x]),d.useEffect(()=>{c.setPageIndex(0)},[N,x]),d.useEffect(()=>{const l=Ie.debounce(m=>{var u;return(u=c.getColumn("LOCATION_INFO"))==null?void 0:u.setFilterValue(m)},275);return l($),()=>{l.cancel()}},[$]);const fe=({rowId:l})=>{const{attributes:m,listeners:u}=se({id:l});return e(F,{className:"px-2 cursor-move",...m,...u,children:e(Ta,{size:16})})},xe=({row:l})=>{const{transform:m,transition:u,setNodeRef:z,isDragging:P}=se({id:l.original.id}),A={transform:Sa.Transform.toString(m),transition:u,opacity:P?.5:1,zIndex:P?1:0,position:"relative"};return t(R,{"data-state":l.getIsSelected()&&"selected",className:`h-10 ${l.getValue("TOP_YN")?"bg-orange-50 dark:bg-orange-950":""}`,ref:z,style:A,children:[e(fe,{rowId:l.original.id}),l.getVisibleCells().map(b=>e(F,{className:"p-0",children:Q(b.column.columnDef.cell,b.getContext())},b.id))]})};function Se(l){const{active:m,over:u}=l;if(m&&u&&m.id!==u.id){C(!0);const z=k.indexOf(m.id),P=k.indexOf(u.id),A=va(n,z,P);i(()=>A);const b=A.map((M,Ce)=>({id:M.id,SORT:c.getState().pagination.pageSize*c.getState().pagination.pageIndex+(Ce+1)}));j.post("/api/recommend/changeOrder",{data:b}).then(M=>{C(!1),T.success("수정되었습니다.")}).catch(M=>{T.error("오류로 인해 수정하지 못했습니다",{description:M.response.data.message}),C(!1)})}}const ve=ha(U(wa,{}),U(Ia,{}),U(Ca,{})),k=d.useMemo(()=>n==null?void 0:n.map(({id:l})=>l),[n]);return t("div",{children:[t("div",{className:"flex items-end pb-4 justify-between",children:[e("div",{className:"flex items-center flex-1 gap-2",children:t("div",{className:"flex flex-col gap-2",children:[t("div",{className:"flex gap-2",children:[e(te,{column:c.getColumn("VIEW_YN"),title:"노출",options:ge}),e(te,{column:c.getColumn("TOP_YN"),title:"상단 고정",options:Oa}),e(Ea,{created_at:c.getColumn("created_at"),date:he,setDate:H})]}),t("div",{className:"flex gap-1.5 items-center",children:[e(aa,{placeholder:"검색",value:$,onChange:l=>K(l.target.value),className:"w-[400px] mo:w-full"}),pe&&t(h,{variant:"secondary",onClick:()=>{c.resetColumnFilters(),H({from:"",to:""}),K("")},className:"px-3.5 h-9 space-x-1.5",children:[e(ya,{size:16}),e("span",{children:"필터 해제"})]})]})]})}),t("div",{className:"flex gap-2",children:[!!w.length&&e(h,{variant:"destructive",type:"button",onClick:()=>{B({type:"delete",show:!0,value:w})},children:"삭제"}),e(Ma,{table:c}),e(re,{href:route("franchise/recommend/edit"),children:e(h,{children:"등록"})})]})]}),t(ga,{className:"rounded-md border",children:[e(pa,{collisionDetection:Na,modifiers:[ba],onDragEnd:Se,sensors:ve,children:t(Ke,{children:[e(We,{children:c.getHeaderGroups().map(l=>t(R,{children:[e(Z,{}),l.headers.map(m=>e(Z,{children:m.isPlaceholder?null:Q(m.column.columnDef.header,m.getContext())},m.id))]},l.id))}),e(Xe,{className:"relative",children:t(fa,{items:k,strategy:xa,children:[S&&e(R,{className:"absolute border-none w-full h-full z-10",children:e(F,{className:"w-full h-full flex justify-center items-center",children:e(ne,{size:20,color:"hsl(var(--primary))",className:"animate-spin"})})}),(W=c.getRowModel().rows)!=null&&W.length?c.getRowModel().rows.map(l=>e(xe,{row:l},l.id)):e(R,{children:e(F,{colSpan:a.length,className:"h-24",children:e("div",{className:"flex justify-center",children:o?e(ne,{size:18,color:"hsl(var(--primary))",className:"animate-spin"}):"결과 없음"})})})]})})]})}),e(ua,{orientation:"horizontal"})]}),e("div",{className:"mt-3",children:e(Aa,{table:c})}),e(oa,{confirmModal:ue,setConfirmModal:B,handleDelete:Ne})]})}
1function Fa(){const[a,n]=d.useState([]),[i,o]=d.useState(!1),[r,g]=d.useState(1);function S({pageSize:C,pageIndex:x},L,N){var O,I;o(!0);const s={};for(const{id:p,value:w}of L)s[p]=w;const _=N.length!==0?[`${(O=N[0])==null?void 0:O.id}:${(I=N[0])!=null&&I.desc?"desc":"asc"}`]:null;j.get("/api/recommend",{params:{pageSize:C,page:x,sort:_,filters:{$and:[{$or:[{LOCATION_INFO:{$contains:s==null?void 0:s.LOCATION_INFO}},{SIDO:{$contains:s==null?void 0:s.LOCATION_INFO}},{NAME:{$contains:s==null?void 0:s.LOCATION_INFO}}]},{TEL:{$in:s==null?void 0:s.TEL},GUGUN:{$in:s==null?void 0:s.GUGUN},BUSINESS_TYPE:{$in:s==null?void 0:s.BUSINESS_TYPE},FLOOR:{$in:s==null?void 0:s.FLOOR},AREA:{$in:s==null?void 0:s.AREA},MAP_TYPE:{$in:s==null?void 0:s.MAP_TYPE},ADDR_POST:{$in:s==null?void 0:s.ADDR_POST},ADDR_SI:{$in:s==null?void 0:s.ADDR_SI},ADDR_GUGUN:{$in:s==null?void 0:s.ADDR_GUGUN},ADDR_DETAIL:{$in:s==null?void 0:s.ADDR_DETAIL},POINT_X:{$in:s==null?void 0:s.POINT_X},POINT_Y:{$in:s==null?void 0:s.POINT_Y},FILENAME:{$in:s==null?void 0:s.FILENAME},PREMIUM:{$in:s==null?void 0:s.PREMIUM},DEPOSIT:{$in:s==null?void 0:s.DEPOSIT},MAINTENANCE:{$in:s==null?void 0:s.MAINTENANCE},DESCRIPTION:{$in:s==null?void 0:s.DESCRIPTION},VIEW_YN:{$in:s==null?void 0:s.VIEW_YN},TOP_YN:{$in:s==null?void 0:s.TOP_YN},created_at:{$between:s==null?void 0:s.created_at}}]}}}).then(p=>{n(p.data.data),g(p.data.meta.last_page),o(!1)}).catch(p=>T.error("오류가 발생했습니다.",{description:p.response.data.message}))}return e(Ra,{columns:Pa,handleEventData:S,data:a,setData:n,isLoading:i,pageCount:r})}function ws(a){return t(Te,{auth:a.auth,errors:a.errors,children:[e(we,{title:"추천점포매물"}),t("div",{className:"space-y-4 mb-10 mo:mb-5",children:[t("div",{className:"flex items-center space-x-1 text-sm text-muted-foreground",children:[e("div",{children:"창업"}),e(G,{}),e("div",{children:"추천점포매물"}),e(G,{}),e("div",{className:"font-medium text-foreground",children:"매물 관리"})]}),e("h1",{className:"text-3xl font-bold tracking-tight",children:"추천점포매물"})]}),e(Fa,{})]})}export{ws as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.