Skip to content

Commit

Permalink
feat: card stamp in poll records
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 1, 2023
1 parent 7011c84 commit f70faf0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
15 changes: 14 additions & 1 deletion components/review/records/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ const emit = defineEmits<{

<template>
<a-card class="review-record-card">
<ReviewRecordsCardStamp
v-if="props.userPollLog.sentence.poll_status != PollStatus.Open"
:poll-status="props.userPollLog.sentence.poll_status"
/>
<template #title> #{{ props.userPollLog.poll_id }} </template>
<ReviewRecordsCardSentence :sentence="sentence" />

<a-divider />

<div class="polled-info-container">
Expand All @@ -53,7 +58,7 @@ const emit = defineEmits<{
投票评论:{{ userPollLog.comment }}
</p>
</div>
<div class="actions-container flex justify-end mt-5">
<div class="actions-container">
<a-button
v-show="
userStore.user?.role === UserRole.Admin ||
Expand All @@ -69,9 +74,17 @@ const emit = defineEmits<{
</template>
<style lang="scss" scoped>
.review-record-card {
@apply relative overflow-hidden;
}
.polled-info-container {
p {
@apply mb-1 mt-0;
}
}
.actions-container {
@apply flex mt-5 justify-end;
}
</style>
39 changes: 39 additions & 0 deletions components/review/records/CardStamp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script setup lang="ts">
import { PollStatus } from '@/enums/poll'
const props = defineProps<{
pollStatus: PollStatus
}>()
</script>
<template>
<div class="stamp">
<div
class="icon"
:class="{
approve: props.pollStatus === PollStatus.Approved,
reject: props.pollStatus === PollStatus.Rejected,
'need-modify': props.pollStatus === PollStatus.NeedModify
}"
></div>
</div>
</template>
<style lang="scss" scoped>
.stamp {
@apply flex items-center justify-center absolute -right-10 -top-15;
.icon {
@apply h-38 w-38 z-1 opacity-25;
}
}
.approve {
@apply i-solar-check-circle-bold bg-green-500;
}
.reject {
@apply i-solar-close-circle-bold bg-red-500;
}
.need-modify {
@apply i-solar-text-circle-bold bg-yellow-500;
}
</style>

0 comments on commit f70faf0

Please sign in to comment.