From 29ead7db51e556d4c4358082444f4a3f75fc2979 Mon Sep 17 00:00:00 2001 From: ember <1279347317@qq.com> Date: Sun, 16 Feb 2025 13:26:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=B8=80=E9=A2=98/?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E9=A2=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{app.29afa872.css => app.9bd76241.css} | 2 +- dist/index.html | 2 +- dist/js/app.354424e3.js | 2 - dist/js/app.b7c55399.js | 2 + src/components/ProblemDetail.vue | 90 +++++++++---------- 5 files changed, 45 insertions(+), 53 deletions(-) rename dist/css/{app.29afa872.css => app.9bd76241.css} (70%) delete mode 100644 dist/js/app.354424e3.js create mode 100644 dist/js/app.b7c55399.js diff --git a/dist/css/app.29afa872.css b/dist/css/app.9bd76241.css similarity index 70% rename from dist/css/app.29afa872.css rename to dist/css/app.9bd76241.css index 6a9d349..b5da504 100644 --- a/dist/css/app.29afa872.css +++ b/dist/css/app.9bd76241.css @@ -1 +1 @@ -*{padding:0;box-sizing:border-box}*,body{margin:0}body{overflow:hidden}.app{width:100vw;overflow:hidden}.app,.sidebar{display:flex;height:100vh}.sidebar{width:200px;background-color:#f5f5f5;padding:20px;border-right:1px solid #ddd;flex-shrink:0;flex-direction:column}.nav-links{flex:1}.nav-item{display:block;padding:10px;margin-bottom:5px;text-decoration:none;color:#333}.nav-item.router-link-active{background-color:#e0e0e0;border-radius:4px}.footer-info{border-top:1px solid #ddd;padding:10px 0;text-align:center}.version-info{color:#666;font-size:12px;margin-bottom:5px}.source-info{color:#999;font-size:11px}.main-content{flex:1;overflow-y:auto;position:relative}.main-content:has(.problem-detail){overflow:hidden}.loading{font-size:18px;color:#666}.loading,.login-prompt{width:100vw;height:100vh;display:flex;justify-content:center;align-items:center}.login-prompt{flex-direction:column;gap:20px;background-color:#f5f5f5}.title{font-size:32px;font-weight:700;color:#333;margin-bottom:10px}.login-message{font-size:24px;color:#333;text-align:center}.login-button{padding:12px 24px;font-size:18px;color:#fff;background-color:#4caf50;border:none;border-radius:4px;cursor:pointer;transition:all .3s}.login-button:hover{background-color:#45a049;transform:translateY(-2px);box-shadow:0 2px 8px rgba(0,0,0,.1)}.login-note{font-size:14px;color:#666;text-align:center}.problem-list[data-v-8b2156d0]{padding:20px}.filters[data-v-8b2156d0]{margin-bottom:20px}.filters input[data-v-8b2156d0],.filters select[data-v-8b2156d0]{margin-right:10px;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:all .3s}.filters input[data-v-8b2156d0]:focus,.filters select[data-v-8b2156d0]:focus{border-color:#4caf50;box-shadow:0 0 5px rgba(76,175,80,.2)}.problems-table[data-v-8b2156d0]{width:100%;border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;box-shadow:0 0 10px rgba(0,0,0,.1)}.problems-table th[data-v-8b2156d0]{background-color:#f8f9fa;font-weight:600;padding:12px;text-align:left;border-bottom:2px solid #ddd}.problems-table td[data-v-8b2156d0]{padding:12px;border-bottom:1px solid #eee}.problems-table tr:last-child td[data-v-8b2156d0]{border-bottom:none}.problems-table tr[data-v-8b2156d0]:hover{background-color:#f5f5f5;cursor:pointer;transition:background-color .2s}.pagination[data-v-8b2156d0]{margin-top:20px;display:flex;justify-content:center;align-items:center;gap:15px}.pagination button[data-v-8b2156d0]{padding:8px 16px;border:1px solid #ddd;background-color:#fff;border-radius:4px;cursor:pointer;transition:all .3s}.pagination button[data-v-8b2156d0]:hover:not(:disabled){background-color:#4caf50;color:#fff;border-color:#4caf50}.pagination button[data-v-8b2156d0]:disabled{background-color:#f5f5f5;cursor:not-allowed;color:#999}.pagination span[data-v-8b2156d0]{padding:8px 16px;color:#666;font-size:14px;background-color:#f5f5f5;border-radius:4px;min-width:150px;text-align:center}.knowledge-tag[data-v-8b2156d0]{background-color:#e8f5e9;color:#2e7d32;padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.knowledge-tag[data-v-8b2156d0]:hover{background-color:#4caf50;color:#fff}.knowledge-search[data-v-8b2156d0]{position:relative;display:inline-block}.knowledge-search input[data-v-8b2156d0]{width:200px}.knowledge-list[data-v-8b2156d0]{position:absolute;top:100%;left:0;right:0;background:#fff;border:none;border-radius:4px;max-height:200px;overflow-y:auto;z-index:1000;box-shadow:0 2px 8px rgba(0,0,0,.1)}.knowledge-item[data-v-8b2156d0]{padding:10px;cursor:pointer;transition:all .2s}.knowledge-item[data-v-8b2156d0]:hover{background-color:#e8f5e9;color:#2e7d32}.status-tag[data-v-8b2156d0]{padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.status-tag.unmarked[data-v-8b2156d0]{background-color:#f5f5f5;color:#666}.status-tag.solved[data-v-8b2156d0]{background-color:#e8f5e9;color:#2e7d32}.status-tag.unsolved[data-v-8b2156d0]{background-color:#ffebee;color:#c62828}table td[data-v-8b2156d0]:first-child,table th[data-v-8b2156d0]:first-child{width:80px;text-align:center}.katex{font-size:1.1em}.katex-display{padding:1em 0}.problem-detail{max-width:99%;margin:0 auto;padding:20px;height:100%;overflow-y:auto}.problem-header{margin-bottom:30px}.problem-meta{margin-top:10px;color:#666}.difficulty{margin-right:20px}.knowledge-tag{background-color:#e0e0e0;padding:2px 6px;margin:0 4px;border-radius:4px;font-size:12px}.content-section{margin-bottom:30px}.example pre{background-color:#f5f5f5;padding:10px;border-radius:4px}.problem-status{margin-top:20px;display:flex;gap:10px}.problem-status button{padding:8px 16px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer}.problem-status button.active{background-color:#4caf50;color:#fff;border-color:#4caf50}.problem-status button:first-child.active{background-color:#f44;color:#fff;border-color:#f44}.content-section{line-height:1.6}.content-section h1,.content-section h2,.content-section h3,.content-section h4,.content-section h5,.content-section h6{margin-top:1.5em;margin-bottom:.5em}.content-section p{margin:1em 0}.content-section code{background-color:#f5f5f5;font-family:monospace}.content-section pre{background-color:#f5f5f5;padding:1em;border-radius:4px}.content-section ol,.content-section ul{padding-left:2em;margin:1em 0}.content-section blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.content-section img{max-width:100%;height:auto}.content-section table{border-collapse:collapse;width:100%;margin:1em 0}.content-section td,.content-section th{border:1px solid #ddd;padding:8px;text-align:left}.content-section th{background-color:#f5f5f5}.katex-display{margin:1em 0;overflow-x:auto;overflow-y:hidden}.content-section code{font-family:JetBrains Mono,Fira Code,Cascadia Code,Source Code Pro,Menlo,Monaco,Consolas,Courier New,monospace;font-size:.9em;background-color:#f6f8fa;padding:2px 4px;border-radius:3px;color:#24292e}.content-section pre{background-color:#f6f8fa;padding:16px;border-radius:6px;overflow-x:auto;margin:1em 0;border:1px solid #eaecef}.content-section pre code{background-color:transparent;padding:0;font-size:.9em;line-height:1.5;display:block;overflow-x:auto;color:#24292e}.content-section pre{position:relative}.content-section pre code{counter-reset:line}.content-section pre code .hljs-ln{display:inline-block;width:100%;line-height:1.5;counter-increment:line}.content-section pre:hover{box-shadow:0 2px 8px rgba(0,0,0,.1)}:not(pre)>code{font-size:.875em;white-space:pre-wrap;word-wrap:break-word}.content-section pre::-webkit-scrollbar{height:8px}.content-section pre::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:4px}.content-section pre::-webkit-scrollbar-track{background-color:#f6f8fa}.hljs-class,.hljs-function,.hljs-keyword{color:#d73a49}.hljs-string{color:#032f62}.hljs-number{color:#005cc5}.hljs-comment{color:#6a737d}.hljs-variable{color:#24292e}.hljs-title{color:#6f42c1}.content-section pre:before{content:attr(data-lang);position:absolute;top:0;right:10px;padding:2px 6px;font-size:12px;color:#666;background-color:#f6f8fa;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.problem-status button.next-problem{background-color:#2196f3;color:#fff;border-color:#2196f3}.problem-status button.next-problem:hover{background-color:#1976d2;border-color:#1976d2}.problem-status button.previous-problem{background-color:#2196f3;color:#fff;border-color:#2196f3}.problem-status button.previous-problem:hover{background-color:#1976d2;border-color:#1976d2}.no-knowledge{color:#999;font-size:16px}.problem-status button.clear-mark{background-color:#9e9e9e;color:#fff;border-color:#9e9e9e}.problem-status button.clear-mark:hover{background-color:#757575;border-color:#757575}.problem-list[data-v-131cee16]{padding:20px}.filters[data-v-131cee16]{margin-bottom:20px}.filters input[data-v-131cee16],.filters select[data-v-131cee16]{margin-right:10px;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:all .3s}.filters input[data-v-131cee16]:focus,.filters select[data-v-131cee16]:focus{border-color:#4caf50;box-shadow:0 0 5px rgba(76,175,80,.2)}.problems-table[data-v-131cee16]{width:100%;border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;box-shadow:0 0 10px rgba(0,0,0,.1)}.problems-table th[data-v-131cee16]{background-color:#f8f9fa;font-weight:600;padding:12px;text-align:left;border-bottom:2px solid #ddd}.problems-table td[data-v-131cee16]{padding:12px;border-bottom:1px solid #eee}.problems-table tr:last-child td[data-v-131cee16]{border-bottom:none}.problems-table tr[data-v-131cee16]:hover{background-color:#f5f5f5;cursor:pointer;transition:background-color .2s}.pagination[data-v-131cee16]{margin-top:20px;display:flex;justify-content:center;align-items:center;gap:15px}.pagination button[data-v-131cee16]{padding:8px 16px;border:1px solid #ddd;background-color:#fff;border-radius:4px;cursor:pointer;transition:all .3s}.pagination button[data-v-131cee16]:hover:not(:disabled){background-color:#4caf50;color:#fff;border-color:#4caf50}.pagination button[data-v-131cee16]:disabled{background-color:#f5f5f5;cursor:not-allowed;color:#999}.pagination span[data-v-131cee16]{padding:8px 16px;color:#666;font-size:14px;background-color:#f5f5f5;border-radius:4px;min-width:150px;text-align:center}.knowledge-tag[data-v-131cee16]{background-color:#e8f5e9;color:#2e7d32;padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.knowledge-tag[data-v-131cee16]:hover{background-color:#4caf50;color:#fff}.knowledge-search[data-v-131cee16]{position:relative;display:inline-block}.knowledge-search input[data-v-131cee16]{width:200px}.knowledge-list[data-v-131cee16]{position:absolute;top:100%;left:0;right:0;background:#fff;border:none;border-radius:4px;max-height:200px;overflow-y:auto;z-index:1000;box-shadow:0 2px 8px rgba(0,0,0,.1)}.knowledge-item[data-v-131cee16]{padding:10px;cursor:pointer;transition:all .2s}.knowledge-item[data-v-131cee16]:hover{background-color:#e8f5e9;color:#2e7d32}.status-tag[data-v-131cee16]{padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.status-tag.unmarked[data-v-131cee16]{background-color:#f5f5f5;color:#666}.status-tag.solved[data-v-131cee16]{background-color:#e8f5e9;color:#2e7d32}.status-tag.unsolved[data-v-131cee16]{background-color:#ffebee;color:#c62828}.problems-table td[data-v-131cee16]:first-child,.problems-table th[data-v-131cee16]:first-child{width:80px;text-align:center} \ No newline at end of file +*{padding:0;box-sizing:border-box}*,body{margin:0}body{overflow:hidden}.app{width:100vw;overflow:hidden}.app,.sidebar{display:flex;height:100vh}.sidebar{width:200px;background-color:#f5f5f5;padding:20px;border-right:1px solid #ddd;flex-shrink:0;flex-direction:column}.nav-links{flex:1}.nav-item{display:block;padding:10px;margin-bottom:5px;text-decoration:none;color:#333}.nav-item.router-link-active{background-color:#e0e0e0;border-radius:4px}.footer-info{border-top:1px solid #ddd;padding:10px 0;text-align:center}.version-info{color:#666;font-size:12px;margin-bottom:5px}.source-info{color:#999;font-size:11px}.main-content{flex:1;overflow-y:auto;position:relative}.main-content:has(.problem-detail){overflow:hidden}.loading{font-size:18px;color:#666}.loading,.login-prompt{width:100vw;height:100vh;display:flex;justify-content:center;align-items:center}.login-prompt{flex-direction:column;gap:20px;background-color:#f5f5f5}.title{font-size:32px;font-weight:700;color:#333;margin-bottom:10px}.login-message{font-size:24px;color:#333;text-align:center}.login-button{padding:12px 24px;font-size:18px;color:#fff;background-color:#4caf50;border:none;border-radius:4px;cursor:pointer;transition:all .3s}.login-button:hover{background-color:#45a049;transform:translateY(-2px);box-shadow:0 2px 8px rgba(0,0,0,.1)}.login-note{font-size:14px;color:#666;text-align:center}.problem-list[data-v-8b2156d0]{padding:20px}.filters[data-v-8b2156d0]{margin-bottom:20px}.filters input[data-v-8b2156d0],.filters select[data-v-8b2156d0]{margin-right:10px;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:all .3s}.filters input[data-v-8b2156d0]:focus,.filters select[data-v-8b2156d0]:focus{border-color:#4caf50;box-shadow:0 0 5px rgba(76,175,80,.2)}.problems-table[data-v-8b2156d0]{width:100%;border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;box-shadow:0 0 10px rgba(0,0,0,.1)}.problems-table th[data-v-8b2156d0]{background-color:#f8f9fa;font-weight:600;padding:12px;text-align:left;border-bottom:2px solid #ddd}.problems-table td[data-v-8b2156d0]{padding:12px;border-bottom:1px solid #eee}.problems-table tr:last-child td[data-v-8b2156d0]{border-bottom:none}.problems-table tr[data-v-8b2156d0]:hover{background-color:#f5f5f5;cursor:pointer;transition:background-color .2s}.pagination[data-v-8b2156d0]{margin-top:20px;display:flex;justify-content:center;align-items:center;gap:15px}.pagination button[data-v-8b2156d0]{padding:8px 16px;border:1px solid #ddd;background-color:#fff;border-radius:4px;cursor:pointer;transition:all .3s}.pagination button[data-v-8b2156d0]:hover:not(:disabled){background-color:#4caf50;color:#fff;border-color:#4caf50}.pagination button[data-v-8b2156d0]:disabled{background-color:#f5f5f5;cursor:not-allowed;color:#999}.pagination span[data-v-8b2156d0]{padding:8px 16px;color:#666;font-size:14px;background-color:#f5f5f5;border-radius:4px;min-width:150px;text-align:center}.knowledge-tag[data-v-8b2156d0]{background-color:#e8f5e9;color:#2e7d32;padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.knowledge-tag[data-v-8b2156d0]:hover{background-color:#4caf50;color:#fff}.knowledge-search[data-v-8b2156d0]{position:relative;display:inline-block}.knowledge-search input[data-v-8b2156d0]{width:200px}.knowledge-list[data-v-8b2156d0]{position:absolute;top:100%;left:0;right:0;background:#fff;border:none;border-radius:4px;max-height:200px;overflow-y:auto;z-index:1000;box-shadow:0 2px 8px rgba(0,0,0,.1)}.knowledge-item[data-v-8b2156d0]{padding:10px;cursor:pointer;transition:all .2s}.knowledge-item[data-v-8b2156d0]:hover{background-color:#e8f5e9;color:#2e7d32}.status-tag[data-v-8b2156d0]{padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.status-tag.unmarked[data-v-8b2156d0]{background-color:#f5f5f5;color:#666}.status-tag.solved[data-v-8b2156d0]{background-color:#e8f5e9;color:#2e7d32}.status-tag.unsolved[data-v-8b2156d0]{background-color:#ffebee;color:#c62828}table td[data-v-8b2156d0]:first-child,table th[data-v-8b2156d0]:first-child{width:80px;text-align:center}.katex{font-size:1.1em}.katex-display{padding:1em 0}.problem-detail{max-width:99%;margin:0 auto;padding:20px;height:100%;overflow-y:auto}.problem-header{margin-bottom:30px}.problem-meta{margin-top:10px;color:#666}.difficulty{margin-right:20px}.knowledge-tag{background-color:#e0e0e0;padding:2px 6px;margin:0 4px;border-radius:4px;font-size:12px}.content-section{margin-bottom:30px}.example pre{background-color:#f5f5f5;padding:10px;border-radius:4px}.problem-status{margin-top:20px;display:flex;gap:10px}.problem-status button{padding:8px 16px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer}.problem-status button.active{background-color:#4caf50;color:#fff;border-color:#4caf50}.problem-status button:first-child.active{background-color:#f44;color:#fff;border-color:#f44}.content-section{line-height:1.6}.content-section h1,.content-section h2,.content-section h3,.content-section h4,.content-section h5,.content-section h6{margin-top:1.5em;margin-bottom:.5em}.content-section p{margin:1em 0}.content-section code{background-color:#f5f5f5;font-family:monospace}.content-section pre{background-color:#f5f5f5;padding:1em;border-radius:4px}.content-section ol,.content-section ul{padding-left:2em;margin:1em 0}.content-section blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.content-section img{max-width:100%;height:auto}.content-section table{border-collapse:collapse;width:100%;margin:1em 0}.content-section td,.content-section th{border:1px solid #ddd;padding:8px;text-align:left}.content-section th{background-color:#f5f5f5}.katex-display{margin:1em 0;overflow-x:auto;overflow-y:hidden}.content-section code{font-family:JetBrains Mono,Fira Code,Cascadia Code,Source Code Pro,Menlo,Monaco,Consolas,Courier New,monospace;font-size:.9em;background-color:#f6f8fa;padding:2px 4px;border-radius:3px;color:#24292e}.content-section pre{background-color:#f6f8fa;padding:16px;border-radius:6px;overflow-x:auto;margin:1em 0;border:1px solid #eaecef}.content-section pre code{background-color:transparent;padding:0;font-size:.9em;line-height:1.5;display:block;overflow-x:auto;color:#24292e}.content-section pre{position:relative}.content-section pre code{counter-reset:line}.content-section pre code .hljs-ln{display:inline-block;width:100%;line-height:1.5;counter-increment:line}.content-section pre:hover{box-shadow:0 2px 8px rgba(0,0,0,.1)}:not(pre)>code{font-size:.875em;white-space:pre-wrap;word-wrap:break-word}.content-section pre::-webkit-scrollbar{height:8px}.content-section pre::-webkit-scrollbar-thumb{background-color:#ccc;border-radius:4px}.content-section pre::-webkit-scrollbar-track{background-color:#f6f8fa}.hljs-class,.hljs-function,.hljs-keyword{color:#d73a49}.hljs-string{color:#032f62}.hljs-number{color:#005cc5}.hljs-comment{color:#6a737d}.hljs-variable{color:#24292e}.hljs-title{color:#6f42c1}.content-section pre:before{content:attr(data-lang);position:absolute;top:0;right:10px;padding:2px 6px;font-size:12px;color:#666;background-color:#f6f8fa;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.problem-status button.next-problem{background-color:#2196f3;color:#fff;border-color:#2196f3}.problem-status button.next-problem:hover{background-color:#1976d2;border-color:#1976d2}.problem-status button.previous-problem{background-color:#2196f3;color:#fff;border-color:#2196f3}.problem-status button.previous-problem:hover{background-color:#1976d2;border-color:#1976d2}.no-knowledge{color:#999;font-size:16px}.problem-status button.clear-mark{background-color:#9e9e9e;color:#fff;border-color:#9e9e9e}.problem-status button.clear-mark:hover{background-color:#757575;border-color:#757575}.problem-status button:disabled{background-color:#ccc;border-color:#ccc;cursor:not-allowed;opacity:.7}.problem-status button.next-problem:disabled,.problem-status button.previous-problem:disabled{background-color:#90caf9;border-color:#90caf9;opacity:.5}.problem-status button.next-problem,.problem-status button.previous-problem{background-color:#2196f3;color:#fff;border-color:#2196f3}.problem-status button.next-problem:hover:not(:disabled),.problem-status button.previous-problem:hover:not(:disabled){background-color:#1976d2;border-color:#1976d2}.problem-list[data-v-131cee16]{padding:20px}.filters[data-v-131cee16]{margin-bottom:20px}.filters input[data-v-131cee16],.filters select[data-v-131cee16]{margin-right:10px;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:all .3s}.filters input[data-v-131cee16]:focus,.filters select[data-v-131cee16]:focus{border-color:#4caf50;box-shadow:0 0 5px rgba(76,175,80,.2)}.problems-table[data-v-131cee16]{width:100%;border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden;box-shadow:0 0 10px rgba(0,0,0,.1)}.problems-table th[data-v-131cee16]{background-color:#f8f9fa;font-weight:600;padding:12px;text-align:left;border-bottom:2px solid #ddd}.problems-table td[data-v-131cee16]{padding:12px;border-bottom:1px solid #eee}.problems-table tr:last-child td[data-v-131cee16]{border-bottom:none}.problems-table tr[data-v-131cee16]:hover{background-color:#f5f5f5;cursor:pointer;transition:background-color .2s}.pagination[data-v-131cee16]{margin-top:20px;display:flex;justify-content:center;align-items:center;gap:15px}.pagination button[data-v-131cee16]{padding:8px 16px;border:1px solid #ddd;background-color:#fff;border-radius:4px;cursor:pointer;transition:all .3s}.pagination button[data-v-131cee16]:hover:not(:disabled){background-color:#4caf50;color:#fff;border-color:#4caf50}.pagination button[data-v-131cee16]:disabled{background-color:#f5f5f5;cursor:not-allowed;color:#999}.pagination span[data-v-131cee16]{padding:8px 16px;color:#666;font-size:14px;background-color:#f5f5f5;border-radius:4px;min-width:150px;text-align:center}.knowledge-tag[data-v-131cee16]{background-color:#e8f5e9;color:#2e7d32;padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.knowledge-tag[data-v-131cee16]:hover{background-color:#4caf50;color:#fff}.knowledge-search[data-v-131cee16]{position:relative;display:inline-block}.knowledge-search input[data-v-131cee16]{width:200px}.knowledge-list[data-v-131cee16]{position:absolute;top:100%;left:0;right:0;background:#fff;border:none;border-radius:4px;max-height:200px;overflow-y:auto;z-index:1000;box-shadow:0 2px 8px rgba(0,0,0,.1)}.knowledge-item[data-v-131cee16]{padding:10px;cursor:pointer;transition:all .2s}.knowledge-item[data-v-131cee16]:hover{background-color:#e8f5e9;color:#2e7d32}.status-tag[data-v-131cee16]{padding:4px 8px;margin:0 4px;border-radius:4px;font-size:12px;display:inline-block;transition:all .3s}.status-tag.unmarked[data-v-131cee16]{background-color:#f5f5f5;color:#666}.status-tag.solved[data-v-131cee16]{background-color:#e8f5e9;color:#2e7d32}.status-tag.unsolved[data-v-131cee16]{background-color:#ffebee;color:#c62828}.problems-table td[data-v-131cee16]:first-child,.problems-table th[data-v-131cee16]:first-child{width:80px;text-align:center} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 04be41e..0025789 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -front
\ No newline at end of file +front
\ No newline at end of file diff --git a/dist/js/app.354424e3.js b/dist/js/app.354424e3.js deleted file mode 100644 index d379373..0000000 --- a/dist/js/app.354424e3.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){"use strict";var e={1719:function(e,t,o){var n=o(5130),i=o(6768);const l={class:"app"},s={key:0,class:"loading"},a={key:1,class:"login-prompt"},r={class:"sidebar"},d={class:"nav-links"},c={class:"main-content"};function u(e,t,o,n,u,h){const p=(0,i.g2)("router-link"),g=(0,i.g2)("router-view");return(0,i.uX)(),(0,i.CE)("div",l,[u.isLoading?((0,i.uX)(),(0,i.CE)("div",s," 加载中... ")):u.isLoggedIn?((0,i.uX)(),(0,i.CE)(i.FK,{key:2},[(0,i.Lk)("div",r,[(0,i.Lk)("div",d,[(0,i.bF)(p,{to:"/problems",class:"nav-item"},{default:(0,i.k6)((()=>t[4]||(t[4]=[(0,i.eW)("题目列表")]))),_:1}),(0,i.bF)(p,{to:"/my",class:"nav-item"},{default:(0,i.k6)((()=>t[5]||(t[5]=[(0,i.eW)("我标记的题目")]))),_:1})]),t[6]||(t[6]=(0,i.Lk)("div",{class:"footer-info"},[(0,i.Lk)("div",{class:"version-info"},"NEU小站OJ题库 - v1.0"),(0,i.Lk)("div",{class:"source-info"},"本题库所有题目均来自东北大学OJ系统,本站仅归纳展示题目,不提供在线评测环境")],-1))]),(0,i.Lk)("div",c,[(0,i.bF)(g)])],64)):((0,i.uX)(),(0,i.CE)("div",a,[t[1]||(t[1]=(0,i.Lk)("div",{class:"login-message"},"请登录后进入NEU小站OJ题库!",-1)),(0,i.Lk)("button",{class:"login-button",onClick:t[0]||(t[0]=(...e)=>h.goToLogin&&h.goToLogin(...e))},"前往登录"),t[2]||(t[2]=(0,i.Lk)("div",{class:"login-note"},"本系统所有题目来自东北大学OJ系统,本站仅归纳展示题目,不提供在线评测环境。",-1)),t[3]||(t[3]=(0,i.Lk)("div",{class:"login-note"},"为帮助考研NEU同学准备复试机试,本系统仅需注册账号即可使用,无需经过校内验证。",-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()}},g=o(1241);const k=(0,g.A)(p,[["render",u]]);var m=k,b=o(1387),v=o(4232);const f={class:"problem-list"},w={class:"filters"},y={class:"knowledge-search",ref:"knowledgeSearch"},L={key:0,class:"knowledge-list"},P=["onClick"],C={class:"problems-table"},T=["onClick"],E={key:1,class:"no-knowledge"},$={class:"pagination"},_=["disabled"],K=["disabled"];function S(e,t,o,l,s,a){return(0,i.uX)(),(0,i.CE)("div",f,[(0,i.Lk)("div",w,[(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>s.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,s.title]]),(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,s.content]]),(0,i.bo)((0,i.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>s.difficulty=e)},t[9]||(t[9]=[(0,i.Fv)('',11)]),512),[[n.u1,s.difficulty]]),(0,i.bo)((0,i.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>s.statusFilter=e)},t[10]||(t[10]=[(0,i.Lk)("option",{value:""},"全部状态",-1),(0,i.Lk)("option",{value:"0"},"不显示已会的题",-1),(0,i.Lk)("option",{value:"1"},"不显示已会和不会的题",-1)]),512),[[n.u1,s.statusFilter]]),(0,i.Lk)("div",y,[(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>s.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>a.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>a.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,s.knowledgeSearch]]),s.showKnowledgeList?((0,i.uX)(),(0,i.CE)("div",L,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(s.knowledgePoints,(e=>((0,i.uX)(),(0,i.CE)("div",{key:e.id,onClick:t=>a.selectKnowledge(e),class:"knowledge-item"},(0,v.v_)(e.title),9,P)))),128))])):(0,i.Q3)("",!0)],512)]),(0,i.Lk)("table",C,[t[11]||(t[11]=(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"编号"),(0,i.Lk)("th",null,"标题"),(0,i.Lk)("th",null,"难度"),(0,i.Lk)("th",null,"知识点"),(0,i.Lk)("th",null,"状态")])],-1)),(0,i.Lk)("tbody",null,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(s.problems,(e=>((0,i.uX)(),(0,i.CE)("tr",{key:e.id,onClick:t=>a.goToProblem(e.id)},[(0,i.Lk)("td",null,(0,v.v_)(e.id),1),(0,i.Lk)("td",null,(0,v.v_)(e.title),1),(0,i.Lk)("td",null,(0,v.v_)(a.getDifficultyText(e.difficulty)),1),(0,i.Lk)("td",null,[e.knowledge&&e.knowledge.length>0?((0,i.uX)(!0),(0,i.CE)(i.FK,{key:0},(0,i.pI)(e.knowledge,(e=>((0,i.uX)(),(0,i.CE)("span",{key:e.id,class:"knowledge-tag"},(0,v.v_)(e.title),1)))),128)):((0,i.uX)(),(0,i.CE)("span",E,"无"))]),(0,i.Lk)("td",null,[(0,i.Lk)("span",{class:(0,v.C4)(["status-tag",{unmarked:null===e.status,solved:1===e.status,unsolved:0===e.status}])},(0,v.v_)(a.getStatusText(e.status)),3)])],8,T)))),128))])]),(0,i.Lk)("div",$,[(0,i.Lk)("button",{disabled:1===s.page,onClick:t[7]||(t[7]=e=>a.changePage(s.page-1))},"上一页",8,_),(0,i.Lk)("span",null,"第 "+(0,v.v_)(s.page)+" 页 / 共 "+(0,v.v_)(s.totalPages)+" 页",1),(0,i.Lk)("button",{disabled:s.page===s.totalPages,onClick:t[8]||(t[8]=e=>a.changePage(s.page+1))},"下一页",8,K)])])}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")||""}},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=""))}},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,g.A)(O,[["render",S],["__scopeId","data-v-8b2156d0"]]);var j=X;const A={key:0,class:"problem-detail"},F={class:"problem-header"},x={class:"problem-meta"},J={class:"difficulty"},I={class:"knowledge-points",style:{"margin-top":"10px"}},N={key:1,class:"no-knowledge"},U={class:"problem-content"},M={class:"content-section"},V=["innerHTML"],z={class:"content-section"},D={class:"example"},q={key:0,class:"content-section"},H=["innerHTML"],Q={class:"problem-status"};function W(e,t,o,n,l,s){return l.problem?((0,i.uX)(),(0,i.CE)("div",A,[(0,i.Lk)("div",F,[(0,i.Lk)("h1",null,(0,v.v_)(l.problem.title),1),(0,i.Lk)("div",x,[(0,i.Lk)("span",J,"难度:"+(0,v.v_)(s.getDifficultyText(l.problem.difficulty)),1),(0,i.Lk)("div",I,[t[2]||(t[2]=(0,i.eW)(" 知识点: ")),l.problem.knowledge&&l.problem.knowledge.length>0?((0,i.uX)(!0),(0,i.CE)(i.FK,{key:0},(0,i.pI)(l.problem.knowledge,(e=>((0,i.uX)(),(0,i.CE)("span",{key:e.id,class:"knowledge-tag"},(0,v.v_)(e.title),1)))),128)):((0,i.uX)(),(0,i.CE)("span",N,"无"))])])]),(0,i.Lk)("div",U,[(0,i.Lk)("div",M,[t[3]||(t[3]=(0,i.Lk)("h2",null,"题目描述",-1)),(0,i.Lk)("div",{innerHTML:s.renderedContent},null,8,V)]),(0,i.Lk)("div",z,[t[6]||(t[6]=(0,i.Lk)("h2",null,"示例",-1)),(0,i.Lk)("div",D,[t[4]||(t[4]=(0,i.Lk)("h3",null,"输入",-1)),(0,i.Lk)("pre",null,(0,v.v_)(l.problem.example_input),1),t[5]||(t[5]=(0,i.Lk)("h3",null,"输出",-1)),(0,i.Lk)("pre",null,(0,v.v_)(l.problem.example_output),1)])]),l.problem.hint?((0,i.uX)(),(0,i.CE)("div",q,[t[7]||(t[7]=(0,i.Lk)("h2",null,"提示",-1)),(0,i.Lk)("div",{innerHTML:s.renderedHint},null,8,H)])):(0,i.Q3)("",!0)]),(0,i.Lk)("div",Q,[(0,i.Lk)("button",{onClick:t[0]||(t[0]=e=>s.markProblem(0)),class:(0,v.C4)({active:0===l.problem.status})}," 不会 ",2),(0,i.Lk)("button",{onClick:t[1]||(t[1]=e=>s.markProblem(1)),class:(0,v.C4)({active:1===l.problem.status})}," 已会 ",2)])])):(0,i.Q3)("",!0)}var R=o(642),B=o(1995),G=o.n(B),Y=o(1109),Z=(o(9351),o(437)),ee=o(8734),te=o.n(ee),oe={data(){return{problem:null,md:null,token:h.A.get("token")||""}},created(){this.md=new R.A({html:!0,breaks:!0,linkify:!0,highlight:function(e,t){if(t&&Y.A.getLanguage(t))try{return Y.A.highlight(e,{language:t}).value}catch(o){}return""}});const e=this.md.renderer.rules.text||function(e,t,o,n,i){return i.renderToken(e,t,o)};this.md.renderer.rules.text=function(t,o,n,i,l){let s=t[o].content;return s=s.replace(/(?{try{return Z.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX error:",o),e}})),s=s.replace(/(?{try{return Z.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX error:",o),e}})),t[o].content=s,e(t,o,n,i,l)},this.md.use(G())},computed:{renderedContent(){if(!this.problem)return"";let e=this.md.render(this.problem.content);return e=e.replace(/\$([^$\n]+?)\$/g,((e,t)=>{try{return Z.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return Z.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=te().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 Z.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return Z.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=te().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(){try{const e=this.problem.id+1,t=await fetch(`https://api.oj.东北大学.com/problem?problem_id=${e}`,{headers:{Authorization:this.token}});if(!t.ok)return void(404===t.status?alert("已经是最后一题了~"):alert("获取下一题失败"));const o=await t.json();o&&o.id&&this.$router.push(`/problem/${o.id}`)}catch(e){console.error("Error:",e),alert("获取下一题失败")}},async goToPreviousProblem(){try{const e=this.problem.id-1;if(e<1)return void alert("已经是第一题了~");const t=await fetch(`https://api.oj.东北大学.com/problem?problem_id=${e}`,{headers:{Authorization:this.token}});if(!t.ok)return void alert("获取上一题失败");const o=await t.json();o&&o.id&&this.$router.push(`/problem/${o.id}`)}catch(e){console.error("Error:",e),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 ne=(0,g.A)(oe,[["render",W]]);var ie=ne;const le={class:"problem-list"},se={class:"filters"},ae={class:"knowledge-search",ref:"knowledgeSearch"},re={key:0,class:"knowledge-list"},de=["onClick"],ce={class:"problems-table"},ue=["onClick"],he={key:1,class:"no-knowledge"},pe={class:"pagination"},ge=["disabled"],ke=["disabled"];function me(e,t,o,l,s,a){return(0,i.uX)(),(0,i.CE)("div",le,[(0,i.Lk)("div",se,[(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>s.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,s.title]]),(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,s.content]]),(0,i.bo)((0,i.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>s.difficulty=e)},t[9]||(t[9]=[(0,i.Fv)('',11)]),512),[[n.u1,s.difficulty]]),(0,i.bo)((0,i.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>s.statusFilter=e)},t[10]||(t[10]=[(0,i.Lk)("option",{value:""},"全部状态",-1),(0,i.Lk)("option",{value:"0"},"只看不会的题",-1),(0,i.Lk)("option",{value:"1"},"只看已会的题",-1)]),512),[[n.u1,s.statusFilter]]),(0,i.Lk)("div",ae,[(0,i.bo)((0,i.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>s.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>a.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>a.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,s.knowledgeSearch]]),s.showKnowledgeList?((0,i.uX)(),(0,i.CE)("div",re,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(s.knowledgePoints,(e=>((0,i.uX)(),(0,i.CE)("div",{key:e.id,onClick:t=>a.selectKnowledge(e),class:"knowledge-item"},(0,v.v_)(e.title),9,de)))),128))])):(0,i.Q3)("",!0)],512)]),(0,i.Lk)("table",ce,[t[11]||(t[11]=(0,i.Lk)("thead",null,[(0,i.Lk)("tr",null,[(0,i.Lk)("th",null,"编号"),(0,i.Lk)("th",null,"标题"),(0,i.Lk)("th",null,"难度"),(0,i.Lk)("th",null,"知识点"),(0,i.Lk)("th",null,"状态")])],-1)),(0,i.Lk)("tbody",null,[((0,i.uX)(!0),(0,i.CE)(i.FK,null,(0,i.pI)(s.problems,(e=>((0,i.uX)(),(0,i.CE)("tr",{key:e.id,onClick:t=>a.goToProblem(e.id)},[(0,i.Lk)("td",null,(0,v.v_)(e.id),1),(0,i.Lk)("td",null,(0,v.v_)(e.title),1),(0,i.Lk)("td",null,(0,v.v_)(a.getDifficultyText(e.difficulty)),1),(0,i.Lk)("td",null,[e.knowledge&&e.knowledge.length>0?((0,i.uX)(!0),(0,i.CE)(i.FK,{key:0},(0,i.pI)(e.knowledge,(e=>((0,i.uX)(),(0,i.CE)("span",{key:e.id,class:"knowledge-tag"},(0,v.v_)(e.title),1)))),128)):((0,i.uX)(),(0,i.CE)("span",he,"无"))]),(0,i.Lk)("td",null,[(0,i.Lk)("span",{class:(0,v.C4)(["status-tag",{solved:1===e.status,unsolved:0===e.status}])},(0,v.v_)(a.getStatusText(e.status)),3)])],8,ue)))),128))])]),(0,i.Lk)("div",pe,[(0,i.Lk)("button",{disabled:1===s.page,onClick:t[7]||(t[7]=e=>a.changePage(s.page-1))},"上一页",8,ge),(0,i.Lk)("span",null,"第 "+(0,v.v_)(s.page)+" 页 / 共 "+(0,v.v_)(s.totalPages)+" 页",1),(0,i.Lk)("button",{disabled:s.page===s.totalPages,onClick:t[8]||(t[8]=e=>a.changePage(s.page+1))},"下一页",8,ke)])])}var be={data(){return{problems:[],page:1,totalPages:1,title:"",content:"",difficulty:"",statusFilter:"",knowledgeSearch:"",knowledgePoints:[],showKnowledgeList:!1,selectedKnowledge:null,token:h.A.get("token")||""}},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=""))}},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 ve=(0,g.A)(be,[["render",me],["__scopeId","data-v-131cee16"]]);var fe=ve;const we=[{path:"/",redirect:"/problems"},{path:"/problems",name:"ProblemList",component:j},{path:"/problem/:id",name:"ProblemDetail",component:ie,meta:{title:"题目详情"}},{path:"/my",name:"MyProblemList",component:fe},{path:"/:pathMatch(.*)*",redirect:"/problems"}],ye=(0,b.aE)({history:(0,b.LA)(),routes:we});var Le=ye,Pe=o(782),Ce=(0,Pe.y$)({state:{},getters:{},mutations:{},actions:{},modules:{}});(0,n.Ef)(m).use(Ce).use(Le).mount("#app")}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var l=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(l.exports,l,l.exports,o),l.loaded=!0,l.exports}o.m=e,function(){var e=[];o.O=function(t,n,i,l){if(!n){var s=1/0;for(c=0;c=l)&&Object.keys(o.O).every((function(e){return o.O[e](n[r])}))?n.splice(r--,1):(a=!1,l0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[n,i,l]}}(),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.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(){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(){var e={524:0};o.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,l,s=n[0],a=n[1],r=n[2],d=0;if(s.some((function(t){return 0!==e[t]}))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(r)var c=r(o)}for(t&&t(n);dt[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})]),t[6]||(t[6]=(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"},"本题库所有题目均来自东北大学OJ系统,本站仅归纳展示题目,不提供在线评测环境")],-1))]),(0,l.Lk)("div",c,[(0,l.bF)(g)])],64)):((0,l.uX)(),(0,l.CE)("div",a,[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"},"为帮助考研NEU同学准备复试机试,本系统仅需注册账号即可使用,无需经过校内验证。",-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()}},g=o(1241);const k=(0,g.A)(p,[["render",u]]);var m=k,b=o(1387),v=o(4232);const f={class:"problem-list"},w={class:"filters"},L={class:"knowledge-search",ref:"knowledgeSearch"},y={key:0,class:"knowledge-list"},P=["onClick"],C={class:"problems-table"},T=["onClick"],E={key:1,class:"no-knowledge"},K={class:"pagination"},S=["disabled"],$=["disabled"];function _(e,t,o,i,s,a){return(0,l.uX)(),(0,l.CE)("div",f,[(0,l.Lk)("div",w,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>s.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,s.title]]),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,s.content]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>s.difficulty=e)},t[9]||(t[9]=[(0,l.Fv)('',11)]),512),[[n.u1,s.difficulty]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>s.statusFilter=e)},t[10]||(t[10]=[(0,l.Lk)("option",{value:""},"全部状态",-1),(0,l.Lk)("option",{value:"0"},"不显示已会的题",-1),(0,l.Lk)("option",{value:"1"},"不显示已会和不会的题",-1)]),512),[[n.u1,s.statusFilter]]),(0,l.Lk)("div",L,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>s.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>a.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>a.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,s.knowledgeSearch]]),s.showKnowledgeList?((0,l.uX)(),(0,l.CE)("div",y,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(s.knowledgePoints,(e=>((0,l.uX)(),(0,l.CE)("div",{key:e.id,onClick:t=>a.selectKnowledge(e),class:"knowledge-item"},(0,v.v_)(e.title),9,P)))),128))])):(0,l.Q3)("",!0)],512)]),(0,l.Lk)("table",C,[t[11]||(t[11]=(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)(s.problems,(e=>((0,l.uX)(),(0,l.CE)("tr",{key:e.id,onClick:t=>a.goToProblem(e.id)},[(0,l.Lk)("td",null,(0,v.v_)(e.id),1),(0,l.Lk)("td",null,(0,v.v_)(e.title),1),(0,l.Lk)("td",null,(0,v.v_)(a.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,v.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",E,"无"))]),(0,l.Lk)("td",null,[(0,l.Lk)("span",{class:(0,v.C4)(["status-tag",{unmarked:null===e.status,solved:1===e.status,unsolved:0===e.status}])},(0,v.v_)(a.getStatusText(e.status)),3)])],8,T)))),128))])]),(0,l.Lk)("div",K,[(0,l.Lk)("button",{disabled:1===s.page,onClick:t[7]||(t[7]=e=>a.changePage(s.page-1))},"上一页",8,S),(0,l.Lk)("span",null,"第 "+(0,v.v_)(s.page)+" 页 / 共 "+(0,v.v_)(s.totalPages)+" 页",1),(0,l.Lk)("button",{disabled:s.page===s.totalPages,onClick:t[8]||(t[8]=e=>a.changePage(s.page+1))},"下一页",8,$)])])}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")||""}},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=""))}},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,g.A)(O,[["render",_],["__scopeId","data-v-8b2156d0"]]);var x=X;const F={key:0,class:"problem-detail"},j={class:"problem-header"},A={class:"problem-meta"},J={class:"difficulty"},N={class:"knowledge-points",style:{"margin-top":"10px"}},I={key:1,class:"no-knowledge"},U={class:"problem-content"},M={class:"content-section"},V=["innerHTML"],z={class:"content-section"},D={class:"example"},q={key:0,class:"content-section"},H=["innerHTML"],Q={class:"problem-status"},W=["disabled"],R=["disabled"];function B(e,t,o,n,i,s){return i.problem?((0,l.uX)(),(0,l.CE)("div",F,[(0,l.Lk)("div",j,[(0,l.Lk)("h1",null,(0,v.v_)(i.problem.title),1),(0,l.Lk)("div",A,[(0,l.Lk)("span",J,"难度:"+(0,v.v_)(s.getDifficultyText(i.problem.difficulty)),1),(0,l.Lk)("div",N,[t[5]||(t[5]=(0,l.eW)(" 知识点: ")),i.problem.knowledge&&i.problem.knowledge.length>0?((0,l.uX)(!0),(0,l.CE)(l.FK,{key:0},(0,l.pI)(i.problem.knowledge,(e=>((0,l.uX)(),(0,l.CE)("span",{key:e.id,class:"knowledge-tag"},(0,v.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",I,"无"))])])]),(0,l.Lk)("div",U,[(0,l.Lk)("div",M,[t[6]||(t[6]=(0,l.Lk)("h2",null,"题目描述",-1)),(0,l.Lk)("div",{innerHTML:s.renderedContent},null,8,V)]),(0,l.Lk)("div",z,[t[9]||(t[9]=(0,l.Lk)("h2",null,"示例",-1)),(0,l.Lk)("div",D,[t[7]||(t[7]=(0,l.Lk)("h3",null,"输入",-1)),(0,l.Lk)("pre",null,(0,v.v_)(i.problem.example_input),1),t[8]||(t[8]=(0,l.Lk)("h3",null,"输出",-1)),(0,l.Lk)("pre",null,(0,v.v_)(i.problem.example_output),1)])]),i.problem.hint?((0,l.uX)(),(0,l.CE)("div",q,[t[10]||(t[10]=(0,l.Lk)("h2",null,"提示",-1)),(0,l.Lk)("div",{innerHTML:s.renderedHint},null,8,H)])):(0,l.Q3)("",!0)]),(0,l.Lk)("div",Q,[(0,l.Lk)("button",{onClick:t[0]||(t[0]=e=>s.markProblem(0)),class:(0,v.C4)({active:0===i.problem.status})}," 不会 ",2),(0,l.Lk)("button",{onClick:t[1]||(t[1]=e=>s.markProblem(1)),class:(0,v.C4)({active:1===i.problem.status})}," 已会 ",2),(0,l.Lk)("button",{onClick:t[2]||(t[2]=e=>s.markProblem(2)),class:"clear-mark"}," 清除标记 "),(0,l.Lk)("button",{onClick:t[3]||(t[3]=(...e)=>s.goToPreviousProblem&&s.goToPreviousProblem(...e)),class:"previous-problem",disabled:!i.problem.last}," 上一题 ",8,W),(0,l.Lk)("button",{onClick:t[4]||(t[4]=(...e)=>s.goToNextProblem&&s.goToNextProblem(...e)),class:"next-problem",disabled:!i.problem.next}," 下一题 ",8,R)])])):(0,l.Q3)("",!0)}var G=o(642),Y=o(1995),Z=o.n(Y),ee=o(1109),te=(o(9351),o(437)),oe=o(8734),ne=o.n(oe),le={data(){return{problem:null,md:null,token:h.A.get("token")||""}},created(){this.md=new G.A({html:!0,breaks:!0,linkify:!0,highlight:function(e,t){if(t&&ee.A.getLanguage(t))try{return ee.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 s=t[o].content;return s=s.replace(/(?{try{return te.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX error:",o),e}})),s=s.replace(/(?{try{return te.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX error:",o),e}})),t[o].content=s,e(t,o,n,l,i)},this.md.use(Z())},computed:{renderedContent(){if(!this.problem)return"";let e=this.md.render(this.problem.content);return e=e.replace(/\$([^$\n]+?)\$/g,((e,t)=>{try{return te.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return te.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=ne().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 te.Ay.renderToString(t.trim(),{displayMode:!1})}catch(o){return console.warn("KaTeX inline error:",o),e}})),e=e.replace(/\$\$([^$]+?)\$\$/g,((e,t)=>{try{return te.Ay.renderToString(t.trim(),{displayMode:!0})}catch(o){return console.warn("KaTeX display error:",o),e}})),e=ne().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("已经是第一题了~")}},mounted(){this.fetchProblem()},watch:{"$route.params.id"(){this.fetchProblem()},"problem.title"(){this.problem&&this.problem.title&&(document.title=`${this.problem.title} - OJ题库 - NEU小站`)}}};const ie=(0,g.A)(le,[["render",B]]);var se=ie;const ae={class:"problem-list"},re={class:"filters"},de={class:"knowledge-search",ref:"knowledgeSearch"},ce={key:0,class:"knowledge-list"},ue=["onClick"],he={class:"problems-table"},pe=["onClick"],ge={key:1,class:"no-knowledge"},ke={class:"pagination"},me=["disabled"],be=["disabled"];function ve(e,t,o,i,s,a){return(0,l.uX)(),(0,l.CE)("div",ae,[(0,l.Lk)("div",re,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>s.title=e),placeholder:"搜索题目标题"},null,512),[[n.Jo,s.title]]),(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>s.content=e),placeholder:"搜索题目内容"},null,512),[[n.Jo,s.content]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>s.difficulty=e)},t[9]||(t[9]=[(0,l.Fv)('',11)]),512),[[n.u1,s.difficulty]]),(0,l.bo)((0,l.Lk)("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>s.statusFilter=e)},t[10]||(t[10]=[(0,l.Lk)("option",{value:""},"全部状态",-1),(0,l.Lk)("option",{value:"0"},"只看不会的题",-1),(0,l.Lk)("option",{value:"1"},"只看已会的题",-1)]),512),[[n.u1,s.statusFilter]]),(0,l.Lk)("div",de,[(0,l.bo)((0,l.Lk)("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>s.knowledgeSearch=e),onFocus:t[5]||(t[5]=e=>a.fetchKnowledgePoints()),onInput:t[6]||(t[6]=e=>a.fetchKnowledgePoints()),placeholder:"搜索知识点"},null,544),[[n.Jo,s.knowledgeSearch]]),s.showKnowledgeList?((0,l.uX)(),(0,l.CE)("div",ce,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(s.knowledgePoints,(e=>((0,l.uX)(),(0,l.CE)("div",{key:e.id,onClick:t=>a.selectKnowledge(e),class:"knowledge-item"},(0,v.v_)(e.title),9,ue)))),128))])):(0,l.Q3)("",!0)],512)]),(0,l.Lk)("table",he,[t[11]||(t[11]=(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)(s.problems,(e=>((0,l.uX)(),(0,l.CE)("tr",{key:e.id,onClick:t=>a.goToProblem(e.id)},[(0,l.Lk)("td",null,(0,v.v_)(e.id),1),(0,l.Lk)("td",null,(0,v.v_)(e.title),1),(0,l.Lk)("td",null,(0,v.v_)(a.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,v.v_)(e.title),1)))),128)):((0,l.uX)(),(0,l.CE)("span",ge,"无"))]),(0,l.Lk)("td",null,[(0,l.Lk)("span",{class:(0,v.C4)(["status-tag",{solved:1===e.status,unsolved:0===e.status}])},(0,v.v_)(a.getStatusText(e.status)),3)])],8,pe)))),128))])]),(0,l.Lk)("div",ke,[(0,l.Lk)("button",{disabled:1===s.page,onClick:t[7]||(t[7]=e=>a.changePage(s.page-1))},"上一页",8,me),(0,l.Lk)("span",null,"第 "+(0,v.v_)(s.page)+" 页 / 共 "+(0,v.v_)(s.totalPages)+" 页",1),(0,l.Lk)("button",{disabled:s.page===s.totalPages,onClick:t[8]||(t[8]=e=>a.changePage(s.page+1))},"下一页",8,be)])])}var fe={data(){return{problems:[],page:1,totalPages:1,title:"",content:"",difficulty:"",statusFilter:"",knowledgeSearch:"",knowledgePoints:[],showKnowledgeList:!1,selectedKnowledge:null,token:h.A.get("token")||""}},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=""))}},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 we=(0,g.A)(fe,[["render",ve],["__scopeId","data-v-131cee16"]]);var Le=we;const ye=[{path:"/",redirect:"/problems"},{path:"/problems",name:"ProblemList",component:x},{path:"/problem/:id",name:"ProblemDetail",component:se,meta:{title:"题目详情"}},{path:"/my",name:"MyProblemList",component:Le},{path:"/:pathMatch(.*)*",redirect:"/problems"}],Pe=(0,b.aE)({history:(0,b.LA)(),routes:ye});var Ce=Pe,Te=o(782),Ee=(0,Te.y$)({state:{},getters:{},mutations:{},actions:{},modules:{}});(0,n.Ef)(m).use(Ee).use(Ce).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 s=1/0;for(c=0;c=i)&&Object.keys(o.O).every((function(e){return o.O[e](n[r])}))?n.splice(r--,1):(a=!1,i0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[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.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(){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(){var e={524:0};o.O.j=function(t){return 0===e[t]};var t=function(t,n){var l,i,s=n[0],a=n[1],r=n[2],d=0;if(s.some((function(t){return 0!==e[t]}))){for(l in a)o.o(a,l)&&(o.m[l]=a[l]);if(r)var c=r(o)}for(t&&t(n);d 已会 - - + @@ -242,55 +244,18 @@ }); }, async goToNextProblem() { - try { - const next_id = this.problem.id + 1; - const response = await fetch(`https://api.oj.东北大学.com/problem?problem_id=${next_id}`, { - headers: { - 'Authorization': this.token - } - }); - if (!response.ok) { - if (response.status === 404) { - // 已经是最后一题 - alert('已经是最后一题了~'); - } else { - alert('获取下一题失败'); - } - return; - } - const data = await response.json(); - if (data && data.id) { - this.$router.push(`/problem/${data.id}`); - } - } catch (error) { - console.error('Error:', error); - alert('获取下一题失败'); + if (!this.problem.next) { + alert('已经是最后一题了~'); + return; } + this.$router.push(`/problem/${this.problem.next}`); }, async goToPreviousProblem() { - try { - const previous_id = this.problem.id - 1; - if (previous_id < 1) { - alert('已经是第一题了~'); - return; - } - const response = await fetch(`https://api.oj.东北大学.com/problem?problem_id=${previous_id}`, { - headers: { - 'Authorization': this.token - } - }); - if (!response.ok) { - alert('获取上一题失败'); - return; - } - const data = await response.json(); - if (data && data.id) { - this.$router.push(`/problem/${data.id}`); - } - } catch (error) { - console.error('Error:', error); - alert('获取上一题失败'); + if (!this.problem.last) { + alert('已经是第一题了~'); + return; } + this.$router.push(`/problem/${this.problem.last}`); } }, mounted() { @@ -616,4 +581,31 @@ background-color: #757575; border-color: #757575; } + +.problem-status button:disabled { + background-color: #cccccc; + border-color: #cccccc; + cursor: not-allowed; + opacity: 0.7; +} + +.problem-status button.previous-problem:disabled, +.problem-status button.next-problem:disabled { + background-color: #90CAF9; + border-color: #90CAF9; + opacity: 0.5; +} + +.problem-status button.previous-problem, +.problem-status button.next-problem { + background-color: #2196F3; + color: white; + border-color: #2196F3; +} + +.problem-status button.previous-problem:hover:not(:disabled), +.problem-status button.next-problem:hover:not(:disabled) { + background-color: #1976D2; + border-color: #1976D2; +} \ No newline at end of file