@zhaoshiqi24299/elpis
v1.1.3
Published
```javascript { "mode": "dashboard", // 头部菜单 "menu": [{ // 菜单唯一描述 "key": "", // 菜单name "name": "", // 菜单类型 group分组 / module "menuType": "", // 子菜单 当menuType为group时有效 "subMenu": [{
Downloads
535
Readme
#elpis
企业级应用框架
model 配置
{
"mode": "dashboard",
// 头部菜单
"menu": [{
// 菜单唯一描述
"key": "",
// 菜单name
"name": "",
// 菜单类型 group分组 / module
"menuType": "",
// 子菜单 当menuType为group时有效
"subMenu": [{
}, ...],
// 菜单行为,当menuType为module时有效。 枚举值:iframe / custom / schema / sider
"moduleType": "",
// 当moduleType为sider时有效
siderConfig:{
menu:[{},...]
},
// 当moduleType为iframe时有效
iframeConfig: {
path: "", // iframe地址
},
// 当moduleType为custom时有效
customConfig: {
path: "" // 自定义路由路径
},
// 当moduleType为schema时有效
schemaConfig: {
api: "", // 数据源api地址,遵循restful风格
// json-schema描述
schema: {
type: "object",
properties: {
key: {
...schema, //标准json-schema描述
type: "string",// 字段类型
label: "字段名称",// 字段名称
// 字段在table中的配置
tableOption:{
...elTableColumnConfig, // 标准el-table-column配置
tofixed: 2, // 数字类型时的小数位数
visible: true // 是否在table中显示
},
// 字段在search-bar中的配置
searchOption:{
...elComponentConfig, // 标准el-component-column组件配置
comType:'', // 配置组件类型 input/select/dynamicSelect/date-picker/date-range等
default:'', // 默认值
// comType为select生效
enumList:[
{
label:'',
value:''
}
],
// comType为dynamicSelect生效
api:''
},
// 字段在不同动态component中的相关配置,前缀对应componentConfig中的key值
// 如componentConfig中有个key值为createForm的配置,则此处对应createFormOption
createFormOption:{
...elComponentConfig, //标准el-component配置
comType:'', // 控件类型 input/select/dynamicSelect/date-picker/date-range等
disabled:false, // 是否禁用
default:'', // 默认值
visible:true, // 是否显示
placeholder:'', // 占位提示
// comType为select生效
enumList:[
{
label:'',
value:''
}
]
},
editFormOption:{
...elComponentConfig, //标准el-component配置
comType:'', // 控件类型 input/select/dynamicSelect/date-picker/date-range等
disabled:false, // 是否禁用
default:'', // 默认值
visible:true, // 是否显示
placeholder:'', // 占位提示
// comType为select生效
enumList:[
{
label:'',
value:''
}
]
},
detailPanelOption:{
...elComponentConfig, //标准el-component配置
}
},
...
},
},
// table相关配置
tableConfig: {
headerButtons: [
{
label:'', // 按钮名称
eventKey:'', // 按钮事件名
eventOption:{
// eventKey === 'remove'时有效
params:{
"paramsKey":"schema::fieldKey" // schema:: 开头表示取schema中的字段值
},
// eventKey === 'showComponent'时有效
comName:'', // 组件名称,对应componentConfig中的key值
}, // 按钮事件配置
...elButtonConfig, // 标准el-button配置
}
],
rowButtons: [
{
label:'', // 按钮名称
eventKey:'', // 按钮事件名
eventOption:{}, // 按钮事件配置
...elButtonConfig, // 标准el-button配置
}
]
},
// 搜索相关配置
searchConfig: {},
// 组件相关配置
componentConfig: {
createForm:{
title: '', // 组件标题
saveBtnText: '', // 保存按钮文字
},
editForm:{
title: '', // 组件标题
saveBtnText: '', // 保存按钮文字
mainKey:'', // 主键字段
},
detailPanel:{
title: '', // 组件标题
mainKey:'', // 主键字段
}
}
}, ...]
}
服务端启动
const { serverStart } = require("@zhaoshiqi24299/elpis");
serverStart({
name: "ElipsDemo",
homePage: "/view/project-list",
});自定义服务端
- router-schema
- router
- controller
- service
- exted
- config
前端构建
const { frontendBuild } = require("@zhaoshiqi24299/elpis");
frontendBuild(process.env._ENV.trim());自定义页面扩展
- 在
app/pages目录下写入口 entry.xxx.js
dashboard / custom-view 自定义页面扩展
- 在
app/pages/dashboard/xxx目录下写入口 entry.xxx.js
dashboard / schema-view /components 动态组件扩展
- 在
app/pages/dashboard/complex-view/schema-view/components下写组件 - 配置到
app/pages/dashboard/complex-view/schema-view/components/component-config.js
schema-form 控件扩展
- 在
app/pages/widgets/schema-form/complex-view下写控件 - 配置到
app/pages/widgets/schema-form/form-item-config.js
schema-search-bar 控件扩展
- 在
app/pages/widgets/schema-search-bar/complex-view下写控件 - 配置到
app/pages/widgets/schema-search-bar/search-bar-config.js
