Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fe-app-h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万亚飞
fe-app-h5
Commits
de5d7abd
Commit
de5d7abd
authored
May 27, 2019
by
万亚飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
81bf0869
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
10 deletions
+42
-10
webpack.dev.js
config/webpack.dev.js
+2
-0
webpack.prod.js
config/webpack.prod.js
+1
-0
App.jsx
src/App.jsx
+5
-3
index.js
src/index.js
+2
-2
JobList.js
src/pages/user/JobList.js
+3
-2
Train.js
src/pages/user/Train.js
+11
-1
TrainList.js
src/pages/user/TrainList.js
+1
-0
addMaterial.js
src/pages/user/addMaterial.js
+11
-2
global.less
src/static/styles/global.less
+6
-0
No files found.
config/webpack.dev.js
View file @
de5d7abd
...
...
@@ -12,6 +12,7 @@ module.exports = {
vendor
:
[
'react'
,
'better-scroll'
,
'react-redux'
,
'react-lazyload'
]
},
output
:
{
publicPath
:
'/'
,
filename
:
'[name].[hash:8].js'
,
path
:
resolve
(
__dirname
,
'../build'
)
},
...
...
@@ -109,6 +110,7 @@ module.exports = {
devServer
:
{
contentBase
:
'../build'
,
host
:
'0.0.0.0'
,
historyApiFallback
:
true
,
open
:
true
,
port
:
5000
,
hot
:
true
...
...
config/webpack.prod.js
View file @
de5d7abd
...
...
@@ -18,6 +18,7 @@ module.exports = {
vendor
:
[
'react'
]
},
output
:
{
publicPath
:
'/'
,
filename
:
'[name].[contenthash:8].js'
,
path
:
resolve
(
__dirname
,
'../dist'
)
},
...
...
src/App.jsx
View file @
de5d7abd
...
...
@@ -49,11 +49,13 @@ class App extends React.Component {
<
div
className=
"container"
>
<
div
className=
"page-content"
>
<
Switch
>
<
Route
path=
{
[
'/user/job/add'
,
'/user/job/:id'
]
}
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job/add"
key=
"add-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job/:id"
key=
"edit-job"
component=
{
AddMaterial
}
/>
<
Route
path=
"/user/job"
component=
{
JobList
}
/>
<
Route
path=
{
[
'/user/train/add'
,
'/user/train/:id'
]
}
component=
{
Train
}
/>
<
Route
path=
"/user/train/add"
key=
"add-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train/:id"
key=
"edit-train"
component=
{
Train
}
/>
<
Route
path=
"/user/train"
component=
{
TrainList
}
/>
<
Route
path=
"*"
component=
{
JobList
}
/>
<
Route
component=
{
JobList
}
/>
</
Switch
>
</
div
>
</
div
>
...
...
src/index.js
View file @
de5d7abd
...
...
@@ -8,10 +8,10 @@ import { Provider } from 'react-redux';
// import './assets/index.less';
import
'./static/styles/global.less'
;
ReactDOM
.
render
(
<
Hash
Router
basename
=
"/new"
>
<
Browser
Router
basename
=
"/new"
>
<
Provider
store
=
{
store
}
>
<
App
/>
<
/Provider
>
<
/
Hash
Router>
,
<
/
Browser
Router>
,
document
.
querySelector
(
'#root'
)
);
src/pages/user/JobList.js
View file @
de5d7abd
...
...
@@ -36,8 +36,8 @@ function ListItemView(props) {
return
(
<
React
.
Fragment
>
<
ul
className
=
"train-list"
>
{
props
.
dataArr
.
map
(
item
=>
(
<
TrainItem
iType
=
{
props
.
tabIndex
}
key
=
{
i
tem
.
id
}
data
=
{
item
}
delToggle
=
{
props
.
delTrain
}
/
>
{
props
.
dataArr
.
map
(
(
item
,
index
)
=>
(
<
TrainItem
iType
=
{
props
.
tabIndex
}
key
=
{
i
ndex
}
data
=
{
item
}
delToggle
=
{
props
.
delTrain
}
/
>
))}
<
/ul
>
<
AddView
tabIndex
=
{
props
.
tabIndex
}
/
>
...
...
@@ -64,6 +64,7 @@ class JobList extends Component {
};
}
componentWillMount
()
{
document
.
title
=
'职业背景'
;
this
.
setState
({
tabIndex
:
parseInt
(
getParameterByName
(
'index'
,
location
.
href
))
||
0
});
...
...
src/pages/user/Train.js
View file @
de5d7abd
...
...
@@ -23,6 +23,8 @@ class Train extends Component {
imgUrls
:
[],
certificateFiles
:
[],
viewImages
:
[],
isEdit
:
false
,
//是否是编辑
hasChange
:
false
,
//是否编辑过
modifyId
:
null
};
//初始化图片
...
...
@@ -55,8 +57,10 @@ class Train extends Component {
this
.
setState
({
[
name
]:
value
});
this
.
hansChangeForm
();
};
componentDidMount
()
{
document
.
title
=
'受训背景'
;
app
().
downRefresh
(
false
);
app
().
notRefresh
(
false
);
const
id
=
getParam
(
location
.
href
);
...
...
@@ -98,6 +102,7 @@ class Train extends Component {
this
.
setState
({
[
name
]:
date
});
this
.
hansChangeForm
();
};
refreshFile
=
res
=>
{
if
(
res
.
code
>=
0
)
{
...
...
@@ -109,6 +114,7 @@ class Train extends Component {
this
.
initImgs
(
this
.
state
.
imgUrls
);
}
);
this
.
hansChangeForm
();
}
else
{
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
}
...
...
@@ -167,10 +173,14 @@ class Train extends Component {
}
]);
};
hansChangeForm
=
()
=>
{
this
.
setState
({
hasChange
:
true
});
};
delFile
=
()
=>
{
this
.
setState
({
certificateFiles
:
[]
});
this
.
hansChangeForm
();
};
render
()
{
const
{
startTime
,
endTime
,
backgroundArea
,
certificateFiles
,
viewImages
}
=
this
.
state
;
...
...
@@ -201,7 +211,7 @@ class Train extends Component {
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
/div
>
<
div
className
=
"bottom-operate"
>
<
button
onClick
=
{
this
.
submitTrain
}
className
=
"am-button am-button-primary"
>
<
button
disabled
=
{
this
.
state
.
isEdit
&&
!
this
.
state
.
hasChange
}
onClick
=
{
this
.
submitTrain
}
className
=
"am-button am-button-primary"
>
提交
<
/button
>
<
/div
>
...
...
src/pages/user/TrainList.js
View file @
de5d7abd
...
...
@@ -19,6 +19,7 @@ class TrainList extends Component {
}
};
componentDidMount
()
{
document
.
title
=
'受训背景'
;
app
().
downRefresh
(
true
);
app
().
notRefresh
(
true
);
const
userInfo
=
storage
.
getSS
(
'urlQuery'
);
...
...
src/pages/user/addMaterial.js
View file @
de5d7abd
...
...
@@ -20,6 +20,7 @@ class AddMaterial extends Component {
certificateFiles
:
[],
viewImages
:
[],
isEdit
:
false
,
//是否是编辑
hasChange
:
false
,
//是否编辑过
isShowRange
:
false
,
modifyId
:
null
,
id
:
null
...
...
@@ -34,7 +35,7 @@ class AddMaterial extends Component {
if
(
index
>
2
||
index
===
null
)
{
return
Toast
.
info
(
'路径有误'
);
}
console
.
log
(
modifyId
,
modifyId
!==
null
)
;
document
.
title
=
MATERIAL_ARR
[
index
]
;
this
.
setState
({
isEdit
:
modifyId
!==
null
,
materialType
:
index
,
...
...
@@ -91,6 +92,8 @@ class AddMaterial extends Component {
this
.
setState
({
[
name
]:
value
});
this
.
hansChangeForm
();
};
refreshFile
=
res
=>
{
if
(
res
.
code
>=
0
)
{
...
...
@@ -102,6 +105,7 @@ class AddMaterial extends Component {
this
.
initImgs
(
this
.
state
.
imgUrls
);
}
);
this
.
hansChangeForm
();
}
else
{
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
}
...
...
@@ -111,6 +115,7 @@ class AddMaterial extends Component {
this
.
setState
({
certificateFiles
:
[]
});
this
.
hansChangeForm
();
};
validateForm
=
()
=>
{
if
(
!
this
.
state
.
backgroundArea
)
{
...
...
@@ -118,6 +123,10 @@ class AddMaterial extends Component {
}
return
true
;
};
hansChangeForm
=
()
=>
{
this
.
setState
({
hasChange
:
true
});
};
toggleRange
=
()
=>
{
this
.
setState
({
isShowRange
:
!
this
.
state
.
isShowRange
...
...
@@ -188,7 +197,7 @@ class AddMaterial extends Component {
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
/div
>
<
div
className
=
"bottom-operate"
>
<
button
onClick
=
{
this
.
submitJob
}
className
=
"am-button am-button-primary"
>
<
button
disabled
=
{
this
.
state
.
isEdit
&&
!
this
.
state
.
hasChange
}
onClick
=
{
this
.
submitJob
}
className
=
"am-button am-button-primary"
>
提交
<
/button
>
<
/div
>
...
...
src/static/styles/global.less
View file @
de5d7abd
...
...
@@ -927,6 +927,12 @@ textarea::placeholder {
height: 45px;
line-height: 45px;
}
.am-button[disabled] {
background-color: #ddd;
&::before {
border: 1px solid #ddd !important;
}
}
.deposit-user .my-list .am-list-item .am-list-line .am-list-content,
.am-list-item .am-list-line .am-list-extra {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment