修复 magic-import 类型为方法时 import 值为 undefine问题

代码生成 数据源字段 如果为null 就转换为 空字符串
This commit is contained in:
吕金泽 2022-06-09 21:43:02 +08:00
parent 84b7b0ece1
commit 59ee88ac19
2 changed files with 4 additions and 0 deletions

View File

@ -6,5 +6,8 @@ const libs = {
'element-plus': ElementPlus
}
window.___magic__import__ = function(lib, name){
if(typeof(libs[lib]) == 'function'){
return libs[lib]
}
return (libs[lib] || {})[name]
}

View File

@ -403,6 +403,7 @@ import {reactive, ref, watch, getCurrentInstance, onMounted, nextTick} from 'vue
function getDetail(id){
proxy.$get('/system/code/gen/get', { id: id }).then(res => {
var formData = {...res.data}
formData.datasource = formData.datasource || ''
formData.info = JSON.parse(formData.info)
formData.columns = JSON.parse(formData.columns)
genInfo.value = formData