diff --git a/package.json b/package.json
index 4f81fce..f2e0826 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"@amap/amap-jsapi-loader": "^1.0.1",
"axios": "^1.6.2",
"dayjs": "^1.11.10",
+ "lodash-es": "^4.17.21",
"mitt": "^3.0.1",
"path": "^0.12.7",
"prettier": "^3.1.0",
diff --git a/src/assets/img/watch.png b/src/assets/img/watch.png
new file mode 100644
index 0000000..f6672bd
Binary files /dev/null and b/src/assets/img/watch.png differ
diff --git a/src/assets/mapUtils/commonFun.ts b/src/assets/mapUtils/commonFun.ts
index 6891e80..9effefb 100644
--- a/src/assets/mapUtils/commonFun.ts
+++ b/src/assets/mapUtils/commonFun.ts
@@ -1,4 +1,5 @@
import { mapIcon1, mapIcon2, mapIcon3, mapIcon4 } from '/@/components/chinaMap/chinaHooks.ts';
+import { watchIcon } from '/@/components/secondaryScreen/secondMap/secondMapHooks.ts';
/**
* @desc 创建icon
@@ -33,6 +34,9 @@ export function typeToIcon(type: string) {
if (type == '4') {
return createIcon({ icon: mapIcon3, iconSize, imageSize });
}
+ if (type == '6') {
+ return createIcon({ icon: watchIcon, iconSize: [21, 44], imageSize: [21, 44] });
+ }
}
/**
diff --git a/src/assets/mapUtils/map.ts b/src/assets/mapUtils/map.ts
index 1f0fb05..ade6017 100644
--- a/src/assets/mapUtils/map.ts
+++ b/src/assets/mapUtils/map.ts
@@ -2,6 +2,7 @@ import china from '/@/assets/lngLat/china.ts';
import chinaInner from '/@/assets/lngLat/chinaInner.ts';
import { createCircle, createIcon, typeToIcon } from '/@/assets/mapUtils/commonFun.ts';
import { aircraftContent, alarmIcon } from '/@/components/chinaMap/chinaHooks.ts';
+import { isFunction } from '/@/utils/is.ts';
export const defaultOption = {
center: [106.3, 37.87], //地图中心点
@@ -87,7 +88,7 @@ export const Map = {
* @desc 创建覆盖物组,用于批量处理点 (控制显隐,点击事件等)
* @param result
*/
- createOverlay(result) {
+ createOverlay(result, { extOption = {}, content }, callback) {
this.removeOverlayGroup();
this.overlayGroup = new AMap.OverlayGroup();
for (let i = 0; i < result.length; i++) {
@@ -104,10 +105,12 @@ export const Map = {
icon: startIcon, //启用点击事件 如果需要点击事件,必须开启
clickable: true, //点额外携带的数据,用户自定义属性,支持JavaScript API任意数据类型
extData: result[i],
+ label: {
+ content: isFunction(content) && content(result[i]),
+ },
+ ...extOption,
});
// 可以调用setExtData()设置自定义属性
- //startMarker.setExtData('222')
-
//将组 挂载到地图上
this.overlayGroup.setMap(this.map);
//将需要批量控制的点放到一个组中,通过控制组,就可以操作组内所有所有覆盖物
@@ -115,10 +118,10 @@ export const Map = {
}
this.overlayGroup.on('click', function (e) {
- //e.target触发事件的点对象
- console.log(e.target);
//拿到点中携带的数据
- console.log(e.target.getExtData());
+ // console.log(e.target.getExtData());
+ if (!isFunction(callback)) return;
+ callback(e.target.getExtData());
});
},
clearOverlay() {
diff --git a/src/components/secondaryScreen/secondMap/components/footerDialog.vue b/src/components/secondaryScreen/secondMap/components/footerDialog.vue
new file mode 100644
index 0000000..0d0f2c2
--- /dev/null
+++ b/src/components/secondaryScreen/secondMap/components/footerDialog.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
员工姓名:213
+
员工姓名:213
+
员工姓名:213
+
+
+
员工姓名:213
+
员工姓名:213
+
员工姓名:213
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/secondaryScreen/secondMap/secondMap.vue b/src/components/secondaryScreen/secondMap/secondMap.vue
index d59c8ea..9c83a5f 100644
--- a/src/components/secondaryScreen/secondMap/secondMap.vue
+++ b/src/components/secondaryScreen/secondMap/secondMap.vue
@@ -2,29 +2,109 @@
+
\ No newline at end of file
diff --git a/src/components/secondaryScreen/secondMap/secondMapApi.ts b/src/components/secondaryScreen/secondMap/secondMapApi.ts
index 5f51cc7..c02e7b5 100644
--- a/src/components/secondaryScreen/secondMap/secondMapApi.ts
+++ b/src/components/secondaryScreen/secondMap/secondMapApi.ts
@@ -1,11 +1,7 @@
import { get } from '/@/api/request.ts';
export enum Api {
- allList = '/health-emergency/emergency/tblAmbulanceGps/getAllList',
- getAmbulanceList = '/health-emergency/emergency/tblAmbulanceGps/getAmbulanceList',
+ footerStatistic = '/health-watch/watch/deptStatisticData/list',
}
-// 获取所有资源
-export const getAllList = (params) => get(Api.allList, params);
-//获取救护车GPS信息
-export const getAmbulanceList = (params) => get(Api.getAmbulanceList, params);
\ No newline at end of file
+export const footerApi = (params) => get(Api.footerStatistic, params);
\ No newline at end of file
diff --git a/src/components/secondaryScreen/secondMap/secondMapHooks.ts b/src/components/secondaryScreen/secondMap/secondMapHooks.ts
index e7436e2..9884eee 100644
--- a/src/components/secondaryScreen/secondMap/secondMapHooks.ts
+++ b/src/components/secondaryScreen/secondMap/secondMapHooks.ts
@@ -12,30 +12,29 @@
// type: TabType.yiLiaoDian,
// },
// ];
-
-import {onMounted, ref} from "vue";
+import {cloneDeep} from 'lodash-es';
+import {nextTick, onMounted, ref} from "vue";
import {allSecondaryDeparts} from "/@/components/secondaryScreen/commonApi";
-export function useDepart({selectOption = [],}) {
+export const watchIcon = new URL('/@/assets/img/watch.png', import.meta.url).href;
+
+export function useDepart() {
const orgCode = ref();
const option = ref([]);
const fieldNames = {label: 'departName', value: 'orgCode',}
onMounted(() => {
- if (selectOption && Array.isArray(selectOption) && selectOption.length > 0) {
- setOption(selectOption);
- } else {
- getOptionData();
- }
+ getOptionData();
});
- function setOption(option) {
- option.value = selectOption || option;
+ function setOption(data) {
+ option.value = data;
+ orgCode.value = data[0]?.orgCode
}
async function getOptionData() {
const {result, code} = await allSecondaryDeparts();
if (code == 200) {
- option.value = result;
+ setOption(result)
}
}
@@ -67,4 +66,61 @@ export function useTimeType(t) {
type,
timeRangeOption
}
+}
+
+export function useFooterTable() {
+ const footerList = ref([
+ {
+ name: '单位名称',
+ value: '',
+ key: 'orgName'
+ },
+ {
+ name: '单位人数',
+ value: '',
+ key: 'userCount'
+ },
+ {
+ name: '入库设备数量',
+ value: '',
+ key: 'deviceNum'
+ },
+ {
+ name: '佩戴手表人数',
+ value: '',
+ key: 'allotDeviceNum'
+ },
+ {
+ name: '近一周活跃人数',
+ value: '',
+ key: 'sevenDayNum'
+ },
+ {
+ name: '近一月活跃人数',
+ value: '',
+ key: 'a'
+ },
+ {
+ name: '近一年活跃人数',
+ value: '',
+ key: 'b'
+ }
+ ])
+
+ function setFooterList(res: any) {
+
+ const arrList = cloneDeep(footerList.value)
+ if (res) {
+ arrList.forEach(item => {
+ item.value = res[item.key] || ''
+ })
+ }
+ footerList.value = arrList
+
+ }
+
+ return {
+ footerList,
+ setFooterList
+ }
}
\ No newline at end of file
diff --git a/src/utils/is.ts b/src/utils/is.ts
new file mode 100644
index 0000000..73a9e6e
--- /dev/null
+++ b/src/utils/is.ts
@@ -0,0 +1,12 @@
+const objectToString = Object.prototype.toString;
+const toTypeString = (value: any) => objectToString.call(value);
+
+export const { isArray } = Array;
+export const isMap = (val: any) => toTypeString(val) === '[object Map]';
+export const isSet = (val: any) => toTypeString(val) === '[object Set]';
+export const isDate = (val: any) => val instanceof Date;
+export const isFunction = (val: any) => typeof val === 'function';
+export const isString = (val: any) => typeof val === 'string';
+export const isSymbol = (val: any) => typeof val === 'symbol';
+export const isObject = (val: null) => val !== null && typeof val === 'object';
+export const isPromise = (val: any) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 3a539b8..cbd9d9c 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -22,4 +22,8 @@ export function useTopTime() {
timeLeft,
timeRight,
};
+}
+
+export function getToday() {
+ return dayjs().format('YYYY-MM-DD');
}
\ No newline at end of file
diff --git a/src/views/indexSon.vue b/src/views/indexSon.vue
index 364f20e..f13959a 100644
--- a/src/views/indexSon.vue
+++ b/src/views/indexSon.vue
@@ -14,17 +14,19 @@
-
+
@@ -166,25 +168,24 @@ const {type, timeRangeOption} = useTimeType('week');
}
}
- .body-d-left {
- > :nth-child(n) {
- width: 100%;
- height: calc(100% / 4);
- padding: 10px;
+ .body-d-left {
+ > :nth-child(n) {
+ width: 100%;
+ height: calc(100% / 4);
+ padding: 10px;
+ }
+ }
+
+ .body-d-middle {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .type-select {
+ width: 140px;
+ margin-right: 10px;
+ }
}
- }
-
- .body-d-middle {
- display: flex;
- flex-direction: column;
- }
-
- .type-select {
- width: 120px;
- color: #008cff;
- margin-right: 10px;
- }
-}
.bottom-d {
height: 40px;