Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
manager-app-sz
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
ReactNative
manager-app-sz
Commits
6b2a7f4c
提交
6b2a7f4c
authored
11月 13, 2017
作者:
吴强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加新增人口Detail界面2
上级
2d5ac12d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
246 行增加
和
152 行删除
+246
-152
listhouse.js
src/models/houseinfo/listhouse.js
+14
-0
peopleInfo.js
src/models/peopleInfo/peopleInfo.js
+9
-5
addPeopleInfo.js
src/routes/main/peopleInfo/addPeopleInfo.js
+1
-3
index.js
src/routes/main/peopleInfo/index.js
+4
-0
peopleDetailEditScreen.js
src/routes/main/peopleInfo/peopleDetailEditScreen.js
+106
-0
peopleDetailInfo.js
src/routes/main/peopleInfo/peopleDetailInfo.js
+112
-144
没有找到文件。
src/models/houseinfo/listhouse.js
浏览文件 @
6b2a7f4c
...
...
@@ -41,26 +41,40 @@ export default {
}));
},
*
getHouseList
({
payload
},
{
take
,
put
,
call
,
select
})
{
console
.
info
(
1
);
const
{
clear
,
pFWDiZhi
}
=
payload
;
console
.
info
(
2
);
if
(
clear
===
'clear'
)
{
console
.
info
(
3
);
yield
put
({
type
:
'clearList'
,
payload
:
{}
});
console
.
info
(
4
);
}
const
{
sourceData
}
=
yield
select
(
state
=>
state
.
ListHouse
);
console
.
info
(
5
);
const
size
=
sourceData
.
length
;
console
.
info
(
6
);
const
coordinate
=
{
containerType
:
'module'
,
containerName
:
'query-DSRFWInfo'
,
datasourceName
:
'QueryfwTable'
,
};
console
.
info
(
7
);
const
result
=
yield
call
(
getData
,
coordinate
,
{
pst
:
size
,
psz
:
10
,
params
:
{
pFWDiZhi
}
});
console
.
info
(
78
);
const
meta
=
yield
call
(
getMeta
,
coordinate
);
console
.
info
(
9
);
yield
put
({
type
:
'setMetas'
,
payload
:
meta
});
console
.
info
(
10
);
for
(
const
row
of
result
)
{
console
.
info
(
11
);
yield
put
({
type
:
'addHouse'
,
payload
:
row
});
console
.
info
(
12
);
yield
take
(
'addHouse/@@end'
);
console
.
info
(
13
);
}
},
*
addHouse
({
payload
},
{
put
})
{
console
.
info
(
11111
);
yield
put
({
type
:
'setList'
,
payload
:
{
arrayData
:
[
payload
]
}
});
},
},
...
...
src/models/peopleInfo/peopleInfo.js
浏览文件 @
6b2a7f4c
...
...
@@ -2,6 +2,7 @@
* Created by zhouhuan on 2017/10/30.
*/
import
{
Toast
}
from
'antd-mobile'
;
import
{
unionBy
}
from
'lodash'
;
import
{
NavigationActions
}
from
'react-navigation'
;
import
{
getData
,
getMeta
}
from
'../../utils/DataTemplate'
;
import
{
datasourceApi
}
from
'../../services/datasource'
;
...
...
@@ -83,10 +84,16 @@ export default {
}));
},
*
addPeopleInfo
(
ignore
,
{
put
})
{
yield
put
({
type
:
'getPeopleDetailInfo'
,
payload
:
{}
});
yield
put
(
NavigationActions
.
navigate
({
routeName
:
'addPeoppleInfo'
,
}));
},
*
GoToPeopleDetailEditScreen
(
ignore
,
{
put
})
{
yield
put
(
NavigationActions
.
navigate
({
routeName
:
'peopleInfoDetailEdit'
,
}));
},
*
updateDSRDetail
({
payload
},
{
call
,
put
})
{
console
.
log
(
'update'
);
const
coordinate
=
{
...
...
@@ -126,10 +133,6 @@ export default {
}));
yield
put
({
type
:
'setDisabled'
,
payload
:
true
});
},
*
setStatus
({
payload
},
{
put
})
{
yield
put
({
type
:
'setDisabled'
,
payload
:
false
});
yield
put
({
type
:
'setEdit'
,
payload
});
},
*
DuKa
(
ignored
,
{
call
,
put
})
{
try
{
Toast
.
loading
(
'读卡中...'
,
0
);
...
...
@@ -172,7 +175,8 @@ export default {
return
{
...
state
,
detailData
};
},
setPeopleList
(
state
,
{
payload
:
{
arrayData
}
})
{
return
{
...
state
,
sourceData
:
[...
state
.
sourceData
,
...
arrayData
]
};
const
newSourceData
=
unionBy
(
state
.
sourceData
,
arrayData
,
'id'
);
return
{
...
state
,
sourceData
:
newSourceData
};
},
setMetas
(
state
,
{
payload
})
{
return
{
...
state
,
metas
:
payload
};
...
...
src/routes/main/peopleInfo/addPeopleInfo.js
浏览文件 @
6b2a7f4c
...
...
@@ -4,7 +4,7 @@
import
React
from
'react'
;
import
{
createForm
}
from
'rc-form'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
Button
,
List
,
InputItem
,
WhiteSpace
}
from
'antd-mobile'
;
import
{
List
,
InputItem
,
WhiteSpace
}
from
'antd-mobile'
;
import
{
connect
}
from
'react-redux'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
import
{
createAction
}
from
'../../../utils'
;
...
...
@@ -68,7 +68,6 @@ class AddPeopleInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
"true"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
...
...
@@ -84,7 +83,6 @@ class AddPeopleInfo extends React.Component {
})}
clear
placeholder
=
"请输入"
editable
=
"true"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
...
...
src/routes/main/peopleInfo/index.js
浏览文件 @
6b2a7f4c
...
...
@@ -5,6 +5,7 @@ import { StackNavigator } from 'react-navigation';
import
PeopleInfo
from
'./peopelInfo'
;
import
PeopleDetailInfo
from
'./peopleDetailInfo'
;
import
AddPeopleInfo
from
'./addPeopleInfo'
;
import
peopleDetailEditScreen
from
"./peopleDetailEditScreen"
;
const
peopleInfoErJiScreen
=
StackNavigator
(
{
...
...
@@ -17,6 +18,9 @@ const peopleInfoErJiScreen = StackNavigator(
addPeoppleInfo
:
{
screen
:
AddPeopleInfo
,
},
peopleInfoDetailEdit
:
{
screen
:
peopleDetailEditScreen
,
},
},
{
headerMode
:
'none'
,
...
...
src/routes/main/peopleInfo/peopleDetailEditScreen.js
浏览文件 @
6b2a7f4c
/**
* Created by zhouhuan on 2017/11/2.
*/
import
React
from
'react'
;
import
{
createForm
}
from
'rc-form'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
List
,
InputItem
,
WhiteSpace
}
from
'antd-mobile'
;
import
{
connect
}
from
'react-redux'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
import
{
createAction
}
from
'../../../utils'
;
@
connect
(({
peopleInfo
})
=>
({
peopleInfo
}))
class
PeopleDetailEditScreen
extends
React
.
Component
{
componentDidMount
()
{
const
{
id
}
=
this
.
props
.
navigation
.
state
.
params
;
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/getPeopleDetail'
)(
id
));
}
onSubmit
=
()
=>
{
this
.
props
.
form
.
validateFields
({
force
:
true
},
(
error
,
value
)
=>
{
if
(
!
error
)
{
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/updateDSRDetail'
)({
id
:
this
.
props
.
peopleInfo
.
peopleID
,
singularData
:
value
}));
}
else
{
console
.
log
(
'Validation failed'
);
}
});
};
render
()
{
const
{
detailData
,
metas
}
=
this
.
props
.
peopleInfo
;
console
.
log
(
this
.
props
.
peopleInfo
);
const
{
getFieldProps
}
=
this
.
props
.
form
;
return
(
<
ScrollView
>
<
WhiteSpace
/>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
Icon
.
Button
name
=
"id-card"
backgroundColor
=
"#08BBF9"
onPress
=
{()
=>
{
this
.
props
.
dispatch
({
type
:
'peopleInfo/DuKa'
});
}}
>
读卡
<
/Icon.Button
>
<
/View
>
<
WhiteSpace
/>
<
List
>
{
metas
.
map
((
m
)
=>
{
if
(
m
.
required
===
true
)
{
return
(
<
InputItem
{...
getFieldProps
(
m
.
key
,
{
initialValue
:
detailData
[
m
.
key
],
rules
:
[
{
required
:
true
,
message
:
'不允许为空'
},
{
validator
:
this
.
validateNoNull
},
],
})}
clear
placeholder
=
"请输入"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
{
m
.
label
}
<
/InputItem
>
);
}
else
{
return
(
<
InputItem
{...
getFieldProps
(
m
.
key
,
{
initialValue
:
detailData
[
m
.
key
],
})}
clear
placeholder
=
"请输入"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
{
m
.
label
}
<
/InputItem
>
);
}
})}
{[
1
].
map
(()
=>
{
return
(
<
List
.
Item
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
<
Icon
.
Button
name
=
"save"
backgroundColor
=
"#08BBF9"
onPress
=
{
this
.
onSubmit
}
>
保存
<
/Icon.Button
>
<
/View
>
<
/List.Item
>
);
})
}
<
/List
>
<
/ScrollView
>
);
}
}
export
default
createForm
()(
PeopleDetailEditScreen
);
src/routes/main/peopleInfo/peopleDetailInfo.js
浏览文件 @
6b2a7f4c
...
...
@@ -2,10 +2,10 @@
* Created by zhouhuan on 2017/11/2.
*/
import
React
from
'react'
;
import
{
createForm
}
from
'rc-form'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
Button
,
List
,
InputItem
}
from
'antd-mobile'
;
import
{
List
,
InputItem
,
WhiteSpace
,
WingBlank
}
from
'antd-mobile'
;
import
{
connect
}
from
'react-redux'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
import
{
createAction
}
from
'../../../utils'
;
@
connect
(({
peopleInfo
})
=>
({
peopleInfo
}))
...
...
@@ -15,150 +15,118 @@ class PeopleDetailInfo extends React.Component {
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/getPeopleDetail'
)(
id
));
}
onEdit
=
()
=>
{
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/setStatus'
)(
true
));
};
onSubmit
=
()
=>
{
this
.
props
.
form
.
validateFields
({
force
:
true
},
(
error
,
value
)
=>
{
if
(
!
error
)
{
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/updateDSRDetail'
)({
id
:
this
.
props
.
peopleInfo
.
peopleID
,
singularData
:
value
}));
}
else
{
console
.
log
(
'Validation failed'
);
}
});
};
onEditBack
=
()
=>
{
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/onEBack'
)(
'clear'
));
this
.
props
.
dispatch
(
createAction
(
'peopleInfo/GoToPeopleDetailEditScreen'
)());
};
render
()
{
const
{
detailData
,
editable
,
disabled
}
=
this
.
props
.
peopleInfo
;
console
.
log
(
this
.
props
.
peopleInfo
);
const
{
getFieldProps
}
=
this
.
props
.
form
;
return
(
<
ScrollView
>
<
List
>
<
InputItem
{...
getFieldProps
(
'xingMing'
,
{
initialValue
:
detailData
.
xingMing
,
rules
:
[
{
required
:
true
,
message
:
'不允许为空'
},
],
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
姓名
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'identityCard'
,
{
initialValue
:
detailData
.
identityCard
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
证件号码
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'birthday'
,
{
initialValue
:
detailData
.
birthday
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
出生日期
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'guoJi'
,
{
initialValue
:
detailData
.
guoJi
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
国籍
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'minZu'
,
{
initialValue
:
detailData
.
minZu
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
民族
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'lianXiDianHua'
,
{
initialValue
:
detailData
.
lianXiDianHua
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
联系电话
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'lianXiDiZhi'
,
{
initialValue
:
detailData
.
lianXiDiZhi
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
联系地址
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'yuHuZhuGuanXi'
,
{
initialValue
:
detailData
.
yuHuZhuGuanXi
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
与户主关系
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'zhengZhiMianMao'
,
{
initialValue
:
detailData
.
zhengZhiMianMao
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
政治面貌
<
/InputItem
>
<
InputItem
{...
getFieldProps
(
'hunYinZhuangKuang'
,
{
initialValue
:
detailData
.
hunYinZhuangKuang
,
})}
clear
placeholder
=
""
editable
=
{
editable
}
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
婚姻状况
<
/InputItem
>
<
List
.
Item
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
Button
style
=
{{
marginRight
:
8
}}
type
=
"primary"
onClick
=
{
this
.
onEdit
}
>
编辑
<
/Button
>
<
Button
style
=
{{
marginRight
:
8
}}
onClick
=
{
this
.
onSubmit
}
disabled
=
{
disabled
}
>
保存
<
/Button
>
<
Button
onClick
=
{
this
.
onEditBack
}
>
返回
<
/Button
>
const
{
detailData
,
editable
,
metas
}
=
this
.
props
.
peopleInfo
;
if
(
editable
===
true
)
{
return
(
<
ScrollView
>
<
WhiteSpace
/>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
Icon
.
Button
name
=
"id-card"
backgroundColor
=
"#08BBF9"
onPress
=
{()
=>
{
this
.
props
.
dispatch
({
type
:
'peopleInfo/DuKa'
});
}}
>
读卡
<
/Icon.Button
>
<
/View
>
<
WhiteSpace
/>
<
List
>
{
metas
.
map
((
m
)
=>
{
if
(
m
.
required
===
true
)
{
return
(
<
InputItem
{...
getFieldProps
(
m
.
key
,
{
initialValue
:
detailData
[
m
.
key
],
rules
:
[
{
required
:
true
,
message
:
'不允许为空'
},
{
validator
:
this
.
validateNoNull
},
],
})}
clear
placeholder
=
"请输入"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
{
m
.
label
}
<
/InputItem
>
);
}
else
{
return
(
<
InputItem
{...
getFieldProps
(
m
.
key
,
{
initialValue
:
detailData
[
m
.
key
],
})}
clear
placeholder
=
"请输入"
ref
=
{(
el
)
=>
{
this
.
customFocusInst
=
el
;
}}
>
{
m
.
label
}
<
/InputItem
>
);
}
})}
{[
1
].
map
(()
=>
{
return
(
<
List
.
Item
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
<
Icon
.
Button
name
=
"save"
backgroundColor
=
"#08BBF9"
onPress
=
{
this
.
onSubmit
}
>
保存
<
/Icon.Button
>
<
/View
>
<
/List.Item
>
);
})
}
<
/List
>
<
/ScrollView
>
);
}
else
{
return
(
<
ScrollView
>
<
WhiteSpace
/>
<
WhiteSpace
/>
<
WingBlank
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
}}
>
<
Icon
.
Button
name
=
"edit"
backgroundColor
=
"#08BBF9"
onPress
=
{
this
.
onEdit
}
>
编辑
<
/Icon.Button
>
<
/View
>
<
/List.Item
>
<
/List
>
<
/ScrollView
>
);
<
WhiteSpace
/>
<
List
>
{
metas
.
map
((
m
)
=>
{
return
(
<
List
.
Item
key
=
{
m
.
key
}
extra
=
{
detailData
[
m
.
key
]}
>
{
m
.
label
}
<
/List.Item
>
);
})
}
<
/List
>
<
/WingBlank
>
<
/ScrollView
>
);
}
}
}
export
default
createForm
()(
PeopleDetailInfo
)
;
export
default
PeopleDetailInfo
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论