Commit e05e44e6 authored by Sixiang_Zzb's avatar Sixiang_Zzb

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi into final

parents 5d6b38fb 8ca7af94
import React from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Table, Tag, Space, Button, Radio, Row, Col, Input, Checkbox } from 'antd'; import { Table, Tag, Space, Button, Radio, Row, Col, Input, Checkbox } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import { gray } from 'chalk'; import { gray } from 'chalk';
import { StarOutlined, StarFilled, StarTwoTone , DownOutlined, UpOutlined } from '@ant-design/icons'; import { StarOutlined, StarFilled, StarTwoTone, DownOutlined, UpOutlined } from '@ant-design/icons';
import { indexOf } from 'lodash'; import { indexOf } from 'lodash';
import { useIntl, getLocale } from 'umi'; import { useIntl, getLocale } from 'umi';
...@@ -58,8 +58,9 @@ class SelectOptions extends React.Component { ...@@ -58,8 +58,9 @@ class SelectOptions extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const { list, dispatch, checklist } = this.props; const { list, dispatch, checklist } = this.props;
// console.log(list)
// console.log(checklist) console.log(list);
if (list == null) { if (list == null) {
//console.error("组件错误:没有数据导入") //console.error("组件错误:没有数据导入")
} }
...@@ -88,10 +89,9 @@ class SelectOptions extends React.Component { ...@@ -88,10 +89,9 @@ class SelectOptions extends React.Component {
flag: false, flag: false,
lastValue: null, lastValue: null,
}; };
} }
} }
componentDidUpdate() { componentDidUpdate(prevProps) {
if (this.props.show != null) { if (this.props.show != null) {
if (this.props.show == this.state.flag) { if (this.props.show == this.state.flag) {
console.log(this.props.show); console.log(this.props.show);
...@@ -102,6 +102,24 @@ class SelectOptions extends React.Component { ...@@ -102,6 +102,24 @@ class SelectOptions extends React.Component {
} }
console.log(this.state.componetVisible); console.log(this.state.componetVisible);
} }
// console.log(this.props.list);
// console.log(prevProps.list);
// if (this.props.list.length > prevProps.list.length) {
// console.log(this.props.list);
// console.log(prevProps.list);
// // 发生改变重新赋值
// this.setState({
// menuList: ArrayToPingYin.get(this.props.list),
// checkedListOptions: this.props.list,
// checkedList: this.props.list,
// indeterminate: false,
// checkAll: true,
// checkNone: false,
// resultList: this.props.list,
// flag: false,
// lastValue: null,
// });
// }
} }
} }
componentDidMount() { componentDidMount() {
...@@ -145,6 +163,7 @@ class SelectOptions extends React.Component { ...@@ -145,6 +163,7 @@ class SelectOptions extends React.Component {
}; };
// 多选框改变的回调 // 多选框改变的回调
onChangeValue = (checkedList) => { onChangeValue = (checkedList) => {
// console.log(checkedList);
if (this.props.single != null) { if (this.props.single != null) {
var tmp; var tmp;
if (checkedList.length > 1) { if (checkedList.length > 1) {
...@@ -187,6 +206,7 @@ class SelectOptions extends React.Component { ...@@ -187,6 +206,7 @@ class SelectOptions extends React.Component {
}; };
// 全选 // 全选
onCheckAllChange = (e) => { onCheckAllChange = (e) => {
// console.log(prevProps.list);
this.setState({ this.setState({
checkedList: this.props.list, checkedList: this.props.list,
indeterminate: false, indeterminate: false,
...@@ -209,6 +229,7 @@ class SelectOptions extends React.Component { ...@@ -209,6 +229,7 @@ class SelectOptions extends React.Component {
}; };
// 索引 -- 全部点击 // 索引 -- 全部点击
itemSelectAll = (e) => { itemSelectAll = (e) => {
console.log(this.props.list);
this.setState({ this.setState({
checkedListOptions: this.props.list, checkedListOptions: this.props.list,
checkedList: this.state.resultList, checkedList: this.state.resultList,
...@@ -300,14 +321,12 @@ class SelectOptions extends React.Component { ...@@ -300,14 +321,12 @@ class SelectOptions extends React.Component {
</div> </div>
<div style={{ width: '100%', backgroundColor: '#eeeeee', userSelect: 'none' }}> <div style={{ width: '100%', backgroundColor: '#eeeeee', userSelect: 'none' }}>
<div style={{ width: '100%', height: 30, position: 'relative' }}> <div style={{ width: '100%', height: 30, position: 'relative' }}>
{/* a-z 索引 */} {/* a-z 索引 */}
<div style={{ fontSize: 14, position: 'absolute' }}> <div style={{ fontSize: 14, position: 'absolute' }}>
<a style={{ marginLeft: 16 }} onClick={this.itemSelectAll.bind(this)}> <a style={{ marginLeft: 16 }} onClick={this.itemSelectAll.bind(this)}>
{this.state.selectoptionsAll} {this.state.selectoptionsAll}
</a> </a>
{menuListNormal.map((item, index) => { {menuListNormal.map((item, index) => {
if (this.state.menuList.indexOf(item) > -1) { if (this.state.menuList.indexOf(item) > -1) {
return ( return (
<a <a
......
...@@ -52,11 +52,9 @@ const TitleSearch = (props: any) => { ...@@ -52,11 +52,9 @@ const TitleSearch = (props: any) => {
form.setFieldsValue(defaultValue); form.setFieldsValue(defaultValue);
} }
}, [defaultValue]); }, [defaultValue]);
useEffect(() => {
// console.log(CommunityList)
useEffect(() => {
if (CommunityList != null) { if (CommunityList != null) {
// console.log("小区数量初始化完毕") OK
var tmp = {}; var tmp = {};
tmp[community] = CommunityList; tmp[community] = CommunityList;
// props.onSubmit(tmp) 禁用 改用组件初始化 // props.onSubmit(tmp) 禁用 改用组件初始化
......
...@@ -65,7 +65,9 @@ export default { ...@@ -65,7 +65,9 @@ export default {
case 24: case 24:
{ {
let Data = resp.data; let Data = resp.data;
let CommunityList = resp.data.communityList;
yield put({ type: 'returnPage', Data }); yield put({ type: 'returnPage', Data });
yield put({ type: 'Init/returnCommunityList', CommunityList });
} }
break; break;
case 29: // 小区新增编辑 case 29: // 小区新增编辑
......
import * as service from '../services/Init'; import * as service from '../services/Init';
import { message } from 'antd'; import { message } from 'antd';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router';
export default { export default {
namespace: 'Init', namespace: 'Init',
...@@ -13,19 +13,14 @@ export default { ...@@ -13,19 +13,14 @@ export default {
returnCommunityList(state, { CommunityList }) { returnCommunityList(state, { CommunityList }) {
return { ...state, CommunityList }; return { ...state, CommunityList };
}, },
}, },
effects: { effects: {
//获取 //获取
*tosCommunityget({ playload }, { call, put }) { *tosCommunityget({ playload }, { call, put }) {
const resp = yield call(service.tosCommunityget, playload); const resp = yield call(service.tosCommunityget, playload);
let CommunityList = resp.data.communityList; let CommunityList = resp.data.communityList;
yield put({ type: 'returnCommunityList', CommunityList, }); yield put({ type: 'returnCommunityList', CommunityList });
}, },
}, },
}; };
...@@ -219,7 +219,7 @@ const Adds = (props: any) => { ...@@ -219,7 +219,7 @@ const Adds = (props: any) => {
obj.propertyFee = PropertyFee; obj.propertyFee = PropertyFee;
// 小区信息; // 小区信息;
let { residentialZipCode, residentialAddress, residentialName } = values.des; let { residentialZipCode, residentialAddress, residentialName } = values.des;
obj.residentialZipCode = `SINGAPORE${residentialZipCode}`; obj.residentialZipCode = `SINGAPORE ${residentialZipCode}`;
obj.residentialAddress = residentialAddress; obj.residentialAddress = residentialAddress;
obj.residentialName = residentialName; obj.residentialName = residentialName;
......
...@@ -46,17 +46,15 @@ const CellLists = (props: any) => { ...@@ -46,17 +46,15 @@ const CellLists = (props: any) => {
const { dispatch, Data, loading, curString, village } = props; const { dispatch, Data, loading, curString, village } = props;
// 翻页数据 // 翻页数据
function pagesList( name:string , list: any , num: number){ function pagesList(name: string, list: any, num: number) {
let msg = { let msg = {
residentialManagerUserName: name ? name : '', residentialManagerUserName: name ? name : '',
communityNameList: list, communityNameList: list,
pageNum: num, pageNum: num,
} };
return msg return msg;
} }
console.log(village.page)
// 先请求一次 拿到所有小区列表 // 先请求一次 拿到所有小区列表
useEffect(() => { useEffect(() => {
RA(24, { communityName: '' }, module, dispatch); RA(24, { communityName: '' }, module, dispatch);
...@@ -65,7 +63,7 @@ const CellLists = (props: any) => { ...@@ -65,7 +63,7 @@ const CellLists = (props: any) => {
// 监听data请求完毕再请求一次 // 监听data请求完毕再请求一次
useEffect(() => { useEffect(() => {
if (Data != null) { if (Data != null) {
RA(48, pagesList('',Data.communityList , 1), module, dispatch); RA(48, pagesList('', Data.communityList, 1), module, dispatch);
} }
}, [Data]); }, [Data]);
...@@ -90,23 +88,22 @@ const CellLists = (props: any) => { ...@@ -90,23 +88,22 @@ const CellLists = (props: any) => {
// 点击搜索 // 点击搜索
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
console.log(comment) console.log(comment);
if (comment.communityName.length > 0 || typeof comment.label !== 'undefined') { if (comment.communityName.length > 0 || typeof comment.label !== 'undefined') {
RA(48, pagesList(comment.label,comment.communityName , 1), module, dispatch); RA(48, pagesList(comment.label, comment.communityName, 1), module, dispatch);
} } else {
else {
message.error('Please Enter And Select A Content To Search!'); message.error('Please Enter And Select A Content To Search!');
} }
}; };
// 点击页面属性传参数 // 点击页面属性传参数
const paginationHandler = (page: number, pageSize?: number) => { const paginationHandler = (page: number, pageSize?: number) => {
RA(48, pagesList('',Data.communityList , page), module, dispatch); RA(48, pagesList('', Data.communityList, page), module, dispatch);
}; };
// 刷新 // 刷新
const resetHandler = () => { const resetHandler = () => {
RA(48, pagesList('',Data.communityList , 1), module, dispatch); RA(48, pagesList('', Data.communityList, 1), module, dispatch);
}; };
return ( return (
...@@ -149,7 +146,6 @@ const CellLists = (props: any) => { ...@@ -149,7 +146,6 @@ const CellLists = (props: any) => {
/> />
{village.page ? ( {village.page ? (
<div className="pages"> <div className="pages">
<Pagination <Pagination
current={village.page.currentPage} current={village.page.currentPage}
total={village.page.totalRow} total={village.page.totalRow}
...@@ -157,8 +153,9 @@ const CellLists = (props: any) => { ...@@ -157,8 +153,9 @@ const CellLists = (props: any) => {
onChange={paginationHandler} onChange={paginationHandler}
/> />
</div> </div>
) : ''} ) : (
''
)}
</> </>
) : ( ) : (
'暂无数据' '暂无数据'
......
...@@ -183,9 +183,9 @@ const FacilityBookings = (props: any) => { ...@@ -183,9 +183,9 @@ const FacilityBookings = (props: any) => {
if (tab == 1) { if (tab == 1) {
RA(9, { RA(9, {
userToken: token, userToken: token,
pageNum: curString.curPage,
subscribeDate: curString.subscribeDate,
status: curString.status, status: curString.status,
subscribeDate: curString.subscribeDate,
pageNum: curString.curPage,
communityNameList: curString.communityNameList, communityNameList: curString.communityNameList,
}); });
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment