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) => {
const { dispatch, CommunityList } = props;
const key = props.listkey
const key = props.listkey;
const name = props.list;
// const single = props.single
// const checklist = props.checklist;
......@@ -28,58 +28,56 @@ const TitleSearch = (props: any) => {
const { single, checklist, status, communitySelect, defaultValue } = props;
const time = props.time;
const community = props.community;
const [selectOptions, setSelectOptions] = useState(true)
const [communitys, setCommunitys] = useState(CommunityList)
const [communitySingle, setCommunitySingle] = useState(null)
const [datePicker, setDate] = useState(null)
const [selectOptions, setSelectOptions] = useState(true);
const [communitys, setCommunitys] = useState(CommunityList);
const [communitySingle, setCommunitySingle] = 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(() => {
// console.log("标题搜寻组件初始化") OK
if (CommunityList == null) {
// console.log("小区数量初始化") OK
tosCommunityget(null)
console.log('这里开始获取小区');
tosCommunityget(null);
}
if (defaultValue != null) {
form.setFieldsValue(defaultValue)
form.setFieldsValue(defaultValue);
}
}, []);
useEffect(() => {
if (defaultValue != null) {
form.setFieldsValue(defaultValue)
form.setFieldsValue(defaultValue);
}
}, [defaultValue])
}, [defaultValue]);
useEffect(() => {
// console.log(CommunityList)
if (CommunityList != null) {
// console.log("小区数量初始化完毕") OK
var tmp = {}
tmp[community] = CommunityList
var tmp = {};
tmp[community] = CommunityList;
// props.onSubmit(tmp) 禁用 改用组件初始化
setCommunitys(CommunityList)
setCommunitys(CommunityList);
}
}, [CommunityList])
}, [CommunityList]);
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)
props.onSubmit(values);
};
const onFinishFailed = (errorInfo: any) => {
......@@ -87,90 +85,101 @@ const TitleSearch = (props: any) => {
};
const onChange = (date: any, dateString: string) => {
setDate(dateString)
}
setDate(dateString);
};
const printContent = (comment: any) => {
setCommunitys(comment)
}
setCommunitys(comment);
};
// 选择小区名字并赋值
const opname = (value: any) => {
form.setFieldsValue({
'communityName': value
})
}
communityName: value,
});
};
return (
<>
<Form form={form} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}>
{
communitySelect != null ?
<Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} opname={opname} /></Form.Item></Col>
: null
}
{
key != null ?
key.map((item, index) => {
{communitySelect != null ? (
<Col key={'communitySelect_'}>
<Form.Item name={'communityName'}>
<SearchOptionsCommnity titleSearch={true} opname={opname} />
</Form.Item>
</Col>
) : 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
}
{
status != null ?
status.map((item, index) => {
: null}
{status != null
? status.map((item, index) => {
return (
<Col key={"StatusCol_" + index}>
<Col key={'StatusCol_' + index}>
<Form.Item name={item.name[0]}>
<Select style={{ width: 160 }} placeholder={item.name[1]} allowClear={true}>
{
item.data.map(word => {
{item.data.map((word) => {
return (
<Option key={word} value={word[0]}>{word[1]}</Option>
)
})
}
<Option key={word} value={word[0]}>
{word[1]}
</Option>
);
})}
</Select>
</Form.Item>
</Col>
)
);
})
: null
}
{
time != null ?
<Col key={"datePicker_"} > <DatePicker placeholder={time[1]} onChange={onChange} /></Col>
: null
}
{
community == null ?
<Col><Form.Item><Button type="primary" htmlType="submit">Search</Button></Form.Item></Col>
: null
}
: null}
{time != null ? (
<Col key={'datePicker_'}>
{' '}
<DatePicker placeholder={time[1]} onChange={onChange} />
</Col>
) : null}
{community == null ? (
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Search
</Button>
</Form.Item>
</Col>
) : null}
</Row>
{
community != null ?
{community != null ? (
<>
{
CommunityList != null ?
<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>
</> : null
}
{CommunityList != null ? (
<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>
</>
) : null}
</Form>
</>
);
};
......
import {getAllCommunity, getAllDevice,saveDevice,delDevice,getDeviceNum,getNewAddBug,importUserDeviceListExcel,
getUserDevice,saveUserDevice,getTargetKeys,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/housingList';
import { getRegion,getRegionList } from '@/services/region';
import {
getAllCommunity,
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',
state: {
data: [],
},
effects: {
*getAllCommunity({callback,payload},{ call, put }) {
const response = yield call(getAllCommunity,payload);
*getAllCommunity({ callback, payload }, { call, put }) {
const response = yield call(getAllCommunity, payload);
yield put({
type: "getAll",
type: 'getAll',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getAllDevice({callback,payload},{ call, put }) {
const response = yield call(getAllDevice,payload);
*getAllDevice({ callback, payload }, { call, put }) {
const response = yield call(getAllDevice, payload);
yield put({
type: "getAll",
type: 'getAll',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getRegion({callback,payload},{ call, put }) {
const response = yield call(getRegion,payload);
*getRegion({ callback, payload }, { call, put }) {
const response = yield call(getRegion, payload);
yield put({
type: "getRegions",
type: 'getRegions',
});
if(callback) callback(response);
if (callback) callback(response);
},
*saveDevice({callback,payload},{ call, put }) {
const response = yield call(saveDevice,payload);
*saveDevice({ callback, payload }, { call, put }) {
const response = yield call(saveDevice, payload);
yield put({
type: "save",
type: 'save',
});
if(callback) callback(response);
if (callback) callback(response);
},
*delDevice({callback,payload},{ call, put }) {
const response = yield call(delDevice,payload);
*delDevice({ callback, payload }, { call, put }) {
const response = yield call(delDevice, payload);
yield put({
type: "del",
type: 'del',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getRegionList({callback,payload},{ call, put }) {
const response = yield call(getRegionList,payload);
*getRegionList({ callback, payload }, { call, put }) {
const response = yield call(getRegionList, payload);
yield put({
type: "regionList",
type: 'regionList',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getDeviceNum({callback,payload},{ call, put }) {
const response = yield call(getDeviceNum,payload);
*getDeviceNum({ callback, payload }, { call, put }) {
const response = yield call(getDeviceNum, payload);
yield put({
type: "num",
type: 'num',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getUserDevice({callback,payload},{ call, put }) {
const response = yield call(getUserDevice,payload);
*getUserDevice({ callback, payload }, { call, put }) {
const response = yield call(getUserDevice, payload);
yield put({
type: "userDevice",
type: 'userDevice',
});
if(callback) callback(response);
if (callback) callback(response);
},
*saveUserDevice({callback,payload},{ call, put }) {
const response = yield call(saveUserDevice,payload);
*saveUserDevice({ callback, payload }, { call, put }) {
const response = yield call(saveUserDevice, payload);
yield put({
type: "userDeviceSave",
type: 'userDeviceSave',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getTargetKeys({callback,payload},{ call, put }) {
const response = yield call(getTargetKeys,payload);
*getTargetKeys({ callback, payload }, { call, put }) {
const response = yield call(getTargetKeys, payload);
yield put({
type: "targetKeys",
type: 'targetKeys',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getNewAdd({callback,payload},{ call, put }) {
const response = yield call(getNewAdd,payload);
*getNewAdd({ callback, payload }, { call, put }) {
const response = yield call(getNewAdd, payload);
yield put({
type: "newAdd",
type: 'newAdd',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getNewAddBug({callback,payload},{ call, put }) {
const response = yield call(getNewAddBug,payload);
*getNewAddBug({ callback, payload }, { call, put }) {
const response = yield call(getNewAddBug, payload);
yield put({
type: "newAddBug",
type: 'newAddBug',
});
if(callback) callback(response);
if (callback) callback(response);
},
*importUserListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserListExcel,payload);
*importUserListExcel({ callback, payload }, { call, put }) {
const response = yield call(importUserListExcel, payload);
yield put({
type: "importListExcel",
type: 'importListExcel',
});
if(callback) callback(response);
if (callback) callback(response);
},
*importUserDeviceListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserDeviceListExcel,payload);
*importUserDeviceListExcel({ callback, payload }, { call, put }) {
const response = yield call(importUserDeviceListExcel, payload);
yield put({
type: "importDeviceListExcel",
type: 'importDeviceListExcel',
});
if(callback) callback(response);
if (callback) callback(response);
},
*getDeviceDetails({callback,payload},{ call, put }) {
const response = yield call(getDeviceDetails,payload);
*getDeviceDetails({ callback, payload }, { call, put }) {
const response = yield call(getDeviceDetails, payload);
yield put({
type: "deviceDetails",
type: 'deviceDetails',
});
if(callback) callback(response);
if (callback) callback(response);
},
},
reducers: {
getAll(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
getRegions(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
regionList(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
num(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
userDevice(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
userDeviceSave(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
targetKeys(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
newAdd(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
newAddBug(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
importListExcel(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
importDeviceListExcel(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
deviceDetails(state, action) {
return {
...state,
data:action.payload || {},
data: action.payload || {},
};
},
},
};
......@@ -233,7 +233,7 @@ const Adds = (props: any) => {
let { residentialZipCode } = values.des;
let tel = values.info.tel;
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) {
message.error('Please Enter The Correct Name!');
} else if (tel.length != 8 && tel.length != 11) {
......
......@@ -10,6 +10,8 @@ import TitleSearch from '@/components/TitleSearch/TitleSearch';
import { RA, SA } from '@/utils/method';
import { objectColumns } from '@/utils/string';
import { getCookie } from '@/utils/method';
const module = 'CellList';
import './celllist.less';
......@@ -81,7 +83,7 @@ const CellLists = (props: any) => {
};
setTerm(obj); // 存进搜索条件
} else {
RA(24, { communityName: '' }, module, dispatch);
RA(55, { id: getCookie('id') }, module, dispatch);
}
}, [Data]);
......
......@@ -136,7 +136,12 @@ const Detail = (props: any) => {
{/* 激活码 */}
<div className="code">
<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>
</div>
......
......@@ -118,10 +118,9 @@ li {
li {
text-align: center;
line-height: 35px;
margin-bottom: 6px;
}
img {
width: 140px;
border: 1px solid #f0f0f0;
border-radius: 3px;
margin-bottom: 5px;
}
......
......@@ -22,7 +22,7 @@ const Guard = (props: any) => {
return (
<div className={styles.base}>
<TitleGet title={'Version 1.5.1'} />
<TitleGet title={'Version 1.5.2'} />
{/* <p>
token:{page.token}
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 { getCookie } from '@/utils/method';
// 新加的根据权限 获取小区的接口
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',
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';
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