Commit 41c626d6 authored by maple's avatar maple Committed by MrShi

[fix]小区设施模块

(cherry picked from commit 2fbb5d5b)
parent acb73afb
...@@ -253,8 +253,7 @@ export default defineConfig({ ...@@ -253,8 +253,7 @@ export default defineConfig({
{ {
path: '/AccountManagement', path: '/AccountManagement',
name: 'accountmanagement', name: 'accountmanagement',
icon: 'UserSwitchOutlined', icon: 'UserSwitchOutlined',
authority: 'admin',
routes: [ routes: [
/* { /* {
path: './AccountManagement', path: './AccountManagement',
......
...@@ -22,17 +22,14 @@ const Picture = (props:any) => { ...@@ -22,17 +22,14 @@ const Picture = (props:any) => {
useEffect(() => { useEffect(() => {
var tmp = props.defaultValue var tmp = props.defaultValue
console.log(tmp)
var checkFlag=false var checkFlag=false
if (tmp != null) { if (tmp != null) {
tmp.map((item, index) => { tmp.map((item, index) => {
if (item.name == null) { if (item.name == null||item.pic==null) {
checkFlag=true checkFlag=true
} }
}) })
if (!checkFlag) { if (!checkFlag) {
// console.log("picture")
// console.log(tmp)
setFileList(tmp) setFileList(tmp)
} }
...@@ -60,6 +57,10 @@ const Picture = (props:any) => { ...@@ -60,6 +57,10 @@ const Picture = (props:any) => {
props.onSubmit(file.name) props.onSubmit(file.name)
} }
} }
const handleRemove = (file: any) => {
// props.onSubmit(file.name)
props.onDelete(file.name)
}
const beforeUpload=( file:any) => { const beforeUpload=( file:any) => {
if (file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg') { if (file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg') {
return true return true
...@@ -83,7 +84,11 @@ const Picture = (props:any) => { ...@@ -83,7 +84,11 @@ const Picture = (props:any) => {
data={props.data} data={props.data}
fileList={fileList} fileList={fileList}
onPreview={handlePreview} onChange={handleChange} disabled={props.disabled} beforeUpload={beforeUpload}> onPreview={handlePreview}
onChange={handleChange}
onRemove={handleRemove}
disabled={props.disabled}
beforeUpload={beforeUpload}>
{fileList.length >= 1 ? null : uploadButton} {fileList.length >= 1 ? null : uploadButton}
</Upload> </Upload>
) )
......
...@@ -11,17 +11,18 @@ import Picture from './Picture'; ...@@ -11,17 +11,18 @@ import Picture from './Picture';
import { getUrlPicName } from '../../utils/string'; import { getUrlPicName } from '../../utils/string';
const PictureOptions = (props:any) => { const PictureOptions = (props:any) => {
const { value, onChange }=props const { value, onChange } = props
const [rowkey,setRoKey]=useState(0)
const [fileList, setFileList] = useState([]) const [fileList, setFileList] = useState([])
const [fileListLen, setFileListLen] = useState(0) const [fileListLen, setFileListLen] = useState(0)
const add = () => { const add = () => {
setFileListLen(fileListLen + 1) setFileListLen(fileListLen + 1)
setFileList(fileList => ([...fileList, {index:fileListLen + 1,name:null,pic:null}])) setFileList(fileList => ([...fileList, { uid:fileListLen + 1 ,index: fileListLen + 1, name: null, pic: null }]))
} }
useEffect(() => { useEffect(() => {
var tmp = value var tmp = value
if (tmp != null&&tmp.length>0&&(typeof tmp[0])=="object") { if (tmp != null&&tmp.length>0&&(typeof tmp[0])=="object") {
console.log("图片默认值") console.log("图片集合使用默认值")
console.log(tmp) console.log(tmp)
var initArray = new Array() var initArray = new Array()
tmp.map((item: any, index: any) => { tmp.map((item: any, index: any) => {
...@@ -36,8 +37,10 @@ const PictureOptions = (props:any) => { ...@@ -36,8 +37,10 @@ const PictureOptions = (props:any) => {
uid: index, uid: index,
status:"Done"}) status:"Done"})
}) })
console.log(initArray)
setFileList(initArray) setFileList(initArray)
setFileListLen(initArray.length + 1) setFileListLen(initArray.length + 1)
onChange( CheckParm(initArray))
} }
}, [value]) }, [value])
...@@ -60,10 +63,23 @@ const PictureOptions = (props:any) => { ...@@ -60,10 +63,23 @@ const PictureOptions = (props:any) => {
return tmp return tmp
} }
const PictureName=(index: any,values:any) => { const DeletePictureName = (index: any, values: any) => {
var tmp = fileList var tmp = fileList
tmp[index].pic = values tmp[index].pic = null
console.log(tmp) console.log(tmp)
setFileList(fileList => ([...tmp]))
console.log( CheckParm(tmp));
onChange( CheckParm(tmp))
}
const PictureName=(index: any,values:any) => {
var tmp = fileList
console.log(fileList)
tmp[index].pic = values
tmp[index].url = null
console.log("图片文件发生改变")
console.log(CheckParm(tmp))
onChange( CheckParm(tmp)) onChange( CheckParm(tmp))
} }
const InputGet = (index: any, e: any) => { const InputGet = (index: any, e: any) => {
...@@ -74,18 +90,19 @@ const PictureOptions = (props:any) => { ...@@ -74,18 +90,19 @@ const PictureOptions = (props:any) => {
tmp[index].name = e.target.value tmp[index].name = e.target.value
} }
console.log(tmp) console.log(tmp)
console.log(CheckParm(tmp));
onChange(CheckParm(tmp)) onChange(CheckParm(tmp))
} }
return ( return (
<div> <div>
{ {
fileList.map((item, index) => { fileList.map((item, index) => {
console.log(index)
console.log(item)
return ( return (
<Row key={item.index}> <Row key={item.index}>
<Col><Picture onSubmit={PictureName.bind(this, index)} data={props.data} defaultValue={[item]} disabled={props.disabled}/></Col> <Col><Picture onSubmit={PictureName.bind(this, index)} onDelete={DeletePictureName.bind(this, index)} data={props.data} defaultValue={item.url!=null? [item]:null} disabled={props.disabled} /></Col>
{/* defaultValue={[item]} */}
<Col> <Col>
<Row><Input placeholder={"Facility Name"} onChange={InputGet.bind(this, index)} defaultValue={item.name} disabled={props.disabled}/></Row> <Row><Input placeholder={"Facility Name"} onChange={InputGet.bind(this, index)} defaultValue={item.name} disabled={props.disabled}/></Row>
{ {
......
...@@ -32,28 +32,72 @@ const PictureOptionsRow = (props: any) => { ...@@ -32,28 +32,72 @@ const PictureOptionsRow = (props: any) => {
const handleCancel = () => setPreviewVisible(false); const handleCancel = () => setPreviewVisible(false);
useEffect(() => { useEffect(() => {
console.log("是否刷新")
console.log(value);
if (value!=null) { if (value!=null) {
var tmp = value var tmp = value
var result = new Array() var result = new Array()
var resultToInside = new Array() var resultToInside = new Array()
console.log("组件"); if (tmp.length > 0 && typeof (tmp[0]) != "string") {//输入输出
console.log(tmp); tmp.map((item: any, index: any) => {
if (item.name == null) {
item.name = getUrlPicName(item.url)
item.uid = index
}
result.push(item)
resultToInside.push(item.name)
})
setFileList(result)
console.log("图片集最初组件");
console.log(resultToInside);
onChange(resultToInside)
}
}
}, [value])
useEffect(() => {
if (props.disabled) {
if (props.defaultValue != null) {
var tmp = props.defaultValue
var result = new Array()
var resultToInside = new Array()
console.log("组件");
console.log(tmp);
tmp.map((item:any, index:any) => { tmp.map((item: any, index: any) => {
if (item.name == null) { if (item.name == null) {
item.name = getUrlPicName(item.url) item.name = getUrlPicName(item.url)
item.uid=index item.uid = index
} }
result.push(item) result.push(item)
resultToInside.push(item.name) resultToInside.push(item.name)
}) })
setFileList(result) setFileList(result)
onChange(resultToInside) }
} }
}, []) }, [props.defaultValue])
// useEffect(() => {
// if (props.disabled) {
// if (value != null) {
// var tmp = value
// var result = new Array()
// var resultToInside = new Array()
// console.log("图片集使用表单组件");
// console.log(tmp)
// if (tmp.url != null) {
// tmp.map((item: any, index: any) => {
// if (item.name == null) {
// item.name = getUrlPicName(item.url)
// item.uid = index
// }
// result.push(item)
// resultToInside.push(item.name)
// })
// setFileList(result)
// }
// }
// }
// }, [value])
const handlePreview = async file => { const handlePreview = async file => {
if (!file.url && !file.preview) { if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj); file.preview = await getBase64(file.originFileObj);
...@@ -63,13 +107,15 @@ const PictureOptionsRow = (props: any) => { ...@@ -63,13 +107,15 @@ const PictureOptionsRow = (props: any) => {
} }
const handleChange = ({ file, fileList }) => { const handleChange = ({ file, fileList }) => {
console.log(fileList);
let tmp=fileList let tmp = fileList
setFileList(tmp.filter(file => !!file.status)) setFileList(tmp.filter(file => !!file.status||file.status==null))
var result=new Array() var result=new Array()
fileList.map((item, index) => { fileList.map((item, index) => {
result.push(item.name) result.push(item.name)
}) })
console.log("该过程图片发生改变");
onChange(result) onChange(result)
} }
const beforeUpload=( file:any) => { const beforeUpload=( file:any) => {
......
import React from 'react';
const TimeSelect2 = (props:any) => {
return (
<>
<div className={styles.item}>{props.title}</div>
</>
);
};
export default TimeSelect2;
import React from 'react'; import React, { useEffect }from 'react';
import styles from './index.less'; import styles from './index.less';
import { Tree } from 'antd'; import { Tree } from 'antd';
// const treeData = [
// {
// title: 'LIFE用户管理',
// key: 'A',
// children: [
// {title: '查看LIFE用户',key: '2'},
// { title: '编辑LIFE用户', key: '3' },
// { title: '添加业主档案', key: '4' },
// {title: '注销业主档案',key: '5'},
// ],
// },
// { title: '数据中心', key: '1' },
// {
// title: '服务商管理',
// key: 'B',
// children: [
// {title: '查看服务商',key: '6'},
// { title: '编辑服务商', key: '7' },
// { title: '添加服务商', key: '8' },
// {title: '注销服务商',key: '9'},
// ],
// },
// {
// title: '物业费管理',
// key: 'C',
// children: [
// {title: '查看物业费记录',key: '10'},
// { title: '添加物业费记录', key: '11' },
// ],
// },
// {
// title: '物业管理', w
// key: 'D',
// children: [
// {title: '查看物业服务',key: '12'},
// { title: '编辑物业服务', key: '13' },
// { title: '注销物业服务', key: '14' },
// ],
// },
// {
// title: '订单管理',
// key: 'E',
// children: [
// {title: '查看订单',key: '15'},
// { title: '编辑订单', key: '16' },
// ],
// },
// {
// title: '合同管理',
// key: 'F',
// children: [
// {title: '查看合同',key: '17'},
// { title: '编辑合同', key: '18' },
// { title: '添加合同', key: '19'},
// ],
// },
// {
// title: '小区管理',
// key: 'G',
// children: [
// {title: '查看小区',key: '20'},
// { title: '编辑小区', key: '21' },
// { title: '添加小区', key: '22' },
// ],
// },
// { title: '访客记录', key: '26' },
// {
// title: '预订设施',
// key: 'H',
// children: [
// {title: '查看预定服务',key: '27'},
// { title: '编辑预定服务', key: '28' },
// { title: '添加预定服务', key: '29' },
// ],
// },
// {
// title: '后台管理',
// key: 'I',
// children: [
// {title: '查看后台账号',key: '30'},
// { title: '配置后台账号', key: '31' },
// ],
// },
// ];
const treeData = [ const treeData = [
{ {
title: 'LIFE用户管理', title: 'Life user management',
key: 'A', key: 'A',
children: [ children: [
{title: '查看LIFE用户',key: '2'}, {title: 'View life users',key: '2'},
{ title: '编辑LIFE用户', key: '3' }, { title: 'Edit life user', key: '3' },
{ title: '添加业主档案', key: '4' }, { title: 'Add owner file', key: '4' },
{title: '注销业主档案',key: '5'}, {title: 'Cancellation of owner files',key: '5'},
], ],
}, },
{ title: '数据中心', key: '1' }, { title: 'Data center', key: '1' },
{ {
title: '服务商管理', title: 'Service provider management',
key: 'B', key: 'B',
children: [ children: [
{title: '查看服务商',key: '6'}, {title: 'View service provider',key: '6'},
{ title: '编辑服务商', key: '7' }, { title: 'Editorial service provider', key: '7' },
{ title: '添加服务商', key: '8' }, { title: 'Add service provider', key: '8' },
{title: '注销服务商',key: '9'}, {title: 'Cancellation of service provider',key: '9'},
], ],
}, },
{ {
title: '物业费管理', title: 'Property management',
key: 'C', key: 'C',
children: [ children: [
{title: '查看物业费记录',key: '10'}, {title: 'View property fee records',key: '10'},
{ title: '添加物业费记录', key: '11' }, { title: 'Add property fee record', key: '11' },
], ],
}, },
{ {
title: '物业管理', title: 'Estate management',
key: 'D', key: 'D',
children: [ children: [
{title: '查看物业服务',key: '12'}, {title: 'View property services',key: '12'},
{ title: '编辑物业服务', key: '13' }, { title: 'Edit property services', key: '13' },
{ title: '注销物业服务', key: '14' }, { title: 'Cancellation of property services', key: '14' },
], ],
}, },
{ {
title: '订单管理', title: 'Order management',
key: 'E', key: 'E',
children: [ children: [
{title: '查看订单',key: '15'}, {title: 'View order',key: '15'},
{ title: '编辑订单', key: '16' }, { title: 'Edit order', key: '16' },
], ],
}, },
{ {
title: '合同管理', title: 'Contract management',
key: 'F', key: 'F',
children: [ children: [
{title: '查看合同',key: '17'}, {title: 'View contract',key: '17'},
{ title: '编辑合同', key: '18' }, { title: 'Edit contract', key: '18' },
{ title: '添加合同', key: '19'}, { title: 'Add contract', key: '19'},
], ],
}, },
{ {
title: '小区管理', title: 'Community management',
key: 'G', key: 'G',
children: [ children: [
{title: '查看小区',key: '20'}, {title: 'View community',key: '20'},
{ title: '编辑小区', key: '21' }, { title: 'Edit community', key: '21' },
{ title: '添加小区', key: '22' }, { title: 'Add cell', key: '22' },
], ],
}, },
{ title: '访客记录', key: '26' }, { title: 'Visitor record', key: '26' },
{ {
title: '预订设施', title: 'Booking facilities',
key: 'H', key: 'H',
children: [ children: [
{title: '查看预定服务',key: '27'}, {title: 'View booking services',key: '27'},
{ title: '编辑预定服务', key: '28' }, { title: 'Edit booking service', key: '28' },
{ title: '添加预定服务', key: '29' }, { title: 'Add booking service', key: '29' },
], ],
}, },
{ {
title: '后台管理', title: 'Back-stage management',
key: 'I', key: 'I',
children: [ children: [
{title: '查看后台账号',key: '30'}, {title: 'View background account',key: '30'},
{ title: '配置后台账号', key: '31' }, { title: 'Configure background account', key: '31' },
], ],
}, },
]; ];
const TreeAction = (props:any) => { const TreeAction = (props:any) => {
const {value,onChange}=props 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);
}; };
useEffect(()=>{
onChange([
'2', '3', '4', '5', '1',
'6', '7', '8', '9', '10',
'11', '12', '13', '14', '15',
'16', '17', '18', '19', '20',
'21', '22', '26', '27', '28',
'29', '30', '31'
])
},[])
const onCheck = (checkedKeys:any, info:any) => { const onCheck = (checkedKeys:any, info:any) => {
const checklist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'] const checklist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
var array=new Array() var array=new Array()
......
...@@ -102,11 +102,13 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -102,11 +102,13 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
useEffect(() => { useEffect(() => {
if (dispatch) { if (dispatch) {
console.log("Maple")
dispatch({ dispatch({
type: 'user/fetchCurrent', type: 'user/fetchCurrent',
playload: { playload: {
userName: "admin", userName: "admin",
password:"admin",} password: "admin",
}
}); });
} }
}, []); }, []);
......
...@@ -32,13 +32,13 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -32,13 +32,13 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// console.log("安全登录中") // console.log("安全登录中")
// console.log(login) // console.log(login)
if (dispatch) { if (dispatch) {
dispatch({ // dispatch({
type: 'user/fetchCurrent', // type: 'user/fetchCurrent',
playload: { // playload: {
userName: login.userName, // userName: login.userName,
password: login.password // password: login.password
} // }
}); // });
} }
} }
......
import * as service from '../services/tos';
import { message } from 'antd';
import { routerRedux } from 'dva/router'
export default {
namespace: 'AccountManagement',
state: {
Data: null,
CurData:'',
},
reducers: {
returnData(state, { Data }) {
return { ...state, Data };
},
},
effects: {
//获取管理列表
*TosUserGetAllInfrom({ playload }, { call, put }) {
console.log(playload)
const resp = yield call(service.TosUserGetAllInfrom, playload);
console.log(resp)
let Data = resp.data.rows;
yield put({ type: 'returnData', Data, });
},
},
};
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'Account',
state: {
Data: null,
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 41: {
// let Data = resp.data;
// yield put({ type: 'returnPage', Data });
} break;
case 42: {
history.go(-1)
} break;
case 45: {
let Data = resp;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
...@@ -5,6 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -5,6 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router'
import {Fromate} from '@/utils/method' import {Fromate} from '@/utils/method'
import { timeToMoment } from '@/utils/time';
export default { export default {
namespace: 'FacilityBookings', namespace: 'FacilityBookings',
state: { state: {
...@@ -62,7 +63,6 @@ export default { ...@@ -62,7 +63,6 @@ export default {
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp)
console.log(playload)
if (resp.code == 500||resp.error_code!="0000") { if (resp.code == 500||resp.error_code!="0000") {
// window.location.href = '/500'; // window.location.href = '/500';
} }
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
canReservationDay: tmp.canReservationDay, canReservationDay: tmp.canReservationDay,
canReservationNum: tmp.canReservationNum, canReservationNum: tmp.canReservationNum,
cancelReservationDay: tmp.cancelReservationDay, cancelReservationDay: tmp.cancelReservationDay,
categoriesOpenTime: tmp.categoriesOpenTime, categoriesOpenTime: timeToMoment(tmp.categoriesOpenTime),
communityManagerFee: tmp.communityManagerFee, communityManagerFee: tmp.communityManagerFee,
communityMargin: tmp.communityMargin, communityMargin: tmp.communityMargin,
communityName: tmp.communityName, communityName: tmp.communityName,
...@@ -132,9 +132,7 @@ export default { ...@@ -132,9 +132,7 @@ export default {
categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2) categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2)
} }
console.log(sourceData) console.log(sourceData)
console.log(tmp.facilitiesImageList)
console.log(Fromate(tmp.facilitiesImageList,reg2))
console.log("##############################")
yield put({ type: 'returnSource', sourceData }); yield put({ type: 'returnSource', sourceData });
} break; } break;
case 8: { case 8: {
......
...@@ -7,7 +7,7 @@ import { routerRedux } from 'dva/router' ...@@ -7,7 +7,7 @@ import { routerRedux } from 'dva/router'
export default { export default {
namespace: 'User', namespace: 'User',
state: { state: {
Data: {data:[],total:0}, Data: null,
DataPage:{totalRow:0}, DataPage:{totalRow:0},
Data3Error: null, Data3Error: null,
DataSave: null, DataSave: null,
...@@ -61,7 +61,6 @@ export default { ...@@ -61,7 +61,6 @@ export default {
effects: { effects: {
//预订设施查询
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
switch (playload.index) { switch (playload.index) {
...@@ -109,7 +108,7 @@ export default { ...@@ -109,7 +108,7 @@ export default {
switch (playload.index) { switch (playload.index) {
case 12:{ case 12:{
let Data = resp.data; let Data = resp;
yield put({ type: 'returnPage', Data}); yield put({ type: 'returnPage', Data});
} break; } break;
case 18: case 18:
......
...@@ -92,6 +92,7 @@ const Model: LoginModelType = { ...@@ -92,6 +92,7 @@ const Model: LoginModelType = {
} }
history.replace(redirect || '/'); history.replace(redirect || '/');
} else { } else {
console.error(response)
message.error("Login Error! Username or Password is wrong!",3) message.error("Login Error! Username or Password is wrong!",3)
} }
}, },
......
...@@ -38,16 +38,20 @@ const UserModel: UserModelType = { ...@@ -38,16 +38,20 @@ const UserModel: UserModelType = {
}, },
effects: { effects: {
*fetch(_, { call, put }) { *fetch(_, { call, put }) {
const response = yield call(queryUsers); const response = yield call(queryUsers);
console.error(response)
yield put({ yield put({
type: 'save', type: 'save',
payload: response, payload: response,
}); });
}, },
*fetchCurrent({playload}, { call, put }) { *fetchCurrent({ playload }, { call, put }) {
console.log("response")
const response = yield call(queryCurrent,playload); const response = yield call(queryCurrent,playload);
// console.log(response) console.log(response)
yield put({ yield put({
type: 'saveCurrentUser', type: 'saveCurrentUser',
payload: response, payload: response,
......
...@@ -7,24 +7,67 @@ import { Link, useIntl, connect, Dispatch,history } from 'umi'; ...@@ -7,24 +7,67 @@ import { Link, useIntl, connect, Dispatch,history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index'; import SelectOptions from '../../../components/SelectOptions/index';
import { timestampToTime } from '../../../utils/time'; import { timestampToTime } from '../../../utils/time';
import { filterObjbyTg, RA, urlEncode } from '@/utils/method';
const authorizeLevel = ["Administrator","Secondary Administrator", "Three Level Administrator"]
const user_state = [[0, "enabled"], [1, "Disabled"]]
const module="Account"
const Account = (props: any) => { const Account = (props: any) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const { dispatch, location,Data} = props; const { dispatch, location, Data } = props;
const get = (values:any) => {dispatch({type: 'AccountManagement/TosUserGetAllInfrom',playload:values})};
const formRef = useRef(null);
const [pageNum, setPageNum] = useState(1)
const [loading, setLoading] = useState(false)
const columns = [
{ title: "tosUserName", dataIndex: 'tosUserName', },
{ title: "tosuserLevel", dataIndex: 'tosuserLevel', render: (text: any) => (<Space size="middle">{authorizeLevel[parseInt(text)]}{text}</Space>) },
{ title: "userStatus", dataIndex: 'userStatus', },
{title: "createTime",
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime(record.createTime.time)}</Space>
),
},
{ title: "Actions",
render: (text: any, record: any) => (
<Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space>
),
},
];
useEffect(() => { useEffect(() => {
get({ //分页设置
if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
} else {
setPageNum(1)
}
setLoading(true)
RA(45,{
"id": "", "id": "",
"moment": [], "moment": [],
"name": "", "name": "",
"leaderID": "1", "leaderID": "1",
"userPhone": "" "userPhone": ""
}) },module,dispatch)
}, []); }, [location]);
const formRef = useRef(null); useEffect(() => {
const onFinish = (values: any) => {get(values)}; if (Data != null) {
setLoading(false)
}
}, [Data])
const onFinish = (values: any) => {
console.log(values);
};
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) }; const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
const goToDetail = (values:any,e:any) => { const goToDetail = (values:any,e:any) => {
...@@ -37,36 +80,13 @@ const Account = (props: any) => { ...@@ -37,36 +80,13 @@ const Account = (props: any) => {
history.push(location.pathname + '/Edit?providerName='+values.providerName) history.push(location.pathname + '/Edit?providerName='+values.providerName)
} }
const pageChange = (values: any) => {
/*页面跳转*/
const pagination={defaultCurrent:1,total: 16} var tmp = filterObjbyTg(location.query, [])
/* tmp["current"]=values.current
账号名称 tosUserName history.push(location.pathname + urlEncode(tmp))
等级 tosuserLevel
状态 userStatus
创建者
创建时间 createTime
*/
const columns = [
{ title: "tosUserName", dataIndex: 'tosUserName', },
{ title: "tosuserLevel", dataIndex: 'tosuserLevel', },
{ title: "userStatus", dataIndex: 'userStatus', },
{title: "createTime",
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime(record.createTime.time)}</Space>
),
},
{ title: "Actions",
render: (text: any, record: any) => (
<Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space>
),
},
];
const dataSource = (values:any) => {
let tmp = values;
return tmp;
} }
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
...@@ -84,7 +104,15 @@ const Account = (props: any) => { ...@@ -84,7 +104,15 @@ const Account = (props: any) => {
</div> </div>
{/* 列表组件 */} {/* 列表组件 */}
<Table size="small" rowKey={"id"} style={{ marginTop: 16 }} columns={columns} dataSource={Data!=null?dataSource(Data):null} pagination={pagination} /> <Table size="small"
rowKey={"id"}
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={Data != null ? Data.data.rows : null}
pagination={Data != null ? { current: pageNum, total: Data.data.rows.length } : {}}
onChange={pageChange}
/>
</div> </div>
...@@ -92,8 +120,7 @@ const Account = (props: any) => { ...@@ -92,8 +120,7 @@ const Account = (props: any) => {
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { Data } = state.AccountManagement; const { Data } = state.Account;
console.log(Data)
return { return {
Data, Data,
}; };
......
...@@ -11,24 +11,49 @@ import TreeAction from '../../../components/TreeAction/TreeAction'; ...@@ -11,24 +11,49 @@ import TreeAction from '../../../components/TreeAction/TreeAction';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SelectCommunity from '@/components/SelectCommunity'; import SelectCommunity from '@/components/SelectCommunity';
import Line from '@/components/Line/Line'; import Line from '@/components/Line/Line';
import authorize from '@/components/Authorized/Secured';
import { RA, translate } from '@/utils/method';
const printContent = (comment: any)=>{ import { EyeTwoTone, EyeInvisibleOutlined, StarTwoTone } from '@ant-design/icons';
console.log(comment) import { validateMessages } from '@/utils/params';
}
const getTreeActionValues = (comment: any)=>{
console.log(comment)
}
const authorizeLevel = ["Administrator","Secondary Administrator", "Three Level Administrator"]
const user_state=[[0, "enabled"],[1,"Disabled"]]
const module="Account"
const AccountManagement = (props:any) => { const AccountManagement = (props:any) => {
const { dispatch } = props; const { dispatch } = props;
const formRef = useRef(null) const formRef = useRef(null)
const onFinish = (values:any) =>{ const onFinish = (values:any) =>{
console.log(values) console.log(values)
var tmp = {
"id": "null",
"oneself": 0,
"userStatus": 1,
"tosUserName": null,
"tosUserPwd": null,
"tosUserPhone": null,
"tosUserEmail": null,
"tosuserLevel": null,
"tosUserToCompany": "1",
"tosUserServiceCell":"",
}
var tmp2 = {}
translate(tmp,values, [
["tosUserName", "Account"],
["tosUserPwd", "Password"],
["tosUserPhone", "phone"],
["tosUserEmail", "email"],
["tosuserLevel", "tosuserLevel"],
])
translate(tmp2,values, [
["userName", "Account"],
["userPassword", "Password"],
["permissionArray", "premission"],
])
RA(41, tmp, module, dispatch)
RA(42,tmp2,module,dispatch)
} }
return ( return (
<div className={styles.base}> <div className={styles.base}>
...@@ -37,38 +62,45 @@ const AccountManagement = (props:any) => { ...@@ -37,38 +62,45 @@ const AccountManagement = (props:any) => {
<TitleBack title="Admin Account Adding" /> <TitleBack title="Admin Account Adding" />
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<Form.Item name="Account" label="Account"><Input placeholder="account Name" style={{width:120}}/></Form.Item> <Form.Item name="Account" label="Account" rules={[{required:true}]} ><Input placeholder="account Name" style={{width:200}}/></Form.Item>
<Form.Item name="Password" label="Password"><Input placeholder="password" style={{width:120}}/></Form.Item> <Form.Item name="Password" label="Password" rules={[{required:true}]} ><Input.Password type="" placeholder="password" iconRender={visible => (visible ? <EyeTwoTone /> : <EyeInvisibleOutlined />)} style={{width:200}}/></Form.Item>
<Form.Item label="Contact Details"> <Form.Item label="Contact Details" >
<Input.Group compact> <Input.Group compact>
<Form.Item name="phone" style={{marginRight:16}}><Input placeholder="Phone number"></Input></Form.Item> <Form.Item name="phone" style={{marginRight:16}} rules={[{required:true}]}><Input placeholder="Phone number"></Input></Form.Item>
<Form.Item name="email"><Input placeholder="Email"></Input></Form.Item> <Form.Item name="email" rules={[{required:true}]}><Input placeholder="Email" ></Input></Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
<Form.Item name="community" label="Community" ><SelectCommunity ></SelectCommunity></Form.Item> <Form.Item name="community" label="Community" ><SelectCommunity ></SelectCommunity></Form.Item>
<Form.Item label="Level" name="tosuserLevel"> <Form.Item label="Level" name="tosuserLevel" wrapperCol={{ offset: 2}}>
<Select placeholder="Level" style={{ width: 120 }}> <Select placeholder="Level" style={{ width: 240 }}>
<Option value="0">Secondary Administrator</Option> {
<Option value="1">Three Level Administrator</Option> authorizeLevel.map((item, index) => {
<Option value="2">Select All</Option> return <Option key={"" + index} value={"" + index+1}>{item}</Option>
})
}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="premission" label="Permission"> <Form.Item name="premission" label="Permission" wrapperCol={{ offset: 1}}>
<TreeAction onSubmit={getTreeActionValues} /> <TreeAction/>
</Form.Item> </Form.Item>
<Line></Line> <Line></Line>
<Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> </Form>
</div> </div>
); );
}; };
function mapStateToProps(state:any) {
export default AccountManagement; const { Data } = state.Account;
return {
Data
};
}
export default connect(mapStateToProps)(AccountManagement);
...@@ -25,8 +25,6 @@ const Detail = (props:any) => { ...@@ -25,8 +25,6 @@ const Detail = (props:any) => {
const fromRef=useRef(null) const fromRef=useRef(null)
const RA = (index:any,values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) }; const RA = (index:any,values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const setCurDataDetail = () => { dispatch({ type: 'CommunityService/setCurDataDetail' }) };
const [curString, setCurString] = useState({ readyState: false}) const [curString, setCurString] = useState({ readyState: false})
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
...@@ -39,8 +37,6 @@ const Detail = (props:any) => { ...@@ -39,8 +37,6 @@ const Detail = (props:any) => {
"Reply To Report Online", "Reply To Report Online",
"Reply To Problem Feedback"] "Reply To Problem Feedback"]
const [fileList, setfileList] = useState([]);
useEffect(() => { useEffect(() => {
if ((location.pathname).indexOf("/Edit")>-1) { if ((location.pathname).indexOf("/Edit")>-1) {
...@@ -48,15 +44,13 @@ const Detail = (props:any) => { ...@@ -48,15 +44,13 @@ const Detail = (props:any) => {
} else { } else {
setEditorFlag(false) setEditorFlag(false)
} }
console.log("跳转后的URL参数值")
console.log(location)
RA(21,{ RA(21,{
serviceType: location.query.serviceType, serviceType: location.query.serviceType,
id: location.query.id id: location.query.id
}) })
setHeadTitle(headTitles[parseInt(location.query.serviceType)- 1]) setHeadTitle(headTitles[parseInt(location.query.serviceType)- 1])
setLoading({ data: true }) setLoading(true)
},[location.pathname]); },[location.pathname]);
useEffect(() => { useEffect(() => {
...@@ -65,13 +59,10 @@ const Detail = (props:any) => { ...@@ -65,13 +59,10 @@ const Detail = (props:any) => {
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@") console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
console.log(CurDataDetail) console.log(CurDataDetail)
if (!editorFlag) { if (!editorFlag) {
console.log(CurDataDetail.replyImgUrl);
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl } var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl }
console.log(tmp) fromRef.current.setFieldsValue(tmp)
fromRef.current.setFieldsValue(tmp)
} }
setLoading({ data: false }) setLoading(false)
} }
}, [CurDataDetail]) }, [CurDataDetail])
useEffect(()=>{ useEffect(()=>{
...@@ -89,18 +80,10 @@ const Detail = (props:any) => { ...@@ -89,18 +80,10 @@ const Detail = (props:any) => {
val.handleStatus = "1" val.handleStatus = "1"
// val.file=fileList // val.file=fileList
console.log('Success:', val) console.log('Success:', val)
RA(22,val); RA(22, val);
}; setLoading(true)
const onFinishFailed = (errorInfo:any) => {
console.log('Failed:', errorInfo);
}; };
const PictureOptionsRowRef = (values:any) => {
console.log(values)
setfileList(values)
}
const titleProps = { const titleProps = {
sublist: CurDataDetail != null?['Handle Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]:null, sublist: CurDataDetail != null?['Handle Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]:null,
title: headTitle title: headTitle
...@@ -111,7 +94,7 @@ const Detail = (props:any) => { ...@@ -111,7 +94,7 @@ const Detail = (props:any) => {
<div> <div>
{CurDataDetail != null ? {CurDataDetail != null ?
<> <>
<Spin spinning={loading.data}> <Spin spinning={loading}>
<div className={styles.base}> <div className={styles.base}>
<TitleBack {...titleProps} /> <TitleBack {...titleProps} />
...@@ -128,51 +111,52 @@ const Detail = (props:any) => { ...@@ -128,51 +111,52 @@ const Detail = (props:any) => {
<Col><TextArea style={{ width: 394, height: 80,padding:8 }} autoSize={false} disabled value={CurDataDetail.content}/></Col> <Col><TextArea style={{ width: 394, height: 80,padding:8 }} autoSize={false} disabled value={CurDataDetail.content}/></Col>
</Row> </Row>
<Row gutter={16} style={{marginTop:20}}> <Row gutter={16} style={{marginTop:20}}>
<Col>Picture:</Col> <Col span={3}>Picture:</Col>
<Col>{ <Col>{
// CurDataDetail!=null? CurDataDetail!=null?
// <PictureOptionsRow <PictureOptionsRow
// action="/tos/communtiy/service/reply/img" action="/tos/communtiy/service/reply/img"
// disabled={true} putSubmit={PictureOptionsRowRef} disabled={true}
// data={{ defaultValue={CurDataDetail.pictrues}
// userToken: "token", data={{
// imageType: 'tosCommunityImageReply', userToken: "token",
// extends: "", imageType: 'tosCommunityImageReply',
// }} extends: "",
// // defultValue={CurDataDetail.pictrues} }}
// />:null //
/>:null
}</Col> }</Col>
</Row> </Row>
<Line /> <Line />
<Form ref={fromRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} validateMessages={validateMessages}> <Form ref={fromRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
{!editorFlag ? {!editorFlag ?
<Row gutter={16}> <Row gutter={16}>
<Col>Response:</Col> <Col>Response:</Col>
<Col>{getCookie("name")}</Col> <Col span={6}>{getCookie("name")}</Col>
<Col>Contract Detail:</Col> <Col>Contract Detail:</Col>
<Col>{getCookie("phone")}</Col> <Col>{getCookie("phone")}</Col>
</Row> </Row>
: null} : null}
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3.5}>Resolved Complaint:</Col> <Col span={3}>Resolved Complaint:</Col>
<Col ><Form.Item name="replyContent" rules={[{required:true,max:300}]} ><TextArea style={{padding:8, width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col> <Col ><Form.Item name="replyContent" rules={[{required:true,max:300}]} ><TextArea style={{padding:8, width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col>
</Row> </Row>
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16}>
<Col span={3}></Col> <Col span={3}></Col>
<Col > <Col >
{/* putSubmit={PictureOptionsRowRef} */} {/* putSubmit={PictureOptionsRowRef} */}
{ {
CurDataDetail.replyImgUrl != null ? <> CurDataDetail.replyImgUrl != null ? <>
<Form.Item name="file" label="filename" > <Form.Item name="file">
<PictureOptionsRow <PictureOptionsRow
action="/tos/communtiy/service/reply/img" action="/tos/communtiy/service/reply/img"
disabled={!editorFlag} disabled={!editorFlag}
data={{ data={{
userToken: "token", userToken: "token",
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extends: "", extends: "",
}} /> }} />
</Form.Item> </Form.Item>
</>:null </>:null
......
...@@ -8,10 +8,11 @@ import { timestampToTime3 } from '../../utils/time'; ...@@ -8,10 +8,11 @@ import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { query } from 'express';
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"] const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
const handle_Status = [[0,"Untreated"], [1,"Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"] const handle_Status = [[0,"Untreated"], [1,"Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"]
const goToName = ["Reply", "Detail"];
const module="CommunityService" const module="CommunityService"
const PropertyServices = (props: any) => { const PropertyServices = (props: any) => {
...@@ -29,14 +30,11 @@ const PropertyServices = (props: any) => { ...@@ -29,14 +30,11 @@ const PropertyServices = (props: any) => {
{ title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)}, { title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)},
{ title: "Create Time",dataIndex: "create_time",render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>)}, { title: "Create Time",dataIndex: "create_time",render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>)},
{ title: "Handle status", dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle">{handle_Status[text][1]}</Space>)}, { title: "Handle status", dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle">{handle_Status[text][1]}</Space>)},
{ title: "Actions",dataIndex: 'handle_status', { title: "Actions",dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle"><a onClick={goToDetail.bind(this,text,record)}>{goToName[text]}</a></Space>)},
render: (text: any, record: any) => (
<Space size="middle"> <a onClick={goToDetail.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space>
),
},
]; ];
const goToDetail = (value:any, record:any, e:any) => { const goToDetail = (value: any, record: any, e: any) => {
//页面递进
history.push(location.pathname+(value==0?"/Edit":"/Detail")+urlEncode({serviceType: serviceTypeGobal,id: record.id,user_id:record.user_id})) history.push(location.pathname+(value==0?"/Edit":"/Detail")+urlEncode({serviceType: serviceTypeGobal,id: record.id,user_id:record.user_id}))
} }
...@@ -44,13 +42,14 @@ const PropertyServices = (props: any) => { ...@@ -44,13 +42,14 @@ const PropertyServices = (props: any) => {
if (Data != null) {setLoading(false)} if (Data != null) {setLoading(false)}
}, [Data]); }, [Data]);
const ClickTitleSearch = (comment: any)=>{ const ClickTitleSearch = (comment: any) => {
//页面搜索
comment.serviceType = serviceTypeGobal comment.serviceType = serviceTypeGobal
comment.current = 1 comment.current = 1
history.push(location.pathname+urlEncode(filterObj(comment))) history.push(location.pathname+urlEncode(filterObj(comment)))
} }
const PageChange = (values: any) => { //.current const PageChange = (values: any) => { //.current
//页面跳转参数
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"]) var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
tmp["current"]=values.current tmp["current"]=values.current
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp))
...@@ -58,6 +57,7 @@ const PropertyServices = (props: any) => { ...@@ -58,6 +57,7 @@ const PropertyServices = (props: any) => {
useEffect(()=>{ useEffect(()=>{
if (location != null) { if (location != null) {
//细分类:页面指令
var serviceType ="" var serviceType =""
pathname.map((item, index) => { pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) { if ((location.pathname).indexOf(item) > -1) {
...@@ -65,19 +65,21 @@ const PropertyServices = (props: any) => { ...@@ -65,19 +65,21 @@ const PropertyServices = (props: any) => {
setServiceType(serviceType) setServiceType(serviceType)
} }
}) })
//分页设置
if (location.query.current!=null) { if (location.query.current!=null) {
setPageNum(parseInt(location.query.current)) setPageNum(parseInt(location.query.current))
} else { } else {
setPageNum(1) setPageNum(1)
} }
setLoading(true)
//前置数据
console.log("设置大数据"); console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"]) var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
console.log(tmp) tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)] //特殊处理
setReadyData(tmp) setReadyData(tmp)
// var tmp=filterObj(location.query)
// console.log(tmp) //获取数据
setLoading(true)
RA(40, { RA(40, {
serviceType: serviceType, serviceType: serviceType,
handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null, handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
...@@ -121,11 +123,3 @@ function mapStateToProps(state:any) { ...@@ -121,11 +123,3 @@ function mapStateToProps(state:any) {
}; };
} }
export default connect(mapStateToProps)(PropertyServices); export default connect(mapStateToProps)(PropertyServices);
// 26、获取小区服务信息
// http://47.74.233.180:8651/tos/community/service/get
// {
// "serviceType":"1",
// "ownerName":"阿涛暗暗",
// "handleStatus":"1",
// "communityName":"TANGDE2"
// }
\ No newline at end of file
...@@ -11,7 +11,8 @@ import TitleBack from '../../../components/TitleBack/TitleBack'; ...@@ -11,7 +11,8 @@ import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { numberToString } from '../../../utils/string'; import { numberToString } from '../../../utils/string';
import { checkInput } from '@/utils/method'; import { checkData, checkInput } from '@/utils/method';
import { validateMessages } from '@/utils/params';
const Bookings = (props:any) => { const Bookings = (props:any) => {
const { dispatch, Data3,Result,DataSave,token} = props; const { dispatch, Data3,Result,DataSave,token} = props;
...@@ -155,7 +156,7 @@ const Bookings = (props:any) => { ...@@ -155,7 +156,7 @@ const Bookings = (props:any) => {
</div> </div>
{Data3 != null ? {Data3 != null ?
<> <>
<Form ref={formRef} name="basic" onFinish={onFinish} > <Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages} >
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Facility Bookings</div> <div className={styles.box2item1}>Facility Bookings</div>
<div className={styles.box2item2}> <div className={styles.box2item2}>
...@@ -180,18 +181,18 @@ const Bookings = (props:any) => { ...@@ -180,18 +181,18 @@ const Bookings = (props:any) => {
<div className={styles.box3}> <div className={styles.box3}>
<div className={styles.box3item1}>User Name</div> <div className={styles.box3item1}>User Name</div>
<div className={styles.box3item2}><Form.Item name="accountName" ><Input style={{ width: 200 }} onBlur={checkInput} maxLength={30} /></Form.Item></div> <div className={styles.box3item2}><Form.Item name="accountName" rules={[{required:true,min:2,max:30}]} ><Input style={{ width: 200 }} /></Form.Item></div>
<div className={styles.box3item3}>Contact Details</div> <div className={styles.box3item3}>Contact Details</div>
<div className={styles.box3item4}><Form.Item name="accountPhone" ><Input style={{ width: 200 }} /></Form.Item></div> <div className={styles.box3item4}><Form.Item name="accountPhone" rules={[{required:true},{validator: checkData, trigger: 'blur'}]} ><Input style={{ width: 200 }}/></Form.Item></div>
</div> </div>
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Unit</div> <div className={styles.box4item1}>Unit</div>
<div className={styles.box4item2}><Form.Item name="buildNumber" ><Input placeholder="building" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item2}><Form.Item name="buildNumber" rules={[{required:true}]}><Input placeholder="building" style={{ width: 80 }} /></Form.Item></div>
<div className={styles.box4item3}>#</div> <div className={styles.box4item3}>#</div>
<div className={styles.box4item4}><Form.Item name="floorNumber" ><Input placeholder="floor" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item4}><Form.Item name="floorNumber" rules={[{required:true}]}><Input placeholder="floor" style={{ width: 80 }} /></Form.Item></div>
<div className={styles.box4item5}>——</div> <div className={styles.box4item5}>——</div>
<div className={styles.box4item6}><Form.Item name="roomNumber" ><Input placeholder="room" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box4item6}><Form.Item name="roomNumber" rules={[{required:true}]}><Input placeholder="room" style={{ width: 80 }} /></Form.Item></div>
</div> </div>
<div className={styles.line}></div> <div className={styles.line}></div>
...@@ -200,8 +201,8 @@ const Bookings = (props:any) => { ...@@ -200,8 +201,8 @@ const Bookings = (props:any) => {
<div className={styles.box5item1}>Booking Schedule</div> <div className={styles.box5item1}>Booking Schedule</div>
<div className={styles.box5item2}> <div className={styles.box5item2}>
<Row gutter={8}> <Row gutter={8}>
<Col><Form.Item name="subscribeDate" ><DatePicker /></Form.Item></Col> <Col><Form.Item name="subscribeDate" rules={[{required:true}]}><DatePicker /></Form.Item></Col>
<Col><Form.Item name="reservedTimeList" ><RangePicker format={format}/></Form.Item></Col> <Col><Form.Item name="reservedTimeList" rules={[{required:true}]}><RangePicker format={format}/></Form.Item></Col>
</Row> </Row>
</div> </div>
</div> </div>
......
import React, { useState, useEffect,useRef } from 'react'; import React, { useState, useEffect,useRef } from 'react';
import styles from './css/index.less'; import styles from './css/index.less';
import { Input ,InputNumber,Modal,Button,Space,Pagination,Tooltip, Radio, Form,Row, Col,Select, message } from 'antd'; import { Input, TimePicker, Modal, Button, Space, Pagination, Tooltip, Radio, Form, Row, Col, Select, message } from 'antd';
const { RangePicker } = TimePicker;
const { Option } = Select; const { Option } = Select;
import { Link, useIntl, connect, Dispatch,history } from 'umi'; import { Link, useIntl, connect, Dispatch,history } from 'umi';
...@@ -20,7 +21,8 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio ...@@ -20,7 +21,8 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
// reservationQuantumTime: ["09:00-07:00"] // reservationQuantumTime: ["09:00-07:00"]
import { getUrlLast,numberToString } from '../../../utils/string' import { getUrlLast,numberToString } from '../../../utils/string'
import {checkParam} from '@/utils/method' import {checkParam, timeForm} from '@/utils/method'
import { validateMessages } from '@/utils/params';
const Facility = (props:any) => { const Facility = (props:any) => {
...@@ -29,6 +31,8 @@ const Facility = (props:any) => { ...@@ -29,6 +31,8 @@ const Facility = (props:any) => {
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) }; const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' })} const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' })}
const openCheck = true
const [Ref3, setRef3] = useState([]) const [Ref3, setRef3] = useState([])
const [extend, setExtend] = useState(null) const [extend, setExtend] = useState(null)
...@@ -68,7 +72,7 @@ const Facility = (props:any) => { ...@@ -68,7 +72,7 @@ const Facility = (props:any) => {
setTimeExtend(sourceData.reservationQuantumTime) setTimeExtend(sourceData.reservationQuantumTime)
// 中断 // 中断
// setPictrueExtend({tab:null,pic:null,pics:null}) // setPictrueExtend({tab:null,pic:null,pics:null})
console.log("重点检查"); console.log("重点检查");
console.log(sourceData); console.log(sourceData);
formRef.current.setFieldsValue(sourceData) formRef.current.setFieldsValue(sourceData)
...@@ -96,21 +100,23 @@ const Facility = (props:any) => { ...@@ -96,21 +100,23 @@ const Facility = (props:any) => {
} }
},[]) },[])
const TimeSelectRef = (values:any) => { // const TimeSelectRef = (values:any) => {
// console.log(values) // setRef3(values)
setRef3(values) // }
}
const onFinish = (values: any) => { const onFinish = (values: any) => {
var result = values var result = values
if (Ref3.length!=0) { // if (Ref3.length!=0) {
result.reservationQuantumTime = Ref3 // result.reservationQuantumTime = Ref3
} else { // } else {
result.reservationQuantumTime = ["09:00-20:00"] result.reservationQuantumTime = [timeForm(result.categoriesOpenTime, 'HH:mm')]
} var categoriesOpenTime=timeForm(result.categoriesOpenTime,'HH:mm')
result.categoriesOpenTime = "09:00-20:00" result.categoriesOpenTime=categoriesOpenTime
// }
// console.log(timeForm(result.categoriesOpenTime,'HH:mm'))
// result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) { if (result.communityManagerFee == null) {
result.communityManagerFee=numberToString(0) result.communityManagerFee=numberToString(0)
} else { } else {
...@@ -123,28 +129,28 @@ const Facility = (props:any) => { ...@@ -123,28 +129,28 @@ const Facility = (props:any) => {
} }
if (result.canReservationDay <= result.cancelReservationDay || result.canReservationDay <= result.nomarginCancelReservationDay) { if (result.canReservationDay <= result.cancelReservationDay || result.canReservationDay <= result.nomarginCancelReservationDay) {
message.error("can Reservation Day is invaild!", 3) message.error("can Reservation Day is invaild!", 3)
result.canReservationDay=null result.canReservationDay = null
} } else {
console.log('Should be check:', result);
if (checkParam(result)) { console.log('Should be check:', result);
console.log('Success:', result); if (checkParam(result)) {
//中断 //中断
if (pictrueExtend.tab == 3) { if (pictrueExtend.tab == 3) {
if (Result == null) { if (Result == null) {
console.log("提交") console.log("提交")
// RA(6, result); RA(6, result);
} }
} else { } else {
result.id = DataSave.id result.id = DataSave.id
console.log("编辑") console.log("编辑")
console.log(result) if (Result == null) {
if (Result == null) { RA(17, result);
RA(17, result); }
} }
}
}else{message.error("Error,Please finish it,not empty!",3)} } else { message.error("Error,Please finish it,not empty!", 3) }
}
}; };
...@@ -178,33 +184,30 @@ const Facility = (props:any) => { ...@@ -178,33 +184,30 @@ const Facility = (props:any) => {
formRef.current.setFieldsValue(tmp) formRef.current.setFieldsValue(tmp)
} }
const test = () => {
console.log(extend)
}
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + "?Facility=true"} /> <TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + "?Facility=true"} />
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} onValuesChange={onBillChange} > <Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} onValuesChange={onBillChange} validateMessages={validateMessages} >
<Row gutter={32}> <Row gutter={32}>
<Col>所属小区</Col> <Col>Community</Col>
<Col><Form.Item name="communityName" ><SearchOptionsCommnity disabled={pictrueExtend.tab!=3?true:false} /></Form.Item></Col> <Col><Form.Item name="communityName" ><SearchOptionsCommnity disabled={pictrueExtend.tab!=3?true:false} /></Form.Item></Col>
</Row> </Row>
<Row gutter={32} style={{marginTop:28}}> <Row gutter={32} style={{marginTop:28}}>
<Col>设施名称</Col> <Col>Facility</Col>
<Col><Form.Item name="facilityName" ><Input placeholder="Facility Name" disabled={facilityDetail}/></Form.Item></Col> <Col><Form.Item name="facilityName" rules={[{required:openCheck}]}><Input placeholder="Facility Name" disabled={facilityDetail}/></Form.Item></Col>
<Col>费用($)</Col> <Col>Fee($)</Col>
<Col><Form.Item name="communityManagerFee" ><Input onKeyUp={keyup_communityManagerFee} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col> <Col><Form.Item name="communityManagerFee" rules={[{required:openCheck}]}><Input onKeyUp={keyup_communityManagerFee} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col>
<Col>押金</Col> <Col>Deposit</Col>
<Col><Form.Item name="communityMargin" ><Input onKeyUp={keyup_communityMargin} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col> <Col><Form.Item name="communityMargin" rules={[{required:openCheck}]}><Input onKeyUp={keyup_communityMargin} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col>
</Row> </Row>
<Row gutter={32} style={{ marginTop: 28 }}> <Row gutter={32} style={{ marginTop: 28 }}>
{ {
extend != null ?<> extend != null ?<>
<Col>设施品类</Col> <Col>Category Of Facilities</Col>
<Col> <Col>
<Form.Item name="categoriesName" > <Form.Item name="categoriesName" >
<PictureOptions disabled={facilityDetail} <PictureOptions disabled={facilityDetail}
...@@ -219,7 +222,7 @@ const Facility = (props:any) => { ...@@ -219,7 +222,7 @@ const Facility = (props:any) => {
<Row gutter={32} style={{ marginTop: 28 }}> <Row gutter={32} style={{ marginTop: 28 }}>
{ {
extend != null ?<> extend != null ?<>
<Col>设施详情</Col> <Col>Facility Details</Col>
<Col> <Col>
<Form.Item name="categoriesDetailsImageName" > <Form.Item name="categoriesDetailsImageName" >
<PictureOptionsRow disabled={facilityDetail} <PictureOptionsRow disabled={facilityDetail}
...@@ -234,21 +237,22 @@ const Facility = (props:any) => { ...@@ -234,21 +237,22 @@ const Facility = (props:any) => {
</Row> </Row>
<Line /> <Line />
<Row gutter={32} style={{marginTop:28}}> <Row gutter={32} style={{marginTop:28}}>
<Col>开放时间</Col> <Col >Opening Hours</Col>
<Col> <Input placeholder="09:00-20:00" suffix={<FieldTimeOutlined />} style={{width:160}} disabled/></Col> {/* <Input placeholder="09:00-20:00" suffix={<FieldTimeOutlined />} style={{width:160}}/> */}
<Col><Form.Item name="categoriesOpenTime" rules={[{required:openCheck}]}><RangePicker format={'HH'} hourStep={1} /></Form.Item></Col>
</Row> </Row>
<Row gutter={32} style={{marginTop:28}}> <Row gutter={32} style={{}}>
<Col>预约设置</Col> <Col>Appointment Settings</Col>
<Col> <Col>
<Row gutter={20}> <Row gutter={20}>
<Col><Form.Item name="cancelReservationDay" label="提前取消预订"><Input onKeyUp={keyup.bind(this,"cancelReservationDay")} placeholder="取消预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col> <Col><Form.Item name="cancelReservationDay" rules={[{required:openCheck}]} label="Early cancellation"><Input onKeyUp={keyup.bind(this,"cancelReservationDay")} placeholder="Cancel the reservation" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col>
<Col><Form.Item name="nomarginCancelReservationDay" label="不交押金,自动取消预订"><Input onKeyUp={keyup.bind(this,"omarginCancelReservationDay")} placeholder="不交押金,取消预订" style={{ width: 160 }} disabled={facilityDetail} suffix="Day" /></Form.Item></Col> <Col><Form.Item name="nomarginCancelReservationDay" rules={[{required:openCheck}]} label="Automatic cancellation without deposit"><Input onKeyUp={keyup.bind(this,"nomarginCancelReservationDay")} placeholder="No deposit,cancellation" style={{ width: 160 }} disabled={facilityDetail} suffix="Day" /></Form.Item></Col>
<Col><Form.Item name="canReservationDay" label="可提前预订"><Input onKeyUp={keyup.bind(this,"canReservationDay")} placeholder="可预订" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col> <Col><Form.Item name="canReservationDay" rules={[{required:openCheck}]} label="Advance booking is available"><Input onKeyUp={keyup.bind(this,"canReservationDay")} placeholder="Bookable" style={{width:160}} disabled={facilityDetail} suffix="Day"/></Form.Item></Col>
</Row> </Row>
<Row gutter={8}> <Row gutter={8}>
<Col> <Col>
<Form.Item name="periodType" label="预约周期"> <Form.Item name="periodType" rules={[{required:openCheck}]} label="Appointment Cycle">
<Select placeholder="period" allowClear style={{width:120}} disabled={facilityDetail}> <Select placeholder="period" allowClear style={{width:120}} disabled={facilityDetail}>
<Option value="1">Week</Option> <Option value="1">Week</Option>
<Option value="2">Month</Option> <Option value="2">Month</Option>
...@@ -256,15 +260,15 @@ const Facility = (props:any) => { ...@@ -256,15 +260,15 @@ const Facility = (props:any) => {
</Select> </Select>
</Form.Item> </Form.Item>
</Col> </Col>
<Col><Form.Item name="canReservationNum" ><Input onKeyUp={keyup.bind(this,"canReservationNum")} placeholder="times" style={{width:120}} disabled={facilityDetail} suffix="Times"/></Form.Item></Col> <Col><Form.Item name="canReservationNum" rules={[{required:openCheck}]} ><Input onKeyUp={keyup.bind(this,"canReservationNum")} placeholder="times" style={{width:120}} disabled={facilityDetail} suffix="Times"/></Form.Item></Col>
</Row> </Row>
</Col> </Col>
</Row> </Row>
<Row gutter={32} style={{ marginTop: 28 }}> {/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>预约时段</Col> <Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col> <Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row> </Row> */}
{ {
facilityDetail ? <><Line /><Button type="primary" onClick={Subscribe}>Subscribe</Button></> : facilityDetail ? <><Line /><Button type="primary" onClick={Subscribe}>Subscribe</Button></> :
<><Line /><Button type="primary" htmlType="submit">Submit</Button></> <><Line /><Button type="primary" htmlType="submit">Submit</Button></>
......
...@@ -175,17 +175,17 @@ const FacilityBookings = (props:any) => { ...@@ -175,17 +175,17 @@ const FacilityBookings = (props:any) => {
<> <>
<TitleSearch <TitleSearch
status={[{ status={[{
name: ["status", "订单状态"], name: ["status", "Order status"],
data: [[0, "All"], [1, "Applied"], [2, "Reserved"], [3, "Used"], [4, "Cancelled"]] data: [[0, "All"], [1, "Applied"], [2, "Reserved"], [3, "Used"], [4, "Cancelled"]]
}]} }]}
time={["key", "预订时间筛选"]} time={["key", "Booking time "]}
community={"communityName"} community={"communityName"}
checklist={curString.communityNameList!=null?curString.communityNameList:null} checklist={curString.communityNameList!=null?curString.communityNameList:null}
onSubmit={CallBackTitleSearch} /> onSubmit={CallBackTitleSearch} />
</> : </> :
<> <>
<TitleSearch <TitleSearch
listkey={['facilityName']} list={['设施名称']} listkey={['facilityName']} list={['Facility name']}
community={"communityName"} community={"communityName"}
onSubmit={CallBackTitleSearch} /> onSubmit={CallBackTitleSearch} />
</> </>
......
...@@ -10,7 +10,7 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch'; ...@@ -10,7 +10,7 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
import { timestampToTime } from '../../../utils/time'; import { timestampToTime } from '../../../utils/time';
import { PAGE, RA, URLCLEAR, getCookie, DataClear,URL } from '@/utils/method'; import { PAGE, RA, URLCLEAR, getCookie, DataClear,URL, filterObjbyTg, urlEncode, filterObj } from '@/utils/method';
import PageData from '@/models/Common/PageData'; import PageData from '@/models/Common/PageData';
const module = "User" const module = "User"
...@@ -38,6 +38,12 @@ const Users = (props:any) => { ...@@ -38,6 +38,12 @@ const Users = (props:any) => {
const string2mean=[[0, "Unregistered"],[1,"Registered"], [2,"Deregistered"]] const string2mean=[[0, "Unregistered"],[1,"Registered"], [2,"Deregistered"]]
const [curString, setCurString] = useState({ defaultCurrent: 1 }) const [curString, setCurString] = useState({ defaultCurrent: 1 })
const [loading, setLoading] = useState(false)
const [fileUploading, setFileUploading] = useState(false)
const [pageNum, setPageNum] = useState(1)
const [readyData,setReadyData]=useState(null)
const [compent,setCompent]=useState({loading:false,fileUploading:false}) const [compent,setCompent]=useState({loading:false,fileUploading:false})
const [TestData, setTestData] = useState(null)//{ rows: [], total:0,defaultCurrent:1 } const [TestData, setTestData] = useState(null)//{ rows: [], total:0,defaultCurrent:1 }
const [pageStart, setPageStart] = useState(false) const [pageStart, setPageStart] = useState(false)
...@@ -45,7 +51,7 @@ const Users = (props:any) => { ...@@ -45,7 +51,7 @@ const Users = (props:any) => {
const columns = [ const columns = [
{ title: username, dataIndex: 'owerName', }, { title: username, dataIndex: 'owerName', },
{ title: project, dataIndex: 'communityName', }, { title: project, dataIndex: 'communityName', },
// { title: project, dataIndex: 'unit', }, // { title: project, dataIndex: 'unit', },
// { title: unit, dataIndex: 'living', }, // { title: unit, dataIndex: 'living', },
{title: unit,render:(text: any, record: any) => (<div>{record.buildingNumber+"#"+record.floorNumber+"—"+record.roomNumber}</div>)}, {title: unit,render:(text: any, record: any) => (<div>{record.buildingNumber+"#"+record.floorNumber+"—"+record.roomNumber}</div>)},
...@@ -61,16 +67,14 @@ const Users = (props:any) => { ...@@ -61,16 +67,14 @@ const Users = (props:any) => {
}, },
]; ];
const changeValue = (key:any,value: any) => {
var tmp = compent;tmp[key] = value;setCompent(tmp)
}
// 上传的模块 // 上传的模块
const propsUpload = { const propsUpload = {
name: 'file', name: 'file',
action: ()=>{return "http://47.74.233.180:8651/tos/excel/upload?userId=" + getCookie("id")}, action: ()=>{return "http://47.74.233.180:8651/tos/excel/upload?userId=" + getCookie("id")},
onChange(info) { onChange(info) {
if (info.file.status == 'uploading') { if (info.file.status == 'uploading') {
changeValue("fileUploading",true) setFileUploading(true)
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file.response.data.error_code == "0000") { if (info.file.response.data.error_code == "0000") {
...@@ -78,74 +82,83 @@ const Users = (props:any) => { ...@@ -78,74 +82,83 @@ const Users = (props:any) => {
} else { } else {
history.push(location.pathname+"/ResultFailed") history.push(location.pathname+"/ResultFailed")
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`);
changeValue("fileUploading",false) setFileUploading(false)
} }
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`);
changeValue("fileUploading",false) setFileUploading(false)
} }
}, },
showUploadList:false, showUploadList:false,
} }
useEffect(() => { useEffect(() => {
if (CommunityList != null) { if (Data != null) {
setLoading(false)
// console.log("小组件开始请求") console.log("核查的地方")
// if (pageData != null) { console.log(Data)
// console.log(pageData) }
// } }, [Data])
RA(12, {
ownerName: pageData != null?pageData.search.name:null, // if (pageStart == false) {
communityArray: pageData != null?pageData.search.cell:CommunityList // console.log(location.pathname)
}, module, dispatch); // if(history_url!=null){ console.log(history_url.pathname)}
}
}, [CommunityList]) // if (history_url != null && location.pathname != history_url.pathname) {
// console.log("来自上层数据")
// if (history_url.status == 0) {
// console.log("更新数据源")
// var tmp = Data
// tmp.defaultCurrent = pageData.defaultCurrent
// var tmp2 = curString; tmp2.defaultCurrent = pageData.defaultCurrent; setCurString(tmp2)
// setTestData(tmp)
// } else {
// console.log("异变数据源")
// console.log(history_url)
// RA(12, {
// ownerName:null,
// communityArray: CommunityList
// }, module, dispatch);
// changeValue("loading",true)
// }
// // URLCLEAR(module2, dispatch)
// }else {
// var tmp={rows:[], total:0,defaultCurrent:1}
// setTestData(tmp)
// }
// }
// if (pageStart == true) {
// if (Data != null) {
// console.log("可以接受值2")
// console.log(Data)
// changeValue("loading",false)
// setTestData(Data)
// }
// }
useEffect(() => { useEffect(() => {
if (pageStart == false) {
console.log(location.pathname) //分页设置
if(history_url!=null){ console.log(history_url.pathname)} if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
if (history_url != null && location.pathname != history_url.pathname) { } else {
console.log("来自上层数据") setPageNum(1)
if (history_url.status == 0) {
console.log("更新数据源")
var tmp = Data
tmp.defaultCurrent = pageData.defaultCurrent
var tmp2 = curString; tmp2.defaultCurrent = pageData.defaultCurrent; setCurString(tmp2)
setTestData(tmp)
} else {
console.log("异变数据源")
console.log(history_url)
RA(12, {
ownerName:null,
communityArray: CommunityList
}, module, dispatch);
changeValue("loading",true)
}
// URLCLEAR(module2, dispatch)
}else {
var tmp={rows:[], total:0,defaultCurrent:1}
setTestData(tmp)
}
}
if (pageStart == true) {
if (Data != null) {
console.log("可以接受值2")
console.log(Data)
changeValue("loading",false)
setTestData(Data)
}
} }
}, [Data])
//前置数据
console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["ownerName"])
setReadyData(tmp)
useEffect(() => { //获取数据
setPageStart(true) setLoading(true)
},[]) RA(12, {
ownerName:location.query.ownerName != undefined ? (location.query.ownerName) : null,
communityArray: CommunityList
}, module, dispatch);
},[location])
const goToDetail = (values:any,e:any) => { const goToDetail = (values:any,e:any) => {
SA(values) SA(values)
...@@ -166,17 +179,17 @@ const Users = (props:any) => { ...@@ -166,17 +179,17 @@ const Users = (props:any) => {
const CallBackTitleSearch = (comment: any)=>{ const CallBackTitleSearch = (comment: any)=>{
console.log(comment) console.log(comment)
RA(12, { //页面搜索
ownerName: comment.OwnerName, comment.current = 1
communityArray: comment.serviceCommunityList history.push(location.pathname+urlEncode(filterObj({ ownerName: comment.OwnerName})))
}, module, dispatch);
changeValue("loading",true)
} }
const pageChange = (values: any) => { const pageChange = (values: any) => {
// var tmp = curString; tmp.defaultCurrent = values.current; setCurString(tmp)
var tmp = curString; tmp.defaultCurrent = values.current;setCurString(tmp) /*页面跳转*/
var tmp = filterObjbyTg(location.query, [])
tmp["current"]=values.current
history.push(location.pathname + urlEncode(tmp))
} }
...@@ -199,15 +212,14 @@ const Users = (props:any) => { ...@@ -199,15 +212,14 @@ const Users = (props:any) => {
</div> </div>
{/* 列表组件 */} {/* 列表组件 */}
<Spin spinning={compent.loading}> <Table
{ rowKey={"id"}
TestData != null ? loading={loading}
<> style={{ marginTop: 16 }}
<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={TestData.rows} columns={columns} pagination={TestData} onChange={pageChange} /> dataSource={Data!=null?Data.data.rows:[]}
</> columns={columns}
: null pagination={Data!=null? { current: pageNum, total: Data.data.rows.length } : {}}
} onChange={pageChange} />
</Spin>
</div> </div>
); );
......
...@@ -10,6 +10,7 @@ import TitleGet from '../../components/TitleGet/TitleGet'; ...@@ -10,6 +10,7 @@ import TitleGet from '../../components/TitleGet/TitleGet';
import TableShow from '../../components/TableShow/TableShow'; import TableShow from '../../components/TableShow/TableShow';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
import PictureOptions from '@/components/PictureOptions/PictureOptions';
const Guard = (props:any) => { const Guard = (props:any) => {
...@@ -33,12 +34,26 @@ const Guard = (props:any) => { ...@@ -33,12 +34,26 @@ const Guard = (props:any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={"Version 1.1.9"} /> <TitleGet title={"Version 1.2.2"} />
<p> <p>
token:{page.token} token:{page.token}
name:{getCookie("name")} name:{getCookie("name")}
phone:{getCookie("phone")} phone:{getCookie("phone")}
</p> </p>
{
/* <Form name="basic" onFinish={onFinish}>
<Form.Item name="">
<PictureOptions
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: "extend",
}} />
</Form.Item>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> */
}
{/* <TableShow /> */} {/* <TableShow /> */}
{/* <div>{token}</div> {/* <div>{token}</div>
<Line /> */} <Line /> */}
......
import { requestList } from '@/utils/params';
import request from '@/utils/request'; import request from '@/utils/request';
// 后台账号管理 // 后台账号管理
export function TosUsersSave(values: any) {
return request('/tos/users/save',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
export function TosAccountPermissionSavePermission(values: any) {
return request('/tos/account/permission/savePermission',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
export function TosUserGetAllInfrom(values: any) { export function TosUserGetAllInfrom(values: any) {
return request('/tos/user/getAllInfrom',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/user/getAllInfrom',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
...@@ -39,83 +33,18 @@ export function TosTosServiceProviderSave(values: any) { ...@@ -39,83 +33,18 @@ export function TosTosServiceProviderSave(values: any) {
return request('/tos/tosServiceProvider/save',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}) return request('/tos/tosServiceProvider/save',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
} }
//小区管理
const headers = { 'Content-Type': 'application/json'}
function Body(values:any) { return {method: 'POST',body: JSON.stringify(values),headers:headers}}
// 设施管理
export function TosCommunityFacilitiesFuzzyQuery(values: any) {
return request('/tos/community/facilities/fuzzy/query',Body(values))
}
const requestList = [ // /tos/community/facilities/fuzzy/query
["/tos/community/facilities/categories/subscribe/list","0 请求预订列表"],
["/tos/community/facilities/get","1 设施品类获取"],
["/tos/community/facilities/categories/detail/get","2 缴费详情"],
["/tos/community/facilities/categories/fee/back","3 退还押金"],
["/tos/community/facilities/categories/fee/pay","4 缴费"],
["/tos/community/categories/subscribe/cancel","5 取消预约"],
["/tos/community/facilities/add","6 新增小区设施"],
["/tos/bookingService/lookUp","7 查看小区设施"],
["/tos/community/facilities/fuzzy/query","8 查看设施管理模糊"],
["/tos/community/categories/subscribe/fuzzy/query","9 预订列表模糊查询"],
["/tos/user/newCurrentUser", "10 后台用户信息"],
["/tos/community/facilities/categories/subscribe","11 预订"],
["/tos/tosOwner/getAll", "12 业主查询"],
["/tos/tosOwner/getDetailAll", "13 业主查询详细"],
["/tos/tosOwner/save","14 业主添加"],
["/tos/life/community/qr/get","15 二维码查询"],
["/tos/life/community/account/unit/del","16 删除单元"],
["/tos/bookingService/edit", "17 编辑小区设施"],
["/tos/tosOwner/info/update", "18 编辑业主信息"],
["/tos/contract/list", "19 获取合同列表"],
["/tos/contract/detail/query", "20 获取合同列表详情"],
["/tos/community/service/get/detail", "21 小区服务获取详情"],
["/tos/communtiy/service/reply", "22 小区回复"],
["/tos/property/decorate/record/get", "23 装修列表获取"],
["/tos/tosCommunity/get", "24 获取小区列表"],
["/tos/tosCommunityNotic/get", "25 获取小区公告列表"],
["/tos/tosVisitorRecord/get", "26 获取访客记录列表"],
["/tos/contract/add", "27 合同新增和编辑"],
["/tos/tosCommunityNotic/add", "28 新增小区公告接口"],
["/tos/tosManageCommunity/save", "29 新建一个小区"],
["/tos/tosOrder/get", "30 获取订单详情"],
["/tos/property/community/houseCard/query", "31 获取住户卡列表"],
["/tos/tosCommunity/get/detail", "32 获取小区详情"],
["/tos/property/decorate/record/reply", "33 回复装修申请"],
["/tos/property/community/houseCard/reply", "34 回复住户卡申请"],
["/tos/home/page/community/houseCard/add", "35 申请住户卡"],
["/tos/property/community/houseCard/query/detail", "36 获取住户卡详情"],
["/tos/property/decorate/record/get/detail", "37 获取装修记录详情"],
["/tos/users/save", "38 新建后台信息"],
["/tos/life/community/account/member/del", "39 删除业主成员信息"],// {"id":"c06286cfe7b843cb96fdfcb987231123","ownerId":"6b359755a36b49c28241a4620fa6539b"}
["/tos/community/service/get","40 获取小区服务回复列表"],
]
const params = [
{ "communityName": "" },
{ "communityNum": "", "noticTitlel": "" },
{ "inviterAddress": "", "visitorCommunity": "" },
{
"serviceType":"1",
"ownerName":"阿涛暗暗",
"handleStatus":"1",
"communityName":"TANGDE2"
}
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
}
//配置文件 //配置文件
// const yellowcolor ="\033[40;33m" // const yellowcolor ="\033[40;33m"
// // const bulecolor='\033[40;34m'; // // const bulecolor='\033[40;34m';
// const colorend = "\033[0m" // const colorend = "\033[0m"
const headers = { 'Content-Type': 'application/json'}
function Body(values:any) { return {method: 'POST',body: JSON.stringify(values),headers:headers}}
function requestAuto(url:string,values:any) {
return request(url, Body(values))
}
export function RA(playload: any) { export function RA(playload: any) {
// console.log(playload) // console.log(playload)
// console.log(playload.index) // console.log(playload.index)
...@@ -129,23 +58,6 @@ export function RA(playload: any) { ...@@ -129,23 +58,6 @@ export function RA(playload: any) {
return requestAuto(url,playload.body) return requestAuto(url,playload.body)
} }
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
// http://47.74.233.180:8651/tos/tosCommunityNotic/add
// {
// "noticTitle":"Garden公告",
// "communityNum":"珠江丽景小区",
// "noticText":"今晚晚上停水4小时",
// "noticScope":"1",
// "noticStartTime":"2020-07-01 12:30:00",
// "noticEndTime":"2020-08-01 9:30:00",
// "file":["A.jpg"]
// }
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
...@@ -4,7 +4,8 @@ export async function query(): Promise<any> { ...@@ -4,7 +4,8 @@ export async function query(): Promise<any> {
return request('/api/users'); return request('/api/users');
} }
export async function queryCurrent(values:any): Promise<any> { export async function queryCurrent(values: any): Promise<any> {
console.log(values)
return request('/tos/user/newCurrentUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}}); return request('/tos/user/newCurrentUser',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}});
} }
......
import {message } from 'antd'; import {message } from 'antd';
import moment from 'moment';
export const checkParam = (values: any) => { export const checkParam = (values: any) => {
var flag = true var flag = true
...@@ -137,3 +138,50 @@ export const filterObjbyTg = (obj:any,tg:any) => { ...@@ -137,3 +138,50 @@ export const filterObjbyTg = (obj:any,tg:any) => {
} }
return tmp return tmp
} }
//提取当中的指定数据类型数据
export const getLevelNum =()=>{
var levelNum=new Array()
for (var item in treeData) {
// console.log(parseInt(treeData[item].key))
if (!isNaN(parseInt(treeData[item].key))) {
levelNum.push(treeData[item].key)
} else {
var tmp = treeData[item]
tmp.children.map((item, index) => {
levelNum.push(item.key)
})
}
}
return levelNum
}
//转换
export const translate = (from:any,to:any,middle:any) => {
middle.map((item, index) => {
from[item[0]]=to[item[1]]
})
return from
}
//用户名检测
export 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();
};
//时间转换函数
export const timeForm = (values: any,format:any) => {
var result = new Array()
values.map((items:any, index:any) => {
result.push(moment(items).format(format))
})
return result[0] + "-" + result[1]
}
\ No newline at end of file
export const validateMessages ={ export const validateMessages ={
required: 'Please enter,it is required!', required: '*it is required!',
types: { types: {
email: 'It is not validate email!', email: 'It is not validate email!',
number: '${label} is not a validate number!', number: '${label} is not a validate number!',
...@@ -13,3 +13,103 @@ export const validateMessages ={ ...@@ -13,3 +13,103 @@ export const validateMessages ={
}, },
} }
export const requestList = [
["/tos/community/facilities/categories/subscribe/list","0 请求预订列表",{}],
["/tos/community/facilities/get","1 设施品类获取",{}],
["/tos/community/facilities/categories/detail/get","2 缴费详情",{}],
["/tos/community/facilities/categories/fee/back","3 退还押金",{}],
["/tos/community/facilities/categories/fee/pay","4 缴费",{}],
["/tos/community/categories/subscribe/cancel","5 取消预约",{}],
["/tos/community/facilities/add","6 新增小区设施",{}],
["/tos/bookingService/lookUp","7 查看小区设施",{}],
["/tos/community/facilities/fuzzy/query","8 查看设施管理模糊",{}],
["/tos/community/categories/subscribe/fuzzy/query","9 预订列表模糊查询",{}],
["/tos/user/newCurrentUser", "10 后台用户信息",{}],
["/tos/community/facilities/categories/subscribe","11 预订",{}],
["/tos/tosOwner/getAll", "12 业主查询",{}],
["/tos/tosOwner/getDetailAll", "13 业主查询详细",{}],
["/tos/tosOwner/save","14 业主添加",{}],
["/tos/life/community/qr/get","15 二维码查询",{}],
["/tos/life/community/account/unit/del","16 删除单元",{}],
["/tos/bookingService/edit", "17 编辑小区设施",{}],
["/tos/tosOwner/info/update", "18 编辑业主信息",{}],
["/tos/contract/list", "19 获取合同列表",{}],
["/tos/contract/detail/query", "20 获取合同列表详情",{}],
["/tos/community/service/get/detail", "21 小区服务获取详情",{}],
["/tos/communtiy/service/reply", "22 小区回复",{}],
["/tos/property/decorate/record/get", "23 装修列表获取",{}],
["/tos/tosCommunity/get", "24 获取小区列表",{}],
["/tos/tosCommunityNotic/get", "25 获取小区公告列表",{}],
["/tos/tosVisitorRecord/get", "26 获取访客记录列表",{}],
["/tos/contract/add", "27 合同新增和编辑",{}],
["/tos/tosCommunityNotic/add", "28 新增小区公告接口", {
"noticTitle":"Garden公告",
"communityNum":"珠江丽景小区",
"noticText":"今晚晚上停水4小时",
"noticScope":"1",
"noticStartTime":"2020-07-01 12:30:00",
"noticEndTime":"2020-08-01 9:30:00",
"file":["A.jpg"]
}],
["/tos/tosManageCommunity/save", "29 新建一个小区",{}],
["/tos/tosOrder/get", "30 获取订单详情",{}],
["/tos/property/community/houseCard/query", "31 获取住户卡列表",{}],
["/tos/tosCommunity/get/detail", "32 获取小区详情",{}],
["/tos/property/decorate/record/reply", "33 回复装修申请",{}],
["/tos/property/community/houseCard/reply", "34 回复住户卡申请",{}],
["/tos/home/page/community/houseCard/add", "35 申请住户卡",{}],
["/tos/property/community/houseCard/query/detail", "36 获取住户卡详情",{}],
["/tos/property/decorate/record/get/detail", "37 获取装修记录详情",{}],
["/tos/users/save", "38 新建后台信息",{}],
["/tos/life/community/account/member/del", "39 删除业主成员信息", {
"id": "c06286cfe7b843cb96fdfcb987231123",
"ownerId": "6b359755a36b49c28241a4620fa6539b"
}],
["/tos/community/service/get", "40 获取小区服务回复列表",{}],
["/tos/users/save", "41 添加后台账号", {
"id": "null",
"oneself": 0,
"tosUserEmail": "sales@huahui.com",
"tosUserName": "小赵2",
"tosUserPhone": "020-8888-4444",
"tosUserPwd": "123456",
"tosUserToCompany": "1",
"tosUserServiceCell":"",
"tosuserLevel": 1,
"userStatus": 1
}],
["/tos/account/permission/savePermission", "42 添加后台权限", {
"userName": "小赵2",
"userPassword": "123456",
"permissionArray": ["2", "1", "3", "4"]
}],
["/tos/tosServiceScope/get", "43 获取服务范围",{
"serviceName": ""
}],
["/tos/tosServiceScope/save", "44 添加服务范围",{
"id":"5",
"serviceName":"律政"
}],
["/tos/user/getAllInfrom", "45 获取后台列表", {
"id": "",
"moment": [],
"name": "",
"leaderID": "1",
"userPhone": ""
}]
]
const params = [
{ "communityName": "" },
{ "communityNum": "", "noticTitlel": "" },
{ "inviterAddress": "", "visitorCommunity": "" },
[26,{
}],
[28, {
}]
]
\ 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