Browse Source

Merge pull request #302 from tingfeng-key/patch-3

添加自动填充功能
奇淼(piexlmax 4 years ago
parent
commit
a0cc936d12
1 changed files with 16 additions and 1 deletions
  1. 16 1
      web/src/view/systemTools/autoCode/component/fieldDialog.vue

+ 16 - 1
web/src/view/systemTools/autoCode/component/fieldDialog.vue

@@ -103,6 +103,7 @@
 </template>
 <script>
 import { getDict } from "@/utils/dictionary";
+import { toSQLLine } from "@/utils/stringFun.js";
 import { getSysDictionaryList } from "@/api/sysDictionary";
 export default {
   name: "FieldDialog",
@@ -201,7 +202,21 @@ export default {
     });
 
     this.dictOptions = dictRes.data.list
-  }
+  },
+  watch: {
+    'dialogMiddle.fieldName': function (val) {
+      if (val.length > 0) {
+        val = val.replace(val[0], val[0].toLowerCase());
+        val = toSQLLine(val)
+      }
+
+      this.dialogMiddle.fieldJson = val;
+      this.dialogMiddle.columnName = val;
+    },
+    'dialogMiddle.fieldDesc': function (val) {
+      this.dialogMiddle.comment = val;
+    }
+  },
 };
 </script>
 <style lang="scss">