@milnejm/elpis
v1.0.0
Published
```javascript { mode:'dashboard',//模板类型,不同的模板类型会有不同的展示效果 name:'',//名称 desc:'',//描述 icon:'',//图标 homePage:'',//首页地址 menu:[ { name:'',//菜单名称 key:'',//菜单key值,必须唯一 menuType:'',//枚举值,group/module subMenu:[//
Readme
#elpis ##一个企业级应用框架,通过全栈实现
model配置
{
mode:'dashboard',//模板类型,不同的模板类型会有不同的展示效果
name:'',//名称
desc:'',//描述
icon:'',//图标
homePage:'',//首页地址
menu:[
{
name:'',//菜单名称
key:'',//菜单key值,必须唯一
menuType:'',//枚举值,group/module
subMenu:[//当menuType为module时,可填
],
moduleType:'',//枚举值,iframe/custom/schema/sider
siderConfig:{
menu:[{}],
},
//当moduleType为iframe时,可填
iframeConfig:{
path:'',//iframe地址
},
//当moduleType为custom时,可填
customConfig:{
path:'',//自定义路由
},
//当moduleType为schema时,可填
schemaConfig:{
api:'/api/user',//schema接口地址,遵循RESTFUL规范
schema:{//板块数据结构
type:'object',
properties:{
key:{
...schema,//标准schema配置
type:'',
label:'',//字段中文名称
tableOptions:{//table字段中的配置
...elTableColumnConfig,//el-table-column字段中的配置
visible:true,//是否显示,配置为false时不显示,配置true或者不配置时显示
},
searchOptions:{//搜索字段中的配置
...eleComponentConfig,//el-component字段中的配置
comType:'',//配置组件类型 比如input、select
default:'',//默认值
visible:true,//是否显示,配置为false时不显示,配置true或者不配置时显示
//当comType为select时,可填
enumList:[],
//当comType为dynamic-select时,可填
api:'',
},
// formOptions:{},//表单字段中的配置
// 字段在不同 component 中相关配置,前缀对应componentConfig中的键值
//例如 componentConfig.creatFrom 对应 createFormOptions 字段在createForm中配置
createFormOptions:{
...eleComponentConfig,//el-component字段中的配置
comType:'',//配置组件类型 比如input、select
visible:true,// 是否显示,配置为false时不显示,配置true或者不配置时显示
disabled:false,//是否禁用
default:'',//默认值
//当comType为select时,可填
enumList:[], //枚举列表
//当comType为dynamic-select时,可填
api:'',
params:{},
},
editFormOptions:{
...eleComponentConfig,//el-component字段中的配置
comType:'',//配置组件类型 比如input、select
visible:true,// 是否显示,配置为false时不显示,配置true或者不配置时显示
disabled:false,//是否禁用
default:'',//默认值
//当comType为select时,可填
enumList:[], //枚举列表
},//更新字段中的配置
detailFormOptions:{
...eleComponentConfig,//el-component字段中的配置
comType:'',//配置组件类型 比如input、select
disabled:false,//是否禁用
default:'',//默认值
//当comType为select时,可填
enumList:[], //枚举列表
}
},
},
required:[],//标记哪些为必填字段
},
tableConfig:{//table相关配置
headerButtons:[
{
label:'',//按钮名称
eventKey:'',//按钮事件名
eventOption:{//按钮事件的具体配置
// 当eventKey为showComponent时,可填
comName:'',//组件名称
},
...elButtonConfig,//el-button字段中的配置
}
],
rowButtons:[
{
label:'',//按钮名称
eventKey:'',//按钮事件名
eventOption:{
comName:'',//组件名称
params:{
//paramKey是参数的键, rowValueKey 参数值,格式为 schema::tableKey 到table中找响应的字段
paramKey:rowValueKey,
}
},
...elButtonConfig,//el-button字段中的配置
}
],
},
searchConfig:{
},//搜索相关配置
components:{},//模块组件配置
//动态组件相关配置
componentConfig:{
creatFrom:{
title:'',//表单标题
saveBtnText:'',//保存按钮名称
},
// 编辑表单相关配置
editFrom:{
title:'',
mainKey:'',//主键字段 唯一标识要修改的数据对象
saveBtnText:'',
},
detailForm:{ //详情表单
mainKey:'',
title:'',
// saveBtnText:'',
}
}
},
}
]
}服务端启动
const { serverStart } = require('@milnejm/elpis')
//启动elpis服务
const app = serverStart({})自定义服务端
- router-schema
- router
- controller
- service
- extend
- config
前端构建
const { frontendBuild } = require('@milnejm/elpis')
//编译构建前端工程
frontendBuild(process.env._ENV)自定义页面扩展
- 在
app/pages/目录下写入口 entry.xxx.jsx 文件
dashboard / custom-view 自定义页面扩展
- 在
app/pages/dashboard/xxx目录下写页面
dashboard / schema-view / components 扩展动态组件
- 1、在
app/pages/dashboard/schema-view/components目录下写组件 - 2、配置到
app/pages/dashboard/schema-view/components/components-config.js中方可生效 - 3、在model 的配置中 注意:组件名称在 components-config.js 需和使用名称保持一致
schema-form 扩展动态表单
- 1、在
app/pages/widgets/schema-form/目录下写表单组件 - 2、配置到
app/pages/widgets/schema-form/form-item-config.js中方可生效 - 3、在model 的配置中 xxxxOptions 中 comType 属性配置对应名称
schema-scarch-bar 搜索筛选控件扩展
- 1、在
app/pages/widgets/schema-scarch-bar/目录下写搜索组件 - 2、配置到
app/pages/widgets/schema-scarch-bar/search-item-config.js中方可生效 - 3、在model 的配置中searchOptions 中 comType 属性配置对应名称
