Эх сурвалжийг харах

修改数据引擎新增数据表的默认数据

lph 1 жил өмнө
parent
commit
c515db06cf

+ 11 - 10
zkqy-ui/src/views/tool/datasheet/index.vue

@@ -212,15 +212,15 @@ export default {
       },
       experienceDataForm: {},
       experienceData: [
-        // {
-        //   fieldName: "",
-        //   fieldType: "",
-        //   fieldLength: undefined,
-        //   isNull: false,
-        //   isPrimary: false,
-        //   fieldDescription: "",
-        //   isAuto: false,
-        // },
+        {
+          fieldName: "id",
+          fieldType: "",
+          fieldLength: undefined,
+          isNull: true,
+          isPrimary: true,
+          fieldDescription: "",
+          isAuto: true,
+        },
       ],
       rules: {
         dataBaseName: {
@@ -260,7 +260,7 @@ export default {
       Object.keys(this.form).forEach((item) => {
         this.form[item] = "";
       });
-      this.experienceData = [];
+      // this.experienceData = [];
     }
   },
   mounted() {
@@ -586,6 +586,7 @@ export default {
         databaseName: this.databaseName,
       };
       tableInfo(data).then((response) => {
+        this.experienceData = [];
         response.data.forEach((item, index) => {
           item.oldVal = JSON.parse(JSON.stringify(item)); // 保留原始数据
           // item.sort = index;