@alvin-cqx/alvin-vue
v1.0.1
Published
elpis ###企业端项目是个全栈的项目
Readme
elpis
企业端项目是个全栈的项目
model配置
{
mode: "dashboard"; //模板类型,不同模板类型对应不同的模板数据结构
name: ""; //名字
desc: ""; //描述
icon: ""; //图标
homePage: ""; //首页
// 头部菜单
menu: [
{
key: "", //菜单唯一描述
name: "", //菜单名称
menuType: "", //菜单类型 枚举值 group /module
//当menuType==group
// 可递归
subMenu: [{}],
//当menuType==module
moduleType: "", //枚举值 sider/iframe /custom/schema
// moduleType==sider
siderConfig: {
menu: [{}],
},
// moduleType==iframe
iframeConfig: {
path: "", //iframe路径
},
// moduleType==custom
customConfig: {
path: "", //自定义路径
},
//moduleType==schema
schemaConfig: {
api: "", //数据源api,遵循RESTFUL规范
schema: {
type: "object",
properties: {
key: {
...schema, //标准schema配置
type: "", //字段类型
label: "", //字段中文名字
// maxLength: 10, //字段长度限制
// minLength: 5,
// 字段在table中的相关配置
tableOption: {
...elTableColumnConfig, //标准el-table-column基础配置
toFixed: 2, //保留几位小数
visible: true, //默认为true(false 或者不配置,不展示在table展示)
},
// 字段在search中相关配置
searchOption: {
...eleComponentCofing, //标准 el-componet-column配置
// 当comType==input时
comType: "input", //类型
default: "", //默认值
// 当comType==select时
// 是否自定义下拉列表对应的
enumList: [], //下拉列表
// 自定义key value
customizeList: {
label: "",
value: "",
},
// 当comType==dynamicSelect,多一个api请求
api: "",
// 当comType==datePicker
// 时间控件的一些配置
datePickerOption: {
//type: date daterange
type: "date",
placeholder: "Pick a day",
// 当 type:daterange,他选择时间返回的是个数组,我们要特殊处理
dateParams: ["startTime", "endTime"],
},
},
// 字段在不同的组件中相关配置,前缀对应componentConfig中的键值
//如:componetConfig.createForm 这里对应createFormOption
// 字段在createForm的配置
createFormOption: {
...eleComponentCofing, //标准 el-componet-column配置
comType: "input", //控件类型
visible: true, //是否展示,默认为true
disabled: false, //是否禁用,默认为fasle
default: "", //默认值
// 当comType==select时
// 是否自定义下拉列表对应的
enumList: [], //下拉列表
},
editFormOption: {
...eleComponentCofing, //标准 el-componet-column配置
comType: "input", //控件类型
visible: true, //是否展示,默认为true
disabled: false, //是否禁用,默认为fasle
default: "", //默认值
},
detailPanelOption: {},
required: [], //必填字段
},
},
},
//表格配置
tableConfig: {
headerButtons: [
{
label: "", //按钮中文名
eventKey: "", //按钮事件名
eventOption: {}, //按钮具体配置
...elButtonConfig, //el-button 基础配置
},
],
rowButtons: [
{
label: "", //按钮中文名
eventKey: "", //按钮事件名
eventOption: {
// 举例子
// 当eventKey==remove
params: {
// key:参数的键
// value:参数的值,格式为 schema::tableKey的时候,到table中找对应字段
key: value,
},
// 当eventKey==showComponet,就让他弹出组件,组件名字
compName: "",
}, //按钮具体配置
...elButtonConfig, //el-button 基础配置
},
],
},
searchConfig: {}, //搜索配置
//动态组件
componentConfig: {
// create-form 表单配置
createForm: {
title: "", //标题
saveBtnText: "", //保存按钮文字
},
// 修改表单配置
editForm: {
mainKey: "id", //id
title: "", //标题
saveBtnText: "", //保存按钮文字
},
// 详情
detailPanel: {
mainKey: "id", //id
title: "", //标题
},
// 支持用户动态添加
},
},
},
];
}
服务端启动
const { serverStart } = require("@alvin-cqx/alvin-vue");
serverStart({ name: "ElpisDemo", homePath: "/view/project-list" });自定义服务端
router-schema
router
controller
service
extend
前端构建
const { frontendBuild } = require("@alvin-cqx/alvin-vue");
frontendBuild(process.env._ENV);自定义页面拓展
1.在app/pages/目录下写入口 entry.xxx.js
dashboard / custom-view 自定义页面拓展
1.在 app/pagas/dashboard/xxxx 下写页面
dashboard / schema-view / componets 动态组件拓展
1.在app/pages/dashboard/compiex-view/schema-view/componets 下写组件
2.配置到app/pages/dashboard/compiex-view/schema-view/componets/component-config.js中
schema-form 控件拓展
1.在app/widgets/schema-form下写控件
2.配置到app/widgets/schema-form/form-item-config.js
schema-search控件拓展
1.在app/widgets/schema-search下写控件
2.配置到app/widgets/schema-search/schema-item-config.js
