Commit 1f4108f5670e692fad069dd684433bd0eb570d60

Authored by fengtao
1 parent ba8c52e1

fix:DEFECT-885 之前发的通知头像为图一,然后我现在修改头像,就变为图二了

@@ -18,10 +18,7 @@ @@ -18,10 +18,7 @@
18 <ListItem @click="go('/notice/myNotices')" class="cursor-pointer"> 18 <ListItem @click="go('/notice/myNotices')" class="cursor-pointer">
19 <ListItemMeta> 19 <ListItemMeta>
20 <template #avatar> 20 <template #avatar>
21 - <Avatar  
22 - :src="item.sysNotice.avatar ?? defaultAvatar(item.receiverId)"  
23 - size="large"  
24 - /> 21 + <Avatar :src="item.sysNotice.avatar" size="large" />
25 </template> 22 </template>
26 <template #description> 23 <template #description>
27 <span class="cursor-pointer noticeTitle">{{ item.sysNotice.title }} </span> 24 <span class="cursor-pointer noticeTitle">{{ item.sysNotice.title }} </span>
@@ -92,7 +89,7 @@ @@ -92,7 +89,7 @@
92 ? '#e6e6e5' 89 ? '#e6e6e5'
93 : index === 2 90 : index === 2
94 ? '#f8c296' 91 ? '#f8c296'
95 - : '#0b55f1;', 92 + : '#0b55f1',
96 }" 93 }"
97 >{{ index + 1 }}</span 94 >{{ index + 1 }}</span
98 > 95 >
@@ -169,7 +166,6 @@ @@ -169,7 +166,6 @@
169 import { BasicTable, useTable } from '/@/components/Table'; 166 import { BasicTable, useTable } from '/@/components/Table';
170 import { isAdmin } from '/@/enums/roleEnum'; 167 import { isAdmin } from '/@/enums/roleEnum';
171 import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard'; 168 import { getTenantExpireTimeList, getTenantTop10 } from '/@/api/dashboard';
172 - import headerImg from '/@/assets/images/logo.png';  
173 169
174 export default defineComponent({ 170 export default defineComponent({
175 components: { 171 components: {
@@ -257,11 +253,6 @@ @@ -257,11 +253,6 @@
257 }); 253 });
258 254
259 const userStore = useUserStore(); 255 const userStore = useUserStore();
260 - const defaultAvatar = (uid) => {  
261 - if (uid === userStore.getUserInfo?.userId) {  
262 - return userStore.getUserInfo?.avatar || headerImg;  
263 - }  
264 - };  
265 const getContacts = computed(() => { 256 const getContacts = computed(() => {
266 return userStore.enterPriseInfo?.contacts; 257 return userStore.enterPriseInfo?.contacts;
267 }); 258 });
@@ -285,6 +276,7 @@ @@ -285,6 +276,7 @@
285 const notice = await notifyMyGetrPageApi({ page: 1, pageSize: 5 }); 276 const notice = await notifyMyGetrPageApi({ page: 1, pageSize: 5 });
286 const res = await getEnterPriseDetail(); 277 const res = await getEnterPriseDetail();
287 dataSource.value = notice.items; 278 dataSource.value = notice.items;
  279 + console.log(dataSource.value);
288 userStore.setEnterPriseInfo(res); 280 userStore.setEnterPriseInfo(res);
289 }); 281 });
290 282
@@ -302,7 +294,6 @@ @@ -302,7 +294,6 @@
302 registerTable, 294 registerTable,
303 isAdmin, 295 isAdmin,
304 Empty, 296 Empty,
305 - defaultAvatar,  
306 }; 297 };
307 }, 298 },
308 }); 299 });
@@ -29,10 +29,12 @@ @@ -29,10 +29,12 @@
29 } from '/@/api/stationnotification/stationnotifyApi'; 29 } from '/@/api/stationnotification/stationnotifyApi';
30 import { useMessage } from '/@/hooks/web/useMessage'; 30 import { useMessage } from '/@/hooks/web/useMessage';
31 import { Authority } from '/@/components/Authority'; 31 import { Authority } from '/@/components/Authority';
  32 + import { useUserStore } from '/@/store/modules/user';
  33 + import headerImg from '/@/assets/images/logo.png';
32 34
33 export default defineComponent({ 35 export default defineComponent({
34 name: 'ConfigDrawer', 36 name: 'ConfigDrawer',
35 - components: { BasicDrawer, BasicForm,Authority }, 37 + components: { BasicDrawer, BasicForm, Authority },
36 emits: ['success', 'register'], 38 emits: ['success', 'register'],
37 setup(_, { emit }) { 39 setup(_, { emit }) {
38 const draftDisable = ref(false); 40 const draftDisable = ref(false);
@@ -62,6 +64,9 @@ @@ -62,6 +64,9 @@
62 setFieldsValue(data.record); 64 setFieldsValue(data.record);
63 } 65 }
64 }); 66 });
  67 + const userStore = useUserStore();
  68 + const avatar = ref<string | undefined>('');
  69 + avatar.value = userStore.getUserInfo?.avatar || headerImg;
65 // 发布通知 70 // 发布通知
66 const handleSend = async () => { 71 const handleSend = async () => {
67 try { 72 try {
@@ -75,6 +80,7 @@ @@ -75,6 +80,7 @@
75 ...field, 80 ...field,
76 pointId, 81 pointId,
77 id: unref(isUpdate) ? unref(noticeId) : undefined, 82 id: unref(isUpdate) ? unref(noticeId) : undefined,
  83 + avatar: avatar.value,
78 }; 84 };
79 await notifyAddLeaseApi(editNotice); 85 await notifyAddLeaseApi(editNotice);
80 emit('success'); 86 emit('success');
@@ -106,6 +112,7 @@ @@ -106,6 +112,7 @@
106 ...field, 112 ...field,
107 pointId, 113 pointId,
108 id: unref(noticeId), 114 id: unref(noticeId),
  115 + avatar: avatar.value,
109 }; 116 };
110 await notifyAddDraftApi(editDraft); 117 await notifyAddDraftApi(editDraft);
111 } 118 }