This commit is contained in:
姚宇浩 2024-05-22 15:12:28 +08:00
parent e61db70465
commit 0d6eae17ca
3 changed files with 122 additions and 74 deletions

View File

@ -71,27 +71,27 @@ function getCookie(cname) {
// return '' // return ''
} }
router.beforeEach((to, form, next) => { // router.beforeEach((to, form, next) => {
var token = getCookie('lytoken') // var token = getCookie('lytoken')
console.log('token', token) // console.log('token', token)
if (token == '') { // if (token == '') {
window.location.href = // window.location.href =
'http://220.191.238.50:996/api/login?returnURL=' + // 'http://220.191.238.50:996/api/login?returnURL=' +
window.location.href // window.location.href
} else { // } else {
// http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => { // // http.get("/api/zzdn_event/auditToken?token=" + token).then((res) => {
// if (res.code == '500') { // // if (res.code == '500') {
// window.location.href = // // window.location.href =
// 'http://220.191.238.50:996/api/login?returnURL=' + // // 'http://220.191.238.50:996/api/login?returnURL=' +
// window.location.href // // window.location.href
// } else { // // } else {
// tools.data.set('token',token) // // tools.data.set('token',token)
// next(); // // next();
// } // // }
// }); // // });
tools.data.set('token', token) // tools.data.set('token', token)
next(); // next();
} // }
}) // })
export default router export default router

View File

