From c2022955a01eddadea950167d0f1b615844bbefa Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 24 七月 2025 10:27:32 +0800 Subject: [PATCH] qx --- src/views/system/tijian/index.vue | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 4a193d2..0869d55 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -2011,7 +2011,7 @@ if (isChineseChar(resultObj.data.sex)) { _this.form.cusSex = resultObj.data.sex == "濂�" ? 1 : 0 } else { - _this.form.cusSex = resultObj.data.sex; + _this.form.cusSex = resultObj.data.sex == "1" ? 0 : 1; } _this.form.cusNational = resultObj.data.mz; _this.form.cusBrithday = resultObj.data.csrq; @@ -2158,8 +2158,14 @@ }; websocket.onmessage = function (event) { var resultObj = JSON.parse(event.data); + const isChineseChar = (char) => /[\u4E00-\u9FA5]/.test(char) _this.form.cusName = resultObj.data.name; - _this.form.cusSex = resultObj.data.sex; + // _this.form.cusSex = resultObj.data.sex; + if (isChineseChar(resultObj.data.sex)) { + _this.form.cusSex = resultObj.data.sex == "濂�" ? 1 : 0 + } else { + _this.form.cusSex = resultObj.data.sex == "1" ? 0 : 1; + } _this.form.cusNational = resultObj.data.mz; _this.form.cusBrithday = resultObj.data.csrq; if (_this.form.cusBrithday) { -- Gitblit v1.8.0