新增邮件发送和管理员功能
This commit is contained in:
82
mail-vue/src/views/send/index.vue
Normal file
82
mail-vue/src/views/send/index.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<emailScroll ref="sendScroll"
|
||||
:cancel-success="cancelStar"
|
||||
:star-success="addStar"
|
||||
:getEmailList="getEmailList"
|
||||
:emailDelete="emailDelete"
|
||||
:star-add="starAdd"
|
||||
show-status
|
||||
actionLeft="4px"
|
||||
:star-cancel="starCancel"
|
||||
@jump="jumpContent"
|
||||
:time-sort="params.timeSort"
|
||||
>
|
||||
<template #first>
|
||||
<Icon class="icon" @click="changeTimeSort" icon="material-symbols-light:timer-arrow-down-outline"
|
||||
v-if="params.timeSort === 0" width="28" height="28"/>
|
||||
<Icon class="icon" @click="changeTimeSort" icon="material-symbols-light:timer-arrow-up-outline" v-else
|
||||
width="28" height="28"/>
|
||||
</template>
|
||||
</emailScroll>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {useAccountStore} from "@/store/account.js";
|
||||
import {useEmailStore} from "@/store/email.js";
|
||||
import emailScroll from "@/components/email-scroll/index.vue"
|
||||
import {emailList, emailDelete} from "@/request/email.js";
|
||||
import {starAdd, starCancel} from "@/request/star.js";
|
||||
import {defineOptions, onMounted, reactive, ref, watch} from "vue";
|
||||
import router from "@/router/index.js";
|
||||
import {Icon} from "@iconify/vue";
|
||||
|
||||
defineOptions({
|
||||
name: 'send'
|
||||
})
|
||||
|
||||
const emailStore = useEmailStore();
|
||||
const accountStore = useAccountStore();
|
||||
const sendScroll = ref({})
|
||||
const params = reactive({
|
||||
timeSort: 0,
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
emailStore.sendScroll = sendScroll;
|
||||
})
|
||||
|
||||
watch(() => accountStore.currentAccountId, () => {
|
||||
sendScroll.value.refreshList();
|
||||
})
|
||||
|
||||
function changeTimeSort() {
|
||||
params.timeSort = params.timeSort ? 0 : 1
|
||||
sendScroll.value.refreshList();
|
||||
}
|
||||
|
||||
function jumpContent(email) {
|
||||
emailStore.contentData.email = email
|
||||
emailStore.contentData.delType = 'logic'
|
||||
emailStore.contentData.showStar = true
|
||||
router.push('/content')
|
||||
}
|
||||
|
||||
function addStar(email) {
|
||||
emailStore.starScroll?.addItem(email)
|
||||
}
|
||||
|
||||
function cancelStar(email) {
|
||||
emailStore.starScroll?.deleteEmail([email.emailId])
|
||||
}
|
||||
|
||||
function getEmailList(emailId, size) {
|
||||
return emailList(accountStore.currentAccountId, emailId, params.timeSort, size, 1)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user