oj/dist/js/app.d621846b.js
2025-02-24 00:42:04 +08:00

2 lines
28 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){"use strict";var e={2978:function(e,t,o){var n=o(5130),l=o(6768);const i={class:"app"},a={key:0,class:"loading"},s={key:1,class:"login-prompt"},r={class:"sidebar"},c={class:"nav-links"},d={class:"main-content"};function u(e,t,o,n,u,h){const p=(0,l.g2)("router-link"),m=(0,l.g2)("router-view");return(0,l.uX)(),(0,l.CE)("div",i,[u.isLoading?((0,l.uX)(),(0,l.CE)("div",a," 加载中... ")):u.isLoggedIn?((0,l.uX)(),(0,l.CE)(l.FK,{key:2},[(0,l.Lk)("div",r,[(0,l.Lk)("div",c,[(0,l.bF)(p,{to:"/problems",class:"nav-item"},{default:(0,l.k6)((()=>t[4]||(t[4]=[(0,l.eW)("题目列表")]))),_:1}),(0,l.bF)(p,{to:"/my",class:"nav-item"},{default:(0,l.k6)((()=>t[5]||(t[5]=[(0,l.eW)("我标记的题目")]))),_:1}),(0,l.bF)(p,{to:"/about",class:"nav-item"},{default:(0,l.k6)((()=>t[6]||(t[6]=[(0,l.eW)("关于")]))),_:1})]),t[7]||(t[7]=(0,l.Lk)("div",{class:"footer-info"},[(0,l.Lk)("div",{class:"version-info"},"NEU小站OJ题库 - v1.0"),(0,l.Lk)("div",{class:"source-info"},[(0,l.eW)("© 2025 "),(0,l.Lk)("a",{href:"https://www.东北大学.com",target:"_blank"},"NEU小站")])],-1))]),(0,l.Lk)("div",d,[(0,l.bF)(m)])],64)):((0,l.uX)(),(0,l.CE)("div",s,[t[1]||(t[1]=(0,l.Lk)("div",{class:"login-message"},"请登录后进入NEU小站OJ题库",-1)),(0,l.Lk)("button",{class:"login-button",onClick:t[0]||(t[0]=(...e)=>h.goToLogin&&h.goToLogin(...e))},"前往登录"),t[2]||(t[2]=(0,l.Lk)("div",{class:"login-note"},"本系统所有题目来自东北大学OJ系统本站仅归纳展示题目不提供在线评测环境。",-1)),t[3]||(t[3]=(0,l.Lk)("div",{class:"login-note"},"本系统向所有用户公开,仅需注册账号即可使用,无需经过校内验证。",-1))]))])}var h=o(8704),p={data(){return{isLoggedIn:!1,isLoading:!0,token:h.A.get("token")||""}},watch:{isLoggedIn:{handler(e){document.title=e?"NEU小站OJ题库 - 题目列表":"NEU小站OJ题库"},immediate:!0}},methods:{async checkLoginStatus(){try{const e=await fetch("https://api.oj.东北大学.com/check_login",{headers:{Authorization:this.token}}),t=await e.json();this.isLoggedIn=t.isLoggedIn}catch(e){console.error("Error:",e),this.isLoggedIn=!1}finally{this.isLoading=!1}},goToLogin(){window.location.href="https://www.东北大学.com/submission"}},mounted(){this.checkLoginStatus()}},m=o(1241);const g=(0,m.A)(p,[["render",u]]);var k=g,f=o(1387),b=o(4232);const v={class:"problem-list"},L={class:"filters"},y={class:"knowledge-search",ref:"knowledgeSearch"},w={key:0,class:"knowledge-list"},P=["onClick"],C={class:"problems-table"},T=["onClick"],E={key:1,class:"no-knowledge"},_={class:"pagination"},S=["disabled"],K=["disabled"],j={class:"quick-jump"},$=["max"];function F(e,t,o,i,a,s){return(0,l.uX)(),(0,l.CE)("div",v,[(0,l.Lk)("div",L,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>a.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,a.title]]),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>a.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,a.content]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>a.difficulty=e)},t[12]||(t[12]=[(0,l.Fv)('<option value="" data-v-4fb05069>全部难度</option><option value="1" data-v-4fb05069>1</option><option value="2" data-v-4fb05069>2</option><option value="3" data-v-4fb05069>3</option><option value="4" data-v-4fb05069>4</option><option value="5" data-v-4fb05069>5</option><option value="6" data-v-4fb05069>6</option><option value="7" data-v-4fb05069>7</option><option value="8" data-v-4fb05069>8</option><option value="9" data-v-4fb05069>9</option><option value="10" data-v-4fb05069>10</option>',11)]),512),[[n.u1,a.difficulty]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>a.statusFilter=e)},t[13]||(t[13]=[(0,l.Lk)("option",{value:""},"全部状态",-1),(0,l.Lk)("option",{value:"0"},"不显示已会的题",-1),(0,l.Lk)("option",{value:"1"},"不显示已会和不会的题",-1)]),512),[[n.u1,a.statusFilter]]),(0,l.Lk)("div",y,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>a.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>s.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>s.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,a.knowledgeSearch]]),a.showKnowledgeList?((0,l.uX)(),(0,l.CE)("div",w,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.knowledgePoints,(e=>((0,l.uX)(),(0,l.CE)("div",{key:e.id,onClick:t=>s.selectKnowledge(e),class:"knowledge-item"},(0,b.v_)(e.title),9,P)))),128))])):(0,l.Q3)("",!0)],512)]),(0,l.Lk)("table",C,[t[14]||(t[14]=(0,l.Lk)("thead",null,[(0,l.Lk)("tr",null,[(0,l.Lk)("th",null,"编号"),(0,l.Lk)("th",null,"标题"),(0,l.Lk)("th",null,"难度"),(0,l.Lk)("th",null,"知识点"),(0,l.Lk)("th",null,"状态")])],-1)),(0,l.Lk)("tbody",null,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.problems,(e=>((0,l.uX)(),(0,l.CE)("tr",{key:e.id,onClick:t=>s.goToProblem(e.id)},[(0,l.Lk)("td",null,(0,b.v_)(e.id),1),(0,l.Lk)("td",null,(0,b.v_)(e.title),1),(0,l.Lk)("td",null,(0,b.v_)(s.getDifficultyText(e.difficulty)),1),(0,l.Lk)("td",null,[e.knowledge&&e.knowledge.length>0?((0,l.uX)(!0),(0,l.CE)(l.FK,{key:0},(0,l.pI)(e.knowledge,(e=>((0,l.uX)(),(0,l.CE)("span",{key:e.id,class:"knowledge-tag"},(0,b.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",E,"无"))]),(0,l.Lk)("td",null,[(0,l.Lk)("span",{class:(0,b.C4)(["status-tag",{unmarked:null===e.status,solved:1===e.status,unsolved:0===e.status}])},(0,b.v_)(s.getStatusText(e.status)),3)])],8,T)))),128))])]),(0,l.Lk)("div",_,[(0,l.Lk)("button",{disabled:1===a.page,onClick:t[7]||(t[7]=e=>s.changePage(a.page-1))},"上一页",8,S),(0,l.Lk)("span",null,"第 "+(0,b.v_)(a.page)+" 页 / 共 "+(0,b.v_)(a.totalPages)+" 页",1),(0,l.Lk)("button",{disabled:a.page===a.totalPages,onClick:t[8]||(t[8]=e=>s.changePage(a.page+1))},"下一页",8,K),(0,l.Lk)("div",j,[t[15]||(t[15]=(0,l.eW)(" 快速跳转至 ")),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[9]||(t[9]=e=>a.jumpPage=e),type:"number",min:"1",max:a.totalPages,onKeyup:t[10]||(t[10]=(0,n.jR)(((...e)=>s.handleJump&&s.handleJump(...e)),["enter"]))},null,40,$),[[n.Jo,a.jumpPage]]),t[16]||(t[16]=(0,l.eW)(" 页 ")),(0,l.Lk)("button",{onClick:t[11]||(t[11]=(...e)=>s.handleJump&&s.handleJump(...e))},"跳转")])])])}o(4114);var O={data(){return{problems:[],page:1,totalPages:1,title:"",content:"",difficulty:"",statusFilter:"",knowledgeSearch:"",knowledgePoints:[],showKnowledgeList:!1,selectedKnowledge:null,token:h.A.get("token")||"",jumpPage:""}},methods:{async fetchProblems(){try{const e=await fetch("https://api.oj.东北大学.com/problem_list",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({page:this.page,title:this.title||void 0,content:this.content||void 0,difficulty:this.difficulty?Number(this.difficulty):void 0,status_filter:this.statusFilter?Number(this.statusFilter):void 0,knowledge_id:this.selectedKnowledge?.id})}),t=await e.json();this.problems=t.problems,this.totalPages=t.pages;const o={...this.$route.query,page:this.page};this.$router.replace({query:o},{keepActiveRoute:!0})}catch(e){console.error("Error:",e)}},goToProblem(e){this.$router.push(`/problem/${e}`)},changePage(e){e<1||e>this.totalPages||(this.page=e,this.fetchProblems())},getDifficultyText(e){const t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10"};return t[e]||"未知"},getStatusText(e){const t={0:"不会",1:"已会",null:"未标记"};return t[e]||"未标记"},async fetchKnowledgePoints(){try{const e=await fetch("https://api.oj.东北大学.com/knowledge",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({search:this.knowledgeSearch})}),t=await e.json();this.knowledgePoints=t,this.showKnowledgeList=!0}catch(e){console.error("Error:",e)}},selectKnowledge(e){this.selectedKnowledge=e,this.knowledgeSearch=e.title,this.showKnowledgeList=!1,this.page=1,this.fetchProblems()},goToKnowledge(e){this.$router.push({path:"/problems",query:{knowledge_id:e.id}})},handleClickOutside(e){const t=this.$refs.knowledgeSearch;t&&!t.contains(e.target)&&(this.showKnowledgeList=!1,this.selectedKnowledge||(this.knowledgeSearch=""))},handleJump(){const e=parseInt(this.jumpPage);e&&e>=1&&e<=this.totalPages?this.changePage(e):alert("请输入有效的页码!"),this.jumpPage=""}},watch:{title(){this.page=1,this.fetchProblems()},difficulty(){this.page=1,this.fetchProblems()},statusFilter(){this.page=1,this.fetchProblems()},content(){this.page=1,this.fetchProblems()},knowledgeSearch(e){e||(this.selectedKnowledge=null,this.page=1,this.fetchProblems())},"$route.query.page":{immediate:!0,handler(e){const t=parseInt(e);t&&t>=1&&(this.page=t,this.fetchProblems())}}},mounted(){const e=parseInt(this.$route.query.page);e&&e>=1&&(this.page=e),document.title="题目列表 - OJ题库 - NEU小站",this.fetchProblems(),document.addEventListener("click",this.handleClickOutside)},unmounted(){document.removeEventListener("click",this.handleClickOutside)}};const x=(0,m.A)(O,[["render",F],["__scopeId","data-v-4fb05069"]]);var A=x;const X={key:0,class:"problem-detail"},J={class:"problem-header"},N={class:"problem-meta"},I={class:"difficulty"},U={class:"knowledge-points",style:{"margin-top":"10px"}},M={key:1,class:"no-knowledge"},q={class:"feedback-section",style:{"margin-top":"10px"}},V={class:"problem-content"},W={class:"content-section"},D=["innerHTML"],z={class:"content-section"},H={class:"limits-container"},B={class:"limit-item"},Q={class:"limit-value"},R={class:"limit-item"},G={class:"limit-value"},Y={class:"content-section"},Z={class:"example"},ee={key:0,class:"content-section"},te=["innerHTML"],oe={class:"problem-status"},ne=["disabled"],le=["disabled"],ie={key:1,class:"modal"},ae={class:"modal-content"},se={class:"form-group"},re=["value"],ce={class:"form-group"},de={class:"quick-tags"},ue=["onClick"],he={class:"modal-actions"};function pe(e,t,o,i,a,s){return(0,l.uX)(),(0,l.CE)(l.FK,null,[a.problem?((0,l.uX)(),(0,l.CE)("div",X,[(0,l.Lk)("div",J,[(0,l.Lk)("h1",null,(0,b.v_)(a.problem.title),1),(0,l.Lk)("div",N,[(0,l.Lk)("span",I,"难度:"+(0,b.v_)(s.getDifficultyText(a.problem.difficulty)),1),(0,l.Lk)("div",U,[t[8]||(t[8]=(0,l.eW)(" 知识点: ")),a.problem.knowledge&&a.problem.knowledge.length>0?((0,l.uX)(!0),(0,l.CE)(l.FK,{key:0},(0,l.pI)(a.problem.knowledge,(e=>((0,l.uX)(),(0,l.CE)("span",{key:e.id,class:"knowledge-tag"},(0,b.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",M,"无"))]),(0,l.Lk)("div",q,[t[9]||(t[9]=(0,l.eW)(" 题目有问题?")),(0,l.Lk)("button",{class:"feedback-btn",onClick:t[0]||(t[0]=e=>a.showFeedbackModal=!0)},"反馈")])])]),(0,l.Lk)("div",V,[(0,l.Lk)("div",W,[t[10]||(t[10]=(0,l.Lk)("h2",null,"题目描述",-1)),(0,l.Lk)("div",{innerHTML:s.renderedContent},null,8,D)]),(0,l.Lk)("div",z,[t[13]||(t[13]=(0,l.Lk)("h2",null,"题目限制",-1)),(0,l.Lk)("div",H,[(0,l.Lk)("div",B,[t[11]||(t[11]=(0,l.Lk)("span",{class:"limit-label"},"内存限制:",-1)),(0,l.Lk)("span",Q,(0,b.v_)((a.problem.memory_limit/1024).toFixed(1))+" MB",1)]),(0,l.Lk)("div",R,[t[12]||(t[12]=(0,l.Lk)("span",{class:"limit-label"},"时间限制:",-1)),(0,l.Lk)("span",G,(0,b.v_)(a.problem.time_limit)+" s",1)])])]),(0,l.Lk)("div",Y,[t[16]||(t[16]=(0,l.Lk)("h2",null,"示例",-1)),(0,l.Lk)("div",Z,[t[14]||(t[14]=(0,l.Lk)("h3",null,"输入",-1)),(0,l.Lk)("pre",null,(0,b.v_)(a.problem.example_input),1),t[15]||(t[15]=(0,l.Lk)("h3",null,"输出",-1)),(0,l.Lk)("pre",null,(0,b.v_)(a.problem.example_output),1)])]),a.problem.hint?((0,l.uX)(),(0,l.CE)("div",ee,[t[17]||(t[17]=(0,l.Lk)("h2",null,"提示",-1)),(0,l.Lk)("div",{innerHTML:s.renderedHint},null,8,te)])):(0,l.Q3)("",!0)]),(0,l.Lk)("div",oe,[(0,l.Lk)("button",{onClick:t[1]||(t[1]=e=>s.markProblem(0)),class:(0,b.C4)({active:0===a.problem.status})}," 不会 ",2),(0,l.Lk)("button",{onClick:t[2]||(t[2]=e=>s.markProblem(1)),class:(0,b.C4)({active:1===a.problem.status})}," 已会 ",2),(0,l.Lk)("button",{onClick:t[3]||(t[3]=(...e)=>s.goToPreviousProblem&&s.goToPreviousProblem(...e)),class:"previous-problem",disabled:!a.problem.last}," 上一题 ",8,ne),(0,l.Lk)("button",{onClick:t[4]||(t[4]=(...e)=>s.goToNextProblem&&s.goToNextProblem(...e)),class:"next-problem",disabled:!a.problem.next}," 下一题 ",8,le)])])):(0,l.Q3)("",!0),a.showFeedbackModal?((0,l.uX)(),(0,l.CE)("div",ie,[(0,l.Lk)("div",ae,[t[20]||(t[20]=(0,l.Lk)("h3",null,"题目问题反馈",-1)),(0,l.Lk)("div",se,[t[18]||(t[18]=(0,l.Lk)("label",null,"题目:",-1)),(0,l.Lk)("input",{type:"text",value:a.problem.title,disabled:""},null,8,re)]),(0,l.Lk)("div",ce,[t[19]||(t[19]=(0,l.Lk)("label",null,"反馈内容:",-1)),(0,l.bo)((0,l.Lk)("textarea",{"onUpdate:modelValue":t[5]||(t[5]=e=>a.feedbackContent=e),placeholder:"请描述您遇到的问题...",rows:"4"},null,512),[[n.Jo,a.feedbackContent]])]),(0,l.Lk)("div",de,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.quickTags,(e=>((0,l.uX)(),(0,l.CE)("button",{key:e,onClick:t=>s.appendTag(e),class:"tag-btn"},(0,b.v_)(e),9,ue)))),128))]),(0,l.Lk)("div",he,[(0,l.Lk)("button",{onClick:t[6]||(t[6]=(...e)=>s.submitFeedback&&s.submitFeedback(...e)),class:"submit-btn"},"提交"),(0,l.Lk)("button",{onClick:t[7]||(t[7]=e=>a.showFeedbackModal=!1),class:"cancel-btn"},"取消")])])])):(0,l.Q3)("",!0)],64)}var me=o(642),ge=o(1995),ke=o.n(ge),fe=o(1109),be=(o(9351),o(437)),ve=o(8734),Le=o.n(ve),ye={data(){return{problem:null,md:null,token:h.A.get("token")||"",showFeedbackModal:!1,feedbackContent:"",quickTags:["图片无法加载","公式渲染错乱","题目内容有误"]}},created(){this.md=new me.A({html:!0,breaks:!0,linkify:!0,highlight:function(e,t){if(t&&fe.A.getLanguage(t))try{return fe.A.highlight(e,{language:t}).value}catch(o){}return""}});const e=this.md.renderer.rules.text||function(e,t,o,n,l){return l.renderToken(e,t,o)};this.md.renderer.rules.text=function(t,o,n,l,i){let a=t[o].content;return a=a.replace(/(?<!\\)\$((?!\$)[^$]+?)\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX error:",o),e}})),a=a.replace(/(?<!\\)\$\$((?:.|\n)+?)\$\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX error:",o),e}})),t[o].content=a,e(t,o,n,l,i)},this.md.use(ke())},computed:{renderedContent(){if(!this.problem)return"";let e=this.md.render(this.problem.content);return e=e.replace(/\$([^$\n]+?)\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=Le().decode(e),e},renderedHint(){if(!this.problem||!this.problem.hint)return"";let e=this.md.render(this.problem.hint);return e=e.replace(/\$([^$\n]+?)\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return be.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=Le().decode(e),e}},methods:{async fetchProblem(){try{const e=await fetch(`https://api.oj.东北大学.com/problem?problem_id=${this.$route.params.id}`,{headers:{Authorization:this.token}});this.problem=await e.json()}catch(e){console.error("Error:",e)}},async markProblem(e){try{const t=await fetch("https://api.oj.东北大学.com/mark",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({problem_id:this.problem.id,status:this.problem.status===e?2:e})});t.ok&&await this.fetchProblem()}catch(t){console.error("Error:",t)}},getDifficultyText(e){const t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10"};return t[e]||"未知"},goToKnowledge(e){this.$router.push({path:"/problems",query:{knowledge_id:e.id}})},async goToNextProblem(){this.problem.next?this.$router.push(`/problem/${this.problem.next}`):alert("已经是最后一题了~")},async goToPreviousProblem(){this.problem.last?this.$router.push(`/problem/${this.problem.last}`):alert("已经是第一题了~")},appendTag(e){this.feedbackContent?this.feedbackContent+=" "+e:this.feedbackContent=e},async submitFeedback(){if(this.feedbackContent.trim())try{const e=await fetch("https://api.oj.东北大学.com/report",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({problem_id:this.problem.id,content:this.feedbackContent.trim()})});if(e.ok)alert("反馈已提交,感谢您的支持!"),this.showFeedbackModal=!1,this.feedbackContent="";else{const t=await e.json();alert(t.error||"提交失败,请稍后重试")}}catch(e){console.error("Error:",e),alert("提交失败,请稍后重试")}else alert("请输入反馈内容!")}},mounted(){this.fetchProblem()},watch:{"$route.params.id"(){this.fetchProblem()},"problem.title"(){this.problem&&this.problem.title&&(document.title=`${this.problem.title} - OJ题库 - NEU小站`)}}};const we=(0,m.A)(ye,[["render",pe]]);var Pe=we;const Ce={class:"problem-list"},Te={class:"filters"},Ee={class:"knowledge-search",ref:"knowledgeSearch"},_e={key:0,class:"knowledge-list"},Se=["onClick"],Ke={class:"problems-table"},je=["onClick"],$e={key:1,class:"no-knowledge"},Fe={class:"pagination"},Oe=["disabled"],xe=["disabled"],Ae={class:"quick-jump"},Xe=["max"];function Je(e,t,o,i,a,s){return(0,l.uX)(),(0,l.CE)("div",Ce,[(0,l.Lk)("div",Te,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>a.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,a.title]]),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>a.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,a.content]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>a.difficulty=e)},t[12]||(t[12]=[(0,l.Fv)('<option value="" data-v-3fac1adc>全部难度</option><option value="1" data-v-3fac1adc>1</option><option value="2" data-v-3fac1adc>2</option><option value="3" data-v-3fac1adc>3</option><option value="4" data-v-3fac1adc>4</option><option value="5" data-v-3fac1adc>5</option><option value="6" data-v-3fac1adc>6</option><option value="7" data-v-3fac1adc>7</option><option value="8" data-v-3fac1adc>8</option><option value="9" data-v-3fac1adc>9</option><option value="10" data-v-3fac1adc>10</option>',11)]),512),[[n.u1,a.difficulty]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>a.statusFilter=e)},t[13]||(t[13]=[(0,l.Lk)("option",{value:""},"全部状态",-1),(0,l.Lk)("option",{value:"0"},"只看不会的题",-1),(0,l.Lk)("option",{value:"1"},"只看已会的题",-1)]),512),[[n.u1,a.statusFilter]]),(0,l.Lk)("div",Ee,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>a.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>s.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>s.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,a.knowledgeSearch]]),a.showKnowledgeList?((0,l.uX)(),(0,l.CE)("div",_e,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.knowledgePoints,(e=>((0,l.uX)(),(0,l.CE)("div",{key:e.id,onClick:t=>s.selectKnowledge(e),class:"knowledge-item"},(0,b.v_)(e.title),9,Se)))),128))])):(0,l.Q3)("",!0)],512)]),(0,l.Lk)("table",Ke,[t[14]||(t[14]=(0,l.Lk)("thead",null,[(0,l.Lk)("tr",null,[(0,l.Lk)("th",null,"编号"),(0,l.Lk)("th",null,"标题"),(0,l.Lk)("th",null,"难度"),(0,l.Lk)("th",null,"知识点"),(0,l.Lk)("th",null,"状态")])],-1)),(0,l.Lk)("tbody",null,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(a.problems,(e=>((0,l.uX)(),(0,l.CE)("tr",{key:e.id,onClick:t=>s.goToProblem(e.id)},[(0,l.Lk)("td",null,(0,b.v_)(e.id),1),(0,l.Lk)("td",null,(0,b.v_)(e.title),1),(0,l.Lk)("td",null,(0,b.v_)(s.getDifficultyText(e.difficulty)),1),(0,l.Lk)("td",null,[e.knowledge&&e.knowledge.length>0?((0,l.uX)(!0),(0,l.CE)(l.FK,{key:0},(0,l.pI)(e.knowledge,(e=>((0,l.uX)(),(0,l.CE)("span",{key:e.id,class:"knowledge-tag"},(0,b.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",$e,"无"))]),(0,l.Lk)("td",null,[(0,l.Lk)("span",{class:(0,b.C4)(["status-tag",{solved:1===e.status,unsolved:0===e.status}])},(0,b.v_)(s.getStatusText(e.status)),3)])],8,je)))),128))])]),(0,l.Lk)("div",Fe,[(0,l.Lk)("button",{disabled:1===a.page,onClick:t[7]||(t[7]=e=>s.changePage(a.page-1))},"上一页",8,Oe),(0,l.Lk)("span",null,"第 "+(0,b.v_)(a.page)+" 页 / 共 "+(0,b.v_)(a.totalPages)+" 页",1),(0,l.Lk)("button",{disabled:a.page===a.totalPages,onClick:t[8]||(t[8]=e=>s.changePage(a.page+1))},"下一页",8,xe),(0,l.Lk)("div",Ae,[t[15]||(t[15]=(0,l.eW)(" 快速跳转至 ")),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[9]||(t[9]=e=>a.jumpPage=e),type:"number",min:"1",max:a.totalPages,onKeyup:t[10]||(t[10]=(0,n.jR)(((...e)=>s.handleJump&&s.handleJump(...e)),["enter"]))},null,40,Xe),[[n.Jo,a.jumpPage]]),t[16]||(t[16]=(0,l.eW)(" 页 ")),(0,l.Lk)("button",{onClick:t[11]||(t[11]=(...e)=>s.handleJump&&s.handleJump(...e))},"跳转")])])])}var Ne={data(){return{problems:[],page:1,totalPages:1,title:"",content:"",difficulty:"",statusFilter:"",knowledgeSearch:"",knowledgePoints:[],showKnowledgeList:!1,selectedKnowledge:null,token:h.A.get("token")||"",jumpPage:""}},methods:{async fetchProblems(){try{const e=await fetch("https://api.oj.东北大学.com/my_problem_list",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({page:this.page,title:this.title||void 0,content:this.content||void 0,difficulty:this.difficulty?Number(this.difficulty):void 0,status_filter:this.statusFilter?Number(this.statusFilter):void 0,knowledge_id:this.selectedKnowledge?.id})}),t=await e.json();this.problems=t.problems,this.totalPages=t.pages}catch(e){console.error("Error:",e)}},goToProblem(e){this.$router.push(`/problem/${e}`)},changePage(e){this.page=e,this.fetchProblems()},getDifficultyText(e){const t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10"};return t[e]||"未知"},getStatusText(e){return 1===e?"已会":"不会"},async fetchKnowledgePoints(){try{const e=await fetch("https://api.oj.东北大学.com/knowledge",{method:"POST",headers:{Authorization:this.token,"Content-Type":"application/json"},body:JSON.stringify({search:this.knowledgeSearch})}),t=await e.json();this.knowledgePoints=t,this.showKnowledgeList=!0}catch(e){console.error("Error:",e)}},selectKnowledge(e){this.selectedKnowledge=e,this.knowledgeSearch=e.title,this.showKnowledgeList=!1,this.page=1,this.fetchProblems()},handleClickOutside(e){const t=this.$refs.knowledgeSearch;t&&!t.contains(e.target)&&(this.showKnowledgeList=!1,this.selectedKnowledge||(this.knowledgeSearch=""))},handleJump(){const e=parseInt(this.jumpPage);e&&e>=1&&e<=this.totalPages?this.changePage(e):alert("请输入有效的页码!"),this.jumpPage=""}},watch:{title(){this.page=1,this.fetchProblems()},difficulty(){this.page=1,this.fetchProblems()},statusFilter(){this.page=1,this.fetchProblems()},content(){this.page=1,this.fetchProblems()},knowledgeSearch(e){e||(this.selectedKnowledge=null,this.page=1,this.fetchProblems())}},mounted(){document.title="我标记的题目 - OJ题库 - NEU小站",this.fetchProblems(),document.addEventListener("click",this.handleClickOutside)},unmounted(){document.removeEventListener("click",this.handleClickOutside)}};const Ie=(0,m.A)(Ne,[["render",Je],["__scopeId","data-v-3fac1adc"]]);var Ue=Ie;const Me=[{path:"/",redirect:"/problems"},{path:"/problems",name:"ProblemList",component:A},{path:"/problem/:id",name:"ProblemDetail",component:Pe,meta:{title:"题目详情"}},{path:"/my",name:"MyProblemList",component:Ue},{path:"/about",name:"About",component:()=>o.e(131).then(o.bind(o,3131)),meta:{title:"关于"}},{path:"/:pathMatch(.*)*",redirect:"/problems"}],qe=(0,f.aE)({history:(0,f.LA)(),routes:Me});var Ve=qe,We=o(782),De=(0,We.y$)({state:{},getters:{},mutations:{},actions:{},modules:{}});(0,n.Ef)(k).use(De).use(Ve).mount("#app")}},t={};function o(n){var l=t[n];if(void 0!==l)return l.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=e,function(){var e=[];o.O=function(t,n,l,i){if(!n){var a=1/0;for(d=0;d<e.length;d++){n=e[d][0],l=e[d][1],i=e[d][2];for(var s=!0,r=0;r<n.length;r++)(!1&i||a>=i)&&Object.keys(o.O).every((function(e){return o.O[e](n[r])}))?n.splice(r--,1):(s=!1,i<a&&(a=i));if(s){e.splice(d--,1);var c=l();void 0!==c&&(t=c)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,l,i]}}(),function(){o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,{a:t}),t}}(),function(){o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](e,t),t}),[]))}}(),function(){o.u=function(e){return"js/"+e+".0d4b6380.js"}}(),function(){o.miniCssF=function(e){return"css/"+e+".81924f9e.css"}}(),function(){o.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="front:";o.l=function(n,l,i,a){if(e[n])e[n].push(l);else{var s,r;if(void 0!==i)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(r=!0,s=document.createElement("script"),s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[l];var h=function(t,o){s.onerror=s.onload=null,clearTimeout(p);var l=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),l&&l.forEach((function(e){return e(o)})),t)return t(o)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),r&&document.head.appendChild(s)}}}(),function(){o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){o.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){o.p="/"}(),function(){if("undefined"!==typeof document){var e=function(e,t,n,l,i){var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",o.nc&&(a.nonce=o.nc);var s=function(o){if(a.onerror=a.onload=null,"load"===o.type)l();else{var n=o&&o.type,s=o&&o.target&&o.target.href||t,r=new Error("Loading CSS chunk "+e+" failed.\n("+n+": "+s+")");r.name="ChunkLoadError",r.code="CSS_CHUNK_LOAD_FAILED",r.type=n,r.request=s,a.parentNode&&a.parentNode.removeChild(a),i(r)}};return a.onerror=a.onload=s,a.href=t,n?n.parentNode.insertBefore(a,n.nextSibling):document.head.appendChild(a),a},t=function(e,t){for(var o=document.getElementsByTagName("link"),n=0;n<o.length;n++){var l=o[n],i=l.getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(i===e||i===t))return l}var a=document.getElementsByTagName("style");for(n=0;n<a.length;n++){l=a[n],i=l.getAttribute("data-href");if(i===e||i===t)return l}},n=function(n){return new Promise((function(l,i){var a=o.miniCssF(n),s=o.p+a;if(t(a,s))return l();e(n,s,null,l,i)}))},l={524:0};o.f.miniCss=function(e,t){var o={131:1};l[e]?t.push(l[e]):0!==l[e]&&o[e]&&t.push(l[e]=n(e).then((function(){l[e]=0}),(function(t){throw delete l[e],t})))}}}(),function(){var e={524:0};o.f.j=function(t,n){var l=o.o(e,t)?e[t]:void 0;if(0!==l)if(l)n.push(l[2]);else{var i=new Promise((function(o,n){l=e[t]=[o,n]}));n.push(l[2]=i);var a=o.p+o.u(t),s=new Error,r=function(n){if(o.o(e,t)&&(l=e[t],0!==l&&(e[t]=void 0),l)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,l[1](s)}};o.l(a,r,"chunk-"+t,t)}},o.O.j=function(t){return 0===e[t]};var t=function(t,n){var l,i,a=n[0],s=n[1],r=n[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(l in s)o.o(s,l)&&(o.m[l]=s[l]);if(r)var d=r(o)}for(t&&t(n);c<a.length;c++)i=a[c],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(d)},n=self["webpackChunkfront"]=self["webpackChunkfront"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var n=o.O(void 0,[504],(function(){return o(2978)}));n=o.O(n)})();
//# sourceMappingURL=app.d621846b.js.map