PageSourceSearch

https://mof.gov.vn/assets/CategoryView-BlB4RvLP.js

js mof.gov.vn collected 2026-10-02 06:02:43 UTC 2,743 bytes, 1 lines download raw bytes

1import{_ as x,f as p,o as c,g as f,h as A,t as S,u as $,i as k,c as v,j as V,k as B,A as y,m as N,b as C,n as E,r as I}from"./index-B1UYKE73.js";const P={name:"LoadingSpinner",props:{showText:{type:Boolean,default:!0},text:{type:String,default:"Đang tải..."}}},j={class:"flex items-center justify-center h-full"},D={key:0,class:"ml-3 text-gray-700 font-medium"};function T(_,l,r,m,i,n){return c(),p("div",j,[l[0]||(l[0]=f("div",{class:"relative"},[f("div",{class:"w-10 h-10 border-4 border-blue-200 rounded-full"}),f("div",{class:"w-10 h-10 border-4 border-[var(--btc-blue-border)] rounded-full animate-spin border-t-transparent absolute top-0 left-0"})],-1)),r.showText?(c(),p("span",D,S(r.text),1)):A("",!0)])}const F=x(P,[["render",T]]),U={__name:"CategoryView",setup(_){const{getInsideComponent:l}=$(),r=k(),m=v(()=>(console.log(r.categoryLayoutName),l.value("Categories",r.categoryLayoutName))),i=V(),n=i.params.homeSlug||"home-slug",u=v(()=>i.params.categorySlug||"category-slug"),e=B({status:"",childCategories:[],isLeaf:!1,async getArticles(a){try{const t=await y.post("/article/reads?offset=0&limit=3",{categoryId:a});return t.data.success&&t.data.data?t.data.data:[]}catch(t){return console.error("Error fetching articles:",t),[]}finally{r.loading=!1}},async fetchChildCategories(){var a,t;try{const s=await y.get(`/articlecategory/getchildsbyslug?slug=${n}/${u.value}`,""),d=(a=s==null?void 0:s.data)==null?void 0:a.data;if((t=s==null?void 0:s.data)!=null&&t.success&&Array.isArray(d)&&d.length>0){const h=d.sort((o,g)=>o.order-g.order),b=h.map(o=>e.value.getArticles(o.id)),w=await Promise.all(b),L=h.map((o,g)=>({...o,articles:w[g]}));e.value.childCategories=L}else console.warn("No child categories found or API response invalid."),e.value.childCategories=[],e.value.fetchCategory()}catch(s){console.error("Error fetching child categories and articles:",s),e.value.status="empty"}finally{r.loading=!1}},async fetchCategory(){try{const a=await y.get(`/articlecategory/getbyslug?slug=${n}/${u.value}`,"");a.data.success&&a.data.data&&(console.log(a.data.data),e.value.childCategories.push({...a.data.data,articles:[]}),e.value.isLeaf=!0)}catch(a){console.error("Error fetching articles:",a),e.value.status="empty"}finally{r.loading=!1}}});return N(()=>u.value,async a=>{console.log("Fetch categories"),e.value.status="loading",e.value.childCategories=[],await e.value.fetchChildCategories()},{immediate:!0}),(a,t)=>E(r).loading?(c(),C(F,{key:1,style:{"min-height":"calc(-15.1rem + 100vh)"}})):(c(),C(I(m.value),{key:0,modelValue:e.value.childCategories,"onUpdate:modelValue":t[0]||(t[0]=s=>e.value.childCategories=s),isLeaf:e.value.isLeaf,status:e.value.status},null,8,["modelValue","isLeaf","status"]))}};export{U 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.