@ -21,34 +21,34 @@ axios.interceptors.request.use(
); );
// HTTP response 拦截器 // HTTP response 拦截器
axios.interceptors.response.use( // axios.interceptors.response.use(
(response) => { // (response) => {
return response; // return response;
}, // },
(error) => { // (error) => {
if (error.response) { // if (error.response) {
if (error.response.status == 401) { // if (error.response.status == 401) {
ElMessage.error("请重新登录!"); // ElMessage.error("请重新登录!");
// window.location.href = '/#/login?returnURL=' + window.location.href // // window.location.href = '/#/login?returnURL=' + window.location.href
window.location.href = // window.location.href =
'http://220.191.238.50:996/api/login?returnURL=' + // 'http://220.191.238.50:996/api/login?returnURL=' +
window.location.href // window.location.href
} else if (error.response.status == 404) { // } else if (error.response.status == 404) {
ElMessage.error("Status:404正在请求不存在的服务器记录"); // ElMessage.error("Status:404正在请求不存在的服务器记录");
} else if (error.response.status == 500) { // } else if (error.response.status == 500) {
ElMessage.error({ // ElMessage.error({
title: '请求错误', // title: '请求错误',
message: "Status:500服务器发生错误" // message: "Status:500服务器发生错误"
}); // });
} else { // } else {
ElMessage.error(`Status:${error.response.status},未知错误!`); // ElMessage.error(`Status:${error.response.status},未知错误!`);
} // }
} else { // } else {
ElMessage.error("请求服务器无响应!"); // ElMessage.error("请求服务器无响应!");
} // }
return Promise.reject(error.response); // return Promise.reject(error.response);
} // }
); // );
var http = { var http = {

View File

@ -30,16 +30,24 @@
/> />
</span> </span>
</div> </div>
<ePie v-if="leftchoose.first == '1'" :list='data.medicalInsurance.ffrc' :year='data.medicalInsurance.year'></ePie> <ePie
<ePie2 v-else :list='data.medicalInsurance.ffje' :year='data.medicalInsurance.year'></ePie2> v-if="leftchoose.first == '1'"
:list="data.medicalInsurance.ffrc"
:year="data.medicalInsurance.year"
></ePie>
<ePie2
v-else
:list="data.medicalInsurance.ffje"
:year="data.medicalInsurance.year"
></ePie2>
</div> </div>
<div class="flex1" style="margin-top: 10px"> <div class="flex1" style="margin-top: 10px">
<div class="yd_title left_3"></div> <div class="yd_title left_3"></div>
<div class="sm_title_1"></div> <div class="sm_title_1"></div>
<tnb :list='data.lmb.tnbrs' :year='data.lmb.year'></tnb> <tnb :list="data.lmb.tnbrs" :year="data.lmb.year"></tnb>
<div class="sm_title_2"></div> <div class="sm_title_2"></div>
<gxy :list='data.lmb.gxyrs' :year='data.lmb.year'></gxy> <gxy :list="data.lmb.gxyrs" :year="data.lmb.year"></gxy>
</div> </div>
</div> </div>
<div class="displayFlex center_bg"> <div class="displayFlex center_bg">
@ -51,7 +59,7 @@
<div class="right"> <div class="right">
<div class="right_top">门急诊人次</div> <div class="right_top">门急诊人次</div>
<img src="@/assets/images/hygiene/jt.png" class="right_center" /> <img src="@/assets/images/hygiene/jt.png" class="right_center" />
<div class="right_bottom">{{data.mz.mjzrc}}</div> <div class="right_bottom">{{ data.mz.mjzrc }}</div>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
@ -59,7 +67,7 @@
<div class="right"> <div class="right">
<div class="right_top">住院人数</div> <div class="right_top">住院人数</div>
<img src="@/assets/images/hygiene/jt.png" class="right_center" /> <img src="@/assets/images/hygiene/jt.png" class="right_center" />
<div class="right_bottom">{{data.mz.zyrs}}</div> <div class="right_bottom">{{ data.mz.zyrs }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -96,7 +104,7 @@
<div class="yd_title familyPlanning"></div> <div class="yd_title familyPlanning"></div>
<!-- 计划生育 --> <!-- 计划生育 -->
<!-- <div style="width: 100%; "> --> <!-- <div style="width: 100%; "> -->
<eP5 :list='data.jsbgl'></eP5> <eP5 :list="data.jsbgl"></eP5>
<!-- </div> --> <!-- </div> -->
</div> </div>
</div> </div>
@ -105,12 +113,12 @@
<div class="yd_title mechanism"></div> <div class="yd_title mechanism"></div>
<div class="history"> <div class="history">
<div class="history1"> <div class="history1">
<div class="va">{{data.fyglrs.ycfrc}}</div> <div class="va">{{ data.fyglrs.ycfrc }}</div>
<img src="@/assets/images/hygiene/yf.png" alt="" /> <img src="@/assets/images/hygiene/yf.png" alt="" />
<div class="historyimg">孕产妇系统管理人数</div> <div class="historyimg">孕产妇系统管理人数</div>
</div> </div>
<div class="history1"> <div class="history1">
<div class="va">{{data.fyglrs.etrs}}</div> <div class="va">{{ data.fyglrs.etrs }}</div>
<img src="@/assets/images/hygiene/et.png" alt="" /> <img src="@/assets/images/hygiene/et.png" alt="" />
<div class="historyimg">0-6岁儿童系统管理人数</div> <div class="historyimg">0-6岁儿童系统管理人数</div>
</div> </div>
@ -118,13 +126,19 @@
</div> </div>
<div class="flex1" style="flex: 1.1"> <div class="flex1" style="flex: 1.1">
<div class="yd_title service"></div> <div class="yd_title service"></div>
<eP7 :list='data.jktj.jktjrs' :year='data.jktj.year'></eP7> <eP7 :list="data.jktj.jktjrs" :year="data.jktj.year"></eP7>
</div> </div>
<div class="flex1"> <div class="flex1">
<div class="yd_title last"></div> <div class="yd_title last"></div>
<div class="table"> <div
class="t"
@mouseenter="stopAutoScroll"
@mouseleave="startAutoScroll"
>
<div class="table" ref="mainRef">
<div class="item" v-for="item in data.jkhd"> <div class="item" v-for="item in data.jkhd">
{{item.jkhd }} {{ item.jkhd }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -144,7 +158,7 @@ import eP4 from "./echarts_hygiene/eP4.vue";
import eP4_1 from "./echarts_hygiene/eP4_1.vue"; import eP4_1 from "./echarts_hygiene/eP4_1.vue";
import tnb from "./echarts_hygiene/tnb.vue"; import tnb from "./echarts_hygiene/tnb.vue";
import gxy from "./echarts_hygiene/gxy.vue"; import gxy from "./echarts_hygiene/gxy.vue";
import { ref,reactive, onMounted, onBeforeMount } from "vue"; import { ref, reactive, onMounted, onBeforeMount } from "vue";
import http from "@/utils/request.js"; import http from "@/utils/request.js";
const leftchoose = ref({ const leftchoose = ref({
first: "1", first: "1",
@ -155,18 +169,52 @@ const change = (name, index) => {
leftchoose.value[name] = index; leftchoose.value[name] = index;
}; };
const data = reactive({ const data = reactive({
medicalInsurance:{},// medicalInsurance: {}, //
lmb:{},// lmb: {}, //
mz:{},// mz: {}, //
jkda:[],// jkda: [], //
jsbgl:[],// jsbgl: [], //
fyglrs:{},// fyglrs: {}, //
jktj:{},//65 jktj: {}, //65
jkhd:[],// jkhd: [], //
}) });
onBeforeMount( async () => { //
const mainRef = ref(null);
let isAutoScrolling = true;
const stopAutoScroll = () => {
isAutoScrolling = false;
};
const startAutoScroll = () => {
isAutoScrolling = true;
autoScroll();
};
const autoScroll = () => {
if (!isAutoScrolling) return;
const mainEl = mainRef.value;
mainEl.scrollTop += 1; //
if (mainEl.scrollTop+1 >= mainEl.scrollHeight - mainEl.clientHeight) {
setTimeout(() => {
mainEl.scrollTo({ top: 0, behavior: "smooth" });
setTimeout(autoScroll, 2000); // 2
}, 1000); // 1
} else {
requestAnimationFrame(autoScroll);
}
};
onBeforeMount(async () => {
getData(); getData();
}); });
onMounted(() => {
startAutoScroll();
console.log(mainRef.value.scrollTop,mainRef.value.scrollHeight,mainRef.value.clientHeight);
});
const getData = async () => { const getData = async () => {
await http.get("/api/ggfwyth/health").then((res) => { await http.get("/api/ggfwyth/health").then((res) => {
if (res.code == 200) { if (res.code == 200) {