This commit is contained in:
zk
2024-07-08 17:08:39 +08:00
parent e367d13c78
commit e625073dcc
6 changed files with 33 additions and 25 deletions
@@ -6,6 +6,7 @@ export enum Api {
getMonitorList = '/health-watch/watch/watchMonitorData/getMonitorList', getMonitorList = '/health-watch/watch/watchMonitorData/getMonitorList',
sleepApi = '/health-watch/watch/watchData/getSleep', sleepApi = '/health-watch/watch/watchData/getSleep',
stepApi = '/health-watch/watch/watchData/getSdc', stepApi = '/health-watch/watch/watchData/getSdc',
listCustom = 'health-watch/watch/watchMonitorData/listCustom',
} }
// 单位- // 单位-
@@ -20,3 +21,6 @@ export const getMonitorList = (params: any) => get(Api.getMonitorList, params);
export const getSleep = (params: any) => post(Api.sleepApi, params); export const getSleep = (params: any) => post(Api.sleepApi, params);
// 右-步数 // 右-步数
export const getStep = (params: any) => post(Api.stepApi, params); export const getStep = (params: any) => post(Api.stepApi, params);
//副屏-预警
export const getCustom = (params: any) => get(Api.listCustom, params);
@@ -190,8 +190,8 @@ export function useStep() {
export const monitorColumns = [ export const monitorColumns = [
{ {
title: '姓名', title: '姓名',
dataIndex: 'realName', dataIndex: 'userName',
key: 'realName', key: 'userName',
align: 'center', align: 'center',
}, },
{ {
@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<public-title title="预警" :theme-type="themeType"> <public-title title="预警" :theme-type="themeType">
<template #right><span class="right-text" :class="[themeType]" @click="viewDetail">查看详情</span></template> <template #right><span class="right-text" :class="[themeType]" @click="viewDetail">查看详情</span> </template>
</public-title> </public-title>
<div class="inner-screen"> <div class="inner-screen">
<a-table <a-table
@@ -33,7 +33,7 @@
import { onUnmounted, ref, watch } from 'vue'; import { onUnmounted, ref, watch } from 'vue';
import PublicTitle from '/@/components/publicTitle.vue'; import PublicTitle from '/@/components/publicTitle.vue';
import EarlyWarningDialog from '/@/views/components/earlyWarningDialog.vue'; import EarlyWarningDialog from '/@/views/components/earlyWarningDialog.vue';
import { getMonitorList } from '/@/components/secondaryScreen/commonApi.ts'; import { getCustom, getMonitorList } from '/@/components/secondaryScreen/commonApi.ts';
import { monitorColumns } from '/@/components/secondaryScreen/screen-right/screenRightHooks.ts'; import { monitorColumns } from '/@/components/secondaryScreen/screen-right/screenRightHooks.ts';
import $bus from '/@/utils/bus.ts'; import $bus from '/@/utils/bus.ts';
import { earlyWarning } from '/@/utils/busConstant.ts'; import { earlyWarning } from '/@/utils/busConstant.ts';
@@ -89,7 +89,7 @@
async function init(page) { async function init(page) {
try { try {
const { pageSize } = pagination.value; const { pageSize } = pagination.value;
const { code, result } = await getMonitorList({ pageSize, pageNo: page, orgCode: props.orgCode }); const { code, result } = await getCustom({ pageSize, pageNo: page, orgCode: props.orgCode });
if (code == 200) { if (code == 200) {
setSession(PAGE2_RIGHT3, JSON.stringify({ page, result })); setSession(PAGE2_RIGHT3, JSON.stringify({ page, result }));
setValue(result, page); setValue(result, page);
@@ -6,21 +6,22 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="info-left"> <div class="info-left">
<div v-for="item in detailLeft" :key="item.key"> <div v-for="item in detailLeft" :key="item.key" style="display: flex">
<template v-if="item.customRender"> <template v-if="item.customRender">
<span class="info-label">{{ item.name }}</span> <div class="info-label">{{ item.name }}</div>
<span class="info-value" v-html="item.customRender(item.value)"> </span> <div class="info-value" v-html="item.customRender(item.value)"></div>
</template> </template>
<template v-else> <template v-else>
<span class="info-label">{{ item.name }}</span> <div class="info-label">{{ item.name }}</div>
<span class="info-value">{{ item.value }}</span> <div class="info-value">{{ item.value }}</div>
</template> </template>
</div> </div>
</div> </div>
<div class="info-right"> <div class="info-right">
<div v-for="item in detailRight" :key="item.key" <div v-for="item in detailRight" :key="item.key" style="display: flex">
><span class="info-label">{{ item.name }}</span><span class="info-value">{{ item.value }}</span></div <div class="info-label">{{ item.name }}</div>
> <div class="info-value">{{ item.value }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -96,15 +97,18 @@
padding: 2% 0 2% 5%; padding: 2% 0 2% 5%;
display: flex; display: flex;
div { > div {
flex: 1;
line-height: 28px; line-height: 28px;
flex: 1;
.info-label { .info-label {
display: inline-flex; text-align: right;
font-weight: bold; font-weight: bold;
width: 70px; width: 100px;
justify-content: flex-end; }
.info-value {
width: calc(100% - 100px);
} }
} }
} }
@@ -154,7 +154,7 @@
Map.clearMarker(); Map.clearMarker();
return; return;
} }
Map.createMarker(data); Map.createMarker({ ...data, realName: data.userName });
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@@ -127,12 +127,12 @@ export function useAlarmDetail() {
{ {
name: '员工姓名', name: '员工姓名',
value: '', value: '',
key: 'realName', key: 'userName',
}, },
{ {
name: '部门名称', name: '部门名称',
value: '', value: '',
key: 'orgName', key: 'thirdDepart',
}, },
{ {
name: '手机号码', name: '手机号码',
@@ -149,8 +149,8 @@ export function useAlarmDetail() {
value: '', value: '',
key: '', key: '',
customRender: (record) => { customRender: (record) => {
if (record?.lat) { if (record?.address) {
return `${record.lat},${record.lon}`; return `${record.address}`;
} else { } else {
return `<span style="color: #eb3636;">${record?.gpsErrorMsg || ''}</span>`; return `<span style="color: #eb3636;">${record?.gpsErrorMsg || ''}</span>`;
} }
@@ -161,7 +161,7 @@ export function useAlarmDetail() {
{ {
name: '单位名称', name: '单位名称',
value: '', value: '',
key: 'orgName2', key: 'secondDepart',
}, },
{ {
name: '事件类型', name: '事件类型',