diff --git a/web/src/view/systemTools/autoCode/index.vue b/web/src/view/systemTools/autoCode/index.vue index 8aef959ab4..62d952f74b 100644 --- a/web/src/view/systemTools/autoCode/index.vue +++ b/web/src/view/systemTools/autoCode/index.vue @@ -1207,6 +1207,20 @@ const enterForm = async(isPreview) => { return false } form.value.humpPackageName = toSQLLine(form.value.packageName) + + form.value.fields.forEach(item => { + if(item.fieldType === 'enum'){ + // 判断一下 item.dataTypeLong 按照,切割后的每个元素是否都使用 '' 包裹,如果没包 则修改为包裹起来的 然后再转为字符串赋值给 item.dataTypeLong + const arr = item.dataTypeLong.split(',') + arr.forEach((ele, index) => { + if(ele.indexOf("'") === -1){ + arr[index] = `'${ele}'` + } + }) + item.dataTypeLong = arr.join(',') + } + }) + delete form.value.primaryField if (isPreview) { const data = await preview(form.value)