generated from VLADIMIR/template_frontend
add diffectly
This commit is contained in:
@@ -56,6 +56,7 @@ const code = ref('')
|
||||
const reviewKey = `game-review-${teamId}`
|
||||
const reviewSubmitted = ref(localStorage.getItem(reviewKey) === '1')
|
||||
const reviewRating = ref(0)
|
||||
const reviewDifficulty = ref(0)
|
||||
const reviewText = ref('')
|
||||
const reviewLoading = ref(false)
|
||||
|
||||
@@ -225,8 +226,8 @@ const paperControlsOverrides = {
|
||||
}
|
||||
|
||||
async function submitReview() {
|
||||
if (!reviewRating.value || reviewText.value.trim() === '') {
|
||||
message.error('Поставьте оценку и напишите отзыв')
|
||||
if (!reviewRating.value || !reviewDifficulty.value || reviewText.value.trim() === '') {
|
||||
message.error('Поставьте оценки и напишите отзыв')
|
||||
return
|
||||
}
|
||||
reviewLoading.value = true
|
||||
@@ -235,6 +236,7 @@ async function submitReview() {
|
||||
teamID: Number(teamId),
|
||||
password: password as string,
|
||||
rating: reviewRating.value,
|
||||
difficulty: reviewDifficulty.value,
|
||||
text: reviewText.value.trim(),
|
||||
})
|
||||
reviewLoading.value = false
|
||||
@@ -278,6 +280,8 @@ useSimplePolling(() => {
|
||||
<n-config-provider :theme-overrides="paperControlsOverrides">
|
||||
<div class="review-rating font">Оценка</div>
|
||||
<n-rate v-model:value="reviewRating" :count="5" class="review-rate" />
|
||||
<div class="review-rating font">Сложность</div>
|
||||
<n-rate v-model:value="reviewDifficulty" :count="3" class="review-rate" />
|
||||
<n-input
|
||||
v-model:value="reviewText"
|
||||
class="review-input"
|
||||
|
||||
Reference in New Issue
Block a user