| src/store/type/user.type.ts | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mobile/bedsideAuxiliaryScreen/components/Header.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/mobile/bedsideAuxiliaryScreen/components/Login/userInfo.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/store/type/user.type.ts
@@ -14,4 +14,5 @@ updateUser: string | null; userCode: string; userName: string; userAvatar: string | null; } src/views/mobile/bedsideAuxiliaryScreen/components/Header.vue
@@ -65,7 +65,7 @@ alt="" @click="openSettingDeviceDialog" /> <img v-if="userInfo?.code" :src="generateCircularAvatar(userInfo.userName)" class="btn-img" alt="" @click="openLoginDialog" /> <img v-if="userInfo?.code" :src="userInfo?.userAvatar" class="btn-img" alt="" @click="openLoginDialog" /> <img v-else :src="userImg" class="btn-img" alt="" @click="openLoginDialog" /> </div> </div> @@ -167,7 +167,10 @@ const userInfo = computed(() => { return bedsideAuxiliaryScreenStore.userInfo; if (!bedsideAuxiliaryScreenStore.userInfo) return null return Object.assign({}, bedsideAuxiliaryScreenStore.userInfo, { userAvatar: bedsideAuxiliaryScreenStore.userInfo?.userAvatar ? bedsideAuxiliaryScreenStore.userInfo?.userAvatar : generateCircularAvatar(bedsideAuxiliaryScreenStore.userInfo?.userName) }); }); watch( @@ -254,6 +257,7 @@ }; function generateCircularAvatar(name: string, size = 100): string { console.log('name: ', name) const canvas = document.createElement('canvas'); canvas.width = size; canvas.height = size; src/views/mobile/bedsideAuxiliaryScreen/components/Login/index.vue
@@ -69,6 +69,16 @@ }; }); const userInfo = computed(() => { const userInfo = bedsideAuxiliaryScreenStore.userInfo; if (!userInfo) return null; return { ...userInfo, 床号: bedsideAuxiliaryScreenStore.deviceData.devicdeNo, 设备编号: bedsideAuxiliaryScreenStore.deviceCode } }); const openDialog = () => { state.show = true; }; @@ -112,6 +122,7 @@ handleCancel, openDialog, onLogout, userInfo, }; }, }; src/views/mobile/bedsideAuxiliaryScreen/components/Login/userInfo.vue
@@ -1,6 +1,6 @@ <template> <div class="userinfo-container"> <!-- <img :src="userInfo.用户头像" alt="" srcset="" class="user-avatar"> --> <img :src="userInfo.userAvatar" alt="" srcset="" class="user-avatar"> <div class="user-text">当前账户:{{ userInfo.userName }}</div> <div class="user-text">床号:{{ userInfo.床号 }}</div> <div class="user-text">设备号:{{ userInfo.设备编号 }}</div>