From 62771fd1cf82f028645d54f8873c4abe238eab94 Mon Sep 17 00:00:00 2001
From: maochaoying <925670706@qq.com>
Date: Mon, 4 Sep 2023 16:58:18 +0800
Subject: [PATCH] login form
---
src/components/LoginForm.vue | 14 +-
src/components/Progress.vue | 16 +-
src/components/dialogs/LoginModal.vue | 67 +++
src/pages/Home.vue | 26 +-
yarn.lock | 831 +++++++++++++++++++---------------
5 files changed, 593 insertions(+), 361 deletions(-)
create mode 100644 src/components/dialogs/LoginModal.vue
diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue
index 6fb6288..7c923fa 100644
--- a/src/components/LoginForm.vue
+++ b/src/components/LoginForm.vue
@@ -42,6 +42,14 @@ const props = defineProps({
input: {
type: String,
},
+ hideLoginModal: {
+ type: Function,
+ default: () => {},
+ },
+ modal: {
+ type: Boolean,
+ default: false,
+ },
})
const activeInput = ref(1)
@@ -92,7 +100,11 @@ const handleLogin = () => {
flag = true
userStore.updatePermission(item.permission_level)
userStore.updateLoginUser(item.uid)
- window.location.href = 'http://127.0.0.1/'
+ if (props.modal) {
+ props.hideLoginModal()
+ } else {
+ window.location.href = 'http://127.0.0.1/'
+ }
}
})
if (!flag) {
diff --git a/src/components/Progress.vue b/src/components/Progress.vue
index ae2a576..1aabc29 100644
--- a/src/components/Progress.vue
+++ b/src/components/Progress.vue
@@ -134,6 +134,10 @@
+
@@ -146,6 +150,7 @@ import {
continueDisinfectionJSON,
pauseDisinfectionJSON,
} from '@/mock/command'
+import DisinfectModal from 'cpns/dialogs/DisinfectModal'
import { onMounted, onUnmounted, ref, computed, watch } from 'vue'
import * as echarts from 'echarts'
import { storeToRefs } from 'pinia'
@@ -656,12 +661,18 @@ const pauseDisinfect = () => {
}
}
+const disinfectWarnVisible = ref(false)
const stopDisinfect = () => {
+ disinfectWarnVisible.value = true
if ([1, 2].includes(operatorStore.disinfectStatus)) {
webSocketStore.sendCommandMsg(stopDisinfectionJSON)
}
}
+const hideDisinfectModal = () => {
+ disinfectWarnVisible.value = false
+}
+
const continueDisinfect = () => {
if (operatorStore.disinfectStatus == 2) {
webSocketStore.sendCommandMsg(continueDisinfectionJSON)
@@ -710,6 +721,7 @@ const continueDisinfect = () => {
}
.btn {
padding: 12px 28px;
+ white-space: nowrap;
box-sizing: border-box;
width: 140px;
height: 50px;
@@ -729,6 +741,7 @@ const continueDisinfect = () => {
.echarts_wrap {
height: 351px;
display: flex;
+ padding-left: 20px;
align-items: center;
margin-bottom: 19px;
.single_wrap {
@@ -760,6 +773,7 @@ const continueDisinfect = () => {
}
}
.detail_wrap {
+ padding-left: 20px;
display: flex;
align-items: center;
padding-right: 16px;
@@ -797,7 +811,7 @@ const continueDisinfect = () => {
font-weight: bold;
line-height: normal;
letter-spacing: 0.02em;
- color: #000000;
+ color: #17f179;
left: 197px;
bottom: -2px;
width: 68px;
diff --git a/src/components/dialogs/LoginModal.vue b/src/components/dialogs/LoginModal.vue
new file mode 100644
index 0000000..4c566b8
--- /dev/null
+++ b/src/components/dialogs/LoginModal.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
diff --git a/src/pages/Home.vue b/src/pages/Home.vue
index d37f80e..a42bbb1 100644
--- a/src/pages/Home.vue
+++ b/src/pages/Home.vue
@@ -112,7 +112,10 @@
activeTab == 5 ? 'tab_btn style-btn active_btn' : 'style-btn tab_btn'
"
@click="changeTab(5)"
- v-if="userStore.loginUserPermission != 3"
+ v-if="
+ userStore.loginUserPermission != 3 ||
+ operatorStore.disinfectStatus == 1
+ "
>
+