Commit f6dae9f3 authored by 1271610056@qq.com's avatar 1271610056@qq.com

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

parents 3699ba57 e8a38aa7
import React, { useEffect } from 'react';
import styles from './index.less';
import { Row, Col, Table, Space,Tabs, Button } from 'antd';
import { Row, Col, Table, Space, Tabs, Button } from 'antd';
const { TabPane } = Tabs
import { objectColumns} from '@/utils/string';
import { objectColumns } from '@/utils/string';
import { size } from 'lodash';
import Toast from '../Toast/Toast';
const TableShow = (props:any) => {
const TableShow = (props: any) => {
const { data } = props;
const dataRow = data.rows;
const goTo = (values:any,e:any) => {
const goTo = (values: any, e: any) => {
console.log(values)
props.onSubmit(values)
}
......@@ -24,17 +24,17 @@ const TableShow = (props:any) => {
useEffect(() => {
console.log("组件入参")
console.log(dataRow)
},[])
}, [])
//
// Contact Details
// Email
// cdk_code
// Account Type
// User Status
// Contact Details
// Email
// cdk_code
// Account Type
// User Status
// ower_email: "535740436@qq.com"
// ower_name: "测试"
// ower_phone: "微微"
// ower_email: "535740436@qq.com"
// ower_name: "测试"
// ower_phone: "微微"
// Owner/Family Member/Tenant
// const user_status = [[1, "家属"], [2, "租户"]]
......@@ -44,14 +44,14 @@ const TableShow = (props:any) => {
// const user_type_status = ["Registered", "Unregistered", "Cancellation"]
const user_type_status = ["Normal", "Normal", "Cancellation"]
const user_code=["Not Used","Used"]
const user_code = ["Not Used", "Used"]
const key = objectColumns([
["User Name", "ower_name"],
["Contact Details", "ower_phone"],
["Email", "ower_email"],
["RelationShip", null, (text: any, record: any) => (<Space size="middle">{record.owner_relationship != null ? user_status[(record.owner_relationship) - 1][1] : null}</Space>)],
["status", null, (text: any, record: any) => (<Space size="middle">{user_type_status[record.enable]}</Space>)],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this,record)}>Detail</a></Space>)],
["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goTo.bind(this, record)}>Detail</a></Space>)],
])
......@@ -60,11 +60,11 @@ const TableShow = (props:any) => {
<Tabs defaultActiveKey="0" >
{
dataRow.map((item, index) => {
return(
return (
<TabPane tab={item.name} key={index}>
<Row gutter={16}><Col>Address:</Col><Col>{((item).owner).addressAndpostalCode}</Col></Row>
<Row gutter={16}><Col>Address:</Col><Col>{((item).owner).addressAndpostalCode + " " + ((item).owner).buildingNumber + "#" + ((item).owner).floorNumber + "-" + ((item).owner).roomNumber}</Col></Row>
{
(item.unit).map((unit:any, uindex:any) => {
(item.unit).map((unit: any, uindex: any) => {
return (
<div key={unit.living}>
<Row gutter={32}>
......@@ -72,11 +72,11 @@ const TableShow = (props:any) => {
<Table title={() => {
return (
<div style={{ height: 80, position: "relative" }}>
<div style={{ position: "absolute", left: 0,bottom:16 }}>
<div style={{ position: "absolute", left: 0, bottom: 16 }}>
<Row gutter={32}><Col>Unit No:</Col><Col>{unit.living}</Col></Row>
</div>
<div style={{ position: "absolute", right: 0,bottom:16 }}>
{props.deleteDisable ?<Button type="danger" onClick={deleteUnit.bind(this, unit.living)}>Delete</Button> : null}
<div style={{ position: "absolute", right: 0, bottom: 16 }}>
{props.deleteDisable ? null : <Button type="primary" danger onClick={deleteUnit.bind(this, unit.living)}>Delete</Button>}
</div>
</div>
)
......@@ -95,7 +95,8 @@ const TableShow = (props:any) => {
})
}
</TabPane>
)})
)
})
}
</Tabs>
......
......@@ -81,7 +81,8 @@ class TagSelect extends React.Component {
const { value, inputVisible, inputValue, editInputIndex, editInputValue } = this.state;
return (
<>
{value.map((tag, index) => {
{
value.map((tag, index) => {
if (editInputIndex === index) {
return (
<Input
......@@ -127,7 +128,9 @@ class TagSelect extends React.Component {
) : (
tagElem
);
})}
})
}
{inputVisible && (
<Input
ref={this.saveInputRef}
......
......@@ -4,19 +4,21 @@ import styles from './index.less';
import BackButton from '../BackButton/BackButton';
import TitleGet from '../TitleGet/TitleGet';
const TitleBack = (props:any) => {
// <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
const TitleBack = (props: any) => {
// <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
const backData = (values:any) => {
console.log(props, "创建时间====================")
const backData = (values: any) => {
props.titleBack(values)
}
return (
<>
<div className={styles.item0}><TitleGet title={props.title} /></div>
{
props.sublist!=null
props.sublist != null && props.title == "Edit Owner Infomation"
?
(props.sublist).map((item:any,index:any)=>{
(props.sublist).map((item: any, index: any) => {
return (
<div key={index} className={styles.item1}>{item}</div>
)
......@@ -24,7 +26,7 @@ const TitleBack = (props:any) => {
:
<></>
}
<div className={styles.item2}><BackButton backFunction={backData} url={props.url}/></div>
<div className={styles.item2}><BackButton backFunction={backData} url={props.url} /></div>
<div className={styles.clear0}></div>
</>
);
......
import React, { useState,useEffect,useRef} from 'react';
import React, { useState, useEffect, useRef } from 'react';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import styles from './index.less';
......@@ -6,23 +6,24 @@ import styles from './index.less';
import BackButton from '../BackButton/BackButton';
import TitleGet from '../TitleGet/TitleGet';
import { Input, Row, Col, Form, Select, Button,DatePicker } from 'antd';
import { Input, Row, Col, Form, Select, Button, DatePicker } from 'antd';
const { Option } = Select;
import SelectOptions from '../../components/SelectOptions/index';
import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch= (props:any) => {
const TitleSearch = (props: any) => {
// console.log("===================================",props)
const {dispatch, CommunityList } = props;
const { dispatch, CommunityList } = props;
const key = props.listkey
const name = props.list;
const single = props.single
const checklist = props.checklist;
const status = props.status;
const communitySelect=props.communitySelect
const communitySelect = props.communitySelect
const defaultValue = props.defaultValue
const time = props.time;
......@@ -34,7 +35,7 @@ const TitleSearch= (props:any) => {
const formRef = useRef(null)
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
useEffect(() => {
// console.log("标题搜寻组件初始化") OK
if (CommunityList == null) {
......@@ -46,13 +47,15 @@ const TitleSearch= (props:any) => {
}
}, []);
useEffect(()=>{
useEffect(() => {
if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue)
}
},[defaultValue])
useEffect(()=>{
}, [defaultValue])
useEffect(() => {
console.log(CommunityList)
if (CommunityList != null) {
// console.log("小区数量初始化完毕") OK
......@@ -61,30 +64,30 @@ const TitleSearch= (props:any) => {
// props.onSubmit(tmp) 禁用 改用组件初始化
setCommunitys(CommunityList)
}
},[CommunityList])
}, [CommunityList])
const onFinish = (values:any) => {
const onFinish = (values: any) => {
if (datePicker) {
values[time[0]] = datePicker;
}
if (community) {
values[community]=communitys
values[community] = communitys
}
console.log('Success:', values);
props.onSubmit(values)
};
const onFinishFailed = (errorInfo:any) => {
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
const onChange = (date:any,dateString:string) => {
const onChange = (date: any, dateString: string) => {
setDate(dateString)
}
const printContent = (comment: any)=>{
const printContent = (comment: any) => {
setCommunitys(comment)
}
......@@ -99,20 +102,21 @@ const TitleSearch= (props:any) => {
: null
}
{
key!=null?
key != null ?
key.map((item, index) => {
return (
<Col key={"KeyCol_"+ index}><Form.Item name={item}><Input placeholder={name[index]} allowClear /></Form.Item></Col>
<Col key={"KeyCol_" + index}><Form.Item name={item}><Input placeholder={name[index]} allowClear /></Form.Item></Col>
)
})
:null
: null
}
{
status != null ?
status.map((item, index) => {
return (
<Col key={"StatusCol_" + index}><Form.Item name={item.name[0]}>
<Select style={{width:160}} placeholder={item.name[1]} allowClear={true}>
<Col key={"StatusCol_" + index}>
<Form.Item name={item.name[0]}>
<Select style={{ width: 160 }} placeholder={item.name[1]} allowClear={true}>
{
item.data.map(word => {
return (
......@@ -120,10 +124,12 @@ const TitleSearch= (props:any) => {
)
})
}
</Select></Form.Item></Col>
</Select>
</Form.Item>
</Col>
)
})
:null
: null
}
{
time != null ?
......@@ -141,11 +147,11 @@ const TitleSearch= (props:any) => {
<>
{
CommunityList != null ?
<SelectOptions checklist={checklist} single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} />:
<SelectOptions checklist={checklist} single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} /> :
null
}
<Form.Item><Button type="primary" htmlType="submit" style={{ backgroundColor: "#e7f4ff",color:"rgba(24,144,255,1)"}}>Search</Button></Form.Item>
<Form.Item><Button type="primary" htmlType="submit" style={{ backgroundColor: "#e7f4ff", color: "rgba(24,144,255,1)" }}>Search</Button></Form.Item>
</> : null
}
......@@ -158,7 +164,8 @@ const TitleSearch= (props:any) => {
</>
);
};
function mapStateToProps(state:any) {
function mapStateToProps(state: any) {
// console.log("state参数",state)
const { CommunityList } = state.Init;
return {
CommunityList,
......
export default {
'R.charge.input.project': 'Project',
'R.charge.input.nameofowner':'Name of Owner',
'R.charge.input.nameofowner': 'Name of Owner',
'R.charge.username': 'User Name',
'R.charge.project': 'Project',
'R.charge.unit': 'Unit',
'R.charge.status': 'Status',
'R.charge.submissionTime': 'Submission Time',
'R.charge.usertype': 'user Type',
'R.charge.actions': 'Actions',
'R.charge.search': 'Search',
'R.charge.addaccount': 'Add Account',
'R.charge.paymentsetting': 'Payment Setting',
'R.selectoptions.open': 'Open',
'R.selectoptions.PutItAway':'Put It Away',
'R.selectoptions.Selected':'Selected',
'R.selectoptions.PutItAway': 'Put It Away',
'R.selectoptions.Selected': 'Selected',
'R.selectoptions.SelectNone': 'Select None',
'R.selectoptions.all':'All',
'R.selectoptions.all': 'All',
'R.selectoptions.SearchCell': 'Search cell',
};
export default {
'R.charge.input.project': '所在小区',
'R.charge.input.nameofowner':'业主名称',
'R.charge.input.nameofowner': '业主名称',
'R.charge.username': '业主名称',
'R.charge.project': '所在小区',
'R.charge.unit': '所在单元',
'R.charge.status': '状态',
'R.charge.submissionTime': '提交时间',
'R.charge.usertype': '用户类型',
'R.charge.actions': '操作',
'R.charge.search': '搜索',
'R.charge.addaccount': '添加会计',
'R.charge.paymentsetting': '缴费设置',
'R.selectoptions.open': '展开',
'R.selectoptions.PutItAway':'收起',
'R.selectoptions.Selected':'已选',
'R.selectoptions.PutItAway': '收起',
'R.selectoptions.Selected': '已选',
'R.selectoptions.SelectNone': '全不选',
'R.selectoptions.all':'所有',
'R.selectoptions.SearchCell':'搜索小区',
'R.selectoptions.all': '所有',
'R.selectoptions.SearchCell': '搜索小区',
};
......@@ -2,13 +2,13 @@ import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { routerRedux } from 'dva/router';
export default {
namespace: 'User',
state: {
Data: null,
DataPage:{totalRow:0},
DataPage: { totalRow: 0 },
Data3Error: null,
DataSave: null,
DataSaveDetail: null,
......@@ -22,21 +22,21 @@ export default {
returnValue: null,
memberResult: null,
DataServices:null,
DataServices: null,
},
reducers: {
returnPage(state, { Data,DataPage,DataSave}) {
return { ...state, Data,DataPage,DataSave };
returnPage(state, { Data, DataPage, DataSave }) {
return { ...state, Data, DataPage, DataSave };
},
returnData3Error(state, { Data3Error }) {
return { ...state, Data3Error };
},
returnDataSave(state, { DataSave }) {
return { ...state, DataSave};
return { ...state, DataSave };
},
DataSaveDetail(state, { DataSaveDetail,returnValue}) {
return { ...state, DataSaveDetail,returnValue};
DataSaveDetail(state, { DataSaveDetail, returnValue }) {
return { ...state, DataSaveDetail, returnValue };
},
returnSource(state, { sourceData }) {
return { ...state, sourceData };
......@@ -45,157 +45,174 @@ export default {
return { ...state, curString };
},
returnResult(state, { Result }) {
return {...state,Result}
return { ...state, Result };
},
returnCommunityInfo(state, { communityInfo }) {
return {...state,communityInfo}
return { ...state, communityInfo };
},
PageDate(state, { pageDate }) {
return {...state,pageDate}
return { ...state, pageDate };
},
ReturnValue(state, { returnValue }) {
return{...state,returnValue}
return { ...state, returnValue };
},
returnMemberResult(state, { memberResult }) {
return{...state,memberResult}
return { ...state, memberResult };
},
returnDataServices(state, { DataServices }) {
return{...state,DataServices}
}
return { ...state, DataServices };
},
},
effects: {
*RA({ playload }, { call, put }) {
switch (playload.index) {
case 12:
{
let Data = null;
yield put({ type: 'returnPage', Data });
} break;
case 13: {
}
break;
case 13:
{
let DataSaveDetail = null;
let returnValue = null;
yield put({ type: 'DataSaveDetail', DataSaveDetail,returnValue });
} break;
case 43: {
yield put({ type: 'DataSaveDetail', DataSaveDetail, returnValue });
}
break;
case 43:
{
let DataServices = null;
yield put({ type: 'returnDataServices', DataServices });
} break;
}
break;
}
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500 || resp.error_code != "0000") {
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';
}
if (resp.error_code != "0000") {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload)
var Data3Error = null
var Result=null
if (resp.error_code != '0000') {
console.log('请求错误码:' + '(' + playload.index + ')' + resp.error_code);
console.log(playload);
var Data3Error = null;
var Result = null;
switch (playload.index) {
case 11: {
Data3Error = { msg: "Information Wrong!" };
case 11:
{
Data3Error = { msg: 'Information Wrong!' };
yield put({ type: 'returnData3Error', Data3Error });
} break;
case 13: {
}
break;
case 13:
{
//
history.push("/UserManagement/LIFEUserManagement")
} break;
history.push('/UserManagement/LIFEUserManagement');
}
break;
// 删除失败的案例
// case 16:{
// Result = resp;
// yield put({ type: 'returnResult', Result });
// } break;
}
}
else {
} else {
switch (playload.index) {
case 12:{
case 12:
{
let Data = resp;
yield put({ type: 'returnPage', Data});
} break;
yield put({ type: 'returnPage', Data });
}
break;
case 18:
case 14:{
message.success("Success Operation!",3)
case 14:
{
message.success('Success Operation!', 3);
// window.location.href = '/CommunityManagement/FacilityBookings';
history.push("/UserManagement/LIFEUserManagement")
} break;
case 13: {
history.push('/UserManagement/LIFEUserManagement');
}
break;
case 13:
{
let DataSaveDetail = resp.data;
yield put({ type: 'DataSaveDetail', DataSaveDetail });
} break;
case 16: {
console.log("等待删除完成")
}
break;
case 16:
{
console.log('等待删除完成');
var returnValue = resp;
yield put({ type: 'ReturnValue', returnValue });
} break;
case 32: {
}
break;
case 32:
{
let communityInfo = resp;
yield put({ type: 'returnCommunityInfo', communityInfo });
} break;
case 39: {
}
break;
case 39:
{
let memberResult = resp;
yield put({ type: 'returnMemberResult', memberResult });
} break;
}
break;
case 43: {
case 43:
{
let DataServices = resp;
yield put({ type: 'returnDataServices', DataServices });
} break;
}
break;
}
}
},
*IA({ playload }, { call, put }) {
var Data3 = null
var Data3 = null;
yield put({ type: 'returnPage3', Data3 });
},
*IA2({ playload }, { call, put }) {
var Data3Error = null
var Data3Error = null;
yield put({ type: 'returnData3Error', Data3Error });
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
var DataSave = playload;
yield put({ type: 'returnDataSave', DataSave });
},
*CA({ playload }, { call, put }) {
var sourceData = playload
yield put({type: 'returnSource',sourceData})
var sourceData = playload;
yield put({ type: 'returnSource', sourceData });
},
*QA({ playload }, { call, put }) {
var curString = playload
yield put({type: 'returnCurString', curString} )
var curString = playload;
yield put({ type: 'returnCurString', curString });
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
*ResultClear({}, { put }) {
var tmp = null;
yield put({ type: 'returnResult', tmp });
},
*PAGE({ playload }, { put }) {
var pageDate = playload
yield put({type: 'PageDate',pageDate})
var pageDate = playload;
yield put({ type: 'PageDate', pageDate });
},
*DataClear({ }, { put }) {
var pageDate = null
yield put({type: 'returnPage',pageDate})
*DataClear({}, { put }) {
var pageDate = null;
yield put({ type: 'returnPage', pageDate });
},
*MemberResultClear({ }, { put }) {
*MemberResultClear({}, { put }) {
let memberResult = null;
yield put({ type: 'returnMemberResult', memberResult });
},
},
};
import * as service from '../services/tos';
import { message } from 'antd';
import { routerRedux } from 'dva/router'
import { routerRedux } from 'dva/router';
export default {
namespace: 'ServiceProvider',
state: {
Data: null,
CurDataFollow: null,
SaveChooseData:null,
SaveChooseData: null,
},
reducers: {
......@@ -26,61 +26,57 @@ export default {
returnSaveChooseData(state, { SaveChooseData }) {
return { ...state, SaveChooseData };
},
},
effects: {
// 获取服务商
*TosTosServiceProviderGet({ playload }, { call, put }) {
const resp = yield call(service.TosTosServiceProviderGet, playload);
console.log(resp)
console.log(resp);
if (resp.code == 500) {
// window.location.href = '/500';
}
if (resp.error_code == "0000") {
if (resp.error_code == '0000') {
let Data = resp.data.rows;
yield put({ type: 'returnPage', Data, });
yield put({ type: 'returnPage', Data });
} else {
console.log("请求错误码:"+resp.error_code)
console.log('请求错误码:' + resp.error_code);
let Data = null;
console.log(playload)
yield put({ type: 'returnPage', Data, });
console.log(playload);
yield put({ type: 'returnPage', Data });
}
},
// 新建服务商
*TosTosServiceProviderSave({ playload }, { call, put }) {
console.log(playload)
console.log(playload);
const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp)
console.log(resp);
if (resp.code == 500) {
window.location.href = '/500';
} else {
message.success("operator success!", 2);
message.success('operator success!', 2);
window.location.href = '/UserManagement/ServiceProviderManagement';
}
},
//获取服务商保安根据服务商名
*TosSecurityGuarderGet({ playload }, { call, put }) {
console.log(playload)
console.log(playload);
const resp = yield call(service.TosSecurityGuarderGet, playload);
console.log(resp)
console.log(resp);
let CurDataFollow = resp.data.rows;
yield put({ type: 'returnCurDataFollow', CurDataFollow, });
yield put({ type: 'returnCurDataFollow', CurDataFollow });
},
//获取服务商保安详情根据服务商名
*GuarderById({ playload }, { call, put }) {
let CurDataFollowDetail = playload;
yield put({ type: 'returnCurDataFollowDetail', CurDataFollowDetail, });
yield put({ type: 'returnCurDataFollowDetail', CurDataFollowDetail });
},
*SaveChooseData({ playload }, { call, put }) {
let SaveChooseData = playload;
yield put({ type: 'returnSaveChooseData', SaveChooseData, });
yield put({ type: 'returnSaveChooseData', SaveChooseData });
},
},
};
......@@ -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, });
......
......@@ -28,7 +28,7 @@ export default{
});
if(callback) callback(response);
},
*saveOwner({callback,payload},{ call, put }) {
*saveOwner({ callback, payload }, { call, put }) {
const response = yield call(saveOwner,payload);
yield put({
type: "save",
......
......@@ -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}
}
......
......@@ -9,110 +9,110 @@
}
//头部组件
.box{
.box {
width: 100%;
height: 64px;
position: relative;
}
.item1{
.item1 {
position: absolute;
width: 400px;
text-indent: 15px;
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
border-left: 5px solid rgba(24, 144, 255, 1);
font-family: 'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item3{
width:80px;
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
background: none;
cursor: pointer;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
}
.box1{
.box1 {
width: 100%;
height: 34px;
line-height: 34px;
position: relative;
margin-bottom: 28px;
}
.box1item1{
.box1item1 {
position: absolute;
}
.box1item2{
.box1item2 {
position: absolute;
left: 146px;
}
.box4{
.box4 {
width: 100%;
height: 34px;
line-height: 34px;
position: relative;
margin-bottom: 28px;
}
.box4item0{
.box4item0 {
position: absolute;
}
.box4item1{
.box4item1 {
position: absolute;
left: 146px;
}
.box4item2{
.box4item2 {
position: absolute;
left: 346px;
}
.box2{
.box2 {
width: 100%;
height: 34px;
line-height: 34px;
position: relative;
margin-bottom: 28px;
}
.box2item1{
.box2item1 {
position: absolute;
}
.box2item2{
.box2item2 {
position: absolute;
left: 146px;
}
.box2item3{
.box2item3 {
position: absolute;
left: 362px;
}
.box2item4{
.box2item4 {
position: absolute;
left: 461px;
}
.box2item5{
.box2item5 {
position: absolute;
left: 475px;
}
.box2item6{
.box2item6 {
position: absolute;
left: 561px;
}
.box2item7{
.box2item7 {
position: absolute;
left: 583px;
}
.box3{
.box3 {
width: 100%;
height: 34px;
position: relative;
}
.box3item1{
.box3item1 {
padding-left: 146px;
}
import React, { useState, useEffect,useRef } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import styles from './UsersAdd.less';
import { Input ,Menu,Table,Space,Pagination,Spin, Button,Form,Row,Col, message} from 'antd';
import { Input, Menu, Table, Space, Pagination, Spin, Button, Form, Row, Col, message } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
......@@ -10,17 +10,19 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
import { checkParam, RA } from '../../../utils/method'
import { validateMessages } from '@/utils/params';
import "./UsersAddInput.less"
const module="User"
const UsersAdd = (props:any) => {
const { dispatch,communityInfo} = props;
const module = "User"
const UsersAdd = (props: any) => {
const [postman,setPostman]=useState({extend:null})
const { dispatch, communityInfo } = props;
const [postman, setPostman] = useState({ extend: null })
const formRef = useRef(null);
const [loading,setLoading]=useState(false)
const onFinish=(values:any) => {
const [loading, setLoading] = useState(false)
const onFinish = (values: any) => {
if (postman.extend != null) {
values.communityName = postman.extend
......@@ -31,32 +33,32 @@ const UsersAdd = (props:any) => {
console.log("添加业主提交的参数:" + tmp.length)
console.log(values)
if (checkParam(values)) {
values.owerPhone =null
values.owerEmail=null
values.owerPhone = null
values.owerEmail = null
RA(14, values, module, dispatch)
setLoading(true)
} else {
setLoading(false)
message.error("Error,Please finish it,not empty!",3)
message.error("Error,Please finish it,not empty!", 3)
}
}
const extendName = (values: any) => {
var tmp = postman
tmp.extend = values
RA(32, {communityName: values }, module, dispatch);
RA(32, { communityName: values }, module, dispatch);
setPostman(tmp)
}
useEffect(()=>{
useEffect(() => {
if (communityInfo != null) {
console.log(communityInfo)
if (postman.extend != null) {
formRef.current.setFieldsValue({ addressAndpostalCode: communityInfo.data.rows[0].residentialAddress+" "+communityInfo.data.rows[0].residentialZipCode })
formRef.current.setFieldsValue({ addressAndpostalCode: communityInfo.data.rows[0].residentialAddress + " SINGAPORE" + communityInfo.data.rows[0].residentialZipCode })
}
}
},[communityInfo])
}, [communityInfo])
const checkData = (rule:any, value:any, callback:any) => {
const checkData = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
......@@ -75,7 +77,7 @@ const UsersAdd = (props:any) => {
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" rules={[{required:true,min:2,max:30}]} ><Input placeholder="Ower Name" /></Form.Item></div>
<div className={styles.box1item2}><Form.Item name="owerName" rules={[{ required: true, min: 2, max: 30 }]} ><Input placeholder="Ower Name" /></Form.Item></div>
</div>
{/* <div className={styles.box4}>
......@@ -85,17 +87,18 @@ const UsersAdd = (props:any) => {
</div> */}
<div className={styles.box2}>
<div className={styles.box2item1}>Contact Details</div>
<div className={styles.box2item2}><SearchOptionsCommnity alone={true} onSubmit={extendName} /></div>
<div className={styles.box2item3}><Form.Item name="buildingNumber" rules={[{validator: checkData, trigger: 'blur'}]}><Input placeholder="Building" style={{width:94}}/></Form.Item></div>
<div className={styles.box2item3}><Form.Item name="buildingNumber" rules={[{ validator: checkData }]}><Input placeholder="Building" style={{ width: 94 }} /></Form.Item></div>
<div className={styles.box2item4}>#</div>
<div className={styles.box2item5}><Form.Item name="floorNumber" ><Input placeholder="Floor" style={{width:80}} /></Form.Item></div>
<div className={styles.box2item5}><Form.Item name="floorNumber" rules={[{ validator: checkData }]}><Input placeholder="Floor" style={{ width: 80 }} /></Form.Item></div>
<div className={styles.box2item6}>——</div>
<div className={styles.box2item7}><Form.Item name="roomNumber"><Input placeholder="Room" style={{width:112}}/></Form.Item></div>
<div className={styles.box2item7}><Form.Item name="roomNumber" rules={[{ validator: checkData }]}><Input placeholder="Room" style={{ width: 112 }} /></Form.Item></div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>
<Form.Item name="addressAndpostalCode"><Input style={{width:680}} placeholder="Display the address and postcode automatically according to the"/></Form.Item>
<Form.Item name="addressAndpostalCode"><Input style={{ width: 680 }} disabled placeholder="Display the address and postcode automatically according to the" /></Form.Item>
</div>
</div>
<Line />
......@@ -107,8 +110,8 @@ const UsersAdd = (props:any) => {
);
};
function mapStateToProps(state:any) {
const { DataSave,communityInfo } = state.User;
function mapStateToProps(state: any) {
const { DataSave, communityInfo } = state.User;
return {
DataSave,
......
.box2item3___3VsZz .ant-form-item-explain {
margin-left: -80px;
}
.box2item5___2AZ2K .ant-form-item-explain {
width: 1000px;
position: absolute;
top: -25px;
left: -55px;
}
.box2item7___ePaor .ant-form-item-explain {
margin-left: -30px;
}
.box2item3___3VsZz {
.ant-form-item-explain {
margin-left: -80px;
}
}
.box2item5___2AZ2K {
// position: relative;
.ant-form-item-explain {
width: 1000px;
position: absolute;
top: -25px;
left: -55px;
}
}
.box2item7___ePaor {
.ant-form-item-explain {
margin-left: -30px;
}
}
import React, { useState, useEffect,useRef } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less';
import { Input ,Button,Form,Result,Pagination,Tooltip, Checkbox } from 'antd';
import { Input, Button, Form, Result, Pagination, Tooltip, Checkbox } from 'antd';
import { Link, useIntl, connect } from 'umi';
......@@ -8,32 +8,36 @@ import SelectOptions from '../../../components/SelectOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack';
import { RA } from '@/utils/method';
const module="User"
const Edit= (props:any) => {
const module = "User"
const Edit = (props: any) => {
const { dispatch,CurData,SaveChooseData,location,CommunityList,DataServices} = props;
const { dispatch, CurData, SaveChooseData, location, CommunityList, DataServices } = props;
const TosTosServiceProviderSave = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values }) };
const [CList, setCList] = useState(CommunityList);
const [SList,setSList]=useState(["1"])
const printContent = (List: any)=>{setCList(List)}
const [SList, setSList] = useState(["1"])
const printContent = (List: any) => { setCList(List) }
const formRef = useRef(null);
useEffect(() => {
console.log(SaveChooseData)
RA(43,{serviceName:""},module,dispatch)
RA(43, { serviceName: "" }, module, dispatch)
}, []);
useEffect(()=>{
useEffect(() => {
if (DataServices != null) {
var tmp=DataServices.data.serviceScopeList
var tmp = DataServices.data.serviceScopeList
if (SaveChooseData != null) {
formRef.current.setFieldsValue(SaveChooseData)
}
}
},[DataServices])
}, [DataServices])
const onFinish = (values: any) => {
console.log(values)
return;
var val = values
val.serviceCommunityList = CList
// val.serviceScopeList = SList
......@@ -42,7 +46,9 @@ const Edit= (props:any) => {
TosTosServiceProviderSave(val)
};
const onFinishFailed = (errorInfo:any) => {console.log('Failed:', errorInfo) };
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo)
};
return (
<div className={styles.base}>
......@@ -53,29 +59,79 @@ const Edit= (props:any) => {
<Form ref={formRef} name="basic" initialValues={{}} onFinish={onFinish} onFinishFailed={onFinishFailed}>
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}><Form.Item name="providerName" ><Input style={{width:260}} placeholder="Please enter company name" /></Form.Item></div>
<div className={styles.box1item2}>
<Form.Item name="providerName"
rules={[{
required: true,
message: "Please enter the company name!"
}]}
>
<Input style={{ width: 260 }} placeholder="Please enter company name" />
</Form.Item>
</div>
<div className={styles.box1item3}>Office Address</div>
<div className={styles.box1item4}><Form.Item name="providerAddress"><Input style={{width:200}} placeholder="Single Line Input"/></Form.Item></div>
<div className={styles.box1item4}>
<Form.Item
name="providerAddress"
rules={[{
required: true,
message: "Please enter your office address!"
}]}
>
<Input style={{ width: 200 }} placeholder="Single Line Input" />
</Form.Item>
</div>
</div>
<div className={styles.line}></div>
<SelectOptions list={CommunityList.sort()} checklist={SaveChooseData!=null?SaveChooseData.serviceCommunityList:null} onSubmit={printContent} />
<SelectOptions list={CommunityList.sort()} checklist={SaveChooseData != null ? SaveChooseData.serviceCommunityList : null} onSubmit={printContent} />
<div className={styles.box2}>
<div className={styles.box2item1}>Services Available</div>
<div className={styles.box2item2}><Form.Item name="serviceScopeList"><Checkbox.Group options={ DataServices!=null?DataServices.data.serviceScopeList:null} /></Form.Item></div>
<div className={styles.box2item2}>
<Form.Item
name="serviceScopeList"
rules={[{
required: true,
message: "Please select at least one service available!"
}]}
>
<Checkbox.Group options={DataServices != null ? DataServices.data.serviceScopeList : null} />
</Form.Item>
</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Person In Charge</div>
<div className={styles.box3item2}><Form.Item name="contactName"><Input style={{width:200}} placeholder="Please enter a name"/></Form.Item></div>
<div className={styles.box3item2}>
<Form.Item
name="contactName"
rules={[{
required: true,
message: "Please enter the name of the person in charge!"
}]}
>
<Input style={{ width: 200 }}
placeholder="Please enter a name"
/>
</Form.Item>
</div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}><Form.Item name="contactPhone"><Input style={{width:200}} placeholder="Telephone"/></Form.Item></div>
<div className={styles.box4item3}><Form.Item name="contactEmail"><Input style={{width:200}} placeholder="E-mail"/></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="contactPhone"><Input style={{ width: 200 }} placeholder="Telephone" /></Form.Item></div>
<div className={styles.box4item3}>
<Form.Item
name="contactEmail"
rules={[{
required: true,
type: "email",
message: "Please enter the correct email address!"
}]}
>
<Input style={{ width: 200 }} placeholder="E-mail" /></Form.Item></div>
</div>
......@@ -89,7 +145,7 @@ const Edit= (props:any) => {
);
};
function mapStateToProps(state:any) {
function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices, } = state.User;
const { CommunityList } = state.Init;
......@@ -106,4 +162,3 @@ function mapStateToProps(state:any) {
export default connect(mapStateToProps)(Edit);
\ No newline at end of file
import React, { useState, useEffect,useRef} from 'react';
import React, { useState, useEffect, useRef } from 'react';
import styles from './index.less';
import {Form, Input ,Spin,Table,Space, Button} from 'antd';
import { Form, Input, Spin, Table, Space, Button } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import { urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const ServiceProviderManagement = (props: any) => {
const { formatMessage } = useIntl();
const [pageNum, setPageNum] = useState(1)
const [loading, setLoading] = useState(false)
const [testData, setTestData] = useState(null);
const { dispatch, location, Data, CommunityList } = props;
const RA = (index:any,values: any) => { dispatch({ type: 'ServiceProvider/RA', playload: {index:index, body:values } }) };
const TosTosServiceProviderGet = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderGet', playload: values }) };
const RA = (index: any, values: any) => { dispatch({ type: 'ServiceProvider/RA', playload: { index: index, body: values } }) };
const TosTosServiceProviderGet = (values: any) => {
dispatch({
type: 'ServiceProvider/TosTosServiceProviderGet',
playload: values
})
};
const SaveChooseData = (values: any) => { dispatch({ type: 'ServiceProvider/SaveChooseData', playload: values }) };
const GetList = () => {
if (CommunityList != null) {
TosTosServiceProviderGet({
providerName: "",
serviceCommunityList: CommunityList
})
}
}
useEffect(() => {
GetList()
}, []);
useEffect(() => {
GetList()
}, [CommunityList]);
// const GetList = () => {
// if (CommunityList != null) {
// TosTosServiceProviderGet({
// providerName: "",
// serviceCommunityList: CommunityList
// })
// }
// }
// useEffect(() => {
// console.log(CommunityList)
// GetList()
// }, [CommunityList]);
const goToDetail = (values: any, e: any) => {
SaveChooseData(values)
history.push(location.pathname +'/Detail')
history.push(location.pathname + '/Detail')
}
const goToCreate = () => {
SaveChooseData(null)
......@@ -44,76 +55,112 @@ const ServiceProviderManagement = (props: any) => {
SaveChooseData(values)
history.push(location.pathname + '/Edit')
}
const goToServices = () => {history.push(location.pathname +'/Services')}
const pagination={defaultCurrent:1,total: Data!=null?Data.length:0}
const goToServices = () => { history.push(location.pathname + '/Services') }
const columns = [
{ title: "Service Provider",dataIndex: 'providerName',},
{ title: "contact Name",dataIndex: 'contactName',},
{ title: "Service Provider", dataIndex: 'providerName', },
{ title: "contact Name", dataIndex: 'contactName', },
{ title: "Contacts",dataIndex: 'contactPhone',},
{
title: "Contacts",
dataIndex: 'contactPhone',
},
/*{ title: "Contact Details",dataIndex: 'contactEmail',},*/
{ title: "Services Available",dataIndex: 'serviceScope',},
{ title: "Account Status",dataIndex: 'enable',},
{ title: "Actions",
{
title: "Services Available",
dataIndex: 'serviceScope',
},
{ title: "Account Status", dataIndex: 'enable', },
{
title: "Actions",
render: (text: any, record: any) => (
<Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space>
<Space size="middle"><a onClick={goToDetail.bind(this, record)}>Detail</a><a onClick={goToEdit.bind(this, record)}>edit</a></Space>
),
},
];
const dataSource = (values:any) => {
const dataSource = (values: any) => {
let tmp = values;
for (let items in tmp) {
switch (tmp[items].enable) {
case 0: tmp[items].enable = "unregistered";break;
case 1: tmp[items].enable = "registered";break;
case 2:break;
case 0: tmp[items].enable = "unregistered"; break;
case 1: tmp[items].enable = "registered"; break;
case 2: break;
}
}
for (let items in tmp) {
switch (tmp[items].serviceScope) {
case 0: tmp[items].serviceScope = "清洁";break;
case 1: tmp[items].serviceScope = "维修";break;
case 2:tmp[items].serviceScope = "保安";break;
case 3:tmp[items].serviceScope = "会计";break;
case 0: tmp[items].serviceScope = "清洁"; break;
case 1: tmp[items].serviceScope = "维修"; break;
case 2: tmp[items].serviceScope = "保安"; break;
case 3: tmp[items].serviceScope = "会计"; break;
}
}
// for (let items in tmp) {
// for(let i=0; i<tmp[items].serviceScopeList.length;i++){
// if(tmp[items].serviceScopeList[i] == '0'){
// tmp[items].serviceScopeList[i] = '清洁'
// continue
// }else if(tmp[items].serviceScopeList[i] == '1'){
// tmp[items].serviceScopeList[i] = '维修'
// continue
// }else if(tmp[items].serviceScopeList[i] == '2'){
// tmp[items].serviceScopeList[i] = '保安'
// continue
// }else if(tmp[items].serviceScopeList[i] == '3'){
// tmp[items].serviceScopeList[i] = '会计'
// continue
// }
// }
// }
return tmp;
}
const CallBackTitleSearch = (comment: any)=>{
useEffect(() => {
if (Data != null) {
setLoading(false)
console.log("核查的地方")
console.log(Data)
}
}, [Data])
useEffect(() => {
//分页设置
if (location.query.pageNum != null) {
setPageNum(parseInt(location.query.pageNum))
TosTosServiceProviderGet({
...location.query,
serviceCommunityList: testData != null ? testData : CommunityList,
})
} else {
setPageNum(1)
//获取数据
setLoading(true)
TosTosServiceProviderGet({
...location.query,
serviceCommunityList: testData != null ? testData : CommunityList,
})
}
}, [location])
const CallBackTitleSearch = (comment: any) => {
console.log(comment)
console.log(location.pathname)
//页面搜索
TosTosServiceProviderGet({
// TosTosServiceProviderGet({
// providerName: comment.providerName,
// serviceScope: comment.status,
// serviceCommunityList: comment.serviceCommunityList
// })
setTestData(comment.serviceCommunityList)
history.push(location.pathname + urlEncode(filterObj({
providerName: comment.providerName,
serviceScope:comment.status,
serviceCommunityList: comment.serviceCommunityList
})
// history.push(location.pathname+urlEncode(filterObj({ providerName: comment.providerName})))
serviceScope: comment.status,
pageNum: 1
})))
}
const pageChange = (values: any) => {
// setPageNum(values.current)
console.log(values)
/*页面跳转*/
var tmp = filterObjbyTg(location.query, [])
tmp["pageNum"] = values.current
history.push(location.pathname + urlEncode(tmp))
}
const pagination = {
current: pageNum,
// total: Data.total,
showSizeChanger: false
}
return (
<div className={styles.base}>
......@@ -136,11 +183,15 @@ const ServiceProviderManagement = (props: any) => {
</div>
{/* 列表组件 */}
<Spin spinning={Data!=null?false:true}>
<Spin spinning={Data != null ? false : true}>
<Table size="small" rowKey={"id"}
style={{ marginTop: 16 }} columns={columns}
dataSource={Data!=null?dataSource(Data):null}
pagination={pagination} />
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={Data != null ? dataSource(Data) : null}
pagination={Data != null ? pagination : {}}
onChange={pageChange}
/>
</Spin>
</div>
......@@ -148,7 +199,7 @@ const ServiceProviderManagement = (props: any) => {
);
};
function mapStateToProps(state:any) {
function mapStateToProps(state: any) {
const { Data } = state.ServiceProvider;
const { DataProvider } = state.User;
const { CommunityList } = state.Init;
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './Services.less';
import { Form ,Button,Modal,Space,Pagination,Tooltip, Checkbox } from 'antd';
import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import {PlusCircleOutlined} from '@ant-design/icons';
import { PlusCircleOutlined } from '@ant-design/icons';
import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton';
......@@ -14,32 +14,33 @@ import TagSelect from '../../../components/TagSelect/index';
import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
const module="User"
const Services = (props:any) => {
const module = "User"
const Services = (props: any) => {
const { dispatch,DataServices} = props
const { dispatch, DataServices } = props
const formRef = useRef(null)
useEffect(()=>{
RA(43,{serviceName:""},module,dispatch)
useEffect(() => {
RA(43, { serviceName: "" }, module, dispatch)
}, [location])
useEffect(()=>{
useEffect(() => {
if (DataServices != null) {
var tmp=DataServices.data.serviceScopeList
var tmp = DataServices.data.serviceScopeList
console.log(tmp)
formRef.current.setFieldsValue({services:tmp })
console.log(formRef)
formRef.current.setFieldsValue({ services: tmp })
}
}, [DataServices])
const onFinish = (values:any) => {
const onFinish = (values: any) => {
console.log(values)
RA(44, {
id:"5",
serviceName:"律政"
},module,dispatch)
id: "5",
serviceName: "律政"
}, module, dispatch)
}
const Add = (values:any) => {
const Add = (values: any) => {
console.log(values)
}
const Remove = (values: any) => {
......@@ -51,9 +52,9 @@ const Services = (props:any) => {
<TitleBack title={"Services Available Management"}></TitleBack>
<Form ref={formRef} name="basic" onFinish={onFinish}>
{DataServices != null?
<Form.Item label="Available Services" name="services"><TagSelect onAdd={Add} onRemove={Remove}/></Form.Item>
:null
{DataServices != null ?
<Form.Item label="Available Services" name="services"><TagSelect onAdd={Add} onRemove={Remove} /></Form.Item>
: null
}
<Line />
{/* <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> */}
......@@ -64,8 +65,8 @@ const Services = (props:any) => {
);
};
function mapStateToProps(state:any) {
const{DataServices} = state.User
function mapStateToProps(state: any) {
const { DataServices } = state.User
return {
DataServices
}
......
......@@ -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'}})
}
......@@ -4,60 +4,101 @@ import request from '@/utils/request';
// 后台账号管理
export function TosUserGetAllInfrom(values: any) {
return request('/tos/user/getAllInfrom',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/user/getAllInfrom', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosUsersQuitAndUser(values: any) {
return request('/tos/users/quitAndUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/users/quitAndUser', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosUserLogin(values: any) {
return request('/tos/user/login/',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/user/login/', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosUserNewCurrentUser(values: any) {
return request('/tos/user/newCurrentUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/user/newCurrentUser', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosCheckAccountUsername(values: any) {
return request('/tos/checkAccount/username',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/checkAccount/username', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosAccountPermissionCheckPermission(values: any) {
return request('/tos/account/permission/checkPermission',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/account/permission/checkPermission', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
// 服务商
export function TosTosServiceProviderGet(values: any) {
return request('/tos/tosServiceProvider/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
console.log(values);
// return
return request('/tos/tosServiceProvider/get', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export function TosSecurityGuarderGet(values: any) {
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' },
});
}
export function TosTosServiceProviderSave(values: any) {
return request('/tos/tosServiceProvider/save',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
return request('/tos/tosServiceProvider/save', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
// /tos/community/facilities/fuzzy/query
//配置文件
// const yellowcolor ="\033[40;33m"
// // const bulecolor='\033[40;34m';
// const colorend = "\033[0m"
const headers = { 'Content-Type': 'application/json'}
function Body(values:any) { return {method: 'POST',body: JSON.stringify(values),headers:headers}}
function requestAuto(url:string,values:any) {
return request(url, Body(values))
const headers = { 'Content-Type': 'application/json' };
function Body(values: any) {
return {
method: 'POST',
body: JSON.stringify(values),
headers: headers,
};
}
export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index)
var url = (requestList[playload.index])[0]
console.log(playload.index + "》【发送请求】" + url + " " + (requestList[playload.index])[1])
console.log("参数如下:")
console.log(playload.body)
function requestAuto(url: string, values: any) {
return request(url, Body(values));
}
export function RA(playload: any) {
console.log('playload参数===========================================', playload);
var url = requestList[playload.index][0].toString();
console.log(playload.index + '》【发送请求】' + url + ' ' + requestList[playload.index][1]);
console.log('参数如下:');
console.log(playload.body);
// console.log(JSON.stringify(playload.body))
return requestAuto(url,playload.body)
return requestAuto(url, playload.body);
}
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
......@@ -5,12 +5,14 @@ export async function query(): Promise<any> {
}
export async function queryCurrent(values: any): Promise<any> {
console.log(values)
return request('/tos/user/newCurrentUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}});
console.log('登录数据=================', values);
return request('/tos/user/newCurrentUser', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
export async function queryNotices(): Promise<any> {
return request('/api/notices');
}
import {message } from 'antd';
import { message } from 'antd';
import moment from 'moment';
export const checkParam = (values: any) => {
var flag = true
var flag = true;
for (var i in values) {
// console.log(values[i]);
if (values[i] == null) {
flag=false
flag = false;
} else {
if(values[i].length == 0){ flag=false}
if (values[i].length == 0) {
flag = false;
}
}
return flag
}
}
return flag;
};
// onBlur={checkInput} maxLength={33}
export const checkInput = (e: any) => {
// console.log(e)
if (e.target.value.length == 1) {
message.error("User Name Should be limit 2~30!", 3)
e.target.value=null
message.error('User Name Should be limit 2~30!', 3);
e.target.value = null;
}
}
};
export const picFromate = (values: any) => {
var result=new Array()
var result = new Array();
if (values != null) {
values.map((item:any, index:any) => {
result.push({ url: item })
})
values.map((item: any, index: any) => {
result.push({ url: item });
});
}
return result
}
return result;
};
export const getCookie=(key:string)=>{
const name = key + "=";
export const getCookie = (key: string) => {
const name = key + '=';
const ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
const c = ca[i].trim();
......@@ -47,127 +45,141 @@ export const getCookie=(key:string)=>{
return c.substring(name.length, c.length);
}
}
return "";
}
return '';
};
export const setCookie=(key:string,value: string)=>{
document.cookie=key + "=" + value + "; ";
}
export const setCookie = (key: string, value: string) => {
document.cookie = key + '=' + value + '; ';
};
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 });
};
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 }) };
export const URLCLEAR = (module: string, dispatch: any) => { dispatch({ type: module + '/URLCLEAR'}) };
export const DataClear = (module: string, dispatch: any) => { dispatch({ type: module + '/DataClear'}) };
export const ResultClear = (module:any,dispatch:any) => { dispatch({ type: module + '/ResultClear' }) };
export const URLCLEAR = (module: string, dispatch: any) => {
dispatch({ type: module + '/URLCLEAR' });
};
export const DataClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataClear' });
};
export const ResultClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/ResultClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values:any,reg:any) => {
var result=new Array()
export const Fromate = (values: any, reg: any) => {
var result = new Array();
if (values != null) {
values.map((item:any, index:any) => {
var obj={}
for (var i = 0; i < reg.length; i++){
values.map((item: any, index: any) => {
var obj = {};
for (var i = 0; i < reg.length; i++) {
if (reg[i][1] == null) {
obj[reg[i][0]]=item
obj[reg[i][0]] = item;
} else {
obj[reg[i][0]] = item[reg[i][1]]
obj[reg[i][0]] = item[reg[i][1]];
}
}
result.push(obj)
})
result.push(obj);
});
}
return result
}
return result;
};
// 按键取值
// const reg2 = "name"
// const values2 = [{name:"kat",url:"longtime"},{name:"jack",url:"longtime2"}]
export const Fromate2 = (values:any, reg:string) => {
var result = new Array()
values.map((item:any, index:number) => {
export const Fromate2 = (values: any, reg: string) => {
var result = new Array();
values.map((item: any, index: number) => {
result.push(item[reg]);
})
return result
}
});
return result;
};
// 获取对象信息
export const getObjectInfo = (test: any) => {
console.log(JSON.stringify(test,null, '\t'))
var array = new Array()
console.log(JSON.stringify(test, null, '\t'));
var array = new Array();
for (let item in test) {
array.push([item, typeof test[item]])
array.push([item, typeof test[item]]);
}
return array
}
return array;
};
//对象转URL
export const urlEncode = (obj:any) => {
var url = "?"
var i = 0
export const urlEncode = (obj: any) => {
var url = '?';
var i = 0;
for (var item in obj) {
if (i > 0) {
url += "&"
url += '&';
}
url += item + "=" + obj[item]
i += 1
url += item + '=' + obj[item];
i += 1;
}
return url
}
return url;
};
//对象抽空
export const filterObj = (obj:any) => {
var tmp = {}
export const filterObj = (obj: any) => {
var tmp = {};
for (var item in obj) {
if (obj[item] != null&&obj[item]!=undefined) {
tmp[item] = obj[item]
if (obj[item] != null && obj[item] != undefined) {
tmp[item] = obj[item];
}
}
return tmp
}
return tmp;
};
//对象抽空根据关键字
export const filterObjbyTg = (obj:any,tg:any) => {
var tmp = {}
export const filterObjbyTg = (obj: any, tg: any) => {
var tmp = {};
for (var item in obj) {
if (tg.indexOf(item)>-1) {
if (tg.indexOf(item) > -1) {
if (obj[item] != null) {
tmp[item] = obj[item]
tmp[item] = obj[item];
}
}
}
return tmp
}
return tmp;
};
//提取当中的指定数据类型数据
export const getLevelNum =()=>{
var levelNum=new Array()
export const getLevelNum = () => {
var levelNum = new Array();
for (var item in treeData) {
// console.log(parseInt(treeData[item].key))
if (!isNaN(parseInt(treeData[item].key))) {
levelNum.push(treeData[item].key)
levelNum.push(treeData[item].key);
} else {
var tmp = treeData[item]
var tmp = treeData[item];
tmp.children.map((item, index) => {
levelNum.push(item.key)
})
levelNum.push(item.key);
});
}
}
return levelNum
}
return levelNum;
};
//转换
export const translate = (from:any,to:any,middle:any) => {
export const translate = (from: any, to: any, middle: any) => {
middle.map((item, index) => {
from[item[0]]=to[item[1]]
})
return from
}
from[item[0]] = to[item[1]];
});
return from;
};
//用户名检测
export const checkData = (rule:any, value:any, callback:any) => {
export const checkData = (rule: any, value: any, callback: any) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
......@@ -178,10 +190,10 @@ export const checkData = (rule:any, value:any, callback:any) => {
callback();
};
//时间转换函数
export const timeForm = (values: any,format:any) => {
var result = new Array()
values.map((items:any, index:any) => {
result.push(moment(items).format(format))
})
return result[0] + "-" + result[1]
}
\ No newline at end of file
export const timeForm = (values: any, format: any) => {
var result = new Array();
values.map((items: any, index: any) => {
result.push(moment(items).format(format));
});
return result[0] + '-' + result[1];
};
export const validateMessages ={
export const validateMessages = {
required: '*it is required!',
types: {
email: 'It is not validate email!',
number: '${label} is not a validate number!',
string:'${label} is not a validate number!'
string: '${label} is not a validate number!',
},
string: {
range: 'It must be between ${min} and ${max}',
......@@ -11,106 +11,130 @@ export const validateMessages ={
number: {
range: '${label} must be between ${min} and ${max}',
},
}
};
export const requestList = [
["/tos/community/facilities/categories/subscribe/list","0 请求预订列表",{}],
["/tos/community/facilities/get","1 设施品类获取",{}],
["/tos/community/facilities/categories/detail/get","2 缴费详情",{}],
["/tos/community/facilities/categories/fee/back","3 退还押金",{}],
["/tos/community/facilities/categories/fee/pay","4 缴费",{}],
["/tos/community/categories/subscribe/cancel","5 取消预约",{}],
["/tos/community/facilities/add","6 新增小区设施",{}],
["/tos/bookingService/lookUp","7 查看小区设施",{}],
["/tos/community/facilities/fuzzy/query","8 查看设施管理模糊",{}],
["/tos/community/categories/subscribe/fuzzy/query","9 预订列表模糊查询",{}],
["/tos/user/newCurrentUser", "10 后台用户信息",{}],
["/tos/community/facilities/categories/subscribe","11 预订",{}],
['/tos/community/facilities/categories/subscribe/list', '0 请求预订列表', {}],
['/tos/community/facilities/get', '1 设施品类获取', {}],
['/tos/community/facilities/categories/detail/get', '2 缴费详情', {}],
['/tos/community/facilities/categories/fee/back', '3 退还押金', {}],
['/tos/community/facilities/categories/fee/pay', '4 缴费', {}],
['/tos/community/categories/subscribe/cancel', '5 取消预约', {}],
['/tos/community/facilities/add', '6 新增小区设施', {}],
['/tos/bookingService/lookUp', '7 查看小区设施', {}],
['/tos/community/facilities/fuzzy/query', '8 查看设施管理模糊', {}],
['/tos/community/categories/subscribe/fuzzy/query', '9 预订列表模糊查询', {}],
['/tos/user/newCurrentUser', '10 后台用户信息', {}],
['/tos/community/facilities/categories/subscribe', '11 预订', {}],
["/tos/tosOwner/getAll", "12 业主查询",{}],
["/tos/tosOwner/getDetailAll", "13 业主查询详细",{}],
["/tos/tosOwner/save","14 业主添加",{}],
["/tos/life/community/qr/get","15 二维码查询",{}],
["/tos/life/community/account/unit/del","16 删除单元",{}],
["/tos/bookingService/edit", "17 编辑小区设施",{}],
["/tos/tosOwner/info/update", "18 编辑业主信息",{}],
// ['/tos/tosOwner/getAll', '12 业主查询', {}],
['/tos/owner/query/fuuzy', '12 业主查询', {}],
['/tos/tosOwner/getDetailAll', '13 业主查询详细', {}],
['/tos/tosOwner/save', '14 业主添加', {}],
['/tos/life/community/qr/get', '15 二维码查询', {}],
['/tos/life/community/account/unit/del', '16 删除单元', {}],
['/tos/bookingService/edit', '17 编辑小区设施', {}],
['/tos/tosOwner/info/update', '18 编辑业主信息', {}],
["/tos/contract/list", "19 获取合同列表",{}],
["/tos/contract/detail/query", "20 获取合同列表详情",{}],
["/tos/community/service/get/detail", "21 小区服务获取详情",{}],
["/tos/communtiy/service/reply", "22 小区回复",{}],
["/tos/property/decorate/record/get", "23 装修列表获取",{}],
["/tos/tosCommunity/get", "24 获取小区列表",{}],
["/tos/tosCommunityNotic/get", "25 获取小区公告列表",{}],
["/tos/tosVisitorRecord/get", "26 获取访客记录列表",{}],
["/tos/contract/add", "27 合同新增和编辑",{}],
["/tos/tosCommunityNotic/add", "28 新增小区公告接口", {
"noticTitle":"Garden公告",
"communityNum":"珠江丽景小区",
"noticText":"今晚晚上停水4小时",
"noticScope":"1",
"noticStartTime":"2020-07-01 12:30:00",
"noticEndTime":"2020-08-01 9:30:00",
"file":["A.jpg"]
}],
["/tos/tosManageCommunity/save", "29 新建一个小区",{}],
["/tos/tosOrder/get", "30 获取订单详情",{}],
["/tos/property/community/houseCard/query", "31 获取住户卡列表",{}],
["/tos/tosCommunity/get/detail", "32 获取小区详情",{}],
["/tos/property/decorate/record/reply", "33 回复装修申请",{}],
["/tos/property/community/houseCard/reply", "34 回复住户卡申请",{}],
["/tos/home/page/community/houseCard/add", "35 申请住户卡",{}],
["/tos/property/community/houseCard/query/detail", "36 获取住户卡详情",{}],
["/tos/property/decorate/record/get/detail", "37 获取装修记录详情",{}],
["/tos/users/save", "38 新建后台信息",{}],
["/tos/life/community/account/member/del", "39 删除业主成员信息", {
"id": "c06286cfe7b843cb96fdfcb987231123",
"ownerId": "6b359755a36b49c28241a4620fa6539b"
}],
["/tos/community/service/get", "40 获取小区服务回复列表",{}],
["/tos/users/save", "41 添加后台账号", {
"id": "null",
"oneself": 0,
"tosUserEmail": "sales@huahui.com",
"tosUserName": "小赵2",
"tosUserPhone": "020-8888-4444",
"tosUserPwd": "123456",
"tosUserToCompany": "1",
"tosUserServiceCell":"",
"tosuserLevel": 1,
"userStatus": 1
}],
["/tos/account/permission/savePermission", "42 添加后台权限", {
"userName": "小赵2",
"userPassword": "123456",
"permissionArray": ["2", "1", "3", "4"]
}],
["/tos/tosServiceScope/get", "43 获取服务范围",{
"serviceName": ""
}],
["/tos/tosServiceScope/save", "44 添加服务范围",{
"id":"5",
"serviceName":"律政"
}],
["/tos/user/getAllInfrom", "45 获取后台列表", {
"id": "",
"moment": [],
"name": "",
"leaderID": "1",
"userPhone": ""
}],
["/tos/tosServiceProvider/get","46 获取服务商",{}],
]
['/tos/contract/list', '19 获取合同列表', {}],
['/tos/contract/detail/query', '20 获取合同列表详情', {}],
['/tos/community/service/get/detail', '21 小区服务获取详情', {}],
['/tos/communtiy/service/reply', '22 小区回复', {}],
['/tos/property/decorate/record/get', '23 装修列表获取', {}],
['/tos/tosCommunity/get', '24 获取小区列表', {}],
['/tos/tosCommunityNotic/get', '25 获取小区公告列表', {}],
['/tos/tosVisitorRecord/get', '26 获取访客记录列表', {}],
['/tos/contract/add', '27 合同新增和编辑', {}],
[
'/tos/tosCommunityNotic/add',
'28 新增小区公告接口',
{
noticTitle: 'Garden公告',
communityNum: '珠江丽景小区',
noticText: '今晚晚上停水4小时',
noticScope: '1',
noticStartTime: '2020-07-01 12:30:00',
noticEndTime: '2020-08-01 9:30:00',
file: ['A.jpg'],
},
],
['/tos/tosManageCommunity/save', '29 新建一个小区', {}],
['/tos/tosOrder/get', '30 获取订单详情', {}],
['/tos/property/community/houseCard/query', '31 获取住户卡列表', {}],
['/tos/tosCommunity/get/detail', '32 获取小区详情', {}],
['/tos/property/decorate/record/reply', '33 回复装修申请', {}],
['/tos/property/community/houseCard/reply', '34 回复住户卡申请', {}],
['/tos/home/page/community/houseCard/add', '35 申请住户卡', {}],
['/tos/property/community/houseCard/query/detail', '36 获取住户卡详情', {}],
['/tos/property/decorate/record/get/detail', '37 获取装修记录详情', {}],
['/tos/users/save', '38 新建后台信息', {}],
[
'/tos/life/community/account/member/del',
'39 删除业主成员信息',
{
id: 'c06286cfe7b843cb96fdfcb987231123',
ownerId: '6b359755a36b49c28241a4620fa6539b',
},
],
['/tos/community/service/get', '40 获取小区服务回复列表', {}],
[
'/tos/users/save',
'41 添加后台账号',
{
id: 'null',
oneself: 0,
tosUserEmail: 'sales@huahui.com',
tosUserName: '小赵2',
tosUserPhone: '020-8888-4444',
tosUserPwd: '123456',
tosUserToCompany: '1',
tosUserServiceCell: '',
tosuserLevel: 1,
userStatus: 1,
},
],
[
'/tos/account/permission/savePermission',
'42 添加后台权限',
{
userName: '小赵2',
userPassword: '123456',
permissionArray: ['2', '1', '3', '4'],
},
],
[
'/tos/tosServiceScope/get',
'43 获取服务范围',
{
serviceName: '',
},
],
[
'/tos/tosServiceScope/save',
'44 添加服务范围',
{
id: '5',
serviceName: '律政',
},
],
[
'/tos/user/getAllInfrom',
'45 获取后台列表',
{
id: '',
moment: [],
name: '',
leaderID: '1',
userPhone: '',
},
],
['/tos/tosServiceProvider/get', '46 获取服务商', {}],
];
const params = [
{ "communityName": "" },
{ "communityNum": "", "noticTitlel": "" },
{ "inviterAddress": "", "visitorCommunity": "" },
[26,{
}],
[28, {
}]
]
\ No newline at end of file
{ communityName: '' },
{ communityNum: '', noticTitlel: '' },
{ inviterAddress: '', visitorCommunity: '' },
[26, {}],
[28, {}],
];
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