修改msdData解析方法

This commit is contained in:
lai
2025-08-08 09:51:33 +08:00
parent 0ac4e1b7ff
commit 886fb7a7c0

View File

@@ -567,7 +567,15 @@ function wsMessage(res: Record<string, any>) {
function fnModalVisibleByEdit(record: Record<string, any>) {
modalState.title = t('common.viewText') + t('views.dashboard.cdr.msd');
modalState.openByView = true;
modalState.from = Object.assign(modalState.from, record.cdrJSON.msdData);
let msdDataObj = {};
try {
msdDataObj = JSON.parse(record.cdrJSON.msdData);
} catch (e) {
msdDataObj = {};
}
modalState.from = Object.assign(modalState.from, msdDataObj);
// if (!record || !record.cdrJSON) return;
// const cdrJSON = record.cdrJSON;
// Modal.info({
@@ -855,9 +863,11 @@ onBeforeUnmount(() => {
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'msdData'">
<a-button type="link" @click.prevent="fnModalVisibleByEdit(record)"
:disabled="!record.cdrJSON.msdData"
>
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record)"
:disabled="!record.cdrJSON.msdData"
>
<template #icon><InfoCircleOutlined /></template>
</a-button>
</template>
@@ -1019,8 +1029,7 @@ onBeforeUnmount(() => {
:labelWrap="false"
>
<a-row :gutter="[32, 4]">
<a-col :lg="12" :md="12" :xs="24">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.dashboard.cdr.messageIdentifier')"
name="messageIdentifier"
@@ -1044,9 +1053,7 @@ onBeforeUnmount(() => {
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.dashboard.cdr.timestamp')"
name="timestamp"
@@ -1070,9 +1077,6 @@ onBeforeUnmount(() => {
</a-form-item>
</a-col>
<a-divider orientation="left">
{{ t('views.dashboard.cdr.control') }}
</a-divider>
@@ -1122,8 +1126,6 @@ onBeforeUnmount(() => {
</a-form-item>
</a-col>
<a-divider orientation="left">
{{ t('views.dashboard.cdr.recentVehicleLocationN1') }}
</a-divider>
@@ -1188,8 +1190,6 @@ onBeforeUnmount(() => {
</a-form-item>
</a-col>
<a-divider orientation="left">
{{ t('views.dashboard.cdr.vehicleIdentificationNumber') }}
</a-divider>
@@ -1234,10 +1234,7 @@ onBeforeUnmount(() => {
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.dashboard.cdr.isowmi')"
name="isowmi"
>
<a-form-item :label="t('views.dashboard.cdr.isowmi')" name="isowmi">
<a-input
:disabled="true"
v-model:value="