diff --git a/src/api/file-upload.ts b/src/api/file-upload.ts index 7bb65ce..a290416 100644 --- a/src/api/file-upload.ts +++ b/src/api/file-upload.ts @@ -24,24 +24,52 @@ export function handleHttpUpload(options: any) { }) } +// export function handleHttpUploadUrl(options: any, url: string | undefined) { +// let formData = new FormData(); +// formData.append('file', options.file); +// formData.append('dir', options.dir) +// return new Promise((resolve) => { +// try { +// request({ +// url: url, +// method: 'post', +// headers: { +// 'Content-Type': 'multipart/form-data', +// }, +// data: formData, +// }).then((res: any) => { +// resolve(res.data) +// }); +// } catch (error) { +// resolve(error) +// } +// }) +// } + export function handleHttpUploadUrl(options: any, url: string | undefined) { let formData = new FormData(); formData.append('file', options.file); - formData.append('dir', options.dir) - return new Promise((resolve) => { - try { - request({ - url: url, - method: 'post', - headers: { - 'Content-Type': 'multipart/form-data', - }, - data: formData, - }).then((res: any) => { - resolve(res.data) - }); - } catch (error) { - resolve(error) - } - }) -} \ No newline at end of file + formData.append('dir', options.dir); + + return new Promise((resolve, reject) => { // 使用 reject 来处理错误 + request({ + url: url, + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data', + }, + data: formData, + }).then((res: any) => { + if (res.data && res.data.code !== 0) { + // 如果返回的 code 不为 0,拒绝 Promise + reject(res.data); + } else { + // console.log(res.message); + resolve(res.message); + } + }).catch((error) => { + // 网络请求遇到其他错误时也拒绝 Promise + reject(error); + }); + }); +} diff --git a/src/assets/medical.mp4 b/src/assets/medical.mp4 deleted file mode 100644 index 89fc390..0000000 Binary files a/src/assets/medical.mp4 and /dev/null differ diff --git a/src/components/import-dialog.vue b/src/components/import-dialog.vue index 3d75714..889bc56 100644 --- a/src/components/import-dialog.vue +++ b/src/components/import-dialog.vue @@ -1,23 +1,23 @@ diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts index b3d099c..a523121 100644 --- a/src/stores/remote-ws-store.ts +++ b/src/stores/remote-ws-store.ts @@ -3,14 +3,14 @@ import {Session} from "@/utils/storage"; import {ElMessage} from "element-plus"; // 本地调试版本: -// 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() +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() // 服务器部署版本 -const vitalUrl = "wss://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() -// const medicineUrl = "wss://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() -const chatUrl = "wss://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() +// const vitalUrl = "wss://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +// // const medicineUrl = "wss://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +// const chatUrl = "wss://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() // 测试echars // const vitalUrl = "wss://" + "110.41.142.124" + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue index 466a4f1..9cb66c1 100644 --- a/src/views/remote-manage/remote-control.vue +++ b/src/views/remote-manage/remote-control.vue @@ -9,8 +9,8 @@ @exception-event="vitalExcepEvent"> - +
@@ -23,33 +23,28 @@ :src="heartAlarm ? imgHeartAlarm : imgHeart">
-
- - 开始 - -
- AI给药 - 人工给药 -
-
+ + + + + + + + +
-
- - - 病人尿量(ml):500 - - - 患者信息 - 当前延迟:{{ timeDiffPing }}ms - 连接远程控制 - - +
+ + + + + + 患者信息 + +
@@ -66,144 +61,136 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
  • - {{ item.content }} - + {{ item.msg }}
- - 发送消息 - 录音 -
-
- - 正在录音... {{ remainingTime }} 秒剩余 + + 发送消息
+ + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - + + + + + + + +
- - - - - - - - - - - + + + + + +
@@ -220,18 +207,16 @@ - +