d3j-commonop
d3j-commonop 是一个多tab的通用后台。 使用前请先阅读:通用多tab后台
how to use
- first install create-react-app, create a project
npm install -g create-react-app
create-react-app my-app
cd my-app/
- install d3j-commmonop
npm install d3j-commonop --save
-
执行: "fibjs ./node_modules/d3j-commonop/generateCode.js"
-
give a appConfig.json at src
npm run codeInit
npm start
appConfig
like this:
logo can also be :
"logo":{
"url":"http://lorempixel.com/200/80/",
"width":"200",
"height":"80"
}
rooter
参考 history 的使用方法
history
额外的支持
history
获取参数的时候:
const urlSearch = thisprops
另外 提供一个Link组件
const Link = RouterLibLink
diy
override reducer
// you can handle before default by case first// ./component/userlist/module/reducer.js { }
auth
权限组件 SimpleAuth
<SimpleAuth ="编辑"><ComponentA/></SimpleAuth>
加强版BaseForm
新增下拉选择框,日期框(分为单个日期框以及包含开始日期和结束日期的日期框),级联选择框 参数格式(和配置文件的columns类似,多了一个type属性) [{ title: '用户', dateIndex; 'userlist', key: 'userlist', type: 'select', //select表示类型是下拉选择框 oplist: ['Jone', 'Effy', 'Dongyang'] }, { title: '起始时间', dateIndex; 'startDate', key: 'startDate', type: 'date' //date表示类型是单个日期的选择框 }, { title: '活动期限', dateIndex; 'period', key: 'period', type: 'rangeDate' //rangeDate表示类型是包含起止日期的选择框 }, { title: '省市', dateIndex; 'address', key: 'address', type: 'cascader', //cascader表示类型是级联选择器 oplist: [{ //oplist表示级联的内容,如果没有则默认是省市级联 value: 'LPL', label: 'LPL', children: [{ value: 'EDG', label: 'EDG' }, { value: 'WE', label: 'WE' }] }, { value: 'LCK', label: 'LCK', children: [{ value: 'SKT', label: 'SKT', children: [{ value: 'KT', label: 'KT' }] }] }] }]