refactor:优化代码生成

This commit is contained in:
JaguarJack
2023-07-19 17:32:53 +08:00
parent 78c25497d6
commit d5ed1dd461
2 changed files with 15 additions and 23 deletions

View File

@@ -60,6 +60,20 @@ import { Delete } from '@element-plus/icons-vue'
const generateStore = useGenerateStore()
const structures = computed(() => {
generateStore.getStructures.forEach(struct => {
if (struct.field === 'id' || struct.field === 'created_at' || struct.field === 'updated_at') {
struct.form = false
}
if (struct.field === 'sort') {
struct.form_component = 'input-number'
}
if (struct.field === 'status') {
struct.form_component = 'select'
}
})
return generateStore.getStructures
})