|
@@ -37,7 +37,7 @@ import mailWrite from "./mailWrite.vue";
|
|
|
|
|
|
import useMailStore from "@/store/modules/mail";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
-import { nextTick } from "vue";
|
|
|
+import { nextTick, watch } from "vue";
|
|
|
|
|
|
const mailStore = useMailStore();
|
|
|
const { proxy } = getCurrentInstance();
|
|
@@ -47,17 +47,6 @@ let activeMenu = ref("");
|
|
|
mailStore.$subscribe((mutations, state) => {
|
|
|
activeMenu.value = state.currentId;
|
|
|
menuList.value = state.mailMenuList;
|
|
|
- // 判断是文件夹还是邮件详情
|
|
|
- const currentMenu = state.currentMenu;
|
|
|
- let type = "";
|
|
|
- if (currentMenu.id.includes("floder")) {
|
|
|
- type = "floder";
|
|
|
- } else if (currentMenu.id.includes("detail")) {
|
|
|
- type = "detail";
|
|
|
- } else {
|
|
|
- type = "write";
|
|
|
- }
|
|
|
- checkType(currentMenu, type);
|
|
|
});
|
|
|
|
|
|
const handleTabRemove = (id) => {
|
|
@@ -89,23 +78,27 @@ const checkType = (menu, type) => {
|
|
|
const index = menuList.value.findIndex((x) => x.id === activeMenu.value);
|
|
|
const dom = type + index.toString();
|
|
|
nextTick(() => {
|
|
|
- console.log(dom, "wss");
|
|
|
proxy.$refs[dom][0].initFn();
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-// const handleTabChange = () => {
|
|
|
-// // 判断是文件夹还是邮件详情
|
|
|
-// let type = "";
|
|
|
-// if (activeMenu.value.id.includes("floder")) {
|
|
|
-// type = "floder";
|
|
|
-// } else if (activeMenu.value.id.includes("detail")) {
|
|
|
-// type = "detail";
|
|
|
-// } else {
|
|
|
-// type = "write";
|
|
|
-// }
|
|
|
-// checkType(currentMenu, type);
|
|
|
-// };
|
|
|
+const handleTabChange = (val) => {
|
|
|
+ const currentMenu = menuList.value.find((x) => x.id === val);
|
|
|
+ mailStore.$patch({
|
|
|
+ currentId: val,
|
|
|
+ currentMenu: currentMenu,
|
|
|
+ });
|
|
|
+ // 判断是文件夹还是邮件详情
|
|
|
+ let type = "";
|
|
|
+ if (currentMenu.id.includes("floder")) {
|
|
|
+ type = "floder";
|
|
|
+ } else if (currentMenu.id.includes("detail")) {
|
|
|
+ type = "detail";
|
|
|
+ } else {
|
|
|
+ type = "write";
|
|
|
+ }
|
|
|
+ checkType(currentMenu, type);
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {});
|
|
|
</script>
|