update
This commit is contained in:
+9
-1
@@ -36,10 +36,18 @@ const routes: Array<RouteRecordRaw> = [
|
||||
path: '/yinChuanHome',
|
||||
name: 'yinChuanHome',
|
||||
meta: {
|
||||
title: '副屏',
|
||||
title: '银川片应急就医',
|
||||
},
|
||||
component: () => import('/@/views/yinChuan/yinChuan.vue'),
|
||||
},
|
||||
{
|
||||
path: '/yinChuanTest',
|
||||
name: 'yinChuanTest',
|
||||
meta: {
|
||||
title: '银川片应急就医',
|
||||
},
|
||||
component: () => import('/@/views/yinChuanTest/yinChuanTest.vue'),
|
||||
},
|
||||
{
|
||||
path: '/secondScreen',
|
||||
name: 'secondScreen',
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div class="common-card" :class="[themeType]">
|
||||
<public-title title="服务详情数据" :themeType="themeType" />
|
||||
<div class="inner">
|
||||
<div class="type-time">
|
||||
<span
|
||||
v-for="(item, index) in typeTime"
|
||||
:key="index"
|
||||
:class="[selectIndex === index ? 'select' : 'unSelect', themeType]"
|
||||
@click="handleSelect(index, item.value)"
|
||||
>{{ item.name }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="server-container">
|
||||
<div
|
||||
v-for="(item, index) in statistics"
|
||||
:key="index"
|
||||
class="server-item"
|
||||
:class="[['gross', 'alerdyreceive'].includes(item.key) ? 'hasCursor' : '', themeType]"
|
||||
@click="handleClick(item)"
|
||||
>
|
||||
<span>{{ item?.name }}</span>
|
||||
<span>{{ item?.value }}</span>
|
||||
</div>
|
||||
<a-spin :spinning="spinning" class="spin"></a-spin>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { list } from '/@/components/body-d-left/left.api';
|
||||
import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
import { useDetailStore } from '/@/store/modules/detailData.ts';
|
||||
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { useTheme } from '/@/hooks/theme/useTheme.ts';
|
||||
import { left1 } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const { themeType } = useTheme();
|
||||
const { LEFT_KEY1 } = caching;
|
||||
const props = defineProps({
|
||||
refreshState: {
|
||||
type: Boolean,
|
||||
},
|
||||
setting: {
|
||||
type: Object,
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['handleClick']);
|
||||
const typeTime = ref(timeTab);
|
||||
const { statistics, setStatistics, getStatistics } = useStatistics();
|
||||
const selectIndex = ref(0);
|
||||
const selectVal = ref('2'); //本年
|
||||
const { setSpin, spinning } = useSpin();
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
const useDetail = useDetailStore();
|
||||
const { setSession, getSession } = useSession();
|
||||
|
||||
async function getList() {
|
||||
setSpin(true);
|
||||
try {
|
||||
const { code, result } = left1;
|
||||
setSpin(false);
|
||||
if (code != 200 || !result) {
|
||||
return;
|
||||
}
|
||||
setSession(LEFT_KEY1, JSON.stringify(result));
|
||||
setValue(result);
|
||||
} catch {
|
||||
setSpin(false);
|
||||
const result = JSON.parse(getSession(LEFT_KEY1));
|
||||
setValue(result);
|
||||
}
|
||||
}
|
||||
|
||||
function setValue(result = {}) {
|
||||
let { alerdyreceive = '', totalacceptance = '' } = result;
|
||||
setStatistics(result);
|
||||
if (alerdyreceive || totalacceptance) {
|
||||
useDetail.setAlerdyreceive(alerdyreceive);
|
||||
useDetail.setTotalacceptance(totalacceptance);
|
||||
}
|
||||
}
|
||||
|
||||
function handleSelect(index: number, value: string) {
|
||||
selectIndex.value = index;
|
||||
selectVal.value = value;
|
||||
getList();
|
||||
}
|
||||
|
||||
function handleClick(item) {
|
||||
emit('handleClick', item);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.refreshState,
|
||||
() => {
|
||||
getList();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
|
||||
.server-container {
|
||||
color: #fff;
|
||||
padding-top: 10px;
|
||||
height: 88%;
|
||||
display: grid;
|
||||
align-items: start;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
|
||||
.spin {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.server-item {
|
||||
font-size: 16px;
|
||||
padding: 6px 6% 6px 5%;
|
||||
|
||||
&.hasCursor {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="terminal-container common-card" :class="[themeType]">
|
||||
<public-title title="健康终端报警" :themeType="themeType">
|
||||
<template #right>
|
||||
<!-- <span class="right-text" :class="[themeType]" @click="viewDetail">查看详情</span>-->
|
||||
</template>
|
||||
</public-title>
|
||||
<div class="inner">
|
||||
<vue3-seamless-scroll :list="scrollList" class="scroll" :hover="true" :limitScrollNum="4" v-bind="classOption">
|
||||
<div class="item right-top-item" :class="themeType" v-for="(item, i) in scrollList" :key="i">
|
||||
<span class="fixed-width" :title="item?.realName">{{ item?.realName }}</span>
|
||||
<span class="fixed-width" :title="item?.eventType_dictText">{{ item?.eventType_dictText }}</span>
|
||||
<div class="time-icon">
|
||||
<span>{{ item?.warnTime }}</span>
|
||||
<span class="terminal-icon" @click="handlePolice(item)" title="健康报警员工信息"></span>
|
||||
<span class="position" @click="sendPosition(item)" title="员工定位"></span>
|
||||
</div>
|
||||
</div>
|
||||
</vue3-seamless-scroll>
|
||||
</div>
|
||||
<Dialog :openVis="openInfor" width="30%" title="健康报警员工信息" @close="handlePoliceClose">
|
||||
<template #container>
|
||||
<div class="police-con" :class="[themeType]">
|
||||
<div class="con-item">
|
||||
<div>姓名:</div>
|
||||
<div>{{ userInfo?.realName }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>二级单位:</div>
|
||||
<div>{{ userInfo?.orgName1 }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>手机号码:</div>
|
||||
<div>{{ userInfo?.phone }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>异常事件:</div>
|
||||
<div>{{ userInfo?.eventType_dictText }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>异常值:</div>
|
||||
<div>{{ userInfo?.dataValue }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>发生时间:</div>
|
||||
<div>{{ userInfo?.warnTime }}</div>
|
||||
</div>
|
||||
<div class="con-item">
|
||||
<div>发生地点:</div>
|
||||
<div v-if="userInfo?.address">{{ userInfo?.address }}</div>
|
||||
<div style="color: #eb3636" v-else>{{ userInfo?.gpsErrorMsg }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import Dialog from '/@/components/dialog/Dialog.vue';
|
||||
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
|
||||
import { Map } from '/@/assets/mapUtils/map.ts';
|
||||
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { DataType } from '/@/utils/settings.ts';
|
||||
import { useTheme } from '/@/hooks/theme/useTheme.ts';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { right1 } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const props = defineProps({
|
||||
setting: Object,
|
||||
});
|
||||
const { themeType } = useTheme();
|
||||
const emit = defineEmits(['emit-view-detail']);
|
||||
const router = useRouter();
|
||||
const { setSession, getSession } = useSession();
|
||||
const { RIGHT_KEY1 } = caching;
|
||||
|
||||
const classOption = ref({
|
||||
step: 0.3, // 速度
|
||||
});
|
||||
const openInfor = ref<boolean>(false); //弹窗显示
|
||||
const userInfo = ref({
|
||||
realName: '',
|
||||
orgName1: '',
|
||||
phone: '',
|
||||
eventType_dictText: '',
|
||||
warnTime: '',
|
||||
address: '',
|
||||
dataValue: '',
|
||||
});
|
||||
onMounted(() => {
|
||||
getScrollList();
|
||||
});
|
||||
|
||||
/**
|
||||
* @desc open员工信息
|
||||
*/
|
||||
function handlePolice(item) {
|
||||
userInfo.value = item;
|
||||
openInfor.value = true;
|
||||
classOption.value.step = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc close员工信息
|
||||
*/
|
||||
function handlePoliceClose() {
|
||||
openInfor.value = false;
|
||||
classOption.value.step = 0.3;
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc 终端报警
|
||||
* */
|
||||
const scrollList = ref([]);
|
||||
|
||||
async function getScrollList() {
|
||||
try {
|
||||
const { code, result } = right1;
|
||||
if (code == 200) {
|
||||
setSession(RIGHT_KEY1, JSON.stringify(result.records));
|
||||
scrollList.value = result.records;
|
||||
}
|
||||
} catch {
|
||||
scrollList.value = JSON.parse(getSession(RIGHT_KEY1));
|
||||
}
|
||||
}
|
||||
|
||||
function sendPosition(item) {
|
||||
let { lon, lat } = item;
|
||||
if (lon && lat) {
|
||||
Map.createMarker(item, () => {
|
||||
handlePolice(item);
|
||||
});
|
||||
} else {
|
||||
message.warn('暂无经纬度信息!');
|
||||
}
|
||||
}
|
||||
|
||||
function viewDetail() {
|
||||
if (props.setting.dataType == DataType.xian) {
|
||||
router.push({ path: '/secondScreen' });
|
||||
}
|
||||
if (props.setting.dataType == DataType.yinChuan) {
|
||||
emit('emit-view-detail');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.right-text {
|
||||
font-weight: 100;
|
||||
cursor: pointer;
|
||||
margin-right: 3px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.right-text.light {
|
||||
color: #667ecc;
|
||||
}
|
||||
|
||||
.right-text:hover {
|
||||
color: #129bff;
|
||||
}
|
||||
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.scroll {
|
||||
width: 98%;
|
||||
height: 88%;
|
||||
overflow: hidden;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 3% 0;
|
||||
|
||||
.time-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.terminal-icon {
|
||||
margin-left: 15px;
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-size: 100% 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.position {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-size: 100% 100%;
|
||||
margin-left: 5px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.police-con {
|
||||
padding: 2% 0 2% 5%;
|
||||
|
||||
.con-item {
|
||||
padding: 1.3% 0;
|
||||
display: flex;
|
||||
|
||||
div:nth-child(1) {
|
||||
font-weight: bold;
|
||||
width: 100px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div:nth-child(2) {
|
||||
width: calc(100% - 100px);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!--<style lang="less">-->
|
||||
<!-- .dialog-con {-->
|
||||
<!-- background-color: #00152b;-->
|
||||
<!-- // antd表格样式-->
|
||||
<!-- .ant-table-thead > tr > th {-->
|
||||
<!-- //border-bottom: 1px solid #1e73c2 !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .ant-table-body {-->
|
||||
<!-- background-color: #00152b !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .ant-modal-header {-->
|
||||
<!-- border-bottom: none !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .ant-table-tbody > tr > td {-->
|
||||
<!-- border-bottom: 1px solid #1e73c2 !important;-->
|
||||
<!-- background-color: #00152b !important;-->
|
||||
<!-- color: #ffffff !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .ant-table-tbody > tr.ant-table-row:hover > td,-->
|
||||
<!-- .ant-table-tbody > tr > td.ant-table-cell-row-hover,-->
|
||||
<!-- .ant-table-thead > tr > th {-->
|
||||
<!-- background-color: #00152b !important;-->
|
||||
<!-- color: #ffffff !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .ant-table-cell-scrollbar {-->
|
||||
<!-- box-shadow: none !important;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- /*-->
|
||||
<!--表格滚动条-->
|
||||
<!--*/-->
|
||||
|
||||
<!-- .ant-table-body::-webkit-scrollbar-thumb {-->
|
||||
<!-- border: 4px solid rgba(0, 0, 0, 0);-->
|
||||
<!-- height: 6px;-->
|
||||
<!-- border-radius: 25px;-->
|
||||
<!-- background-clip: padding-box;-->
|
||||
<!-- background-color: rgba(30, 115, 194, 0.3);-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--</style>-->
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<Dialog :openVis="visible" width="50%" title="健康终端报警列表" @close="closeDialog" :maskClosable="false">
|
||||
<template #container>
|
||||
<BasicTable ref="registerTable" class="table-container" :columns="columns" :api="getMonitorList" :apiParams="formState">
|
||||
<template #address="{ record, column, index }">
|
||||
<span v-if="record['address']">{{ record?.address }}</span>
|
||||
<span v-else style="color: #eb3636">{{ record?.gpsErrorMsg }}</span>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch, h } from 'vue';
|
||||
import Dialog from '/@/components/dialog/Dialog.vue';
|
||||
import { useDialog } from '/@/views/components/dialogHooks.ts';
|
||||
import BasicTable from '/@/components/secondaryScreen/secondMap/components/basicTable/BasicTable.vue';
|
||||
import { getMonitorList } from '/@/components/body-d-right/right.api.ts';
|
||||
|
||||
const props = defineProps({
|
||||
record: Object,
|
||||
title: String,
|
||||
useForm: Boolean,
|
||||
labelCol: Object,
|
||||
wrapperCol: Object,
|
||||
setting: Object,
|
||||
phoneType: String,
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
},
|
||||
{
|
||||
title: '二级单位',
|
||||
dataIndex: 'orgName2',
|
||||
key: 'orgName2',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
},
|
||||
{
|
||||
title: '异常事件',
|
||||
dataIndex: 'eventType_dictText',
|
||||
key: 'eventType_dictText',
|
||||
},
|
||||
{
|
||||
title: '异常值',
|
||||
dataIndex: 'dataValue',
|
||||
key: 'dataValue',
|
||||
},
|
||||
{
|
||||
title: '发生时间',
|
||||
dataIndex: 'warnTime',
|
||||
key: 'warnTime',
|
||||
},
|
||||
{
|
||||
title: '发生地点',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
slot: 'address',
|
||||
// customRender: ({ record }) => {
|
||||
// if (record?.address) {
|
||||
// return record?.address;
|
||||
// } else {
|
||||
// return h('span', { style: { color: '#eb3636' } }, record?.gpsErrorMsg);
|
||||
// }
|
||||
// },
|
||||
},
|
||||
];
|
||||
const formState = computed(() => ({
|
||||
dataType: props.setting.dataType,
|
||||
orgCode: props.setting?.orgCode,
|
||||
}));
|
||||
const { visible, closeDialog, openDialog } = useDialog({ title: props.title });
|
||||
const registerTable = ref();
|
||||
watch(props, () => {
|
||||
registerTable.value?.getRecords();
|
||||
});
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.table-container {
|
||||
margin: 0 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,615 @@
|
||||
<template>
|
||||
<div class="center-map">
|
||||
<div class="china-map-box">
|
||||
<div class="tab-list">
|
||||
<div v-for="(item, i) in list" :class="[currentIndex == i ? 'active' : '']" class="tab" @click="changeTab(item, i)">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="currentIndex == list.length - 1" class="route-navigation">
|
||||
<a-form :model="formState" layout="inline">
|
||||
<a-form-item class="form-item-self" label="起点">
|
||||
<a-input v-model:value="formState.start" placeholder="请输入起点"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item class="form-item-self" label="终点">
|
||||
<a-input v-model:value="formState.end" placeholder="请输入终点"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button class="reset-btn" @click="removeInput">清空</a-button>
|
||||
<a-button class="search-btn" @click="searchRoute" :loading="searchFlag" :disabled="searchFlag"> 路线规划 </a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div v-show="showRoutePanel" v-click-outside="outClick" class="line-container">
|
||||
<div v-show="routeList.length" class="has-data">
|
||||
<div class="line-title"> {{ panelTitle }}</div>
|
||||
<div class="line-content">
|
||||
<div class="start">起点</div>
|
||||
<div class="line-body">
|
||||
<div class="line"></div>
|
||||
<div class="line-desc">
|
||||
<p v-for="(item, i) in routeList" :key="i">{{ item }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="end">终点</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="!routeList.length" class="empty-data"> 暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="showHospitalList" class="reset-map" @click="resetMap">
|
||||
<RedoOutlined title="重置地图" />
|
||||
</div>
|
||||
<RoutePanel
|
||||
class="driving-route-panel"
|
||||
v-show="showDrivingPanel"
|
||||
:drivingRoute="drivingRoute"
|
||||
:drivingTitle="drivingTitle"
|
||||
@out-click="showDrivingPanel = false"
|
||||
/>
|
||||
<div style="flex: 1; overflow: hidden; margin: 0 0 10px">
|
||||
<div id="mapContainer" class="mapContainer"></div>
|
||||
</div>
|
||||
<div v-show="false" id="container"></div>
|
||||
<div v-show="false" id="panel"></div>
|
||||
<div class="map-legend">
|
||||
<div v-for="(item, i) in legendList" :key="i" class="legend-item">
|
||||
<div><img :src="item.img" alt="" class="legend-img" /> {{ item.text }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="level">地图层级:{{ level }}</div>-->
|
||||
</div>
|
||||
<div class="center-footer" v-if="showFooter">
|
||||
<div class="count-item">
|
||||
<div class="num">{{ useDetail?.alerdyreceive || '0' }}</div>
|
||||
<div class="text">累计受理</div>
|
||||
</div>
|
||||
<div class="count-item">
|
||||
<div class="num">{{ useDetail?.totalacceptance || '0' }}</div>
|
||||
<div class="text">累计处置</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 附近医院、医疗点 -->
|
||||
<div class="hospital-list" v-if="showHospitalList">
|
||||
<div class="hospital-item" v-for="(item, index) in hospitalList" :key="index" @click="showDrivingLine(item)">
|
||||
<div>{{ item.name }}</div>
|
||||
<div>相距{{ item.distance }}</div>
|
||||
<div>驾车大约{{ item.driveTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, ref } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { RedoOutlined } from '@ant-design/icons-vue';
|
||||
import { Map } from '/@/assets/mapUtils/map';
|
||||
import { aircraft, getKmStr, getTimeStr, legendList, mapApiSwitch, tabList, TabType } from '/@/components/chinaMap/chinaHooks';
|
||||
import { useDetailStore } from '/@/store/modules/detailData.ts';
|
||||
import RoutePanel from '/@/components/chinaMap/components/routePanel.vue';
|
||||
import { mapData } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const props = defineProps({
|
||||
//是否展示底部统计
|
||||
showFooter: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return true;
|
||||
},
|
||||
},
|
||||
//地图是否按照接口数据的中心点定位
|
||||
computedCenter: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return true;
|
||||
},
|
||||
},
|
||||
// 地图配置
|
||||
mapOptions: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
//是否展示最近的三个医院
|
||||
showHospitalList: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return false;
|
||||
},
|
||||
},
|
||||
hospitalList: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['clearHospitalList']);
|
||||
const useDetail = useDetailStore();
|
||||
const formState = ref({
|
||||
start: '',
|
||||
end: '',
|
||||
});
|
||||
const list = ref(tabList);
|
||||
const currentIndex = ref(0);
|
||||
|
||||
function changeTab(item, i: number) {
|
||||
currentIndex.value = i; // 地方医院
|
||||
Map.clearActiveHospital();
|
||||
closeDrivingElement();
|
||||
Map.map.off('moveend', logMapinfo);
|
||||
if (TabType.diFangYiYuan == item.type) {
|
||||
Map.removeOverlayGroup();
|
||||
Map.map.on('moveend', logMapinfo);
|
||||
return;
|
||||
}
|
||||
if (TabType.zhiShengJi == item.type) {
|
||||
Map.createAircraft(aircraft);
|
||||
return;
|
||||
} else {
|
||||
getMapData(item.type, { type: item.type });
|
||||
}
|
||||
}
|
||||
|
||||
const currentCityCode = ref('');
|
||||
|
||||
function logMapinfo() {
|
||||
Map.map.getCity(function (info) {
|
||||
const { citycode } = info;
|
||||
if (currentCityCode.value != citycode) {
|
||||
Map.createActiveHospital(citycode);
|
||||
currentCityCode.value = citycode;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const level = ref(0);
|
||||
|
||||
function setLevel() {
|
||||
//获取当前地图级别
|
||||
level.value = Map.map.getZoom();
|
||||
}
|
||||
|
||||
async function getMapData(type, params = {}) {
|
||||
try {
|
||||
const { code, result } = mapData;
|
||||
if (code == 200) {
|
||||
if (Array.isArray(result) && result.length > 0) {
|
||||
Map.createOverlay(
|
||||
result,
|
||||
{
|
||||
content: (val) => {
|
||||
return `<div style="
|
||||
width: 21px;
|
||||
height: 44px;
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
top: -20px;" title="${val?.name}">
|
||||
</div>`;
|
||||
},
|
||||
},
|
||||
() => {},
|
||||
props.computedCenter
|
||||
);
|
||||
} else {
|
||||
Map.removeOverlayGroup();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
Map.initMap({ el: 'mapContainer', option: props.mapOptions }).then(() => {
|
||||
getMapData(tabList[0].type);
|
||||
Map.map && Map.map.on('zoomend', setLevel);
|
||||
Map.map && Map.map.on('zoomend', setLevel);
|
||||
});
|
||||
});
|
||||
const routeList = ref([]);
|
||||
const showRoutePanel = ref(false);
|
||||
const panelTitle = ref();
|
||||
|
||||
function outClick() {
|
||||
showRoutePanel.value = false;
|
||||
}
|
||||
|
||||
function setTitle({ time, distance }) {
|
||||
let str = '全程';
|
||||
str += getTimeStr(time);
|
||||
str += getKmStr(distance);
|
||||
panelTitle.value = str;
|
||||
}
|
||||
|
||||
let searchFlag = ref(false);
|
||||
|
||||
/**
|
||||
* @desc 路线规划
|
||||
* @param callback
|
||||
*/
|
||||
function searchRoute(callback: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | null) {
|
||||
showRoutePanel.value = false;
|
||||
panelTitle.value = '';
|
||||
if (!formState.value.start) {
|
||||
return message.warn('请输入起点');
|
||||
}
|
||||
if (!formState.value.end) {
|
||||
return message.warn('请输入终点');
|
||||
}
|
||||
searchFlag.value = true;
|
||||
//基本地图加载
|
||||
let map = new AMap.Map('container', {
|
||||
resizeEnable: true,
|
||||
center: [116.397428, 39.90923], //地图中心点
|
||||
zoom: 13, //地图显示的缩放级别
|
||||
});
|
||||
//构造路线导航类
|
||||
let driving = new AMap.Driving({
|
||||
map: map,
|
||||
panel: 'panel',
|
||||
});
|
||||
// 根据起终点名称规划驾车导航路线
|
||||
driving.search([{ keyword: formState.value.start }, { keyword: formState.value.end }], function (status, result) {
|
||||
// result 即是对应的驾车导航信息,相关数据结构文档请参考 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DrivingResult
|
||||
if (status === 'complete') {
|
||||
searchFlag.value = false;
|
||||
|
||||
// console.log('绘制驾车路线完成');
|
||||
} else {
|
||||
searchFlag.value = false;
|
||||
|
||||
// console.log('获取驾车数据失败:' + result);
|
||||
}
|
||||
});
|
||||
AMap.Event.addListener(driving, 'complete', (res) => {
|
||||
const data = JSON.parse(JSON.stringify(res));
|
||||
searchFlag.value = false;
|
||||
if (data.info == 'OK') {
|
||||
const { routes } = data;
|
||||
setTitle(routes[0]);
|
||||
let arr = [];
|
||||
arr.push(data.originName);
|
||||
routes[0].steps.map((item: any) => {
|
||||
arr.push(item.instruction);
|
||||
});
|
||||
arr.push(data.destinationName);
|
||||
showRoutePanel.value = true;
|
||||
routeList.value = arr;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeInput() {
|
||||
formState.value.start = '';
|
||||
formState.value.end = '';
|
||||
searchFlag.value = false;
|
||||
}
|
||||
|
||||
// 驾车路线
|
||||
const drivingRoute = ref([]);
|
||||
const drivingTitle = ref('');
|
||||
const showDrivingPanel = ref(false);
|
||||
|
||||
function showDrivingLine(item) {
|
||||
nextTick(() => {
|
||||
drivingTitle.value = '全程' + item.driveTime + item.distance;
|
||||
drivingRoute.value = item.routeList?.map((item) => item?.instruction);
|
||||
showDrivingPanel.value = true;
|
||||
if (item.lon) {
|
||||
Map.clearNaviLine();
|
||||
Map.createNaviLine(item.userLocation, [item.lon, item.lat]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function closeDrivingElement() {
|
||||
Map.clearNavigationElements();
|
||||
formState.value.start = '';
|
||||
formState.value.end = '';
|
||||
showDrivingPanel.value = false;
|
||||
emits('clearHospitalList');
|
||||
}
|
||||
|
||||
function resetMap() {
|
||||
closeDrivingElement();
|
||||
changeTab(list.value[currentIndex.value], currentIndex.value);
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.center-map {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-content: space-between;
|
||||
|
||||
.china-map-box {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
font-size: 16px;
|
||||
|
||||
.tab {
|
||||
width: calc(100% / 8);
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #29f1fa;
|
||||
background: url('/@/assets/img/tab-default.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&.active {
|
||||
color: #fff;
|
||||
background: url('/@/assets/img/tab-active.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.route-navigation {
|
||||
margin: 12px 0;
|
||||
width: 100%;
|
||||
height: 46px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #002e64;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
top: 36px;
|
||||
z-index: 999;
|
||||
transition: all 0.3s;
|
||||
|
||||
:deep(.form-item-self) {
|
||||
label {
|
||||
color: #29f1fa;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
width: 280px;
|
||||
color: #d6d9e0;
|
||||
background: #2a4164;
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid #1b7ef2;
|
||||
}
|
||||
}
|
||||
|
||||
.reset-btn {
|
||||
width: 64px;
|
||||
height: 32px;
|
||||
border-radius: 5px;
|
||||
color: #45a2ff;
|
||||
background: #002e64;
|
||||
border: 1px solid #45a2ff;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
margin-left: 10px;
|
||||
width: 120px;
|
||||
height: 32px;
|
||||
color: #efefef;
|
||||
background: #45a2ff;
|
||||
border-radius: 5px;
|
||||
border-color: #45a2ff;
|
||||
}
|
||||
|
||||
.line-container {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 54px;
|
||||
width: 288px;
|
||||
padding: 9px 18px;
|
||||
min-height: 200px;
|
||||
max-height: 473px;
|
||||
overflow: auto;
|
||||
background: #2a4164;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #1b7ef2;
|
||||
|
||||
.line-title {
|
||||
margin-bottom: 9px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.line-content {
|
||||
font-size: 12px;
|
||||
|
||||
.start {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '起';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478f5;
|
||||
}
|
||||
}
|
||||
|
||||
.end {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '终';
|
||||
color: #fff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background: #1478f5;
|
||||
}
|
||||
}
|
||||
|
||||
.line-body {
|
||||
display: flex;
|
||||
//max-height: 370px;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 1px;
|
||||
//max-height: 370px;
|
||||
background-color: #1478f5;
|
||||
margin: 5px 19px 5px 8px;
|
||||
}
|
||||
|
||||
.line-desc {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-data {
|
||||
margin-top: 30%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reset-map {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50px;
|
||||
z-index: 99;
|
||||
font-size: 20px;
|
||||
color: #05d5ff;
|
||||
cursor: pointer;
|
||||
background: #243b5d;
|
||||
padding: 0px 6px;
|
||||
}
|
||||
|
||||
//驾驶路线导航面板
|
||||
.driving-route-panel {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 86px;
|
||||
width: 288px;
|
||||
padding: 9px 18px;
|
||||
min-height: 200px;
|
||||
max-height: 473px;
|
||||
overflow: auto;
|
||||
background: #2a4164;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #1b7ef2;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.mapContainer {
|
||||
flex: 1;
|
||||
height: calc(100% + 22px);
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.map-legend {
|
||||
position: absolute;
|
||||
bottom: 15px;
|
||||
left: 10px;
|
||||
width: 200px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.legend-item {
|
||||
width: 50%;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 30px;
|
||||
|
||||
.legend-img {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.level {
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 400px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.center-footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
gap: 20px;
|
||||
|
||||
.count-item {
|
||||
width: 340px;
|
||||
height: 80px;
|
||||
display: flex;
|
||||
color: #ffffff;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #00071b;
|
||||
box-shadow: inset 0 0 40px 0 #1b7ef2;
|
||||
border-radius: 4px;
|
||||
|
||||
.num {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hospital-list {
|
||||
position: absolute;
|
||||
bottom: 200px;
|
||||
width: 800px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
|
||||
.hospital-item {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
gap: 20px;
|
||||
min-width: 230px;
|
||||
max-width: 230px;
|
||||
height: 110px;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
margin: 0 10px;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
background-color: #00152b;
|
||||
border: 1px solid #1b7ef2;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 1px 11px 0 rgba(194, 189, 189, 0.5);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hospital-item:hover {
|
||||
background-color: #192a46;
|
||||
box-shadow: inset 0px 0px 16px 3px #2562a9;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div>
|
||||
<public-title title="一线医疗点每日工作动态" themeType="dark" />
|
||||
<div class="inner">
|
||||
<div class="trends-item" v-for="(item, k) in trendsData" :key="k">
|
||||
<div class="trends-title-con">
|
||||
<span class="icon-medical"></span>
|
||||
<span class="trends-item-title">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="trends-item-span-box">
|
||||
<span class="trends-item-span">高风险干预{{ item?.high }}人</span>
|
||||
<span class="trends-item-span">慢病管理{{ item?.slow }}人</span>
|
||||
<span class="trends-item-span">巡诊{{ item?.tour }}人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getWorkDaily } from '/@/views/yinChuan/yinChuan.api.ts';
|
||||
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { left2 } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const props = defineProps({});
|
||||
const { setSession, getSession } = useSession();
|
||||
const { WORK_DAILY } = caching;
|
||||
const trendsData = ref([]);
|
||||
|
||||
async function getTrendsData() {
|
||||
try {
|
||||
const { code, result } = left2;
|
||||
if (code != 200) {
|
||||
return;
|
||||
}
|
||||
setSession(WORK_DAILY, result);
|
||||
trendsData.value = result;
|
||||
} catch {
|
||||
trendsData.value = JSON.parse(getSession(WORK_DAILY));
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTrendsData();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
overflow: auto;
|
||||
|
||||
.trends-item {
|
||||
font-size: 16px;
|
||||
padding: 10px 20px;
|
||||
|
||||
.trends-title-con {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-medical {
|
||||
display: inline-block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
background: url('/@/assets/images/medical-center.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.trends-item-title {
|
||||
margin-left: 8px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.trends-item-span-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.trends-item-span {
|
||||
flex: 1;
|
||||
color: #ededed;
|
||||
}
|
||||
|
||||
.trends-item-span:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<div>
|
||||
<public-title title="一线医疗点每日工作动态" themeType="dark" />
|
||||
<div class="inner">
|
||||
<div class="trends-item" v-for="(item, k) in trendsData" :key="k">
|
||||
<div class="trends-title-con">
|
||||
<span class="icon-medical"></span>
|
||||
<span class="trends-item-title">{{ item.name }}</span>
|
||||
</div>
|
||||
<div class="trends-item-span-box">
|
||||
<span class="trends-item-span">高风险干预{{ item?.high }}人</span>
|
||||
<span class="trends-item-span">慢病管理{{ item?.slow }}人</span>
|
||||
<span class="trends-item-span">巡诊{{ item?.tour }}人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getWorkDaily } from '/@/views/yinChuan/yinChuan.api.ts';
|
||||
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
|
||||
|
||||
const props = defineProps({});
|
||||
const { setSession, getSession } = useSession();
|
||||
const { WORK_DAILY } = caching;
|
||||
const trendsData = ref([]);
|
||||
|
||||
async function getTrendsData() {
|
||||
try {
|
||||
const { code, result } = await getWorkDaily({});
|
||||
if (code != 200) {
|
||||
return;
|
||||
}
|
||||
setSession(WORK_DAILY, result);
|
||||
trendsData.value = result;
|
||||
} catch {
|
||||
trendsData.value = JSON.parse(getSession(WORK_DAILY));
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getTrendsData();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
overflow: auto;
|
||||
|
||||
.trends-item {
|
||||
font-size: 16px;
|
||||
padding: 10px 20px;
|
||||
|
||||
.trends-title-con {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon-medical {
|
||||
display: inline-block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
background: url('/@/assets/images/medical-center.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.trends-item-title {
|
||||
margin-left: 8px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.trends-item-span-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.trends-item-span {
|
||||
flex: 1;
|
||||
color: #ededed;
|
||||
}
|
||||
|
||||
.trends-item-span:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div>
|
||||
<public-title title="员工队伍健康状况" themeType="dark">
|
||||
<template #right>
|
||||
<!-- <span class="right-text" @click="viewDetail">更多</span>-->
|
||||
</template>
|
||||
</public-title>
|
||||
<div class="inner">
|
||||
<div v-for="item in list" :key="item.label" class="health-item">
|
||||
<span>{{ item.label }}</span>
|
||||
<span>{{ item.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { getTeamHealth } from '/@/views/yinChuan/yinChuan.api.ts';
|
||||
import { right2 } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const props = defineProps({
|
||||
setting: Object,
|
||||
});
|
||||
const { setSession, getSession } = useSession();
|
||||
const { TEAM_HEALTH } = caching;
|
||||
const list = ref([
|
||||
{
|
||||
label: '在册总人数',
|
||||
value: '',
|
||||
key: 'total',
|
||||
},
|
||||
{
|
||||
label: '患重大疾病人数',
|
||||
value: '',
|
||||
key: 'bigIll',
|
||||
},
|
||||
{
|
||||
label: '健康高风险人数',
|
||||
value: '',
|
||||
key: 'highRisk',
|
||||
},
|
||||
{
|
||||
label: '患慢性病人数',
|
||||
value: '',
|
||||
key: 'slowIll',
|
||||
},
|
||||
{
|
||||
label: '健康指标异常人数',
|
||||
value: '',
|
||||
key: 'focusErr',
|
||||
},
|
||||
{
|
||||
label: '健康人数',
|
||||
value: '',
|
||||
key: 'health',
|
||||
},
|
||||
]);
|
||||
|
||||
function setList(data = {}) {
|
||||
list.value.forEach((item) => {
|
||||
const { key } = item;
|
||||
if (data && data.hasOwnProperty(key)) {
|
||||
item.value = data[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function viewDetail() {
|
||||
try {
|
||||
const { code, result } = right2;
|
||||
if (code != 200) {
|
||||
return;
|
||||
}
|
||||
setList(result);
|
||||
setSession(TEAM_HEALTH, result);
|
||||
} catch {
|
||||
let data = JSON.parse(getSession(TEAM_HEALTH));
|
||||
setList(data);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
viewDetail();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 10px;
|
||||
|
||||
.right-text {
|
||||
font-weight: 100;
|
||||
cursor: pointer;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.health-item {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<div>
|
||||
<public-title title="员工队伍健康状况" themeType="dark">
|
||||
<template #right>
|
||||
<!-- <span class="right-text" @click="viewDetail">更多</span>-->
|
||||
</template>
|
||||
</public-title>
|
||||
<div class="inner">
|
||||
<div v-for="item in list" :key="item.label" class="health-item">
|
||||
<span>{{ item.label }}</span>
|
||||
<span>{{ item.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import { getTeamHealth } from '/@/views/yinChuan/yinChuan.api.ts';
|
||||
|
||||
const props = defineProps({
|
||||
setting: Object,
|
||||
});
|
||||
const { setSession, getSession } = useSession();
|
||||
const { TEAM_HEALTH } = caching;
|
||||
const list = ref([
|
||||
{
|
||||
label: '在册总人数',
|
||||
value: '',
|
||||
key: 'total',
|
||||
},
|
||||
{
|
||||
label: '患重大疾病人数',
|
||||
value: '',
|
||||
key: 'bigIll',
|
||||
},
|
||||
{
|
||||
label: '健康高风险人数',
|
||||
value: '',
|
||||
key: 'highRisk',
|
||||
},
|
||||
{
|
||||
label: '患慢性病人数',
|
||||
value: '',
|
||||
key: 'slowIll',
|
||||
},
|
||||
{
|
||||
label: '健康指标异常人数',
|
||||
value: '',
|
||||
key: 'focusErr',
|
||||
},
|
||||
{
|
||||
label: '健康人数',
|
||||
value: '',
|
||||
key: 'health',
|
||||
},
|
||||
]);
|
||||
|
||||
function setList(data = {}) {
|
||||
list.value.forEach((item) => {
|
||||
const { key } = item;
|
||||
if (data && data.hasOwnProperty(key)) {
|
||||
item.value = data[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function viewDetail() {
|
||||
try {
|
||||
const { code, result } = await getTeamHealth({ dataType: props.setting?.dataType });
|
||||
if (code != 200) {
|
||||
return;
|
||||
}
|
||||
setList(result);
|
||||
setSession(TEAM_HEALTH, result);
|
||||
} catch {
|
||||
let data = JSON.parse(getSession(TEAM_HEALTH));
|
||||
setList(data);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
viewDetail();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 10px;
|
||||
|
||||
.right-text {
|
||||
font-weight: 100;
|
||||
cursor: pointer;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.health-item {
|
||||
flex: 1;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="common-card" :class="[themeType]">
|
||||
<public-title title="体检数据" :themeType="themeType" />
|
||||
<div class="inner">
|
||||
<div class="type-time">
|
||||
<span
|
||||
v-for="(item, index) in timeTab"
|
||||
:key="index"
|
||||
:class="[selectIndex === index ? 'select' : 'unSelect', themeType]"
|
||||
@click="handleSelect(index, item.value)"
|
||||
>{{ item.name }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="physical-container">
|
||||
<a-spin :spinning="spinning" class="spin"></a-spin>
|
||||
<div class="RadarCharts" ref="radarChartsRef"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, unref, watch } from 'vue';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { useSpin, timeTab, useHospitalList, radarCharts, allValueEmpty } from '/@/components/body-d-left/bodyLeftHooks';
|
||||
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
|
||||
import * as echarts from 'echarts';
|
||||
import { useTheme } from '/@/hooks/theme/useTheme.ts';
|
||||
import { right3 } from '/@/views/yinChuanTest/mockData.ts';
|
||||
|
||||
const props = defineProps({
|
||||
refreshState: {
|
||||
type: Boolean,
|
||||
},
|
||||
setting: Object,
|
||||
});
|
||||
const { themeType } = useTheme();
|
||||
const { setSession, getSession } = useSession();
|
||||
const { LEFT_KEY3 } = caching;
|
||||
const { setSpin, spinning } = useSpin();
|
||||
const selectIndex = ref(0);
|
||||
const selectVal = ref('2'); //本年
|
||||
function handleSelect(index: number, value: string) {
|
||||
selectIndex.value = index;
|
||||
selectVal.value = value;
|
||||
setSpin(true);
|
||||
setTimeout(() => {
|
||||
setSpin(false);
|
||||
}, 1000);
|
||||
getList();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
const { radarList, setRadarList, getRadarList } = useHospitalList();
|
||||
|
||||
async function getList() {
|
||||
setSpin(true);
|
||||
try {
|
||||
const { code, result } = right3;
|
||||
setSpin(!spinning.value);
|
||||
if (code != 200) {
|
||||
return;
|
||||
}
|
||||
setSession(LEFT_KEY3, JSON.stringify(result));
|
||||
setValue(result);
|
||||
} catch {
|
||||
const result = JSON.parse(getSession(LEFT_KEY3));
|
||||
setValue(result);
|
||||
setSpin(!spinning.value);
|
||||
}
|
||||
}
|
||||
|
||||
function setValue(result) {
|
||||
setRadarList(result);
|
||||
const everyEmpty = allValueEmpty('value', getRadarList());
|
||||
everyEmpty && initChart();
|
||||
}
|
||||
|
||||
const radarChartsRef = ref<HTMLElement>();
|
||||
|
||||
function initChart() {
|
||||
const myChart = echarts.init(radarChartsRef.value);
|
||||
let countList = radarList?.value.map((item) => item?.userCount);
|
||||
if (countList.length < 1) return;
|
||||
let max = Math.max(...countList);
|
||||
const indicator = radarList?.value.map((item) => ({ name: item?.hospitalName, max: max }));
|
||||
const option = radarCharts({ indicator, countList, theme: 'dark' });
|
||||
myChart.setOption(option);
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.resize();
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.refreshState,
|
||||
() => {
|
||||
getList();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.inner {
|
||||
height: calc(100% - 40px);
|
||||
|
||||
.physical-container {
|
||||
width: 96%;
|
||||
height: calc(100% - 35px);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: space-around;
|
||||
position: relative;
|
||||
|
||||
.spin {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.RadarCharts {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
||||
import { get } from '/@/api/request';
|
||||
|
||||
export enum Api {
|
||||
phoneList = '/health-emergency/emergency/tblUserHelp/phoneList',
|
||||
getWorkDaily = '/health-emergency/emergency/ycLargeScreen/medicalCenter',
|
||||
getTeamHealth = '/health-emergency/emergency/ycLargeScreen/userHealthCenter',
|
||||
}
|
||||
|
||||
// 呼入电话、受理电话
|
||||
export const getPhoneList = (params: any) => get(Api.phoneList, params);
|
||||
//一线医疗点每日工作动态
|
||||
export const getWorkDaily = (params: any) => get(Api.getWorkDaily, params);
|
||||
//员工队伍健康状况
|
||||
export const getTeamHealth = (params: any) => get(Api.getTeamHealth, params);
|
||||
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="outer">
|
||||
<div class="title-d">
|
||||
<div class="title-d-left">
|
||||
{{ dayTimeO }}
|
||||
</div>
|
||||
<div class="title-d-middle">
|
||||
<span>{{ title }}</span>
|
||||
<span class="phone">{{ phone }}</span>
|
||||
</div>
|
||||
<div class="title-d-right"> 累计运行时间:{{ dayTimeT }}</div>
|
||||
</div>
|
||||
<div class="body-d">
|
||||
<div class="yichuan-body-left">
|
||||
<!--服务详情数据-->
|
||||
<ServiceDetails
|
||||
theme="dark"
|
||||
:refreshState="refreshState"
|
||||
:setting="setting"
|
||||
class="service-details"
|
||||
@handleClick="handlePhoneDialog"
|
||||
/>
|
||||
<!--一线医疗点每日工作动态-->
|
||||
<DailyWorkTrends theme="dark" :refreshState="refreshState" class="daily-work-trends" />
|
||||
</div>
|
||||
<div class="body-d-middle">
|
||||
<china-map
|
||||
:showFooter="false"
|
||||
:computedCenter="false"
|
||||
:mapOptions="YinChuanOption"
|
||||
:showHospitalList="showHospitalList"
|
||||
:hospitalList="hospitalList"
|
||||
@clearHospitalList="clearHospitalList"
|
||||
/>
|
||||
</div>
|
||||
<div class="body-d-right">
|
||||
<!--健康终端报警-->
|
||||
<TerminalAlarm :refreshState="refreshState" :setting="setting" @emit-view-detail="handleEmployeeDialog" />
|
||||
<!--员工队伍健康状况-->
|
||||
<EmployeeHealth theme="dark" :refreshState="refreshState" :setting="setting" />
|
||||
<!--体检数据-->
|
||||
<PhysicalExaminationData :key="tabState" :refreshState="refreshState" :setting="setting" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-d"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onUnmounted, ref, nextTick, onMounted } from 'vue';
|
||||
import ServiceDetails from '/@/views/yinChuanTest/componetns/ServiceDetails.vue';
|
||||
import DailyWorkTrends from '/@/views/yinChuanTest/componetns/dailyWorkTrends.vue';
|
||||
import PhysicalExaminationData from '/@/views/yinChuanTest/componetns/physicalExaminationData.vue';
|
||||
import TerminalAlarm from '/@/views/yinChuanTest/componetns/TerminalAlarm.vue';
|
||||
import EmployeeHealth from '/@/views/yinChuanTest/componetns/employeeHealth.vue';
|
||||
import ChinaMap from '/@/views/yinChuanTest/componetns/chinaMap.vue';
|
||||
import { useTopTime } from '/@/utils/utils.ts';
|
||||
import { useRefresh } from '/@/hooks/autoRefresh';
|
||||
import { DEFAULT_TIME } from '/@/hooks/autoRefresh/pageRefreshTime.ts';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { DataType, getSettings, ThemeType } from '/@/utils/settings.ts';
|
||||
import { ServerDetailType } from '/@/components/body-d-left/bodyLeftHooks.ts';
|
||||
import { YinChuanOption } from '/@/assets/mapUtils/mapConstant.ts';
|
||||
import { useUserStore } from '/@/store/modules/user.ts';
|
||||
import { Map } from '/@/assets/mapUtils/map.ts';
|
||||
|
||||
const title = ref('银川片应急就医服务中心');
|
||||
const phone = '(0951-6805199)';
|
||||
const route = useRoute();
|
||||
const setting = getSettings(DataType.yinChuan);
|
||||
onMounted(() => {
|
||||
init();
|
||||
document.title = title.value;
|
||||
document.addEventListener('visibilitychange', checkTabState);
|
||||
//设置主题
|
||||
store.setThemeType(ThemeType.dark);
|
||||
});
|
||||
const store = useUserStore();
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(interval.value);
|
||||
document.removeEventListener('visibilitychange', checkTabState);
|
||||
});
|
||||
const tabState = ref('');
|
||||
|
||||
//判断窗口是否处于激活状态,切换浏览器tab会导致部分echarts显示不正常
|
||||
function checkTabState() {
|
||||
tabState.value = document.hidden ? 'inactive' : 'active';
|
||||
}
|
||||
|
||||
const { refreshState } = useRefresh(DEFAULT_TIME);
|
||||
const dayTimeO = ref();
|
||||
const dayTimeT = ref();
|
||||
const interval = ref(1);
|
||||
|
||||
function init() {
|
||||
getTime();
|
||||
interval.value = setInterval(() => {
|
||||
getTime();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function getTime() {
|
||||
const { timeLeft, timeRight } = useTopTime();
|
||||
dayTimeO.value = timeLeft;
|
||||
dayTimeT.value = timeRight;
|
||||
}
|
||||
|
||||
const phoneDialogTitle = ref('呼入电话');
|
||||
const phoneDialogRef = ref();
|
||||
//0:处置 1:处理 2:呼入 3:全部
|
||||
const phoneType = ref('');
|
||||
|
||||
//呼入电话、受理电话弹窗
|
||||
function handlePhoneDialog(item) {
|
||||
const { name, key } = item;
|
||||
//呼入电话
|
||||
if (key == 'gross') {
|
||||
phoneType.value = ServerDetailType['gross'];
|
||||
//受理电话
|
||||
if (key == 'alerdyreceive') {
|
||||
phoneType.value = ServerDetailType['alerdyreceive'];
|
||||
}
|
||||
nextTick(() => {
|
||||
phoneDialogTitle.value = name;
|
||||
phoneDialogRef.value.openDialog();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const terminalAlarmDialogRef = ref();
|
||||
|
||||
//终端预警列表弹窗
|
||||
function handleEmployeeDialog() {
|
||||
terminalAlarmDialogRef.value.openDialog();
|
||||
}
|
||||
|
||||
//确认应急求助
|
||||
const hospitalList = ref([]); //医院列表
|
||||
const showHospitalList = ref(false);
|
||||
|
||||
async function confirmHelp(data) {
|
||||
if (!data.lon) return;
|
||||
hospitalList.value = [];
|
||||
//用户的坐标信息
|
||||
let point = [data.lon, data.lat];
|
||||
if (data.hospitalList && data.hospitalList.length > 0) {
|
||||
try {
|
||||
hospitalList.value = await getHospitalList(data.hospitalList, point);
|
||||
showHospitalList.value = true;
|
||||
} catch (error) {
|
||||
console.log('获取医院列表时出错:', error);
|
||||
}
|
||||
} else {
|
||||
console.log('没有医院list');
|
||||
}
|
||||
Map.getAddressByPoint(point).then((res) => {
|
||||
const option = {
|
||||
lon: data.lon,
|
||||
lat: data.lat,
|
||||
position: point,
|
||||
name: data.realName,
|
||||
address: res,
|
||||
sex: data.sex,
|
||||
};
|
||||
Map.createEmergencyMarker(option);
|
||||
});
|
||||
}
|
||||
|
||||
async function getHospitalList(hospitalList, userLocation) {
|
||||
const hospitalPromises = hospitalList.map(async (item) => {
|
||||
item.distance = getDistance(userLocation, [item.lon, item.lat]);
|
||||
const { time, routeList } = await getDriveTime(userLocation, [item.lon, item.lat]);
|
||||
item.driveTime = time;
|
||||
item.routeList = routeList;
|
||||
item.userLocation = userLocation;
|
||||
return item; // 返回更新后的医院条目
|
||||
});
|
||||
return Promise.all(hospitalPromises);
|
||||
}
|
||||
|
||||
function getDistance(userLocation, destination) {
|
||||
const value = Map.getDistance(userLocation, destination);
|
||||
return value > 1000 ? (value / 1000).toFixed(2) + 'km' : value + 'm';
|
||||
}
|
||||
|
||||
async function getDriveTime(userLocation, destination) {
|
||||
let { time, steps } = await Map.getDriveTime(userLocation, destination);
|
||||
let h,
|
||||
m,
|
||||
s = 0;
|
||||
if (time <= 60) {
|
||||
return {
|
||||
time: `${s}秒`,
|
||||
routeList: steps,
|
||||
};
|
||||
}
|
||||
if (time > 60 && time < 3600) {
|
||||
m = Math.floor(time / 60);
|
||||
return {
|
||||
time: `${m}分`,
|
||||
routeList: steps,
|
||||
};
|
||||
}
|
||||
if (time >= 3600) {
|
||||
h = Math.floor(time / 3600);
|
||||
m = Math.floor((time - h * 3600) / 60);
|
||||
return {
|
||||
time: `${h}小时${m}分`,
|
||||
routeList: steps,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function clearHospitalList() {
|
||||
hospitalList.value = [];
|
||||
showHospitalList.value = false;
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.outer {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
background: url('/@/assets/images/bg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.title-d {
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
display: flex;
|
||||
padding-bottom: 9px;
|
||||
background: url('/@/assets/images/top-title.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.title-d-left,
|
||||
.title-d-middle,
|
||||
.title-d-right {
|
||||
font-size: 27px;
|
||||
color: #ffffff;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title-d-middle {
|
||||
.phone {
|
||||
font-size: 27px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
> :nth-child(1) {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
width: 42%;
|
||||
font-size: 40px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> :nth-child(3) {
|
||||
width: 29%;
|
||||
}
|
||||
}
|
||||
|
||||
.body-d {
|
||||
display: flex;
|
||||
height: calc(100% - 120px);
|
||||
padding-top: 10px;
|
||||
|
||||
> :nth-child(1) {
|
||||
width: 24%;
|
||||
}
|
||||
|
||||
> :nth-child(2) {
|
||||
width: 52%;
|
||||
}
|
||||
|
||||
> :nth-child(3) {
|
||||
width: 24%;
|
||||
}
|
||||
|
||||
//.yichuan-body-left,
|
||||
//.body-d-right {
|
||||
// text-align: center;
|
||||
//}
|
||||
|
||||
.yichuan-body-left {
|
||||
.service-details {
|
||||
height: 33%;
|
||||
}
|
||||
|
||||
.daily-work-trends {
|
||||
height: 67%;
|
||||
}
|
||||
}
|
||||
|
||||
.body-d-right {
|
||||
> :nth-child(n) {
|
||||
width: 100%;
|
||||
height: calc(100% / 3);
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.body-d-middle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-d {
|
||||
height: 40px;
|
||||
background: url('/@/assets/images/bottom-b.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user