提交 d1cece8a authored 作者: 吴强's avatar 吴强

Merge branch 'zhouhuan' of ssh://192.168.1.116:29418/bolan-root/frontend/manager-app-sz into wq

# Conflicts: # android/app/src/main/assets/fonts/anticon.ttf
......@@ -129,7 +129,7 @@
<orderEntry type="library" exported="" name="play-services-iid-10.0.1" level="project" />
<orderEntry type="library" exported="" name="soloader-0.1.0" level="project" />
<orderEntry type="library" exported="" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="react-native-0.49.3" level="project" />
<orderEntry type="library" exported="" name="react-native-0.49.5" level="project" />
<orderEntry type="library" exported="" name="play-services-basement-10.0.1" level="project" />
<orderEntry type="library" exported="" name="AraBMApiDev" level="project" />
<orderEntry type="library" exported="" name="okhttp-3.6.0" level="project" />
......
......@@ -78,6 +78,11 @@ project.ext.react = [
apply from: "../../node_modules/react-native/react.gradle"
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
......@@ -143,6 +148,7 @@ dependencies {
compile "com.android.support:appcompat-v7:25.3.1"
compile 'com.android.support:multidex:1.0.1'
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-vector-icons') // 2017-10-31 wq add
}
// Run this once to be able to run the application with BUCK
......
......@@ -15,6 +15,8 @@ import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
import com.oblador.vectoricons.VectorIconsPackage;// wq add 2017-10-31
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
......@@ -28,7 +30,8 @@ public class MainApplication extends Application implements ReactApplication {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNDeviceInfo(),
new IDCardReactPackage()
new IDCardReactPackage(),
new VectorIconsPackage()
);
}
......
......@@ -8,4 +8,5 @@
# For customization when using a Version Control System, please read the
# header note.
#Fri Oct 27 18:29:04 CST 2017
sdk.dir=D\:\\Android\\sdk
sdk.dir=D\:\\AppData\\Local\\Android\\sdk1
# sdk.dir=D\:\\Android\\sdk
......@@ -2,4 +2,7 @@ rootProject.name = 'bolanManagerApp'
include ':react-native-device-info'
project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android')
include ':app'
\ No newline at end of file
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':app'
差异被折叠。
/**
* Created by zhouhuan on 2017/10/30.
*/
import { Toast } from 'antd-mobile';
import { NavigationActions } from 'react-navigation';
import { getData } from '../../utils/DataTemplate';
import { datasourceApi } from '../../services/datasource';
export default {
namespace: 'obligeeInfo',
state: {
sourceData: [],
sourceData: {},
detailData: {},
isDetail: false,
editable: false,
disabled: true,
},
effects: {
*getObligeeInfo({ payload }, { put, call, select }) {
if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const { sourceData } = yield select(state => state.obligeeInfo);
const size = sourceData.length;
const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoTable',
};
const result = yield call(getData, coordinate, { pst: size, psz: 10, params: { pID: payload } });
const singularData = result[0];
yield put({ type: 'setDSRList', payload: { ...singularData } });
},
*getObligeeDetail({ payload }, { put, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoDetails',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
console.log(result);
yield put({ type: 'getDSRDetail', payload: { ...result[0] } });
yield put({ type: 'setDetail', payload: true });
yield put({ type: 'setEdit', payload: false });
},
*updateDSRDetail({ payload }, { call, put }) {
console.log('update');
const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoDetails',
};
const api = datasourceApi(coordinate);
yield call(api.update, payload.id, payload.singularData);
Toast.success('修改成功!', 1);
yield put(NavigationActions.navigate({
routeName: 'ObligeeInfo',
}));
yield put({ type: 'setDisabled', payload: true });
yield put({ type: 'setDetail', payload: false });
},
*onEBack({ payload }, { put, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoTable',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
const singularData = result[0];
yield put({ type: 'setDSRList', payload: { ...singularData } });
yield put(NavigationActions.navigate({
routeName: 'ObligeeInfo',
}));
yield put({ type: 'setDisabled', payload: true });
yield put({ type: 'setDetail', payload: false });
},
*setStatus({ payload }, { put }) {
yield put({ type: 'setDisabled', payload: false });
yield put({ type: 'setEdit', payload });
},
},
reducers: {
getDSRDetail(state, { payload }) {
return {
...state,
detailData: payload,
};
},
setDSRList(state, { payload }) {
return {
...state,
sourceData: payload,
};
},
setDetail(state, { payload }) {
return {
...state,
isDetail: payload,
};
},
setEdit(state, { payload }) {
return {
...state,
editable: payload,
};
},
setDisabled(state, { payload }) {
return {
...state,
disabled: payload,
};
},
},
};
......@@ -4,8 +4,16 @@ export default {
namespace: 'ListHouse',
state: {
sourceData: [],
metas: [],
houseID: '',
},
reducers: {
setHouseID(state, { payload }) {
return {
...state,
houseID: payload,
};
},
setList(state, { payload: { arrayData } }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] };
},
......@@ -13,8 +21,18 @@ export default {
clearList(state) {
return { ...state, sourceData: [] };
},
setMetas(state, { payload }) {
console.info(payload);
return { ...state, metas: payload };
},
},
effects: {
*jumpPage({ payload: id }, { put }) {
yield put({ type: 'setHouseID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'HouseDetail',
}));
},
*getHouseList({ payload }, { take, put, call, select }) {
if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} });
......@@ -28,6 +46,8 @@ export default {
datasourceName: 'QueryfwTable',
};
const result = yield call(getData, coordinate, { pst: size, psz: 10 });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
// const result = yield call('', 'query-DSRFWInfo', 'QueryfwTable', { pst: size, psz: 10 });
for (const row of result) {
yield put({ type: 'addHouse', payload: row });
......
......@@ -2,10 +2,12 @@ import welcome from './welcome';
import login from './login';
import listHouse from './houseinfo/listhouse';
import HouseDetail from './houseinfo/houseDetail';
import obligeeInfo from './houseinfo/ObligeeInfo';
export default [
welcome,
login,
listHouse,
HouseDetail,
obligeeInfo,
];
import React, { Component } from 'react';
import { View, Text, ScrollView, StyleSheet } from 'react-native';
import { Card, WingBlank, WhiteSpace, Button, Icon } from 'antd-mobile';
import { connect } from 'react-redux';
@connect(({ obligeeInfo, loading }) => ({ obligeeInfo, loading: !!loading.effects['obligeeInfo/getObligeeList'] }))
class DSRInfoScreeen extends Component {
render() {
return (
<Card>
<Card.Header
extra={
<View style={{ flexDirection: 'row' }}>
<Button type="primary">新增</Button>
</View>
}
/>
<Card.Body>
<ScrollView >
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:<Text style={Styles.cardBodyText2}></Text></Text>
<Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>350502199210236034</Text></Text>
<Text style={Styles.cardBodyText}>与户主关系:<Text style={Styles.cardBodyText2}>户主</Text></Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
</ScrollView >
</Card.Body>
</Card>
);
}
}
const Styles = StyleSheet.create({
cardText: {
color: '#2196F3',
textAlign: 'right',
},
cardBodyText: {
marginBottom: 10,
marginLeft: 13,
},
});
export default DSRInfoScreeen;
import React, { Component } from 'react';
import { Text, FlatList, View } from 'react-native';
import { Card, WingBlank, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../utils';
import FlatListItem from './houseinfo/FlatListItem';
@connect(({ DSRInfo }) => ({ DSRInfo/* , loading: !!loading.effects['obligeeInfo/getObligeeInfo'] */ }))
class DSRInfoScreeen extends Component {
componentDidMount() {
const { dispatch } = this.props;
dispatch(createAction('DSRInfo/getDSRList')());
}
// 上拉加载更多
onEndReached = () => {
// 以下是制造新数据
if (!this.props.loading) {
this.props.dispatch(createAction('DSRInfo/getDSRList')());
}
};
onPressItem = (id) => {
this.props.dispatch(createAction('DSRInfo/jumpPage')(id));
};
getItemLayout = (data, index) => (
{ length: 120, offset: (120 + 1) * index, index }
);
/**
* 此函数用于为给定的item生成一个不重复的Key。
* Key的作用是使React能够区分同类元素的不同个体,以便在刷新时能够确定其变化的位置,减少重新渲染的开销。
* 若不指定此函数,则默认抽取item.key作为key值。
* 若item.key也不存在,则使用数组下标
*
* @param item
* @param index
* @private
*/
// 这里指定使用数组下标作为唯一索引
keyExtractor = item => `${item.id}`;
// Footer布局
renderFooter = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Body>
<Text>到底了!!!</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
);
// 空布局
renderEmptyView = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Body>
<Text>当前无内容</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
);
// 下拉刷新
renderRefresh = () => {
if (!this.props.loading) {
console.info('wodewodewode');
this.props.dispatch(createAction('DSRInfo/getDSRList')('clear'));
}
};
/**
* 使用箭头函数防止不必要的re-render;
* 如果使用bind方式来绑定onPressItem,每次都会生成一个新的函数,导致props在===比较时返回false,
* 从而触发自身的一次不必要的重新render,也就是FlatListItem组件每次都会重新渲染。
*
* @param id
* @private
*/
renderItem = ({ item }) => {
return (
<FlatListItem
title={item.dangShiRenXingMing}
meta={this.props.DSRInfo.metas}
item={item}
onPressItem={this.onPressItem}
/>
);
};
render() {
return (
<FlatList
data={this.props.DSRInfo.sourceData}
keyExtractor={this.keyExtractor}
renderItem={this.renderItem}
// 决定当距离内容最底部还有多远时触发onEndReached回调;数值范围0~1,例如:0.5表示可见布局的最底端距离content最底端等于可见布局一半高度的时候调用该回调
onEndReachedThreshold={0.3}
// 当列表被滚动到距离内容最底部不足onEndReacchedThreshold设置的距离时调用
onEndReached={this.onEndReached}
ListFooterComponent={this.renderFooter}
ListEmptyComponent={this.renderEmptyView}
refreshing={this.props.loading || false}
onRefresh={this.renderRefresh}
// 是一个可选的优化,用于避免动态测量内容,+1是加上分割线的高度
/>
);
}
}
export default DSRInfoScreeen;
......@@ -19,13 +19,23 @@ class FlatListItem extends PureComponent {
<WhiteSpace size="lg" />
<Card>
<Card.Header
title={this.props.item.fangWuZuoLuo}
title={this.props.title}
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>编号:<Text style={Styles.cardBodyText2}>{this.props.item.fwBianMa}</Text></Text>
<Text style={Styles.cardBodyText}>面积:<Text style={Styles.cardBodyText2}>350502199210236034</Text></Text>
<Text style={Styles.cardBodyText}>产权人:<Text style={Styles.cardBodyText2}>户主</Text></Text>
{
this.props.meta.map((m) => {
if (this.props.item[m.key] !== this.props.title) {
return (
<Text key={m.label} style={Styles.cardBodyText}>{m.label}:<Text key={m.key} style={Styles.cardBodyText2}>{this.props.item[m.key]}</Text></Text>
);
} else {
return (
<View key={m.key} />
);
}
})
}
</Card.Body>
</Card>
<WhiteSpace size="lg" />
......
......@@ -5,18 +5,18 @@ import { createForm } from 'rc-form';
import { connect } from 'react-redux';
import { createAction } from '../../../utils/index';
@connect(({ HouseDetail }) => ({ HouseDetail }))
@connect(({ HouseDetail, ListHouse }) => ({ HouseDetail, ListHouse }))
class HouseDetail extends Component {
componentDidMount() {
const { dispatch, navigation } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(navigation.state.params.id));
const { dispatch, ListHouse } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(ListHouse.houseID));
}
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
// 校验成功执行这里的代码
console.info({ id: this.props.navigation.state.params.id, singularData: value });
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.navigation.state.params.id, singularData: value }));
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.ListHouse.houseID, singularData: value }));
console.log(this.props.form.getFieldsValue());
} else {
// 执行出现错误,弹出错处理
......
......@@ -2,93 +2,168 @@
* Created by zhouhuan on 2017/10/30.
*/
import React from 'react';
import { createForm } from 'rc-form';
import { View, StyleSheet, FlatList, Text, ScrollView } from 'react-native';
import { Card, WingBlank, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
@connect(({ obligeeInfo, loading }) => ({ obligeeInfo, loading: !!loading.effects['obligeeInfo/getObligeeList'] }))
@connect(({ obligeeInfo, ListHouse }) => ({ obligeeInfo, ListHouse }))
class ObligeeInfo extends React.Component {
componentDidMount() {
const { houseID } = this.props.ListHouse;
this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')(houseID));
}
onPress = () => {
const ID = this.props.obligeeInfo.sourceData.id;
this.props.dispatch(createAction('obligeeInfo/getObligeeDetail')(ID));
};
onEdit =() => {
this.props.dispatch(createAction('obligeeInfo/setStatus')(true));
};
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
this.props.dispatch(createAction('obligeeInfo/updateDSRDetail')({ id: this.props.obligeeInfo.sourceData.id, singularData: value }));
} else {
console.log('Validation failed');
}
});
}
onEditBack = () => {
const { houseID } = this.props.ListHouse;
this.props.dispatch(createAction('obligeeInfo/onEBack')(houseID));
}
render() {
return (
<ScrollView >
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:<Text style={Styles.cardBodyText2}></Text></Text>
<Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>350502199210236034</Text></Text>
<Text style={Styles.cardBodyText}>与户主关系:<Text style={Styles.cardBodyText2}>户主</Text></Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title="张三"
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>性别:</Text>
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text>
<Text style={Styles.cardBodyText}>与户主关系:户主</Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
</ScrollView >
);
const { sourceData, isDetail, detailData, editable, disabled } = this.props.obligeeInfo;
console.log(this.props.obligeeInfo);
const { getFieldProps } = this.props.form;
if (isDetail === false) {
return (
<ScrollView >
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Header
title={sourceData.dangShiRenXingMing}
extra={<Text style={Styles.cardText} onPress={this.onPress}>&gt;&gt;详情</Text>}
/>
<Card.Body>
<Text style={Styles.cardBodyText}>当事人编号:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenBianHao}</Text></Text>
<Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenIdentityCard}</Text></Text>
</Card.Body>
</Card>
<WhiteSpace size="lg" />
</WingBlank>
</ScrollView >
);
} else {
return (
<ScrollView>
<List>
<InputItem
{...getFieldProps('dangShiRenXingMing', {
initialValue: detailData.dangShiRenXingMing,
rules: [
{ required: true, message: '不允许为空' },
{ validator: this.validateFWBianMa },
],
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
姓名
</InputItem>
<InputItem
{...getFieldProps('dangShiRenXingBie', {
initialValue: detailData.dangShiRenXingBie,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
性别
</InputItem>
<InputItem
{...getFieldProps('dangShiRenTelephone', {
initialValue: detailData.dangShiRenTelephone,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
电话号码
</InputItem>
<InputItem
{...getFieldProps('dangShiRenIdentityCard', {
initialValue: detailData.dangShiRenIdentityCard,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
身份证号码
</InputItem>
<InputItem
{...getFieldProps('dangShiRenIdentityCardbak', {
initialValue: detailData.dangShiRenIdentityCardbak,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
身份证类型
</InputItem>
<InputItem
{...getFieldProps('dangShiRenAddress', {
initialValue: detailData.dangShiRenAddress,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
地址
</InputItem>
<InputItem
{...getFieldProps('DSRMaritalStatus', {
initialValue: detailData.DSRMaritalStatus,
})}
clear
placeholder="请输入"
editable={editable}
ref={(el) => { this.customFocusInst = el; }}
>
婚姻状态
</InputItem>
<InputItem
{...getFieldProps('DSRCensusType', {
initialValue: detailData.DSRCensusType,
})}
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>
</View>
</List.Item>
</List>
</ScrollView>
);
}
}
}
const Styles = StyleSheet.create({
......@@ -101,4 +176,4 @@ const Styles = StyleSheet.create({
marginLeft: 13,
},
});
export default ObligeeInfo;
export default createForm()(ObligeeInfo);
......@@ -20,7 +20,8 @@ class ListHouContent extends Component {
}
};
onPressItem = (id) => {
this.props.navigation.navigate('HouseDetail', { id });
// this.props.navigation.navigate('HouseDetail', { id });
this.props.dispatch(createAction('ListHouse/jumpPage')(id));
};
getItemLayout = (data, index) => (
{ length: 120, offset: (120 + 1) * index, index }
......@@ -83,6 +84,8 @@ class ListHouContent extends Component {
renderItem = ({ item }) => {
return (
<FlatListItem
title={item.fangWuZuoLuo}
meta={this.props.ListHouse.metas}
item={item}
onPressItem={this.onPressItem}
/>
......
......@@ -6,9 +6,57 @@ export const getData = async (coordinate, { pst, psz, params = {}, filters = [],
const options = { pst, psz, params, filters, sortBys, sortTypes };
const api = datasourceApi(coordinate);
const meta = await api.meta();
console.info(meta);
console.info(meta.p)
console.info(3);
console.info(makeColumns(meta));
const dsb = await api.query(options);
return getArrayData(dsb, meta);
};
export const getMeta = async (coordinate) => {
const api = datasourceApi(coordinate);
const meta = await api.meta();
return makeColumns(meta);
};
const parseMetas = (metas) => {
const ret = {};
if (!metas) {
return ret;
}
_.forEach(metas, (value, key) => {
let finalValue;
try {
finalValue = JSON.parse(value);
} catch (err) {
finalValue = value;
}
_.set(ret, key, finalValue);
});
return _.pickBy(ret, _.negate(_.isUndefined));
};
const makeColumns = (meta) => {
return (meta.properties || [])
.filter(property => !property.skip)
.map((property) => {
const props = parseMetas(property.metas);
if (!props.title && props.label) {
props.title = props.label;
}
if (props.order === undefined) {
props.order = 0;
}
if ((props.fixed === true || props.fixed === 'left' || props.fixed === 'right') && props.width === undefined) {
props.width = 150;
}
return _.pickBy({
...props,
key: property.name,
required: property.required,
}, _.negate(_.isUndefined));
})
.filter(c => c.visible !== false);
};
// const tmp = async(ddd) => {
// await
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论