修正前端,运行查看评测点结果

This commit is contained in:
Himit_ZH 2021-06-08 22:47:32 +08:00
parent 63071ab387
commit 44a303fe8e
8 changed files with 209 additions and 199 deletions

View File

@ -8,8 +8,8 @@
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="api" />
<module name="DataBackup" />
<module name="JudgeServer" />
<module name="DataBackup" />
</profile>
</annotationProcessing>
</component>

View File

@ -269,7 +269,6 @@ public class JudgeController {
* @Since 2021/1/2
*/
@GetMapping("/submission")
@RequiresAuthentication
public CommonResult getSubmission(@RequestParam(value = "submitId", required = true) Long submitId, HttpServletRequest request) {
Judge judge = judgeService.getById(submitId);
if (judge == null) {
@ -289,10 +288,10 @@ public class JudgeController {
if (userRolesVo != null) { // 当前是登陆状态
// 需要判断是否为当前登陆用户自己的提交代码
if (!judge.getUid().equals(userRolesVo.getUid())) {
return CommonResult.errorResponse("对不起!该提交并未分享,您无权查看!");
judge.setCode(null);
}
} else { // 不是登陆状态就直接无权限
return CommonResult.errorResponse("对不起!该提交并未分享,您无权查看!");
} else { // 不是登陆状态就直接无权限查看代码
judge.setCode(null);
}
}
@ -423,7 +422,6 @@ public class JudgeController {
* @Since 2020/10/29
*/
@GetMapping("/get-all-case-result")
@RequiresAuthentication
public CommonResult getALLCaseResult(@RequestParam(value = "submitId", required = true) Long submitId) {
Judge judge = judgeService.getById(submitId);

View File

@ -490,3 +490,123 @@ footer h1 {
}
}
</style>
<style>
.markdown-body pre {
display: block;
border-radius: 3px !important;
border: 1px solid #c3ccd0;
padding: 0 16px 0 55px !important;
position: relative !important;
overflow-y: hidden !important;
font-size: 1rem !important;
background: #f8f8f9 !important;
white-space: pre !important;
}
.markdown-body pre code {
line-height: 26px !important;
}
.markdown-body pre ol.pre-numbering {
position: absolute;
top: 0;
left: 0;
line-height: 26px;
margin: 0;
padding: 0;
list-style-type: none;
counter-reset: sectioncounter;
background: #f1f1f1;
color: #777;
font-size: 12px;
}
.markdown-body pre ol.pre-numbering li {
margin-top: 0 !important;
}
.markdown-body pre ol.pre-numbering li:before {
content: counter(sectioncounter) '';
counter-increment: sectioncounter;
display: inline-block;
width: 40px;
text-align: center;
}
.markdown-body pre i.code-copy {
position: absolute;
top: 0;
right: 0;
background-color: #2196f3;
display: none;
padding: 5px;
margin: 5px 5px 0 0;
font-size: 11px;
border-radius: inherit;
color: #fff;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.markdown-body pre:hover i.code-copy {
display: block;
}
.markdown-body pre i.code-copy:hover i.code-copy {
display: block;
}
.markdown-body blockquote {
color: #666;
border-left: 4px solid #8bc34a;
padding: 10px;
margin-left: 0;
font-size: 14px;
background: #f8f8f8;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h2 {
font-size: 1.45em;
line-height: 1.425;
border-bottom: 1px solid #eee;
background: #cce5ff;
padding: 8px 10px;
color: #545857;
border-radius: 3px;
}
.markdown-body h3 {
font-size: 1.3em;
line-height: 1.43;
}
.markdown-body h3:before {
content: '';
border-left: 4px solid #03a9f4;
padding-left: 6px;
}
.markdown-body h4 {
font-size: 1.12em;
}
.markdown-body h4:before {
content: '';
border-left: 4px solid #bbb;
padding-left: 6px;
}
.markdown-body img {
border: 0;
background: #ffffff;
padding: 15px;
margin: 5px 0;
box-shadow: inset 0 0 12px rgb(219 219 219);
}
</style>

View File

@ -124,125 +124,7 @@ export default {
};
</script>
<style>
.markdown-body pre {
display: block;
border-radius: 3px !important;
border: 1px solid #c3ccd0;
padding: 0 16px 0 55px !important;
position: relative !important;
overflow-y: hidden !important;
font-size: 1rem !important;
background: #f8f8f9 !important;
white-space: pre !important;
}
.auto-textarea-wrapper .auto-textarea-block {
white-space: pre-wrap !important;
}
.markdown-body pre code {
line-height: 26px !important;
}
.markdown-body pre ol.pre-numbering {
position: absolute;
top: 0;
left: 0;
line-height: 26px;
margin: 0;
padding: 0;
list-style-type: none;
counter-reset: sectioncounter;
background: #f1f1f1;
color: #777;
font-size: 12px;
}
.markdown-body pre ol.pre-numbering li {
margin-top: 0 !important;
}
.markdown-body pre ol.pre-numbering li:before {
content: counter(sectioncounter) '';
counter-increment: sectioncounter;
display: inline-block;
width: 40px;
text-align: center;
}
.markdown-body pre i.code-copy {
position: absolute;
top: 0;
right: 0;
background-color: #2196f3;
display: none;
padding: 5px;
margin: 5px 5px 0 0;
font-size: 11px;
border-radius: inherit;
color: #fff;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.markdown-body pre:hover i.code-copy {
display: block;
}
.markdown-body pre i.code-copy:hover i.code-copy {
display: block;
}
.markdown-body blockquote {
color: #666;
border-left: 4px solid #8bc34a;
padding: 10px;
margin-left: 0;
font-size: 14px;
background: #f8f8f8;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h2 {
font-size: 1.45em;
line-height: 1.425;
border-bottom: 1px solid #eee;
background: #cce5ff;
padding: 8px 10px;
color: #545857;
border-radius: 3px;
}
.markdown-body h3 {
font-size: 1.3em;
line-height: 1.43;
}
.markdown-body h3:before {
content: '';
border-left: 4px solid #03a9f4;
padding-left: 6px;
}
.markdown-body h4 {
font-size: 1.12em;
}
.markdown-body h4:before {
content: '';
border-left: 4px solid #bbb;
padding-left: 6px;
}
.markdown-body img {
border: 0;
background: #ffffff;
padding: 15px;
margin: 5px 0;
box-shadow: inset 0 0 12px rgb(219 219 219);
}
</style>

View File

@ -1,28 +1,27 @@
const Home= ()=>import('@/views/oj/Home.vue')
const SetNewPassword= ()=>import("@/views/oj/user/SetNewPassword.vue")
const UserHome= ()=>import("@/views/oj/user/UserHome.vue")
const Setting= ()=>import("@/views/oj/user/Setting.vue")
const ProblemLIst= ()=>import("@/views/oj/problem/ProblemList.vue")
const Logout= ()=>import("@/views/oj/user/Logout.vue")
const SubmissionList= ()=>import("@/views/oj/status/SubmissionList.vue")
const SubmissionDetails= ()=>import("@/views/oj/status/SubmissionDetails.vue")
const ContestList= ()=>import("@/views/oj/contest/ContestList.vue")
const Problem= ()=>import("@/views/oj/problem/Problem.vue")
const ACMRank= ()=>import("@/views/oj/rank/ACMRank.vue")
const OIRank= ()=>import("@/views/oj/rank/OIRank.vue")
const ContestDetails= ()=>import("@/views/oj/contest/ContestDetails.vue")
const ContestProblemList= ()=>import("@/views/oj/contest/children/ContestProblemList.vue")
const ContestRank= ()=>import("@/views/oj/contest/children/ContestRank.vue")
const ACMInfoAdmin= ()=>import("@/views/oj/contest/children/ACMInfoAdmin.vue")
const Announcements= ()=>import("@/components/oj/common/Announcements.vue")
const ContestComment= ()=>import("@/views/oj/contest/children/ContestComment.vue")
const ContestRejudgeAdmin= ()=>import("@/views/oj/contest/children/ContestRejudgeAdmin.vue")
const DiscussionList= ()=>import("@/views/oj/discussion/discussionList.vue")
const Discussion= ()=>import("@/views/oj/discussion/discussion.vue")
const Introduction= ()=>import("@/views/oj/about/Introduction.vue")
const Developer= ()=>import("@/views/oj/about/Developer.vue")
const NotFound= ()=>import("@/views/404.vue")
import Home from '@/views/oj/Home.vue'
import SetNewPassword from "@/views/oj/user/SetNewPassword.vue"
import UserHome from "@/views/oj/user/UserHome.vue"
import Setting from "@/views/oj/user/Setting.vue"
import ProblemLIst from "@/views/oj/problem/ProblemList.vue"
import Logout from "@/views/oj/user/Logout.vue"
import SubmissionList from "@/views/oj/status/SubmissionList.vue"
import SubmissionDetails from "@/views/oj/status/SubmissionDetails.vue"
import ContestList from "@/views/oj/contest/ContestList.vue"
import Problem from "@/views/oj/problem/Problem.vue"
import ACMRank from "@/views/oj/rank/ACMRank.vue"
import OIRank from "@/views/oj/rank/OIRank.vue"
import ContestDetails from "@/views/oj/contest/ContestDetails.vue"
import ContestProblemList from "@/views/oj/contest/children/ContestProblemList.vue"
import ContestRank from "@/views/oj/contest/children/ContestRank.vue"
import ACMInfoAdmin from "@/views/oj/contest/children/ACMInfoAdmin.vue"
import Announcements from "@/components/oj/common/Announcements.vue"
import ContestComment from "@/views/oj/contest/children/ContestComment.vue"
import ContestRejudgeAdmin from "@/views/oj/contest/children/ContestRejudgeAdmin.vue"
import DiscussionList from "@/views/oj/discussion/discussionList.vue"
import Discussion from "@/views/oj/discussion/discussion.vue"
import Introduction from "@/views/oj/about/Introduction.vue"
import Developer from "@/views/oj/about/Developer.vue"
import NotFound from "@/views/404.vue"
const ojRoutes = [
{

View File

@ -2,6 +2,7 @@
<comment :cid="$route.params.contestID"></comment>
</template>
<script>
import comment from '@/components/oj/comment/comment.vue';
export default {
name: 'ContestComment',
components: {

View File

@ -70,7 +70,11 @@
}}</a>
</template>
</vxe-table-column>
<vxe-table-column field="status" :title="$t('m.Staus')" min-width="170">
<vxe-table-column
field="status"
:title="$t('m.Status')"
min-width="170"
>
<template v-slot="{ row }">
<span :class="getStatusColor(row.status)">{{
JUDGE_STATUS[row.status].name
@ -162,6 +166,13 @@
</el-row>
</el-card>
</el-col>
<template
v-if="
(submission.code && submission.share && codeShare) ||
isMeSubmisson ||
isAdminRole
"
>
<el-col :span="24" style="margin-top: 13px;">
<Highlight
:code="submission.code"
@ -179,9 +190,9 @@
v-if="submission.code"
>{{ $t('m.Copy') }}</el-button
>
<template v-if="codeShare">
<template v-if="codeShare && isMeSubmisson">
<el-button
v-if="submission.share && isAuthenticated && isMeSubmisson"
v-if="submission.share"
type="warning"
size="large"
icon="el-icon-circle-close"
@ -190,7 +201,7 @@
{{ $t('m.Unshared') }}
</el-button>
<el-button
v-else-if="isAuthenticated && !submission.share && isMeSubmisson"
v-else-if="!submission.share"
type="primary"
size="large"
icon="el-icon-share"
@ -201,6 +212,7 @@
</template>
</div>
</el-col>
</template>
</el-row>
</template>
@ -210,8 +222,7 @@ import { JUDGE_STATUS, JUDGE_STATUS_RESERVE } from '@/common/constants';
import utils from '@/common/utils';
import myMessage from '@/common/message';
import { addCodeBtn } from '@/common/codeblock';
const Highlight = () => import('@/components/oj/common/Highlight');
import Highlight from '@/components/oj/common/Highlight';
export default {
name: 'submissionDetails',
@ -254,10 +265,10 @@ export default {
doCopy() {
this.$copyText(this.submission.code).then(
function(e) {
myMessage.success('Code copied successfully');
myMessage.success(this.$i18n.t('m.Copied_successfully'));
},
function(e) {
myMessage.success('Code copy failed');
myMessage.success(this.$i18n.t('m.复制失败'));
}
);
},
@ -369,6 +380,15 @@ export default {
);
},
},
watch: {
submission(newVal, oldVal) {
if (newVal.code) {
this.$nextTick((_) => {
addCodeBtn();
});
}
},
},
computed: {
status() {
return {

View File

@ -213,16 +213,11 @@
min-width="130"
>
<template v-slot="{ row }">
<span
v-if="!row.share && row.uid != userInfo.uid && !isAdminRole"
>{{ row.language }}</span
>
<el-tooltip
class="item"
effect="dark"
:content="$t('m.View_submission_details')"
placement="top"
v-else
>
<el-button type="text" @click="showSubmitDetail(row)">{{
row.language
@ -639,11 +634,6 @@ export default {
...mapActions(['changeModalStatus']),
showSubmitDetail(row) {
if (!this.isAuthenticated) {
this.changeModalStatus({ mode: 'Login', visible: true });
myMessage.warning(this.$i18n.t('m.Please_login_first'));
return;
}
if (row.cid != 0) {
//
this.$router.push({