Commit 059303cf authored by cellee's avatar cellee

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

parent e349b94b
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-01-30 15:56:31
* @LastEditTime: 2021-02-03 15:41:15
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
......@@ -201,7 +201,7 @@ export default defineConfig({
{ path: './', component: './CommercialService/PropertyServices' },
{ path: './Detail', component: './CommercialService/Detail' },
{ path: './Edit', component: './CommercialService/Detail' },
]
],
},
{
path: './RenovationApplication',
......@@ -226,10 +226,10 @@ export default defineConfig({
path: './ReportOnline',
name: 'reportonline',
routes: [
{ path: "./", component: './CommercialService/PropertyServices' },
{ path: './', component: './CommercialService/PropertyServices' },
{ path: './Detail', component: './CommercialService/Detail' },
{ path: './Edit', component: './CommercialService/Detail' },
]
],
},
{
path: './ShelfLifeService',
......@@ -244,12 +244,12 @@ export default defineConfig({
{ path: './OwnerComplaints/Edit', component: './CommercialService/Detail' },
],
},
{
path: '/OrderManagement',
name: 'ordermanagement',
icon: 'ContainerOutlined',
routes: [{ path: './', component: './OrderManagement/Order' }],
},
// {
// path: '/OrderManagement',
// name: 'ordermanagement',
// icon: 'ContainerOutlined',
// routes: [{ path: './', component: './OrderManagement/Order' }],
// },
{
path: '/ContractManagement',
name: 'contractmanagement',
......
......@@ -74,6 +74,7 @@ class SelectOptions extends React.PureComponent {
flag: false,
lastValue: null,
};
console.log(this.state);
} else {
this.state = {
menuList: ArrayToPingYin.get(list),
......@@ -102,13 +103,13 @@ class SelectOptions extends React.PureComponent {
componentDidUpdate(prevProps) {
if (this.props.show != null) {
if (this.props.show == this.state.flag) {
console.log(this.props.show);
// console.log(this.props.show);
if (this.props.show == false) {
this.setState({ componetVisible: this.state.selectoptionsOpen, flag: true });
} else {
this.setState({ componetVisible: this.state.selectoptionsPutItAway, flag: false });
}
console.log(this.state.componetVisible);
// console.log(this.state.componetVisible);
}
// if (this.props.list.length > this.state.checkedList.length) {
// }
......
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2020-12-04 17:24:27
* @LastEditTime: 2021-02-03 17:43:00
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\models\CommunityManagement\VisitorRecord.ts
......@@ -54,9 +54,8 @@ export default {
{
// 总数据
let Data = resp.data.rows;
let DataSave = resp.data.rows;
console.log('??');
yield put({ type: 'returnPage', Data });
yield put({ type: 'returnDataSave', DataSave });
}
break;
}
......
......@@ -389,7 +389,7 @@ const Account = (props: any) => {
const AccountProps = (state: any) => {
const { Data, DataSave, DataSaveDetail, Result, SubResult, Info } = state.Account;
const loading = state.loading.models.Account || false;
const loading = state.loading.global;
const { user } = state;
return {
Data,
......
......@@ -673,8 +673,9 @@ const Account = (props: any) => {
};
const AccountProps = (state: any) => {
console.log(state.loading);
const { Data, DataSave, DataSaveDetail, Result, SubResult, Permission, Info } = state.Account;
const loading = state.loading.models.Account || false;
const loading = state.loading.global;
const { user } = state;
return {
Data,
......
......@@ -17,9 +17,9 @@ const VisitorRecord = (props: any) => {
// 新增搜索的时间 原来时间是时间戳格式
useEffect(() => {
if (Data != null && CommunityList != null) {
Data.forEach((item: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
});
// Data.forEach((item: any) => {
// item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
// });
} else {
RA(26, { communityNames: CommunityList }, module, dispatch);
}
......@@ -50,7 +50,7 @@ const VisitorRecord = (props: any) => {
// 分页
const pagination: any = {
defaultCurrent: 1,
total: Data != null ? Data.length : 0,
// total: Data != null ? Data.length : 0,
defaultPageSize: 15,
showSizeChanger: false,
showTitle: false,
......@@ -73,116 +73,16 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const onSubmitForm = (value: any) => {
// 小区更换为数组
// value.visitorCommunity = value.community.value;
let visitorCommunity = value.community.value;
delete value.community;
if (value.showTime) {
value.showTime = moment(value.showTime).format('YYYY-MM-DD');
}
// 有的话需要先转换 否则会被清除
// 清除 undefind
let info = JSON.parse(stringifyNoEmptyField(value));
if (info.showTime) {
info.showTime = moment(info.showTime).format('YYYY-MM-DD');
}
// 所有字符串条件检索出来的结果
let Datas = filter(info, DataSave);
let newArr = [];
// 开始数组处理
if (visitorCommunity.length > 0) {
for (let i in Datas) {
if (visitorCommunity.indexOf(Datas[i].visitorCommunity) != -1) {
newArr.push(Datas[i]);
}
}
} else {
// 没有选小区
newArr = Datas;
}
SA(newArr, module, dispatch);
console.log(value);
let obj = {
communityNames: value.community.value,
inviterName: value.inviterName ? value.inviterName : '',
showTime: value.showTime ? moment(value.showTime).format('YYYY-MM-DD') : '',
};
// 点击重置
const onResetFrom = () => {
form.resetFields();
onReset();
};
// 刷新
const onReset = () => {
SA(DataSave, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
SA(obj, module, dispatch);
RA(26, obj, module, dispatch);
};
// 去掉null undefined 无效字段
function removeEmptyField(obj: any) {
var newObj = {};
if (typeof obj == 'string') {
obj = JSON.parse(obj);
}
if (obj instanceof Array) {
newObj = [];
}
if (obj instanceof Object) {
for (var attr in obj) {
if (
obj.hasOwnProperty(attr) &&
obj[attr] !== '' &&
obj[attr] !== null &&
obj[attr] !== undefined
) {
if (obj[attr] instanceof Object) {
newObj[attr] = removeEmptyField(obj[attr]);
} else if (
typeof obj[attr] == 'string' &&
((obj[attr].indexOf('{') > -1 && obj[attr].indexOf('}') > -1) ||
(obj[attr].indexOf('[') > -1 && obj[attr].indexOf(']') > -1))
) {
try {
var attrObj = JSON.parse(obj[attr]);
if (attrObj instanceof Object) {
newObj[attr] = removeEmptyField(attrObj);
}
} catch (e) {
newObj[attr] = obj[attr];
}
} else {
newObj[attr] = obj[attr];
}
}
}
}
return newObj;
}
function stringifyNoEmptyField(obj: any) {
var newObj = removeEmptyField(obj);
for (var attr in newObj) {
if (newObj.hasOwnProperty(attr) && newObj[attr] instanceof Array) {
newObj[attr] = JSON.stringify(newObj[attr]);
}
}
return JSON.stringify(newObj);
}
// 选择小区名字并赋值
// const opname = (value: any) => {
// form.setFieldsValue({
// visitorCommunity: value,
// });
// };
return (
<>
<div className="VisitorRecord">
......@@ -210,16 +110,6 @@ const VisitorRecord = (props: any) => {
<Button type="primary" htmlType="submit" icon={<SearchOutlined />} loading={loading}>
Search{' '}
</Button>
{/* <Button
htmlType="button"
onClick={onReset}
style={{ marginLeft: '15px' }}
icon={<ClearOutlined />}
loading={loading}
>
{' '}
Reset
</Button> */}
</Form.Item>
<div style={{ marginTop: 24, marginRight: -16, width: 'calc(100% + 16px)' }}>
<Form.Item name="community" label="">
......@@ -232,20 +122,14 @@ const VisitorRecord = (props: any) => {
<ProTable
loading={loading}
rowKey="id"
dataSource={Data != null ? Data : ''}
dataSource={Data != null ? Data.rows : ''}
columns={columns}
pagination={pagination}
// pagination={{ current: 1, total: Data.total}}
search={false}
toolBarRender={false}
options={{
density: false,
fullScreen: false,
reload: false,
setting: false,
}}
headerTitle="Visitor List"
onReset={onResetFrom}
// onReset={onResetFrom}
onSubmit={onSubmitForm}
/>
</div>
......
......@@ -17,9 +17,9 @@ const VisitorRecord = (props: any) => {
// 新增搜索的时间 原来时间是时间戳格式
useEffect(() => {
if (Data != null && CommunityList != null) {
Data.forEach((item: any) => {
item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
});
// Data.forEach((item: any) => {
// item.showTime = moment(item.updateTime).format('YYYY-MM-DD');
// });
} else {
RA(26, { communityNames: CommunityList }, module, dispatch);
}
......@@ -50,7 +50,7 @@ const VisitorRecord = (props: any) => {
// 分页
const pagination: any = {
defaultCurrent: 1,
total: Data != null ? Data.length : 0,
// total: Data != null ? Data.length : 0,
defaultPageSize: 15,
showSizeChanger: false,
showTitle: false,
......@@ -73,116 +73,16 @@ const VisitorRecord = (props: any) => {
// 点击搜索
const onSubmitForm = (value: any) => {
// 小区更换为数组
// value.visitorCommunity = value.community.value;
let visitorCommunity = value.community.value;
delete value.community;
if (value.showTime) {
value.showTime = moment(value.showTime).format('YYYY-MM-DD');
}
// 有的话需要先转换 否则会被清除
// 清除 undefind
let info = JSON.parse(stringifyNoEmptyField(value));
if (info.showTime) {
info.showTime = moment(info.showTime).format('YYYY-MM-DD');
}
// 所有字符串条件检索出来的结果
let Datas = filter(info, DataSave);
let newArr = [];
// 开始数组处理
if (visitorCommunity.length > 0) {
for (let i in Datas) {
if (visitorCommunity.indexOf(Datas[i].visitorCommunity) != -1) {
newArr.push(Datas[i]);
}
}
} else {
// 没有选小区
newArr = Datas;
}
SA(newArr, module, dispatch);
console.log(value);
let obj = {
communityNames: value.community.value,
inviterName: value.inviterName ? value.inviterName : '',
showTime: value.showTime ? moment(value.showTime).format('YYYY-MM-DD') : '',
};
// 点击重置
const onResetFrom = () => {
form.resetFields();
onReset();
};
// 刷新
const onReset = () => {
SA(DataSave, module, dispatch);
RA(
26,
{ communityNames: JSON.parse(localStorage.getItem('CommunityList') as any) },
module,
dispatch,
);
SA(obj, module, dispatch);
RA(26, obj, module, dispatch);
};
// 去掉null undefined 无效字段
function removeEmptyField(obj: any) {
var newObj = {};
if (typeof obj == 'string') {
obj = JSON.parse(obj);
}
if (obj instanceof Array) {
newObj = [];
}
if (obj instanceof Object) {
for (var attr in obj) {
if (
obj.hasOwnProperty(attr) &&
obj[attr] !== '' &&
obj[attr] !== null &&
obj[attr] !== undefined
) {
if (obj[attr] instanceof Object) {
newObj[attr] = removeEmptyField(obj[attr]);
} else if (
typeof obj[attr] == 'string' &&
((obj[attr].indexOf('{') > -1 && obj[attr].indexOf('}') > -1) ||
(obj[attr].indexOf('[') > -1 && obj[attr].indexOf(']') > -1))
) {
try {
var attrObj = JSON.parse(obj[attr]);
if (attrObj instanceof Object) {
newObj[attr] = removeEmptyField(attrObj);
}
} catch (e) {
newObj[attr] = obj[attr];
}
} else {
newObj[attr] = obj[attr];
}
}
}
}
return newObj;
}
function stringifyNoEmptyField(obj: any) {
var newObj = removeEmptyField(obj);
for (var attr in newObj) {
if (newObj.hasOwnProperty(attr) && newObj[attr] instanceof Array) {
newObj[attr] = JSON.stringify(newObj[attr]);
}
}
return JSON.stringify(newObj);
}
// 选择小区名字并赋值
// const opname = (value: any) => {
// form.setFieldsValue({
// visitorCommunity: value,
// });
// };
return (
<>
<div className="VisitorRecord">
......@@ -210,16 +110,6 @@ const VisitorRecord = (props: any) => {
<Button type="primary" htmlType="submit" icon={<SearchOutlined />} loading={loading}>
Search{' '}
</Button>
{/* <Button
htmlType="button"
onClick={onReset}
style={{ marginLeft: '15px' }}
icon={<ClearOutlined />}
loading={loading}
>
{' '}
Reset
</Button> */}
</Form.Item>
<div style={{ marginTop: 24, marginRight: -16, width: 'calc(100% + 16px)' }}>
<Form.Item name="community" label="">
......@@ -232,20 +122,14 @@ const VisitorRecord = (props: any) => {
<ProTable
loading={loading}
rowKey="id"
dataSource={Data != null ? Data : ''}
dataSource={Data != null ? Data.rows : ''}
columns={columns}
pagination={pagination}
// pagination={{ current: 1, total: Data.total}}
search={false}
toolBarRender={false}
options={{
density: false,
fullScreen: false,
reload: false,
setting: false,
}}
headerTitle="Visitor List"
onReset={onResetFrom}
// onReset={onResetFrom}
onSubmit={onSubmitForm}
/>
</div>
......
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