From 756f8a63347119f511fc964bf1e2ff2417339c56 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 11 一月 2024 17:16:42 +0800
Subject: [PATCH] update: 改寫 lodash 方法為純 js

---
 PAMapp/pages/agentInfo/edit/_agentNo.vue |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/PAMapp/pages/agentInfo/edit/_agentNo.vue b/PAMapp/pages/agentInfo/edit/_agentNo.vue
index e4cb6f6..cb4f9b3 100644
--- a/PAMapp/pages/agentInfo/edit/_agentNo.vue
+++ b/PAMapp/pages/agentInfo/edit/_agentNo.vue
@@ -264,7 +264,6 @@
 import { Context } from '@nuxt/types';
 import { namespace } from 'nuxt-property-decorator';
 import { Vue, Component, Prop } from 'vue-property-decorator';
-import * as _ from "lodash";
 
 import myConsultantService from '~/shared/services/my-consultant.service';
 import accountSettingService from '~/shared/services/account-setting.service';
@@ -410,7 +409,7 @@
 
     this.editInfoValue = {
       ...this.defaultAgentInfoSetting,
-      expertise: _.cloneDeep(this.defaultAgentInfoSetting.expertise),
+      expertise: JSON.parse(JSON.stringify(this.defaultAgentInfoSetting.expertise)),
       communicationStyle: this.defaultAgentInfoSetting.communicationStyle?.split('��') || [],
     };
   }
@@ -467,11 +466,11 @@
   }
 
   get phoneValid(): boolean {
-            const rule = /^09[0-9]{8}$/;
-            return this.editInfoValue.phoneNumber
-            ? rule.test(this.editInfoValue.phoneNumber) && _.isEqual(this.editInfoValue.phoneNumber.length,10)
-            : true;
-        }
+    const rule = /^09[0-9]{8}$/;
+    return this.editInfoValue.phoneNumber
+      ? rule.test(this.editInfoValue.phoneNumber) && this.editInfoValue.phoneNumber.length === 10
+      : true;
+  }
 
   get emailValid() {
       const rule = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;

--
Gitblit v1.8.0