Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
react-spd
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 527023d3
authored
May 22, 2017
by
hfpp2012 yinsigan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
autobind
1 parent
e2a8896a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
17 additions
and
14 deletions
.babelrc
package.json
readme.md
src/components/Element.js
src/components/ElementGroup.js
src/components/Header.js
src/components/ModalRepoForm.js
src/components/RegionalDesign.js
yarn.lock
.babelrc
View file @
527023d
{
"presets":[
"es2015", "react"
"presets": ["es2015", "stage-0", "react"],
"plugins": [
["transform-decorators-legacy"],
]
}
package.json
View file @
527023d
...
...
@@ -7,6 +7,8 @@
"start"
:
"webpack-dev-server"
},
"dependencies"
:
{
"autobind-decorator"
:
"^1.4.1"
,
"babel-preset-stage-0"
:
"^6.24.1"
,
"halogen"
:
"^0.2.0"
,
"html-webpack-plugin"
:
"^2.28.0"
,
"jquery"
:
"^3.2.1"
,
...
...
@@ -14,7 +16,6 @@
"react"
:
"^15.5.4"
,
"react-addons-update"
:
"^15.5.2"
,
"react-alert"
:
"^2.0.1"
,
"react-autobind"
:
"^1.0.6"
,
"react-bootstrap"
:
"^0.31.0"
,
"react-dom"
:
"^15.5.4"
,
"react-router-dom"
:
"^4.1.1"
,
...
...
@@ -24,6 +25,7 @@
"devDependencies"
:
{
"babel-core"
:
"^6.24.1"
,
"babel-loader"
:
"^7.0.0"
,
"babel-plugin-transform-decorators-legacy"
:
"^1.3.4"
,
"babel-preset-es2015"
:
"^6.24.1"
,
"babel-preset-react"
:
"^6.24.1"
,
"css-loader"
:
"^0.28.1"
,
...
...
readme.md
View file @
527023d
...
...
@@ -5,7 +5,7 @@ yarn config set registry 'https://registry.npm.taobao.org'
yarn add webpack webpack-dev-server path
yarn add babel-loader babel-core babel-preset-es2015 babel-preset-react --dev
yarn add babel-loader babel-
preset-stage-0 babel-
core babel-preset-es2015 babel-preset-react --dev
yarn add html-webpack-plugin
...
...
src/components/Element.js
View file @
527023d
import
React
from
'react'
import
Move
from
'../libs/move'
import
EventEmitter
from
'../libs/eventEmitter'
import
auto
Bind
from
'react-autobind
'
import
auto
bind
from
'autobind-decorator
'
@
autobind
export
default
class
Element
extends
React
.
Component
{
static
get
getDefaultProps
()
{
return
{
...
...
@@ -24,7 +25,6 @@ export default class Element extends React.Component {
name
:
this
.
props
.
name
,
prev_name
:
this
.
props
.
name
};
autoBind
(
this
);
}
componentDidUpdate
(
props
,
state
)
{
...
...
src/components/ElementGroup.js
View file @
527023d
import
React
from
'react'
import
Element
from
'./Element'
import
ReactAddonsUpdate
from
'react-addons-update'
import
auto
Bind
from
'react-autobind
'
import
auto
bind
from
'autobind-decorator
'
@
autobind
export
default
class
ElementGroup
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
...
...
@@ -13,7 +14,6 @@ export default class ElementGroup extends React.Component {
{
id
:
3
,
name
:
"药架格"
,
initialPos
:
{
x
:
80
,
y
:
70
+
60
*
2
},
target_type
:
'RegionalDesign::DrugBrandreth'
}
]
};
autoBind
(
this
);
}
cloneElement
(
element
)
{
...
...
src/components/Header.js
View file @
527023d
...
...
@@ -3,15 +3,15 @@ import ModalRepoForm from './ModalRepoForm'
import
ReactAddonsUpdate
from
'react-addons-update'
import
Loader
from
'halogen/PulseLoader'
import
{
Link
}
from
'react-router-dom'
import
auto
Bind
from
'react-autobind
'
import
auto
bind
from
'autobind-decorator
'
@
autobind
export
default
class
Header
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
data
:
null
,
loading
:
true
,
error
:
null
};
autoBind
(
this
);
}
componentDidMount
()
{
...
...
src/components/ModalRepoForm.js
View file @
527023d
...
...
@@ -3,15 +3,15 @@ import { Modal, Button } from 'react-bootstrap'
import
{
Form
,
FormGroup
,
Col
,
FormControl
,
ControlLabel
}
from
'react-bootstrap'
import
EventEmitter
from
'../libs/eventEmitter'
import
$
from
'jquery'
import
auto
Bind
from
'react-autobind
'
import
auto
bind
from
'autobind-decorator
'
@
autobind
export
default
class
ModalRepoForm
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
showModal
:
false
,
name
:
''
};
autoBind
(
this
);
}
close
()
{
...
...
src/components/RegionalDesign.js
View file @
527023d
...
...
@@ -4,15 +4,15 @@ import Element from './Element'
import
ReactAddonsUpdate
from
'react-addons-update'
import
EventEmitter
from
'../libs/eventEmitter'
import
$
from
'jquery'
import
auto
Bind
from
'react-autobind
'
import
auto
bind
from
'autobind-decorator
'
@
autobind
export
default
class
RegionalDesign
extends
React
.
Component
{
constructor
(
props
){
super
(
props
);
this
.
state
=
{
data
:
null
,
loading
:
true
,
error
:
null
,
object_name
:
''
,
object_type
:
''
,
children_object_type
:
''
};
autoBind
(
this
);
}
getConfig
(
props
,
key
)
{
...
...
yarn.lock
View file @
527023d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment