Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ZnPdCo committed Dec 25, 2024
1 parent b495c02 commit de27993
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 42 deletions.
27 changes: 22 additions & 5 deletions frontend/src/components/VoteModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function SendVote() {
watch(show, async (value) => {
if (value != true) return
loader.value = true
; (difficulty.value = ''), (qualityValue.value = 0), (comment.value = ''), reloadKey.value++
;(difficulty.value = ''), (qualityValue.value = 0), (comment.value = ''), reloadKey.value++
axios('/backend/get_vote/', {
method: 'POST',
Expand Down Expand Up @@ -68,18 +68,35 @@ function cancleQuality() {
<SuiLoader :active="loader" />
<div class="ui labeled input" style="margin-right: 10px">
<div class="ui label">难度(800-3500)</div>
<input type="number" placeholder="难度" data-tribute="true" v-model="difficulty"
oninput="this.value = this.value.replace(/[^0-9]/g, '');" />
<input
type="number"
placeholder="难度"
data-tribute="true"
v-model="difficulty"
oninput="this.value = this.value.replace(/[^0-9]/g, '');"
/>
</div>
<div class="ui labeled input">
<div class="ui label">质量(0-5)</div>
<Rating :key="reloadKey" size="massive" v-model="qualityValue" :maxRating="6" color="yellow" />
<Rating
:key="reloadKey"
size="massive"
v-model="qualityValue"
:maxRating="6"
color="yellow"
/>
<SuiButton @click="cancleQuality()">取消</SuiButton>
</div>
<br />
<div class="ui labeled input" style="margin-top: 10px">
<div class="ui label">评论</div>
<textarea type="text" placeholder="评论" data-tribute="true" v-model="comment" maxlength="255"></textarea>
<textarea
type="text"
placeholder="评论"
data-tribute="true"
v-model="comment"
maxlength="255"
></textarea>
</div>
</SuiSegment>
</div>
Expand Down
74 changes: 37 additions & 37 deletions frontend/src/views/ProblemsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,40 +173,40 @@ function showTable() {
})
if (selected.value != undefined && !type.includes(selected.value.value)) continue
let row = $('<tr>')
; (function (data) {
row.append($('<td>').text(data['pid']))
row.append($('<td>').text(data['contest']))
row.append(
name2Str(data['pid'], data['name'], function () {
detailsModal.value = true
details.value = data
}).click(function (e) {
if ($(e.target).prop('tagName') == 'TD' && !window.autoStatus) changeStatus(data['pid'])
;(function (data) {
row.append($('<td>').text(data['pid']))
row.append($('<td>').text(data['contest']))
row.append(
name2Str(data['pid'], data['name'], function () {
detailsModal.value = true
details.value = data
}).click(function (e) {
if ($(e.target).prop('tagName') == 'TD' && !window.autoStatus) changeStatus(data['pid'])
}),
)
row.append(difficulty2Str(data['difficulty'], data['cnt1']))
row.append(quality2Str(data['quality'], data['cnt2']))
row.append(
$('<td>')
.html('<a>投票</a>')
.click(function () {
pid.value = data['pid']
if (!loggedIn) {
router.push('/login')
}
voteModal.value = true
}),
)
row.append(difficulty2Str(data['difficulty'], data['cnt1']))
row.append(quality2Str(data['quality'], data['cnt2']))
row.append(
$('<td>')
.html('<a>投票</a>')
.click(function () {
pid.value = data['pid']
if (!loggedIn) {
router.push('/login')
}
voteModal.value = true
}),
)
row.append(
$('<td>')
.html('<a>显示投票</a>')
.click(function () {
pid.value = data['pid']
window.pid = data['pid']
showVotesModal.value = true
}),
)
})(problemsData[i])
)
row.append(
$('<td>')
.html('<a>显示投票</a>')
.click(function () {
pid.value = data['pid']
window.pid = data['pid']
showVotesModal.value = true
}),
)
})(problemsData[i])
table.append(row)
}
}
Expand Down Expand Up @@ -318,10 +318,10 @@ $(document).ready(function () {
problemsData[i]['difficulty2'],
problemsData[i]['difficulty'],
]
;[problemsData[i]['quality'], problemsData[i]['quality2']] = [
problemsData[i]['quality2'],
problemsData[i]['quality'],
]
;[problemsData[i]['quality'], problemsData[i]['quality2']] = [
problemsData[i]['quality2'],
problemsData[i]['quality'],
]
}
showTable()
})
Expand Down

0 comments on commit de27993

Please sign in to comment.