update
init
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<BasicModal @register="registerModal" title="咨询数据" width="80%">
|
||||
<div class="top-d-outer">
|
||||
<div class="top-d">
|
||||
<div>医院名称:{{ hospitalInfo?.resourceName || '-' }}</div>
|
||||
<div>医院级别:{{ hospitalInfo?.level || '-' }}</div>
|
||||
<div>专家人数:{{ hospitalInfo?.specialistSum }}</div>
|
||||
<div>当年咨询人次:{{ hospitalInfo?.thisYearSessionSum }}</div>
|
||||
<div>累计咨询人次:{{ hospitalInfo?.allSessionSum }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; padding-right: 5px">
|
||||
<a-radio-group v-model:value="radioValue" button-style="solid" class="radio-group-d" @change="changeRadio">
|
||||
<a-radio-button value="0">专家数据</a-radio-button>
|
||||
<a-radio-button value="1">员工咨询数据</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
|
||||
<BasicTable @register="registerTable" table-type="1" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import BasicModal from '/@/components/Modal/src/BasicModal.vue';
|
||||
import { useModalInner } from '/@/components/Modal';
|
||||
import { ref } from 'vue';
|
||||
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { userPageApi, yearPageApi } from '/@/views/archivesManage/institution/timeService/consult/consult.api';
|
||||
import dayjs from 'dayjs';
|
||||
import { columns1, columns2 } from '/@/views/archivesManage/institution/timeService/consult/consult.data';
|
||||
|
||||
const radioValue = ref('0');
|
||||
const hospitalInfo = ref({});
|
||||
|
||||
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
|
||||
radioValue.value = '0';
|
||||
setModalProps({ showCancelBtn: false, showOkBtn: false });
|
||||
hospitalInfo.value = data.record;
|
||||
|
||||
setProps({ api: yearPageApi, columns: columns1, searchInfo: { hospitalId: hospitalInfo.value.id, year: dayjs().format('YYYY') } });
|
||||
await reload({ page: 1 });
|
||||
});
|
||||
const { tableContext } = useListPage({
|
||||
tableProps: {
|
||||
canResize: false,
|
||||
orderFlag: false,
|
||||
immediate: false,
|
||||
showIndexColumn: true,
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
showActionColumn: false,
|
||||
},
|
||||
});
|
||||
const [registerTable, { setProps, reload }] = tableContext;
|
||||
|
||||
async function changeRadio(v) {
|
||||
if (v.target.value === '0') {
|
||||
setProps({ api: yearPageApi, columns: columns1 });
|
||||
await reload({ page: 1 });
|
||||
} else {
|
||||
setProps({ api: userPageApi, columns: columns2 });
|
||||
await reload({ page: 1 });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.top-d-outer {
|
||||
padding: 10px;
|
||||
.top-d {
|
||||
border-bottom: 1px dashed #cecece;
|
||||
display: flex;
|
||||
padding: 0 0 10px;
|
||||
> div {
|
||||
margin-right: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.ant-radio-button-wrapper) {
|
||||
color: #1684fc !important;
|
||||
border-color: #1684fc !important;
|
||||
&:before {
|
||||
background-color: #1684fc !important;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-radio-button-wrapper-checked) {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
enum Api {
|
||||
list = '/health-consultation/archives/hospital/geo',
|
||||
statistics = '/health-consultation/archives/consultation/statistics',
|
||||
userPage = '/health-consultation/archives/consultation/user-page',
|
||||
yearPage = '/health-consultation/archives/specialist/page',
|
||||
}
|
||||
|
||||
export const listApi = (params: any) => defHttp.get({ url: Api.list, params });
|
||||
export const statisticsApi = (params: any) => defHttp.get({ url: Api.statistics, params });
|
||||
export const userPageApi = (params: any) => defHttp.get({ url: Api.userPage, params });
|
||||
export const yearPageApi = (params: any) => defHttp.get({ url: Api.yearPage, params });
|
||||
@@ -0,0 +1,78 @@
|
||||
import { BasicColumn } from '/@/components/Table';
|
||||
import dayjs from 'dayjs';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
|
||||
export const columns1: BasicColumn[] = [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'doctorName',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'sex2');
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
dataIndex: 'age',
|
||||
},
|
||||
{
|
||||
title: '科室',
|
||||
dataIndex: 'departmentName',
|
||||
},
|
||||
{
|
||||
title: '职称',
|
||||
dataIndex: 'doctorJob_dictText',
|
||||
},
|
||||
{
|
||||
title: `当年服务人次(${dayjs().format('YYYY')})`,
|
||||
dataIndex: 'thisYearSessionSum',
|
||||
},
|
||||
{
|
||||
title: '累计服务人次',
|
||||
dataIndex: 'allSessionSum',
|
||||
},
|
||||
];
|
||||
export const columns2: BasicColumn[] = [
|
||||
{
|
||||
title: '单位',
|
||||
dataIndex: 'secondDeptName',
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'thirdDeptName',
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '工号',
|
||||
dataIndex: 'workNo',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex',
|
||||
customRender: ({ text }) => {
|
||||
return render.renderDict(text, 'sex2');
|
||||
},
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
dataIndex: 'age',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '最近咨询时间',
|
||||
dataIndex: 'lastSessionDate',
|
||||
},
|
||||
{
|
||||
title: '累计咨询次数',
|
||||
dataIndex: 'sessionCount',
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,178 @@
|
||||
<template>
|
||||
<div class="outer-d">
|
||||
<div class="top-title"> 长庆油田咨询医院 </div>
|
||||
<div class="map-d">
|
||||
<template v-if="!loading">
|
||||
<service-map
|
||||
ref="serviceMap"
|
||||
:marker-content="markerContent"
|
||||
:label-content="labelContent"
|
||||
field="resourceName"
|
||||
@get-marker-info="getMarkerInfo"
|
||||
@get-detail="getDetail"
|
||||
/>
|
||||
<div class="bottom-d">
|
||||
<div
|
||||
class="bottom-d-item"
|
||||
v-for="(item, index) in statisticsInfo"
|
||||
:key="`bottom-d-item-${index}`"
|
||||
:style="{ margin: index === 1 ? '0 25px 0 50px' : index === 2 ? '0 50px 0 25px' : 0 }"
|
||||
>
|
||||
<div>{{ item.value }}</div>
|
||||
<div>{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center">
|
||||
<a-spin size="large" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<consult-modal @register="registerModal" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import ServiceMap from '/@/views/archivesManage/institution/timeService/components/serviceMap.vue';
|
||||
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { listApi, statisticsApi } from '/@/views/archivesManage/institution/timeService/consult/consult.api';
|
||||
import ConsultModal from '/@/views/archivesManage/institution/timeService/consult/components/consultModal.vue';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import consult from '/@/assets/images/consult/consult.png';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
|
||||
const loading = ref(true);
|
||||
const serviceMap = ref();
|
||||
const statisticsInfo = ref();
|
||||
const mapList = ref();
|
||||
const orgCode = ref();
|
||||
const markerContent = ref(`<div style="white-space: nowrap;display: flex;background-color: #58a55c;padding: 5px 10px;border-radius: 10px;
|
||||
align-items: center;">
|
||||
<img src="${consult}" alt="" style="width: 20px;height: 20px; margin-right: 5px"/>
|
||||
<span style="color: #ffffff">^&</span>
|
||||
</div>`);
|
||||
const labelContent = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
await initList();
|
||||
await statistics();
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
serviceMap.value.destroyMap();
|
||||
});
|
||||
|
||||
async function statistics() {
|
||||
const info = await statisticsApi({});
|
||||
statisticsInfo.value = [
|
||||
{ value: info?.hospitalSum, name: '医院数量' },
|
||||
{ value: info?.specialistSum, name: '专家人数' },
|
||||
{ value: info?.thisYearSessionSum, name: `${dayjs().format('YYYY')}年咨询人次` },
|
||||
{ value: info?.allSessionSum, name: `2023年至今累计咨询人次` },
|
||||
];
|
||||
}
|
||||
|
||||
async function initList() {
|
||||
try {
|
||||
mapList.value = await listApi({ orgCode: orgCode.value === '1' ? '' : orgCode.value });
|
||||
loading.value = false;
|
||||
await nextTick(() => {
|
||||
serviceMap.value.initMap(mapList.value);
|
||||
});
|
||||
} catch (e) {
|
||||
loading.value = false;
|
||||
await nextTick(() => {
|
||||
serviceMap.value.initMap([]);
|
||||
});
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
function getMarkerInfo(e) {
|
||||
let r = JSON.stringify(e);
|
||||
console.log(r);
|
||||
labelContent.value = `
|
||||
<div style="padding: 10px;background-color: #ffffff;border-radius: 10px">
|
||||
<div style="padding-top: 8px;font-weight: bold;font-size: 14px">专家人数:${e.specialistSum} </div>
|
||||
<div style="padding-top: 8px;font-weight: bold;font-size: 14px">当年咨询人次:${e.thisYearSessionSum} </div>
|
||||
<div style="padding-top: 8px;font-weight: bold;font-size: 14px">累计咨询人次:${e.allSessionSum} </div>
|
||||
<div style="padding-top: 8px;text-align: center;color: #5087ec" onclick="getDetail()">查看咨询数据></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
serviceMap.value.setLabel(labelContent.value);
|
||||
}
|
||||
|
||||
function getDetail(e) {
|
||||
console.log(e);
|
||||
openModal(true, {
|
||||
record: e,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.outer-d {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.top-title {
|
||||
padding: 10px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.search-d {
|
||||
box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 0.35);
|
||||
border-radius: 5px;
|
||||
background-color: #ffffff;
|
||||
padding: 10px 20px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 99;
|
||||
> :nth-child(n + 1) {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
.bottom-d {
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 8%;
|
||||
left: 0;
|
||||
z-index: 99;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.bottom-d-item {
|
||||
border-radius: 5px;
|
||||
box-shadow: 2px 2px 4px 1px rgba(0, 0, 0, 0.35);
|
||||
background-color: #ffffff;
|
||||
font-weight: bold;
|
||||
padding: 0 50px;
|
||||
> div {
|
||||
text-align: center;
|
||||
&:nth-child(1) {
|
||||
font-size: 18px;
|
||||
padding: 10px 0 5px 0;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
padding: 5px 0 10px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.map-d {
|
||||
position: absolute;
|
||||
width: calc(100% - 20px);
|
||||
height: calc(100% - 70px);
|
||||
top: 50px;
|
||||
left: 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user