import{_ as u,s as h,f as p,d as e,e as t,g as o,t as s,j as r,F as l,h as _}from"./app-ad835f92.js";import{a as f}from"./swal-23a4a8dd.js";const y={data(){return{id:this.$store.state.auth.user.id,systemRole:h(),datas:[],userSystemState:[]}},computed:{filteredUserSystems(){return this.userSystemState.filter(a=>this.systemRole[a.id])}},mounted(){this.fetchData()},methods:{fetchData:async function(){const a=this;await p.get(`/api/getOneUserSubSystemState/${this.id}`).then(i=>{a.userSystemState=i.data.data}).catch(f)}}},v={class:"bg-color p-4"},g={class:"system-card mb-3"},x={key:0,class:"div-box loading p-4 me-4"},S={class:"box-none my-4"},b={class:"d-flex justify-content-between align-items-center"},k={class:"left-name"},$={class:"right-date"},R={key:0,class:"box-num mt-3"},U={class:"usaged px-3"},w={class:"limit mt-1"},B={key:1,class:"box-none mt-3"},D={key:2,class:"box-none mt-3"};function F(a,i,I,j,m,c){return e(),t("div",v,[o("div",g,[c.filteredUserSystems.length==0?(e(),t("div",x,[o("p",S,s(a.$t("global.loading")),1)])):r("",!0),(e(!0),t(l,null,_(c.filteredUserSystems,n=>(e(),t("div",{class:"div-box p-3 me-3",key:n.id},[o("div",b,[o("span",k,s(n.name),1),o("span",$,s(n.expiry_date),1)]),n.user_plan&&m.systemRole[n.id]?(e(),t("div",R,[(e(!0),t(l,null,_(n.user_plan.items,d=>(e(),t("div",{class:"flex-1 text-center",key:d.id},[o("p",U,s(d.usaged??0),1),o("p",w,s(d.item.item)+" "+s(d.amount)+" "+s(d.unit),1)]))),128))])):(e(),t("p",B,s(a.$t("backend.activate.not_activated")),1)),n.user_plan.items.length==0?(e(),t("p",D,"尚無資料")):r("",!0)]))),128))])])}const C=u(y,[["render",F],["__scopeId","data-v-f455ce7a"]]);export{C as default};
