Commit 1f4108f5670e692fad069dd684433bd0eb570d60

Authored by fengtao
1 parent ba8c52e1

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

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