sr 4 年之前
父节点
当前提交
dd247a8aab
共有 2 个文件被更改,包括 12 次插入11 次删除
  1. 8 0
      ruoyi-ui/src/api/tool/gen.js
  2. 4 11
      ruoyi-ui/src/views/tool/gen/editTable.vue

+ 8 - 0
ruoyi-ui/src/api/tool/gen.js

@@ -162,3 +162,11 @@ export function getReload(data) {
     data
   })
 }
+// 新增字段信息
+export function addGenTableColumn(data) {
+  return request({
+    url: '/boman-gen/genTableColumn',
+    method: 'POST',
+    data
+  })
+}

+ 4 - 11
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -354,6 +354,7 @@
     tableSql,
     zxImplement,
     getReload,
+    addGenTableColumn,
     qurGenTable
   } from "@/api/tool/gen";
   import {
@@ -380,7 +381,7 @@
         tableSqlData: [],
         columList: [],
         foreignKey: [],
-        openZd: false,
+        openZd: true,
         formZd: {},
         rulesZd: {
           columnName: [{
@@ -543,21 +544,13 @@
     },
     methods: {
       submitFormZd() {
-        this.$refs["form"].validate(valid => {
+        this.$refs["formZd"].validate(valid => {
           if (valid) {
-            if (this.form.id != undefined) {
-              setGenTable(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.tabList();
-              });
-            } else {
-              addGenTable(this.form).then(response => {
+              addGenTableColumn(this.formZd).then(response => {
                 this.msgSuccess("新增成功");
                 this.open = false;
                 this.tabList();
               });
-            }
           }
         });
       },