feat: 响应式布局支持字段换行
docs: 增加表单二开说明
This commit is contained in:
24
dev_tools/template_extend.js
Normal file
24
dev_tools/template_extend.js
Normal file
@ -0,0 +1,24 @@
|
||||
const formProps = require('./formProps');
|
||||
|
||||
let tmpl = '';
|
||||
|
||||
// 用于将config的表单格式展开成字段,以便二开
|
||||
formProps.schemas.forEach((prop) => {
|
||||
let schema = `schemaMap['${prop.key}']`;
|
||||
tmpl += `
|
||||
<!-- ${prop.label || prop.field || prop.component} -->
|
||||
<Col v-if="getIfShow2('${prop.key}')" v-show="getIsShow2('${prop.key}')" :span="getColWidth(${schema})">
|
||||
<template v-if="showComponent(${schema})">
|
||||
<SimpleFormItem v-model:value="formModel[${schema}.field]" :form-api="formApi" :isWorkFlow="isWorkFlow" :refreshFieldObj="refreshFieldObj" :schema="${schema}" />
|
||||
</template>
|
||||
</Col>
|
||||
`;
|
||||
});
|
||||
|
||||
//write to file
|
||||
const fs = require('fs');
|
||||
|
||||
fs.writeFile('./template.txt', tmpl, (err) => {
|
||||
if (err) throw err;
|
||||
console.log('The file has been saved!');
|
||||
});
|
||||
Reference in New Issue
Block a user