diff --git a/.env.development b/.env.development index 54fa899..ec71f38 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ -# VITE_APP_URL = 'http://192.168.3.116:8001/' -# VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' +VITE_APP_URL = 'http://192.168.3.116:8001/' +VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' -VITE_APP_URL = 'http://47.112.185.26:8001/' -VITE_APP_URL_WEBSOCKET = 'ws://47.112.185.26:8000/api/websocket' +# VITE_APP_URL = 'http://47.112.185.26:8001/' +# VITE_APP_URL_WEBSOCKET = 'ws://47.112.185.26:8000/api/websocket' # VITE_APP_URL = 'http://api.handcuff.zhuhaiguangdun.cn' # VITE_APP_URL_WEBSOCKET = 'ws://device.handcuff.zhuhaiguangdun.cn:8000/api/websocket' diff --git a/components.d.ts b/components.d.ts index 9207ae2..6953697 100644 --- a/components.d.ts +++ b/components.d.ts @@ -44,7 +44,6 @@ declare module '@vue/runtime-core' { ElUpload: typeof import('element-plus/es')['ElUpload'] Header: typeof import('./src/components/header.vue')['default'] InfoWindow: typeof import('./src/components/InfoWindow.vue')['default'] - MyComm: typeof import('./src/components/MyComm.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Sidebar: typeof import('./src/components/sidebar.vue')['default'] diff --git a/index.html b/index.html index 1b39ad8..7c9e053 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ securityJsCode: '83572bd6398cb4594c611f93f89b506a' } + src="https://webapi.amap.com/maps?v=1.4.15&key=e1e6dde852b57c61bacdcf1af21a3d9a&plugin=AMap.MouseTool&plugin=AMap.MarkerClusterer=AMap.PolygonEditor&plugin=AMap.PolyEditor&plugin=AMap.CircleEditor&plugin=AMap.MoveAnimation&plugin=AMap.PlaceSearch&plugin=AMap.AutoComplete&plugin=AMap.MoveAnimation"> diff --git a/src/api/index.d.ts b/src/api/index.d.ts index e4046a2..b3a6113 100644 --- a/src/api/index.d.ts +++ b/src/api/index.d.ts @@ -130,9 +130,11 @@ export namespace TLogin { export namespace TAccount { export interface IAdd { + id?: number | string; username: string; phone: string; name: string; + password?: string; orgId?: number | string; roleId: number | string; status: number; diff --git a/src/assets/img/dir-via-marker.png b/src/assets/img/dir-via-marker.png new file mode 100644 index 0000000..5b22a03 Binary files /dev/null and b/src/assets/img/dir-via-marker.png differ diff --git a/src/assets/img/end-marker.png b/src/assets/img/end-marker.png index 1bc8880..29c0d27 100644 Binary files a/src/assets/img/end-marker.png and b/src/assets/img/end-marker.png differ diff --git a/src/assets/img/start-marker.png b/src/assets/img/start-marker.png index bfa7779..d3552ba 100644 Binary files a/src/assets/img/start-marker.png and b/src/assets/img/start-marker.png differ diff --git a/src/layout/index.vue b/src/layout/index.vue index 7b92497..da85188 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -50,20 +50,20 @@ const onMessage = (res) => { }; onMounted(() => { - // const isReload = localStorage.getItem("isReload"); - // if (isReload !== "true") { - // ElMessageBox.alert("由于浏览器安全策略,用户必须点击屏幕才能播放告警声音", "提示", { - // confirmButtonText: "OK", - // callback: () => { - // localStorage.setItem("isReload", "true"); - // }, - // }); - // } + const isReload = localStorage.getItem("isReload"); + if (isReload !== "true") { + ElMessageBox.alert("由于浏览器安全策略,用户必须点击屏幕才能播放告警声音", "提示", { + confirmButtonText: "OK", + callback: () => { + localStorage.setItem("isReload", "true"); + }, + }); + } - // if (ws.socket == null) { - // ws.connect(); - // } - // ws.onMessage(onMessage); + if (ws.socket == null) { + ws.connect(); + } + ws.onMessage(onMessage); window.addEventListener("beforeunload", handleBeforeUnload); }); diff --git a/src/utils/mapCustom.js b/src/utils/mapCustom.js index 259f5b2..c0fc8eb 100644 --- a/src/utils/mapCustom.js +++ b/src/utils/mapCustom.js @@ -118,7 +118,6 @@ export class MapCustom { // 创建marker marker(option) { return new AMap.Marker({ - map: this.map, offset: new AMap.Pixel(-13, -26), ...option }) diff --git a/src/utils/webSocket.js b/src/utils/webSocket.js index 6da176f..4ae88c8 100644 --- a/src/utils/webSocket.js +++ b/src/utils/webSocket.js @@ -107,7 +107,7 @@ export default class WebSocketService { onMessage = (callback) => { this.socket.onmessage = (event) => { const data = JSON.parse(event.data); - console.log(data, 'onMessage'); + // console.log(data, 'onMessage'); if (data.cmd == "webLogin" && !data.code == 200) return this.webScoketLogin() callback && callback(data); diff --git a/src/views/incidentDispose/index.vue b/src/views/incidentDispose/index.vue index 942592b..eabcbec 100644 --- a/src/views/incidentDispose/index.vue +++ b/src/views/incidentDispose/index.vue @@ -64,9 +64,9 @@ - + @@ -127,7 +127,7 @@ const options = { trigger: "axis", formatter: function (params) { let unit = { 0: "次/分", 1: "%", 2: "℃" }; - var res = format(options.times[params[0].dataIndex]) + "
"; + var res = format(Number(params[0].name)) + "
"; res += params .map(function (param, index) { return param.marker + param.seriesName + ":" + param.value + unit[index] + "
"; @@ -149,8 +149,12 @@ const options = { type: "category", boundaryGap: false, data: [], + axisLabel: { + formatter: function (item) { + return format(Number(item), "HH:mm:ss"); + }, + }, }, - times: [], yAxis: { type: "value", }, @@ -270,8 +274,7 @@ const getData = async () => { if (res.healthData && res.healthData.length) { res.healthData.forEach((item) => { - options.times.push(item.time); - options.xAxis.data.push(format(item.time, "HH:mm:ss")); + options.xAxis.data.push(item.time); options.series[0].data.push(item.hr); options.series[1].data.push(item.bo); options.series[2].data.push(item.temp); diff --git a/src/views/monitoringCenter/deviceHistory.vue b/src/views/monitoringCenter/deviceHistory.vue index 95798cd..e949195 100644 --- a/src/views/monitoringCenter/deviceHistory.vue +++ b/src/views/monitoringCenter/deviceHistory.vue @@ -25,7 +25,7 @@ const options = { trigger: "axis", formatter: function (params) { let unit = { 心率: "次/分", 血氧: "%", 体表温度: "℃" }; - var res = format(options.times[params[0].dataIndex]) + "
"; + var res = format(Number(params[0].name)) + "
"; res += params .map(function (param, index) { return param.marker + param.seriesName + ":" + param.value + unit[param.seriesName] + "
"; @@ -34,10 +34,14 @@ const options = { return res; }, }, - times: [], xAxis: { type: "category", data: [], + axisLabel: { + formatter: function (item) { + return format(Number(item), "HH:mm:ss"); + }, + }, }, yAxis: { type: "value", @@ -84,10 +88,10 @@ const options = { const getOptionsData = (list: { time: string; value: number }[], name: string, color: string) => { options.xAxis.data = []; options.series.data = []; + if (list && list.length) { list.forEach((item) => { - options.times.push(item.time); - options.xAxis.data.push(format(item.time, "HH:mm:ss")); + options.xAxis.data.push(item.time); options.series.data.push(item.value); }); options.series.name = name; diff --git a/src/views/monitoringCenter/deviceInfo.vue b/src/views/monitoringCenter/deviceInfo.vue index fc1fa99..87d9181 100644 --- a/src/views/monitoringCenter/deviceInfo.vue +++ b/src/views/monitoringCenter/deviceInfo.vue @@ -54,6 +54,10 @@ 模式: {{ modeEnum[item.mode] }} +
+ 佩戴者: + {{ item.userNumber || "--" }} +
@@ -210,6 +214,10 @@ watch( color: #787878; font-size: 16px; text-align: right; + width: 80px; + white-space: nowrap; // 强制一行显示 + overflow: hidden; // 超出隐藏 + text-overflow: ellipsis; } } } diff --git a/src/views/monitoringCenter/deviceLocationMap.vue b/src/views/monitoringCenter/deviceLocationMap.vue index aeb5273..86406e6 100644 --- a/src/views/monitoringCenter/deviceLocationMap.vue +++ b/src/views/monitoringCenter/deviceLocationMap.vue @@ -58,26 +58,52 @@ const getLocateRecord = () => { image: ViaMarker, size: [20, 29], }); - + let markers = []; list.forEach((item, index) => { - let marker: any = ""; - if (index == 0) { - marker = newMap.marker({ icon: endIcon, position: [item.lng, item.lat], zIndex: 13 }); - } else if (index == list.length - 1) { - marker = newMap.marker({ icon: startIcon, position: [item.lng, item.lat], zIndex: 13 }); + if (list.length < 50) { + let marker: any = ""; + if (index == 0) { + marker = newMap.marker({ icon: endIcon, position: [item.lng, item.lat], zIndex: 13 }); + } else if (index == list.length - 1) { + marker = newMap.marker({ icon: startIcon, position: [item.lng, item.lat], zIndex: 13 }); + } else { + marker = newMap.marker({ icon: ViaIcon, position: [item.lng, item.lat], zIndex: 12 }); + } + marker.on("click", () => { + locationInfo.value = item; + InfoWin = newMap.infoWindow(); + InfoWin.open(newMap.map, marker.getPosition()); + }); + markers.push(marker); } else { - marker = newMap.marker({ icon: ViaIcon, position: [item.lng, item.lat], zIndex: 12 }); + if (index % 5 == 0) { + let marker: any = ""; + if (index == 0) { + marker = newMap.marker({ icon: endIcon, position: [item.lng, item.lat], zIndex: 13 }); + } else if (index == list.length - 1) { + marker = newMap.marker({ icon: startIcon, position: [item.lng, item.lat], zIndex: 13 }); + } else { + marker = newMap.marker({ icon: ViaIcon, position: [item.lng, item.lat], zIndex: 12 }); + } + marker.on("click", () => { + locationInfo.value = item; + InfoWin = newMap.infoWindow(); + InfoWin.open(newMap.map, marker.getPosition()); + }); + + markers.push(marker); + } } - marker.setMap(newMap.map); - marker.on("click", () => { - locationInfo.value = item; - InfoWin = newMap.infoWindow(); - InfoWin.open(newMap.map, marker.getPosition()); - }); }); + newMap.map.add(markers); } }); }; + +const fn = () => { + // this.cluster.on("click", this.clusterClickEvent); +}; + onMounted(() => { newMap = new MapCustom({ dom: "mapcontainer" }); getLocateRecord(); diff --git a/src/views/monitoringCenter/index.vue b/src/views/monitoringCenter/index.vue index 8e7879f..1d63b79 100644 --- a/src/views/monitoringCenter/index.vue +++ b/src/views/monitoringCenter/index.vue @@ -52,59 +52,6 @@ let funcList = ref([ { title: "当前体表温度", en: "DANGQIANTIBIAOWENDU", icon: temperature, unit: "℃", num: 0, color: "#FF6905" }, ]); -const options = { - tooltip: { - trigger: "axis", - formatter: function (params) { - let unit = { 心率: "次/分", 血氧: "%", 体表温度: "℃" }; - var res = format(options.times[params[0].dataIndex]) + "
"; - res += params - .map(function (param, index) { - return param.marker + param.seriesName + ":" + param.value + unit[param.seriesName] + "
"; - }) - .join(""); - return res; - }, - }, - times: [], - xAxis: { - type: "category", - data: [], - }, - yAxis: { - type: "value", - }, - grid: { - left: "5%", - right: "4%", - bottom: "20%", - }, - dataZoom: [ - { - show: true, // 是否显示 - start: 0, // 开始位置,百分比 - end: 10, // 结束位置,百分比 - bottom: "10px", - height: 25, - }, - { - type: "inside", - start: 0, - end: 100, - }, - ], - series: { - name: "", - data: [], - type: "line", - showSymbol: false, - itemStyle: { - color: "#ff4567", // 设置线条颜色 - }, - smooth: true, - }, -}; - const devicePaging = reactive({ page: 1, size: 10, @@ -135,7 +82,6 @@ const getHealthLatestData = () => { funcList.value[0].num = res.hr; funcList.value[1].num = res.bo; funcList.value[2].num = res.temp; - handelRadio(devHisRef.value.radio); }); }; diff --git a/src/views/statisticalCenter/index.vue b/src/views/statisticalCenter/index.vue index 3a9ca4d..affff4b 100644 --- a/src/views/statisticalCenter/index.vue +++ b/src/views/statisticalCenter/index.vue @@ -79,6 +79,11 @@ const option = ref({ type: "category", boundaryGap: false, data: [], + axisLabel: { + formatter: function (item) { + return format(item, "MM-DD"); + }, + }, }, yAxis: { type: "value", @@ -169,34 +174,36 @@ const getStatisticsUseCount = () => { }; const getStatisticsContent = (req) => { statisticsContent(req).then((res) => { - option.value.xAxis.data = res?.times; - option.value.series = [ - { - stack: "Total", - name: "SOS预警数组", - data: res?.sosArr, - type: "line", - }, - { - stack: "Total", - name: "围栏预警数组", - data: res?.railArr, - type: "line", - }, - { - stack: "Total", - name: "破坏预警数组", - data: res?.destroyArr, - type: "line", - }, - { - stack: "Total", - name: "生理预警数组", - data: res?.healthArr, - type: "line", - }, - ]; - myChart.setOption(option.value); + if (res.times && res.times.length) { + option.value.xAxis.data = res.times; + option.value.series = [ + { + stack: "Total", + name: "SOS预警数组", + data: res?.sosArr, + type: "line", + }, + { + stack: "Total", + name: "围栏预警数组", + data: res?.railArr, + type: "line", + }, + { + stack: "Total", + name: "破坏预警数组", + data: res?.destroyArr, + type: "line", + }, + { + stack: "Total", + name: "生理预警数组", + data: res?.healthArr, + type: "line", + }, + ]; + myChart.setOption(option.value); + } }); }; const getStatisticsCount = () => { diff --git a/src/views/synthesizeManage/deviceInfo/index.vue b/src/views/synthesizeManage/deviceInfo/index.vue index c93679a..37ab91c 100644 --- a/src/views/synthesizeManage/deviceInfo/index.vue +++ b/src/views/synthesizeManage/deviceInfo/index.vue @@ -7,18 +7,18 @@
手铐序号:{{ query.id }}
-
绑定管理员:{{ query.name }}
+
绑定管理员:{{ query.adminName }}
设备状态:{{ statusEnum[query.status as string] }}
IMEI号:{{ query.deviceId }}
-
绑定管理者账号:{{ query.username }}
+
绑定管理者账号:{{ query.adminUsername }}
当前电量:{{ query.battery }}%
首次绑定时间:{{ query.createTime }}
隶属组织:{{ query.orgName }}
-
联系电话:{{ query.phone }}
+
联系电话:{{ query.adminPhone }}
固件版本:{{ query.deviceVersion }}
@@ -33,6 +33,9 @@ + @@ -95,6 +98,7 @@ let record = ref([ { prop: "userNumber", label: "佩戴者" }, { prop: "createTime", label: "开始使用时间" }, { prop: "updateTime", label: "结束使用时间" }, + { prop: "operator", label: "操作" }, ]); // 表格相关 diff --git a/src/views/synthesizeManage/deviceManage/index.vue b/src/views/synthesizeManage/deviceManage/index.vue index a6e50fe..343c9bb 100644 --- a/src/views/synthesizeManage/deviceManage/index.vue +++ b/src/views/synthesizeManage/deviceManage/index.vue @@ -93,7 +93,7 @@ const editOp = [ // 查询相关 const query = reactive({}); const searchOpt = ref([ - { type: "input", label: "手铐SN:", prop: "deviceId" }, + { type: "input", label: "IMEI:", prop: "deviceId" }, { type: "input", label: "警察名称:", prop: "name" }, { type: "select", diff --git a/src/views/synthesizeManage/setting/index.vue b/src/views/synthesizeManage/setting/index.vue index d819b58..414c2ca 100644 --- a/src/views/synthesizeManage/setting/index.vue +++ b/src/views/synthesizeManage/setting/index.vue @@ -16,7 +16,7 @@
- +
diff --git a/src/views/synthesizeManage/userManage/addUser.vue b/src/views/synthesizeManage/userManage/addUser.vue index 0461553..459d563 100644 --- a/src/views/synthesizeManage/userManage/addUser.vue +++ b/src/views/synthesizeManage/userManage/addUser.vue @@ -9,6 +9,9 @@ + + + @@ -45,8 +48,8 @@ const { orgAllData, formData, api } = defineProps({ dfault: () => {}, }, formData: { - type: Object, - required: true, + type: Object as PropType, + default: () => {}, }, api: { type: Function, @@ -54,20 +57,20 @@ const { orgAllData, formData, api } = defineProps({ }); const emit = defineEmits(["close"]); -const ruleForm = reactive( +const ruleForm = reactive( formData ? { ...formData } : { name: "", phone: "", username: "", + password: "111111", roleId: "", orgId: "", status: 1, } ); -onMounted(() => {}); const rules = reactive>({ name: [{ required: true, message: "请输入用户名称", trigger: "blur" }], phone: [ diff --git a/src/views/synthesizeManage/userManage/resetPwd.vue b/src/views/synthesizeManage/userManage/resetPwd.vue index 5f34c9a..7f727ce 100644 --- a/src/views/synthesizeManage/userManage/resetPwd.vue +++ b/src/views/synthesizeManage/userManage/resetPwd.vue @@ -1,7 +1,7 @@