import{_ as f,s as g,r as p,o,c as i,a as t,t as n,F as v,b as z,d as u,h as y,f as h,e as w,w as L}from"./index-e263e3d6.js";const m={name:"CasesView",data(){return{casesList:[],loading:!0,adminService:g}},created(){this.loadCasesData()},watch:{"$i18n.locale"(){console.log("语言切换,刷新显示..."),this.$forceUpdate()}},methods:{async loadCasesData(){this.loading=!0;try{console.log("开始从Supabase加载案件数据(长内容管理器)..."),console.log("当前语言:",this.$i18n.locale);const e=await this.adminService.getCasesList({limit:50});this.casesList=e||[],console.log("成功加载案件数据(长内容管理器)"),console.log("案件总数:",this.casesList.length),console.log("案件示例:",this.casesList.length>0?{id:this.casesList[0].id,title:this.casesList[0].title,case_status:this.casesList[0].case_status,case_date:this.casesList[0].case_date}:"无数据")}catch(e){console.error("加载案件数据失败:",e),this.casesList=[]}finally{this.loading=!1}},getLocalizedTitle(e){if(!e)return"";const a=this.$i18n.locale==="zh"?"zh":"en";if(e.title&&typeof e.title=="object"){const s=e.title[a]||e.title.zh||e.title.en;if(s)return s}return typeof e.title=="string"?a==="zh"?e.title:e.title_en||e.title:a==="zh"?e.title_zh||"无标题":e.title_en||e.title_zh||"No Title"},getLocalizedSummary(e){if(!e)return"";const a=this.$i18n.locale==="zh"?"zh":"en";if(e.case_overview){if(typeof e.case_overview=="object"){const s=e.case_overview[a]||e.case_overview.zh||e.case_overview.en;if(s)return s}else if(typeof e.case_overview=="string")return e.case_overview}if(e.description){if(typeof e.description=="object"){const s=e.description[a]||e.description.zh||e.description.en;if(s)return s}else if(typeof e.description=="string")return e.description}if(e.summary){if(typeof e.summary=="object"){const s=e.summary[a]||e.summary.zh||e.summary.en;if(s)return s}else if(typeof e.summary=="string")return e.summary}return a==="zh"?e.description_zh||e.summary_zh||"":e.description_en||e.summary_en||e.description_zh||e.summary_zh||""},getCaseStatusClass(e){return{申诉中:"ongoing",调查中:"ongoing",庭审中:"ongoing",等待判决:"ongoing",上诉中:"ongoing",已结案:"closed",和解:"settled",撤案:"dismissed"}[e]||"unknown"},formatDate(e){if(!e)return"";if(typeof e=="object"&&e!==null){const s=this.$i18n.locale==="zh"?"zh":"en";e=e[s]||e.zh||e.en||""}if(!e)return"";const a=new Date(e);return new Intl.DateTimeFormat(this.$i18n.locale==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",timeZone:"Asia/Shanghai"}).format(a)},getLocalizedField(e,a){if(!e||!a)return"";const s=e[a];if(s==null)return"";if(typeof s=="string")return s;if(typeof s=="object"){const d=this.$i18n.locale==="zh"?"zh":"en";return s[d]||s.zh||s.en||""}return String(s)}}},b={class:"cases"},C={class:"page-header"},k={class:"cases-intro"},F={class:"container"},V={key:0},j={key:1},D={class:"cases-list"},$={class:"container"},T={key:0,class:"loading-container"},N={key:1,class:"cases-grid"},A={class:"case-header"},B={class:"case-date"},S={key:0,class:"case-location"},I={class:"case-summary"},R={key:2,class:"empty-state"},U={class:"case-help"},M={class:"container"},E={key:0},W={key:1},Z={href:"mailto:[email protected]",class:"contact-button"};function q(e,a,s,d,r,l){const _=p("router-link");return o(),i("div",b,[t("header",C,[t("h1",null,n(e.$t("nav.cases")),1)]),t("section",k,[t("div",F,[e.$i18n.locale==="zh"?(o(),i("p",V," 公民权利同盟致力于维护和保障公民的基本权利。我们关注并支持各类公民权利案件,旨在推动司法公正和法治建设。以下是我们正在关注和支持的部分案件。 ")):(o(),i("p",j," The Alliance for Citizens' Rights is committed to upholding and safeguarding the fundamental rights of citizens. We monitor and support various citizens' rights cases, aiming to promote judicial justice and the rule of law. Below are some of the cases we are following and supporting. "))])]),t("section",D,[t("div",$,[r.loading?(o(),i("div",T,[a[0]||(a[0]=t("div",{class:"loading-bounce"},[t("div",{class:"bounce1"}),t("div",{class:"bounce2"}),t("div",{class:"bounce3"})],-1)),t("p",null,n(e.$i18n.locale==="zh"?"加载中...":"Loading..."),1)])):(o(),i("div",N,[(o(!0),i(v,null,z(r.casesList,c=>(o(),i("div",{key:c.id,class:"case-card"},[t("div",A,[t("h2",null,n(l.getLocalizedTitle(c)),1),t("span",{class:y(["case-status",l.getCaseStatusClass(l.getLocalizedField(c,"case_status"))])},n(l.getLocalizedField(c,"case_status")||"未知状态"),3)]),t("div",B,n(l.formatDate(l.getLocalizedField(c,"case_date"))),1),l.getLocalizedField(c,"case_location")?(o(),i("div",S,[a[1]||(a[1]=t("i",{class:"fas fa-map-marker-alt"},null,-1)),h(" "+n(l.getLocalizedField(c,"case_location")),1)])):u("",!0),t("p",I,n(l.getLocalizedSummary(c)),1),w(_,{to:`/cases/${c.id}`,class:"view-details"},{default:L(()=>[h(n(e.$i18n.locale==="zh"?"查看详情":"View Details"),1)]),_:2},1032,["to"])]))),128))])),!r.loading&&r.casesList.length===0?(o(),i("div",R,[t("p",null,n(e.$i18n.locale==="zh"?"暂无案件信息":"No case information available"),1)])):u("",!0)])]),t("section",U,[t("div",M,[t("h2",null,n(e.$i18n.locale==="zh"?"公民权利侵犯案件":"Civil Rights Violation Cases"),1),e.$i18n.locale==="zh"?(o(),i("p",E," 如果您认为您的公民权利受到侵犯,或者您希望报告一个公民权利侵犯案件,请联系我们。公民权利同盟会尽力提供必要的支持和资源。 ")):(o(),i("p",W," If you believe your civil rights have been violated, or if you would like to report a civil rights violation case, please contact us. The Alliance for Citizens' Rights will do its best to provide necessary support and resources. ")),t("a",Z,n(e.$i18n.locale==="zh"?"联系我们":"Contact Us"),1)])])])}const H=f(m,[["render",q],["__scopeId","data-v-bda96d0a"]]);export{H as default};