本项目覆盖的功能包括并不限于:
- SSC 3.0 后台管理
- 友报账 - 基础档案
安装依赖
npm install
以调试模式运行
npm run dev
打开 http://127.0.0.1:3008/ 访问首页
Development feature, like webpack HMR, is not include in demo mode. As this you could host this demo on a web server.
npm run build
npm run demo
ArchContainer |-- Grid 布局 | |-- Row | | `-- Col | | `-- AdminCardActions 数据操作按钮 | `-- Row | `-- Col | `-- AdminTable 表格 |-- AdminEditDialog | `-- AdminEditForm 编辑表单 `-- AdminEditDialog `-- AdminEditForm 创建表单
组件结构图
{
"arch": {
"data": {
"items": [
{
"id": '0',
"col1": 'row1, col1',
"col2": 'row1, col2',
"cols": [
{ "type": 'text', label: 'col1', value: 'row1, col1' },
{ "type": 'text', label: 'col2', value: 'row1, col2' }
]
},
{
"id": '1',
"col1": 'row2, col1',
"col2": 'row2, col2',
"cols": [
{ type: 'text', label: 'col1', value: 'row2, col1' },
{ type: 'text', label: 'col2', value: 'row2, col2' }
]
}
],
"currentItemCount": null,
"startIndex": null,
"totleItems": null
},
"selectedRows": '',
"editDialog": {
show: false,
rowId: 0,
formData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
]
},
editFormData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
],
submitting: false,
submited: false,
createDialog: {
show: false
},
createFormData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
]
adminAlert: {
show: false,
error: {
code: 0,
message: ''
}
}
}
}
{
"arch": {
"data": {
"items": [
{
"id": '0',
"col1": 'row1, col1',
"col2": 'row1, col2',
"cols": [
{ "type": 'text', label: 'col1', value: 'row1, col1' },
{ "type": 'text', label: 'col2', value: 'row1, col2' }
]
},
{
"id": '1',
"col1": 'row2, col1',
"col2": 'row2, col2',
"cols": [
{ type: 'text', label: 'col1', value: 'row2, col1' },
{ type: 'text', label: 'col2', value: 'row2, col2' }
]
}
],
"currentItemCount": null,
"startIndex": null,
"totleItems": null
},
"selectedRows": '',
"editDialog": {
show: false,
rowId: 0,
formData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
]
},
editFormData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
],
submitting: false,
submited: false,
createDialog: {
show: false
},
createFormData: [
{ type: 'text', label: 'col1', value: 'row1, col1' },
{ type: 'text', label: 'col2', value: 'row1, col2' }
]
adminAlert: {
show: false,
error: {
code: 0,
message: ''
}
}
}
}
- AdminEditForm http://127.0.0.1:3008/admin/#/demo/form
Create
,Add
- create or add new entriesRead
,Retrieve
,Search
,View
- read, retrieve, search, or view existing entriesUpdate
,Edit
- update or edit existing entriesDelete
,Deactivate
,Remove
- delete/deactivate/remove existing entries
<noun>-<verb>
,比如Project-Create
, User-Login
,这样以object type(而不是action type)进行分组。
https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e#7f41
比如页面名称叫做“基础档案配置页面”,那么名称定为ArchSetting
- 创建Container,位置
./containers/ArchSettingPage.js
- 创建Action,位置
./actions/archSetting.js
- 创建Action type,位置
./constants/ArchSettingActionTypes.js
- 创建Reducer,位置
./reducers/archSetting.js
- 并添加到
combineReducers()
中,位置./reducers/index.js
- 添加到Sidebar中,位置
./components/Sidebar.js
- 添加到Router中,位置
./index.js
- 创建fake API,位置
../../app_admin.js
- 创建middleware,位置
../server/routes/fakeApiArchSetting.js