delete all element-plus related.

This commit is contained in:
2023-01-18 21:06:50 +08:00
parent 947111247e
commit 5763f6dea2
20 changed files with 405 additions and 631 deletions

165
package-lock.json generated
View File

@@ -14,9 +14,7 @@
"@vueuse/integrations": "^9.10.0", "@vueuse/integrations": "^9.10.0",
"axios": "^1.2.2", "axios": "^1.2.2",
"copy-text-to-clipboard": "^3.0.1", "copy-text-to-clipboard": "^3.0.1",
"element-plus": "^2.2.28",
"naive-ui": "^2.34.3", "naive-ui": "^2.34.3",
"normalize.css": "^8.0.1",
"party-js": "^2.2.0", "party-js": "^2.2.0",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"vue": "^3.2.45", "vue": "^3.2.45",
@@ -80,14 +78,6 @@
"vue": "^3.0.11" "vue": "^3.0.11"
} }
}, },
"node_modules/@ctrl/tinycolor": {
"version": "3.5.0",
"resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.5.0.tgz",
"integrity": "sha512-tlJpwF40DEQcfR/QF+wNMVyGMaO9FQp6Z1Wahj4Gk3CJQYHwA2xVG7iKDFdW6zuxZY9XWOpGcfNCTsX4McOsOg==",
"engines": {
"node": ">=10"
}
},
"node_modules/@element-plus/icons-vue": { "node_modules/@element-plus/icons-vue": {
"version": "2.0.10", "version": "2.0.10",
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz", "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz",
@@ -453,19 +443,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/@floating-ui/core": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.1.0.tgz",
"integrity": "sha512-zbsLwtnHo84w1Kc8rScAo5GMk1GdecSlrflIbfnEBJwvTSj1SL6kkOYV+nHraMCPEy+RNZZUaZyL8JosDGCtGQ=="
},
"node_modules/@floating-ui/dom": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.1.0.tgz",
"integrity": "sha512-TSogMPVxbRe77QCj1dt8NmRiJasPvuc+eT5jnJ6YpLqgOD2zXc5UA3S1qwybN+GVCDNdKfpKy1oj8RpzLJvh6A==",
"dependencies": {
"@floating-ui/core": "^1.0.5"
}
},
"node_modules/@iconify-json/ep": { "node_modules/@iconify-json/ep": {
"version": "1.1.8", "version": "1.1.8",
"resolved": "https://registry.npmmirror.com/@iconify-json/ep/-/ep-1.1.8.tgz", "resolved": "https://registry.npmmirror.com/@iconify-json/ep/-/ep-1.1.8.tgz",
@@ -580,12 +557,6 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/@popperjs/core": {
"name": "@sxzz/popperjs-es",
"version": "2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
},
"node_modules/@rollup/pluginutils": { "node_modules/@rollup/pluginutils": {
"version": "5.0.2", "version": "5.0.2",
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
@@ -1182,11 +1153,6 @@
"date-fns": ">=2.0.0" "date-fns": ">=2.0.0"
} }
}, },
"node_modules/dayjs": {
"version": "1.11.7",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz",
"integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
},
"node_modules/de-indent": { "node_modules/de-indent": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz",
@@ -1218,31 +1184,6 @@
"node": ">=0.4.0" "node": ">=0.4.0"
} }
}, },
"node_modules/element-plus": {
"version": "2.2.28",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.28.tgz",
"integrity": "sha512-BsxF7iEaBydmRfw1Tt++EO9jRBjbtJr7ZRIrnEwz4J3Cwa1IzHCNCcx3ZwcYTlJq9CYFxv94JnbNr1EbkTou3A==",
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.0.6",
"@floating-ui/dom": "^1.0.1",
"@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
"@types/lodash": "^4.14.182",
"@types/lodash-es": "^4.17.6",
"@vueuse/core": "^9.1.0",
"async-validator": "^4.2.5",
"dayjs": "^1.11.3",
"escape-html": "^1.0.3",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.2.0"
},
"peerDependencies": {
"vue": "^3.2.0"
}
},
"node_modules/entities": { "node_modules/entities": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
@@ -1289,11 +1230,6 @@
"@esbuild/win32-x64": "0.16.17" "@esbuild/win32-x64": "0.16.17"
} }
}, },
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"node_modules/escape-string-regexp": { "node_modules/escape-string-regexp": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
@@ -1677,16 +1613,6 @@
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
}, },
"node_modules/lodash-unified": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz",
"integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==",
"peerDependencies": {
"@types/lodash-es": "*",
"lodash": "*",
"lodash-es": "*"
}
},
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "0.27.0", "version": "0.27.0",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz",
@@ -1727,11 +1653,6 @@
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==",
"dev": true "dev": true
}, },
"node_modules/memoize-one": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz",
"integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="
},
"node_modules/merge-stream": { "node_modules/merge-stream": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -1877,16 +1798,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/normalize-wheel-es": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
},
"node_modules/normalize.css": {
"version": "8.0.1",
"resolved": "https://registry.npmmirror.com/normalize.css/-/normalize.css-8.0.1.tgz",
"integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg=="
},
"node_modules/npm-run-path": { "node_modules/npm-run-path": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz", "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz",
@@ -2648,11 +2559,6 @@
"integrity": "sha512-AQLGhhaE0F+rwybRCkKUdzBdTEM/5PZBYy+fSYe1T9z9+yxMuV/k7ZRqa4M69X+EI1W8pa4kc9Iq2VjQkZx4rg==", "integrity": "sha512-AQLGhhaE0F+rwybRCkKUdzBdTEM/5PZBYy+fSYe1T9z9+yxMuV/k7ZRqa4M69X+EI1W8pa4kc9Iq2VjQkZx4rg==",
"requires": {} "requires": {}
}, },
"@ctrl/tinycolor": {
"version": "3.5.0",
"resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.5.0.tgz",
"integrity": "sha512-tlJpwF40DEQcfR/QF+wNMVyGMaO9FQp6Z1Wahj4Gk3CJQYHwA2xVG7iKDFdW6zuxZY9XWOpGcfNCTsX4McOsOg=="
},
"@element-plus/icons-vue": { "@element-plus/icons-vue": {
"version": "2.0.10", "version": "2.0.10",
"resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz", "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz",
@@ -2818,19 +2724,6 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"@floating-ui/core": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.1.0.tgz",
"integrity": "sha512-zbsLwtnHo84w1Kc8rScAo5GMk1GdecSlrflIbfnEBJwvTSj1SL6kkOYV+nHraMCPEy+RNZZUaZyL8JosDGCtGQ=="
},
"@floating-ui/dom": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.1.0.tgz",
"integrity": "sha512-TSogMPVxbRe77QCj1dt8NmRiJasPvuc+eT5jnJ6YpLqgOD2zXc5UA3S1qwybN+GVCDNdKfpKy1oj8RpzLJvh6A==",
"requires": {
"@floating-ui/core": "^1.0.5"
}
},
"@iconify-json/ep": { "@iconify-json/ep": {
"version": "1.1.8", "version": "1.1.8",
"resolved": "https://registry.npmmirror.com/@iconify-json/ep/-/ep-1.1.8.tgz", "resolved": "https://registry.npmmirror.com/@iconify-json/ep/-/ep-1.1.8.tgz",
@@ -2933,11 +2826,6 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
},
"@rollup/pluginutils": { "@rollup/pluginutils": {
"version": "5.0.2", "version": "5.0.2",
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
@@ -3396,11 +3284,6 @@
"integrity": "sha512-1t1b8zyJo+UI8aR+g3iqr5fkUHWpd58VBx8J/ZSQ+w7YrGlw80Ag4sA86qkfCXRBLmMc4I2US+aPMd4uKvwj5g==", "integrity": "sha512-1t1b8zyJo+UI8aR+g3iqr5fkUHWpd58VBx8J/ZSQ+w7YrGlw80Ag4sA86qkfCXRBLmMc4I2US+aPMd4uKvwj5g==",
"requires": {} "requires": {}
}, },
"dayjs": {
"version": "1.11.7",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz",
"integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
},
"de-indent": { "de-indent": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz",
@@ -3421,28 +3304,6 @@
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
}, },
"element-plus": {
"version": "2.2.28",
"resolved": "https://registry.npmmirror.com/element-plus/-/element-plus-2.2.28.tgz",
"integrity": "sha512-BsxF7iEaBydmRfw1Tt++EO9jRBjbtJr7ZRIrnEwz4J3Cwa1IzHCNCcx3ZwcYTlJq9CYFxv94JnbNr1EbkTou3A==",
"requires": {
"@ctrl/tinycolor": "^3.4.1",
"@element-plus/icons-vue": "^2.0.6",
"@floating-ui/dom": "^1.0.1",
"@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
"@types/lodash": "^4.14.182",
"@types/lodash-es": "^4.17.6",
"@vueuse/core": "^9.1.0",
"async-validator": "^4.2.5",
"dayjs": "^1.11.3",
"escape-html": "^1.0.3",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.2.0"
}
},
"entities": { "entities": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz", "resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
@@ -3479,11 +3340,6 @@
"@esbuild/win32-x64": "0.16.17" "@esbuild/win32-x64": "0.16.17"
} }
}, },
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"escape-string-regexp": { "escape-string-regexp": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
@@ -3773,12 +3629,6 @@
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz", "resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="
}, },
"lodash-unified": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/lodash-unified/-/lodash-unified-1.0.3.tgz",
"integrity": "sha512-WK9qSozxXOD7ZJQlpSqOT+om2ZfcT4yO+03FuzAHD0wF6S0l0090LRPDx3vhTTLZ8cFKpBn+IOcVXK6qOcIlfQ==",
"requires": {}
},
"magic-string": { "magic-string": {
"version": "0.27.0", "version": "0.27.0",
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz",
@@ -3815,11 +3665,6 @@
"integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==",
"dev": true "dev": true
}, },
"memoize-one": {
"version": "6.0.0",
"resolved": "https://registry.npmmirror.com/memoize-one/-/memoize-one-6.0.0.tgz",
"integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw=="
},
"merge-stream": { "merge-stream": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -3935,16 +3780,6 @@
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
"dev": true "dev": true
}, },
"normalize-wheel-es": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/normalize-wheel-es/-/normalize-wheel-es-1.2.0.tgz",
"integrity": "sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw=="
},
"normalize.css": {
"version": "8.0.1",
"resolved": "https://registry.npmmirror.com/normalize.css/-/normalize.css-8.0.1.tgz",
"integrity": "sha512-qizSNPO93t1YUuUhP22btGOo3chcvDFqFaj2TRybP0DMxkHOCTYwp3n34fel4a31ORXy4m1Xq0Gyqpb5m33qIg=="
},
"npm-run-path": { "npm-run-path": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz", "resolved": "https://registry.npmmirror.com/npm-run-path/-/npm-run-path-4.0.1.tgz",

View File

@@ -16,9 +16,7 @@
"@vueuse/integrations": "^9.10.0", "@vueuse/integrations": "^9.10.0",
"axios": "^1.2.2", "axios": "^1.2.2",
"copy-text-to-clipboard": "^3.0.1", "copy-text-to-clipboard": "^3.0.1",
"element-plus": "^2.2.28",
"naive-ui": "^2.34.3", "naive-ui": "^2.34.3",
"normalize.css": "^8.0.1",
"party-js": "^2.2.0", "party-js": "^2.2.0",
"pinia": "^2.0.28", "pinia": "^2.0.28",
"vue": "^3.2.45", "vue": "^3.2.45",

View File

@@ -6,7 +6,12 @@ const theme = computed(() => (isDark.value ? darkTheme : null))
</script> </script>
<template> <template>
<n-config-provider :theme="theme" :locale="zhCN" :date-locale="dateZhCN"> <n-config-provider
inline-theme-disabled
:theme="theme"
:locale="zhCN"
:date-locale="dateZhCN"
>
<router-view></router-view> <router-view></router-view>
</n-config-provider> </n-config-provider>
</template> </template>

47
src/components.d.ts vendored
View File

@@ -7,54 +7,22 @@ export {}
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
ElAlert: typeof import('element-plus/es')['ElAlert']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
IEpBell: typeof import('~icons/ep/bell')['default'] IEpBell: typeof import('~icons/ep/bell')['default']
IEpCaretRight: typeof import('~icons/ep/caret-right')['default'] IEpCaretRight: typeof import('~icons/ep/caret-right')['default']
IEpLoading: typeof import('~icons/ep/loading')['default'] IEpLoading: typeof import('~icons/ep/loading')['default']
IEpSelect: typeof import('~icons/ep/select')['default']
IEpSemiSelect: typeof import('~icons/ep/semi-select')['default']
NAlert: typeof import('naive-ui')['NAlert'] NAlert: typeof import('naive-ui')['NAlert']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDataTable: typeof import('naive-ui')['NDataTable'] NDataTable: typeof import('naive-ui')['NDataTable']
NDescriptions: typeof import('naive-ui')['NDescriptions']
NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
NDropdown: typeof import('naive-ui')['NDropdown'] NDropdown: typeof import('naive-ui')['NDropdown']
NDropdownItem: typeof import('naive-ui')['NDropdownItem']
NDropdownMenu: typeof import('naive-ui')['NDropdownMenu']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormGrid: typeof import('naive-ui')['NFormGrid']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NFormItemGi: typeof import('naive-ui')['NFormItemGi']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NIcon: typeof import('naive-ui')['NIcon'] NIcon: typeof import('naive-ui')['NIcon']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NLayout: typeof import('naive-ui')['NLayout'] NLayout: typeof import('naive-ui')['NLayout']
@@ -63,9 +31,12 @@ declare module '@vue/runtime-core' {
NMenu: typeof import('naive-ui')['NMenu'] NMenu: typeof import('naive-ui')['NMenu']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NPagination: typeof import('naive-ui')['NPagination'] NPagination: typeof import('naive-ui')['NPagination']
NScrollbar: typeof import('naive-ui')['NScrollbar']
NSelect: typeof import('naive-ui')['NSelect'] NSelect: typeof import('naive-ui')['NSelect']
NSpace: typeof import('naive-ui')['NSpace'] NSpace: typeof import('naive-ui')['NSpace']
NSwitch: typeof import('naive-ui')['NSwitch'] NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag'] NTag: typeof import('naive-ui')['NTag']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']

View File

@@ -18,14 +18,14 @@ function change(value: string) {
</script> </script>
<template> <template>
<el-row> <n-grid :cols="2">
<el-col :span="12"> <n-gi>
<Md /> <Md />
</el-col> </n-gi>
<el-col :span="12"> <n-gi>
<Monaco :value="code" @change="change" /> <Monaco :value="code" @change="change" />
</el-col> </n-gi>
</el-row> </n-grid>
</template> </template>
<style scoped></style> <style scoped></style>

View File

@@ -7,3 +7,7 @@ int main() {
return 0; return 0;
} }
``` ```
## nihao
我的

View File

@@ -1,6 +1,5 @@
import { createRouter, createWebHistory } from "vue-router" import { createRouter, createWebHistory } from "vue-router"
import { createPinia } from "pinia" import { createPinia } from "pinia"
import "normalize.css"
import loader from "@monaco-editor/loader" import loader from "@monaco-editor/loader"
import storage from "utils/storage" import storage from "utils/storage"

View File

@@ -1,13 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { TabsPaneContext } from "element-plus"
import { SOURCES } from "utils/constants" import { SOURCES } from "utils/constants"
import { Problem } from "utils/types" import { Problem } from "utils/types"
import Monaco from "~/shared/Monaco/index.vue" import Monaco from "~/shared/Monaco/index.vue"
import { code } from "oj/composables/code" import { code } from "oj/composables/code"
const SubmitPanel = defineAsyncComponent(() => import("./SubmitPanel.vue"))
const TestcasePanel = defineAsyncComponent(() => import("./TestcasePanel.vue"))
interface Props { interface Props {
problem: Problem problem: Problem
} }
@@ -17,9 +13,6 @@ const props = defineProps<Props>()
code.language = props.problem.languages[0] || "C" code.language = props.problem.languages[0] || "C"
code.value = props.problem.template[code.language] || SOURCES[code.language] code.value = props.problem.template[code.language] || SOURCES[code.language]
const tab = ref("test")
const submitPanelRef = ref<{ submit: Function }>()
watch(() => code.language, reset) watch(() => code.language, reset)
function reset() { function reset() {
@@ -29,54 +22,40 @@ function reset() {
function change(value: string) { function change(value: string) {
code.value = value code.value = value
} }
function onTab(pane: TabsPaneContext) {
if (pane.paneName === "submit") {
submitPanelRef && submitPanelRef.value!.submit()
}
}
</script> </script>
<template> <template>
<el-form inline> <n-form inline label-placement="left">
<el-form-item label="语言" label-width="60"> <n-form-item label="语言">
<el-select v-model="code.language" class="language"> <n-select
<el-option v-for="item in problem.languages" :key="item" :value="item"> class="language"
<img class="logo" :src="`/${item}.svg`" alt="logo" />&nbsp;&nbsp; v-model:value="code.language"
<span>{{ item }}</span> :options="problem.languages.map((it) => ({ label: it, value: it }))"
</el-option> />
</el-select> </n-form-item>
</el-form-item> <n-form-item>
<el-form-item> <n-space>
<el-button @click="reset">重置</el-button> <n-button @click="reset">重置</n-button>
<el-button @click="$router.push(`/status?problem=${problem._id}`)"> <n-button @click="$router.push(`/status?problem=${problem._id}`)">
提交信息 提交信息
</el-button> </n-button>
</el-form-item> </n-space>
</el-form> </n-form-item>
</n-form>
<Monaco <Monaco
class="editor" class="editor"
:language="code.language" :language="code.language"
:value="code.value" :value="code.value"
@change="change" @change="change"
height="calc(100vh - 621px)" height="calc(100vh - 594px)"
/> />
<el-tabs type="border-card" @tab-click="onTab" v-model="tab">
<TestcasePanel />
<SubmitPanel ref="submitPanelRef" />
</el-tabs>
</template> </template>
<style scoped> <style scoped>
.language { .language {
width: 110px; width: 120px;
} }
.editor { .editor {
min-height: 200px; min-height: 200px;
} }
.logo {
width: 12px;
}
</style> </style>

View File

@@ -1,230 +1,254 @@
<script setup lang="ts"> <script setup lang="ts">
import party from "party-js" import { createTestSubmission } from "utils/judge"
import { Ref } from "vue" import { code } from "oj/composables/code"
import { SOURCES, JUDGE_STATUS, SubmissionStatus } from "utils/constants" import party from "party-js"
import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions" import { Ref } from "vue"
import { Problem, Submission, SubmitCodePayload } from "utils/types" import { SOURCES, JUDGE_STATUS, SubmissionStatus } from "utils/constants"
import { getSubmission, submitCode } from "oj/api" import { submissionMemoryFormat, submissionTimeFormat } from "utils/functions"
import { code } from "oj/composables/code" import { Problem, Submission, SubmitCodePayload } from "utils/types"
import { getSubmission, submitCode } from "oj/api"
import SubmissionResultTag from "../../components/SubmissionResultTag.vue" import SubmissionResultTag from "../../components/SubmissionResultTag.vue"
import { DataTableColumn } from "naive-ui"
const problem = inject<Ref<Problem>>("problem")
const problem = inject<Ref<Problem>>("problem")
const route = useRoute()
const contestID = <string>route.params.contestID ?? "" const route = useRoute()
const contestID = <string>route.params.contestID ?? ""
const submissionId = ref("")
const submission = ref<Submission | null>(null) const submissionId = ref("")
const submission = ref<Submission | null>(null)
const [submitted] = useToggle() const input = ref("")
const result = ref("")
const { start: submitPending, isPending } = useTimeout(5000, { const [submitted] = useToggle()
controls: true,
immediate: false, const { start: submitPending, isPending } = useTimeout(5000, {
}) controls: true,
immediate: false,
const { start: fetchSubmission } = useTimeoutFn( })
async () => {
const res = await getSubmission(submissionId.value) const { start: fetchSubmission } = useTimeoutFn(
submission.value = res.data async () => {
const result = submission.value.result const res = await getSubmission(submissionId.value)
if ( submission.value = res.data
result === SubmissionStatus.judging || const result = submission.value.result
result === SubmissionStatus.pending if (
) { result === SubmissionStatus.judging ||
fetchSubmission() result === SubmissionStatus.pending
} else { ) {
submitted.value = false fetchSubmission()
} } else {
}, submitted.value = false
2000, }
{ immediate: false } },
) 2000,
{ immediate: false }
const judging = computed( )
() =>
!!(submission.value && submission.value.result === SubmissionStatus.judging) const judging = computed(
) () =>
!!(submission.value && submission.value.result === SubmissionStatus.judging)
const pending = computed( )
() =>
!!(submission.value && submission.value.result === SubmissionStatus.pending) const pending = computed(
) () =>
!!(submission.value && submission.value.result === SubmissionStatus.pending)
const submitting = computed( )
() =>
!!( const submitting = computed(
submission.value && () =>
submission.value.result === SubmissionStatus.submitting !!(
) submission.value &&
) submission.value.result === SubmissionStatus.submitting
)
const submitDisabled = computed(() => { )
const value = code.value
if ( const submitDisabled = computed(() => {
value.trim() === "" || const value = code.value
value === problem!.value.template[code.language] || if (
value === SOURCES[code.language] value.trim() === "" ||
) { value === problem!.value.template[code.language] ||
return true value === SOURCES[code.language]
} ) {
if (judging.value || pending.value || submitting.value) { return true
return true }
} if (judging.value || pending.value || submitting.value) {
if (submitted.value) { return true
return true }
} if (submitted.value) {
if (isPending.value) { return true
return true }
} if (isPending.value) {
return false return true
}) }
return false
const submitLabel = computed(() => { })
if (submitting.value) {
return "正在提交" const submitLabel = computed(() => {
} if (submitting.value) {
if (judging.value || pending.value) { return "正在提交"
return "正在评分" }
} if (judging.value || pending.value) {
if (isPending.value) { return "正在评分"
return "运行结果" }
} if (isPending.value) {
return "点击提交" return "运行结果"
}) }
return "点击提交"
const msg = computed(() => { })
let msg = ""
const result = submission.value && submission.value.result const msg = computed(() => {
if ( let msg = ""
result === SubmissionStatus.compile_error || const result = submission.value && submission.value.result
result === SubmissionStatus.runtime_error if (
) { result === SubmissionStatus.compile_error ||
msg += "请仔细检查,看看代码的格式是不是写错了!\n\n" result === SubmissionStatus.runtime_error
} ) {
if ( msg += "请仔细检查,看看代码的格式是不是写错了!\n\n"
submission.value && }
submission.value.statistic_info && if (
submission.value.statistic_info.err_info submission.value &&
) { submission.value.statistic_info &&
msg += submission.value.statistic_info.err_info submission.value.statistic_info.err_info
} ) {
return msg msg += submission.value.statistic_info.err_info
}) }
return msg
const infoTable = computed(() => { })
if (
submission.value && const infoTable = computed(() => {
submission.value.result !== SubmissionStatus.accepted && if (
submission.value.result !== SubmissionStatus.compile_error && submission.value &&
submission.value.result !== SubmissionStatus.runtime_error && submission.value.result !== SubmissionStatus.accepted &&
submission.value.info && submission.value.result !== SubmissionStatus.compile_error &&
submission.value.info.data && submission.value.result !== SubmissionStatus.runtime_error &&
submission.value.info.data.length submission.value.info &&
) { submission.value.info.data &&
const data = submission.value.info.data submission.value.info.data.length
if (data.some((item) => item.result === 0)) { ) {
return submission.value.info.data const data = submission.value.info.data
} else { if (data.some((item) => item.result === 0)) {
return [] return submission.value.info.data
} } else {
} else { return []
return [] }
} } else {
}) return []
}
async function submit() { })
const data: SubmitCodePayload = {
problem_id: problem!.value.id, const columns: DataTableColumn<Submission["info"]["data"][number]>[] = [
language: code.language, { title: "测试用例", key: "test_case" },
code: code.value, {
} title: "测试状态",
if (contestID) { key: "result",
data.contest_id = parseInt(contestID) render: (row) => h(SubmissionResultTag, { result: row.result }),
} },
submission.value = { result: 9 } as Submission {
const res = await submitCode(data) title: "占用内存",
submissionId.value = res.data.submission_id key: "memory",
// render: (row) => submissionMemoryFormat(row.memory),
submitPending() },
submitted.value = true {
// title: "执行耗时",
fetchSubmission() key: "real_time",
} render: (row) => submissionTimeFormat(row.real_time),
},
watch( { title: "信号", key: "signal" },
() => submission?.value?.result, ]
(result) => {
if (result === SubmissionStatus.accepted) { async function submit() {
party.confetti(document.body, { const data: SubmitCodePayload = {
count: party.variation.range(200, 400), problem_id: problem!.value.id,
size: party.variation.skew(2, 0.3), language: code.language,
}) code: code.value,
} }
} if (contestID) {
) data.contest_id = parseInt(contestID)
}
defineExpose({ submit }) submission.value = { result: 9 } as Submission
</script> const res = await submitCode(data)
<template> submissionId.value = res.data.submission_id
<el-tab-pane :disabled="submitDisabled" name="submit"> //
<template #label> submitPending()
<el-space :size="2"> submitted.value = true
<el-icon> //
<i-ep-loading v-if="judging || pending || submitting" /> fetchSubmission()
<i-ep-bell v-else-if="isPending" /> }
<i-ep-caret-right v-else />
</el-icon> watch(
<span>{{ submitLabel }}</span> () => submission?.value?.result,
</el-space> (result) => {
</template> if (result === SubmissionStatus.accepted) {
<div class="panel"> party.confetti(document.body, {
<el-alert count: party.variation.range(200, 400),
v-if="submission" size: party.variation.skew(2, 0.3),
:closable="false" })
:type="JUDGE_STATUS[submission.result]['type']" }
:title="JUDGE_STATUS[submission.result]['name']" }
> )
</el-alert>
<el-scrollbar v-if="msg" height="354" class="result"> async function testcaseSubmit() {
<div>{{ msg }}</div> const res = await createTestSubmission(code, input.value)
</el-scrollbar> result.value = res.output
<el-table }
v-if="infoTable.length"
max-height="354" const tabProps = {
:data="infoTable" onClick() {
stripe if (!submitDisabled.value) {
> submit()
<el-table-column prop="test_case" label="测试用例" align="center" /> }
<el-table-column label="测试状态" width="120" align="center"> },
<template #default="scope"> }
<SubmissionResultTag v-if="scope.row" :result="scope.row.result" /> </script>
</template>
</el-table-column> <template>
<el-table-column label="占用内存" align="center"> <n-tabs default-value="testcase">
<template #default="scope"> <n-tab-pane name="testcase" tab="测试面板">
{{ submissionMemoryFormat(scope.row.memory) }} <n-scrollbar style="height: 400px">
</template> <n-form inline label-placement="left">
</el-table-column> <n-form-item label="输入">
<el-table-column label="执行耗时" align="center"> <n-input type="textarea" v-model:value="input" />
<template #default="scope"> </n-form-item>
{{ submissionTimeFormat(scope.row.real_time) }} <n-form-item>
</template> <n-button @click="testcaseSubmit">运行</n-button>
</el-table-column> </n-form-item>
<el-table-column prop="signal" label="信号" align="center" /> </n-form>
</el-table> <div class="msg">{{ result }}</div>
</div> </n-scrollbar>
</el-tab-pane> </n-tab-pane>
</template> <n-tab-pane name="submit" :disabled="submitDisabled" :tab-props="tabProps">
<style scoped> <template #tab>
.panel { <n-icon>
height: 400px; <i-ep-loading v-if="judging || pending || submitting" />
} <i-ep-bell v-else-if="isPending" />
<i-ep-caret-right v-else />
.result { </n-icon>
margin-top: 12px; <span>{{ submitLabel }}</span>
white-space: pre; </template>
line-height: 1.5; <n-scrollbar style="height: 400px">
} <n-alert
</style> v-if="submission"
:type="JUDGE_STATUS[submission.result]['type']"
:title="JUDGE_STATUS[submission.result]['name']"
/>
<div v-if="msg" class="msg result">{{ msg }}</div>
<n-data-table
v-if="infoTable.length"
size="small"
:data="infoTable"
:columns="columns"
striped
/>
</n-scrollbar>
</n-tab-pane>
</n-tabs>
</template>
<style scoped>
.msg {
white-space: pre;
line-height: 1.5;
}
.result {
margin-top: 12px;
}
</style>

View File

@@ -6,6 +6,7 @@ import { SOURCES } from "utils/constants"
import { Problem, ProblemStatus } from "utils/types" import { Problem, ProblemStatus } from "utils/types"
import { createTestSubmission } from "utils/judge" import { createTestSubmission } from "utils/judge"
import { submissionExists } from "oj/api" import { submissionExists } from "oj/api"
import { useThemeVars } from "naive-ui"
interface Props { interface Props {
problem: Problem problem: Problem
@@ -20,6 +21,8 @@ type Sample = Problem["samples"][number] & {
const props = defineProps<Props>() const props = defineProps<Props>()
const route = useRoute() const route = useRoute()
const contestID = <string>route.params.contestID const contestID = <string>route.params.contestID
const theme = useThemeVars()
const style = computed(() => "color: " + theme.value.primaryColor)
const { data: hasSolved, execute } = submissionExists(props.problem.id) const { data: hasSolved, execute } = submissionExists(props.problem.id)
if (contestID) { if (contestID) {
execute() execute()
@@ -68,86 +71,88 @@ async function test(sample: Sample, index: number) {
}) })
} }
const icon = (status: Sample["status"]) => const icon = (status: ProblemStatus) =>
({ ({
not_test: Flag, not_test: Flag,
failed: CloseBold, failed: CloseBold,
passed: Select, passed: Select,
}[status]) }[status])
const type = (status: Sample["status"]) => const type = (status: ProblemStatus) =>
({ ({
not_test: "warning", not_test: "warning",
failed: "danger", failed: "error",
passed: "success", passed: "success",
}[status]) }[status] as "warning" | "error" | "success")
</script> </script>
<template> <template>
<el-alert <n-alert
v-if="problem.my_status === 0 || (contestID && hasSolved)" v-if="problem.my_status === 0 || (contestID && hasSolved)"
type="success" type="success"
:closable="false"
center
title="🎉 本 题 已 经 被 你 解 决 啦" title="🎉 本 题 已 经 被 你 解 决 啦"
> />
</el-alert>
<h1>{{ problem.title }}</h1> <h1>{{ problem.title }}</h1>
<p class="title">描述</p> <p class="title" :style="style">描述</p>
<div class="content" v-html="problem.description"></div> <div class="content" v-html="problem.description"></div>
<p class="title">输入</p> <p class="title" :style="style">输入</p>
<div class="content" v-html="problem.input_description"></div> <div class="content" v-html="problem.input_description"></div>
<p class="title">输出</p> <p class="title" :style="style">输出</p>
<div class="content" v-html="problem.output_description"></div> <div class="content" v-html="problem.output_description"></div>
<div v-if="problem.hint"> <div v-if="problem.hint">
<p class="title">提示</p> <p class="title" :style="style">提示</p>
<el-card shadow="never"> <div class="content" v-html="problem.hint"></div>
<div class="content" v-html="problem.hint"></div>
</el-card>
</div> </div>
<div v-for="(sample, index) of samples" :key="index"> <div v-for="(sample, index) of samples" :key="index">
<el-space> <n-space align="center">
<p class="title testcaseTitle">测试用例 {{ index + 1 }}</p> <p class="title testcaseTitle" :style="style">测试用例 {{ index + 1 }}</p>
<el-button <n-button
:icon="icon(sample.status)"
:type="type(sample.status)" :type="type(sample.status)"
:disabled="disabled" :disabled="disabled"
:loading="sample.loading" :loading="sample.loading"
circle circle
@click="test(sample, index)" @click="test(sample, index)"
></el-button> >
</el-space> <template #icon>
<el-descriptions border direction="vertical" :column="2"> <component :is="icon(sample.status)"></component>
<el-descriptions-item width="50%"> </template>
</n-button>
</n-space>
<n-descriptions
bordered
:column="2"
label-style="width: 50%; min-width: 100px"
>
<n-descriptions-item>
<template #label> <template #label>
<el-space> <n-space>
<span>输入</span> <span>输入</span>
<el-icon @click="copy(sample.input)"><CopyDocument /> </el-icon> <n-icon @click="copy(sample.input)"><CopyDocument /></n-icon>
</el-space> </n-space>
</template> </template>
<div class="testcase">{{ sample.input }}</div> <div class="testcase">{{ sample.input }}</div>
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item width="50%"> <n-descriptions-item>
<template #label> <template #label>
<el-space> <n-space>
<span>输出</span> <span>输出</span>
<el-icon @click="copy(sample.output)"><CopyDocument /> </el-icon> <n-icon @click="copy(sample.output)"><CopyDocument /></n-icon>
</el-space> </n-space>
</template> </template>
<div class="testcase">{{ sample.output }}</div> <div class="testcase">{{ sample.output }}</div>
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item label="运行结果" v-if="sample.status === 'failed'"> <n-descriptions-item label="运行结果" v-if="sample.status === 'failed'">
<div class="testcase">{{ sample.msg }}</div> <div class="testcase">{{ sample.msg }}</div>
</el-descriptions-item> </n-descriptions-item>
</el-descriptions> </n-descriptions>
</div> </div>
<div v-if="problem.source"> <div v-if="problem.source">
<p class="title">来源</p> <p class="title" :style="style">来源</p>
<div class="content" v-html="problem.source"></div> <div class="content" v-html="problem.source"></div>
</div> </div>
</template> </template>
@@ -156,7 +161,6 @@ const type = (status: Sample["status"]) =>
.title { .title {
font-size: 20px; font-size: 20px;
margin: 24px 0 16px 0; margin: 24px 0 16px 0;
color: var(--el-color-primary);
} }
.testcaseTitle { .testcaseTitle {
@@ -164,15 +168,12 @@ const type = (status: Sample["status"]) =>
} }
.content { .content {
font-size: 16px;
line-height: 2; line-height: 2;
} }
.label {
display: flex;
align-items: center;
}
.testcase { .testcase {
font-size: 14px;
white-space: pre; white-space: pre;
} }
</style> </style>

View File

@@ -11,50 +11,42 @@ defineProps<Props>()
</script> </script>
<template> <template>
<el-descriptions border :column="isDesktop ? 3 : 1"> <n-descriptions bordered label-placement="left" :column="isDesktop ? 3 : 1">
<el-descriptions-item label="编号"> <n-descriptions-item label="编号">
{{ problem._id }} {{ problem._id }}
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item label="出题人"> <n-descriptions-item label="出题人">
{{ problem.created_by.username }} {{ problem.created_by.username }}
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item label="创建时间"> <n-descriptions-item label="创建时间">
{{ parseTime(problem.create_time) }} {{ parseTime(problem.create_time) }}
</el-descriptions-item> </n-descriptions-item>
<n-descriptions-item label="难度">
<el-descriptions-item label="时间限制"> <n-tag :type="getTagColor(problem.difficulty)">
{{ problem.time_limit }}毫秒
</el-descriptions-item>
<el-descriptions-item label="内存限制">
{{ problem.memory_limit }}MB
</el-descriptions-item>
<el-descriptions-item label="难度">
<el-tag disable-transitions :type="getTagColor(problem.difficulty)">
{{ DIFFICULTY[problem.difficulty] }} {{ DIFFICULTY[problem.difficulty] }}
</el-tag> </n-tag>
</el-descriptions-item> </n-descriptions-item>
<n-descriptions-item label="时间限制">
<el-descriptions-item label="提交正确"> {{ problem.time_limit }}毫秒
</n-descriptions-item>
<n-descriptions-item label="内存限制">
{{ problem.memory_limit }}MB
</n-descriptions-item>
<n-descriptions-item label="提交正确">
{{ problem.accepted_number }} {{ problem.accepted_number }}
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item label="提交错误"> <n-descriptions-item label="提交错误">
{{ problem.submission_number - problem.accepted_number }} {{ problem.submission_number - problem.accepted_number }}
</el-descriptions-item> </n-descriptions-item>
<el-descriptions-item label="正确率"> <n-descriptions-item label="正确率">
{{ getACRate(problem.accepted_number, problem.submission_number) }} {{ getACRate(problem.accepted_number, problem.submission_number) }}
</el-descriptions-item> </n-descriptions-item>
<n-descriptions-item :span="3" label="标签">
<el-descriptions-item :span="3" label="标签"> <n-space>
<el-space> <n-tag type="info" v-for="tag in problem.tags" :key="tag">
<el-tag
disable-transitions
type="info"
v-for="tag in problem.tags"
:key="tag"
>
{{ tag }} {{ tag }}
</el-tag> </n-tag>
</el-space> </n-space>
</el-descriptions-item> </n-descriptions-item>
</el-descriptions> </n-descriptions>
</template> </template>

View File

@@ -1,40 +0,0 @@
<script setup lang="ts">
import { createTestSubmission } from "utils/judge"
import { code } from "oj/composables/code"
const input = ref("")
const result = ref("")
async function submit() {
const res = await createTestSubmission(code, input.value)
result.value = res.output
}
</script>
<template>
<el-tab-pane label="测试面板" name="test">
<div class="panel">
<el-form inline>
<el-form-item label="输入">
<el-input type="textarea" autosize v-model="input" />
</el-form-item>
<el-form-item>
<el-button @click="submit">运行</el-button>
</el-form-item>
</el-form>
<el-scrollbar height="345">
<div class="msg">{{ result }}</div>
</el-scrollbar>
</div>
</el-tab-pane>
</template>
<style scoped>
.panel {
height: 400px;
}
.msg {
white-space: pre;
line-height: 1.5;
}
</style>

View File

@@ -3,6 +3,7 @@ import { getProblem } from "oj/api"
import { isDesktop, isMobile } from "~/shared/composables/breakpoints" import { isDesktop, isMobile } from "~/shared/composables/breakpoints"
const Editor = defineAsyncComponent(() => import("./components/Editor.vue")) const Editor = defineAsyncComponent(() => import("./components/Editor.vue"))
const Panel = defineAsyncComponent(() => import("./components/Panel.vue"))
const ProblemContent = defineAsyncComponent( const ProblemContent = defineAsyncComponent(
() => import("./components/ProblemContent.vue") () => import("./components/ProblemContent.vue")
) )
@@ -24,28 +25,34 @@ provide("problem", readonly(problem))
</script> </script>
<template> <template>
<el-row v-if="isFinished && problem" :gutter="20"> <n-grid v-if="isFinished && problem" x-gap="16" :cols="2">
<el-col :span="isDesktop ? 12 : 24"> <n-gi :span="isDesktop ? 1 : 2">
<el-tabs type="border-card"> <n-tabs default-value="content">
<el-tab-pane label="题目描述"> <n-tab-pane name="content" tab="题目描述">
<el-scrollbar v-if="isDesktop" height="calc(100vh - 171px)"> <n-scrollbar v-if="isDesktop" style="max-height: calc(100vh - 136px)">
<ProblemContent :problem="problem" /> <ProblemContent :problem="problem" />
</el-scrollbar> </n-scrollbar>
<ProblemContent v-else :problem="problem" /> <ProblemContent v-else :problem="problem" />
</el-tab-pane> </n-tab-pane>
<el-tab-pane v-if="isMobile" label="代码编辑" lazy> <n-tab-pane v-if="isMobile" name="editor" tab="代码编辑">
<Editor :problem="problem" /> <Editor :problem="problem" />
</el-tab-pane> <Panel />
<el-tab-pane label="比赛信息" v-if="props.contestID" lazy></el-tab-pane> </n-tab-pane>
<el-tab-pane label="题目信息" lazy> <n-tab-pane
name="contest"
tab="比赛信息"
v-if="props.contestID"
></n-tab-pane>
<n-tab-pane name="info" tab="题目信息">
<ProblemInfo :problem="problem" /> <ProblemInfo :problem="problem" />
</el-tab-pane> </n-tab-pane>
</el-tabs> </n-tabs>
</el-col> </n-gi>
<el-col v-if="isDesktop" :span="12"> <n-gi v-if="isDesktop">
<Editor :problem="problem" /> <Editor :problem="problem" />
</el-col> <Panel />
</el-row> </n-gi>
</n-grid>
</template> </template>
<style scoped></style> <style scoped></style>

View File

@@ -184,6 +184,7 @@ function rowProps(row: ProblemFiltered) {
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<n-space> <n-space>
<n-button @click="search(query.keyword)">搜索</n-button>
<n-button @click="clear">重置</n-button> <n-button @click="clear">重置</n-button>
<n-button @click="getRandom">随机一题</n-button> <n-button @click="getRandom">随机一题</n-button>
</n-space> </n-space>

View File

@@ -173,7 +173,10 @@ const columns: DataTableColumn<Submission>[] = [
<n-input @change="search" clearable placeholder="输入后回车" /> <n-input @change="search" clearable placeholder="输入后回车" />
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<n-button @click="clear">重置</n-button> <n-space>
<n-button @click="search(query.username)">搜索</n-button>
<n-button @click="clear">重置</n-button>
</n-space>
</n-form-item> </n-form-item>
</n-form> </n-form>
<n-data-table striped size="small" :columns="columns" :data="submissions" /> <n-data-table striped size="small" :columns="columns" :data="submissions" />

View File

@@ -65,7 +65,7 @@ const options = computed<Array<DropdownOption | DropdownDividerOption>>(() => [
</script> </script>
<template> <template>
<n-space justify="space-between" align="center"> <n-space align="center">
<n-menu mode="horizontal" :options="menus" default-value="problem"></n-menu> <n-menu mode="horizontal" :options="menus" default-value="problem"></n-menu>
<n-space> <n-space>
<n-button circle @click="toggleDark()"> <n-button circle @click="toggleDark()">

View File

@@ -15,7 +15,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
language: "C", language: "C",
height: "calc(100vh - 100px)", height: "100%",
fontSize: 20, fontSize: 20,
class: "", class: "",
}) })

View File

@@ -21,7 +21,6 @@ import Header from "../Header/index.vue"
.header { .header {
padding: 8px; padding: 8px;
} }
.content { .content {
padding: 16px; padding: 16px;
} }

View File

@@ -15,7 +15,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
language: "C", language: "C",
height: "calc(100vh - 100px)", height: "100%",
fontSize: 20, fontSize: 20,
class: "", class: "",
}) })

View File

@@ -3,10 +3,7 @@ import path from "path"
import Vue from "@vitejs/plugin-vue" import Vue from "@vitejs/plugin-vue"
import AutoImport from "unplugin-auto-import/vite" import AutoImport from "unplugin-auto-import/vite"
import Components from "unplugin-vue-components/vite" import Components from "unplugin-vue-components/vite"
import { import { NaiveUiResolver } from "unplugin-vue-components/resolvers"
ElementPlusResolver,
NaiveUiResolver,
} from "unplugin-vue-components/resolvers"
import IconsResolver from "unplugin-icons/resolver" import IconsResolver from "unplugin-icons/resolver"
import Icons from "unplugin-icons/vite" import Icons from "unplugin-icons/vite"
import Markdown from "vite-plugin-vue-markdown" import Markdown from "vite-plugin-vue-markdown"
@@ -50,7 +47,6 @@ export default defineConfig({
Components({ Components({
resolvers: [ resolvers: [
NaiveUiResolver(), NaiveUiResolver(),
ElementPlusResolver(),
IconsResolver({ enabledCollections: ["ep"] }), IconsResolver({ enabledCollections: ["ep"] }),
], ],
dts: "./src/components.d.ts", dts: "./src/components.d.ts",