远程管理错误修复

密码提醒按照一期的来
This commit is contained in:
yy 2024-06-07 10:23:48 +08:00
parent 30b7e00b38
commit 5aee40bfc4
9 changed files with 298 additions and 207 deletions

View File

@ -33,14 +33,14 @@
</template> </template>
<template v-else> <template v-else>
<el-form-item label="密码" prop="password" label-width="100"> <el-form-item label="密码" prop="password" label-width="100">
<el-input v-model="formData.password" type="password" show-password placeholder="请输入密码"></el-input> <el-input v-model="formData.password" type="password" show-password placeholder="8~16位字母或数字区分大小写"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="新密码" prop="newPassword" label-width="100"> <el-form-item label="新密码" prop="newPassword" label-width="100">
<el-input v-model="formData.newPassword" type="password" show-password placeholder="请输入新密码"></el-input> <el-input v-model="formData.newPassword" type="password" show-password placeholder="8~16位字母或数字区分大小写"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="确认密码" prop="confirmPassword" label-width="100"> <el-form-item label="确认密码" prop="confirmPassword" label-width="100">
<el-input v-model="formData.confirmPassword" type="password" show-password <el-input v-model="formData.confirmPassword" type="password" show-password
placeholder="请输入密码"></el-input> placeholder="请输入密码"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-form> </el-form>

View File

