Commit 96265dc3 authored by Sixiang_Zzb's avatar Sixiang_Zzb

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

parent a1294638
......@@ -14,6 +14,7 @@ import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch= (props:any) => {
// console.log("===================================",props)
const {dispatch, CommunityList } = props;
......@@ -159,6 +160,7 @@ const TitleSearch= (props:any) => {
);
};
function mapStateToProps(state:any) {
// console.log("state参数",state)
const { CommunityList } = state.Init;
return {
CommunityList,
......
......@@ -64,10 +64,11 @@ export default {
}
},
effects: {
*RA({ playload }, { call, put }) {
console.log("playload",playload)
switch (playload.index) {
case 12:
{
......@@ -86,7 +87,7 @@ export default {
}
const resp = yield call(service.RA, playload);
console.log(resp)
console.log("resp",resp)
if (resp.code == 500 || resp.error_code != "0000") {
// message.error("Server Error,try again,error code:500",3)
// window.location.href = '/500';
......
......@@ -20,6 +20,7 @@ export default {
//获取
*tosCommunityget({ playload }, { call, put }) {
const resp = yield call(service.tosCommunityget, playload);
let CommunityList = resp.data.communityList;
yield put({ type: 'returnCommunityList', CommunityList, });
......
......@@ -40,7 +40,6 @@ const Order = (props:any) => {
// }
// },[Data])
const CallBackTitleSearch = (value: any) => {
if (value.orderNumber != null || value.serviceType != null) {
RA(30, value, module, dispatch)
}
......@@ -72,7 +71,7 @@ const Order = (props:any) => {
);
};
function map(state:any) {
function map(state: any) {
const { Data} = state[module]
return { Data}
}
......
......@@ -17,6 +17,7 @@ const module = "User"
const module2 = "History"
const module3="PageData"
const Users = (props:any) => {
const { formatMessage } = useIntl();
const { dispatch, location,Data,CommunityList,pageData,history_url} = props;
......@@ -138,7 +139,6 @@ const Users = (props:any) => {
useEffect(() => {
//分页设置
if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
......@@ -147,16 +147,18 @@ const Users = (props:any) => {
}
//前置数据
console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["ownerName"])
setReadyData(tmp)
//获取数据
setLoading(true)
RA(12, {
ownerName:location.query.ownerName != undefined ? (location.query.ownerName) : null,
communityArray: CommunityList
}, module, dispatch);
// console.log("前置数据");
// console.log(location)
// var tmp = filterObjbyTg(location.query, ["ownerName"])
// console.log(tmp)
// setReadyData(tmp)
// //获取数据
// setLoading(true)
// RA(12, {
// ownerName:location.query.ownerName != undefined ? (location.query.ownerName) : null,
// communityArray:CommunityList
// }, module, dispatch);
},[location])
......@@ -177,11 +179,28 @@ const Users = (props:any) => {
history.push(location.pathname+'/Add')
}
// LIFE用户管理页面的搜索按钮
const CallBackTitleSearch = (comment: any)=>{
console.log(comment)
console.log("触发了按钮", comment)
//页面搜索
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) => {
......@@ -197,8 +216,6 @@ const Users = (props:any) => {
<div className={styles.base}>
{/* 头部组件 */}
<TitleSearch listkey={["OwnerName"]} list={["Owner Name"]}
community={"serviceCommunityList"} onSubmit={CallBackTitleSearch} />
......@@ -226,12 +243,15 @@ const Users = (props:any) => {
);
};
function mapStateToProps(state:any) {
const { sourceData, DataSave, Data, } = state.User;
const { history_url } = state.History;
const { pageData} = state.PageData;
const { token } = state.login;
const { CommunityList } = state.Init;
console.log("mapStateToProps 执行了")
return {
Data,
DataSave,
......@@ -242,5 +262,8 @@ function mapStateToProps(state:any) {
CommunityList,
};
}
export default connect(mapStateToProps)(Users);
......@@ -2,26 +2,26 @@ import request from '@/utils/request';
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'}})
}
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'}})
}
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'}})
}
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'}})
}
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'}})
}
......@@ -46,7 +46,6 @@ function requestAuto(url:string,values:any) {
return request(url, Body(values))
}
export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index)
var url = (requestList[playload.index])[0]
......
......@@ -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 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 }) };
......@@ -104,7 +109,7 @@ export const getObjectInfo = (test: any) => {
return array
}
//对象转URL
export const urlEncode = (obj:any) => {
export const urlEncode = (obj: any) => {
var url = "?"
var i = 0
for (var item in obj) {
......@@ -117,7 +122,7 @@ export const urlEncode = (obj:any) => {
return url
}
//对象抽空
export const filterObj = (obj:any) => {
export const filterObj = (obj: any) => {
var tmp = {}
for (var item in obj) {
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