Commit c2c49966 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parent 89d56b21
...@@ -18,7 +18,7 @@ const TitleSearch = (props: any) => { ...@@ -18,7 +18,7 @@ const TitleSearch = (props: any) => {
const { dispatch, CommunityList } = props; const { dispatch, CommunityList } = props;
const key = props.listkey const key = props.listkey;
const name = props.list; const name = props.list;
// const single = props.single // const single = props.single
// const checklist = props.checklist; // const checklist = props.checklist;
...@@ -28,58 +28,56 @@ const TitleSearch = (props: any) => { ...@@ -28,58 +28,56 @@ const TitleSearch = (props: any) => {
const { single, checklist, status, communitySelect, defaultValue } = props; const { single, checklist, status, communitySelect, defaultValue } = props;
const time = props.time; const time = props.time;
const community = props.community; const community = props.community;
const [selectOptions, setSelectOptions] = useState(true) const [selectOptions, setSelectOptions] = useState(true);
const [communitys, setCommunitys] = useState(CommunityList) const [communitys, setCommunitys] = useState(CommunityList);
const [communitySingle, setCommunitySingle] = useState(null) const [communitySingle, setCommunitySingle] = useState(null);
const [datePicker, setDate] = useState(null) const [datePicker, setDate] = useState(null);
const [form] = Form.useForm() const [form] = Form.useForm();
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) }; const tosCommunityget = (values: any) => {
dispatch({ type: 'Init/tosCommunityget', playload: values });
};
useEffect(() => { useEffect(() => {
// console.log("标题搜寻组件初始化") OK // console.log("标题搜寻组件初始化") OK
if (CommunityList == null) { if (CommunityList == null) {
// console.log("小区数量初始化") OK // console.log("小区数量初始化") OK
tosCommunityget(null) console.log('这里开始获取小区');
tosCommunityget(null);
} }
if (defaultValue != null) { if (defaultValue != null) {
form.setFieldsValue(defaultValue) form.setFieldsValue(defaultValue);
} }
}, []); }, []);
useEffect(() => { useEffect(() => {
if (defaultValue != null) { if (defaultValue != null) {
form.setFieldsValue(defaultValue) form.setFieldsValue(defaultValue);
} }
}, [defaultValue]) }, [defaultValue]);
useEffect(() => { useEffect(() => {
// console.log(CommunityList) // console.log(CommunityList)
if (CommunityList != null) { if (CommunityList != null) {
// console.log("小区数量初始化完毕") OK // console.log("小区数量初始化完毕") OK
var tmp = {} var tmp = {};
tmp[community] = CommunityList tmp[community] = CommunityList;
// props.onSubmit(tmp) 禁用 改用组件初始化 // props.onSubmit(tmp) 禁用 改用组件初始化
setCommunitys(CommunityList) setCommunitys(CommunityList);
} }
}, [CommunityList]) }, [CommunityList]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
if (datePicker) { if (datePicker) {
values[time[0]] = datePicker; values[time[0]] = datePicker;
} }
if (community) { if (community) {
values[community] = communitys values[community] = communitys;
} }
console.log('Success:', values); console.log('Success:', values);
props.onSubmit(values) props.onSubmit(values);
}; };
const onFinishFailed = (errorInfo: any) => { const onFinishFailed = (errorInfo: any) => {
...@@ -87,90 +85,101 @@ const TitleSearch = (props: any) => { ...@@ -87,90 +85,101 @@ const TitleSearch = (props: any) => {
}; };
const onChange = (date: any, dateString: string) => { const onChange = (date: any, dateString: string) => {
setDate(dateString) setDate(dateString);
} };
const printContent = (comment: any) => { const printContent = (comment: any) => {
setCommunitys(comment) setCommunitys(comment);
} };
// 选择小区名字并赋值 // 选择小区名字并赋值
const opname = (value: any) => { const opname = (value: any) => {
form.setFieldsValue({ form.setFieldsValue({
'communityName': value communityName: value,
}) });
} };
return ( return (
<> <>
<Form form={form} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}> <Form form={form} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}> <Row gutter={32}>
{ {communitySelect != null ? (
communitySelect != null ? <Col key={'communitySelect_'}>
<Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} opname={opname} /></Form.Item></Col> <Form.Item name={'communityName'}>
: null <SearchOptionsCommnity titleSearch={true} opname={opname} />
} </Form.Item>
{ </Col>
key != null ? ) : null}
key.map((item, index) => { {key != null
? key.map((item, index) => {
return ( 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) => {
status != null ?
status.map((item, index) => {
return ( return (
<Col key={"StatusCol_" + index}> <Col key={'StatusCol_' + index}>
<Form.Item name={item.name[0]}> <Form.Item name={item.name[0]}>
<Select style={{ width: 160 }} placeholder={item.name[1]} allowClear={true}> <Select style={{ width: 160 }} placeholder={item.name[1]} allowClear={true}>
{ {item.data.map((word) => {
item.data.map(word => { return (
return ( <Option key={word} value={word[0]}>
<Option key={word} value={word[0]}>{word[1]}</Option> {word[1]}
) </Option>
}) );
} })}
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
) );
}) })
: null : null}
} {time != null ? (
{ <Col key={'datePicker_'}>
time != null ? {' '}
<Col key={"datePicker_"} > <DatePicker placeholder={time[1]} onChange={onChange} /></Col> <DatePicker placeholder={time[1]} onChange={onChange} />
: null </Col>
} ) : null}
{ {community == null ? (
community == null ? <Col>
<Col><Form.Item><Button type="primary" htmlType="submit">Search</Button></Form.Item></Col> <Form.Item>
: null <Button type="primary" htmlType="submit">
} Search
</Button>
</Form.Item>
</Col>
) : null}
</Row> </Row>
{ {community != null ? (
community != null ? <>
<> {CommunityList != null ? (
{ <SelectOptions
CommunityList != null ? checklist={checklist}
<SelectOptions checklist={checklist} single={single} list={CommunityList.sort()} show={selectOptions} onSubmit={printContent} /> : single={single}
null list={CommunityList.sort()}
} show={selectOptions}
onSubmit={printContent}
<Form.Item><Button type="primary" htmlType="submit" style={{ backgroundColor: "#e7f4ff", color: "rgba(24,144,255,1)" }}>Search</Button></Form.Item> />
</> : null ) : null}
}
<Form.Item>
<Button
type="primary"
htmlType="submit"
style={{ backgroundColor: '#e7f4ff', color: 'rgba(24,144,255,1)' }}
>
Search
</Button>
</Form.Item>
</>
) : null}
</Form> </Form>
</> </>
); );
}; };
...@@ -194,4 +203,4 @@ export default connect(mapStateToProps)(TitleSearch); ...@@ -194,4 +203,4 @@ export default connect(mapStateToProps)(TitleSearch);
// time={["key", "预订时间筛选"]} // time={["key", "预订时间筛选"]}
// community={"communityName"} // community={"communityName"}
// // single={true} // // single={true}
// onSubmit={CallBackTitleSearch} /> // onSubmit={CallBackTitleSearch} />
\ No newline at end of file
import {getAllCommunity, getAllDevice,saveDevice,delDevice,getDeviceNum,getNewAddBug,importUserDeviceListExcel, import {
getUserDevice,saveUserDevice,getTargetKeys,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/housingList'; getAllCommunity,
import { getRegion,getRegionList } from '@/services/region'; getAllDevice,
saveDevice,
delDevice,
getDeviceNum,
getNewAddBug,
importUserDeviceListExcel,
getUserDevice,
saveUserDevice,
getTargetKeys,
getNewAdd,
importUserListExcel,
getDeviceDetails,
} from '@/services/housingList';
import { getRegion, getRegionList } from '@/services/region';
export default{ export default {
namespace: 'housingListModel', namespace: 'housingListModel',
state: { state: {
data: [], data: [],
}, },
effects: { effects: {
*getAllCommunity({callback,payload},{ call, put }) { *getAllCommunity({ callback, payload }, { call, put }) {
const response = yield call(getAllCommunity,payload); const response = yield call(getAllCommunity, payload);
yield put({ yield put({
type: "getAll", type: 'getAll',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getAllDevice({ callback, payload }, { call, put }) {
*getAllDevice({callback,payload},{ call, put }) { const response = yield call(getAllDevice, payload);
const response = yield call(getAllDevice,payload);
yield put({ yield put({
type: "getAll", type: 'getAll',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getRegion({callback,payload},{ call, put }) { *getRegion({ callback, payload }, { call, put }) {
const response = yield call(getRegion,payload); const response = yield call(getRegion, payload);
yield put({ yield put({
type: "getRegions", type: 'getRegions',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*saveDevice({callback,payload},{ call, put }) { *saveDevice({ callback, payload }, { call, put }) {
const response = yield call(saveDevice,payload); const response = yield call(saveDevice, payload);
yield put({ yield put({
type: "save", type: 'save',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*delDevice({callback,payload},{ call, put }) { *delDevice({ callback, payload }, { call, put }) {
const response = yield call(delDevice,payload); const response = yield call(delDevice, payload);
yield put({ yield put({
type: "del", type: 'del',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getRegionList({callback,payload},{ call, put }) { *getRegionList({ callback, payload }, { call, put }) {
const response = yield call(getRegionList,payload); const response = yield call(getRegionList, payload);
yield put({ yield put({
type: "regionList", type: 'regionList',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getDeviceNum({callback,payload},{ call, put }) { *getDeviceNum({ callback, payload }, { call, put }) {
const response = yield call(getDeviceNum,payload); const response = yield call(getDeviceNum, payload);
yield put({ yield put({
type: "num", type: 'num',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getUserDevice({callback,payload},{ call, put }) { *getUserDevice({ callback, payload }, { call, put }) {
const response = yield call(getUserDevice,payload); const response = yield call(getUserDevice, payload);
yield put({ yield put({
type: "userDevice", type: 'userDevice',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*saveUserDevice({callback,payload},{ call, put }) { *saveUserDevice({ callback, payload }, { call, put }) {
const response = yield call(saveUserDevice,payload); const response = yield call(saveUserDevice, payload);
yield put({ yield put({
type: "userDeviceSave", type: 'userDeviceSave',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getTargetKeys({callback,payload},{ call, put }) { *getTargetKeys({ callback, payload }, { call, put }) {
const response = yield call(getTargetKeys,payload); const response = yield call(getTargetKeys, payload);
yield put({ yield put({
type: "targetKeys", type: 'targetKeys',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getNewAdd({callback,payload},{ call, put }) { *getNewAdd({ callback, payload }, { call, put }) {
const response = yield call(getNewAdd,payload); const response = yield call(getNewAdd, payload);
yield put({ yield put({
type: "newAdd", type: 'newAdd',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getNewAddBug({callback,payload},{ call, put }) { *getNewAddBug({ callback, payload }, { call, put }) {
const response = yield call(getNewAddBug,payload); const response = yield call(getNewAddBug, payload);
yield put({ yield put({
type: "newAddBug", type: 'newAddBug',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*importUserListExcel({callback,payload},{ call, put }) { *importUserListExcel({ callback, payload }, { call, put }) {
const response = yield call(importUserListExcel,payload); const response = yield call(importUserListExcel, payload);
yield put({ yield put({
type: "importListExcel", type: 'importListExcel',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*importUserDeviceListExcel({callback,payload},{ call, put }) { *importUserDeviceListExcel({ callback, payload }, { call, put }) {
const response = yield call(importUserDeviceListExcel,payload); const response = yield call(importUserDeviceListExcel, payload);
yield put({ yield put({
type: "importDeviceListExcel", type: 'importDeviceListExcel',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
*getDeviceDetails({callback,payload},{ call, put }) { *getDeviceDetails({ callback, payload }, { call, put }) {
const response = yield call(getDeviceDetails,payload); const response = yield call(getDeviceDetails, payload);
yield put({ yield put({
type: "deviceDetails", type: 'deviceDetails',
}); });
if(callback) callback(response); if (callback) callback(response);
}, },
}, },
reducers: { reducers: {
getAll(state, action) { getAll(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
getRegions(state, action) { getRegions(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
save(state, action) { save(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
del(state, action) { del(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
regionList(state, action) { regionList(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
num(state, action) { num(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
userDevice(state, action) { userDevice(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
userDeviceSave(state, action) { userDeviceSave(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
targetKeys(state, action) { targetKeys(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
newAdd(state, action) { newAdd(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
newAddBug(state, action) { newAddBug(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
importListExcel(state, action) { importListExcel(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
importDeviceListExcel(state, action) { importDeviceListExcel(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
deviceDetails(state, action) { deviceDetails(state, action) {
return { return {
...state, ...state,
data:action.payload || {}, data: action.payload || {},
}; };
}, },
}, },
}; };
...@@ -233,7 +233,7 @@ const Adds = (props: any) => { ...@@ -233,7 +233,7 @@ const Adds = (props: any) => {
let { residentialZipCode } = values.des; let { residentialZipCode } = values.des;
let tel = values.info.tel; let tel = values.info.tel;
if (values.residentialManagerUserName.length < 2) { if (values.residentialManagerUserName.length < 2) {
message.error('Please Enter 2-digit Zip Code!'); message.error('Please Enter 2-digit Administrator Name!');
} else if (residentialZipCode.length < 6) { } else if (residentialZipCode.length < 6) {
message.error('Please Enter The Correct Name!'); message.error('Please Enter The Correct Name!');
} else if (tel.length != 8 && tel.length != 11) { } else if (tel.length != 8 && tel.length != 11) {
......
...@@ -10,6 +10,8 @@ import TitleSearch from '@/components/TitleSearch/TitleSearch'; ...@@ -10,6 +10,8 @@ import TitleSearch from '@/components/TitleSearch/TitleSearch';
import { RA, SA } from '@/utils/method'; import { RA, SA } from '@/utils/method';
import { objectColumns } from '@/utils/string'; import { objectColumns } from '@/utils/string';
import { getCookie } from '@/utils/method';
const module = 'CellList'; const module = 'CellList';
import './celllist.less'; import './celllist.less';
...@@ -81,7 +83,7 @@ const CellLists = (props: any) => { ...@@ -81,7 +83,7 @@ const CellLists = (props: any) => {
}; };
setTerm(obj); // 存进搜索条件 setTerm(obj); // 存进搜索条件
} else { } else {
RA(24, { communityName: '' }, module, dispatch); RA(55, { id: getCookie('id') }, module, dispatch);
} }
}, [Data]); }, [Data]);
......
...@@ -136,7 +136,12 @@ const Detail = (props: any) => { ...@@ -136,7 +136,12 @@ const Detail = (props: any) => {
{/* 激活码 */} {/* 激活码 */}
<div className="code"> <div className="code">
<li>Community Activation Code</li> <li>Community Activation Code</li>
<Image width={140} src={detailData.visitorUrl} fallback={imgs} /> <div
style={{ width: 122, height: 122, border: '1px solid #f0f0f0', margin: 'auto' }}
>
<Image width={120} src={detailData.visitorUrl} />
</div>
{/* <Image width={140} src={detailData.visitorUrl} fallback={imgs} /> */}
<li className="lis">{detailData.rows.cdkCode}</li> <li className="lis">{detailData.rows.cdkCode}</li>
</div> </div>
......
...@@ -118,10 +118,9 @@ li { ...@@ -118,10 +118,9 @@ li {
li { li {
text-align: center; text-align: center;
line-height: 35px; line-height: 35px;
margin-bottom: 6px;
} }
img { img {
width: 140px;
border: 1px solid #f0f0f0;
border-radius: 3px; border-radius: 3px;
margin-bottom: 5px; margin-bottom: 5px;
} }
......
...@@ -22,7 +22,7 @@ const Guard = (props: any) => { ...@@ -22,7 +22,7 @@ const Guard = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={'Version 1.5.1'} /> <TitleGet title={'Version 1.5.2'} />
{/* <p> {/* <p>
token:{page.token} token:{page.token}
name:{getCookie('name')} name:{getCookie('name')}
......
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-10 10:09:27
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\services\Init.ts
*/
import request from '@/utils/request'; import request from '@/utils/request';
import { getCookie } from '@/utils/method';
// 新加的根据权限 获取小区的接口
export function tosCommunityget(values: any) { export function tosCommunityget(values: any) {
return request('/tos/tosCommunity/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/tosCommunity/get/user', {
} method: 'POST',
\ No newline at end of file body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
data: { id: getCookie('id') },
});
}
// 原来的获取小区接口
// export function tosCommunityget(values: any) {
// return request('/tos/tosCommunity/get', {
// method: 'POST',
// body: JSON.stringify(values),
// headers: { 'Content-Type': 'application/json' },
// });
// }
/*
* @Author: your name
* @Date: 2020-11-24 11:24:06
* @LastEditTime: 2020-12-10 14:07:29
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\services\housingList.ts
*/
import request from '@/utils/request'; import request from '@/utils/request';
export interface LoginParamsType { export interface LoginParamsType {
......
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