From a647b8fb3c96791c126dcf26c78676adc35c670f Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期五, 27 十月 2023 17:12:18 +0800
Subject: [PATCH] 修改编码规则管理基础码段编辑bug,修改ts日期转换报错bug

---
 Source/UBCS-WEB/src/views/code/code.vue |   70 +++++++++++++++-------------------
 1 files changed, 31 insertions(+), 39 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/code/code.vue b/Source/UBCS-WEB/src/views/code/code.vue
index b8dddd0..ccc8e0c 100644
--- a/Source/UBCS-WEB/src/views/code/code.vue
+++ b/Source/UBCS-WEB/src/views/code/code.vue
@@ -1186,9 +1186,7 @@
           </el-row>
         </div>
         <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="selectedListClassifyLinkAttr"
-            >纭� 瀹�</el-button
-          >
+          <el-button type="primary" @click="selectedListClassifyLinkAttr">纭� 瀹�</el-button>
           <el-button @click="isShowSelectAttrOption = false">鍙� 娑�</el-button>
         </div>
       </el-dialog>
@@ -1601,7 +1599,7 @@
         basicMoveupBtn: this.vaildData(this.permission.code_rule.code_basic_moveup, false),
         basicDownBtn: this.vaildData(this.permission.code_rule.code_basic_down, false),
       }
-    }
+    },
   },
   watch: {},
   mounted() {
@@ -2696,16 +2694,16 @@
                 type: "success",
                 message: "鎿嶄綔鎴愬姛!",
               });
+              // 鍏抽棴瀵硅瘽妗�
+              this.addBasicCodeSettingBox = false;
+              // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
+              this.loadBasic(this.selectionList[0]);
             },
             (error) => {
               window.console.log(error);
             }
           );
-          // 鍏抽棴瀵硅瘽妗�
-          this.addBasicCodeSettingBox = false;
         }
-        // 鐐瑰嚮鏂板鍩虹鐮佹,鍏抽棴绐楀彛涔嬪悗瑙﹀彂閲嶆柊鍔犺浇
-        this.loadBasic(this.selectionList[0]);
       } else {
         // 鍙兘鍙傜収寮曠敤鐨勪笟鍔$被鍨嬩細鍙戠敓鏀瑰彉鎵�浠ヨ繖鍎跨洿鎺ュreferConfig鐨刯son杩涜鏀瑰彉
         if (
@@ -2725,14 +2723,14 @@
               type: "success",
               message: "鎿嶄綔鎴愬姛!",
             });
+            this.loadBasic(this.selectionList[0]);
+            // 鍏抽棴瀵硅瘽妗�
+            this.addBasicCodeSettingBox = false;
           },
           (error) => {
             window.console.log(error);
           }
         );
-        this.loadBasic(this.selectionList[0]);
-        // 鍏抽棴瀵硅瘽妗�
-        this.addBasicCodeSettingBox = false;
       }
       this.isLoadingSecCodeAddBtn = false;
     },
@@ -3171,34 +3169,19 @@
       ) {
         this.loadCodeSecType();
       }
-      if (row != null) {
-        this.form = {
-          oid: row.oid,
-          id: row.id, //缂栧彿,
-          name: row.name, //鍚嶇О
-          secType: row.secType, //鐮佹绫诲瀷
-          description: row.description, //鎻忚堪
-          serialDependFlag: row.serialDependFlag == "true" ? true : false, //鏄惁娴佹按渚濊禆
-          serialDependOrder: row.serialDependOrder, //娴佹按渚濊禆椤哄簭
-          nullableFlag: row.nullableFlag == "true" ? true : false, //鏄惁涓虹┖
-          displayFlag: row.displayFlag == "true" ? true : false,
-          componentCodeFlag: row.componentCodeFlag == "true" ? true : false, //鏄惁鍙備笌缂栫爜
-          pkCodeRule: row.pkCodeRule, //鎵�灞炵紪鐮佽鍒�
-        };
-      } else {
-        this.form = {
-          id: this.form.id, //缂栧彿
-          name: this.form.name, //鍚嶇О
-          secType: this.form.secType, //鐮佹绫诲瀷
-          description: this.form.description, //鎻忚堪
-          serialDependFlag: this.form.serialDependFlag, //鏄惁娴佹按渚濊禆
-          serialDependOrder: this.form.serialDependOrder, //娴佹按渚濊禆椤哄簭
-          nullableFlag: this.form.nullableFlag, //鏄惁涓虹┖
-          displayFlag: this.form.displayFlag, //
-          componentCodeFlag: this.form.componentCodeFlag, //鏄惁鍙備笌缂栫爜
-          pkCodeRule: this.form.pkCodeRule, //鎵�灞炵紪鐮佽鍒�
-        };
-      }
+      this.form = {
+        oid: row !=null ? row.oid:this.form.oid,
+        id: row !=null ? row.id:this.form.id, //缂栧彿,
+        name: row !=null ? row.name:this.form.name, //鍚嶇О
+        secType: row !=null ?  row.secType:this.form.secType, //鐮佹绫诲瀷
+        description:  row !=null ? row.description:this.form.description, //鎻忚堪
+        serialDependFlag: this.isNullJsonBoolean(row,this.form, 'serialDependFlag'), //鏄惁娴佹按渚濊禆
+        serialDependOrder:  row !=null ? row.serialDependOrder:this.form.serialDependOrder, //娴佹按渚濊禆椤哄簭
+        nullableFlag: this.isNullJsonBoolean(row, this.form, 'nullableFlag'), //鏄惁涓虹┖
+        displayFlag: this.isNullJsonBoolean(row, this.form, 'displayFlag'),
+        componentCodeFlag: this.isNullJsonBoolean(row, this.form, 'componentCodeFlag'), //鏄惁鍙備笌缂栫爜
+        pkCodeRule:  row !=null ? row.pkCodeRule:this.form.pkCodeRule, //鎵�灞炵紪鐮佽鍒�
+      };
       if (this.form.secType === "codefixedsec") {
         //鍥哄畾鐮佹
         this.form = Object.assign({}, this.form, {
@@ -3351,6 +3334,15 @@
         this.loadCodeFillSeparator();
       }
     },
+    // 鍒ゆ柇Boolean鍊兼槸鍚︿负绌猴紝骞朵笖瀵箂tr绫诲瀷甯冨皵鍊艰繘琛岃浆鎹�
+    isNullJsonBoolean(row,form,attr) {
+        //console.log(row[attr],form[attr]);
+        if(row != null){
+          return JSON.parse(row[attr]);
+        }else {
+          return form[attr];
+        }
+    },
     /** 绗竴娆¤姹傜殑鏋氫妇鏁版嵁鏀剧紦瀛�*/
     getLocalStorageEnum(enumKey) {
       let enumCach = JSON.parse(localStorage.getItem(enumKey));

--
Gitblit v1.9.3