From 3496040d90c8109b648ce0a584d1bd5f4ce60711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=A2=A6=E8=BF=9C?= <1063331231@qq.com> Date: Fri, 4 Jul 2025 14:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AE=E9=80=9A=E7=94=A8=E6=88=B7=E4=B8=8D?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E5=85=B7=E6=9C=89=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=9D=83=E9=99=90=E3=80=81=E6=B5=8B=E8=AF=95=E6=9D=83?= =?UTF-8?q?=E9=99=90=E3=80=81=E5=88=A0=E9=99=A4=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=9D=83=E9=99=90=E3=80=81=E8=AE=BE=E7=BD=AE=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=97=B6=E9=97=B4=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/user.ts | 3 +-- src/components/common/SoftKeyboard/index.vue | 6 +++--- src/components/setting/History.vue | 7 +++++-- src/components/system/ErrorEventsModal.vue | 2 +- src/layouts/default.vue | 6 +++--- src/router/routes.ts | 8 +++++++- src/stores/deviceStore.ts | 18 ++++++++++++------ src/stores/settingStore.ts | 5 +++++ src/types/device.d.ts | 2 +- src/types/user.d.ts | 2 +- src/views/debug/index.vue | 6 +++--- src/views/login/index.vue | 3 +++ src/views/setting/index.vue | 3 ++- 13 files changed, 47 insertions(+), 24 deletions(-) diff --git a/src/apis/user.ts b/src/apis/user.ts index b801afc..cd31788 100644 --- a/src/apis/user.ts +++ b/src/apis/user.ts @@ -2,7 +2,7 @@ import { createWebSocket } from 'libs/socket' const wsClient = createWebSocket() export const login = async (params: User.Login) => { - const res = await wsClient.waitAndSend({ + return await wsClient.waitAndSend({ messageType: 'Command', fnName: 'login', className: 'UserMgrService', @@ -11,5 +11,4 @@ export const login = async (params: User.Login) => { ...params, }, }) - return res } diff --git a/src/components/common/SoftKeyboard/index.vue b/src/components/common/SoftKeyboard/index.vue index 805980b..237600b 100644 --- a/src/components/common/SoftKeyboard/index.vue +++ b/src/components/common/SoftKeyboard/index.vue @@ -15,7 +15,7 @@ const emits = defineEmits<{ (e: 'confirm', value: string): void (e: 'close'): void }>() -const deviceStete = useDeviceStore() +const deviceState = useDeviceStore() const languageType = ref('en') const inputValue = ref(props.modelValue) const cnList = ref([]) @@ -41,7 +41,7 @@ onMounted(() => { const isOpen = ref(false) watchEffect(() => { // 在焦点内二次点击时不触发EventListener,做一下延迟处理 - if (deviceStete.deviceInfo.deviceType !== deviceStete.deviceTypeMap.LargeSpaceDM_B) { // 大空间标准版 + if (deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B) { // 大空间标准版 setTimeout(() => { isOpen.value = props.isVisible }, 100) @@ -52,7 +52,7 @@ watchEffect(() => { watch( () => props.isVisible, (newVal) => { - if (deviceStete.deviceInfo.deviceType !== deviceStete.deviceTypeMap.LargeSpaceDM_B) { + if (deviceState.deviceInfo.deviceType !== deviceState.deviceTypeMap.LargeSpaceDM_B) { isOpen.value = newVal } }, diff --git a/src/components/setting/History.vue b/src/components/setting/History.vue index 4ca8804..9bc80b1 100644 --- a/src/components/setting/History.vue +++ b/src/components/setting/History.vue @@ -2,7 +2,7 @@ // import { useSettingStore } from '@/stores/settingStore' import { syncSendCmd } from 'apis/system' import { ElMessageBox } from 'element-plus' -import { onMounted, ref } from 'vue' +import { computed, onMounted, ref } from 'vue' import { FtMessage } from '@/libs/message' @@ -93,13 +93,16 @@ const handleSelectionChange = (rows: Setting.History[]) => { const onClose = () => { visible.value = false } +const deleteBtnVisible = computed(() => { + return JSON.parse(localStorage.user).roleType.includes('admin') +})