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',
sleepApi = '/health-watch/watch/watchData/getSleep',
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 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 = [
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
dataIndex: 'userName',
key: 'userName',
align: 'center',
},
{
@@ -214,4 +214,4 @@ export const monitorColumns = [
slots: { customRender: 'address' },
width: 40,
},
];
];
@@ -1,7 +1,7 @@
<template>
<div>
<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>
<div class="inner-screen">
<a-table
@@ -33,7 +33,7 @@
import { onUnmounted, ref, watch } from 'vue';
import PublicTitle from '/@/components/publicTitle.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 $bus from '/@/utils/bus.ts';
import { earlyWarning } from '/@/utils/busConstant.ts';
@@ -89,7 +89,7 @@
async function init(page) {
try {
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) {
setSession(PAGE2_RIGHT3, JSON.stringify({ page, result }));
setValue(result, page);
@@ -6,21 +6,22 @@
</div>
<div class="modal-body">
<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">
<span class="info-label">{{ item.name }}</span>
<span class="info-value" v-html="item.customRender(item.value)"> </span>
<div class="info-label">{{ item.name }}</div>
<div class="info-value" v-html="item.customRender(item.value)"></div>
</template>
<template v-else>
<span class="info-label">{{ item.name }}</span>
<span class="info-value">{{ item.value }}</span>
<div class="info-label">{{ item.name }}</div>
<div class="info-value">{{ item.value }}</div>
</template>
</div>
</div>
<div class="info-right">
<div v-for="item in detailRight" :key="item.key"
><span class="info-label">{{ item.name }}</span><span class="info-value">{{ item.value }}</span></div
>
<div v-for="item in detailRight" :key="item.key" style="display: flex">
<div class="info-label">{{ item.name }}</div>
<div class="info-value">{{ item.value }}</div>
</div>
</div>
</div>
</div>
@@ -96,15 +97,18 @@
padding: 2% 0 2% 5%;
display: flex;
div {
flex: 1;
> div {
line-height: 28px;
flex: 1;
.info-label {
display: inline-flex;
text-align: right;
font-weight: bold;
width: 70px;
justify-content: flex-end;
width: 100px;
}
.info-value {
width: calc(100% - 100px);
}
}
}
@@ -154,7 +154,7 @@
Map.clearMarker();
return;
}
Map.createMarker(data);
Map.createMarker({ ...data, realName: data.userName });
}
</script>
<style lang="less" scoped>
@@ -127,12 +127,12 @@ export function useAlarmDetail() {
{
name: '员工姓名',
value: '',
key: 'realName',
key: 'userName',
},
{
name: '部门名称',
value: '',
key: 'orgName',
key: 'thirdDepart',
},
{
name: '手机号码',
@@ -149,8 +149,8 @@ export function useAlarmDetail() {
value: '',
key: '',
customRender: (record) => {
if (record?.lat) {
return `${record.lat},${record.lon}`;
if (record?.address) {
return `${record.address}`;
} else {
return `<span style="color: #eb3636;">${record?.gpsErrorMsg || ''}</span>`;
}
@@ -161,7 +161,7 @@ export function useAlarmDetail() {
{
name: '单位名称',
value: '',
key: 'orgName2',
key: 'secondDepart',
},
{
name: '事件类型',