1.优化
This commit is contained in:
2025-07-09 17:33:51 +08:00
parent cd1b085499
commit cf129e6d23
18 changed files with 48 additions and 60 deletions
-8
View File
@@ -10,24 +10,16 @@
import { onMounted, watch } from 'vue';
import { getEmergencyCenterApi } from '/@/api/user.ts';
import { useUserStore } from '/@/store/modules/user.ts';
import { useRouter } from 'vue-router';
import { getBaseLogin } from '/@/enum/pageEnum.ts';
dayjs.locale('zh-cn');
const locle = zhCN;
const userStore = useUserStore();
const router = useRouter();
onMounted(async () => {
try {
if (userStore.getToken) {
const { result } = await getEmergencyCenterApi();
if (result?.screenPath) {
router.replace(result?.screenPath);
} else {
router.replace('/home');
}
userStore.setCenterInfo(result);
}
} catch (e) {}
-1
View File
@@ -31,7 +31,6 @@ service.interceptors.response.use(
},
(error) => {
if (error.response) {
console.log('response', error.response);
switch (error.response.data.code) {
case 401:
// debugger;
+1 -3
View File
@@ -155,7 +155,7 @@ export const Map = {
if (lng) {
lon = lng;
}
if (!longitude || !latitude || !type) {
if (!lon || !lat || !type) {
continue;
}
// 创建一个 Icon
@@ -394,7 +394,6 @@ export const Map = {
});
this.driveLine.on('error', function (result) {
let str = '定位失败:';
console.log('error', result);
switch (result.info) {
case 'PERMISSION_DENIED':
str += '浏览器阻止了定位操作';
@@ -409,7 +408,6 @@ export const Map = {
str += '未知错误';
break;
}
console.log(str);
return false;
});
},
-1
View File
@@ -153,7 +153,6 @@
});
async function getScrollList() {
console.log(dayjs());
try {
const { code, result } = await getMonitorList({
pageSize: 10,
+1
View File
@@ -65,6 +65,7 @@
function initChart(chartData, total, color) {
let myChart = echarts.init(healthChart.value);
let options = circleRing(chartData, total, color);
console.log(options);
myChart.setOption(options);
window.addEventListener('resize', () => {
myChart.resize();
@@ -79,8 +79,14 @@
orgCode: String,
type: String,
themeType: String,
refreshState: {
type: Boolean,
default: () => false,
},
});
onMounted(() => {
init();
});
onMounted(() => {});
watch(props, () => {
init();
});
@@ -91,11 +97,12 @@
const { code, result } = await getWatchDataByOrgCode(props);
if (code == 200) {
setValue(result);
setSession(PAGE2_LEFT, JSON.stringify(result));
// setSession(PAGE2_LEFT, JSON.stringify(result));
}
console.log(dataList.value);
} catch {
const result = JSON.parse(getSession(PAGE2_LEFT));
setValue(result);
// const result = JSON.parse(getSession(PAGE2_LEFT));
// setValue(result);
}
}
-4
View File
@@ -208,11 +208,9 @@
}
onMounted(() => {
console.log(props.mapOptions);
const op = { el: 'xianmapContainer', option: props.mapOptions, innerLineOption: innerLineLight, outerLineOption: outerLineOption };
Map.initMap(op).then(() => {
getMapData(tabList[0].type);
console.log(getMapData(tabList[0].type), 123);
Map.map && Map.map.on('zoomend', setLevel);
Map.map && Map.map.on('zoomend', setLevel);
});
@@ -266,14 +264,12 @@
// console.log('绘制驾车路线完成');
searchFlag.value = false;
} else {
console.log('获取驾车数据失败:', result);
searchFlag.value = false;
}
});
AMap.Event.addListener(driving, 'complete', (res) => {
const data = JSON.parse(JSON.stringify(res));
searchFlag.value = false;
console.log('查询结果', data);
if (data.info == 'OK') {
const { routes } = data;
setTitle(routes[0]);
+1 -1
View File
@@ -2,6 +2,6 @@
const BASIC_MIN = 60 * 1000; //1min
const BASIC_SECOND = 1000; //1s
//副屏 心率、血氧、压力、睡眠、步数
export const DEFAULT_TIME = BASIC_MIN * 10;
export const DEFAULT_TIME = BASIC_MIN * 0.1;
//预警分页切换
export const PAGE_SWITCH = BASIC_SECOND * 3;
-1
View File
@@ -163,7 +163,6 @@ export const useUserStore = defineStore({
this.setToken('');
this.setUserInfo(null);
this.setLoginInfo(null);
console.log('goLogin', goLogin);
let path = getBaseLogin();
goLogin && router.replace({ path: path });
},
-1
View File
@@ -104,7 +104,6 @@ export function useSocket(p = basicPath, hasTimestamp: boolean = true) {
socket.value.onmessage = function (event) {
//如果获取到消息,心跳检测重置
heartCheck.reset().start(); //拿到任何消息都说明当前连接是正常的
console.log('收到消息:', event.data);
if (event.data != 'pong') {
let data = JSON.parse(event.data);
// socketData.value = data;
+1 -1
View File
@@ -50,7 +50,7 @@ export function visibleChartLabel(chartData) {
if (!flag) {
data.forEach((val) => {
if (val.value == 0) {
val.value = null;
val.value = 0;
}
});
}
-1
View File
@@ -50,7 +50,6 @@
watch(
() => props.record,
(nVal) => {
console.log('健康报警');
userInfo.value = nVal;
}
);
+2
View File
@@ -4,6 +4,7 @@ export enum Api {
organizationTree = '',
getDictByCode = '/sys/dict/getDictItems',
getDictByCode2 = '/sys/api/getDictItems',
mapList = '/health-watch/watch/watchDevice/selectDeptMapList',
}
// 组织机构tree
@@ -11,3 +12,4 @@ export const getOrganizationTree = () => get(Api.organizationTree);
export const getDictByCode = (params) => get(Api.getDictByCode + `/${params.code}`);
export const getDictByCode2 = (params) => Dictget(Api.getDictByCode2, params);
export const mapListApi = (params) => get(Api.mapList, params);
+23 -18
View File
@@ -35,14 +35,15 @@
</template>
<script setup lang="ts">
import { RollbackOutlined } from '@ant-design/icons-vue';
import { nextTick, onMounted, ref } from 'vue';
import { onMounted, ref } from 'vue';
import OneR from '/@/components/secondaryScreen/screen-right/oneR.vue';
import TwoR from '/@/components/secondaryScreen/screen-right/twoR.vue';
import ThreeR from '/@/components/secondaryScreen/screen-right/threeR.vue';
import SecondMap from '/@/components/secondaryScreen/secondMap/secondMap.vue';
import screenLeft from '/@/components/secondaryScreen/screen-left/screenLeft.vue';
import { Map } from '/@/assets/mapUtils/map';
import router from '/@/router';
import { useDepart, useTimeType } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
import { useTimeType } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
import { startTime, useTopTime } from '/@/utils/utils.ts';
import { useUserStore } from '/@/store/modules/user.ts';
import { useRefresh } from '/@/hooks/autoRefresh';
@@ -50,9 +51,9 @@
import { onUnmounted } from 'vue';
import { useTheme } from '/@/hooks/theme/useTheme.ts';
import { ThemeType } from '/@/utils/settings.ts';
import { allSecondaryDepartsApi } from '/@/views/indexSun/indexSun.api.ts';
import { mapListApi } from '/@/views/index.api.ts';
const option1 = ref([{ label: '全部', value: '' }]);
const option1 = ref([{ label: '新疆油田', value: 'A01' }]);
const { refreshState } = useRefresh(DEFAULT_TIME);
const store = useUserStore();
@@ -61,29 +62,21 @@
store.setThemeType(ThemeType.dark);
});
const { themeType } = useTheme();
const useStore = useUserStore();
const orgCode = ref();
const { option, fieldNames, setOrgCode } = useDepart();
const orgCode = ref('');
onMounted(() => {
const userInfo = useStore.getUserInfo;
let orgCodes = userInfo?.secondDepart?.orgCode;
if (orgCodes) {
nextTick(() => {
// orgCode.value = orgCodes;
orgCode.value = userInfo?.secondDepart?.orgCode;
setOrgCode(orgCodes);
});
}
orgCode.value = 'A01';
init();
document.addEventListener('visibilitychange', checkTabState);
getSecondDepart();
});
function getSecondDepart() {
allSecondaryDepartsApi({})
mapListApi({})
.then((res: any) => {
if (res.code === 200) {
let newArr: any[] = [];
const op: any[] = res?.result
? res.result.map((it: any) => {
newArr.push({ ...it, type: '6' });
return {
label: it.departName,
value: it.orgCode,
@@ -91,7 +84,19 @@
})
: [];
option1.value = option1.value.concat(op);
Map.createOverlay(newArr, {
content: (val) => {
return `<div style="
width: 21px;
height: 44px;
position: absolute;
left: -20px;
top: -20px;" title="${val?.departName}">
</div>`;
},
});
} else {
Map.removeOverlayGroup();
}
})
.catch((err) => {
@@ -231,7 +236,7 @@
}
.type-select {
width: 140px;
width: 200px;
margin-right: 10px;
:deep(.ant-select-selection-item) {
-2
View File
@@ -382,7 +382,6 @@
});
function handleThreeRClick(type) {
const textArr = ['心血管异常人员列表', '脑血管异常人员列表', '冠状CT异常人员列表'];
console.log(type);
indexModalTitle.value = textArr[type - 1];
indexColumn.value = threeRModalColumns;
modalApi.value = threeRModalApi;
@@ -421,7 +420,6 @@
});
}
function handleCenterMapClick(res) {
console.log(res, 'centerres');
indexColumn.value = centerMapColumns;
firstFormOne.value = centerMapFromList;
const params = {
+6 -10
View File
@@ -200,12 +200,12 @@
Map.map.on('moveend', logMapinfo);
return;
}
if (TabType.zhiShengJi == item.type) {
Map.createAircraft(aircraft);
return;
} else {
getMapData(item.type, { type: item.type });
}
// if (TabType.zhiShengJi == item.type) {
// Map.createAircraft(aircraft);
// return;
// } else {
// getMapData(item.type, { type: item.type });
// }
}
function watchInfoChangeTab(item: any) {
@@ -238,14 +238,12 @@
// console.log('绘制驾车路线完成');
searchFlag.value = false;
} else {
console.log('获取驾车数据失败:', result);
searchFlag.value = false;
}
});
AMap.Event.addListener(driving, 'complete', (res) => {
const data = JSON.parse(JSON.stringify(res));
searchFlag.value = false;
console.log('查询结果', data);
if (data.info == 'OK') {
const { routes } = data;
setTitle(routes[0]);
@@ -263,7 +261,6 @@
async function getMapData(type, params = { type: '' }) {
try {
console.log(type, params, 'asghujis');
const { code, result } = await mapApiSwitch(type, params);
if (code == 200) {
if (Array.isArray(result) && result.length > 0) {
@@ -339,7 +336,6 @@
}
function drawMarker(data: any) {
console.log(data);
const { lon, lat } = data;
if (!lon || !lat) {
Map.clearMarker();
-1
View File
@@ -130,7 +130,6 @@
}
function handleDataChange(type) {
console.log(formState.value, formRecord.value);
if (type == dataActity.value) return;
dataActity.value = type;
getField();
+2 -3
View File
@@ -154,8 +154,8 @@ export function infoContent1(res) {
return `
<div class="modal-box modal-box-normal">
<div class="modal-item">
<span class="item-one">单位</span>
<span class="item-two">${res.orgName ? res.orgName : '--'}</span>
<span class="item-one">${res.type === '1' ? '医院名称' : '救护车名称'}</span>
<span class="item-two">${res.name ? res.name : '--'}</span>
</div>
<div class="modal-item">
<span class="item-one">地点:</span>
@@ -538,7 +538,6 @@ export const centerMapColumns = [
dataIndex: 'checkType',
key: 'checkType',
customRender: ({ text }) => {
console.log(text, checkData);
const dddd = checkData.filter((item) => item.value == text);
return dddd[0].label;
},