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 = {
...
@@ -12,6 +12,7 @@ module.exports = {
vendor
:
[
'react'
,
'better-scroll'
,
'react-redux'
,
'react-lazyload'
]
vendor
:
[
'react'
,
'better-scroll'
,
'react-redux'
,
'react-lazyload'
]
},
},
output
:
{
output
:
{
publicPath
:
'/'
,
filename
:
'[name].[hash:8].js'
,
filename
:
'[name].[hash:8].js'
,
path
:
resolve
(
__dirname
,
'../build'
)
path
:
resolve
(
__dirname
,
'../build'
)
},
},
...
@@ -109,6 +110,7 @@ module.exports = {
...
@@ -109,6 +110,7 @@ module.exports = {
devServer
:
{
devServer
:
{
contentBase
:
'../build'
,
contentBase
:
'../build'
,
host
:
'0.0.0.0'
,
host
:
'0.0.0.0'
,
historyApiFallback
:
true
,
open
:
true
,
open
:
true
,
port
:
5000
,
port
:
5000
,
hot
:
true
hot
:
true
...
...
config/webpack.prod.js
View file @
de5d7abd
...
@@ -18,6 +18,7 @@ module.exports = {
...
@@ -18,6 +18,7 @@ module.exports = {
vendor
:
[
'react'
]
vendor
:
[
'react'
]
},
},
output
:
{
output
:
{
publicPath
:
'/'
,
filename
:
'[name].[contenthash:8].js'
,
filename
:
'[name].[contenthash:8].js'
,
path
:
resolve
(
__dirname
,
'../dist'
)
path
:
resolve
(
__dirname
,
'../dist'
)
},
},
...
...
src/App.jsx
View file @
de5d7abd
...
@@ -49,11 +49,13 @@ class App extends React.Component {
...
@@ -49,11 +49,13 @@ class App extends React.Component {
<
div
className=
"container"
>
<
div
className=
"container"
>
<
div
className=
"page-content"
>
<
div
className=
"page-content"
>
<
Switch
>
<
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/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=
"/user/train"
component=
{
TrainList
}
/>
<
Route
path=
"*"
component=
{
JobList
}
/>
<
Route
component=
{
JobList
}
/>
</
Switch
>
</
Switch
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/index.js
View file @
de5d7abd
...
@@ -8,10 +8,10 @@ import { Provider } from 'react-redux';
...
@@ -8,10 +8,10 @@ import { Provider } from 'react-redux';
// import './assets/index.less';
// import './assets/index.less';
import
'./static/styles/global.less'
;
import
'./static/styles/global.less'
;
ReactDOM
.
render
(
ReactDOM
.
render
(
<
Hash
Router
basename
=
"/new"
>
<
Browser
Router
basename
=
"/new"
>
<
Provider
store
=
{
store
}
>
<
Provider
store
=
{
store
}
>
<
App
/>
<
App
/>
<
/Provider
>
<
/Provider
>
<
/
Hash
Router>
,
<
/
Browser
Router>
,
document
.
querySelector
(
'#root'
)
document
.
querySelector
(
'#root'
)
);
);
src/pages/user/JobList.js
View file @
de5d7abd
...
@@ -36,8 +36,8 @@ function ListItemView(props) {
...
@@ -36,8 +36,8 @@ function ListItemView(props) {
return
(
return
(
<
React
.
Fragment
>
<
React
.
Fragment
>
<
ul
className
=
"train-list"
>
<
ul
className
=
"train-list"
>
{
props
.
dataArr
.
map
(
item
=>
(
{
props
.
dataArr
.
map
(
(
item
,
index
)
=>
(
<
TrainItem
iType
=
{
props
.
tabIndex
}
key
=
{
i
tem
.
id
}
data
=
{
item
}
delToggle
=
{
props
.
delTrain
}
/
>
<
TrainItem
iType
=
{
props
.
tabIndex
}
key
=
{
i
ndex
}
data
=
{
item
}
delToggle
=
{
props
.
delTrain
}
/
>
))}
))}
<
/ul
>
<
/ul
>
<
AddView
tabIndex
=
{
props
.
tabIndex
}
/
>
<
AddView
tabIndex
=
{
props
.
tabIndex
}
/
>
...
@@ -64,6 +64,7 @@ class JobList extends Component {
...
@@ -64,6 +64,7 @@ class JobList extends Component {
};
};
}
}
componentWillMount
()
{
componentWillMount
()
{
document
.
title
=
'职业背景'
;
this
.
setState
({
this
.
setState
({
tabIndex
:
parseInt
(
getParameterByName
(
'index'
,
location
.
href
))
||
0
tabIndex
:
parseInt
(
getParameterByName
(
'index'
,
location
.
href
))
||
0
});
});
...
...
src/pages/user/Train.js
View file @
de5d7abd
...
@@ -23,6 +23,8 @@ class Train extends Component {
...
@@ -23,6 +23,8 @@ class Train extends Component {
imgUrls
:
[],
imgUrls
:
[],
certificateFiles
:
[],
certificateFiles
:
[],
viewImages
:
[],
viewImages
:
[],
isEdit
:
false
,
//是否是编辑
hasChange
:
false
,
//是否编辑过
modifyId
:
null
modifyId
:
null
};
};
//初始化图片
//初始化图片
...
@@ -55,8 +57,10 @@ class Train extends Component {
...
@@ -55,8 +57,10 @@ class Train extends Component {
this
.
setState
({
this
.
setState
({
[
name
]:
value
[
name
]:
value
});
});
this
.
hansChangeForm
();
};
};
componentDidMount
()
{
componentDidMount
()
{
document
.
title
=
'受训背景'
;
app
().
downRefresh
(
false
);
app
().
downRefresh
(
false
);
app
().
notRefresh
(
false
);
app
().
notRefresh
(
false
);
const
id
=
getParam
(
location
.
href
);
const
id
=
getParam
(
location
.
href
);
...
@@ -98,6 +102,7 @@ class Train extends Component {
...
@@ -98,6 +102,7 @@ class Train extends Component {
this
.
setState
({
this
.
setState
({
[
name
]:
date
[
name
]:
date
});
});
this
.
hansChangeForm
();
};
};
refreshFile
=
res
=>
{
refreshFile
=
res
=>
{
if
(
res
.
code
>=
0
)
{
if
(
res
.
code
>=
0
)
{
...
@@ -109,6 +114,7 @@ class Train extends Component {
...
@@ -109,6 +114,7 @@ class Train extends Component {
this
.
initImgs
(
this
.
state
.
imgUrls
);
this
.
initImgs
(
this
.
state
.
imgUrls
);
}
}
);
);
this
.
hansChangeForm
();
}
else
{
}
else
{
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
}
}
...
@@ -167,10 +173,14 @@ class Train extends Component {
...
@@ -167,10 +173,14 @@ class Train extends Component {
}
}
]);
]);
};
};
hansChangeForm
=
()
=>
{
this
.
setState
({
hasChange
:
true
});
};
delFile
=
()
=>
{
delFile
=
()
=>
{
this
.
setState
({
this
.
setState
({
certificateFiles
:
[]
certificateFiles
:
[]
});
});
this
.
hansChangeForm
();
};
};
render
()
{
render
()
{
const
{
startTime
,
endTime
,
backgroundArea
,
certificateFiles
,
viewImages
}
=
this
.
state
;
const
{
startTime
,
endTime
,
backgroundArea
,
certificateFiles
,
viewImages
}
=
this
.
state
;
...
@@ -201,7 +211,7 @@ class Train extends Component {
...
@@ -201,7 +211,7 @@ class Train extends Component {
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"bottom-operate"
>
<
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
>
<
/button
>
<
/div
>
<
/div
>
...
...
src/pages/user/TrainList.js
View file @
de5d7abd
...
@@ -19,6 +19,7 @@ class TrainList extends Component {
...
@@ -19,6 +19,7 @@ class TrainList extends Component {
}
}
};
};
componentDidMount
()
{
componentDidMount
()
{
document
.
title
=
'受训背景'
;
app
().
downRefresh
(
true
);
app
().
downRefresh
(
true
);
app
().
notRefresh
(
true
);
app
().
notRefresh
(
true
);
const
userInfo
=
storage
.
getSS
(
'urlQuery'
);
const
userInfo
=
storage
.
getSS
(
'urlQuery'
);
...
...
src/pages/user/addMaterial.js
View file @
de5d7abd
...
@@ -20,6 +20,7 @@ class AddMaterial extends Component {
...
@@ -20,6 +20,7 @@ class AddMaterial extends Component {
certificateFiles
:
[],
certificateFiles
:
[],
viewImages
:
[],
viewImages
:
[],
isEdit
:
false
,
//是否是编辑
isEdit
:
false
,
//是否是编辑
hasChange
:
false
,
//是否编辑过
isShowRange
:
false
,
isShowRange
:
false
,
modifyId
:
null
,
modifyId
:
null
,
id
:
null
id
:
null
...
@@ -34,7 +35,7 @@ class AddMaterial extends Component {
...
@@ -34,7 +35,7 @@ class AddMaterial extends Component {
if
(
index
>
2
||
index
===
null
)
{
if
(
index
>
2
||
index
===
null
)
{
return
Toast
.
info
(
'路径有误'
);
return
Toast
.
info
(
'路径有误'
);
}
}
console
.
log
(
modifyId
,
modifyId
!==
null
)
;
document
.
title
=
MATERIAL_ARR
[
index
]
;
this
.
setState
({
this
.
setState
({
isEdit
:
modifyId
!==
null
,
isEdit
:
modifyId
!==
null
,
materialType
:
index
,
materialType
:
index
,
...
@@ -91,6 +92,8 @@ class AddMaterial extends Component {
...
@@ -91,6 +92,8 @@ class AddMaterial extends Component {
this
.
setState
({
this
.
setState
({
[
name
]:
value
[
name
]:
value
});
});
this
.
hansChangeForm
();
};
};
refreshFile
=
res
=>
{
refreshFile
=
res
=>
{
if
(
res
.
code
>=
0
)
{
if
(
res
.
code
>=
0
)
{
...
@@ -102,6 +105,7 @@ class AddMaterial extends Component {
...
@@ -102,6 +105,7 @@ class AddMaterial extends Component {
this
.
initImgs
(
this
.
state
.
imgUrls
);
this
.
initImgs
(
this
.
state
.
imgUrls
);
}
}
);
);
this
.
hansChangeForm
();
}
else
{
}
else
{
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
Toast
.
info
(
'上传图片失败,请重试'
,
2
);
}
}
...
@@ -111,6 +115,7 @@ class AddMaterial extends Component {
...
@@ -111,6 +115,7 @@ class AddMaterial extends Component {
this
.
setState
({
this
.
setState
({
certificateFiles
:
[]
certificateFiles
:
[]
});
});
this
.
hansChangeForm
();
};
};
validateForm
=
()
=>
{
validateForm
=
()
=>
{
if
(
!
this
.
state
.
backgroundArea
)
{
if
(
!
this
.
state
.
backgroundArea
)
{
...
@@ -118,6 +123,10 @@ class AddMaterial extends Component {
...
@@ -118,6 +123,10 @@ class AddMaterial extends Component {
}
}
return
true
;
return
true
;
};
};
hansChangeForm
=
()
=>
{
this
.
setState
({
hasChange
:
true
});
};
toggleRange
=
()
=>
{
toggleRange
=
()
=>
{
this
.
setState
({
this
.
setState
({
isShowRange
:
!
this
.
state
.
isShowRange
isShowRange
:
!
this
.
state
.
isShowRange
...
@@ -188,7 +197,7 @@ class AddMaterial extends Component {
...
@@ -188,7 +197,7 @@ class AddMaterial extends Component {
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
UpLoad
certificateFiles
=
{
certificateFiles
}
viewImages
=
{
viewImages
}
refresh
=
{
this
.
refreshFile
}
delFile
=
{
this
.
delFile
}
/
>
<
/div
>
<
/div
>
<
div
className
=
"bottom-operate"
>
<
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
>
<
/button
>
<
/div
>
<
/div
>
...
...
src/static/styles/global.less
View file @
de5d7abd
...
@@ -927,6 +927,12 @@ textarea::placeholder {
...
@@ -927,6 +927,12 @@ textarea::placeholder {
height: 45px;
height: 45px;
line-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,
.deposit-user .my-list .am-list-item .am-list-line .am-list-content,
.am-list-item .am-list-line .am-list-extra {
.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