From 7bd45dfd444d402e3ffd53169641acd56766ba17 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Wed, 5 Jan 2022 13:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=87=E5=AD=97=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-domain/left-domain.component.html | 4 ++-- .../left-domain/left-domain.component.ts | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/app/pages/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html index e51375e..555a440 100644 --- a/src/app/pages/left-domain/left-domain.component.html +++ b/src/app/pages/left-domain/left-domain.component.html @@ -74,7 +74,7 @@

-

+

@@ -101,7 +101,7 @@

-

+

diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index b1665e1..d9021f9 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -207,6 +207,26 @@ export class LeftDomainComponent implements OnInit { //编辑模式 } + //是否换行 + isLineFeed(str: string):boolean { + if (str) { + let strlen = 0; + for (var i = 0;i < str.length; i++) { + if(str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2 + strlen += 2; + else + strlen++; + } + if (strlen >= 16) { + return false + } else { + return true + } + } else { + return true + } + } + //获取设备 数量 getFacilityNum(type: string): string { let num = 0