This commit is contained in:
ChenQiuYu 2025-04-25 17:08:43 +08:00
parent 853f552ae4
commit 9bddab3122
4 changed files with 49 additions and 26 deletions

View File

@ -2,10 +2,12 @@ export enum apiConfig{
/**
*
*/
"ManagerLogin"="manager/manager/login",//登录
"ManagerLogin"="manager/user/login",//登录
"signUp"="signUp/signUp",//签到
/**
*
*/
"DoctorDetail" ="medical/record/getDetailByRegisId"//详情
"DoctorDetail" ="medical/record/getDetailByRegisId",//详情
"DoctorList" ="registration/getListByType",//患者列表
}

View File

@ -43,6 +43,7 @@ import {onMounted, ref, watch} from "vue";
import Panel from "@/components/common/Panel.vue";
import {post} from "@/utils/request.ts";
import {formatTime} from "@/utils/dateUtils.ts";
import {apiConfig} from "@/assets/config/apiConfig.ts";
const props = defineProps({
status: {
@ -86,7 +87,7 @@ onMounted(() => {
init()
})
const init = () => {
post('registration/getListByType', {
post(apiConfig.DoctorList, {
query: {
status: props.status,
}

View File

@ -1,10 +1,13 @@
<script setup lang="ts">
import {ref} from 'vue'
import {onMounted, onUnmounted, ref} from 'vue'
import {post} from '@/utils/request.ts'
import {useRouter} from "vue-router";
import {ElMessage} from "element-plus";
import Mask from "@/components/common/Mask.vue";
import Auth from "@/components/manger/Auth.vue";
import {apiConfig} from "@/assets/config/apiConfig";
import type {Request, Response} from "@/utils/ws.ts";
import {useWsStore} from "@/stores/wsStore.ts";
const username = ref('')
const password = ref('')
@ -12,19 +15,41 @@ const rememberMe = ref(false)
const router = useRouter();
const handleLogin = () => {
post("manager/user/login", {username: username.value, password: password.value}).then((token: any) => {
post(apiConfig.ManagerLogin, {username: username.value, password: password.value}).then((token: any) => {
localStorage.setItem('token', token)
ElMessage({
message: "登录成功,即将为您跳转到首页",
type: 'success',
duration: 1000,
onClose: () => {
router.push("/home/index")
}
})
getNetwork()
// ElMessage({
// message: "",
// type: 'success',
// duration: 1000,
// onClose: () => {
// router.push("/home/index")
// }
// })
})
}
const wsStore = useWsStore();
const reciceMessage = (response: Response) => {
post(apiConfig.signUp, {mac:response.Data[0].MACAddress,ip:response.Data[0].IPAddress})
}
const getNetwork = () => {
let data: any = {}
let request: Request = {
type: "getNetwork",
config: {},
data: data
}
wsStore.sendMessage(request);
}
onMounted(async () => {
wsStore.setMessageCallback(reciceMessage)
});
onUnmounted(() => {
wsStore.removeAllMessageCallback()
})
const isShowAuth = ref(false)
const showAuth = () => {
isShowAuth.value = true
@ -232,6 +257,7 @@ const showAuth = () => {
position: relative;
margin-bottom: 1.5rem;
}
.input-icon {
position: absolute;
left: 1rem;
@ -278,9 +304,11 @@ const showAuth = () => {
text-decoration: underline;
}
}
.button{
.button {
display: flex;
}
.login-button {
flex: 1;
padding: 1rem;
@ -301,7 +329,8 @@ const showAuth = () => {
transform: translateY(0);
}
}
.auth-button{
.auth-button {
flex: 1;
margin-left: 10px;
padding: 1rem;
@ -313,6 +342,7 @@ const showAuth = () => {
font-weight: 600;
cursor: pointer;
transition: transform 0.2s ease;
&:hover {
transform: translateY(-2px);
}
@ -321,6 +351,7 @@ const showAuth = () => {
transform: translateY(0);
}
}
.register-link {
text-align: center;
margin-top: 1.5rem;

View File

@ -59,17 +59,6 @@ let content: any = ref(null);
const loading = ref(false)
let uploadMsg= ref('')
const uploadNumber=ref()
const svg = `
<path class="path" d="
M 30 15
L 28 17
M 25.61 25.61
A 15 15, 0, 0, 1, 15 30
A 15 15, 0, 1, 1, 27.99 7.5
L 15 15
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
`
onMounted(() => {
init()
});