Commit 96265dc3 authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIFE用户管理 筛选小区BUG处理

parent a1294638
...@@ -14,6 +14,7 @@ import { gray } from 'chalk'; ...@@ -14,6 +14,7 @@ import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch= (props:any) => { const TitleSearch= (props:any) => {
// console.log("===================================",props)
const {dispatch, CommunityList } = props; const {dispatch, CommunityList } = props;
...@@ -73,7 +74,7 @@ const TitleSearch= (props:any) => { ...@@ -73,7 +74,7 @@ const TitleSearch= (props:any) => {
values[community]=communitys values[community]=communitys
} }
console.log('Success:', values); console.log('Success:', values);
props.onSubmit(values) props.onSubmit(values)
}; };
const onFinishFailed = (errorInfo:any) => { const onFinishFailed = (errorInfo:any) => {
...@@ -159,6 +160,7 @@ const TitleSearch= (props:any) => { ...@@ -159,6 +160,7 @@ const TitleSearch= (props:any) => {
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
// console.log("state参数",state)
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
CommunityList, CommunityList,
......
...@@ -64,10 +64,11 @@ export default { ...@@ -64,10 +64,11 @@ export default {
} }
}, },
effects: { effects: {
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
console.log("playload",playload)
switch (playload.index) { switch (playload.index) {
case 12: case 12:
{ {
...@@ -86,7 +87,7 @@ export default { ...@@ -86,7 +87,7 @@ export default {
} }
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log("resp",resp)
if (resp.code == 500 || resp.error_code != "0000") { if (resp.code == 500 || resp.error_code != "0000") {
// message.error("Server Error,try again,error code:500",3) // message.error("Server Error,try again,error code:500",3)
// window.location.href = '/500'; // window.location.href = '/500';
......
...@@ -20,6 +20,7 @@ export default { ...@@ -20,6 +20,7 @@ export default {
//获取 //获取
*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, });
......
...@@ -40,7 +40,6 @@ const Order = (props:any) => { ...@@ -40,7 +40,6 @@ const Order = (props:any) => {
// } // }
// },[Data]) // },[Data])
const CallBackTitleSearch = (value: any) => { const CallBackTitleSearch = (value: any) => {
if (value.orderNumber != null || value.serviceType != null) { if (value.orderNumber != null || value.serviceType != null) {
RA(30, value, module, dispatch) RA(30, value, module, dispatch)
} }
...@@ -72,7 +71,7 @@ const Order = (props:any) => { ...@@ -72,7 +71,7 @@ const Order = (props:any) => {
); );
}; };
function map(state:any) { function map(state: any) {
const { Data} = state[module] const { Data} = state[module]
return { Data} return { Data}
} }
......
...@@ -17,8 +17,9 @@ const module = "User" ...@@ -17,8 +17,9 @@ const module = "User"
const module2 = "History" const module2 = "History"
const module3="PageData" const module3="PageData"
const Users = (props:any) => { const Users = (props:any) => {
const { formatMessage } = useIntl();
const { formatMessage } = useIntl();
const { dispatch, location,Data,CommunityList,pageData,history_url} = props; const { dispatch, location,Data,CommunityList,pageData,history_url} = props;
const SA = (values: any) => { dispatch({ type: 'User/SA', playload: values}) }; const SA = (values: any) => { dispatch({ type: 'User/SA', playload: values}) };
...@@ -66,7 +67,7 @@ const Users = (props:any) => { ...@@ -66,7 +67,7 @@ const Users = (props:any) => {
), ),
}, },
]; ];
// 上传的模块 // 上传的模块
const propsUpload = { const propsUpload = {
...@@ -138,7 +139,6 @@ const Users = (props:any) => { ...@@ -138,7 +139,6 @@ const Users = (props:any) => {
useEffect(() => { useEffect(() => {
//分页设置 //分页设置
if (location.query.current!=null) { if (location.query.current!=null) {
setPageNum(parseInt(location.query.current)) setPageNum(parseInt(location.query.current))
...@@ -147,16 +147,18 @@ const Users = (props:any) => { ...@@ -147,16 +147,18 @@ const Users = (props:any) => {
} }
//前置数据 //前置数据
console.log("前置数据"); // console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["ownerName"]) // console.log(location)
setReadyData(tmp) // var tmp = filterObjbyTg(location.query, ["ownerName"])
// console.log(tmp)
//获取数据 // setReadyData(tmp)
setLoading(true)
RA(12, { // //获取数据
ownerName:location.query.ownerName != undefined ? (location.query.ownerName) : null, // setLoading(true)
communityArray: CommunityList // RA(12, {
}, module, dispatch); // ownerName:location.query.ownerName != undefined ? (location.query.ownerName) : null,
// communityArray:CommunityList
// }, module, dispatch);
},[location]) },[location])
...@@ -177,11 +179,28 @@ const Users = (props:any) => { ...@@ -177,11 +179,28 @@ const Users = (props:any) => {
history.push(location.pathname+'/Add') history.push(location.pathname+'/Add')
} }
// LIFE用户管理页面的搜索按钮
const CallBackTitleSearch = (comment: any)=>{ const CallBackTitleSearch = (comment: any)=>{
console.log(comment) console.log("触发了按钮", comment)
//页面搜索 //页面搜索
comment.current = 1 comment.current = 1
history.push(location.pathname+urlEncode(filterObj({ ownerName: comment.OwnerName})))
// 修改小区列表数据
console.log("所有小区数据",props.CommunityList)
console.log("选中的小区数据",comment)
setLoading(true)
RA(12, {
ownerName: comment.OwnerName != undefined ? (comment.OwnerName) : null,
communityArray:comment.serviceCommunityList
},module,dispatch)
// history.push(location.pathname + urlEncode(filterObj({ ownerName: comment.OwnerName})))
history.push(location.pathname)
} }
const pageChange = (values: any) => { const pageChange = (values: any) => {
...@@ -197,8 +216,6 @@ const Users = (props:any) => { ...@@ -197,8 +216,6 @@ const Users = (props:any) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<TitleSearch listkey={["OwnerName"]} list={["Owner Name"]} <TitleSearch listkey={["OwnerName"]} list={["Owner Name"]}
community={"serviceCommunityList"} onSubmit={CallBackTitleSearch} /> community={"serviceCommunityList"} onSubmit={CallBackTitleSearch} />
...@@ -226,12 +243,15 @@ const Users = (props:any) => { ...@@ -226,12 +243,15 @@ const Users = (props:any) => {
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { sourceData, DataSave, Data, } = state.User; const { sourceData, DataSave, Data, } = state.User;
const { history_url } = state.History; const { history_url } = state.History;
const { pageData} = state.PageData; const { pageData} = state.PageData;
const { token } = state.login; const { token } = state.login;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
console.log("mapStateToProps 执行了")
return { return {
Data, Data,
DataSave, DataSave,
...@@ -242,5 +262,8 @@ function mapStateToProps(state:any) { ...@@ -242,5 +262,8 @@ function mapStateToProps(state:any) {
CommunityList, CommunityList,
}; };
} }
export default connect(mapStateToProps)(Users); export default connect(mapStateToProps)(Users);
...@@ -2,26 +2,26 @@ import request from '@/utils/request'; ...@@ -2,26 +2,26 @@ import request from '@/utils/request';
export function create(values: any) { export function create(values: any) {
console.log(values) console.log("ServiceProviderServices:create",values)
return request('/api/ServiceProvider/create',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/api/ServiceProvider/create',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
export function service_1001(values: any) { export function service_1001(values: any) {
console.log(values) console.log("ServiceProviderServices:service_1001",values)
return request('/api/ServiceProvider/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/api/ServiceProvider/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
export function service_1002(values: any) { export function service_1002(values: any) {
console.log(values) console.log("ServiceProviderServices:service_1002",values)
return request('/api/ServiceProvider/getById',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/api/ServiceProvider/getById',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
export function get(values: any) { export function get(values: any) {
console.log(values) console.log("ServiceProviderServices:get",values)
return request('/tos/tosServiceProvider/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/tosServiceProvider/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
export function getSecurityGuarder(values: any) { export function getSecurityGuarder(values: any) {
console.log(values) console.log("ServiceProviderServices:getSecurityGuarder",values)
return request('/tos/securityGuarder/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/securityGuarder/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
...@@ -46,7 +46,6 @@ function requestAuto(url:string,values:any) { ...@@ -46,7 +46,6 @@ function requestAuto(url:string,values:any) {
return request(url, Body(values)) return request(url, Body(values))
} }
export function RA(playload: any) { export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index) // console.log(playload.index)
var url = (requestList[playload.index])[0] var url = (requestList[playload.index])[0]
......
...@@ -55,7 +55,12 @@ export const setCookie=(key:string,value: string)=>{ ...@@ -55,7 +55,12 @@ export const setCookie=(key:string,value: string)=>{
} }
export const RA = (index: any, values: any, module: string, dispatch: any) => { dispatch({ type: module + '/RA', playload: { index: index, body: values } }) }; export const RA = (index: any, values: any, module: string, dispatch: any) => {
dispatch({
type: module + '/RA',
playload: { index: index, body: values }
})
};
export const SA = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/SA', playload: values }) }; export const SA = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/SA', playload: values }) };
export const PAGE = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/PAGE', playload: values }) }; export const PAGE = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/PAGE', playload: values }) };
export const URL = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/URL', playload: values }) }; export const URL = (values: any, module: string, dispatch: any) => { dispatch({ type: module + '/URL', playload: values }) };
...@@ -104,7 +109,7 @@ export const getObjectInfo = (test: any) => { ...@@ -104,7 +109,7 @@ export const getObjectInfo = (test: any) => {
return array return array
} }
//对象转URL //对象转URL
export const urlEncode = (obj:any) => { export const urlEncode = (obj: any) => {
var url = "?" var url = "?"
var i = 0 var i = 0
for (var item in obj) { for (var item in obj) {
...@@ -117,7 +122,7 @@ export const urlEncode = (obj:any) => { ...@@ -117,7 +122,7 @@ export const urlEncode = (obj:any) => {
return url return url
} }
//对象抽空 //对象抽空
export const filterObj = (obj:any) => { export const filterObj = (obj: any) => {
var tmp = {} var tmp = {}
for (var item in obj) { for (var item in obj) {
if (obj[item] != null&&obj[item]!=undefined) { if (obj[item] != null&&obj[item]!=undefined) {
......
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