1.修改socket弹窗等
This commit is contained in:
2025-07-08 16:00:47 +08:00
parent 07f14c7703
commit 8a630dd1cd
11 changed files with 476 additions and 171 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
if (result?.screenPath) {
router.replace(result?.screenPath);
} else {
router.replace('centralScreen');
router.replace('/home');
}
userStore.setCenterInfo(result);
}
+4
View File
@@ -86,3 +86,7 @@ export function openTestModal() {
});
});
}
export function handleSocketUrl(url: string, centerId: string) {
return url.substring(0, url.indexOf('/websocket/') + 11) + centerId;
}
+4 -2
View File
@@ -4,8 +4,8 @@
<template #container>
<div class="police-con" :class="[themeType]">
<div class="sub-text">
<span v-if="userInfo['type'] == '0'">有一个员工刚刚发起 应急求助(120),请马上处理!</span>
<span v-if="userInfo['type'] == '1'">有一个员工刚刚发起 应急求助,请马上处理</span>
<span v-if="userInfo['callType'] == '0'">有一个员工刚刚发起 应急求助(120),请马上处理!</span>
<span v-if="userInfo['callType'] == '1'">有一个员工刚刚发起 应急求助,请马上处理</span>
</div>
<div class="con-item">
<span>姓名</span>
@@ -82,11 +82,13 @@
font-weight: bold;
margin-left: 8px;
font-size: 16px;
color: #ffffff;
}
.con-item {
padding: 1.3% 0;
display: flex;
color: #ffffff;
span:nth-child(1) {
font-weight: bold;
+2
View File
@@ -73,6 +73,7 @@
<style scoped lang="less">
.police-con {
padding: 2% 0 2% 5%;
color: #ffffff;
.sub-text {
font-weight: bold;
@@ -83,6 +84,7 @@
.con-item {
padding: 1.3% 0;
display: flex;
color: #ffffff;
span:nth-child(1) {
font-weight: bold;
+206 -3
View File
@@ -20,7 +20,7 @@
</div>
</div>
<div class="sun-body-center">
<CenterMap />
<CenterMap :showHospitalList="showHospitalList" :hospitalList="hospitalList" @clear-hospital-list="clearHospitalList" />
</div>
<div class="sun-body-right">
<div class="sun-body-right-one">
@@ -36,6 +36,11 @@
</div>
</div>
<PhoneDialog ref="phoneDialogRef" :title="phoneDialogTitle" :useForm="true" :setting="setting" :phoneType="phoneType" />
<!-- <YunZuoXiDialog ref="yunZuoXiDialogRef" :record="xianYunData" @confirmHelp="confirmHelp" />-->
<!-- 健康监测弹窗 -->
<EmployeeDialog ref="employeeDialogRef" :record="socketData" />
<!-- 应急120弹窗 -->
<EmergencyDialog ref="emergencyDialogRef" :record="socketData1" @confirm-help="confirmHelp" />
<IndexModal
ref="indexModalRef"
:api="modalApi"
@@ -57,14 +62,23 @@
import threeR from '/@/views/indexSun/threeR.vue';
import CenterMap from '/@/views/indexSun/centerMap.vue';
import { ServerDetailType } from '/@/components/body-d-left/bodyLeftHooks.ts';
import { nextTick, onMounted, ref } from 'vue';
import { columns, fromLists, threeRModalColumns, threeRModalFromList, towRcolumns, twoRform } from '/@/views/indexSun/indexSun.ts';
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
import PhoneDialog from '/@/views/components/phoneDialog/phoneDialog.vue';
import { DataType, getSettings } from '/@/utils/settings.ts';
import IndexModal from '/@/views/indexSun/indexModal.vue';
import LoginOutButton from '/@/views/components/loginOutButton.vue';
import router from '/@/router';
import { getAuthCache } from '/@/utils/auth.ts';
import { basicPath, useSocket, emergencyPath } from '/@/utils/socket.ts';
import { Map } from '/@/assets/mapUtils/map.ts';
import YunZuoXiDialog from '/@/views/components/yunZuoXiDialog.vue';
import EmployeeDialog from '/@/views/components/employeeDialog.vue';
import EmergencyDialog from '/@/views/components/emergencyDialog.vue';
import { handleSocketUrl } from '/@/utils/utils.ts';
import { useUserStore } from '/@/store/modules/user.ts';
const { getCenterInfo } = useUserStore();
import { threeRModalApi, twoRModal1Api, twoRModal2Api, twoRModal3Api } from '/@/views/indexSun/indexSun.api.ts';
import dayjs from 'dayjs';
//0:处置 1:处理 2:呼入 3:全部
@@ -84,6 +98,7 @@
const centerInfo = getAuthCache('centerInfo');
centerId.value = centerInfo.id;
});
function handleOneLeftClick(item) {
const { name, key } = item;
//呼入电话
@@ -99,6 +114,7 @@
});
}
}
function handleTwoLClick() {
indexModalTitle.value = '主诉分类详情';
indexColumn.value = columns[1];
@@ -108,12 +124,184 @@
indexModalRef.value.openDialog();
});
}
function handleOneRClick() {
console.log(12333);
router.push({
path: '/indexSon',
});
}
// 健康监测工具报警
let socketUrl = handleSocketUrl(basicPath, getCenterInfo?.id);
const { socketData, setSocketData, closeSocket } = useSocket(socketUrl);
const employeeDialogRef = ref();
function employeeDialogOpen() {
setSocketData({
userId: '001a9878fdaf401c844a03e2fc7c370b',
realName: '曹燕',
lon: 87.587482,
lat: 43.856052,
sex: 2,
age: 40,
orgCode: 'A01A33A05',
orgName: '地质研究所',
hospitalList: [
{
id: null,
name: '交大一附院',
lat: 34.22,
lon: 108.94,
type: null,
ambulance: null,
docNum: null,
nurseNum: null,
expertNum: null,
distance: null,
},
{
id: null,
name: '高新医院',
lat: 34.23,
lon: 108.88,
type: null,
ambulance: null,
docNum: null,
nurseNum: null,
expertNum: null,
distance: null,
},
{
id: null,
name: '人民医院',
lat: 34.24,
lon: 108.93,
type: null,
ambulance: null,
docNum: null,
nurseNum: null,
expertNum: null,
distance: null,
},
],
});
emergencyDialogRef.value.openDialog();
}
setTimeout(() => {
// employeeDialogOpen();
// openEmergencyOpen();
// yunZOpen();
}, 5000);
watch(socketData, (nVal) => {
if (nVal) {
nextTick(() => {
setSocketData(nVal);
employeeDialogRef.value.openDialog();
});
}
});
//应急求助、120弹窗
let socketUrl1 = handleSocketUrl(emergencyPath, getCenterInfo?.id);
const { socketData: socketData1, setSocketData: setSocketData1, closeSocket: closeSocket1 } = useSocket(socketUrl1, false);
const emergencyDialogRef = ref(); //紧急求助
watch(socketData1, (nVal) => {
if (nVal) {
setSocketData1(nVal);
emergencyDialogRef.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;
}
onUnmounted(() => {
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
window.onbeforeunload = function () {
closeSocket();
closeSocket1(); //西安云坐席
};
});
function handleThreeRClick(type) {
const textArr = ['心血管异常人员列表', '脑血管异常人员列表', '冠状CT异常人员列表'];
console.log(type);
@@ -159,6 +347,7 @@
letter-spacing: 2px;
background: url('/@/assets/indexSun/bigBg.png') no-repeat;
background-size: 100% 100%;
.sun-screen-title {
height: 80px;
background: url('/@/assets/indexSun/bg.png') no-repeat;
@@ -168,10 +357,12 @@
color: #fff;
text-align: center;
line-height: 60px;
.sun-title-left,
.sun-title-right {
width: 23%;
}
.sun-title-center {
flex: 1;
font-size: 50px;
@@ -181,11 +372,13 @@
font-weight: bold;
}
}
.sun-body-content {
height: calc(100% - 80px);
padding: 10px 20px;
display: flex;
justify-content: space-between;
.sun-body-left,
.sun-body-right {
height: 100%;
@@ -194,6 +387,7 @@
flex-direction: column;
justify-content: space-between;
}
.sun-body-center {
flex: 1;
margin: 0 10px;
@@ -201,6 +395,7 @@
display: flex;
flex-direction: column;
}
.sun-body-left {
.sun-body-left-one,
.sun-body-left-two,
@@ -208,6 +403,7 @@
margin-bottom: 10px;
border: 1px solid #00ccff;
border-radius: 14px;
.one-l-box,
.two-l-box,
.three-l-box,
@@ -215,14 +411,17 @@
height: 100%;
}
}
.sun-body-left-one {
height: 27%;
}
.sun-body-left-two,
.sun-body-left-three {
height: 36%;
}
}
.sun-body-right {
.sun-body-right-one,
.sun-body-right-two,
@@ -230,18 +429,22 @@
border: 1px solid #00ccff;
border-radius: 14px;
margin-bottom: 10px;
.one-r-box,
.two-r-box,
.three-r-box {
height: 100%;
}
}
.sun-body-right-one {
height: 30%;
}
.sun-body-right-two {
height: 42%;
}
.sun-body-right-three {
height: 26%;
}
+158 -96
View File
@@ -19,22 +19,22 @@
<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 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 class="end">终点</div>
</div>
<div class="end">终点</div>
</div>
<div v-show="!routeList.length" class="empty-data"> 暂无数据</div>
</div>
<div v-show="!routeList.length" class="empty-data"> 暂无数据</div>
</div>
<div class="map">
<div style="flex: 1; overflow: hidden">
@@ -59,10 +59,18 @@
<div class="text">累计处置</div>
</div>
</div>
<div class="hospital-list" :class="[themeType]" 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 setup lang="ts">
import { onMounted, ref } from 'vue';
import { nextTick, onMounted, ref } from 'vue';
import { infoContent, legendList, tabList } from '/@/views/indexSun/indexSun.ts';
import { message } from 'ant-design-vue';
import { innerLineLight, outerLineOption } from '/@/assets/mapUtils/mapConstant.ts';
@@ -71,7 +79,8 @@
import { useDetailStore } from '/@/store/modules/detailData.ts';
import $bus from '/@/utils/bus.ts';
import { earlyWarning } from '/@/utils/busConstant.ts';
import { useTheme } from '/@/hooks/theme/useTheme.ts';
const { themeType } = useTheme();
const list = ref(tabList);
const currentIndex = ref(0);
let searchFlag = ref(false);
@@ -87,11 +96,25 @@
return true;
},
},
//是否展示最近的三个医院
showHospitalList: {
type: Boolean,
default: () => {
return false;
},
},
hospitalList: {
type: Array,
default: () => {
return [];
},
},
});
const useDetail = useDetailStore();
const showRoutePanel = ref(false);
const panelTitle = ref();
const level = ref(0);
const drivingTitle = ref('');
const routeList = ref([]);
const emits = defineEmits(['clearHospitalList']);
const showDrivingPanel = ref(false);
@@ -121,6 +144,19 @@
});
});
function showDrivingLine(item) {
nextTick(() => {
panelTitle.value = '全程' + item.driveTime + item.distance;
routeList.value = item.routeList?.map((item) => item?.instruction);
showDrivingPanel.value = true;
if (item.lon) {
Map.clearNaviLine();
Map.createNaviLine(item.userLocation, [item.lon, item.lat]);
}
showRoutePanel.value = true;
});
}
function setLevel() {
//获取当前地图级别
level.value = Map.map.getZoom();
@@ -377,88 +413,6 @@
background: #6d8bf1;
border-radius: 5px;
}
.line-container {
position: absolute;
right: 0;
top: 54px;
width: 288px;
padding: 9px 18px;
min-height: 200px;
max-height: 473px;
overflow: auto;
background: rgba(0, 0, 0, 0.7);
border-radius: 2px;
//border: 1px solid #1b7ef2;
.line-title {
margin-bottom: 9px;
font-size: 14px;
font-weight: 700;
color: var(--cardFontColor);
}
.line-content {
font-size: 12px;
color: var(--cardFontColor);
.start {
display: flex;
align-items: center;
&::before {
content: '起';
color: var(--cardFontFFF);
width: 20px;
height: 20px;
margin-right: 7px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--circelBg);
}
}
.end {
display: flex;
align-items: center;
&::before {
content: '终';
color: var(--cardFontFFF);
width: 20px;
height: 20px;
margin-right: 7px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--circelBg);
}
}
.line-body {
display: flex;
color: var(--cardFontColor);
}
.line {
width: 1px;
background-color: var(--circelBg);
margin: 5px 19px 5px 8px;
}
.line-desc {
flex: 1;
}
}
.empty-data {
margin-top: 30%;
text-align: center;
}
}
}
.map {
@@ -578,5 +532,113 @@
}
}
}
.hospital-list {
position: absolute;
bottom: 160px;
left: 50%;
transform: translateX(-50%);
display: flex;
.hospital-item {
background: #0a1d36;
border: 1px solid #0a1d36;
box-shadow: 0 0 3px 3px #0a1d36;
position: relative;
flex: 1;
gap: 20px;
min-width: 200px;
max-width: 200px;
text-align: center;
padding: 10px;
margin: 0 10px;
font-size: 16px;
border-radius: 12px;
cursor: pointer;
}
}
.line-container {
position: absolute;
right: 0;
top: 54px;
width: 288px;
padding: 9px 18px;
min-height: 200px;
max-height: 473px;
overflow: auto;
background: #0a1d36;
border-radius: 2px;
//border: 1px solid #1b7ef2;
.line-title {
margin-bottom: 9px;
font-size: 14px;
font-weight: 700;
background: #0a1d36 !important;
color: var(--cardFontColor);
}
.line-content {
font-size: 12px;
color: var(--cardFontColor);
.start {
display: flex;
align-items: center;
&::before {
content: '起';
color: var(--cardFontFFF);
width: 20px;
height: 20px;
margin-right: 7px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--circelBg);
}
}
.end {
display: flex;
align-items: center;
&::before {
content: '终';
color: var(--cardFontFFF);
width: 20px;
height: 20px;
margin-right: 7px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: var(--circelBg);
}
}
.line-body {
display: flex;
color: var(--cardFontColor);
}
.line {
width: 1px;
background-color: var(--circelBg);
margin: 5px 19px 5px 8px;
}
.line-desc {
flex: 1;
}
}
.empty-data {
margin-top: 30%;
text-align: center;
}
}
}
</style>
+60 -21
View File
@@ -14,10 +14,10 @@
/>
</a-form-item>
<a-form-item label="单位">
<a-select placeholder="选择单位" v-model:value="orgCode" :options="option" :field-names="fieldNames" />
<a-select placeholder="选择单位" @change="changeSecond" v-model:value="orgCode1" :options="option1" />
</a-form-item>
<a-form-item label="部门">
<a-select placeholder="选择单位" @focus="changeDept" v-model:value="orgCode" :options="option" :field-names="fieldNames" />
<a-select placeholder="选择部门" v-model:value="orgCode2" :options="option2" />
</a-form-item>
<slot name="searchSecond"></slot>
</Form>
@@ -56,12 +56,11 @@
import Dialog from '/@/components/dialog/Dialog.vue';
import { useDialog } from '/@/views/components/dialogHooks.ts';
import { onMounted, ref, watch } from 'vue';
import { SexType, sexTypeList } from '/@/utils/settings.ts';
import { SexType } from '/@/utils/settings.ts';
import { Form } from 'ant-design-vue';
import { useDepart } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
import { message } from 'ant-design-vue';
import BasicTable from '/@/components/secondaryScreen/secondMap/components/basicTable/BasicTable.vue';
import { getSecondaryDepartmentList } from '/@/views/indexSun/indexSun.api.ts';
import { allSecondaryDepartsApi, getThreeDepartByOrgCodeApi } from '/@/views/indexSun/indexSun.api.ts';
const props = defineProps({
title: {
@@ -95,28 +94,71 @@
const formState = ref();
const registerTable = ref();
const dialogTitle = ref('');
const option1 = ref([{ label: '全部', value: '' }]);
const option2 = ref([{ label: '全部', value: '' }]);
const orgCode1 = ref('');
const orgCode2 = ref('');
const formRecord = ref({});
const dataActity = ref(1);
function changeDept() {
if (!orgCode.value) {
return message.warning('请先选择单位');
}
}
onMounted(() => {
getSecondDept();
getSecondDepart();
});
function getSecondDepart() {
allSecondaryDepartsApi({})
.then((res: any) => {
if (res.code === 200) {
const op: any[] = res?.result
? res.result.map((it: any) => {
return {
label: it.departName,
value: it.orgCode,
};
})
: [];
option1.value = option1.value.concat(op);
} else {
}
})
.catch((err) => {
console.log(err);
});
}
function handleDataChange(type) {
if (type == dataActity.value) return;
dataActity.value = type;
}
function getSecondDept() {
getSecondaryDepartmentList().then((res) => {
console.log(res, 'shshakjhdsjbjanmdjka');
if (res.code == 200) {
console.log(res, 'ddddddddd');
}
});
function changeSecond() {
orgCode2.value = '';
option2.value = [{ label: '全部', value: '' }];
if (orgCode1.value) {
getThirdD();
}
}
function getThirdD() {
getThreeDepartByOrgCodeApi({ orgCode: orgCode1.value })
.then((res: any) => {
if (res.code === 200) {
const op: any[] = res?.result
? res.result.map((it: any) => {
return {
label: it.departName,
value: it.orgCode,
};
})
: [];
option2.value = option2.value.concat(op);
} else {
}
})
.catch((err) => {
console.log(err);
});
}
const formItemLayout = {
labelCol: {
style: { width: '80px' },
@@ -137,7 +179,6 @@
twoROnlyFun();
}
getField();
getSecondDept();
});
const normalNum = ref();
const abnormalNum = ref();
@@ -189,7 +230,6 @@
...formRecord.value,
...result,
};
getSecondDept();
console.log(formRecord.value);
}
function handleClicksearch() {
@@ -200,7 +240,6 @@
// registerTable.value.getRecords();
}
const { orgCode, option, fieldNames, setOrgCode } = useDepart();
const { visible, closeDialog, openDialog } = useDialog({ title: dialogTitle.value });
function handleClose() {
+4
View File
@@ -7,6 +7,8 @@ enum Api {
oneR = '/health-watch/watch/watchMonitorData/getMonitorList',
threeR = '/health-emergency/emergency/LargeScreenNew/medicalAbnormalStatistics',
twoR = '/health-emergency/emergency/LargeScreenNew/healthSign',
allSecondaryDeparts = '/sys/sysDepart/allSecondaryDeparts',
getThreeDepartByOrgCode = '/sys/sysDepart/getThreeDepartByOrgCode',
threeRModal = '/health-emergency/emergency/LargeScreenNew/medicalAbnormal',
twoRModal1 = '/health-emergency/emergency/LargeScreenNew/healthWeightLoss',
twoRModal2 = '/health-emergency/emergency/LargeScreenNew/healthBloodSugar',
@@ -26,3 +28,5 @@ export const twoRModal1Api = (params) => post(Api.twoRModal1, params);
export const twoRModal2Api = (params) => post(Api.twoRModal2, params);
export const twoRModal3Api = (params) => post(Api.twoRModal3, params);
export const getSecondaryDepartmentList = () => get({ url: Api.getSecondaryDepartment });
export const allSecondaryDepartsApi = (params) => get(Api.allSecondaryDeparts, params);
export const getThreeDepartByOrgCodeApi = (params) => get(Api.getThreeDepartByOrgCode, params);
+2 -1
View File
@@ -4,7 +4,7 @@ import { normalTypeList, SexType, sexTypeList } from '/@/utils/settings.ts';
export const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href;
export const legend2 = new URL('/@/assets/img/legend5.png', import.meta.url).href;
export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href;
export function getClassCharts(dx, dy) {
export function getClassCharts(dx, dy, m) {
return {
grid: {
top: 40,
@@ -50,6 +50,7 @@ export function getClassCharts(dx, dy) {
},
},
interval: 25, // 步长
max: m,
min: 0, // 起始 - 设置y轴刻度的最小值
axisLabel: {
color: '#65C6E7',
+32 -5
View File
@@ -6,7 +6,7 @@
</div>
<div class="content">
<div class="content-search">
<div class="type-select">
<div>
<a-select v-model:value="selectValue" class="type-select" :options="selectOptions">
<a-select-option value="全部数据">全部数据</a-select-option>
</a-select>
@@ -42,7 +42,7 @@
import { ref, onMounted } from 'vue';
import * as echarts from 'echarts';
import { getClassCharts } from '/@/views/indexSun/indexSun.ts';
import { twoLApi } from '/@/views/indexSun/indexSun.api.ts';
import { allSecondaryDepartsApi, twoLApi } from '/@/views/indexSun/indexSun.api.ts';
const chooseType = ref('0');
const selectValue = ref('all');
@@ -52,12 +52,35 @@
if (chooseType.value === type) return;
chooseType.value = type;
getData();
// initChart();
}
onMounted(() => {
getData();
// initChart();
if (selectOptions.value.length === 1) {
getAllDepart();
}
});
function getAllDepart() {
allSecondaryDepartsApi({})
.then((res: any) => {
if (res.code === 200) {
const op: any[] = res?.result
? res.result.map((it: any) => {
return {
label: it.departName,
value: it.orgCode,
};
})
: [];
selectOptions.value = selectOptions.value.concat(op);
} else {
}
})
.catch((err) => {
console.log(err);
});
}
const myChart = ref(null);
function getData() {
twoLApi({
@@ -81,7 +104,10 @@
value.map((item) => {
return item.count;
}) || [];
let option = getClassCharts(dx, dy);
const max = value.sort((a, b) => b.count - a.count).length > 0 ? value.sort((a, b) => b.count - a.count)[0].count : [];
const m = max % 25 === 0 ? max : (parseInt(max / 25) + 1) * 25;
let option = getClassCharts(dx, dy, m);
myChart.value.setOption(option);
window.addEventListener('resize', () => {
myChart.value.resize();
@@ -123,6 +149,7 @@
align-items: center;
margin: 5px 10px;
.type-select {
width: 200px;
}
}
.type-time {
+3 -42
View File
@@ -201,56 +201,17 @@
let goPath = PageEnum.BASE_HOME;
if (code == 200) {
let flag1 = result?.codeList?.find((item: any) => ['emergency:screen:show:yinchuan'].includes(item));
let flag2 = result?.codeList?.find((item: any) => ['emergency:screen:show:xian'].includes(item));
let flag3 =
result?.codeList?.find((item: any) => ['emergency:screen:show:centralScreen'].includes(item)) ||
userInfo?.roleCodes.split(',').findIndex((item: any) => item === 'large_screen' || item === 'large_screen_admin') > -1;
let flag4 = result?.codeList?.find((item: any) => ['emergency:screen:show:qinghai'].includes(item));
userStore.setFlag1(flag1 || '');
userStore.setFlag2(flag2 || '');
userStore.setFlag3(flag3 || '');
userStore.setFlag4(flag4 || '');
if (!flag1 && !flag2 && !flag3) {
if (!flag3) {
userStore.setToken('');
userStore.setUserInfo({});
userStore.setUserInfo(null);
userStore.setCenterInfo({});
return message.warn('您没有权限访问大屏,请联系管理员!');
}
//1如果有权限 2025-06-16补充判断,如果登陆路由为qLogin 青海登陆,则不走原有逻辑
//1.2若果是有两种权限
// debugger;
if (route.path === PageEnum.Q_SCREEN_LOGIN && flag4) {
goPath = PageEnum.Q_SCREEN;
} else if (flag1 && flag2) {
// 1.2.1 如果是登录地址是西安
// 1.2.2 如果是登录地址是银川
if (route.path == PageEnum.BASE_LOGIN_YINCHUAN) {
goPath = PageEnum.YINCHUAN_HOME;
} else if (route.path == PageEnum.BASE_LOGIN) {
goPath = PageEnum.BASE_HOME;
} else if (route.path == PageEnum.CENTRAL_SCREEN_LOGIN) {
// goPath = PageEnum.CENTRAL_SCREEN;
goPath = centerInfo?.screenPath || PageEnum.CENTRAL_SCREEN;
}
} else {
if (flag1) {
goPath = PageEnum.YINCHUAN_HOME;
} else if (flag2) {
goPath = PageEnum.BASE_HOME;
} else if (flag3) {
// goPath = PageEnum.CENTRAL_SCREEN;
goPath = centerInfo?.screenPath || PageEnum.CENTRAL_SCREEN;
} else {
userStore.setToken('');
userStore.setUserInfo({});
userStore.setCenterInfo({});
return message.warn('没有权限请联系管理员!');
}
}
} else {
return message.warn(msg);
goPath = PageEnum.BASE_HOME;
}
notification.success({
message: t('login.loginSuccessTitle'),