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