Skip to content

Commit

Permalink
feat: notification modify bug fixes, and route in member list to refl…
Browse files Browse the repository at this point in the history
…ect impression
  • Loading branch information
7086cmd committed Apr 6, 2024
1 parent b72cf33 commit c7770c6
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 285 deletions.
1 change: 1 addition & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ declare module 'vue' {
ZDisplayPerson: typeof import('./src/components/member/ZDisplayPerson.vue')['default']
ZInputDuration: typeof import('./src/components/form/ZInputDuration.vue')['default']
ZNonXuehaiPad: typeof import('./src/components/utils/ZNonXuehaiPad.vue')['default']
ZNotificationCard: typeof import('./src/components/notifications/ZNotificationCard.vue')['default']
ZNotificationContentDisplayer: typeof import('./src/components/notifications/ZNotificationContentDisplayer.vue')['default']
ZNotificationForm: typeof import('./src/components/notifications/ZNotificationForm.vue')['default']
ZNotificationList: typeof import('./src/components/notifications/ZNotificationList.vue')['default']
Expand Down
2 changes: 0 additions & 2 deletions src/api/notification/delete.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import axios from '@/plugins/axios'
import type { Response } from '@zvms/zvms4-types'
import { ElNotification } from 'element-plus'
import { temporaryToken } from '@/plugins/short-token'

async function deleteNotification(id: string, uid: string) {
Expand Down
32 changes: 25 additions & 7 deletions src/components/activity/ZActivityImpressionManager.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, toRefs } from 'vue'
import { onMounted, ref, toRefs, watch } from 'vue'
import { useUserStore } from '@/stores/user'
import {
ArrowRight,
Expand Down Expand Up @@ -49,6 +49,7 @@ import { useWindowSize } from '@vueuse/core'
const props = defineProps<{
activity: ActivityInstance
role: 'mine' | 'campus' | 'class'
perspective?: string
}>()
const user = useUserStore()
Expand All @@ -60,7 +61,7 @@ const emits = defineEmits<{
(e: 'finish'): void
}>()
const { activity, role } = toRefs(props)
const { activity, role, perspective } = toRefs(props)
const impression = ref('')
const myimages = ref<UploadUserFile[]>([])
Expand All @@ -69,7 +70,6 @@ const preview = ref(false)
const previewUrl = ref('')
const activeNames = ref<string[]>(['1', '2'])
const submitable = ref<boolean>(role.value !== 'class')
const load = ref<'draft' | 'pending' | 'refused' | 'rejected' | 'effective' | false>(false)
async function submit(submit: boolean) {
Expand Down Expand Up @@ -191,12 +191,30 @@ async function curserTo(index: number) {
loading.value = false
}
if (role.value !== 'mine') {
curserTo(1)
} else {
getMemberActivity()
async function curserToId(id: string) {
const index = activity.value.members.findIndex((x) => x._id === id) + 1
if (index === 0) {
curserTo(1)
}
curserTo(index)
}
async function refresh() {
if (role.value !== 'mine') {
if (perspective.value) {
await curserToId(perspective.value)
} else {
await curserTo(1)
}
} else {
await getMemberActivity()
}
}
onMounted(refresh)
watch(perspective, refresh)
watch(role, refresh)
const serif = ref(false)
function handleSuccess(resp: Response<string>) {
Expand Down
Loading

0 comments on commit c7770c6

Please sign in to comment.