姓名:
{{ userInfo?.realName }}
@@ -61,10 +61,12 @@
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';
const props = defineProps({
setting: Object,
});
+ const { themeType } = useTheme();
const emit = defineEmits(['emit-view-detail']);
const router = useRouter();
const { setSession, getSession } = useSession();
@@ -82,6 +84,9 @@
warnTime: '',
address: '',
});
+ onMounted(() => {
+ getScrollList();
+ });
/**
* @desc open员工信息
@@ -100,10 +105,6 @@
classOption.value.step = 0.3;
}
- onMounted(() => {
- getScrollList();
- });
-
/**
* @desc 终端报警
* */
@@ -209,8 +210,6 @@
}
.police-con {
- color: #ffffff;
- background-color: #00152b;
padding: 2% 0 2% 5%;
.con-item {
@@ -232,11 +231,7 @@
diff --git a/src/components/xianMap/xianMap.vue b/src/components/xianMap/xianMap.vue
new file mode 100644
index 0000000..c8627d4
--- /dev/null
+++ b/src/components/xianMap/xianMap.vue
@@ -0,0 +1,631 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 清空
+ 路线规划
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
{{ item.text }}
+
+
+
+
+
+
+
+
+
{{ item.name }}
+
相距{{ item.distance }}
+
驾车大约{{ item.driveTime }}
+
+
+
+
+
+
diff --git a/src/components/xianMap/xianMapApi.ts b/src/components/xianMap/xianMapApi.ts
new file mode 100644
index 0000000..5f51cc7
--- /dev/null
+++ b/src/components/xianMap/xianMapApi.ts
@@ -0,0 +1,11 @@
+import { get } from '/@/api/request.ts';
+
+export enum Api {
+ allList = '/health-emergency/emergency/tblAmbulanceGps/getAllList',
+ getAmbulanceList = '/health-emergency/emergency/tblAmbulanceGps/getAmbulanceList',
+}
+
+// 获取所有资源
+export const getAllList = (params) => get(Api.allList, params);
+//获取救护车GPS信息
+export const getAmbulanceList = (params) => get(Api.getAmbulanceList, params);
\ No newline at end of file
diff --git a/src/components/xianMap/xianMapHooks.ts b/src/components/xianMap/xianMapHooks.ts
new file mode 100644
index 0000000..45a1ec1
--- /dev/null
+++ b/src/components/xianMap/xianMapHooks.ts
@@ -0,0 +1,175 @@
+import { getAllList, getAmbulanceList } from '/@/components/xianMap/xianMapApi.ts';
+
+export enum TabType {
+ all = '', //所有资源
+ youTianYiYuan = '1', //油田医院
+ heZuoYiYuan = '2', //合作医院
+ yiLiaoDian = '3', //医疗点
+ jiuHuChe = '5', //救护车
+ zhiShengJi = '4', //直升机
+ diFangYiYuan = '6', //地方医院
+}
+
+export const tabList = [
+ {
+ name: '所有资源',
+ type: TabType.all,
+ },
+ {
+ name: '油田医院',
+ type: TabType.youTianYiYuan,
+ },
+ {
+ name: '医疗点',
+ type: TabType.yiLiaoDian,
+ },
+ {
+ name: '救护车',
+ type: TabType.jiuHuChe,
+ },
+ {
+ name: '合作医院',
+ type: TabType.heZuoYiYuan,
+ },
+ {
+ name: '地方医院',
+ type: TabType.diFangYiYuan,
+ },
+ // {
+ // name: '直升机',
+ // type: TabType.zhiShengJi,
+ // },
+ {
+ name: '急救路线',
+ },
+];
+
+export const helicopter = new URL('/@/assets/img/helicopter.png', import.meta.url).href;
+export const mapbg = new URL('/@/assets/img/helicopter.png', import.meta.url).href;
+export const alarmIcon = new URL('/@/assets/img/alarm-icon.png', import.meta.url).href;
+export const male = new URL('/@/assets/img/male.png', import.meta.url).href;
+export const female = new URL('/@/assets/img/female.png', import.meta.url).href;
+// 直升机位置数据
+export const aircraft = [
+ {
+ category: 3,
+ lon: '108.861377',
+ lat: '34.35965',
+ img: helicopter,
+ name: '直升机',
+ },
+ {
+ category: 3,
+ lon: '106.267358',
+ lat: '38.520079',
+ img: helicopter,
+ name: '直升机',
+ },
+ {
+ category: 3,
+ lon: '109.505282',
+ lat: '36.579381',
+ img: helicopter,
+ name: '直升机',
+ },
+ {
+ category: 3,
+ lon: '107.638372',
+ lat: '35.734218',
+ img: helicopter,
+ name: '直升机',
+ },
+];
+
+/**
+ * @desc 直升机文本
+ */
+export function aircraftContent() {
+ return `
+
+
+
+
+
+ 4009-120-999
+
+
+
+
`;
+}
+
+export function mapApiSwitch(type, params: any) {
+ const basicParams = {
+ lat: 34, //纬度34
+ lon: 108, //经度
+ };
+ // 全部 油田 医疗点 合作医院
+ if ([TabType.all, TabType.youTianYiYuan, TabType.yiLiaoDian, TabType.heZuoYiYuan, TabType.jiuHuChe, TabType.jiuHuChe].includes(type)) {
+ return getAllList({ ...basicParams, ...params });
+ }
+ // if ([TabType.jiuHuChe].includes(type)) {
+ // return getAmbulanceList({});
+ // }
+}
+
+export const mapIcon1 = new URL('/@/assets/img/mapIcon1.png', import.meta.url).href;
+export const mapIcon2 = new URL('/@/assets/img/mapIcon2.png', import.meta.url).href;
+export const mapIcon3 = new URL('/@/assets/img/mapIcon3.png', import.meta.url).href;
+export const mapIcon4 = new URL('/@/assets/img/mapIcon4.png', import.meta.url).href;
+export const mapIcon5 = new URL('/@/assets/img/mapIcon5.png', import.meta.url).href;
+export const mapIcon6 = new URL('/@/assets/img/mapIcon6.png', import.meta.url).href;
+
+export const legend1 = new URL('/@/assets/img/legend1.png', import.meta.url).href;
+export const legend2 = new URL('/@/assets/img/legend2.png', import.meta.url).href;
+export const legend3 = new URL('/@/assets/img/legend3.png', import.meta.url).href;
+export const legend4 = new URL('/@/assets/img/legend4.png', import.meta.url).href;
+export const legend5 = new URL('/@/assets/img/legend5.png', import.meta.url).href;
+export const legend6 = new URL('/@/assets/img/legend6.png', import.meta.url).href;
+
+export const legendList = [
+ { img: legend1, text: '油田医院' },
+ { img: legend2, text: '医疗点' },
+ { img: legend3, text: '救护车' },
+ { img: legend4, text: '合作医院' },
+ { img: legend5, text: '地方医院' },
+ // { img: legend6, text: '直升机' },
+];
+
+/**
+ * @description 秒转小时
+ * */
+export function convertSeconds(seconds: number) {
+ let hours = Math.floor(seconds / 3600);
+ let minutes = Math.floor((seconds % 3600) / 60);
+ let remainingSeconds = seconds % 60;
+ return {
+ hours: hours,
+ minutes: minutes,
+ seconds: remainingSeconds,
+ };
+}
+
+export function getTimeStr(time: number): string {
+ let str = '';
+ const { hours, minutes } = convertSeconds(time);
+ if (hours) {
+ str += hours + '小时';
+ }
+ if (minutes) {
+ str += minutes + '分钟';
+ }
+ return str;
+}
+
+export function convertMetersToKilometers(meters: number): number {
+ let kilometers = meters / 1000;
+ return Math.round(kilometers * 100) / 100;
+}
+
+export function getKmStr(distance: number): string {
+ if (!distance) return '';
+ let d = convertMetersToKilometers(distance);
+ return d >= 1 ? d + '公里' : d * 100 + '米';
+}
diff --git a/src/hooks/theme/useTheme.ts b/src/hooks/theme/useTheme.ts
new file mode 100644
index 0000000..ac4192a
--- /dev/null
+++ b/src/hooks/theme/useTheme.ts
@@ -0,0 +1,15 @@
+import { nextTick, onMounted, ref } from 'vue';
+import { useUserStore } from '/@/store/modules/user.ts';
+
+export function useTheme() {
+ const themeType = ref('light');
+ onMounted(() => {
+ const store = useUserStore();
+ nextTick(() => {
+ themeType.value = store.getThemeType;
+ });
+ });
+ return {
+ themeType,
+ };
+}
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 44409d8..b695e6f 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -14,6 +14,7 @@ export const useUserStore = defineStore({
userInfo: null,
//登录返回信息
loginInfo: null,
+ themeType: '', // dark 1, light 2
}),
getters: {
getUserInfo(): UserInfo {
@@ -25,6 +26,9 @@ export const useUserStore = defineStore({
getToken(): string {
return this.token || getAuthCache(TOKEN_KEY);
},
+ getThemeType(): string {
+ return this.themeType || getAuthCache('themeType');
+ },
},
actions: {
setToken(info: string | undefined) {
@@ -38,6 +42,10 @@ export const useUserStore = defineStore({
setLoginInfo(info: LoginInfo | null) {
this.loginInfo = info;
},
+ setThemeType(info: string | undefined) {
+ this.themeType = info ? info : '';
+ setAuthCache('themeType', info);
+ },
/**
* 登录事件
*/
diff --git a/src/utils/settings.ts b/src/utils/settings.ts
index 45b3e24..3ccf1a0 100644
--- a/src/utils/settings.ts
+++ b/src/utils/settings.ts
@@ -7,6 +7,11 @@ export enum DataType {
yinChuan = '2',
}
+export enum ThemeType {
+ dark = 'dark',
+ light = 'light',
+}
+
export enum SexType {
male = '2', //男
female = '1', //女
diff --git a/src/views/components/emergencyDialog.vue b/src/views/components/emergencyDialog.vue
index 4c627a1..89f0989 100644
--- a/src/views/components/emergencyDialog.vue
+++ b/src/views/components/emergencyDialog.vue
@@ -2,7 +2,7 @@