Commit 7cf88132 authored by maple's avatar maple

[fix]业主模块

parent c6162e80
...@@ -157,7 +157,8 @@ export default defineConfig({ ...@@ -157,7 +157,8 @@ export default defineConfig({
name: 'accessCardapplication', name: 'accessCardapplication',
routes:[ routes:[
{ path: './', component: './CommercialService/Card' }, { path: './', component: './CommercialService/Card' },
{path: './Detail',component:'./CommercialService/CardDetail'}, { path: './Detail', component: './CommercialService/CardDetail' },
{path: './Add', component: './CommercialService/CardAdd'},
] ]
}, },
{ {
...@@ -173,8 +174,7 @@ export default defineConfig({ ...@@ -173,8 +174,7 @@ export default defineConfig({
{ path: './Detail', component: './CommercialService/Detail' }, { path: './Detail', component: './CommercialService/Detail' },
{path: './Edit',component:'./CommercialService/Detail'}, {path: './Edit',component:'./CommercialService/Detail'},
] ]
}, },
{path: './AccessCardApplication/Request',component:'./CommercialService/AccessCardApplication/Request'},
{path: './OwnerComplaints/Detail',component:'./CommercialService/Detail'}, {path: './OwnerComplaints/Detail',component:'./CommercialService/Detail'},
{path: './OwnerComplaints/Edit',component:'./CommercialService/Detail'}, {path: './OwnerComplaints/Edit',component:'./CommercialService/Detail'},
{path: './ProblemFeedback/Detail',component:'./CommercialService/Detail'}, {path: './ProblemFeedback/Detail',component:'./CommercialService/Detail'},
......
...@@ -4,11 +4,20 @@ import styles from './index.less'; ...@@ -4,11 +4,20 @@ import styles from './index.less';
import {Button } from 'antd'; import {Button } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { URL } from '@/utils/method'
const module2="History"
const BackButton = (props:any) => { const BackButton = (props:any) => {
const { history_url, dispatch } = props
const url = props.url; const url = props.url;
const goToReturn = () => { const goToReturn = () => {
// history.back() // history.back()
URL(history.location.pathname, module2, dispatch)
console.log("这里的地址为")
console.log(history.location.pathname)
history.go(-1) history.go(-1)
} }
const goToReturnByParam = () => { const goToReturnByParam = () => {
...@@ -29,5 +38,10 @@ const BackButton = (props:any) => { ...@@ -29,5 +38,10 @@ const BackButton = (props:any) => {
) )
}; };
function mapStateToProps(state:any) {
export default BackButton; const { history_url} = state.History;
return {
history_url,
};
}
export default connect(mapStateToProps)(BackButton);
import React,{useEffect} from 'react';
import { Select } from 'antd';
const { Option } = Select;
const Relationship = (props:any) => {
const { value, onChange }=props
useEffect(()=>{
onChange("0")
},[])
const handleChange=(values:any)=>{
onChange(values)
}
return (
<>
<Select defaultValue="0" style={{ width: 120 }} onChange={handleChange} allowClear>
<Option value="0">Oneself</Option>
<Option value="1">Family Members</Option>
<Option value="2">Tenant</Option>
</Select>
</>
);
};
export default Relationship;
...@@ -111,7 +111,7 @@ class SelectOptions extends React.Component { ...@@ -111,7 +111,7 @@ class SelectOptions extends React.Component {
componetVisible:'Put It Away', componetVisible:'Put It Away',
}) })
} }
console.log("初始化2") // console.log("初始化2")
}; };
......
...@@ -34,12 +34,16 @@ const TableShow = (props:any) => { ...@@ -34,12 +34,16 @@ const TableShow = (props:any) => {
// ower_email: "535740436@qq.com" // ower_email: "535740436@qq.com"
// ower_name: "测试" // ower_name: "测试"
// ower_phone: "微微" // ower_phone: "微微"
const user_status=[[ 1,"家属" ],[2,"租户"]]
const user_status = [[1, "家属"], [2, "租户"]]
const user_type_status = ["Registered", "Unregistered","Cancellation"]
const user_code=["Used","Not Used"]
const key = objectColumns([ const key = objectColumns([
["User Name", "ower_name"], ["User Name", "ower_name"],
["Contact Details", "ower_phone"], ["Contact Details", "ower_phone"],
["Email", "ower_email"], ["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>)], ["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>)],
]) ])
...@@ -59,15 +63,23 @@ const TableShow = (props:any) => { ...@@ -59,15 +63,23 @@ const TableShow = (props:any) => {
<Row gutter={32}> <Row gutter={32}>
<Col span={20}> <Col span={20}>
<Table title={() => { <Table title={() => {
return (<Row gutter={32}><Col>Unit No:</Col><Col>{unit.living}</Col><Col> return (
{props.deleteDisable ? <Button type="danger" onClick={deleteUnit.bind(this, unit.living)}>Delete</Button> : null}</Col></Row>) <div style={{ height: 80, position: "relative" }}>
<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>
</div>
)
}} footer={() => ''} rowKey={"ower_name"} dataSource={unit.member} columns={key} pagination={false}></Table> }} footer={() => ''} rowKey={"ower_name"} dataSource={unit.member} columns={key} pagination={false}></Table>
</Col> </Col>
<Col> <Col>
<Row> <Row>
<img width={80} src={unit.imgUrl} /> <img width={80} src={unit.imgUrl} />
</Row> </Row>
<Row style={{marginTop:8}}><div style={{width:80,textAlign:"center"}}>{((item.unit)[0].member)[0].cdk_code}</div></Row> <Row style={{ marginTop: 8 }}><div style={{ width: 80, textAlign: "center" }}>{((item.unit)[0].member)[0].cdk_code}({user_code[((item.unit)[0].member)[0].cdk_status]})</div></Row>
</Col> </Col>
</Row> </Row>
......
...@@ -6,6 +6,7 @@ import TitleGet from '../TitleGet/TitleGet'; ...@@ -6,6 +6,7 @@ import TitleGet from '../TitleGet/TitleGet';
const TitleBack = (props:any) => { const TitleBack = (props:any) => {
// <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} /> // <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
const backData = (values:any) => { const backData = (values:any) => {
props.titleBack(values) props.titleBack(values)
} }
...@@ -15,7 +16,7 @@ const TitleBack = (props:any) => { ...@@ -15,7 +16,7 @@ const TitleBack = (props:any) => {
{ {
props.sublist!=null props.sublist!=null
? ?
(props.sublist).map( (item:any,index:any)=>{ (props.sublist).map((item:any,index:any)=>{
return ( return (
<div key={index} className={styles.item1}>{item}</div> <div key={index} className={styles.item1}>{item}</div>
) )
......
import React from 'react';
const index = (props:any) => {
return (
<>
<div className={styles.item}>{props.title}</div>
</>
);
};
export default index;
...@@ -91,6 +91,7 @@ const treeData = [ ...@@ -91,6 +91,7 @@ const treeData = [
const TreeAction = (props:any) => { const TreeAction = (props:any) => {
const {value,onChange}=props
const onSelect = (selectedKeys:any, info:any) => { const onSelect = (selectedKeys:any, info:any) => {
// console.log('selected', selectedKeys, info); // console.log('selected', selectedKeys, info);
}; };
...@@ -109,7 +110,8 @@ const TreeAction = (props:any) => { ...@@ -109,7 +110,8 @@ const TreeAction = (props:any) => {
array.push(items) array.push(items)
} }
}) })
props.onSubmit(array) // props.onSubmit(array)
onChange(array)
}; };
return ( return (
......
import { message } from 'antd';
import { routerRedux } from 'dva/router'
export default {
namespace: 'History',
state: {
pageData: null,
history_url:null,
},
reducers: {
PageData(state, { pageData }) {
return { ...state, pageData };
},
returnURL(state, { history_url }) {
return { ...state, history_url};
},
},
effects: {
//页面处理
*PAGE({playload}, {put}) {
let pageData = playload;
yield put({ type: 'PageData', pageData, });
},
//链接
*URL({ playload }, { put }) {
let history_url = playload;
console.log("保存地址");
yield put({ type: 'returnURL', history_url});
},
*URLCLEAR({ }, { put }) {
let history_url = null;
yield put({ type: 'returnURL', history_url});
}
},
};
import { message } from 'antd';
import { routerRedux } from 'dva/router'
export default {
namespace: 'PageData',
state: {
pageData: null,
},
reducers: {
returnPageData(state, { pageData }) {
return { ...state, pageData };
},
},
effects: {
//页面处理
*PAGE({playload}, {put}) {
let pageData = playload;
console.log("页面处理")
yield put({ type: 'returnPageData', pageData, });
},
},
};
...@@ -15,7 +15,9 @@ export default { ...@@ -15,7 +15,9 @@ export default {
CurData: null, CurData: null,
CurDataDetail: {}, CurDataDetail: {},
Data7: null, Data7: null,
Data8:null, Data8: null,
Result: null,
DataSaveDetail:null,
}, },
reducers: { reducers: {
...@@ -37,6 +39,13 @@ export default { ...@@ -37,6 +39,13 @@ export default {
returnPage8(state, { Data8 }) { returnPage8(state, { Data8 }) {
return { ...state, Data8 }; return { ...state, Data8 };
}, },
returnResult(state, { Result }) {
return { ...state, Result };
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return { ...state, DataSaveDetail };
},
}, },
effects: { effects: {
...@@ -115,8 +124,17 @@ export default { ...@@ -115,8 +124,17 @@ export default {
} break; } break;
case 31: { case 31: {
let Data7 = resp; let Data7 = resp;
yield put({type:'returnPage7',Data7}) yield put({ type: 'returnPage7', Data7 })
} } break;
case 35: {
let Result = resp;
yield put({ type: 'returnResult', Result })
} break;
case 37:
case 36: {
let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail, });
} break;
} }
...@@ -160,7 +178,14 @@ export default { ...@@ -160,7 +178,14 @@ export default {
*setCurDataDetail({ playload }, { call, put }) { *setCurDataDetail({ playload }, { call, put }) {
var CurDataDetail={community:'',address:'',home:'',name:'',phone:'',email:'',content:''} var CurDataDetail={community:'',address:'',home:'',name:'',phone:'',email:'',content:''}
yield put({ type: 'returnCurDataDetail', CurDataDetail, }); yield put({ type: 'returnCurDataDetail', CurDataDetail, });
} },
*ResultClear({ }, { put }) {
var Result = null
console.log("清除")
yield put({type: 'returnResult', Result} )
},
}, },
}; };
...@@ -14,7 +14,10 @@ export default { ...@@ -14,7 +14,10 @@ export default {
DataSaveDetail: null, DataSaveDetail: null,
sourceData: null, sourceData: null,
curString:{subscribeDate: null, status: null,curPage:1,curPage2:1} curString: { subscribeDate: null, status: null, curPage: 1, curPage2: 1 },
communityInfo: null,
pageDate:null,
}, },
reducers: { reducers: {
...@@ -38,8 +41,14 @@ export default { ...@@ -38,8 +41,14 @@ export default {
}, },
returnResult(state, { Result }) { returnResult(state, { Result }) {
return {...state,Result} return {...state,Result}
} },
returnCommunityInfo(state, { communityInfo }) {
return {...state,communityInfo}
},
PageDate(state, { pageDate }) {
return {...state,pageDate}
}
}, },
...@@ -47,7 +56,14 @@ export default { ...@@ -47,7 +56,14 @@ export default {
//预订设施查询 //预订设施查询
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
switch (playload.index) {
case 12:
{
let Data = null;
yield put({ type: 'returnPage', Data });
} break;
}
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp)
if (resp.code == 500||resp.error_code!="0000") { if (resp.code == 500||resp.error_code!="0000") {
...@@ -90,6 +106,10 @@ export default { ...@@ -90,6 +106,10 @@ export default {
case 16: { case 16: {
console.log("等待删除完成") console.log("等待删除完成")
} break; } break;
case 32: {
let communityInfo = resp;
yield put({ type: 'returnCommunityInfo', communityInfo });
} break;
} }
} }
...@@ -123,6 +143,11 @@ export default { ...@@ -123,6 +143,11 @@ export default {
var tmp=null var tmp=null
yield put({type: 'returnResult', tmp} ) yield put({type: 'returnResult', tmp} )
}, },
*PAGE({ playload }, { put }) {
var pageDate = playload
yield put({type: 'PageDate',pageDate})
},
}, },
}; };
...@@ -18,9 +18,8 @@ export default { ...@@ -18,9 +18,8 @@ export default {
effects: { effects: {
//获取物业费列表 //获取
*tosCommunityget({ playload }, { call, put }) { *tosCommunityget({ playload }, { call, put }) {
console.log(playload)
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, });
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect,useRef} from 'react';
import styles from './index.less'; import styles from './index.less';
import { Input ,Button,Table,Space,Pagination,Tooltip, Radio } from 'antd'; import { Input, Button, Table, Space, Pagination, Form, Select, Layout } from 'antd';
const { Option } = Select;
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
...@@ -8,6 +9,8 @@ import SelectOptions from '../../../components/SelectOptions/index'; ...@@ -8,6 +9,8 @@ import SelectOptions from '../../../components/SelectOptions/index';
import TreeAction from '../../../components/TreeAction/TreeAction'; import TreeAction from '../../../components/TreeAction/TreeAction';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SelectCommunity from '@/components/SelectCommunity';
import Line from '@/components/Line/Line';
const printContent = (comment: any)=>{ const printContent = (comment: any)=>{
console.log(comment) console.log(comment)
...@@ -20,46 +23,49 @@ const getTreeActionValues = (comment: any)=>{ ...@@ -20,46 +23,49 @@ const getTreeActionValues = (comment: any)=>{
const AccountManagement = () => { const AccountManagement = (props:any) => {
const { dispatch } = props;
const formRef = useRef(null)
const onFinish = (values:any) =>{
console.log(values)
}
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title="Admin Account Adding" /> <TitleBack title="Admin Account Adding" />
<div className={styles.box1}>
<div className={styles.box1item1}>Account ID</div> <Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1item2}><Input/></div>
</div> <Form.Item name="Account" label="Account"><Input placeholder="account Name" style={{width:120}}/></Form.Item>
<Form.Item name="Password" label="Password"><Input placeholder="password" style={{width:120}}/></Form.Item>
<div className={styles.box2}>
<div className={styles.box2item1}>Administrator Name</div> <Form.Item label="Contact Details">
<div className={styles.box2item2}><Input/></div> <Input.Group compact>
<div className={styles.box2item3}>Contact Details</div> <Form.Item name="phone" style={{marginRight:16}}><Input placeholder="Phone number"></Input></Form.Item>
<div className={styles.box2item4}><Input/></div> <Form.Item name="email"><Input placeholder="Email"></Input></Form.Item>
</div> </Input.Group>
</Form.Item>
<SelectOptions list={["美国", "美丽的", "美好", "加拿大", "加油", "XO"].sort()} onSubmit={printContent} />
<Form.Item name="community" label="Community" ><SelectCommunity ></SelectCommunity></Form.Item>
<div className={styles.box3}>
<div className={styles.box3item1}>Permission Configuration</div> <Form.Item label="Level" name="tosuserLevel">
<div className={styles.box3item2}> <Select placeholder="Level" style={{ width: 120 }}>
<div className={styles.box3item2R}><Radio>Secondary Administrator</Radio></div> <Option value="0">Secondary Administrator</Option>
<div className={styles.box3item2R}><Radio>Three Level Administrator</Radio></div> <Option value="1">Three Level Administrator</Option>
<div className={styles.box3item2R}><Radio>Select All</Radio></div> <Option value="2">Select All</Option>
</div> </Select>
<div className={styles.box3item3}> </Form.Item>
<Input />
</div> <Form.Item name="premission" label="Permission">
</div> <TreeAction onSubmit={getTreeActionValues} />
<div className={styles.box4}> </Form.Item>
<div className={styles.box4item1}></div> <Line></Line>
<div className={styles.box4item2}> <Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
<TreeAction onSubmit={getTreeActionValues}/> </Form>
</div>
</div>
<div className={styles.line}></div><Button type="primary" style={{ width: 80, height: 32 }}>Submit</Button>
</div> </div>
); );
}; };
......
...@@ -60,12 +60,21 @@ const Card = (props:any) => { ...@@ -60,12 +60,21 @@ const Card = (props:any) => {
history.push('./AccessCardApplication/Detail') history.push('./AccessCardApplication/Detail')
} }
const goToAdd = (values:any,e:any)=>{
history.push('./AccessCardApplication/Add')
}
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{ {
Data7 != null ? Data7 != null ?
<> <>
<div style={{ height: 80, position: "relative" }}>
<div style={{ position: "absolute", right: 0 }}>
<Button type="primary" onClick={goToAdd}>Apply Card</Button>
</div>
</div>
<Table loading={false} rowKey="id" style={{ marginTop: 16 }} <Table loading={false} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data7.data.rows} dataSource={Data7.data.rows}
columns={columns} columns={columns}
......
import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Table,Space, Button,Form,Row,Col, Layout, message} from 'antd';
const { TabPane } = Tabs;
import {connect,history} from 'umi';
import { RA, ResultClear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import Relationship from '@/components/Relationship/Relationship';
const module="CommunityService"
const CardAdd = (props:any) => {
const { dispatch, Result } = props;
const formRef = useRef(null)
useEffect(() => {
if (Result != null) {
console.log("初始化页面参数")
console.log(Result)
if (Result.error_code = "0000") {
message.success("Operation Success!")
ResultClear(module, dispatch)
} else {
message.error("Operation Fail!")
ResultClear(module, dispatch)
history.go(-1)
}
}
}, [Result])
useEffect(()=>{
var param=
{
"communityName":"A4",
"buildNumber":"01",
"floorNumber":"02",
"roomNumber":"369",
"zipCode":"510000",
"communityOwner":"jack-小雄",
"communityOwnerPhone":"18813757878",
"communityOwnerEmail":"sale2huahuico.com",
"applyName":"小李子",
"applyNamePhone":"13436989568",
"applyNameEmail":"xiaoli@huahuico.com",
"applyRelationOwner":"2",
"applyReasonContent":"租房",
"description":"test"
}
formRef.current.setFieldsValue(param)
}, [])
const onFinish = (values:any)=>{
console.log(values)
RA(35, values, module, dispatch);
}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleBack title={"Apply Card"}></TitleBack>
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Form.Item labelCol={{span:3}} label="Community" style={{marginBottom:0}}>
<Input.Group compact>
<Form.Item name="communityName" style={{marginRight:20}} ><SearchOptionsCommnity /></Form.Item>
<Form.Item name="buildNumber" style={{marginRight:16}} ><Input style={{ width: 80 }} placeholder={"Building"} /></Form.Item>
<div style={{ lineHeight: 2,marginRight:16}}>#</div>
<Form.Item name="floorNumber" style={{marginRight:16}} ><Input style={{ width: 80 }} placeholder={"Floor"} /></Form.Item>
<div style={{lineHeight:2,marginRight:16}}>-</div>
<Form.Item name="roomNumber" ><Input style={{width:120}} placeholder={"Room"} /></Form.Item>
</Input.Group>
</Form.Item>
<Form.Item name="zipCode" wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Input style={{ width: 400 }}></Input></Form.Item>
<Form.Item labelCol={{span:3}} label="Owner Name" style={{marginBottom:-40}}>
<Input.Group compact>
<Form.Item name="communityOwner" style={{marginRight:20}} ><Input placeholder={"Name"} /></Form.Item>
<Form.Item style={{marginRight:20}} label={"Contact Information"} ><Input hidden={true} /></Form.Item>
<Form.Item name="communityOwnerPhone" style={{marginRight:20}}><Input placeholder={"Phone number"} /></Form.Item>
<Form.Item name="communityOwnerEmail" ><Input placeholder={"Email"} /></Form.Item>
</Input.Group>
</Form.Item>
<Line></Line>
<Form.Item labelCol={{span:3}} label="Applicant" style={{marginBottom:-40}}>
<Input.Group compact>
<Form.Item name="applyName" style={{marginRight:20}} ><Input placeholder={"Name"} /></Form.Item>
<Form.Item style={{marginRight:20}} label={"Contact Information"} ><Input placeholder={"Phone number"} hidden={true} /></Form.Item>
<Form.Item name="applyNamePhone" style={{marginRight:20}}><Input placeholder={"Phone number"} /></Form.Item>
<Form.Item name="applyNameEmail" ><Input placeholder={"Email"} /></Form.Item>
</Input.Group>
</Form.Item>
{/* label={"Contact Information"} */}
<Form.Item labelCol={{span:3}} name="applyRelationOwner" label={"Relationship"} ><Relationship /></Form.Item>
<Form.Item labelCol={{span:3}} name="applyReasonContent" label={"Reason"}><TextArea style={{width:400}}></TextArea></Form.Item>
<Line></Line>
<Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form>
</div>
);
};
function map(state:any) {
const { Result} = state[module]
return { Result}
}
export default connect(map)(CardAdd);
\ No newline at end of file
...@@ -12,14 +12,21 @@ import TextArea from 'antd/lib/input/TextArea'; ...@@ -12,14 +12,21 @@ import TextArea from 'antd/lib/input/TextArea';
const module="CommunityService" const module="CommunityService"
const CardDetail = (props:any) => { const CardDetail = (props:any) => {
const { dispatch, Data,DataSave } = props; const { dispatch, Data,DataSave,DataSaveDetail } = props;
const formRef = useRef(null) const formRef = useRef(null)
useEffect(()=>{
if (DataSaveDetail != null) {
console.log(DataSaveDetail)
}
}, [DataSaveDetail])
useEffect(()=>{ useEffect(()=>{
if (DataSave != null) { if (DataSave != null) {
console.log("初始化页面参数") console.log("初始化页面参数")
console.log(DataSave); console.log(DataSave);
RA(36, { id:DataSave.id }, module, dispatch);
/* apply_name: "jack-小白白" /* apply_name: "jack-小白白"
apply_reason_content: "H4sIAAAAAAAAAHuyo/fJnlkAljbS9QYAAAA=" apply_reason_content: "H4sIAAAAAAAAAHuyo/fJnlkAljbS9QYAAAA="
apply_relation_owner: 0 apply_relation_owner: 0
...@@ -99,7 +106,7 @@ const CardDetail = (props:any) => { ...@@ -99,7 +106,7 @@ const CardDetail = (props:any) => {
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{marginTop:16}}>
<Col span={3}>Examine:</Col> <Col span={3}>Examine:</Col>
<Col span={4}><Form.Item name="applyStatus"><Radio.Group ><Radio.Button value={"1"}>Agree</Radio.Button ><Radio.Button style={{marginLeft:20}} value={"2"}>Refuse</Radio.Button ></Radio.Group></Form.Item></Col> <Col span={4}><Form.Item name="applyStatus"><Radio.Group ><Radio.Button value={"1"}>Agree</Radio.Button ><Radio.Button style={{marginLeft:10}} value={"2"}>Refuse</Radio.Button ></Radio.Group></Form.Item></Col>
</Row> </Row>
<Row gutter={8} style={{marginTop:16}}> <Row gutter={8} style={{marginTop:16}}>
...@@ -123,7 +130,7 @@ const CardDetail = (props:any) => { ...@@ -123,7 +130,7 @@ const CardDetail = (props:any) => {
}; };
function map(state:any) { function map(state:any) {
const { Data,DataSave} = state[module] const { Data,DataSave,DataSaveDetail} = state[module]
return { Data,DataSave} return { Data,DataSave,DataSaveDetail}
} }
export default connect(map)(CardDetail); export default connect(map)(CardDetail);
\ No newline at end of file
...@@ -14,13 +14,19 @@ import { values } from 'lodash'; ...@@ -14,13 +14,19 @@ import { values } from 'lodash';
const module="CommunityService" const module="CommunityService"
const RenovationDetail = (props:any) => { const RenovationDetail = (props:any) => {
const { dispatch, DataSave } = props; const { dispatch, DataSave,DataSaveDetail} = props;
const formRef = useRef(null) const formRef = useRef(null)
useEffect(()=>{
if (DataSaveDetail != null) {
console.log(DataSaveDetail)
}
},[DataSaveDetail])
useEffect(()=>{ useEffect(()=>{
if (DataSave != null) { if (DataSave != null) {
console.log("初始化页面参数") console.log("初始化页面参数")
console.log(DataSave); console.log(DataSave);
RA(37,{id:DataSave.id},module,dispatch)
// applyfor_name: "jack-小白白" // applyfor_name: "jack-小白白"
// communityId: "7e5c6fd2f4ba497a90e64535df6e9088" // communityId: "7e5c6fd2f4ba497a90e64535df6e9088"
// community_build_decorate: "01" // community_build_decorate: "01"
...@@ -118,7 +124,7 @@ const RenovationDetail = (props:any) => { ...@@ -118,7 +124,7 @@ const RenovationDetail = (props:any) => {
}; };
function map(state:any) { function map(state:any) {
const { DataSave} = state[module] const { DataSave,DataSaveDetail} = state[module]
return { DataSave} return { DataSave,DataSaveDetail}
} }
export default connect(map)(RenovationDetail); export default connect(map)(RenovationDetail);
\ No newline at end of file
...@@ -4,7 +4,7 @@ import { Input ,Tabs,Table,Space, Button} from 'antd'; ...@@ -4,7 +4,7 @@ import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs; const { TabPane } = Tabs;
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
import {timestampToTime3} from '@/utils/time' import {timestampToTime3, timestampToTime} from '@/utils/time'
// communityNum: "A7" // communityNum: "A7"
// count: 0 // count: 0
// createTime: "Jul 8, 2020 7:38:37 PM" // createTime: "Jul 8, 2020 7:38:37 PM"
...@@ -19,13 +19,7 @@ import {timestampToTime3} from '@/utils/time' ...@@ -19,13 +19,7 @@ import {timestampToTime3} from '@/utils/time'
// noticTitlel: "大家好,今年端午节不放假" // noticTitlel: "大家好,今年端午节不放假"
// updateTime: "Jun 28, 2020 7:38:39 PM" // updateTime: "Jun 28, 2020 7:38:39 PM"
const columns = objectColumns( [
["community", "communityNum"],
["Title", "noticTitlel"],
["Publish Time", null, (text: any, record: any) => (<Space size="middle">{record.noticStartTime.time}</Space>)],
["noticScope", "noticScope"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
const goToAdd = () => { const goToAdd = () => {
...@@ -34,6 +28,14 @@ const goToAdd = () => { ...@@ -34,6 +28,14 @@ const goToAdd = () => {
const module="CommunityAnnouncement" const module="CommunityAnnouncement"
const CommunityAnnouncement = (props:any) => { const CommunityAnnouncement = (props:any) => {
const columns = objectColumns( [
["community", "communityNum"],
["Title", "noticTitlel"],
["Publish Time", "noticStartTime", (text: any, record: any) => (<Space size="middle">{text!=null? timestampToTime(text.time):null}</Space>)],
["noticScope", "noticScope"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
const { dispatch, Data } = props; const { dispatch, Data } = props;
useEffect(() => { useEffect(() => {
RA(25,{communityNum: "", noticTitlel: "" },module,dispatch) RA(25,{communityNum: "", noticTitlel: "" },module,dispatch)
......
...@@ -10,12 +10,16 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch'; ...@@ -10,12 +10,16 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
import { timestampToTime } from '../../../utils/time'; import { timestampToTime } from '../../../utils/time';
import { PAGE, RA, URLCLEAR } from '@/utils/method';
import PageData from '@/models/Common/PageData';
const module = "User"
const module2 = "History"
const module3="PageData"
const Users = (props:any) => { const Users = (props:any) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const { dispatch, location,Data,CommunityList} = props; const { dispatch, location,Data,CommunityList,pageData,history_url} = props;
const RA = (index: any, values: any) => { dispatch({ type: 'User/RA', playload: { index: index, body: values } }) };
const SA = (values: any) => { dispatch({ type: 'User/SA', playload: values}) }; const SA = (values: any) => { dispatch({ type: 'User/SA', playload: values}) };
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' }) const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
...@@ -31,9 +35,9 @@ const Users = (props:any) => { ...@@ -31,9 +35,9 @@ const Users = (props:any) => {
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' }) const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
// const string2mean = [[0, "未注册"], [1, "注册"], [2, "注销"]] // const string2mean = [[0, "未注册"], [1, "注册"], [2, "注销"]]
const string2mean=[[0, "Unregistered"],[1,"registered"], [2,"deregistered"]] const string2mean=[[0, "Unregistered"],[1,"Registered"], [2,"Deregistered"]]
const [curString, setCurString] = useState({ defaultCurrent: 1, total: 0 }) const [curString, setCurString] = useState(null)
const [fileUpload, setFileUpload] = useState(false); const [fileUpload, setFileUpload] = useState(false);
const [fileUploading,setFileUploading]=useState(false) const [fileUploading,setFileUploading]=useState(false)
...@@ -80,25 +84,47 @@ const Users = (props:any) => { ...@@ -80,25 +84,47 @@ const Users = (props:any) => {
} }
useEffect(() => { useEffect(() => {
// console.log(CommunityList )
if (CommunityList != null) { if (CommunityList != null) {
RA(12, {
ownerName: null, console.log("小组件开始请求")
communityArray: CommunityList RA(12, {
}); ownerName: null,
communityArray: CommunityList
}, module, dispatch);
} }
},[CommunityList]) }, [CommunityList])
useEffect(() => { useEffect(() => {
if (Data != null) { if (Data != null) {
var tmp = curString
var tmp = { serach: { name: null, cell: null }, defaultCurrent: 1, total: 0 }
if (history_url != null && history.location.pathname != history_url) {
console.log("旧页面");
console.log(history_url)
console.log( history.location.pathname )
console.log(pageData)
tmp.defaultCurrent = pageData.defaultCurrent;
} else {
console.log("新页面")
}
tmp.total = Data.total tmp.total = Data.total
// message.info("test", 5);
setCurString(tmp) setCurString(tmp)
console.log(tmp)
URLCLEAR(module2, dispatch)
} }
},[Data]) }, [Data])
const goToDetail = (values:any,e:any) => { const goToDetail = (values:any,e:any) => {
SA(values) SA(values)
console.log("保存页面参数")
console.log(curString)
PAGE(curString,module3,dispatch)
history.push(location.pathname+'/Detail') history.push(location.pathname+'/Detail')
} }
const goToEdit = (values: any, e: any) => { const goToEdit = (values: any, e: any) => {
...@@ -119,7 +145,7 @@ const Users = (props:any) => { ...@@ -119,7 +145,7 @@ const Users = (props:any) => {
{title: actions, {title: actions,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
<a onClick={goToEdit.bind(this, record)}>Edit</a> <a onClick={goToEdit.bind(this, record)} disabled={record.enable==2?true:false}>Edit</a>
<a onClick={goToDetail.bind(this,record)}>Detail</a> <a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space> </Space>
), ),
...@@ -130,14 +156,22 @@ const Users = (props:any) => { ...@@ -130,14 +156,22 @@ const Users = (props:any) => {
console.log(comment) console.log(comment)
var tmp = curString var tmp = curString
tmp.total = 0 tmp.total = 0
setCurString(tmp) tmp.serach.name = comment.OwnerName
tmp.serach.cell=comment.serviceCommunityList
setCurString(tmp)
RA(12, { RA(12, {
ownerName: comment.OwnerName, ownerName: comment.OwnerName,
communityArray: comment.serviceCommunityList communityArray: comment.serviceCommunityList
}); },module,dispatch);
} }
const pageChange = (values:any)=>{
var tmp = curString
tmp.defaultCurrent = values.current
setCurString(tmp)
}
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
...@@ -163,7 +197,7 @@ const Users = (props:any) => { ...@@ -163,7 +197,7 @@ const Users = (props:any) => {
{/* 列表组件 */} {/* 列表组件 */}
{ {
Data != null ? Data != null ?
<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data.rows} columns={columns} pagination={curString} /> <Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data.rows} columns={columns} pagination={curString} onChange={pageChange} />
: null : null
} }
</> : </> :
...@@ -182,13 +216,17 @@ const Users = (props:any) => { ...@@ -182,13 +216,17 @@ 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 { pageData} = state.PageData;
const { token } = state.login; const { token } = state.login;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
Data, Data,
DataSave, DataSave,
sourceData, sourceData,
pageData,
history_url,
// token // token
CommunityList, CommunityList,
}; };
......
import React, { useState, useEffect,useRef } from 'react'; import React, { useState, useEffect,useRef } from 'react';
import styles from './UsersAdd.less'; import styles from './UsersAdd.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, 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'; import { Link, useIntl, connect, Dispatch } from 'umi';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam } from '../../../utils/method' import { checkParam, RA } from '../../../utils/method'
import { validateMessages } from '@/utils/params';
const module="User"
const UsersAdd = (props:any) => { const UsersAdd = (props:any) => {
const { dispatch} = props; const { dispatch,communityInfo} = props;
const RA = (index: any, values: any) => { dispatch({ type: 'User/RA', playload: { index: index, body: values } }) };
// const [] = props;
const [postman,setPostman]=useState({extend:null}) const [postman,setPostman]=useState({extend:null})
const formRef = useRef(null); const formRef = useRef(null);
const [loading,setLoading]=useState(false)
const onFinish=(values:any) => { const onFinish=(values:any) => {
if (postman.extend != null) { if (postman.extend != null) {
...@@ -28,44 +31,62 @@ const UsersAdd = (props:any) => { ...@@ -28,44 +31,62 @@ const UsersAdd = (props:any) => {
console.log("添加业主提交的参数:" + tmp.length) console.log("添加业主提交的参数:" + tmp.length)
console.log(values) console.log(values)
if (checkParam(values)) { if (checkParam(values)) {
RA(14,values) values.owerPhone =null
values.owerEmail=null
RA(14, values, module, dispatch)
setLoading(true)
} else { } 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) => { const extendName = (values: any) => {
var tmp = postman var tmp = postman
tmp.extend=values tmp.extend = values
RA(32, {communityName: values }, module, dispatch);
setPostman(tmp) setPostman(tmp)
} }
const checkInput = (e: any) => { useEffect(()=>{
console.log(e) if (communityInfo != null) {
if (e.target.value.length == 1) { console.log(communityInfo)
message.error("Ower Name Should be limit 2~30!",3) if (postman.extend != null) {
formRef.current.setFieldsValue({ addressAndpostalCode: communityInfo.data.rows[0].residentialAddress+" "+communityInfo.data.rows[0].residentialZipCode })
}
} }
} },[communityInfo])
const checkData = (rule:any, value:any, callback:any) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback();
} else {
callback(new Error('Only numbers and letters can be entered!'));
}
}
callback();
};
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<TitleBack title={"Create New Owner"} /> <TitleBack title={"Create New Owner"} />
<Form ref={formRef} name="basic" onFinish={onFinish}> <Spin spinning={loading}>
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" ><Input placeholder="Ower Name" onBlur={checkInput} maxLength={30}/></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>
<div className={styles.box4}> {/* <div className={styles.box4}>
<div className={styles.box4item0}>Contact Details</div> <div className={styles.box4item0}>Contact Details</div>
<div className={styles.box4item1}><Form.Item name="owerPhone" ><Input placeholder="Phone Number" /></Form.Item></div> <div className={styles.box4item1}><Form.Item name="owerPhone" ><Input placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input placeholder="Email" /></Form.Item></div> <div className={styles.box4item2}><Form.Item name="owerEmail" ><Input placeholder="Email" /></Form.Item></div>
</div> </div> */}
<div className={styles.box2}> <div className={styles.box2}>
{/* <div className={styles.box2item1}>Contact Details</div> */}
<div className={styles.box2item2}><SearchOptionsCommnity alone={true} onSubmit={extendName} /></div> <div className={styles.box2item2}><SearchOptionsCommnity alone={true} onSubmit={extendName} /></div>
<div className={styles.box2item3}><Form.Item name="buildingNumber"><Input placeholder="Building" style={{width:94}}/></Form.Item></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.box2item4}>#</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" ><Input placeholder="Floor" style={{width:80}} /></Form.Item></div>
<div className={styles.box2item6}>——</div> <div className={styles.box2item6}>——</div>
...@@ -80,18 +101,18 @@ const UsersAdd = (props:any) => { ...@@ -80,18 +101,18 @@ const UsersAdd = (props:any) => {
<Line /> <Line />
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> </Form>
</Spin>
</div> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { DataSave } = state.User; const { DataSave,communityInfo } = state.User;
return { return {
DataSave, DataSave,
communityInfo,
}; };
} }
export default connect(mapStateToProps)(UsersAdd); export default connect(mapStateToProps)(UsersAdd);
......
...@@ -10,6 +10,7 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio ...@@ -10,6 +10,7 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
import { checkParam } from '../../../utils/method' import { checkParam } from '../../../utils/method'
import TableShow from '@/components/TableShow/TableShow'; import TableShow from '@/components/TableShow/TableShow';
import { values, fromPairs } from 'lodash'; import { values, fromPairs } from 'lodash';
import { timestampToTime } from '@/utils/time';
const UsersDetail = (props:any) => { const UsersDetail = (props:any) => {
...@@ -23,6 +24,7 @@ const UsersDetail = (props:any) => { ...@@ -23,6 +24,7 @@ const UsersDetail = (props:any) => {
const [editFlag, setEditFlag] = useState(false) const [editFlag, setEditFlag] = useState(false)
const user_status = [[1, "家属"], [2, "租户"]] const user_status = [[1, "家属"], [2, "租户"]]
const user_type_status = ["Registered", "Unregistered", "Cancellation"]
const formRef = useRef(null); const formRef = useRef(null);
const onFinish=(values:any) => { const onFinish=(values:any) => {
...@@ -122,7 +124,7 @@ const UsersDetail = (props:any) => { ...@@ -122,7 +124,7 @@ const UsersDetail = (props:any) => {
{ {
memberDetail==false ? <> memberDetail==false ? <>
<TitleBack title={editFlag?"Edit Owner Infomation":"Owner Detail"} /> <TitleBack sublist={['Status : '+user_type_status[DataSave.enable],'Create Time : '+timestampToTime(DataSave.createTime.time)]} title={editFlag?"Edit Owner Infomation":"Owner Detail"} />
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <div className={styles.box1item1}>Owner's Name</div>
...@@ -134,10 +136,9 @@ const UsersDetail = (props:any) => { ...@@ -134,10 +136,9 @@ const UsersDetail = (props:any) => {
<div className={styles.box4item1}><Form.Item name="owerPhone" ><Input disabled={!editFlag} placeholder="Phone Number" /></Form.Item></div> <div className={styles.box4item1}><Form.Item name="owerPhone" ><Input disabled={!editFlag} placeholder="Phone Number" /></Form.Item></div>
<div className={styles.box4item2}><Form.Item name="owerEmail" ><Input disabled={!editFlag} placeholder="Email" /></Form.Item></div> <div className={styles.box4item2}><Form.Item name="owerEmail" ><Input disabled={!editFlag} placeholder="Email" /></Form.Item></div>
</div> </div>
<Line /> <Line />
{ {
DataSaveDetail != null ? <TableShow data={DataSaveDetail} onSubmit={tableShowCallback} onChange={deleteUnit} deleteDisable={!editFlag}/> : null DataSaveDetail != null ? <TableShow data={DataSaveDetail} onSubmit={tableShowCallback} onChange={deleteUnit} deleteDisable={editFlag}/> : null
} }
{ {
editFlag ? <> editFlag ? <>
......
...@@ -33,7 +33,7 @@ const Guard = (props:any) => { ...@@ -33,7 +33,7 @@ const Guard = (props:any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={"Version 1.1.1"} /> <TitleGet title={"Version 1.1.2"} />
<p> <p>
token:{page.token} token:{page.token}
name:{getCookie("name")} name:{getCookie("name")}
......
import request from '@/utils/request'; import request from '@/utils/request';
export function tosCommunityget(values: any) { export function tosCommunityget(values: any) {
console.log(values)
return request('/tos/tosCommunity/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/tosCommunity/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
\ No newline at end of file
...@@ -95,9 +95,13 @@ const requestList = [ ...@@ -95,9 +95,13 @@ const requestList = [
["/tos/tosManageCommunity/save", "29 新建一个小区"], ["/tos/tosManageCommunity/save", "29 新建一个小区"],
["/tos/tosOrder/get", "30 获取订单详情"], ["/tos/tosOrder/get", "30 获取订单详情"],
["/tos/property/community/houseCard/query", "31 获取住户卡列表"], ["/tos/property/community/houseCard/query", "31 获取住户卡列表"],
["/tos/tosManageCommunity/get/detail", "32 获取小区详情"], ["/tos/tosCommunity/get/detail", "32 获取小区详情"],
["/tos/property/decorate/record/reply", "33 回复装修申请"], ["/tos/property/decorate/record/reply", "33 回复装修申请"],
["/tos/property/community/houseCard/reply", "34 回复住户卡申请"], ["/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 新建后台信息"],
] ]
const params = [ const params = [
...@@ -108,14 +112,21 @@ const params = [ ...@@ -108,14 +112,21 @@ const params = [
function requestAuto(url:string,values:any) { function requestAuto(url:string,values:any) {
return request(url, Body(values)) return request(url, Body(values))
} }
//配置文件
// const yellowcolor ="\033[40;33m"
// // const bulecolor='\033[40;34m';
// const colorend = "\033[0m"
export function RA(playload: any) { export function RA(playload: any) {
console.log(playload) // console.log(playload)
console.log(playload.index) // console.log(playload.index)
var url =(requestList[playload.index])[0] var url = (requestList[playload.index])[0]
console.log(playload.index + "》【发送请求】" + url + " " + (requestList[playload.index])[1]) console.log(playload.index + "》【发送请求】" + url + " " + (requestList[playload.index])[1])
console.log("参数如下:") console.log("参数如下:")
console.log(playload.body) console.log(playload.body)
console.log(JSON.stringify(playload.body))
// console.log(JSON.stringify(playload.body))
return requestAuto(url,playload.body) return requestAuto(url,playload.body)
} }
......
...@@ -56,6 +56,10 @@ export const setCookie=(key:string,value: string)=>{ ...@@ -56,6 +56,10 @@ 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 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 ResultClear = (module:any,dispatch:any) => { dispatch({ type: module + '/ResultClear' }) }; export const ResultClear = (module:any,dispatch:any) => { dispatch({ type: module + '/ResultClear' }) };
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]] // const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }] // const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
......
export const validateMessages ={ export const validateMessages ={
required: '${label} is required!', required: 'please enter,it is required!',
types: { types: {
email: '${label} is not validate email!', email: '${label} is not validate email!',
number: '${label} is not a validate number!', number: '${label} is not a validate number!',
string:'${label} is not a validate number!' string:'${label} is not a validate number!'
}, },
string: { string: {
range: '${label} must be between ${min} and ${max}', range: 'it must be between ${min} and ${max}',
}, },
number: { number: {
range: '${label} must be between ${min} and ${max}', range: '${label} must be between ${min} and ${max}',
......
...@@ -72,4 +72,16 @@ export const stringTab = (string:any) => { ...@@ -72,4 +72,16 @@ export const stringTab = (string:any) => {
return string.slice(0, 20) + "..." return string.slice(0, 20) + "..."
} }
return string return string
} }
\ No newline at end of file
// if (/[\u4E00-\u9FA5]/g.test(value)||/^[0-9]+.?[0-9]*$/g.test(value)) {
// callback(new Error('只可输入字母、不能输入汉字!'));
// } else {
// callback();
// }
// const checkInput = (e: any) => {
// console.log(e)
// if (e.target.value.length == 1) {
// message.error("Ower Name Should be limit 2~30!",3)
// }
// }
\ No newline at end of file
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