mirror of
https://github.com/QingdaoU/OnlineJudgeFE.git
synced 2024-12-28 23:41:47 +00:00
disable submit button after submitting
This commit is contained in:
parent
ec14ba848b
commit
b5bf87594c
@ -91,10 +91,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Button type="warning" icon="edit" :loading="submitting" @click="submitCode"
|
<Button type="warning" icon="edit" :loading="submitting" @click="submitCode"
|
||||||
:disabled="problemSubmitDisabled"
|
:disabled="problemSubmitDisabled || submitted"
|
||||||
class="fl-right">
|
class="fl-right">
|
||||||
<span v-if="!submitting">Submit</span>
|
<span v-if="submitting">Submitting</span>
|
||||||
<span v-else>Submitting</span>
|
<span v-else-if="submitted">Submitted</span>
|
||||||
|
<span v-else>Submit</span>
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
@ -228,6 +229,7 @@
|
|||||||
language: 'C++',
|
language: 'C++',
|
||||||
theme: 'solarized',
|
theme: 'solarized',
|
||||||
submissionId: '',
|
submissionId: '',
|
||||||
|
submitted: false,
|
||||||
result: {
|
result: {
|
||||||
result: 9
|
result: 9
|
||||||
},
|
},
|
||||||
@ -405,6 +407,7 @@
|
|||||||
const submitFunc = (data, detailsVisible) => {
|
const submitFunc = (data, detailsVisible) => {
|
||||||
this.statusVisible = true
|
this.statusVisible = true
|
||||||
api.submitCode(data).then(res => {
|
api.submitCode(data).then(res => {
|
||||||
|
this.submitted = true
|
||||||
this.submissionId = res.data.data && res.data.data.submission_id
|
this.submissionId = res.data.data && res.data.data.submission_id
|
||||||
// 定时检查状态
|
// 定时检查状态
|
||||||
this.submitting = false
|
this.submitting = false
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<Row type="flex" justify="space-around">
|
<Row type="flex" justify="space-around">
|
||||||
<Col :span="20" id="status">
|
<Col :span="20" id="status">
|
||||||
<Alert :type="status.type" showIcon>
|
<Alert :type="status.type" showIcon>
|
||||||
<span class="title">{{status.statusName}}</span>
|
<span class="title">{{status.statusName}}</span>
|
||||||
<div slot="desc" class="content">
|
<div slot="desc" class="content">
|
||||||
<template v-if="isCE">
|
<template v-if="isCE">
|
||||||
<pre>{{submission.statistic_info.err_info}}</pre>
|
<pre>{{submission.statistic_info.err_info}}</pre>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<span>Time: {{submission.statistic_info.time_cost | submissionTime}}</span>
|
<span>Time: {{submission.statistic_info.time_cost | submissionTime}}</span>
|
||||||
<span>Memory: {{submission.statistic_info.memory_cost | submissionMemory}}</span>
|
<span>Memory: {{submission.statistic_info.memory_cost | submissionMemory}}</span>
|
||||||
<span>Lang: {{submission.language}}</span>
|
<span>Lang: {{submission.language}}</span>
|
||||||
<span>Author: {{submission.username}}</span>
|
<span>Author: {{submission.username}}</span>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</Alert>
|
</Alert>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<!--后台返info就显示出来, 权限控制放后台 -->
|
<!--后台返info就显示出来, 权限控制放后台 -->
|
||||||
<Col v-if="submission.info && !isCE" :span="20">
|
<Col v-if="submission.info && !isCE" :span="20">
|
||||||
<Table stripe :loading="loading" :disabled-hover="true" :columns="columns" :data="submission.info.data"></Table>
|
<Table stripe :loading="loading" :disabled-hover="true" :columns="columns" :data="submission.info.data"></Table>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col :span="20">
|
<Col :span="20">
|
||||||
<Highlight :code="submission.code" :language="submission.language" :border-color="status.color"></Highlight>
|
<Highlight :code="submission.code" :language="submission.language" :border-color="status.color"></Highlight>
|
||||||
</Col>
|
</Col>
|
||||||
<Col v-if="submission.can_unshare" :span="20">
|
<Col v-if="submission.can_unshare" :span="20">
|
||||||
<div id="share-btn">
|
<div id="share-btn">
|
||||||
<Button v-if="submission.shared"
|
<Button v-if="submission.shared"
|
||||||
type="warning" size="large" @click="shareSubmission(false)">
|
type="warning" size="large" @click="shareSubmission(false)">
|
||||||
UnShare
|
UnShare
|
||||||
</Button>
|
</Button>
|
||||||
<Button v-else
|
<Button v-else
|
||||||
type="primary" size="large" @click="shareSubmission(true)">
|
type="primary" size="large" @click="shareSubmission(true)">
|
||||||
Share
|
Share
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import api from '@oj/api'
|
import api from '@oj/api'
|
||||||
import { JUDGE_STATUS } from '@/utils/constants'
|
import {JUDGE_STATUS} from '@/utils/constants'
|
||||||
import utils from '@/utils/utils'
|
import utils from '@/utils/utils'
|
||||||
import Highlight from '@/pages/oj/components/Highlight'
|
import Highlight from '@/pages/oj/components/Highlight'
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ function utcToLocal (utcDt, format = 'YYYY-M-D HH:mm:ss') {
|
|||||||
return moment.utc(utcDt).local().format(format)
|
return moment.utc(utcDt).local().format(format)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get duration from startTime to endTime, return like 3 days, 2 hours, one yead ..
|
// get duration from startTime to endTime, return like 3 days, 2 hours, one year ..
|
||||||
function duration (startTime, endTime) {
|
function duration (startTime, endTime) {
|
||||||
let start = moment(startTime)
|
let start = moment(startTime)
|
||||||
let end = moment(endTime)
|
let end = moment(endTime)
|
||||||
|
Loading…
Reference in New Issue
Block a user