完善代码生成

This commit is contained in:
aixianling
2023-02-02 17:19:49 +08:00
parent d988440bca
commit 7acebbc35b

View File

@@ -29,7 +29,12 @@ const genList = (app, dest) => {
listProps = "", searchProps = "", btns = "", tableBtns = ""
if (checkJson(app.props)) {
let props = JSON.parse(app.props)
listProps = JSON.stringify(props.filter(e => e.isTable))
listProps = JSON.stringify(props.filter(e => e.isTable)?.map(e => {
delete e.isSearch
delete e.isTable
delete e.isDetail
return e
}) || null)?.replace(/"([^"]+)":/g, '$1:')
props.filter(e => e.isSearch && e.dict).map(e => {
searchProps += `<ai-select v-model="search.${e.prop}" placeholder="${e.label}" :selectList="dict.getDict('${e.dict}')"/>`
})