增加自动化代码回滚功能

This commit is contained in:
pixel
2021-07-14 14:37:04 +08:00
parent 2de1d42a30
commit 3434b2ba5e
8 changed files with 87 additions and 11 deletions

View File

@@ -165,7 +165,7 @@ const fieldTemplate = {
import FieldDialog from '@/view/systemTools/autoCode/component/fieldDialog.vue'
import PreviewCodeDialg from '@/view/systemTools/autoCode/component/previewCodeDialg.vue'
import { toUpperCase, toHump, toSQLLine } from '@/utils/stringFun'
import { createTemp, getDB, getTable, getColumn, preview } from '@/api/autoCode'
import { createTemp, getDB, getTable, getColumn, preview, getMeta } from '@/api/autoCode'
import { getDict } from '@/utils/dictionary'
export default {
@@ -223,6 +223,10 @@ export default {
created() {
this.getDb()
this.setFdMap()
const id = this.$route.params.id
if (id) {
this.getAutoCodeJson(id)
}
},
methods: {
editAndAddField(item) {
@@ -395,6 +399,12 @@ export default {
this.fdMap[item.label] = fdtype
})
})
},
async getAutoCodeJson(id) {
const res = await getMeta({ id: Number(id) })
if (res.code === 0) {
this.form = JSON.parse(res.data.meta)
}
}
}
}