From 5aee40bfc4bf043b7a347f80985a395962e15d00 Mon Sep 17 00:00:00 2001
From: yy <11@11.com>
Date: Fri, 7 Jun 2024 10:23:48 +0800
Subject: [PATCH] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E7=AE=A1=E7=90=86=E9=94=99?=
=?UTF-8?q?=E8=AF=AF=E4=BF=AE=E5=A4=8D=20=E5=AF=86=E7=A0=81=E6=8F=90?=
=?UTF-8?q?=E9=86=92=E6=8C=89=E7=85=A7=E4=B8=80=E6=9C=9F=E7=9A=84=E6=9D=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/user-info.vue | 6 +-
src/stores/remote-ws-store.ts | 12 +-
src/views/login/login.vue | 6 +-
.../permissions-manage/doctor-manage.vue | 103 ++++--
.../permissions-manage/form/doctor-form.vue | 6 +-
.../remote-manage/part/remote-item-part.vue | 16 +-
src/views/remote-manage/remote-control.vue | 29 +-
src/views/remote-manage/remote-manage.vue | 316 +++++++++---------
src/views/remote-manage/remote-thumbnail.vue | 11 +-
9 files changed, 298 insertions(+), 207 deletions(-)
diff --git a/src/components/user-info.vue b/src/components/user-info.vue
index 3b939e3..f5251c6 100644
--- a/src/components/user-info.vue
+++ b/src/components/user-info.vue
@@ -33,14 +33,14 @@
-
+
-
+
+ placeholder="请输入密码">
diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts
index 5499469..e9337be 100644
--- a/src/stores/remote-ws-store.ts
+++ b/src/stores/remote-ws-store.ts
@@ -48,13 +48,13 @@ export const useRemoteWsStore = defineStore("remoteWs", {
Session.set("remoteTasks", this.remoteTasks)
},
getRemoteTask() {
- if (Session.get("remoteTasks") && !this.remoteTasks) {
+ if (Session.get("remoteTasks") && this.remoteTasks.length == 0) {
this.remoteTasks = Session.get("remoteTasks")
}
return this.remoteTasks
},
initRemoteTask() {
- if (Session.get("remoteTasks") && !this.remoteTasks) {
+ if (Session.get("remoteTasks")) {
this.remoteTasks = Session.get("remoteTasks")
}
if (this.remoteTasks.length <= 0) {
@@ -139,7 +139,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
}
} else {
cb({
- status: 1,
+ status: 2,
msg: "已断开连接"
})
}
@@ -169,7 +169,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
},
unsubscribeVital(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index]
- if (patient) {
+ if (patient && patient.vitalWS) {
patient.vitalWS.onmessage = undefined
patient.vitalWS.onclose = undefined
patient.vitalWS.onerror = undefined
@@ -242,7 +242,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
},
unsubscribeChat(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index]
- if (patient) {
+ if (patient && patient.chatWS) {
patient.chatWS.onmessage = undefined
patient.chatWS.onclose = undefined
patient.chatWS.onerror = undefined
@@ -335,7 +335,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
},
unsubscribeMedicine(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index]
- if (patient) {
+ if (patient && patient.medicineWS) {
patient.medicineWS.onmessage = undefined
patient.medicineWS.onclose = undefined
patient.medicineWS.onerror = undefined
diff --git a/src/views/login/login.vue b/src/views/login/login.vue
index 6211696..2f7ac8d 100644
--- a/src/views/login/login.vue
+++ b/src/views/login/login.vue
@@ -12,7 +12,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -76,6 +99,7 @@ import CommonPagination from '@/components/common-pagination.vue'
import DoctorForm from './form/doctor-form.vue'
import ImportDialog from '@/components/import-dialog.vue'
import {deleteU, modifyPw, updateUserInfo, userPage} from "@/api/user";
+import {REGEXP} from "@/enum/global-enum";
const tableRef = ref()
const doctorFormRef = ref()
@@ -83,6 +107,7 @@ const importDialogRef = ref()
const isSearch = ref(true)
const loading = ref(true)
const isFormDialog = ref(false)
+const psDialogVisible = ref(false)
const formDialogTitle = ref('')
const queryParams = ref({
userName: ''
@@ -91,6 +116,36 @@ const tableData = ref([] as any)
let current = 0
let size = 10
const total = ref(0)
+const formRef = ref()
+const formData = ref()
+
+const validatePassword = (rule: any, value: any, callback: any) => {
+ if (!(new RegExp(REGEXP.PASSWORD).test(value))) {
+ callback("8~16位字母或数字(区分大小写)")
+ } else {
+ callback()
+ }
+}
+
+const validateConsistent = (rule: any, value: any, callback: any) => {
+ if (formData.value.password != formData.value.confirmPassword) {
+ callback('两次密码不一致')
+ } else {
+ callback()
+ }
+}
+
+const rules = ref({
+ password: [
+ {required: true, message: '请输入密码', trigger: ['blur', 'change']},
+ {validator: validatePassword, trigger: ['blur', 'change']},
+ ],
+ confirmPassword: [
+ {required: true, message: '请输入密码', trigger: ['blur', 'change']},
+ {validator: validatePassword, trigger: ['blur', 'change']},
+ {validator: validateConsistent, trigger: ['blur', 'change']}
+ ]
+})
queryData()
@@ -167,23 +222,31 @@ const enableChange = (e: any) => {
})
}
const resetPassword = (e: any) => {
- ElMessageBox.prompt('是否确定要重置密码?', '系统提醒', {
- type: 'warning',
- draggable: true,
- inputPattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{9,15}$/,
- inputErrorMessage: "密码至少包含字母、数字、特殊字符,不少于9位,最多15位"
- }).then((inputVal) => {
- modifyPw({
- username: e.username,
- password: inputVal.value
- }).then((res: any) => {
- if (res.code == 0) {
- ElMessage.success('重置成功!')
- } else {
- ElMessage.error(res.msg)
- }
- })
- })
+ formData.value = {
+ password: '',
+ confirmPassword: '',
+ username: e.username
+ }
+ psDialogVisible.value = true
+ formRef.value.resetFields()
+}
+
+const sbPs = () => {
+ formRef.value.validate((valid: any, fields: any) => {
+ if (valid) {
+ modifyPw({
+ username: formData.value.username,
+ password: formData.value.password
+ }).then((res: any) => {
+ if (res.code == 0) {
+ ElMessage.success('重置成功!')
+ psDialogVisible.value = false
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+ }
+ })
}
const editData = (e: any) => {
isFormDialog.value = true
diff --git a/src/views/permissions-manage/form/doctor-form.vue b/src/views/permissions-manage/form/doctor-form.vue
index e2c633d..a671d15 100644
--- a/src/views/permissions-manage/form/doctor-form.vue
+++ b/src/views/permissions-manage/form/doctor-form.vue
@@ -3,7 +3,7 @@
-
@@ -46,13 +46,13 @@
-
-
diff --git a/src/views/remote-manage/part/remote-item-part.vue b/src/views/remote-manage/part/remote-item-part.vue
index 8849515..8f55f32 100644
--- a/src/views/remote-manage/part/remote-item-part.vue
+++ b/src/views/remote-manage/part/remote-item-part.vue
@@ -88,13 +88,15 @@ function initData() {
function subscribeVital() {
remoteWsStore.subscribeVital(remoteTask.value.patient, remoteTask.value.patientId, remoteTask.value.date, remoteTask.value.index, (res: any) => {
- const data = JSON.parse(res.data);
- if (data.vitalSignsList && data.vitalSignsList.length > 0) {
- Object.assign(patientInfo.value, data.vitalSignsList[0]);
- patientInfo.value.state = (patientInfo.value.BIS_except || patientInfo.value.SBP_except ||
- patientInfo.value.DBP_except || patientInfo.value.HR_except);
- setLog(patientInfo.value, props.index)
- emit('addLogAfter', props.index)
+ if (res.status != 2) {
+ const data = JSON.parse(res.data);
+ if (data.vitalSignsList && data.vitalSignsList.length > 0) {
+ Object.assign(patientInfo.value, data.vitalSignsList[0]);
+ patientInfo.value.state = (patientInfo.value.BIS_except || patientInfo.value.SBP_except ||
+ patientInfo.value.DBP_except || patientInfo.value.HR_except);
+ setLog(patientInfo.value, props.index)
+ emit('addLogAfter', props.index)
+ }
}
})
}
diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue
index 20f0f92..a21f6f0 100644
--- a/src/views/remote-manage/remote-control.vue
+++ b/src/views/remote-manage/remote-control.vue
@@ -2,7 +2,7 @@
-
{{ currentRemote.taskName }}
+
{{ currentRemote?.taskName }}
{
msgLogScrollBottom()
initScale()
createConnect()
- onVitalClose()
- onChatClose()
- onMedicineClose()
subscribeWS()
});
@@ -289,6 +286,13 @@ function createConnect() {
function disconnect() {
remoteWsStore.disconnectMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
remoteWsStore.disconnectChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index)
+
+ if (!router.currentRoute.value.path.startsWith('/remote-manage/')) {
+ const tasks: any = remoteWsStore.getRemoteTask()
+ tasks.forEach((task: any) => {
+ remoteWsStore.disconnect(task.patient, task.patientId, task.date, task.index)
+ })
+ }
}
function subscribeWS() {
@@ -298,18 +302,22 @@ function subscribeWS() {
}
const subscribeVital = () => {
+ onVitalClose()
remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => {
- const data = JSON.parse(res.data);
- chartDom1.value.updateChartData(data.vitalSignsList[0]);
- chartDom2.value.updateChartData(data.vitalSignsList[0]);
- chartDom3.value.updateChartData(data.vitalSignsList[0]);
- chartDom4.value.updateChartData(data.vitalSignsList[0]);
- updateMedicineTable(data.aiMedicineList[0], data.docMedicineList[0]);
+ if (res.status != 2) {
+ const data = JSON.parse(res.data);
+ chartDom1.value.updateChartData(data.vitalSignsList[0]);
+ chartDom2.value.updateChartData(data.vitalSignsList[0]);
+ chartDom3.value.updateChartData(data.vitalSignsList[0]);
+ chartDom4.value.updateChartData(data.vitalSignsList[0]);
+ updateMedicineTable(data.aiMedicineList[0], data.docMedicineList);
+ }
})
}
const subscribeChat = () => {
+ onChatClose()
remoteWsStore.subscribeChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => {
mssageList.value.push(JSON.parse(res.data));
@@ -317,6 +325,7 @@ const subscribeChat = () => {
}
const subscribeMedicine = () => {
+ onMedicineClose()
remoteWsStore.subscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => {
const data = JSON.parse(res.data);
diff --git a/src/views/remote-manage/remote-manage.vue b/src/views/remote-manage/remote-manage.vue
index 81b5855..85df96b 100644
--- a/src/views/remote-manage/remote-manage.vue
+++ b/src/views/remote-manage/remote-manage.vue
@@ -1,32 +1,32 @@
-
-
+
+
diff --git a/src/views/remote-manage/remote-thumbnail.vue b/src/views/remote-manage/remote-thumbnail.vue
index c14f803..9858f65 100644
--- a/src/views/remote-manage/remote-thumbnail.vue
+++ b/src/views/remote-manage/remote-thumbnail.vue
@@ -26,7 +26,7 @@