diff --git a/src/api/log-manage.ts b/src/api/log-manage.ts index e9182a0..72ad062 100644 --- a/src/api/log-manage.ts +++ b/src/api/log-manage.ts @@ -22,7 +22,7 @@ export function getMonthlyLogCount(startTime: string, endTime: string) { }) } -export function getPage(current: number, size: number, condition: {timeInterval: string, logType: string}) { +export function getPage(current: number, size: number, condition?: {timeInterval: string, logType: string}) { return new Promise((resolve, reject) => { request.get(getPageUrl, { params: { diff --git a/src/components/Websocket/index.vue b/src/components/Websocket/index.vue deleted file mode 100644 index 6b2ed61..0000000 --- a/src/components/Websocket/index.vue +++ /dev/null @@ -1,159 +0,0 @@ - - diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts index fd5153b..b1bb55d 100644 --- a/src/stores/remote-ws-store.ts +++ b/src/stores/remote-ws-store.ts @@ -1,214 +1,384 @@ import {defineStore} from "pinia"; import {Session} from "@/utils/storage"; +import {ElMessage} from "element-plus"; -const vitalUrl = "ws://localhost:5173/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() -const medicineUrl = "ws://localhost:5173/socket.io/admin/rax/addMedicine?token=" + Session.getToken() -const chatUrl = "ws://localhost:5173/socket.io/admin/rax/chatRoom?token=" + Session.getToken() +const vitalUrl = "ws://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +const medicineUrl = "ws://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +const chatUrl = "ws://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() export const useRemoteWsStore = defineStore("remoteWs", { - state: () => { - return { - patient: {} as any, - remoteTasks: [] as any, - remoteTasksCap: 10, - currentTaskIndex: 0, - varMedicine: ["丙泊酚", "舒芬太尼", "瑞芬太尼", "顺阿曲库胺"], - fixedMedicine: ["尼卡地平", "艾司洛尔", "麻黄素", "阿托品"], - exceptionType: ["BIS_except", "DBP_except", "EtCO2_except", "HR_except", "SBP_except", "ST_except"], - exceptionMsg: { - "BIS_except": "脑电双频指数异常", "DBP_except": "舒张压异常", "EtCO2_except": "呼气末二氧化碳异常", - "HR_except": "心率异常", "SBP_except": "收缩压异常", "ST_except": "ST异常" - } as any, - } - }, - actions: { - initRemoteTask() { - if (this.remoteTasks.length <= 0) { - for (let i = 0; i < 10; i++) { - this.remoteTasks.push({ - isRemote: false, - isException: false, - taskName: "", - server: "", - serverun: "", - serverps: "", - patient: "", - patientId: "", - date: "", - log: [], - index: i - }) - } - } - return this.remoteTasks - }, - resetRemoteTask(i: number) { - this.remoteTasks[i] = Object.assign(this.remoteTasks[i], { - isRemote: false, - isException: false, - taskName: "", - server: "", - serverun: "", - serverps: "", - patient: "", - patientId: "", - date: "", - log: [], - index: i, - message: [] - }) - }, - getActiveRemoteTask() { - for (let i = 0; i < this.remoteTasks.length; i++) { - if (this.remoteTasks[i].isRemote) return i - } - }, - setRemoteLog(log: any, i: number) { - this.remoteTasks[i].log.push(log) - }, - createConnect(name: string, id: string, date: string) { - if (!this.patient[name + id + date]) { - const vitalWS = new WebSocket(vitalUrl) - const medicineWS = new WebSocket(medicineUrl) - const chatWS = new WebSocket(chatUrl) - vitalWS.onopen = function () { - vitalWS.send(JSON.stringify({ - patientName: name, - idNum: id, - date: date - })) - } - medicineWS.onopen = function () { - medicineWS.send(JSON.stringify({ - patientName: name, - idNum: id, - date: date - })) - } - chatWS.onopen = function () { - chatWS.send(JSON.stringify({ - patientName: name, - idNum: id, - date: date - })) - } - this.patient[name + id + date] = { - vitalWS, - medicineWS, - chatWS - } - } - }, - disconnect(name: string, id: string, date: string) { - const patient: any = this.patient[name + id + date] - if (patient) { - patient.vitalWS.close() - patient.medicineWS.close() - patient.chatWS.close() - delete this.patient[name + id + date] - } - }, - subscribeVital(name: string, id: string, date: string, cb: any) { - const patient: any = this.patient[name + id + date] - if (patient) { - patient.vitalWS.onmessage = cb - patient.vitalCB = cb - } else { - cb({ - status: 1, - msg: "已断开连接" - }) - } - }, - unsubscribeVital(name: string, id: string, date: string) { - const patient: any = this.patient[name + id + date] - if (patient && patient.vitalWS) { - patient.vitalWS.onmessage = undefined; - patient.vitalCB = undefined; - } - }, - sendMsg(name: string, id: string, date: string, msg: string, cb: any) { - const patient: any = this.patient[name + id + date] - if (patient) { - const params = { - patientName: name, - idNum: id, - date: date, - msg - } - patient.chatWS.send(JSON.stringify(params)) - cb({ - status: 0 - }) - } else { - cb({ - status: 1, - msg: "已断开连接" - }) - } - }, - subscribeChat(name: string, id: string, date: string, cb: any) { - const patient: any = this.patient[name + id + date] - if (patient) { - patient.chatCB = cb - patient.chatWS.onmessage = cb - } else { - cb({ - status: 1, - msg: "已断开连接" - }) - } - }, - unsubscribeChat(name: string, id: string, date: string) { - const patient: any = this.patient[name + id + date] - patient.chatCB = undefined; - patient.chatWS.onmessage = undefined; - }, - sendMedicine(args: { - name: string, - id: string, - date: string, - flag: string, - medicine: string, - value: string - }, cb: any) { - const patient: any = this.patient[args.name + args.id + args.date] - if (patient) { - const params = { - patientName: args.name, - idNum: args.id, - date: args.date, - flag: args.flag, - medicine: args.medicine, - value: args.value - } - patient.medicineWS.send(JSON.stringify(params)) - cb({ - status: 0 - }) - } else { - cb({ - status: 1, - msg: "已断开连接" - }) - } - }, - subscribeMedicine(name: string, id: string, date: string, cb: any) { - const patient = this.patient[name + id + date] - if (patient) { - patient.medicineCB = cb - patient.medicineWS.onmessage = cb - } else { - cb({ - status: 1, - msg: "已断开连接" - }) - } - }, - unsubscribeMedicine(name: string, id: string, date: string) { - const patient: any = this.patient[name + id + date] - patient.medicineCB = undefined; - patient.medicineWS.onmessage = undefined; - } - } + state: () => { + return { + patient: {} as any, + remoteTasks: [] as any, + remoteTasksCap: 10, + currentTaskIndex: 0, + varMedicine: ["丙泊酚", "舒芬太尼", "瑞芬太尼", "顺阿曲库胺"], + fixedMedicine: ["尼卡地平", "艾司洛尔", "麻黄素", "阿托品"], + exceptionType: ["BIS_except", "DBP_except", "EtCO2_except", "HR_except", "SBP_except", "ST_except"], + exceptionMsg: { + "BIS_except": "脑电双频指数异常", "DBP_except": "舒张压异常", "EtCO2_except": "呼气末二氧化碳异常", + "HR_except": "心率异常", "SBP_except": "收缩压异常", "ST_except": "ST异常" + } as any, + exceptions: {} as any, + closeStatus: {} as any + } + }, + actions: { + setCurrentTaskIndex(i: number) { + this.currentTaskIndex = i + Session.set("currentTaskIndex", i) + }, + getCurrentTaskIndex() { + if (Session.get("currentTaskIndex") && Session.get("currentTaskIndex") > -1) { + this.currentTaskIndex = Session.get("currentTaskIndex") + } + return this.currentTaskIndex + }, + setExceptions(i: number, e: any) { + this.exceptions[i] = e + }, + getExceptions() { + return this.exceptions + }, + getCloseStatus() { + return this.closeStatus + }, + setRemoteTask() { + Session.set("remoteTasks", this.remoteTasks) + }, + getRemoteTask() { + if (Session.get("remoteTasks") && !this.remoteTasks) { + this.remoteTasks = Session.get("remoteTasks") + } + return this.remoteTasks + }, + initRemoteTask() { + if (Session.get("remoteTasks") && !this.remoteTasks) { + this.remoteTasks = Session.get("remoteTasks") + } + if (this.remoteTasks.length <= 0) { + for (let i = 0; i < 10; i++) { + this.remoteTasks.push({ + isRemote: false, + isException: false, + taskName: "", + server: "", + serverun: "", + serverps: "", + patient: "", + patientId: "", + date: "", + log: [], + index: i + }) + } + } + return this.remoteTasks + }, + resetRemoteTask(i: number) { + this.remoteTasks[i] = Object.assign(this.remoteTasks[i], { + isRemote: false, + isException: false, + taskName: "", + server: "", + serverun: "", + serverps: "", + patient: "", + patientId: "", + date: "", + log: [], + index: i, + message: [] + }) + Session.set("remoteTasks", this.remoteTasks) + }, + getActiveRemoteTask() { + let index = 0 + for (let i = 0; i < this.remoteTasks.length; i++) { + if (this.remoteTasks[i].isRemote) index = i + } + return index + }, + setRemoteLog(log: any, i: number) { + this.remoteTasks[i].log.push(log) + }, + disconnect(name: string, id: string, date: string) { + this.disconnectVital(name, id, date) + this.disconnectChat(name, id, date) + this.disconnectMedicine(name, id, date) + delete this.patient[name + id + date] + }, + createVitalConnect(name: string, id: string, date: string) { + if (!this.patient[name + id + date]) this.patient[name + id + date] = {} + const patient = this.patient[name + id + date] + if (!patient['vitalWS']) { + patient['vitalWS'] = new WebSocket(vitalUrl) + patient.vitalWS.onopen = () => { + patient.vitalWS.send(JSON.stringify({ + patientName: name, + idNum: id, + date: date, + msgType: "msg" + })) + } + } + }, + subscribeVital(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.vitalWS) { + patient.vitalWS.onmessage = (e: any) => { + if (e && e.data) { + const data = JSON.parse(e.data); + if (data.msgType == "msg") { + cb(e) + } else { + patient.vitalWS.send(JSON.stringify({msgType: "heartbeat"})) + } + } + } + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + vitalOnclose(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.vitalWS) { + patient.vitalWS.onclose = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + vitalOnerror(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.vitalWS) { + patient.vitalWS.onerror = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + unsubscribeVital(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient) { + patient.vitalWS.onmessage = undefined + patient.vitalWS.onclose = undefined + patient.vitalWS.onerror = undefined + } + }, + disconnectVital(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient && patient.vitalWS) { + this.closeStatus[name + id + date + 'vitalWS'] = true + patient.vitalWS.close() + delete patient['vitalWS'] + delete this.closeStatus[name + id + date + 'vitalWS'] + } + }, + createChatConnect(name: string, id: string, date: string) { + if (!this.patient[name + id + date]) this.patient[name + id + date] = {} + const patient = this.patient[name + id + date] + if (!patient['chatWS']) { + patient['chatWS'] = new WebSocket(chatUrl) + patient.chatWS.onopen = function () { + patient.chatWS.send(JSON.stringify({ + patientName: name, + idNum: id, + date: date, + msgType: "msg" + })) + } + } + }, + subscribeChat(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.chatWS) { + patient.chatWS.onmessage = (e: any) => { + if (e && e.data) { + const data = JSON.parse(e.data); + if (data.msgType == "msg") { + cb(e) + } else { + patient.chatWS.send(JSON.stringify({msgType: "heartbeat"})) + } + } + } + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + chatOnclose(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.chatWS) { + patient.chatWS.onclose = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + chatOnerror(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.chatWS) { + patient.chatWS.onerror = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + unsubscribeChat(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient) { + patient.chatWS.onmessage = undefined + patient.chatWS.onclose = undefined + patient.chatWS.onerror = undefined + } + }, + sendMsg(name: string, id: string, date: string, msg: string, cb: any) { + const patient: any = this.patient[name + id + date] + if (patient) { + const params = { + patientName: name, + idNum: id, + date: date, + msg + } + patient.chatWS.send(JSON.stringify(params)) + cb({ + status: 0 + }) + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + disconnectChat(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient && patient.chatWS) { + this.closeStatus[name + id + date + 'chatWS'] = true + patient.chatWS.close() + delete patient['chatWS'] + delete this.closeStatus[name + id + date + 'chatWS'] + } + }, + createMedicineConnect(name: string, id: string, date: string) { + if (!this.patient[name + id + date]) this.patient[name + id + date] = {} + const patient = this.patient[name + id + date] + if (!patient['medicineWS']) { + patient['medicineWS'] = new WebSocket(medicineUrl) + patient.medicineWS.onopen = function () { + patient.medicineWS.send(JSON.stringify({ + patientName: name, + idNum: id, + date: date, + msgType: "msg" + })) + } + } + }, + subscribeMedicine(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient) { + patient.medicineWS.onmessage = (e: any) => { + if (e && e.data) { + const data = JSON.parse(e.data); + if (data.msgType == "msg") { + cb(e) + } else { + patient.medicineWS.send(JSON.stringify({msgType: "heartbeat"})) + } + } + } + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + medicineOnclose(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.medicineWS) { + patient.medicineWS.onclose = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + medicineOnerror(name: string, id: string, date: string, cb: any) { + const patient = this.patient[name + id + date] + if (patient.medicineWS) { + patient.medicineWS.onerror = cb + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + unsubscribeMedicine(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient) { + patient.medicineWS.onmessage = undefined + patient.medicineWS.onclose = undefined + patient.medicineWS.onerror = undefined + } + }, + sendMedicine(args: { + name: string, + id: string, + date: string, + flag: string, + medicine: string, + value: string + }, cb: any) { + const patient: any = this.patient[args.name + args.id + args.date] + if (patient) { + const params = { + patientName: args.name, + idNum: args.id, + date: args.date, + flag: args.flag, + medicine: args.medicine, + value: args.value + } + patient.medicineWS.send(JSON.stringify(params)) + cb({ + status: 0 + }) + } else { + cb({ + status: 1, + msg: "已断开连接" + }) + } + }, + disconnectMedicine(name: string, id: string, date: string) { + const patient: any = this.patient[name + id + date] + if (patient && patient.medicineWS) { + this.closeStatus[name + id + date + 'medicineWS'] = true + patient.medicineWS.close() + delete patient['medicineWS'] + delete this.closeStatus[name + id + date + 'medicineWS'] + } + }, + } }) \ No newline at end of file diff --git a/src/utils/request.ts b/src/utils/request.ts index d461504..911565c 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -79,7 +79,7 @@ function handleResponse(response: any) { axiosInstance.interceptors.response.use(handleResponse, error => { const code = error.response.status || 200 - if (code == 424 || code == 401) { + if (code == 424) { ElMessageBox.confirm('令牌状态已过期,请点击重新登录', "系统提示", { confirmButtonText: "确定", cancelButtonText: "取消", diff --git a/src/views/home/index.vue b/src/views/home/index.vue index d52818c..0255e99 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -12,8 +12,8 @@
- {{ userInfo.name }} - {{ userInfo.roleName }} + {{ userInfo?.name }} + {{ userInfo?.roleName }}
@@ -55,39 +55,6 @@
- -
- - -

{{ item.message }}

- -
-
- - -
@@ -110,10 +77,6 @@ const userStore = useUserStore(); const userInfo = userStore.getlogin() const showLogMod = ref(false) const messages = ref([] as any) -const messageTable = ref([] as any) -const current = ref(1); -const size = ref(10); -const total = ref(0); const todoTotal = ref(0) // 日历添加的记录提醒统计 onMounted(() => { @@ -131,9 +94,6 @@ function init() { }); getTodoCount(); messages.value = []; - messageTable.value = []; - current.value = 1 - total.value = 0 loadMsg(); } @@ -145,25 +105,11 @@ function getTodoCount() { }); } -function handleSizeChange() { - messageTable.value = []; - loadMsg() -} - -function handleCurrentChange() { - messageTable.value = []; - loadMsg() -} - async function loadMsg() { - const res = await msgApi.page(current.value, size.value) + const res = await msgApi.page(0, 10) if (res.code == 0) { - total.value = res.data.total res.data.records.forEach((row: any) => { - if (current.value == 1) { - messages.value.push(row) - } - messageTable.value.push(row) + messages.value.push(row) }) } } diff --git a/src/views/index.vue b/src/views/index.vue index 3908d9b..347b683 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,62 +1,96 @@ diff --git a/src/views/remote-manage/index.vue b/src/views/remote-manage/index.vue index 8826981..4df3e64 100644 --- a/src/views/remote-manage/index.vue +++ b/src/views/remote-manage/index.vue @@ -3,7 +3,7 @@ @@ -107,34 +107,42 @@ const unsubscribeLastTask = () => { display: flex; justify-content: space-between; align-items: center; - &>img { + + & > img { width: 260px; border: 1px solid #C77000; border-radius: 20px; } + .info { width: calc(100% - 290px); color: $main-color; line-height: 2; font-weight: 600; + h3 { font-size: 28px; } + p { font-size: 15px; } + .input-box { display: flex; align-items: center; - &>span { + & > span { flex-shrink: 0; } + :deep(.el-input) { border-bottom: 1px solid $text3-color; + .el-input__wrapper { box-shadow: none; padding: 0; + input { height: 20px; font-size: 15px; @@ -151,11 +159,12 @@ const unsubscribeLastTask = () => { justify-content: center; align-items: center; margin-top: 50px; + .el-button { font-weight: 600; padding: 15px 50px; height: auto; } - + } diff --git a/src/views/remote-manage/part/remote-item-part.vue b/src/views/remote-manage/part/remote-item-part.vue index e3b4785..83b5152 100644 --- a/src/views/remote-manage/part/remote-item-part.vue +++ b/src/views/remote-manage/part/remote-item-part.vue @@ -1,114 +1,131 @@ @@ -117,233 +134,235 @@ function setLog(data: any, index: number) { $size: 20px; .remote-item-part { - cursor: pointer; - position: relative; - width: 100%; - height: 100%; - border: 1px solid $border-color; - &::after { - content: ''; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: transparent; - transition: all .6s; - z-index: 1; - } - &:hover { - &::after { - background-color: rgba(black, .1); - transition: all .6s; - } - } - - .title { + cursor: pointer; position: relative; width: 100%; - height: $size; - font-size: $size*0.7; - text-align: center; - line-height: $size; - font-weight: 600; - color: white; - background: $main-color; - } + height: 100%; + border: 1px solid $border-color; - .content { - width: 100%; - height: calc(100% - #{$size}); - padding: $size*0.5; - display: flex; - justify-content: space-between; - - .common-box { - width: 30%; - height: 100%; - display: flex; - flex-direction: column; - justify-content: space-evenly; - align-items: center; + &::after { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: transparent; + transition: all .6s; + z-index: 1; } - .left-box { - @extend .common-box; - - .label { - background: $main-color; - } + &:hover { + &::after { + background-color: rgba(black, .1); + transition: all .6s; + } } - .center-box { - @extend .common-box; - - img { - max-width: 100%; - max-height: 100%; - } - } - - .right-box { - @extend .common-box; - - .label { - background: #f8b300; - } - } - - .row-item { - width: 100%; - display: flex; - justify-content: space-between; - - .label { - flex-shrink: 0; + .title { + position: relative; width: 100%; height: $size; - color: white; - font-size: $size*0.6; - line-height: $size; - text-align: center; - border-radius: 5px; - } - } - - .info-box, - .row-item .value { - display: none; - } - - &.is-total { - - .info-box, - .row-item .value { - display: block; - } - - .label { - width: calc(50% - $size*0.5); - } - - .value { - width: 50%; - height: $size; - border-width: 1px; - border-style: solid; - text-align: center; - border-radius: 5px; - color: $main-color; - border-color: $main-color; font-size: $size*0.7; + text-align: center; line-height: $size; font-weight: 600; - - .unit { - font-size: $size*0.6; - font-family: 400; - } - } - - .right-box .value { - color: $main-color; - border-color: $main-color; - } - - .row-item.alarm { - .label { - background: red !important; - } - - .value { - color: red !important; - border-color: red !important; - } - } - - .info-box { - width: 100%; - - .row-item { - padding: $size*0.5 0; - height: $size; - justify-content: flex-start; - align-items: center; - - .label { - width: $size*3; - height: $size; - background: transparent; - color: $main-color; - font-size: $size*0.6; - line-height: $size; - font-weight: 600; - text-align: left; - } - - .input-value { - width: 100%; - height: $size; - line-height: $size; - font-size: $size*0.6; - color: $main-color; - border-bottom: 1px solid $border2-color; - } - - .tag-value { - margin-left: $size*0.5; - padding: 0 $size*0.5; - height: $size; - line-height: $size; - font-size: $size*0.7; - color: white; - font-weight: 600; - background: $border2-color; - border-radius: 8px; - - &.normal { - background: $main-color; - } - - &.alarm { - background: red; - } - } - } - } + color: white; + background: $main-color; } - &.mini { - padding: $size; + .content { + width: 100%; + height: calc(100% - #{$size}); + padding: $size*0.5; + display: flex; + justify-content: space-between; - .left-box { - width: 50%; - } + .common-box { + width: 30%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + } - .center-box { - width: 50%; - } - - &.is-total { .left-box { - .info-box { - display: block; - flex-shrink: 0; - } + @extend .common-box; - .row-item.yellow { .label { - background: $main-color; + background: $main-color; + } + } + + .center-box { + @extend .common-box; + + img { + max-width: 100%; + max-height: 100%; + } + } + + .right-box { + @extend .common-box; + + .label { + background: #f8b300; + } + } + + .row-item { + width: 100%; + display: flex; + justify-content: space-between; + + .label { + flex-shrink: 0; + width: 100%; + height: $size; + color: white; + font-size: $size*0.6; + line-height: $size; + text-align: center; + border-radius: 5px; + } + } + + .info-box, + .row-item .value { + display: none; + } + + &.is-total { + + .info-box, + .row-item .value { + display: block; + } + + .label { + width: calc(50% - $size * 0.5); } .value { - color: $main-color; - border-color: $main-color; - } - } - } - } + width: 50%; + height: $size; + border-width: 1px; + border-style: solid; + text-align: center; + border-radius: 5px; + color: $main-color; + border-color: $main-color; + font-size: $size*0.7; + line-height: $size; + font-weight: 600; + .unit { + font-size: $size*0.6; + font-family: 400; + } + } + + .right-box .value { + color: $main-color; + border-color: $main-color; + } + + .row-item.alarm { + .label { + background: red !important; + } + + .value { + color: red !important; + border-color: red !important; + } + } + + .info-box { + width: 100%; + + .row-item { + padding: $size*0.5 0; + height: $size; + justify-content: flex-start; + align-items: center; + + .label { + width: $size*3; + height: $size; + background: transparent; + color: $main-color; + font-size: $size*0.6; + line-height: $size; + font-weight: 600; + text-align: left; + } + + .input-value { + width: 100%; + height: $size; + line-height: $size; + font-size: $size*0.6; + color: $main-color; + border-bottom: 1px solid $border2-color; + } + + .tag-value { + margin-left: $size*0.5; + padding: 0 $size*0.5; + height: $size; + line-height: $size; + font-size: $size*0.7; + color: white; + font-weight: 600; + background: $border2-color; + border-radius: 8px; + + &.normal { + background: $main-color; + } + + &.alarm { + background: red; + } + } + } + } + } + + &.mini { + padding: $size; + + .left-box { + width: 50%; + } + + .center-box { + width: 50%; + } + + &.is-total { + .left-box { + .info-box { + display: block; + flex-shrink: 0; + } + + .row-item.yellow { + .label { + background: $main-color; + } + + .value { + color: $main-color; + border-color: $main-color; + } + } + } + } + + } } - } } diff --git a/src/views/remote-manage/part/remote-part.vue b/src/views/remote-manage/part/remote-part.vue index e1831be..3554d73 100644 --- a/src/views/remote-manage/part/remote-part.vue +++ b/src/views/remote-manage/part/remote-part.vue @@ -1,124 +1,125 @@ diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue index 185857b..8542a90 100644 --- a/src/views/remote-manage/remote-control.vue +++ b/src/views/remote-manage/remote-control.vue @@ -1,193 +1,197 @@ diff --git a/src/views/remote-manage/remote-manage.vue b/src/views/remote-manage/remote-manage.vue index c3dbc20..81b5855 100644 --- a/src/views/remote-manage/remote-manage.vue +++ b/src/views/remote-manage/remote-manage.vue @@ -46,7 +46,7 @@ onMounted(() => { function initRemoteTask() { remoteTask.value = remoteWsStore.initRemoteTask() - remotePartRef.value.showData(remoteWsStore.currentTaskIndex); + remotePartRef.value.initData() } const viewThumbnail = () => { @@ -69,6 +69,7 @@ const editTask = (item: any) => { const toRemoteControl = (item: any) => { // 如果当前任务是已连接状态则跳转,否则打开弹窗 if (item.isRemote) { + remoteWsStore.setCurrentTaskIndex(item.index) router.push('/remote-manage/remote-control') } else { remoteDialogRef.value.open(item.index) diff --git a/src/views/remote-manage/remote-thumbnail.vue b/src/views/remote-manage/remote-thumbnail.vue index 29c0db8..c14f803 100644 --- a/src/views/remote-manage/remote-thumbnail.vue +++ b/src/views/remote-manage/remote-thumbnail.vue @@ -39,7 +39,7 @@ const remoteTask = ref([] as any); const remoteWsStore = useRemoteWsStore(); onMounted(() => { - remoteTask.value = remoteWsStore.remoteTasks; + remoteTask.value = remoteWsStore.getRemoteTask(); }) const openRemote = (params: any) => {