mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
医生删除
This commit is contained in:
parent
fdea342eec
commit
fddc1b5d25
|
@ -8,7 +8,7 @@ const editPasswordUrl = '/admin/user/password'
|
||||||
|
|
||||||
const userPageUrl = '/admin/user/page'
|
const userPageUrl = '/admin/user/page'
|
||||||
|
|
||||||
const addUserUrl = '/admin/user'
|
const userUrl = '/admin/user'
|
||||||
|
|
||||||
const modifyPwUrl = "/admin/user/modifyPw"
|
const modifyPwUrl = "/admin/user/modifyPw"
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ export function userPage(data: any) {
|
||||||
|
|
||||||
export function addUser(data: any) {
|
export function addUser(data: any) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
postData(addUserUrl, data).then((res: any) => {
|
postData(userUrl, data).then((res: any) => {
|
||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
@ -93,7 +93,7 @@ export function modifyPw(data: any) {
|
||||||
export function updateUI(data: any) {
|
export function updateUI(data: any) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
request({
|
request({
|
||||||
url: addUserUrl,
|
url: userUrl,
|
||||||
method: "put",
|
method: "put",
|
||||||
data
|
data
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
|
@ -103,3 +103,17 @@ export function updateUI(data: any) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function deleteU(ids: any[]) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request({
|
||||||
|
url: userUrl,
|
||||||
|
method: "delete",
|
||||||
|
data: ids
|
||||||
|
}).then((res: any) => {
|
||||||
|
resolve(true)
|
||||||
|
}).catch(error => {
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
:disabled="scope.row.lockFlag == 1">密码</el-button>
|
:disabled="scope.row.lockFlag == 1">密码</el-button>
|
||||||
<el-button link icon="EditPen" @click="editData(scope.row)"
|
<el-button link icon="EditPen" @click="editData(scope.row)"
|
||||||
:disabled="scope.row.lockFlag == 1">修改</el-button>
|
:disabled="scope.row.lockFlag == 1">修改</el-button>
|
||||||
<el-button link icon="Delete" @click="removeData(scope.row)"
|
<el-button link icon="Delete" @click="removeData([scope.row])"
|
||||||
:disabled="scope.row.lockFlag == 1">删除</el-button>
|
:disabled="scope.row.lockFlag == 1">删除</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -74,7 +74,7 @@ import {exportData, tableRemoveRow} from '@/utils/table-util'
|
||||||
import CommonPagination from '@/components/common-pagination.vue'
|
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 {modifyPw, updateUserInfo, userPage} from "@/api/user";
|
import {deleteU, modifyPw, updateUserInfo, userPage} from "@/api/user";
|
||||||
|
|
||||||
const tableRef = ref()
|
const tableRef = ref()
|
||||||
const doctorFormRef = ref()
|
const doctorFormRef = ref()
|
||||||
|
@ -138,11 +138,20 @@ const importData = () => {
|
||||||
}
|
}
|
||||||
const removeData = (e?: any) => {
|
const removeData = (e?: any) => {
|
||||||
const selectRow = e || tableRef.value.getSelectionRows()
|
const selectRow = e || tableRef.value.getSelectionRows()
|
||||||
|
|
||||||
tableRemoveRow({data: selectRow}, (res: boolean) => {
|
tableRemoveRow({data: selectRow}, (res: boolean) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
const index = tableData.value.findIndex((item: any) => item === selectRow)
|
const index = tableData.value.findIndex((item: any) => item === selectRow)
|
||||||
tableData.value.splice(index, 1)
|
tableData.value.splice(index, 1)
|
||||||
// console.log('调用删除', selectRow, index)
|
const ids: any = [];
|
||||||
|
selectRow.forEach((row: any) => {
|
||||||
|
ids.push(row.userId)
|
||||||
|
})
|
||||||
|
deleteU(ids).then(res => {
|
||||||
|
ElMessage.success("删除成功")
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.error("删除失败")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="remote-manage-page">
|
<div class="remote-manage-page">
|
||||||
<button @click="getSurgeryData">123</button>
|
<button @click="getSurgeryData">123</button>
|
||||||
<button @click="disconnectSurgeryData">断开</button>
|
<button @click="disconnectSurgeryData">断开</button>
|
||||||
|
<button @click="sendMsg">发送消息</button>
|
||||||
|
<button @click="closeChat">关闭消息</button>
|
||||||
|
<button @click="addMedicine">给药</button>
|
||||||
|
<button @click="closeAddMedicineWS">关闭给药</button>
|
||||||
<div class="header-box">
|
<div class="header-box">
|
||||||
<div class="thumbnail" @click="viewThumbnail">
|
<div class="thumbnail" @click="viewThumbnail">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
|
@ -150,9 +154,6 @@ const addLogAfter = () => {
|
||||||
|
|
||||||
const ws = new WebSocket("ws://localhost:5173/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken());
|
const ws = new WebSocket("ws://localhost:5173/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken());
|
||||||
|
|
||||||
ws.onopen = function () {
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSurgeryData() {
|
function getSurgeryData() {
|
||||||
const params = {
|
const params = {
|
||||||
patientName: "1111111",
|
patientName: "1111111",
|
||||||
|
@ -170,6 +171,48 @@ ws.onmessage = function (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const chatws = new WebSocket("ws://localhost:5173/socket.io/admin/rax/chatRoom?token=" + Session.getToken());
|
||||||
|
|
||||||
|
function sendMsg() {
|
||||||
|
const params = {
|
||||||
|
patientName: "1111111",
|
||||||
|
idNum: "123567890",
|
||||||
|
date: "20230505",
|
||||||
|
msg: "测试消息"
|
||||||
|
}
|
||||||
|
chatws.send(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
|
||||||
|
chatws.onmessage = function (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeChat() {
|
||||||
|
chatws.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
const addMedicineWS = new WebSocket("ws://localhost:5173/socket.io/admin/rax/addMedicine?token=" + Session.getToken())
|
||||||
|
|
||||||
|
function addMedicine() {
|
||||||
|
const params = {
|
||||||
|
patientName: "1111111",
|
||||||
|
idNum: "123567890",
|
||||||
|
date: "20230505",
|
||||||
|
flag: "2",
|
||||||
|
medicine: "丙泊酚",
|
||||||
|
value: "1"
|
||||||
|
}
|
||||||
|
addMedicineWS.send(JSON.stringify(params))
|
||||||
|
}
|
||||||
|
|
||||||
|
addMedicineWS.onmessage = function (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeAddMedicineWS() {
|
||||||
|
addMedicineWS.close()
|
||||||
|
}
|
||||||
|
|
||||||
/*const surgeryClient = new Client({
|
/*const surgeryClient = new Client({
|
||||||
brokerURL: 'ws://localhost:5173/socket.io/admin/rax/SurgeryData',
|
brokerURL: 'ws://localhost:5173/socket.io/admin/rax/SurgeryData',
|
||||||
connectHeaders: {
|
connectHeaders: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user