From 1eaceed61b2a79336a35c51f7624a7a7d1ff24c6 Mon Sep 17 00:00:00 2001 From: liaozetao <1107136310@qq.com> Date: Mon, 17 Jun 2024 14:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=91=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/nameplate/NameplateInfoView.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/nameplate/NameplateInfoView.vue b/src/views/nameplate/NameplateInfoView.vue index e0d0206..9fb2ab2 100644 --- a/src/views/nameplate/NameplateInfoView.vue +++ b/src/views/nameplate/NameplateInfoView.vue @@ -391,7 +391,7 @@ export default { request.success({ "rows": res.rows.map(i=>{ let nameValue = i.name; - if (nameValue.startsWith('{') && nameValue.endsWith('}')) { + if (nameValue && nameValue.startsWith('{') && nameValue.endsWith('}')) { i.name = JSON.parse(i.name); } else { i.name = { @@ -401,7 +401,7 @@ export default { }; } let fixedWordValue = i.fixedWord; - if (fixedWordValue.startsWith('{') && fixedWordValue.endsWith('}')) { + if (fixedWordValue && fixedWordValue.startsWith('{') && fixedWordValue.endsWith('}')) { i.fixedWord = JSON.parse(i.fixedWord); } else { i.fixedWord = { @@ -448,7 +448,7 @@ export default { $("#id").val(json.id); $("#nameplateType1").val(json.nameplateType); let name = json.name; - if (name.startsWith('{') && name.endsWith('}')) { + if (name && name.startsWith('{') && name.endsWith('}')) { var jsonName = JSON.parse(json.name); console.log(jsonName) $("#name1").val(jsonName.zh); @@ -460,7 +460,7 @@ export default { $("#en_name1").val(name); } let fixedWord = json.fixedWord; - if (fixedWord.startsWith('{') && fixedWord.endsWith('}')) { + if (fixedWord && fixedWord.startsWith('{') && fixedWord.endsWith('}')) { let jsonValue = JSON.parse(json.fixedWord); $('#zhFixedWord').val(jsonValue.zh); $('#arFixedWord').val(jsonValue.ar);