From aefcd3d4e378651f362f08dc56b83b867ec90e72 Mon Sep 17 00:00:00 2001 From: LiuJiaNan Date: Mon, 5 Feb 2024 14:12:24 +0800 Subject: [PATCH] init --- .../header/components/update_avatar.vue | 11 +++-------- src/layout/header/components/update_info.vue | 3 ++- src/layout/header/index.vue | 2 ++ src/layout/menu/index.vue | 6 ++++-- .../dialog/confinedspace_dialog.vue | 8 ++++---- .../BI/components/dialog/highwork_dialog.vue | 7 ++++--- .../BI/components/dialog/hotwork_dialog.vue | 7 ++++--- src/views/BI/components/rightico.vue | 19 ++++--------------- src/views/BI/components/video_ai_analysis.vue | 15 +-------------- .../supplementary_recording.vue | 1 - .../inspection_record/index.vue | 2 +- .../components/qualified.vue | 5 ++++- src/views/keyprojects/hidden/record_view.vue | 1 - .../hidden_list.vue | 1 - 14 files changed, 33 insertions(+), 55 deletions(-) diff --git a/src/layout/header/components/update_avatar.vue b/src/layout/header/components/update_avatar.vue index 80492c0..6e74c1f 100644 --- a/src/layout/header/components/update_avatar.vue +++ b/src/layout/header/components/update_avatar.vue @@ -29,9 +29,7 @@ import { setAvatar } from "@/request/api.js"; import { ElMessage } from "element-plus"; import { ref } from "vue"; import { useVModels } from "@vueuse/core"; -import { useUserStore } from "@/pinia/user.js"; -const userStore = useUserStore(); const props = defineProps({ visible: { type: Boolean, @@ -44,7 +42,7 @@ const props = defineProps({ default: () => ({}), }, }); -const emits = defineEmits(["update:visible", "update:form"]); +const emits = defineEmits(["update:visible", "update:form", "get-data"]); const { visible, form } = useVModels(props, emits); const formRef = ref(null); const rules = { @@ -60,13 +58,10 @@ const fnSubmit = debounce( } const formData = new FormData(); formData.append("FFILE", form.value.file[0].raw); - const resData = await setAvatar(formData); + await setAvatar(formData); fnClose(); ElMessage.success("修改成功"); - userStore.setUserInfo({ - ...userStore.getUserInfo, - userPhoto: resData.userPhoto, - }); + emits("get-data"); }, { atBegin: true } ); diff --git a/src/layout/header/components/update_info.vue b/src/layout/header/components/update_info.vue index 885a7c3..47538f1 100644 --- a/src/layout/header/components/update_info.vue +++ b/src/layout/header/components/update_info.vue @@ -67,7 +67,7 @@ const props = defineProps({ default: () => ({}), }, }); -const emits = defineEmits(["update:visible", "update:form"]); +const emits = defineEmits(["update:visible", "update:form", "get-data"]); const { visible, form } = useVModels(props, emits); const formRef = ref(null); const validatePass = (rule, value, callback) => { @@ -118,6 +118,7 @@ const fnSubmit = debounce( }); fnClose(); ElMessage.success("修改成功"); + emits("get-data"); }, { atBegin: true } ); diff --git a/src/layout/header/index.vue b/src/layout/header/index.vue index 2723b5d..7b87f08 100644 --- a/src/layout/header/index.vue +++ b/src/layout/header/index.vue @@ -52,10 +52,12 @@ diff --git a/src/layout/menu/index.vue b/src/layout/menu/index.vue index 411dc99..3c859dd 100644 --- a/src/layout/menu/index.vue +++ b/src/layout/menu/index.vue @@ -7,7 +7,8 @@ :route="{ path: menu.path }" >