PageSourceSearch

https://sinkacementhai.com/_nuxt/C2K8ztoZ.js

js sinkacementhai.com collected 2026-10-07 14:03:10 UTC 9,583 bytes, 1 lines download raw bytes

1import{C as W,D as G,a as X,u as Z,s as P,r as p,H as k,o as ee,w as te,d as i,e as a,n as _,g as n,t as v,F as q,m as $,h as Q,Q as ae,M as le,R as se,i as oe,f as z,I as ne,T as B,O as re,c as u,J as ie}from"./B2zKXTBA.js";import{g as ue}from"./C9VRpM3s.js";import{u as ce}from"./C-El9R_f.js";import{u as de}from"./DN_qoCjR.js";import{r as ge}from"./gTDIn4Kz.js";import{r as ye}from"./DqIhgBJo.js";import"./CYpY1rdy.js";const pe={class:"font-sans bg-gray-50 min-h-screen"},ve={class:"py-2 mx-8 2xl:mx-40"},xe={class:"flex items-center space-x-2 pa-2 py-5"},fe={class:"flex flex-col xl:flex-row items-center justify-between w-full space-y-4 xl:space-y-0 xl:space-x-4"},he={class:"flex flex-grow-0 flex-shrink-0 whitespace-nowrap md:flex-wrap justify-start overflow-x-auto space-x-2 p-2 w-full xl:w-auto"},me=["onMouseover","onClick"],_e={class:"relative mt-4 xl:mt-0 w-full xl:w-auto xl:flex-1 flex-shrink-0"},we={class:"flex justify-end items-center mt-8 px-4 mb-8"},be={class:"text-gray-600",style:{fontweight:500}},ke={class:"text-orange-700"},Ce={key:0},Le={key:0,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},Se=["onClick"],Te=["src","alt"],qe={class:"p-4"},$e={class:"text-lg font-bold text-gray-800 mb-2 line-clamp-2"},Ae={class:"text-sm text-gray-500 mb-3"},Me={class:"text-sm text-gray-700 mb-3 line-clamp-2 break-all"},De=["innerHTML"],je={key:1},Re={class:"flex justify-center items-center space-x-2 mt-8 py-4"},Pe=["disabled"],Qe=["onClick"],ze=["disabled"],Be={key:1},Ke={__name:"list-article",setup(Ne){const{fetchCategoryArticleList:N,fetchAllContentList:x}=ce(),h=W(),Y=re(),o=G(),d=X(),w=Z(),s=de(),{color:A,hover_color:V}=P(w),{search_text:y,article_contents:m,temp_cate_article_list:H,qty_article_list:M}=P(s),C=p(!1),D=p(null),L=p(!1),I=p({id:"",store_id:Y.public.SHOP_ID,content_type:"",category_name:"ทั้งหมด",count_no:0,sort_no:0,created_at:null,created_by:null,updated_at:null,updated_by:null,status:!0});let b=p([]);const f=p(""),O=p(5),r=p(1),S=k(()=>Math.ceil(M.value/O.value)),E=k(()=>(m==null?void 0:m.value)??[]),j=k(()=>o.query.category_name??"สินค้าทั้งหมด"),F=k(()=>(b==null?void 0:b.value)??[]);ee(async()=>{f.value=o.query.category_id;try{let l=await N();await s.updateTempCateArticleList(l.data);let e=await x(o.query);await s.updateQTYArticleList(e.data.count),await s.updateArticleContents(e.data.contents),b.value=[I.value,...H.value]}catch(l){console.log("in catch ERROR"),console.log("err >>> ",l)}}),te([()=>r.value],async([l])=>{var e,t;if(l){let c={search:y.value?y.value:"",page:r.value?r.value:"",limit:o.query.limit,content_type:"article",category_id:(e=o==null?void 0:o.query)!=null&&e.category_id?(t=o==null?void 0:o.query)==null?void 0:t.category_id:""};d.changeStateLoading(!0);let g=await x(c);await s.updateQTYArticleList(g.data.count),await s.updateArticleContents(g.data.contents),d.changeStateLoading(!1)}});const T=l=>{l>=1&&l<=S.value&&(r.value=l)};async function K(){d.changeStateLoading(!0),s.changeSearchText("");let l={search:"",page:"1",limit:o.query.limit,content_type:"article",category_id:""},e=await x(l);await s.updateQTYArticleList(e.data.count),await s.updateArticleContents(e.data.contents),h.push({path:"/news/list-article",query:l}),r.value=1,d.changeStateLoading(!1)}async function R(){d.changeStateLoading(!0);let l={search:y.value,page:"1",limit:o.query.limit,content_type:"article",category_id:o.query.category_id?o.query.category_id:""},e=await x(l);await s.changeSearchText(y.value),await s.updateQTYArticleList(e.data.count),await s.updateArticleContents(e.data.contents),h.push({path:"/news/list-article",query:l}),r.value=1,d.changeStateLoading(!1)}function J(l){const e=ue(l.title),t=e?`${e}-${l.id}`:`${l.id}`;h.push({path:`/news/${t}`}).then(()=>{location.reload()})}async function U(l,e){d.changeStateLoading(!0),f.value=l.id;let t={search:"",page:"1",limit:o.query.limit,content_type:"article",category_id:l.id,category_name:e},c={search:"",page:"1",limit:o.query.limit,content_type:"article",category_id:"",category_name:"ทั้งหมด"};if(l.content_type==="article"){let g=await x(t);await s.updateQTYArticleList(g.data.count),await s.updateArticleContents(g.data.contents),h.push({path:"/news/list-article",query:t}),r.value=1,d.changeStateLoading(!1)}else if(l.content_type)console.log("something wrong in content category");else{s.changeSearchText("");let g=await x(c);await s.updateQTYArticleList(g.data.count),await s.updateArticleContents(g.data.contents),h.push({path:"/news/list-article",query:c}),r.value=1,d.changeStateLoading(!1)}}return(l,e)=>(u(),i("div",pe,[a("div",ve,[a("div",null,[a("ul",xe,[a("li",null,[a("a",{href:"/news",onMouseover:e[0]||(e[0]=t=>C.value=!0),onMouseleave:e[1]||(e[1]=t=>C.value=!1),style:_({textDecoration:C.value?"underline":"none"})}," บทความและวิดีโอ ",36)]),e[10]||(e[10]=a("li",null,"/",-1)),a("li",{style:_({color:n(w).color})},v(j.value==="สินค้าทั้งหมด"?"ทั้งหมด":j.value),5)])]),e[16]||(e[16]=a("h1",{class:"text-3xl font-bold text-center text-gray-800 mb
1-8"},v("บทความ"),-1)),a("div",fe,[a("div",he,[(u(!0),i(q,null,$(F.value,t=>(u(),i("button",{onMouseover:c=>D.value=t,onMouseleave:e[2]||(e[2]=c=>D.value=null),key:t,class:"cursor-pointer p-4 transition duration-150 ease-in-out hover:underline whitespace-nowrap",style:_({color:f.value===t.id?n(w).color:"black",borderBottom:f.value===t.id?"2px solid":"1px solid",borderColor:f.value===t.id?n(w).color:"transparent",fontWeight:f.value===t.id?"bold":"normal"}),onClick:c=>U(t,t.category_name)},v(t.category_name==="สินค้าทั้งหมด"?"ทั้งหมด":t.category_name),45,me))),128))]),e[11]||(e[11]=a("hr",{class:"border-t border-gray-300 my-4 w-full xl:hidden",style:{"border-color":"#D1D1D1"},role:"separator","aria-orientation":"horizontal"},null,-1)),a("div",_e,[Q(a("input",{type:"text",class:"w-full border px-4 pl-4 pr-10 py-2 border-gray-300 rounded-full focus:outline-none focus:ring-2 focus:ring-orange-700",placeholder:"ค้นหา","onUpdate:modelValue":e[3]||(e[3]=t=>se(y)?y.value=t:null),onKeyup:e[4]||(e[4]=le(t=>R(),["enter"]))},null,544),[[ae,n(y)]]),Q(a("button",{onClick:K,class:"cursor-pointer absolute inset-y-0 right-0 pr-10 flex items-center text-gray-500 hover:text-gray-700 focus:outline-none"},[z(n(ge),{class:"h-5 w-5"})],512),[[oe,n(y)]]),a("button",{onMouseover:e[5]||(e[5]=t=>L.value=!0),onMouseleave:e[6]||(e[6]=t=>L.value=!1),class:"cursor-pointer absolute right-1 top-0 h-full flex items-center",onClick:e[7]||(e[7]=t=>R())},[z(n(ye),{class:"h-8 w-8",style:_({color:L.value?n(V):n(A)})},null,8,["style"])],32)])]),e[17]||(e[17]=a("hr",{class:"border-t border-gray-300 my-4 w-full hidden xl:block",style:{"border-color":"#D1D1D1"},role:"separator","aria-orientation":"horizontal"},null,-1)),a("div",we,[a("div",be,[e[12]||(e[12]=ne(" ผลลัพธ์ที่พบ ")),a("span",ke,v(n(M))+" รายการ",1)]),e[13]||(e[13]=a("div",{class:"flex items-center space-x-2"},null,-1))]),E.value.length>0?(u(),i("div",Ce,[n(m).length>0?(u(),i("div",Le,[(u(!0),i(q,null,$(n(m).slice(0,10),(t,c)=>(u(),i("div",{key:c,class:"cursor-pointer bg-white rounded-lg shadow-md overflow-hidden",onClick:g=>J(t)},[a("img",{src:t.img_title,alt:t.img_title,class:"w-full h-48 object-contain"},null,8,Te),a("div",qe,[a("span",{class:"inline-block text-xs font-semibold px-2 py-1 mb-3 rounded-xl",style:_({color:"white",background:n(A)})},v(t.category_name),5),a("h3",$e,v(t.title),1),a("p",Ae,v(n(s).formatThaiDatetime(t.updated_at)),1),a("div",Me,[a("div",{innerHTML:n(s).cleanContentDescription(t.content)},null,8,De)])])],8,Se))),128))])):(u(),i("div",je,e[14]||(e[14]=[B('<div class="font-sans bg-gray-50 min-h-screen flex items-center justify-center p-4 sm:p-6 lg:p-8"><div class="p-8 sm:p-10 lg:p-12 text-center max-w-md w-full"><div class="mb-6 flex justify-center"><svg class="h-20 w-20 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><h1 class="text-3xl sm:text-4xl font-bold text-gray-800 mb-3"> ไม่พบข้อมูล </h1></div></div>',1)]))),a("div",Re,[a("button",{onClick:e[8]||(e[8]=t=>T(r.value-1)),disabled:r.value===1,class:"px-3 py-1 rounded-full bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:opacity-50"}," ก่อนหน้า ",8,Pe),(u(!0),i(q,null,$(S.value,t=>(u(),i("button",{key:t,onClick:c=>T(t),class:ie([{"bg-orange-700 text-white":r.value===t,"bg-gray-200 text-gray-700 hover:bg-gray-300":r.value!==t},"px-3 py-1 rounded-full"])},v(t),11,Qe))),128)),a("button",{onClick:e[9]||(e[9]=t=>T(r.value+1)),disabled:r.value===S.value,class:"px-3 py-1 rounded-full bg-gray-200 text-gray-700 hover:bg-gray-300 disabled:opacity-50"}," ถัดไป ",8,ze)])])):(u(),i("div",Be,e[15]||(e[15]=[B('<div class="font-sans bg-gray-50 min-h-screen flex items-center justify-center h-[140px] mx-2 xl:mx-0"><div class="text-center max-w-md w-full"><div class="mb-6 flex justify-center"><svg class="h-20 w-20 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div><p class="text-[14px] text-gray-800"> ไม่พบข้อมูล </p></div></div>',1)])))])]))}};export{Ke 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.