dev
This commit is contained in:
parent
853f552ae4
commit
9bddab3122
|
|
@ -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",//患者列表
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -43,6 +43,7 @@ import {onMounted, ref, watch} from "vue";
|
||||||
import Panel from "@/components/common/Panel.vue";
|
import Panel from "@/components/common/Panel.vue";
|
||||||
import {post} from "@/utils/request.ts";
|
import {post} from "@/utils/request.ts";
|
||||||
import {formatTime} from "@/utils/dateUtils.ts";
|
import {formatTime} from "@/utils/dateUtils.ts";
|
||||||
|
import {apiConfig} from "@/assets/config/apiConfig.ts";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
status: {
|
status: {
|
||||||
|
|
@ -86,7 +87,7 @@ onMounted(() => {
|
||||||
init()
|
init()
|
||||||
})
|
})
|
||||||
const init = () => {
|
const init = () => {
|
||||||
post('registration/getListByType', {
|
post(apiConfig.DoctorList, {
|
||||||
query: {
|
query: {
|
||||||
status: props.status,
|
status: props.status,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref} from 'vue'
|
import {onMounted, onUnmounted, ref} from 'vue'
|
||||||
import {post} from '@/utils/request.ts'
|
import {post} from '@/utils/request.ts'
|
||||||
import {useRouter} from "vue-router";
|
import {useRouter} from "vue-router";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
import Mask from "@/components/common/Mask.vue";
|
import Mask from "@/components/common/Mask.vue";
|
||||||
import Auth from "@/components/manger/Auth.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 username = ref('')
|
||||||
const password = ref('')
|
const password = ref('')
|
||||||
|
|
@ -12,19 +15,41 @@ const rememberMe = ref(false)
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const handleLogin = () => {
|
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)
|
localStorage.setItem('token', token)
|
||||||
ElMessage({
|
getNetwork()
|
||||||
message: "登录成功,即将为您跳转到首页",
|
|
||||||
type: 'success',
|
// ElMessage({
|
||||||
duration: 1000,
|
// message: "登录成功,即将为您跳转到首页",
|
||||||
onClose: () => {
|
// type: 'success',
|
||||||
router.push("/home/index")
|
// 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 isShowAuth = ref(false)
|
||||||
const showAuth = () => {
|
const showAuth = () => {
|
||||||
isShowAuth.value = true
|
isShowAuth.value = true
|
||||||
|
|
@ -232,6 +257,7 @@ const showAuth = () => {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-icon {
|
.input-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 1rem;
|
left: 1rem;
|
||||||
|
|
@ -278,9 +304,11 @@ const showAuth = () => {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.button{
|
|
||||||
|
.button {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-button {
|
.login-button {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
|
@ -301,7 +329,8 @@ const showAuth = () => {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.auth-button{
|
|
||||||
|
.auth-button {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
|
@ -313,6 +342,7 @@ const showAuth = () => {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s ease;
|
transition: transform 0.2s ease;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
}
|
}
|
||||||
|
|
@ -321,6 +351,7 @@ const showAuth = () => {
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-link {
|
.register-link {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
|
|
|
||||||
|
|
@ -59,17 +59,6 @@ let content: any = ref(null);
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
let uploadMsg= ref('')
|
let uploadMsg= ref('')
|
||||||
const uploadNumber=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(() => {
|
onMounted(() => {
|
||||||
init()
|
init()
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue