<template>
|
<div class="left-box">
|
<!-- 分发 -->
|
<a-tooltip placement="bottom">
|
<template #title>
|
<span>分发</span>
|
</template>
|
<ExportOutlined class="icon" />
|
</a-tooltip>
|
<!-- 待处理 -->
|
<TooltipAndDropdown
|
class="icon"
|
v-show="checked"
|
:tooltipTitle="'待处理邮件'"
|
:initialDropdownOpen="false"
|
:initialTooltipOpen="false"
|
:showTooltip="false"
|
:docCodeS="getSelectAllBocCode"
|
/>
|
<!-- 删除 -->
|
<a-tooltip placement="bottom">
|
<template #title>
|
<span>删除</span>
|
</template>
|
<DeleteOutlined v-show="checked" class="icon" @click="fuDeleteEmail" />
|
</a-tooltip>
|
|
<!-- 收藏 -->
|
<a-tooltip placement="bottom">
|
<template #title>
|
<span>标志</span>
|
</template>
|
<TagOutlined class="icon" v-show="checked" />
|
</a-tooltip>
|
|
<!-- 文件夹 -->
|
<a-tooltip placement="bottom">
|
<template #title>
|
<span>文件夹</span>
|
</template>
|
<FolderOutlined class="icon" v-show="checked" />
|
</a-tooltip>
|
<!-- 更多 -->
|
<a-tooltip placement="bottom">
|
<template #title>
|
<span>更多</span>
|
</template>
|
<a-dropdown :arrow="{ pointAtCenter: true }" placement="bottom" :trigger="['click']">
|
<template #overlay>
|
<a-menu>
|
<a-menu-item key="2" @click="fnSelectAllRead(true)"> 标为已读</a-menu-item>
|
<a-menu-item key="3" @click="fnSelectAllRead(false)"> 标为未读</a-menu-item>
|
<a-menu-item key="4"> 设为置顶</a-menu-item>
|
<a-divider style="margin: 2px; padding: 2px" />
|
<a-menu-item key="5"> 标记为垃圾邮件</a-menu-item>
|
</a-menu>
|
</template>
|
<MoreOutlined v-show="checked" class="icon" />
|
</a-dropdown>
|
<a-dropdown :arrow="{ pointAtCenter: true }" placement="bottom" :trigger="['click']">
|
<template #overlay>
|
<a-menu>
|
<a-menu-item key="1" @click="fnAllRead">全部标记为已读</a-menu-item>
|
<a-divider style="margin: 2px; padding: 2px" />
|
<p style="color: #999; font-size: 12px">勾选邮件即可查看更多操作</p>
|
</a-menu>
|
</template>
|
<MoreOutlined v-show="!checked" class="icon" />
|
</a-dropdown>
|
</a-tooltip>
|
</div>
|
</template>
|
|
<script lang="ts" setup>
|
import TooltipAndDropdown from './TooltipAndDropdown .vue';
|
import {
|
ExportOutlined,
|
ClockCircleOutlined,
|
DeleteOutlined,
|
TagOutlined,
|
FolderOutlined,
|
MoreOutlined,
|
} from '@ant-design/icons-vue';
|
import { ref, defineProps, defineEmits, computed, reactive, inject } from 'vue';
|
interface Props {
|
checked: boolean;
|
handleId?: number;
|
selectAllRow?: Array<any>;
|
parentTableList?: Array<any>;
|
}
|
|
const props = defineProps<Props>();
|
|
const checked = computed(() => props.checked);
|
import { updateReadApi, deleteEmailAPi } from '@/api/email/userList';
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
const { createMessage } = useMessage();
|
const getDataList = inject('getDataList');
|
function fnSelectAllRead(is) {
|
const data = {
|
status: is,
|
list: getReadId(),
|
};
|
pushUpdateReadApi(data);
|
}
|
const getSelectAllBocCode = computed(() => {
|
let data = props.selectAllRow.map((item) => item.docCode);
|
console.log(data, '00003');
|
|
return data;
|
});
|
function pushUpdateReadApi(data) {
|
updateReadApi(data).then((res) => {
|
if (res.code == 0) {
|
//
|
getDataList({});
|
}
|
});
|
}
|
function fnAllRead() {
|
fnGetTableList();
|
}
|
|
function fnGetTableList() {
|
const data = {
|
status: true,
|
list: getReadId(),
|
};
|
pushUpdateReadApi(data);
|
}
|
function getReadId() {
|
const ids = [];
|
props.parentTableList.forEach((item: Record<string, any>) => {
|
ids.push(item.docCode);
|
});
|
return ids;
|
}
|
const emit = defineEmits(['nextNum']);
|
function fuDeleteEmail() {
|
deleteEmailAPi(getSelectAllBocCode.value).then((res) => {
|
if (res.code == 0) {
|
createMessage.success(res.msg);
|
// 区分操作
|
getDataList({});
|
if (!props.parentTableList) {
|
emit('nextNum');
|
}
|
}
|
});
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.left-box {
|
display: flex;
|
align-items: center;
|
justify-content: space-flex-start;
|
width: 100%;
|
|
& .icon {
|
margin-right: 15px;
|
font-size: 16px;
|
}
|
}
|
</style>
|