远程管理错误修复

密码提醒按照一期的来
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 v-else>
<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 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 label="确认密码" prop="confirmPassword" label-width="100">
<el-input v-model="formData.confirmPassword" type="password" show-password
placeholder="请输入密码"></el-input>
placeholder="请输入密码"></el-input>
</el-form-item>
</template>
</el-form>

View File

@ -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

View File

@ -12,7 +12,7 @@
<div v-if="!isShowRegister" class="login-block move_2">
<div class="login-way">
<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>
<el-form ref="loginFormRef" :model="loginParams" :rules="loginRules" label-width="0" size="small">
<div class="login-form password-login" v-if="passwordLogin">
@ -86,11 +86,11 @@
</el-form-item>
<el-form-item label="密码" prop="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 label="确认密码" prop="confirmPassword">
<el-input v-model="registerParams.confirmPassword" type="password" show-password
placeholder="请输入密码8~16位字母或数字区分大小写"></el-input>
placeholder="请输入密码"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="name">
<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 property="name" label="姓名" width="120" 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)
}}
</div>
</template>
</el-table-column>
<el-table-column label="角色" width="220" align="center">
@ -59,6 +62,26 @@
<CommonPagination :total="total" @paginationChange="paginationChange"/>
</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">
<DoctorForm ref="doctorFormRef" :type="formDialogTitle === '添加' ? 'add' : 'edit'" @close="isFormDialog = false"
@save="doctorFormSave"/>
@ -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,22 +222,30 @@ 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) => {
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: e.username,
password: inputVal.value
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) => {

View File

@ -3,7 +3,7 @@
<el-row>
<el-col :span="12">
<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>
</el-form-item>
</el-col>
@ -46,13 +46,13 @@
<el-row v-if="type != 'edit'">
<el-col :span="12">
<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>
</el-form-item>
</el-col>
<el-col :span="12">
<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>
</el-form-item>
</el-col>

View File

@ -88,6 +88,7 @@ function initData() {
function subscribeVital() {
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);
if (data.vitalSignsList && data.vitalSignsList.length > 0) {
Object.assign(patientInfo.value, data.vitalSignsList[0]);
@ -96,6 +97,7 @@ function subscribeVital() {
setLog(patientInfo.value, props.index)
emit('addLogAfter', props.index)
}
}
})
}

View File

@ -2,7 +2,7 @@
<div class="remote-box" id="screenBox">
<div class="main-box">
<div class="left-box">
<h3>{{ currentRemote.taskName }}</h3>
<h3>{{ currentRemote?.taskName }}</h3>
<chart-line ref="chartDom1" class="chart-line" :names="['BIS', 'HR']"
@exception-event="vitalExcepEvent"></chart-line>
<chart-line ref="chartDom2" class="chart-line" :names="['SBP', 'DBP']"
@ -268,9 +268,6 @@ onMounted(() => {
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) => {
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[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);

View File

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

View File

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