@xxbashen/elpis
v1.0.3
Published
<!-- * @Author: xixing * @LastEditors: Xi xing * @email: [email protected] * @github: https://gitee.com/xx152 * @Date: 2025-04-04 15:10:12 * @LastEditTime: 2025-04-04 15:11:40 * @motto: Still water run deep * @Description: Modify here please * @F
Readme
#node - 18.20.8
elpis
全栈应用框架
model 配置
{
mode: 'dashboard', // 模板类型, 不同类型模板对应不同的模板数据结构
name: '', // 模板名称
title: '', // 模板标题
desc: '', // 模板描述
icon: '', // 模板图标
homePage: '', // 模板首页
// 头部菜单
menu: [
{
key: '', // 菜单唯一描述
name: '', // 菜单名称
menuType: '', // 菜单类型(菜单目录、菜单项) group | module
// 当 menuType === group
subMenu: [
{
// 可递归的菜单项 menuItem
},
// ...
],
// 当 menuType === module
moduleType: '', // 模块类型: sider | iframe | custom | schema
// 当 moduleType === schema
schemaConfig: {
api: '/api/user', // 数据源 restful api
schema: { // 板块数据配置
type: 'object',
properties: {
key: {
...schema, // 标准 schema 配置
type: 'string', // 字段类型
label: '', // 字段中文名
// 字段在 table 中的相关配置
tableOption: {
...elTableColumnConfig, // 标准 el-table-column 配置
toFixed: 0, // 数字字段,保留几位小数
visible: true, // 是否在表格中可见,默认true(false:不展示)
},
// 字段在 search-bar 对应的配置
searchOption: {
...elComponentConfig, // 标准 elementui 组件配置
comType: '', // 配置的组件类型
default: '', // 默认值
},
// 字段在动态组件中的配置,前缀对应componentConfig的键值
// 如:createFormOption = createForm + Option
createFormOption: {
...elComponentConfig,
comType: '', // 控件类型,如:input、select单独
visible: true, // 默认true,(true/false)false不展示
disabled: false, // 是否禁用(true/false)--是否可编辑
// comType === 'select' 时,启用
enumList: [], // 枚举值
// comType === 'dynamicSelect' 时,启用
api: '', // dynamicSelect 控件数据源
},
// 字段在 editForm 中的配置
editFormOption: {
...elComponentConfig,
comType: '', // 控件类型,如:input、select单独
visible: true, // 默认true,(true/false)false不展示
disabled: false, // 是否禁用(true/false)--是否可编辑
// comType === 'select' 时,启用
enumList: [], // 枚举值
// comType === 'dynamicSelect' 时,启用
api: '', // dynamicSelect 控件数据源
},
// 字段在 detailPanel 中的配置
detailPanelOption: {
...elComponentConfig,
}
},
// ...
},
// 必填 字段
required: [],
},
// 表格配置
tableConfig: {
// 表格头部按钮
headerButtons: [
{
label: '', // 按钮名称
eventKey: '', // 事件 key
// 按钮配置项
eventOption: {
// 当 eventKey === 'showComponent' 时,启用 comName,决定调用哪个组件
comName: '', // 组件名
},
...elButtonConfig, // 标准的el-button 配置项
},
// ...
],
// 表格行内按钮
rowButtons: [
{
label: '', // 按钮名称
eventKey: '', // 事件 key
eventOption: {
// 当 eventKey === 'showComponent' 时,启用 comName,决定调用哪个组件
comName: '', // 组件名
// 当 eventKey === 'remove'(add、remove、update、read)
params: {
// paramKey = 参数的键值
// rowValueKey = 参数值(格式:schema::tableKey时,从table中查找传值的值)
paramKey: rowValueKey,
}
}, // 按钮配置项
...elButtonConfig, // 标准的el-button 配置项
},
// ...
]
},
// search-bar 搜索配置
searchConfig: {},
// 动态组件配置
componentConfig: {
// 新增 form表单 组件配置
createForm: {
title: '', // 表单标题
saveBtnText: '', // 保存按钮文案
},
// 编辑 form 表单
editForm: {
mainKey: '', // 单条数据唯一标识-主键
title: '', // 组件标题
saveBtnText: '', // 保存按钮文案
},
// detail-panel 查看单条详情
detailPanel: {
mainKey: '', // 单条数据唯一标识-主键
title: '', // 组件标题
}
},
},
// 当 moduleType === custom
customConfig: {
path: '', // 自定义模块路径
},
// 当 moduleType === iframe
iframeConfig: {
path: '', // iframe 模块路径
},
// 当 moduleType === sider
siderConfig: {
menu: [
{
// 可递归的菜单项 menuItem ( moduleType !== sider)
},
// ...
],
}
}
]
}服务端启动
const { serverStart } = require("@xxbashen/elpis");
const app = serverStart({
name: "ElpisDemo",
homePage: "/view/project-list",
});前端构建
const { frontendBuild } = require("@xxbashen/elpis");
frontendBuild(process.env._ENV);