├── .gitignore
├── reactERP
├── src
│ ├── modules
│ │ ├── login
│ │ │ ├── Login.scss
│ │ │ ├── LoginConstants.js
│ │ │ ├── LoginAction.js
│ │ │ ├── LoginReducer.js
│ │ │ └── LoginComponent.js
│ │ ├── cp
│ │ │ ├── cp.css
│ │ │ └── cp.js
│ │ └── order
│ │ │ ├── orderConstant.js
│ │ │ ├── orderAction.js
│ │ │ ├── orderReducer.js
│ │ │ └── orderComponent.js
│ ├── libs
│ │ ├── bootstrap
│ │ │ ├── css
│ │ │ │ ├── bootstrap.global.css
│ │ │ │ └── bootstrap-theme-light.css
│ │ │ ├── fonts
│ │ │ │ ├── glyphicons-halflings-regular.eot
│ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ └── glyphicons-halflings-regular.woff
│ │ │ └── datepicker
│ │ │ │ ├── less
│ │ │ │ └── datepicker.less
│ │ │ │ └── css
│ │ │ │ └── datepicker.css
│ │ ├── common
│ │ │ ├── global.scss
│ │ │ ├── common.js
│ │ │ └── common.scss
│ │ ├── imgs
│ │ │ ├── red.jpg
│ │ │ ├── green.jpg
│ │ │ └── yellow.jpg
│ │ └── font-awesome
│ │ │ ├── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ │ │ ├── less
│ │ │ ├── fixed-width.less
│ │ │ ├── larger.less
│ │ │ ├── list.less
│ │ │ ├── core.less
│ │ │ ├── font-awesome.less
│ │ │ ├── stacked.less
│ │ │ ├── bordered-pulled.less
│ │ │ ├── rotated-flipped.less
│ │ │ ├── path.less
│ │ │ ├── animated.less
│ │ │ └── mixins.less
│ │ │ └── scss
│ │ │ ├── _fixed-width.scss
│ │ │ ├── _larger.scss
│ │ │ ├── _list.scss
│ │ │ ├── font-awesome.scss
│ │ │ ├── _core.scss
│ │ │ ├── _stacked.scss
│ │ │ ├── _bordered-pulled.scss
│ │ │ ├── _rotated-flipped.scss
│ │ │ ├── _path.scss
│ │ │ ├── _animated.scss
│ │ │ └── _mixins.scss
│ ├── components
│ │ ├── cnode
│ │ │ ├── cnode.scss
│ │ │ └── cnode.js
│ │ ├── datagrid
│ │ │ ├── datagridconstants.js
│ │ │ ├── datagridaction.js
│ │ │ ├── datagridreducer.js
│ │ │ └── datagridcomponent.js
│ │ ├── app
│ │ │ └── app.js
│ │ ├── login
│ │ │ ├── login.scss
│ │ │ └── login.js
│ │ ├── spinner
│ │ │ ├── spinner.js
│ │ │ └── spinner.scss
│ │ ├── home
│ │ │ ├── home.js
│ │ │ ├── home.scss
│ │ │ ├── header
│ │ │ │ ├── header.scss
│ │ │ │ └── header.js
│ │ │ └── nav
│ │ │ │ ├── nav.scss
│ │ │ │ └── nav.js
│ │ └── modal
│ │ │ ├── modalcomponent.js
│ │ │ └── modal.css
│ ├── redux
│ │ ├── rootReducer.js
│ │ ├── configStore.js
│ │ └── middleware.js
│ ├── app.js
│ ├── router
│ │ └── index.js
│ └── utils
│ │ ├── ajaxMiddleware.js
│ │ └── HttpClient.js
├── .DS_Store
├── dist
│ ├── 46661d6d65debc63884004fed6e37e5c.svg
│ ├── fonts
│ │ ├── fontawesome-webfont.[md5.hash.hex:7].ttf
│ │ └── fontawesome-webfont.[md5.hash.hex:7].woff
│ └── src
│ │ └── libs
│ │ └── font-awesome
│ │ └── fonts
│ │ ├── fontawesome-webfont.eot
│ │ ├── fontawesome-webfont.ttf
│ │ ├── fontawesome-webfont.woff
│ │ └── fontawesome-webfont.woff2
├── .babelrc
├── index.html
├── package.json
└── webpack.config.js
├── redux
├── middleware
│ ├── dist
│ │ ├── 46661d6d65debc63884004fed6e37e5c.svg
│ │ └── src
│ │ │ └── libs
│ │ │ └── font-awesome
│ │ │ └── fonts
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ ├── .babelrc
│ ├── src
│ │ ├── components
│ │ │ ├── datagrid
│ │ │ │ ├── datagridconstants.js
│ │ │ │ ├── datagridaction.js
│ │ │ │ ├── datagridreducer.js
│ │ │ │ └── datagridcomponent.js
│ │ │ ├── cnode
│ │ │ │ └── cnode.js
│ │ │ └── spinner
│ │ │ │ ├── spinner.js
│ │ │ │ └── spinner.scss
│ │ ├── redux
│ │ │ ├── rootReducer.js
│ │ │ ├── store.js
│ │ │ └── middleware.js
│ │ ├── app.js
│ │ └── utils
│ │ │ └── HttpClient.js
│ ├── index.html
│ ├── package.json
│ ├── webpack.config.js
│ └── README.md
├── README.md
├── combineReducers
│ └── README.md
└── connetProvider
│ └── README.md
├── component
└── src
│ ├── app.es6.js
│ ├── app.es5.js
│ ├── define
│ ├── define.es6.js
│ ├── define.es5.js
│ ├── define.html
│ └── README.md
│ ├── style
│ └── README.md
│ ├── event
│ ├── event.html
│ └── README.md
│ ├── state
│ ├── README.md
│ └── state.html
│ ├── render
│ ├── condition-rendering.html
│ └── README.md
│ ├── form
│ ├── input.html
│ └── README.md
│ ├── props
│ └── props.html
│ ├── lifecycle
│ ├── lifecycle.html
│ └── README.md
│ └── communication
│ ├── README.md
│ └── communication.html
├── js
└── react-dom.js
├── README.md
├── jsx
├── jsx.html
└── README.md
└── router
├── index.html
├── params.html
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | /reactERP/node_modules/
2 |
--------------------------------------------------------------------------------
/reactERP/src/modules/login/Login.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/reactERP/src/libs/bootstrap/css/bootstrap.global.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/reactERP/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/.DS_Store
--------------------------------------------------------------------------------
/reactERP/dist/46661d6d65debc63884004fed6e37e5c.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/reactERP/src/libs/common/global.scss:
--------------------------------------------------------------------------------
1 | $main-color: #1ab394;
2 | $main-color-hover: #19a085;
3 |
--------------------------------------------------------------------------------
/redux/middleware/dist/46661d6d65debc63884004fed6e37e5c.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/reactERP/src/libs/imgs/red.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/imgs/red.jpg
--------------------------------------------------------------------------------
/reactERP/src/libs/imgs/green.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/imgs/green.jpg
--------------------------------------------------------------------------------
/reactERP/src/libs/imgs/yellow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/imgs/yellow.jpg
--------------------------------------------------------------------------------
/reactERP/src/modules/cp/cp.css:
--------------------------------------------------------------------------------
1 | .c1{
2 | color: red;
3 | width: 100%;
4 | height: 300px;
5 | border: solid 1px red;
6 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/font-awesome/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/reactERP/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["es2015", { "modules": false }],
4 | "react",
5 | "latest",
6 | "stage-2"
7 | ]
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/reactERP/dist/fonts/fontawesome-webfont.[md5.hash.hex:7].ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/fonts/fontawesome-webfont.[md5.hash.hex:7].ttf
--------------------------------------------------------------------------------
/reactERP/src/components/cnode/cnode.scss:
--------------------------------------------------------------------------------
1 | .dk-toolbar{
2 | width: 100%;
3 | height: 50px;
4 | padding: 10px 20px;
5 | border-bottom: solid 1px #ccc;
6 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/reactERP/dist/fonts/fontawesome-webfont.[md5.hash.hex:7].woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/fonts/fontawesome-webfont.[md5.hash.hex:7].woff
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/font-awesome/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/redux/middleware/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["es2015", { "modules": false }],
4 | "react",
5 | "latest",
6 | "stage-2"
7 | ]
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/reactERP/src/components/datagrid/datagridconstants.js:
--------------------------------------------------------------------------------
1 | export const Requesting = 'Requesting'
2 | export const Requested = 'Requested'
3 | export const RequestError = 'RequestError'
--------------------------------------------------------------------------------
/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/reactERP/src/libs/bootstrap/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/redux/middleware/src/components/datagrid/datagridconstants.js:
--------------------------------------------------------------------------------
1 | export const Requesting = 'Requesting'
2 | export const Requested = 'Requested'
3 | export const RequestError = 'RequestError'
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/fixed-width.less:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .@{fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_fixed-width.scss:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .#{$fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dk-lan/react/HEAD/redux/middleware/dist/src/libs/font-awesome/fonts/fontawesome-webfont.woff2
--------------------------------------------------------------------------------
/reactERP/src/components/app/app.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default class AppComponent extends React.Component{
4 | render(){
5 | return
{this.props.children}
6 | }
7 | }
--------------------------------------------------------------------------------
/component/src/app.es6.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 |
4 | //组件定义
5 | import DefineComponent from './define/define.es6';
6 | ReactDOM.render(, document.getElementById('define'));
--------------------------------------------------------------------------------
/reactERP/src/redux/rootReducer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {combineReducers} from 'redux'
3 |
4 | import datagrid from '../components/datagrid/datagridreducer'
5 |
6 | export default combineReducers({
7 | datagrid
8 | })
--------------------------------------------------------------------------------
/redux/middleware/src/redux/rootReducer.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {combineReducers} from 'redux'
3 |
4 | import datagrid from '../components/datagrid/datagridreducer'
5 |
6 | export default combineReducers({
7 | datagrid
8 | })
--------------------------------------------------------------------------------
/component/src/app.es5.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 | var ReactDOM = require('react-dom');
3 |
4 | //组件定义
5 | var DefineComponent = require('./define/define.es5');
6 | ReactDOM.render(, document.getElementById('define'));
7 |
8 |
--------------------------------------------------------------------------------
/component/src/define/define.es6.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | class Component1 extends React.Component{
3 | render(){
4 | return (
5 |
6 |
Tom
7 | Sam
8 |
9 | )
10 | }
11 | }
12 | export default Component1;
--------------------------------------------------------------------------------
/reactERP/src/redux/configStore.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {createStore, applyMiddleware} from 'redux'
3 |
4 | import rootReducer from './rootReducer'
5 |
6 | import middleware from './middleware'
7 |
8 | const store = createStore(rootReducer, applyMiddleware(middleware));
9 |
10 | export default store;
--------------------------------------------------------------------------------
/component/src/define/define.es5.js:
--------------------------------------------------------------------------------
1 | var React = require('react');
2 | var Component1 = React.createClass({
3 | render: function(){
4 | return (
5 |
6 |
Tom
7 | Sam
8 |
9 | )
10 | }
11 | })
12 | module.exports = Component1;
--------------------------------------------------------------------------------
/redux/middleware/src/redux/store.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {createStore, applyMiddleware} from 'redux'
3 |
4 | import rootReducer from './rootReducer'
5 |
6 | import middleware from './middleware'
7 |
8 | const store = createStore(rootReducer, applyMiddleware(middleware));
9 |
10 | export default store;
--------------------------------------------------------------------------------
/reactERP/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DK-React项目应用
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/redux/middleware/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DK-中间件实现案例
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/reactERP/src/libs/common/common.js:
--------------------------------------------------------------------------------
1 | import {EventEmitter} from 'events'
2 |
3 | export default {
4 | state: {
5 | component1: {
6 | count: 0
7 | },
8 | component2: {
9 | count: 0
10 | }
11 | },
12 | event: new EventEmitter(),
13 | addEvent(name, e){
14 | this.event.on(name, e)
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/reactERP/src/modules/login/LoginConstants.js:
--------------------------------------------------------------------------------
1 | export const LOGIN_LOGIN_REQUEST = 'LOGIN_LOGIN_REQUEST';
2 | export const LOGIN_LOGIN_SUCCESS = 'LOGIN_LOGIN_SUCCESS';
3 | export const LOGIN_LOGIN_FAIL = 'LOGIN_LOGIN_FAIL';
4 |
5 | export const ORDER_GETCODE_REQUEST = 'ORDER_GETCODE_REQUEST';
6 | export const ORDER_GETCODE_SUCCESS = 'ORDER_GETCODE_SUCCESS';
7 | export const ORDER_GETCODE_FAIL = 'ORDER_GETCODE_FAIL';
--------------------------------------------------------------------------------
/reactERP/src/components/datagrid/datagridaction.js:
--------------------------------------------------------------------------------
1 | import * as constants from './datagridconstants'
2 |
3 | export function refresh(_config){
4 | return {
5 | types: [constants.Requesting, constants.Requested, constants.RequestError],
6 | url: _config.url,
7 | method: _config.method || 'get',
8 | data: _config.data || {},
9 | name: _config.name
10 | }
11 | }
--------------------------------------------------------------------------------
/reactERP/src/modules/order/orderConstant.js:
--------------------------------------------------------------------------------
1 | export const ORDER_SCANCODE_REQUEST = 'ORDER_SCANCODE_REQUEST';
2 | export const ORDER_SCANCODE_SUCCESS = 'ORDER_SCANCODE_SUCCESS';
3 | export const ORDER_SCANCODE_FAIL = 'ORDER_SCANCODE_FAIL';
4 |
5 | export const ORDER_PRINT_REQUEST = 'ORDER_SCANCODE_REQUEST';
6 | export const ORDER_PRINT_SUCCESS = 'ORDER_SCANCODE_SUCCESS';
7 | export const ORDER_PRINT_FAIL = 'ORDER_SCANCODE_FAIL';
--------------------------------------------------------------------------------
/redux/middleware/src/components/datagrid/datagridaction.js:
--------------------------------------------------------------------------------
1 | import * as constants from './datagridconstants'
2 |
3 | export function refresh(_config){
4 | return {
5 | types: [constants.Requesting, constants.Requested, constants.RequestError],
6 | url: _config.url,
7 | method: _config.method || 'get',
8 | data: _config.data || {},
9 | name: _config.name
10 | }
11 | }
--------------------------------------------------------------------------------
/reactERP/src/modules/login/LoginAction.js:
--------------------------------------------------------------------------------
1 | import * as LoginConstants from './LoginConstants';
2 |
3 | export function login(username, password){
4 | return {
5 | types: ['a', 'b', 'c'],
6 | path: 'pro/fetchAllProducts',
7 | method: 'get',
8 | query: {username, password}
9 | }
10 | }
11 |
12 | export function getCode(){
13 | return {
14 | types: ['getCode1', 'getCode2', 'getCode3']
15 | }
16 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/larger.less:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .@{fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .@{fa-css-prefix}-2x { font-size: 2em; }
11 | .@{fa-css-prefix}-3x { font-size: 3em; }
12 | .@{fa-css-prefix}-4x { font-size: 4em; }
13 | .@{fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_larger.scss:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .#{$fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .#{$fa-css-prefix}-2x { font-size: 2em; }
11 | .#{$fa-css-prefix}-3x { font-size: 3em; }
12 | .#{$fa-css-prefix}-4x { font-size: 4em; }
13 | .#{$fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/list.less:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: @fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .@{fa-css-prefix}-li {
11 | position: absolute;
12 | left: -@fa-li-width;
13 | width: @fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.@{fa-css-prefix}-lg {
17 | left: (-@fa-li-width + (4em / 14));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_list.scss:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: $fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .#{$fa-css-prefix}-li {
11 | position: absolute;
12 | left: -$fa-li-width;
13 | width: $fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.#{$fa-css-prefix}-lg {
17 | left: -$fa-li-width + (4em / 14);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/redux/middleware/src/app.js:
--------------------------------------------------------------------------------
1 | import './libs/bootstrap/css/bootstrap.min.css'
2 | import './libs/font-awesome/css/font-awesome.min.css'
3 |
4 | import React from 'react'
5 | import ReactDOM from 'react-dom'
6 | import {Provider} from 'react-redux'
7 |
8 | import store from './redux/configStore'
9 | import CNodeComponent from './components/cnode/cnode'
10 |
11 | ReactDOM.render(
12 |
13 |
14 | ,
15 | document.getElementById('app')
16 | )
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/font-awesome.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables";
7 | @import "mixins";
8 | @import "path";
9 | @import "core";
10 | @import "larger";
11 | @import "fixed-width";
12 | @import "list";
13 | @import "bordered-pulled";
14 | @import "animated";
15 | @import "rotated-flipped";
16 | @import "stacked";
17 | @import "icons";
18 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/core.less:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .@{fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_core.scss:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix} {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/font-awesome.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables.less";
7 | @import "mixins.less";
8 | @import "path.less";
9 | @import "core.less";
10 | @import "larger.less";
11 | @import "fixed-width.less";
12 | @import "list.less";
13 | @import "bordered-pulled.less";
14 | @import "animated.less";
15 | @import "rotated-flipped.less";
16 | @import "stacked.less";
17 | @import "icons.less";
18 |
--------------------------------------------------------------------------------
/reactERP/src/app.js:
--------------------------------------------------------------------------------
1 | import './libs/bootstrap/css/bootstrap.min.css'
2 | import './libs/font-awesome/css/font-awesome.min.css'
3 | import './libs/common/common.scss'
4 |
5 | import React from 'react'
6 | import ReactDOM from 'react-dom'
7 | import {Router, hashHistory} from 'react-router'
8 | import {Provider} from 'react-redux'
9 |
10 | import store from './redux/configStore'
11 | import routes from './router'
12 |
13 | ReactDOM.render(
14 |
15 |
16 | ,
17 | document.getElementById('app')
18 | )
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/stacked.less:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; }
21 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_stacked.scss:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; }
21 |
--------------------------------------------------------------------------------
/redux/middleware/src/components/cnode/cnode.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import Datagrid from '../../components/datagrid/datagridcomponent'
3 |
4 | export default class CNodeComponent extends React.Component{
5 | static defaultProps = {
6 | config: {
7 | url: 'https://cnodejs.org/api/v1/topics',
8 | data: {page: 1, limit: 10},
9 | cols: ['title', 'reply_count', 'top', 'create_at', 'last_reply_at']
10 | }
11 | }
12 | render(){
13 | return (
14 |
15 |
16 |
17 | )
18 | }
19 | }
--------------------------------------------------------------------------------
/reactERP/src/modules/order/orderAction.js:
--------------------------------------------------------------------------------
1 | import * as orderConstant from './orderConstant'
2 |
3 | export function scanCode(){
4 | return {
5 | types: [orderConstant.ORDER_SCANCODE_REQUEST, orderConstant.ORDER_PRINT_SUCCESS, orderConstant.ORDER_SCANCODE_FAIL],
6 | path: 'pro/fetchAllProducts',
7 | query: {code: '123'}
8 | }
9 | }
10 |
11 | export function print(){
12 | return {
13 | type:[orderConstant.ORDER_PRINT_REQUEST, orderConstant.ORDER_PRINT_REQUEST, orderConstant.ORDER_PRINT_FAIL],
14 | path: 'http://10.3.134.78:81/print',
15 | method: 'post',
16 | query: {text: 'DK测试'}
17 | }
18 | }
--------------------------------------------------------------------------------
/reactERP/src/modules/order/orderReducer.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import update from 'react-addons-update';
3 | import * as OrderConstants from './orderConstant';
4 |
5 | //[{name:'娃哈哈', price: 10.22}]
6 | function scanCode(state = [], action){
7 | if(action.type == OrderConstants.ORDER_PRINT_SUCCESS){
8 | const newState = update(state, {$push: [action.body]});
9 | return newState;
10 | }
11 | return state;
12 | }
13 |
14 | function print(state = {}, action){
15 | return state;
16 | }
17 |
18 | const orderReducers = combineReducers({
19 | scanCode,
20 | print
21 | });
22 |
23 | export default orderReducers;
--------------------------------------------------------------------------------
/reactERP/src/components/login/login.scss:
--------------------------------------------------------------------------------
1 | .login-box{
2 | width: 428px;
3 | height: 298px;
4 | position: absolute;
5 | left: 50%;
6 | top: 50%;
7 | transform: translate(-50%, -80%);
8 | background: #FFFFFF;
9 | border-radius: 5px;
10 | box-shadow: -30px 30px 50px rgba(0, 0, 0, 0.32);
11 | padding: 15px;
12 | border-top: solid 1px #efefef;
13 | border-right: solid 1px #efefef;
14 | .copyright{
15 | font-size: 11px;
16 | margin: 0 auto;
17 | padding: 10px 10px 0;
18 | text-align: center;
19 | position: absolute;
20 | bottom: -32px;
21 | left: 50%;
22 | transform: translate(-50%, 0);
23 | color: #7F7F7F;
24 | }
25 | }
--------------------------------------------------------------------------------
/reactERP/src/components/spinner/spinner.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react'
2 | import './spinner.scss'
3 |
4 | class SpinnerComponent extends React.Component{
5 | render(){
6 | let html = (
7 |
15 | )
16 | return this.props.show ? html : null;
17 | }
18 | }
19 |
20 | export default SpinnerComponent
--------------------------------------------------------------------------------
/redux/middleware/src/components/spinner/spinner.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react'
2 | import './spinner.scss'
3 |
4 | class SpinnerComponent extends React.Component{
5 | render(){
6 | let html = (
7 |
15 | )
16 | return this.props.show ? html : null;
17 | }
18 | }
19 |
20 | export default SpinnerComponent
--------------------------------------------------------------------------------
/reactERP/src/components/home/home.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react'
2 | import HeaderComponent from './header/header'
3 | import NavComponent from './nav/nav'
4 | import './home.scss'
5 |
6 | export default class HomeComponent extends Component{
7 | render(){
8 | return (
9 |
10 |
11 |
12 |
13 |
14 |
{this.props.children}
15 |
16 |
17 |
@dk
18 |
19 | )
20 | }
21 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/bordered-pulled.less:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em @fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .@{fa-css-prefix}-pull-left { float: left; }
11 | .@{fa-css-prefix}-pull-right { float: right; }
12 |
13 | .@{fa-css-prefix} {
14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .@{fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_bordered-pulled.scss:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em $fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .#{$fa-css-prefix}-pull-left { float: left; }
11 | .#{$fa-css-prefix}-pull-right { float: right; }
12 |
13 | .#{$fa-css-prefix} {
14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
16 | }
17 |
18 | /* Deprecated as of 4.4.0 */
19 | .pull-right { float: right; }
20 | .pull-left { float: left; }
21 |
22 | .#{$fa-css-prefix} {
23 | &.pull-left { margin-right: .3em; }
24 | &.pull-right { margin-left: .3em; }
25 | }
26 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/rotated-flipped.less:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
7 |
8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .@{fa-css-prefix}-rotate-90,
15 | :root .@{fa-css-prefix}-rotate-180,
16 | :root .@{fa-css-prefix}-rotate-270,
17 | :root .@{fa-css-prefix}-flip-horizontal,
18 | :root .@{fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/reactERP/src/router/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import {Route, IndexRoute} from 'react-router'
3 |
4 | import AppComponent from '../components/app/app'
5 | import HomeComponent from '../components/home/home'
6 | import LoginComponent from '../components/login/login'
7 | import CNodeComponent from '../components/cnode/cnode'
8 |
9 |
10 | const routes = (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | )
20 |
21 | export default routes;
--------------------------------------------------------------------------------
/reactERP/src/components/home/home.scss:
--------------------------------------------------------------------------------
1 | @import '../../libs/common/global.scss';
2 | .dk-container{
3 | width: 100%;
4 | height: 100%;
5 | position: relative;
6 | }
7 |
8 |
9 |
10 | .dk-body{position: fixed; top: 42px; left: 0; right: 0; bottom: 32px;}
11 |
12 |
13 |
14 | .dk-content{
15 | position: absolute; top: 0; bottom: 0; left: 229px; right: 0; overflow: auto;
16 | .dk-toolbar{
17 | width: 100%;
18 | height: 50px;
19 | padding: 10px 20px;
20 | border-bottom: solid 1px #ccc;
21 | }
22 | .dk-viewer{
23 | width: 100%;
24 | position: absolute;
25 | top: 0;
26 | bottom: 0px;
27 | overflow-x: hidden;
28 | overflow-y: auto;
29 | }
30 | }
31 |
32 | .dk-footer{position: fixed; border-top: solid 1px #ccc; bottom: 0; height: 32px; width: 100%; text-align: center; line-height: 32px;}
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_rotated-flipped.scss:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
7 |
8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
10 |
11 | // Hook for IE8-9
12 | // -------------------------
13 |
14 | :root .#{$fa-css-prefix}-rotate-90,
15 | :root .#{$fa-css-prefix}-rotate-180,
16 | :root .#{$fa-css-prefix}-rotate-270,
17 | :root .#{$fa-css-prefix}-flip-horizontal,
18 | :root .#{$fa-css-prefix}-flip-vertical {
19 | filter: none;
20 | }
21 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/path.less:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_path.scss:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'),
9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
13 | font-weight: normal;
14 | font-style: normal;
15 | }
16 |
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/animated.less:
--------------------------------------------------------------------------------
1 | // Animated Icons
2 | // --------------------------
3 |
4 | .@{fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .@{fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/reactERP/src/components/datagrid/datagridreducer.js:
--------------------------------------------------------------------------------
1 | import * as constants from './datagridconstants'
2 |
3 | export default function datagrid(state = {}, action){
4 | let _state = JSON.parse(JSON.stringify(state));
5 | switch(action.type){
6 | case constants.Requesting:
7 | _state.show = true;
8 | break;
9 | case constants.Requested:
10 | _state.show = false;
11 | if(action.name){
12 | _state[action.name] = _state[action.name] || {};
13 | _state[action.name].dataset = action.result;
14 | } else {
15 | _state.dataset = action.result;
16 | }
17 | break;
18 | case constants.RequestError:
19 | _state.show =false;
20 | _state.error = action.error;
21 | break
22 | }
23 | return _state;
24 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_animated.scss:
--------------------------------------------------------------------------------
1 | // Spinning Icons
2 | // --------------------------
3 |
4 | .#{$fa-css-prefix}-spin {
5 | -webkit-animation: fa-spin 2s infinite linear;
6 | animation: fa-spin 2s infinite linear;
7 | }
8 |
9 | .#{$fa-css-prefix}-pulse {
10 | -webkit-animation: fa-spin 1s infinite steps(8);
11 | animation: fa-spin 1s infinite steps(8);
12 | }
13 |
14 | @-webkit-keyframes fa-spin {
15 | 0% {
16 | -webkit-transform: rotate(0deg);
17 | transform: rotate(0deg);
18 | }
19 | 100% {
20 | -webkit-transform: rotate(359deg);
21 | transform: rotate(359deg);
22 | }
23 | }
24 |
25 | @keyframes fa-spin {
26 | 0% {
27 | -webkit-transform: rotate(0deg);
28 | transform: rotate(0deg);
29 | }
30 | 100% {
31 | -webkit-transform: rotate(359deg);
32 | transform: rotate(359deg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/redux/middleware/src/components/datagrid/datagridreducer.js:
--------------------------------------------------------------------------------
1 | import * as constants from './datagridconstants'
2 |
3 | export default function datagrid(state = {}, action){
4 | let _state = JSON.parse(JSON.stringify(state));
5 | switch(action.type){
6 | case constants.Requesting:
7 | _state.show = true;
8 | break;
9 | case constants.Requested:
10 | _state.show = false;
11 | if(action.name){
12 | _state[action.name] = _state[action.name] || {};
13 | _state[action.name].dataset = action.result;
14 | } else {
15 | _state.dataset = action.result;
16 | }
17 | break;
18 | case constants.RequestError:
19 | _state.show =false;
20 | _state.error = action.error;
21 | break
22 | }
23 | return _state;
24 | }
--------------------------------------------------------------------------------
/reactERP/src/redux/middleware.js:
--------------------------------------------------------------------------------
1 | import http from '../utils/httpclient'
2 | import * as constants from '../components/datagrid/datagridconstants'
3 |
4 | export default function(api){
5 | return function(dispatch){
6 | return function(action){
7 | let {type, types, url, data, method = 'get', name} = action;
8 | if(!url){
9 | return dispatch(action)
10 | }
11 |
12 | dispatch({type: constants.Requesting})
13 |
14 | http[method](url, data).then((res) => {
15 | let _action = {
16 | type: constants.Requested,
17 | name,
18 | result: res.data
19 | }
20 | dispatch(_action)
21 | }).catch((error) => {
22 | dispatch({type: constants.RequestError})
23 | })
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/redux/middleware/src/redux/middleware.js:
--------------------------------------------------------------------------------
1 | import http from '../utils/httpclient'
2 | import * as constants from '../components/datagrid/datagridconstants'
3 |
4 | export default function(api){
5 | return function(dispatch){
6 | return function(action){
7 | let {type, types, url, data, method = 'get', name} = action;
8 | if(!url){
9 | return dispatch(action)
10 | }
11 |
12 | dispatch({type: constants.Requesting})
13 |
14 | http[method](url, data).then((res) => {
15 | let _action = {
16 | type: constants.Requested,
17 | name,
18 | result: res.data
19 | }
20 | dispatch(_action)
21 | }).catch((error) => {
22 | dispatch({type: constants.RequestError})
23 | })
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/reactERP/src/modules/cp/cp.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | let Login = (props) => {
4 | return ;
5 | }
6 |
7 |
8 | let Logout = (props) => {
9 | return ;
10 | }
11 |
12 | export default Login
13 |
14 | // export default class CP extends React.Component{
15 | // state = {
16 | // status: 0
17 | // }
18 |
19 | // login(){
20 | // this.setState({status: 1})
21 | // }
22 |
23 | // logout(){
24 | // this.setState({status: 0})
25 | // }
26 |
27 | // render(){
28 | // let button = null;
29 | // if(this.state.status == 0){
30 | // button =
31 | // } else {
32 | // button =
33 | // }
34 |
35 | // return {button}
36 | // }
37 | // }
--------------------------------------------------------------------------------
/reactERP/src/modules/login/LoginReducer.js:
--------------------------------------------------------------------------------
1 | // import httpclient from '../../utils/HttpClient'
2 | import * as LoginConstants from './LoginConstants';
3 | import { combineReducers } from 'redux';
4 | import update from 'react-addons-update'
5 | function login(state = [], action){
6 |
7 | // httpclient.post(action.url, action.data).then(response => {
8 | // console.log(response);
9 | // state.state = response.state;
10 | // return state;
11 | // })
12 |
13 | // return state;
14 |
15 | // state.dataset = action.response.data.data;
16 | // console.log(action);
17 | const newData = update(state, {$push: [action.body]});
18 | // console.log(newData, state);
19 | return newData;
20 | }
21 |
22 | function getCode(state = {}, action){
23 | return state;
24 | }
25 |
26 | const logineReducer = combineReducers(
27 | {
28 | login,
29 | getCode
30 | }
31 | );
32 |
33 | export default logineReducer;
--------------------------------------------------------------------------------
/component/src/style/README.md:
--------------------------------------------------------------------------------
1 | ## 普通样式名称使用 —— className
2 | app.css
3 | ```css
4 | .c1{
5 | color: red;
6 | width: 100%;
7 | height: 300px;
8 | border: solid 1px red;
9 | }
10 | ```
11 | app.js
12 | ```javascript
13 | import './app.css'
14 |
15 | import React from 'react';
16 | import ReactDOM from 'react-dom';
17 |
18 | import './modules/cp/cp.scss'
19 | class Component1 extends React.Component{
20 | render(){
21 | return (
22 |
23 | )
24 | }
25 | }
26 |
27 | ReactDOM.render(
28 | ,
29 | document.getElementById('app')
30 | )
31 | ```
32 |
33 | ## 行内样式
34 | ```javascript
35 | let c1 = {
36 | color: 'red',
37 | width: '100%',
38 | height: '300px',
39 | border: 'solid 1px red'
40 | }
41 | class Component1 extends React.Component{
42 | render(){
43 | console.log(c1)
44 | return (
45 |
46 | )
47 | }
48 | }
49 | ```
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/less/mixins.less:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | .fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | .fa-icon-rotate(@degrees, @rotation) {
15 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
16 | -webkit-transform: rotate(@degrees);
17 | -ms-transform: rotate(@degrees);
18 | transform: rotate(@degrees);
19 | }
20 |
21 | .fa-icon-flip(@horiz, @vert, @rotation) {
22 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
23 | -webkit-transform: scale(@horiz, @vert);
24 | -ms-transform: scale(@horiz, @vert);
25 | transform: scale(@horiz, @vert);
26 | }
27 |
--------------------------------------------------------------------------------
/reactERP/src/components/home/header/header.scss:
--------------------------------------------------------------------------------
1 | @import '../../../libs/common/global.scss';
2 |
3 | .dk-header{
4 | position: fixed;
5 | top: 0;
6 | width: 100%;
7 | height: 42px;
8 | border-bottom: solid 1px #ccc;
9 | /*logo*/
10 | >ul:first-child{
11 | width: 200px;
12 | height: 100%;
13 | float: left;
14 | li{
15 | width: 100%;
16 | height: 100%;
17 | padding: 4px 15px;
18 | font-family: 'Raleway', sans-serif;
19 | font-size: 25px;
20 | a{
21 | color: #666666;
22 | }
23 | }
24 | }
25 | /*right*/
26 | >ul:last-child{
27 | height: 100%;
28 | float: right;
29 | padding-right: 20px;
30 | li{
31 | // width: 48px;
32 | height: 100%;
33 | position: relative;
34 | text-align: center;
35 | padding: 15px;
36 | float: left;
37 | a{color: #666666;}
38 | i{font-size: 18px;}
39 | span{position: absolute; top: 5px; left: 3px; font-size: 10px; padding: 2px 5px;}
40 | }
41 | li:last-child{
42 | width: auto;
43 | padding: 15px;
44 | }
45 | li:hover{
46 | background-color: #eceeef;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/reactERP/src/libs/font-awesome/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | @mixin fa-icon() {
5 | display: inline-block;
6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
7 | font-size: inherit; // can't have font-size inherit on line above, so need to override
8 | text-rendering: auto; // optimizelegibility throws things off #1094
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 |
12 | }
13 |
14 | @mixin fa-icon-rotate($degrees, $rotation) {
15 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
16 | -webkit-transform: rotate($degrees);
17 | -ms-transform: rotate($degrees);
18 | transform: rotate($degrees);
19 | }
20 |
21 | @mixin fa-icon-flip($horiz, $vert, $rotation) {
22 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
23 | -webkit-transform: scale($horiz, $vert);
24 | -ms-transform: scale($horiz, $vert);
25 | transform: scale($horiz, $vert);
26 | }
27 |
--------------------------------------------------------------------------------
/reactERP/src/components/modal/modalcomponent.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react'
2 |
3 | import DatagridComponent from '../datagrid/datagridcomponent'
4 |
5 | import './modal.css'
6 |
7 | class ModalComponent extends Component{
8 | cancel(){
9 | this.props.cb();
10 | }
11 | render(){
12 | let content = null;
13 | if(this.props.config.type == 'datagrid'){
14 | content =
15 | } else {
16 | content = modal
17 | }
18 |
19 | let html = (
20 |
21 |
22 |
23 |
Modal Header
24 | ×
25 |
26 |
27 | {content}
28 |
29 |
30 |
31 |
32 | )
33 | return this.props.show ? html : null;
34 | }
35 | }
36 |
37 | export default ModalComponent;
--------------------------------------------------------------------------------
/reactERP/src/modules/order/orderComponent.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {connect} from 'react-redux'
3 | import * as orderActions from './orderAction';
4 | import PropTypes from 'prop-types'
5 |
6 |
7 | class OrderComponent extends React.Component{
8 | scanHandler(){
9 | this.props.scanCode();
10 | }
11 | printHandler(){
12 | this.props.print();
13 | }
14 | render(){
15 | return (
16 |
17 |
18 |
19 |
20 | - {this.props.name}
21 | - {this.props.price}
22 |
23 |
{this.props.order.scanCode.length}
24 |
25 | )
26 | }
27 | }
28 |
29 | OrderComponent.propTypes = {
30 | name: PropTypes.string.isRequired
31 | }
32 |
33 | // const mapStateToProps = state => ({order: state.order})
34 | // state == store
35 | const mapStateToProps = (store) => {
36 | return {
37 | order: store.order
38 | }
39 | }
40 | export default connect(mapStateToProps, orderActions)(OrderComponent)
41 |
42 | // export default OrderComponent;
--------------------------------------------------------------------------------
/js/react-dom.js:
--------------------------------------------------------------------------------
1 | /**
2 | * ReactDOM v15.0.1
3 | *
4 | * Copyright 2013-present, Facebook, Inc.
5 | * All rights reserved.
6 | *
7 | * This source code is licensed under the BSD-style license found in the
8 | * LICENSE file in the root directory of this source tree. An additional grant
9 | * of patent rights can be found in the PATENTS file in the same directory.
10 | *
11 | */
12 | // Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
13 | ;(function(f) {
14 | // CommonJS
15 | if (typeof exports === "object" && typeof module !== "undefined") {
16 | module.exports = f(require('react'));
17 |
18 | // RequireJS
19 | } else if (typeof define === "function" && define.amd) {
20 | define(['react'], f);
21 |
22 | //
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
34 |
35 |