@ -48,13 +48,13 @@ export const useRemoteWsStore = defineStore("remoteWs", {
Session.set("remoteTasks", this.remoteTasks) Session.set("remoteTasks", this.remoteTasks)
}, },
getRemoteTask() { getRemoteTask() {
if (Session.get("remoteTasks") && !this.remoteTasks) { if (Session.get("remoteTasks") && this.remoteTasks.length == 0) {
this.remoteTasks = Session.get("remoteTasks") this.remoteTasks = Session.get("remoteTasks")
} }
return this.remoteTasks return this.remoteTasks
}, },
initRemoteTask() { initRemoteTask() {
if (Session.get("remoteTasks") && !this.remoteTasks) { if (Session.get("remoteTasks")) {
this.remoteTasks = Session.get("remoteTasks") this.remoteTasks = Session.get("remoteTasks")
} }
if (this.remoteTasks.length <= 0) { if (this.remoteTasks.length <= 0) {
@ -139,7 +139,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
} }
} else { } else {
cb({ cb({
status: 1, status: 2,
msg: "已断开连接" msg: "已断开连接"
}) })
} }
@ -169,7 +169,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
}, },
unsubscribeVital(name: string, id: string, date: string, index: number) { unsubscribeVital(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index] const patient: any = this.patient[name + id + date + index]
if (patient) { if (patient && patient.vitalWS) {
patient.vitalWS.onmessage = undefined patient.vitalWS.onmessage = undefined
patient.vitalWS.onclose = undefined patient.vitalWS.onclose = undefined
patient.vitalWS.onerror = undefined patient.vitalWS.onerror = undefined
@ -242,7 +242,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
}, },
unsubscribeChat(name: string, id: string, date: string, index: number) { unsubscribeChat(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index] const patient: any = this.patient[name + id + date + index]
if (patient) { if (patient && patient.chatWS) {
patient.chatWS.onmessage = undefined patient.chatWS.onmessage = undefined
patient.chatWS.onclose = undefined patient.chatWS.onclose = undefined
patient.chatWS.onerror = undefined patient.chatWS.onerror = undefined
@ -335,7 +335,7 @@ export const useRemoteWsStore = defineStore("remoteWs", {
}, },
unsubscribeMedicine(name: string, id: string, date: string, index: number) { unsubscribeMedicine(name: string, id: string, date: string, index: number) {
const patient: any = this.patient[name + id + date + index] const patient: any = this.patient[name + id + date + index]
if (patient) { if (patient && patient.medicineWS) {
patient.medicineWS.onmessage = undefined patient.medicineWS.onmessage = undefined
patient.medicineWS.onclose = undefined patient.medicineWS.onclose = undefined
patient.medicineWS.onerror = undefined patient.medicineWS.onerror = undefined

View File

@ -12,7 +12,7 @@
<div v-if="!isShowRegister" class="login-block move_2"> <div v-if="!isShowRegister" class="login-block move_2">
<div class="login-way"> <div class="login-way">
<span :class="passwordLogin && 'active'" @click="passwordLogin = true">密码登录</span> <span :class="passwordLogin && 'active'" @click="passwordLogin = true">密码登录</span>
<span :class="!passwordLogin && 'active'" @click="passwordLogin = false">验证码登录</span> <!-- <span :class="!passwordLogin && 'active'" @click="passwordLogin = false">验证码登录</span>-->
</div> </div>
<el-form ref="loginFormRef" :model="loginParams" :rules="loginRules" label-width="0" size="small"> <el-form ref="loginFormRef" :model="loginParams" :rules="loginRules" label-width="0" size="small">
<div class="login-form password-login" v-if="passwordLogin"> <div class="login-form password-login" v-if="passwordLogin">
@ -86,11 +86,11 @@
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="registerParams.password" type="password" show-password <el-input v-model="registerParams.password" type="password" show-password
placeholder="请输入密码"></el-input> placeholder="8~16位字母或数字区分大小写"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="确认密码" prop="confirmPassword"> <el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="registerParams.confirmPassword" type="password" show-password <el-input v-model="registerParams.confirmPassword" type="password" show-password
placeholder="请输入密码8~16位字母或数字区分大小写"></el-input> placeholder="请输入密码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input v-model="registerParams.name" placeholder="请输入姓名"></el-input> <el-input v-model="registerParams.name" placeholder="请输入姓名"></el-input>

View File

@ -24,9 +24,12 @@
<el-table-column type="index" label="#" width="55" align="center"/> <el-table-column type="index" label="#" width="55" align="center"/>
<el-table-column property="name" label="姓名" width="120" align="center"/> <el-table-column property="name" label="姓名" width="120" align="center"/>
<el-table-column label="手机号" width="220" align="center"> <el-table-column label="手机号" width="220" align="center">
<template #default="scope">{{ <template #default="scope">
<div v-if="scope.row.phone">
{{
scope.row.phone.slice(0, 3) + '****' + scope.row.phone.slice(7) scope.row.phone.slice(0, 3) + '****' + scope.row.phone.slice(7)
}} }}
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="角色" width="220" align="center"> <el-table-column label="角色" width="220" align="center">
@ -59,6 +62,26 @@
<CommonPagination :total="total" @paginationChange="paginationChange"/> <CommonPagination :total="total" @paginationChange="paginationChange"/>
</div> </div>
</div> </div>
<el-dialog v-model="psDialogVisible" title="密码重置" width="500" draggable>
<el-form ref="formRef" :model="formData" :rules="rules" label-width="60">
<el-form-item label="密码" prop="password" label-width="100">
<el-input v-model="formData.password" type="password" show-password
placeholder="8~16位字母或数字区分大小写"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword" label-width="100">
<el-input v-model="formData.confirmPassword" type="password" show-password
placeholder="确认密码"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="psDialogVisible = false">取消</el-button>
<el-button type="primary" @click="sbPs">
确定
</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="isFormDialog" :title="formDialogTitle" width="750px"> <el-dialog v-model="isFormDialog" :title="formDialogTitle" width="750px">
<DoctorForm ref="doctorFormRef" :type="formDialogTitle === '添加' ? 'add' : 'edit'" @close="isFormDialog = false" <DoctorForm ref="doctorFormRef" :type="formDialogTitle === '添加' ? 'add' : 'edit'" @close="isFormDialog = false"
@save="doctorFormSave"/> @save="doctorFormSave"/>
@ -76,6 +99,7 @@ import CommonPagination from '@/components/common-pagination.vue'
import DoctorForm from './form/doctor-form.vue' import DoctorForm from './form/doctor-form.vue'
import ImportDialog from '@/components/import-dialog.vue' import ImportDialog from '@/components/import-dialog.vue'
import {deleteU, modifyPw, updateUserInfo, userPage} from "@/api/user"; import {deleteU, modifyPw, updateUserInfo, userPage} from "@/api/user";
import {REGEXP} from "@/enum/global-enum";
const tableRef = ref() const tableRef = ref()
const doctorFormRef = ref() const doctorFormRef = ref()
@ -83,6 +107,7 @@ const importDialogRef = ref()
const isSearch = ref(true) const isSearch = ref(true)
const loading = ref(true) const loading = ref(true)
const isFormDialog = ref(false) const isFormDialog = ref(false)
const psDialogVisible = ref(false)
const formDialogTitle = ref('') const formDialogTitle = ref('')
const queryParams = ref({ const queryParams = ref({
userName: '' userName: ''
@ -91,6 +116,36 @@ const tableData = ref([] as any)
let current = 0 let current = 0
let size = 10 let size = 10
const total = ref(0) 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() queryData()
@ -167,22 +222,30 @@ const enableChange = (e: any) => {
}) })
} }
const resetPassword = (e: any) => { const resetPassword = (e: any) => {
ElMessageBox.prompt('是否确定要重置密码?', '系统提醒', { formData.value = {
type: 'warning', password: '',
draggable: true, confirmPassword: '',
inputPattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z\s]).{9,15}$/, username: e.username
inputErrorMessage: "密码至少包含字母、数字、特殊字符不少于9位最多15位" }
}).then((inputVal) => { psDialogVisible.value = true
formRef.value.resetFields()
}
const sbPs = () => {
formRef.value.validate((valid: any, fields: any) => {
if (valid) {
modifyPw({ modifyPw({
username: e.username, username: formData.value.username,
password: inputVal.value password: formData.value.password
}).then((res: any) => { }).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
ElMessage.success('重置成功!') ElMessage.success('重置成功!')
psDialogVisible.value = false
} else { } else {
ElMessage.error(res.msg) ElMessage.error(res.msg)
} }
}) })
}
}) })
} }
const editData = (e: any) => { const editData = (e: any) => {

View File

@ -3,7 +3,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
<el-input v-model="formData.username" placeholder="请输入用户名2~16位字母或数字区分大小写" <el-input v-model="formData.username" placeholder="2~16位字母或数字区分大小写"
:disabled="type === 'edit'"></el-input> :disabled="type === 'edit'"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -46,13 +46,13 @@
<el-row v-if="type != 'edit'"> <el-row v-if="type != 'edit'">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="formData.password" placeholder="请输入密码8~16位字母或数字区分大小写" <el-input v-model="formData.password" placeholder="8~16位字母或数字区分大小写"
:disabled="type === 'edit'" type="password" show-password></el-input> :disabled="type === 'edit'" type="password" show-password></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="确认密码" prop="confirmPassword"> <el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="formData.confirmPassword" placeholder="请输入密码8~16位字母或数字区分大小写" <el-input v-model="formData.confirmPassword" placeholder="请输入密码"
:disabled="type === 'edit'" type="password" show-password></el-input> :disabled="type === 'edit'" type="password" show-password></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -88,6 +88,7 @@ function initData() {
function subscribeVital() { function subscribeVital() {
remoteWsStore.subscribeVital(remoteTask.value.patient, remoteTask.value.patientId, remoteTask.value.date, remoteTask.value.index, (res: any) => { remoteWsStore.subscribeVital(remoteTask.value.patient, remoteTask.value.patientId, remoteTask.value.date, remoteTask.value.index, (res: any) => {
if (res.status != 2) {
const data = JSON.parse(res.data); const data = JSON.parse(res.data);
if (data.vitalSignsList && data.vitalSignsList.length > 0) { if (data.vitalSignsList && data.vitalSignsList.length > 0) {
Object.assign(patientInfo.value, data.vitalSignsList[0]); Object.assign(patientInfo.value, data.vitalSignsList[0]);
@ -96,6 +97,7 @@ function subscribeVital() {
setLog(patientInfo.value, props.index) setLog(patientInfo.value, props.index)
emit('addLogAfter', props.index) emit('addLogAfter', props.index)
} }
}
}) })
} }

View File

@ -2,7 +2,7 @@
<div class="remote-box" id="screenBox"> <div class="remote-box" id="screenBox">
<div class="main-box"> <div class="main-box">
<div class="left-box"> <div class="left-box">
<h3>{{ currentRemote.taskName }}</h3> <h3>{{ currentRemote?.taskName }}</h3>
<chart-line ref="chartDom1" class="chart-line" :names="['BIS', 'HR']" <chart-line ref="chartDom1" class="chart-line" :names="['BIS', 'HR']"
@exception-event="vitalExcepEvent"></chart-line> @exception-event="vitalExcepEvent"></chart-line>
<chart-line ref="chartDom2" class="chart-line" :names="['SBP', 'DBP']" <chart-line ref="chartDom2" class="chart-line" :names="['SBP', 'DBP']"
@ -268,9 +268,6 @@ onMounted(() => {
msgLogScrollBottom() msgLogScrollBottom()
initScale() initScale()
createConnect() createConnect()
onVitalClose()
onChatClose()
onMedicineClose()
subscribeWS() subscribeWS()
}); });
@ -289,6 +286,13 @@ function createConnect() {
function disconnect() { function disconnect() {
remoteWsStore.disconnectMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index) 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) 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() { function subscribeWS() {
@ -298,18 +302,22 @@ function subscribeWS() {
} }
const subscribeVital = () => { const subscribeVital = () => {
onVitalClose()
remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index, remoteWsStore.subscribeVital(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => { (res: any) => {
if (res.status != 2) {
const data = JSON.parse(res.data); const data = JSON.parse(res.data);
chartDom1.value.updateChartData(data.vitalSignsList[0]); chartDom1.value.updateChartData(data.vitalSignsList[0]);
chartDom2.value.updateChartData(data.vitalSignsList[0]); chartDom2.value.updateChartData(data.vitalSignsList[0]);
chartDom3.value.updateChartData(data.vitalSignsList[0]); chartDom3.value.updateChartData(data.vitalSignsList[0]);
chartDom4.value.updateChartData(data.vitalSignsList[0]); chartDom4.value.updateChartData(data.vitalSignsList[0]);
updateMedicineTable(data.aiMedicineList[0], data.docMedicineList[0]); updateMedicineTable(data.aiMedicineList[0], data.docMedicineList);
}
}) })
} }
const subscribeChat = () => { const subscribeChat = () => {
onChatClose()
remoteWsStore.subscribeChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index, remoteWsStore.subscribeChat(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => { (res: any) => {
mssageList.value.push(JSON.parse(res.data)); mssageList.value.push(JSON.parse(res.data));
@ -317,6 +325,7 @@ const subscribeChat = () => {
} }
const subscribeMedicine = () => { const subscribeMedicine = () => {
onMedicineClose()
remoteWsStore.subscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index, remoteWsStore.subscribeMedicine(currentRemote.value.patient, currentRemote.value.patientId, currentRemote.value.date, currentRemote.value.index,
(res: any) => { (res: any) => {
const data = JSON.parse(res.data); const data = JSON.parse(res.data);

View File

@ -26,7 +26,7 @@
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import {onMounted, ref} from 'vue' import {onMounted, onUnmounted, ref} from 'vue'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
import RemoteDialog from './part/remote-dialog.vue' import RemoteDialog from './part/remote-dialog.vue'
import RemotePart from './part/remote-part.vue' import RemotePart from './part/remote-part.vue'
@ -44,6 +44,15 @@ onMounted(() => {
initRemoteTask() initRemoteTask()
}) })
onUnmounted(() => {
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 initRemoteTask() { function initRemoteTask() {
remoteTask.value = remoteWsStore.initRemoteTask() remoteTask.value = remoteWsStore.initRemoteTask()
remotePartRef.value.initData() remotePartRef.value.initData()
@ -52,8 +61,7 @@ function initRemoteTask() {
const viewThumbnail = () => { const viewThumbnail = () => {
router.push({ router.push({
path: '/remote-manage/remote-thumbnail', path: '/remote-manage/remote-thumbnail',
query: { query: {}
}
}) })
} }
// //

View File

@ -26,7 +26,7 @@
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import {onMounted, ref} from 'vue'; import {onMounted, onUnmounted, ref} from 'vue';
import {useRoute, useRouter} from 'vue-router'; import {useRoute, useRouter} from 'vue-router';
import RemoteItemPart from './part/remote-item-part.vue'; import RemoteItemPart from './part/remote-item-part.vue';
import MessageItemPart from './part/message-item-part.vue'; import MessageItemPart from './part/message-item-part.vue';
@ -42,6 +42,15 @@ onMounted(() => {
remoteTask.value = remoteWsStore.getRemoteTask(); remoteTask.value = remoteWsStore.getRemoteTask();
}) })
onUnmounted(() => {
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)
})
}
})
const openRemote = (params: any) => { const openRemote = (params: any) => {
router.push('/remote-manage/remote-manage'); router.push('/remote-manage/remote-manage');
} }