Commit 2fbb5d5b authored by maple's avatar maple

[fix]小区设施模块

parent 978b647e
......@@ -254,7 +254,6 @@ export default defineConfig({
path: '/AccountManagement',
name: 'accountmanagement',
icon: 'UserSwitchOutlined',
authority: 'admin',
routes: [
{
path: './AccountManagement',
......
......@@ -22,17 +22,14 @@ const Picture = (props:any) => {
useEffect(() => {
var tmp = props.defaultValue
console.log(tmp)
var checkFlag=false
if (tmp != null) {
tmp.map((item, index) => {
if (item.name == null) {
if (item.name == null||item.pic==null) {
checkFlag=true
}
})
if (!checkFlag) {
// console.log("picture")
// console.log(tmp)
setFileList(tmp)
}
......@@ -60,6 +57,10 @@ const Picture = (props:any) => {
props.onSubmit(file.name)
}
}
const handleRemove = (file: any) => {
// props.onSubmit(file.name)
props.onDelete(file.name)
}
const beforeUpload=( file:any) => {
if (file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg') {
return true
......@@ -83,7 +84,11 @@ const Picture = (props:any) => {
data={props.data}
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}
</Upload>
)
......
......@@ -11,17 +11,18 @@ import Picture from './Picture';
import { getUrlPicName } from '../../utils/string';
const PictureOptions = (props:any) => {
const { value, onChange }=props
const { value, onChange } = props
const [rowkey,setRoKey]=useState(0)
const [fileList, setFileList] = useState([])
const [fileListLen, setFileListLen] = useState(0)
const add = () => {
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(() => {
var tmp = value
if (tmp != null&&tmp.length>0&&(typeof tmp[0])=="object") {
console.log("图片默认值")
console.log("图片集合使用默认值")
console.log(tmp)
var initArray = new Array()
tmp.map((item: any, index: any) => {
......@@ -36,8 +37,10 @@ const PictureOptions = (props:any) => {
uid: index,
status:"Done"})
})
console.log(initArray)
setFileList(initArray)
setFileListLen(initArray.length + 1)
onChange( CheckParm(initArray))
}
}, [value])
......@@ -60,10 +63,23 @@ const PictureOptions = (props:any) => {
return tmp
}
const DeletePictureName = (index: any, values: any) => {
var tmp = fileList
tmp[index].pic = null
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
console.log(tmp)
tmp[index].url = null
console.log("图片文件发生改变")
console.log(CheckParm(tmp))
onChange( CheckParm(tmp))
}
const InputGet = (index: any, e: any) => {
......@@ -74,6 +90,8 @@ const PictureOptions = (props:any) => {
tmp[index].name = e.target.value
}
console.log(tmp)
console.log(CheckParm(tmp));
onChange(CheckParm(tmp))
}
return (
......@@ -81,11 +99,10 @@ const PictureOptions = (props:any) => {
{
fileList.map((item, index) => {
console.log(index)
console.log(item)
return (
<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>
<Row><Input placeholder={"Facility Name"} onChange={InputGet.bind(this, index)} defaultValue={item.name} disabled={props.disabled}/></Row>
{
......
......@@ -32,27 +32,71 @@ const PictureOptionsRow = (props: any) => {
const handleCancel = () => setPreviewVisible(false);
useEffect(() => {
console.log("是否刷新")
console.log(value);
if (value!=null) {
var tmp = value
var result = new Array()
var resultToInside = new Array()
if (tmp.length > 0 && typeof (tmp[0]) != "string") {//输入输出
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) {
item.name = getUrlPicName(item.url)
item.uid=index
item.uid = index
}
result.push(item)
resultToInside.push(item.name)
})
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 => {
if (!file.url && !file.preview) {
......@@ -63,13 +107,15 @@ const PictureOptionsRow = (props: any) => {
}
const handleChange = ({ file, fileList }) => {
let tmp=fileList
setFileList(tmp.filter(file => !!file.status))
console.log(fileList);
let tmp = fileList
setFileList(tmp.filter(file => !!file.status||file.status==null))
var result=new Array()
fileList.map((item, index) => {
result.push(item.name)
})
console.log("该过程图片发生改变");
onChange(result)
}
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 { 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 = [
{
title: 'LIFE用户管理',
title: 'Life user management',
key: 'A',
children: [
{title: '查看LIFE用户',key: '2'},
{ title: '编辑LIFE用户', key: '3' },
{ title: '添加业主档案', key: '4' },
{title: '注销业主档案',key: '5'},
{title: 'View life users',key: '2'},
{ title: 'Edit life user', key: '3' },
{ title: 'Add owner file', key: '4' },
{title: 'Cancellation of owner files',key: '5'},
],
},
{ title: '数据中心', key: '1' },
{ title: 'Data center', key: '1' },
{
title: '服务商管理',
title: 'Service provider management',
key: 'B',
children: [
{title: '查看服务商',key: '6'},
{ title: '编辑服务商', key: '7' },
{ title: '添加服务商', key: '8' },
{title: '注销服务商',key: '9'},
{title: 'View service provider',key: '6'},
{ title: 'Editorial service provider', key: '7' },
{ title: 'Add service provider', key: '8' },
{title: 'Cancellation of service provider',key: '9'},
],
},
{
title: '物业费管理',
title: 'Property management',
key: 'C',
children: [
{title: '查看物业费记录',key: '10'},
{ title: '添加物业费记录', key: '11' },
{title: 'View property fee records',key: '10'},
{ title: 'Add property fee record', key: '11' },
],
},
{
title: '物业管理',
title: 'Estate management',
key: 'D',
children: [
{title: '查看物业服务',key: '12'},
{ title: '编辑物业服务', key: '13' },
{ title: '注销物业服务', key: '14' },
{title: 'View property services',key: '12'},
{ title: 'Edit property services', key: '13' },
{ title: 'Cancellation of property services', key: '14' },
],
},
{
title: '订单管理',
title: 'Order management',
key: 'E',
children: [
{title: '查看订单',key: '15'},
{ title: '编辑订单', key: '16' },
{title: 'View order',key: '15'},
{ title: 'Edit order', key: '16' },
],
},
{
title: '合同管理',
title: 'Contract management',
key: 'F',
children: [
{title: '查看合同',key: '17'},
{ title: '编辑合同', key: '18' },
{ title: '添加合同', key: '19'},
{title: 'View contract',key: '17'},
{ title: 'Edit contract', key: '18' },
{ title: 'Add contract', key: '19'},
],
},
{
title: '小区管理',
title: 'Community management',
key: 'G',
children: [
{title: '查看小区',key: '20'},
{ title: '编辑小区', key: '21' },
{ title: '添加小区', key: '22' },
{title: 'View community',key: '20'},
{ title: 'Edit community', key: '21' },
{ title: 'Add cell', key: '22' },
],
},
{ title: '访客记录', key: '26' },
{ title: 'Visitor record', key: '26' },
{
title: '预订设施',
title: 'Booking facilities',
key: 'H',
children: [
{title: '查看预定服务',key: '27'},
{ title: '编辑预定服务', key: '28' },
{ title: '添加预定服务', key: '29' },
{title: 'View booking services',key: '27'},
{ title: 'Edit booking service', key: '28' },
{ title: 'Add booking service', key: '29' },
],
},
{
title: '后台管理',
title: 'Back-stage management',
key: 'I',
children: [
{title: '查看后台账号',key: '30'},
{ title: '配置后台账号', key: '31' },
{title: 'View background account',key: '30'},
{ title: 'Configure background account', key: '31' },
],
},
];
const TreeAction = (props:any) => {
const {value,onChange}=props
const onSelect = (selectedKeys:any, info:any) => {
// 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 checklist = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I']
var array=new Array()
......
......@@ -102,11 +102,13 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
useEffect(() => {
if (dispatch) {
console.log("Maple")
dispatch({
type: 'user/fetchCurrent',
playload: {
userName: "admin",
password:"admin",}
password: "admin",
}
});
}
}, []);
......
......@@ -32,13 +32,13 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// console.log("安全登录中")
// console.log(login)
if (dispatch) {
dispatch({
type: 'user/fetchCurrent',
playload: {
userName: login.userName,
password: login.password
}
});
// dispatch({
// type: 'user/fetchCurrent',
// playload: {
// userName: login.userName,
// 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';
import { routerRedux } from 'dva/router'
import {Fromate} from '@/utils/method'
import { timeToMoment } from '@/utils/time';
export default {
namespace: 'FacilityBookings',
state: {
......@@ -62,7 +63,6 @@ export default {
const resp = yield call(service.RA, playload);
console.log(resp)
console.log(playload)
if (resp.code == 500||resp.error_code!="0000") {
// window.location.href = '/500';
}
......@@ -120,7 +120,7 @@ export default {
canReservationDay: tmp.canReservationDay,
canReservationNum: tmp.canReservationNum,
cancelReservationDay: tmp.cancelReservationDay,
categoriesOpenTime: tmp.categoriesOpenTime,
categoriesOpenTime: timeToMoment(tmp.categoriesOpenTime),
communityManagerFee: tmp.communityManagerFee,
communityMargin: tmp.communityMargin,
communityName: tmp.communityName,
......@@ -132,9 +132,7 @@ export default {
categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2)
}
console.log(sourceData)
console.log(tmp.facilitiesImageList)
console.log(Fromate(tmp.facilitiesImageList,reg2))
console.log("##############################")
yield put({ type: 'returnSource', sourceData });
} break;
case 8: {
......
......@@ -7,7 +7,7 @@ import { routerRedux } from 'dva/router'
export default {
namespace: 'User',
state: {
Data: {data:[],total:0},
Data: null,
DataPage:{totalRow:0},
Data3Error: null,
DataSave: null,
......@@ -61,7 +61,6 @@ export default {
effects: {
//预订设施查询
*RA({ playload }, { call, put }) {
switch (playload.index) {
......@@ -109,7 +108,7 @@ export default {
switch (playload.index) {
case 12:{
let Data = resp.data;
let Data = resp;
yield put({ type: 'returnPage', Data});
} break;
case 18:
......
......@@ -92,6 +92,7 @@ const Model: LoginModelType = {
}
history.replace(redirect || '/');
} else {
console.error(response)
message.error("Login Error! Username or Password is wrong!",3)
}
},
......
......@@ -38,16 +38,20 @@ const UserModel: UserModelType = {
},
effects: {
*fetch(_, { call, put }) {
const response = yield call(queryUsers);
console.error(response)
yield put({
type: 'save',
payload: response,
});
},
*fetchCurrent({playload}, { call, put }) {
*fetchCurrent({ playload }, { call, put }) {
console.log("response")
const response = yield call(queryCurrent,playload);
// console.log(response)
console.log(response)
yield put({
type: 'saveCurrentUser',
payload: response,
......
......@@ -7,24 +7,67 @@ import { Link, useIntl, connect, Dispatch,history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
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 { formatMessage } = useIntl();
const { dispatch, location,Data} = props;
const get = (values:any) => {dispatch({type: 'AccountManagement/TosUserGetAllInfrom',playload:values})};
const { dispatch, location, Data } = props;
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(() => {
get({
//分页设置
if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
} else {
setPageNum(1)
}
setLoading(true)
RA(45,{
"id": "",
"moment": [],
"name": "",
"leaderID": "1",
"userPhone": ""
})
}, []);
},module,dispatch)
}, [location]);
const formRef = useRef(null);
const onFinish = (values: any) => {get(values)};
useEffect(() => {
if (Data != null) {
setLoading(false)
}
}, [Data])
const onFinish = (values: any) => {
console.log(values);
};
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
const goToDetail = (values:any,e:any) => {
......@@ -37,34 +80,11 @@ const Account = (props: any) => {
history.push(location.pathname + '/Edit?providerName='+values.providerName)
}
const pagination={defaultCurrent:1,total: 16}
/*
账号名称 tosUserName
等级 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;
const pageChange = (values: any) => {
/*页面跳转*/
var tmp = filterObjbyTg(location.query, [])
tmp["current"]=values.current
history.push(location.pathname + urlEncode(tmp))
}
return (
......@@ -84,7 +104,15 @@ const Account = (props: any) => {
</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>
......@@ -92,8 +120,7 @@ const Account = (props: any) => {
};
function mapStateToProps(state:any) {
const { Data } = state.AccountManagement;
console.log(Data)
const { Data } = state.Account;
return {
Data,
};
......
......@@ -11,24 +11,49 @@ import TreeAction from '../../../components/TreeAction/TreeAction';
import TitleBack from '../../../components/TitleBack/TitleBack';
import SelectCommunity from '@/components/SelectCommunity';
import Line from '@/components/Line/Line';
import authorize from '@/components/Authorized/Secured';
import { RA, translate } from '@/utils/method';
const printContent = (comment: any)=>{
console.log(comment)
}
const getTreeActionValues = (comment: any)=>{
console.log(comment)
}
import { EyeTwoTone, EyeInvisibleOutlined, StarTwoTone } from '@ant-design/icons';
import { validateMessages } from '@/utils/params';
const authorizeLevel = ["Administrator","Secondary Administrator", "Three Level Administrator"]
const user_state=[[0, "enabled"],[1,"Disabled"]]
const module="Account"
const AccountManagement = (props:any) => {
const { dispatch } = props;
const formRef = useRef(null)
const onFinish = (values:any) =>{
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 (
<div className={styles.base}>
......@@ -37,38 +62,45 @@ const AccountManagement = (props:any) => {
<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="Password" label="Password"><Input placeholder="password" 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" 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>
<Form.Item name="phone" style={{marginRight:16}}><Input placeholder="Phone number"></Input></Form.Item>
<Form.Item name="email"><Input placeholder="Email"></Input></Form.Item>
<Form.Item name="phone" style={{marginRight:16}} rules={[{required:true}]}><Input placeholder="Phone number"></Input></Form.Item>
<Form.Item name="email" rules={[{required:true}]}><Input placeholder="Email" ></Input></Form.Item>
</Input.Group>
</Form.Item>
<Form.Item name="community" label="Community" ><SelectCommunity ></SelectCommunity></Form.Item>
<Form.Item label="Level" name="tosuserLevel">
<Select placeholder="Level" style={{ width: 120 }}>
<Option value="0">Secondary Administrator</Option>
<Option value="1">Three Level Administrator</Option>
<Option value="2">Select All</Option>
<Form.Item label="Level" name="tosuserLevel" wrapperCol={{ offset: 2}}>
<Select placeholder="Level" style={{ width: 240 }}>
{
authorizeLevel.map((item, index) => {
return <Option key={"" + index} value={"" + index+1}>{item}</Option>
})
}
</Select>
</Form.Item>
<Form.Item name="premission" label="Permission">
<TreeAction onSubmit={getTreeActionValues} />
<Form.Item name="premission" label="Permission" wrapperCol={{ offset: 1}}>
<TreeAction/>
</Form.Item>
<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>
</div>
);
};
export default AccountManagement;
function mapStateToProps(state:any) {
const { Data } = state.Account;
return {
Data
};
}
export default connect(mapStateToProps)(AccountManagement);
......@@ -25,8 +25,6 @@ const Detail = (props:any) => {
const fromRef=useRef(null)
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 [loading, setLoading] = useState(false)
......@@ -39,8 +37,6 @@ const Detail = (props:any) => {
"Reply To Report Online",
"Reply To Problem Feedback"]
const [fileList, setfileList] = useState([]);
useEffect(() => {
if ((location.pathname).indexOf("/Edit")>-1) {
......@@ -48,15 +44,13 @@ const Detail = (props:any) => {
} else {
setEditorFlag(false)
}
console.log("跳转后的URL参数值")
console.log(location)
RA(21,{
serviceType: location.query.serviceType,
id: location.query.id
})
setHeadTitle(headTitles[parseInt(location.query.serviceType)- 1])
setLoading({ data: true })
setLoading(true)
},[location.pathname]);
useEffect(() => {
......@@ -65,13 +59,10 @@ const Detail = (props:any) => {
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
console.log(CurDataDetail)
if (!editorFlag) {
console.log(CurDataDetail.replyImgUrl);
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl }
console.log(tmp)
fromRef.current.setFieldsValue(tmp)
}
setLoading({ data: false })
setLoading(false)
}
}, [CurDataDetail])
useEffect(()=>{
......@@ -89,18 +80,10 @@ const Detail = (props:any) => {
val.handleStatus = "1"
// val.file=fileList
console.log('Success:', val)
RA(22,val);
};
const onFinishFailed = (errorInfo:any) => {
console.log('Failed:', errorInfo);
RA(22, val);
setLoading(true)
};
const PictureOptionsRowRef = (values:any) => {
console.log(values)
setfileList(values)
}
const titleProps = {
sublist: CurDataDetail != null?['Handle Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]:null,
title: headTitle
......@@ -111,7 +94,7 @@ const Detail = (props:any) => {
<div>
{CurDataDetail != null ?
<>
<Spin spinning={loading.data}>
<Spin spinning={loading}>
<div className={styles.base}>
<TitleBack {...titleProps} />
......@@ -128,44 +111,45 @@ const Detail = (props:any) => {
<Col><TextArea style={{ width: 394, height: 80,padding:8 }} autoSize={false} disabled value={CurDataDetail.content}/></Col>
</Row>
<Row gutter={16} style={{marginTop:20}}>
<Col>Picture:</Col>
<Col span={3}>Picture:</Col>
<Col>{
// CurDataDetail!=null?
// <PictureOptionsRow
// action="/tos/communtiy/service/reply/img"
// disabled={true} putSubmit={PictureOptionsRowRef}
// data={{
// userToken: "token",
// imageType: 'tosCommunityImageReply',
// extends: "",
// }}
// // defultValue={CurDataDetail.pictrues}
// />:null
CurDataDetail!=null?
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={true}
defaultValue={CurDataDetail.pictrues}
data={{
userToken: "token",
imageType: 'tosCommunityImageReply',
extends: "",
}}
//
/>:null
}</Col>
</Row>
<Line />
<Form ref={fromRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} validateMessages={validateMessages}>
<Form ref={fromRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
{!editorFlag ?
<Row gutter={16}>
<Col>Response:</Col>
<Col>{getCookie("name")}</Col>
<Col span={6}>{getCookie("name")}</Col>
<Col>Contract Detail:</Col>
<Col>{getCookie("phone")}</Col>
</Row>
: null}
<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>
</Row>
<Row gutter={16} style={{ marginTop: 20 }}>
<Row gutter={16}>
<Col span={3}></Col>
<Col >
{/* putSubmit={PictureOptionsRowRef} */}
{
CurDataDetail.replyImgUrl != null ? <>
<Form.Item name="file" label="filename" >
<Form.Item name="file">
<PictureOptionsRow
action="/tos/communtiy/service/reply/img"
disabled={!editorFlag}
......
......@@ -8,10 +8,11 @@ import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { query } from 'express';
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
const handle_Status = [[0,"Untreated"], [1,"Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"]
const goToName = ["Reply", "Detail"];
const module="CommunityService"
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: "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: "Actions",dataIndex: 'handle_status',
render: (text: any, record: any) => (
<Space size="middle"> <a onClick={goToDetail.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space>
),
},
{ title: "Actions",dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle"><a onClick={goToDetail.bind(this,text,record)}>{goToName[text]}</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}))
}
......@@ -44,13 +42,14 @@ const PropertyServices = (props: any) => {
if (Data != null) {setLoading(false)}
}, [Data]);
const ClickTitleSearch = (comment: any)=>{
const ClickTitleSearch = (comment: any) => {
//页面搜索
comment.serviceType = serviceTypeGobal
comment.current = 1
history.push(location.pathname+urlEncode(filterObj(comment)))
}
const PageChange = (values: any) => { //.current
//页面跳转参数
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
tmp["current"]=values.current
history.push(location.pathname + urlEncode(tmp))
......@@ -58,6 +57,7 @@ const PropertyServices = (props: any) => {
useEffect(()=>{
if (location != null) {
//细分类:页面指令
var serviceType =""
pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) {
......@@ -65,19 +65,21 @@ const PropertyServices = (props: any) => {
setServiceType(serviceType)
}
})
//分页设置
if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
} else {
setPageNum(1)
}
setLoading(true)
console.log("设置大数据");
//前置数据
console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
console.log(tmp)
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)] //特殊处理
setReadyData(tmp)
// var tmp=filterObj(location.query)
// console.log(tmp)
//获取数据
setLoading(true)
RA(40, {
serviceType: serviceType,
handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
......@@ -121,11 +123,3 @@ function mapStateToProps(state:any) {
};
}
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';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
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 { dispatch, Data3,Result,DataSave,token} = props;
......@@ -155,7 +156,7 @@ const Bookings = (props:any) => {
</div>
{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.box2item1}>Facility Bookings</div>
<div className={styles.box2item2}>
......@@ -180,18 +181,18 @@ const Bookings = (props:any) => {
<div className={styles.box3}>
<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.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 className={styles.box4}>
<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.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.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 className={styles.line}></div>
......@@ -200,8 +201,8 @@ const Bookings = (props:any) => {
<div className={styles.box5item1}>Booking Schedule</div>
<div className={styles.box5item2}>
<Row gutter={8}>
<Col><Form.Item name="subscribeDate" ><DatePicker /></Form.Item></Col>
<Col><Form.Item name="reservedTimeList" ><RangePicker format={format}/></Form.Item></Col>
<Col><Form.Item name="subscribeDate" rules={[{required:true}]}><DatePicker /></Form.Item></Col>
<Col><Form.Item name="reservedTimeList" rules={[{required:true}]}><RangePicker format={format}/></Form.Item></Col>
</Row>
</div>
</div>
......
import React, { useState, useEffect,useRef } from 'react';
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;
import { Link, useIntl, connect, Dispatch,history } from 'umi';
......@@ -20,7 +21,8 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
// reservationQuantumTime: ["09:00-07:00"]
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) => {
......@@ -29,6 +31,8 @@ const Facility = (props:any) => {
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' })}
const openCheck = true
const [Ref3, setRef3] = useState([])
const [extend, setExtend] = useState(null)
......@@ -96,21 +100,23 @@ const Facility = (props:any) => {
}
},[])
const TimeSelectRef = (values:any) => {
// console.log(values)
setRef3(values)
}
// const TimeSelectRef = (values:any) => {
// setRef3(values)
// }
const onFinish = (values: any) => {
var result = values
if (Ref3.length!=0) {
result.reservationQuantumTime = Ref3
} else {
result.reservationQuantumTime = ["09:00-20:00"]
}
result.categoriesOpenTime = "09:00-20:00"
// if (Ref3.length!=0) {
// result.reservationQuantumTime = Ref3
// } else {
result.reservationQuantumTime = [timeForm(result.categoriesOpenTime, 'HH:mm')]
var categoriesOpenTime=timeForm(result.categoriesOpenTime,'HH:mm')
result.categoriesOpenTime=categoriesOpenTime
// }
// console.log(timeForm(result.categoriesOpenTime,'HH:mm'))
// result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) {
result.communityManagerFee=numberToString(0)
} else {
......@@ -123,28 +129,28 @@ const Facility = (props:any) => {
}
if (result.canReservationDay <= result.cancelReservationDay || result.canReservationDay <= result.nomarginCancelReservationDay) {
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('Success:', result);
//中断
if (pictrueExtend.tab == 3) {
if (Result == null) {
console.log("提交")
// RA(6, result);
RA(6, result);
}
} else {
result.id = DataSave.id
console.log("编辑")
console.log(result)
if (Result == null) {
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) => {
formRef.current.setFieldsValue(tmp)
}
const test = () => {
console.log(extend)
}
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<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}>
<Col>所属小区</Col>
<Col>Community</Col>
<Col><Form.Item name="communityName" ><SearchOptionsCommnity disabled={pictrueExtend.tab!=3?true:false} /></Form.Item></Col>
</Row>
<Row gutter={32} style={{marginTop:28}}>
<Col>设施名称</Col>
<Col><Form.Item name="facilityName" ><Input placeholder="Facility Name" disabled={facilityDetail}/></Form.Item></Col>
<Col>费用($)</Col>
<Col><Form.Item name="communityManagerFee" ><Input onKeyUp={keyup_communityManagerFee} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col>
<Col>押金</Col>
<Col><Form.Item name="communityMargin" ><Input onKeyUp={keyup_communityMargin} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col>
<Col>Facility</Col>
<Col><Form.Item name="facilityName" rules={[{required:openCheck}]}><Input placeholder="Facility Name" disabled={facilityDetail}/></Form.Item></Col>
<Col>Fee($)</Col>
<Col><Form.Item name="communityManagerFee" rules={[{required:openCheck}]}><Input onKeyUp={keyup_communityManagerFee} prefix="$" placeholder="00.00" disabled={facilityDetail} allowClear/></Form.Item></Col>
<Col>Deposit</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 gutter={32} style={{ marginTop: 28 }}>
{
extend != null ?<>
<Col>设施品类</Col>
<Col>Category Of Facilities</Col>
<Col>
<Form.Item name="categoriesName" >
<PictureOptions disabled={facilityDetail}
......@@ -219,7 +222,7 @@ const Facility = (props:any) => {
<Row gutter={32} style={{ marginTop: 28 }}>
{
extend != null ?<>
<Col>设施详情</Col>
<Col>Facility Details</Col>
<Col>
<Form.Item name="categoriesDetailsImageName" >
<PictureOptionsRow disabled={facilityDetail}
......@@ -234,21 +237,22 @@ const Facility = (props:any) => {
</Row>
<Line />
<Row gutter={32} style={{marginTop:28}}>
<Col>开放时间</Col>
<Col> <Input placeholder="09:00-20:00" suffix={<FieldTimeOutlined />} style={{width:160}} disabled/></Col>
<Col >Opening Hours</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 gutter={32} style={{marginTop:28}}>
<Col>预约设置</Col>
<Row gutter={32} style={{}}>
<Col>Appointment Settings</Col>
<Col>
<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="nomarginCancelReservationDay" label="不交押金,自动取消预订"><Input onKeyUp={keyup.bind(this,"omarginCancelReservationDay")} placeholder="不交押金,取消预订" 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="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" 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" 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 gutter={8}>
<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}>
<Option value="1">Week</Option>
<Option value="2">Month</Option>
......@@ -256,15 +260,15 @@ const Facility = (props:any) => {
</Select>
</Form.Item>
</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>
</Col>
</Row>
<Row gutter={32} style={{ marginTop: 28 }}>
<Col>预约时段</Col>
{/* <Row gutter={32} style={{ marginTop: 28 }}>
<Col>Appointment Period</Col>
<Col><TimeSelect putSubmit={TimeSelectRef} defaultValue={timeExtend} disabled={facilityDetail}/></Col>
</Row>
</Row> */}
{
facilityDetail ? <><Line /><Button type="primary" onClick={Subscribe}>Subscribe</Button></> :
<><Line /><Button type="primary" htmlType="submit">Submit</Button></>
......
......@@ -175,17 +175,17 @@ const FacilityBookings = (props:any) => {
<>
<TitleSearch
status={[{
name: ["status", "订单状态"],
name: ["status", "Order status"],
data: [[0, "All"], [1, "Applied"], [2, "Reserved"], [3, "Used"], [4, "Cancelled"]]
}]}
time={["key", "预订时间筛选"]}
time={["key", "Booking time "]}
community={"communityName"}
checklist={curString.communityNameList!=null?curString.communityNameList:null}
onSubmit={CallBackTitleSearch} />
</> :
<>
<TitleSearch
listkey={['facilityName']} list={['设施名称']}
listkey={['facilityName']} list={['Facility name']}
community={"communityName"}
onSubmit={CallBackTitleSearch} />
</>
......
......@@ -10,7 +10,7 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
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';
const module = "User"
......@@ -38,6 +38,12 @@ const Users = (props:any) => {
const string2mean=[[0, "Unregistered"],[1,"Registered"], [2,"Deregistered"]]
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 [TestData, setTestData] = useState(null)//{ rows: [], total:0,defaultCurrent:1 }
const [pageStart, setPageStart] = useState(false)
......@@ -61,16 +67,14 @@ const Users = (props:any) => {
},
];
const changeValue = (key:any,value: any) => {
var tmp = compent;tmp[key] = value;setCompent(tmp)
}
// 上传的模块
const propsUpload = {
name: 'file',
action: ()=>{return "http://47.74.233.180:8651/tos/excel/upload?userId=" + getCookie("id")},
onChange(info) {
if (info.file.status == 'uploading') {
changeValue("fileUploading",true)
setFileUploading(true)
}
if (info.file.status === 'done') {
if (info.file.response.data.error_code == "0000") {
......@@ -78,74 +82,83 @@ const Users = (props:any) => {
} else {
history.push(location.pathname+"/ResultFailed")
message.error(`${info.file.name} file upload failed.`);
changeValue("fileUploading",false)
setFileUploading(false)
}
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`);
changeValue("fileUploading",false)
setFileUploading(false)
}
},
showUploadList:false,
}
useEffect(() => {
if (CommunityList != null) {
// console.log("小组件开始请求")
// if (pageData != null) {
// console.log(pageData)
// }
RA(12, {
ownerName: pageData != null?pageData.search.name:null,
communityArray: pageData != null?pageData.search.cell:CommunityList
}, module, dispatch);
if (Data != null) {
setLoading(false)
console.log("核查的地方")
console.log(Data)
}
}, [CommunityList])
}, [Data])
// if (pageStart == false) {
// console.log(location.pathname)
// if(history_url!=null){ console.log(history_url.pathname)}
// 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(() => {
if (pageStart == false) {
console.log(location.pathname)
if(history_url!=null){ console.log(history_url.pathname)}
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)
//分页设置
if (location.query.current!=null) {
setPageNum(parseInt(location.query.current))
} else {
console.log("异变数据源")
console.log(history_url)
setPageNum(1)
}
//前置数据
console.log("前置数据");
var tmp = filterObjbyTg(location.query, ["ownerName"])
setReadyData(tmp)
//获取数据
setLoading(true)
RA(12, {
ownerName:null,
ownerName:location.query.ownerName != undefined ? (location.query.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])
useEffect(() => {
setPageStart(true)
},[])
},[location])
const goToDetail = (values:any,e:any) => {
SA(values)
......@@ -166,17 +179,17 @@ const Users = (props:any) => {
const CallBackTitleSearch = (comment: any)=>{
console.log(comment)
RA(12, {
ownerName: comment.OwnerName,
communityArray: comment.serviceCommunityList
}, module, dispatch);
changeValue("loading",true)
//页面搜索
comment.current = 1
history.push(location.pathname+urlEncode(filterObj({ ownerName: comment.OwnerName})))
}
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) => {
</div>
{/* 列表组件 */}
<Spin spinning={compent.loading}>
{
TestData != null ?
<>
<Table rowKey={"id"} style={{ marginTop: 16 }} dataSource={TestData.rows} columns={columns} pagination={TestData} onChange={pageChange} />
</>
: null
}
</Spin>
<Table
rowKey={"id"}
loading={loading}
style={{ marginTop: 16 }}
dataSource={Data!=null?Data.data.rows:[]}
columns={columns}
pagination={Data!=null? { current: pageNum, total: Data.data.rows.length } : {}}
onChange={pageChange} />
</div>
);
......
......@@ -10,6 +10,7 @@ import TitleGet from '../../components/TitleGet/TitleGet';
import TableShow from '../../components/TableShow/TableShow';
import { getCookie } from '@/utils/method';
import PictureOptions from '@/components/PictureOptions/PictureOptions';
const Guard = (props:any) => {
......@@ -33,12 +34,26 @@ const Guard = (props:any) => {
return (
<div className={styles.base}>
<TitleGet title={"Version 1.1.9"} />
<TitleGet title={"Version 1.2.2"} />
<p>
token:{page.token}
name:{getCookie("name")}
phone:{getCookie("phone")}
</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 /> */}
{/* <div>{token}</div>
<Line /> */}
......
import { requestList } from '@/utils/params';
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) {
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) {
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/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))
}
// /tos/community/facilities/fuzzy/query
//配置文件
// const yellowcolor ="\033[40;33m"
// // const bulecolor='\033[40;34m';
// 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) {
// console.log(playload)
// console.log(playload.index)
......@@ -129,23 +58,6 @@ export function RA(playload: any) {
return requestAuto(url,playload.body)
}
// 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
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
......@@ -4,7 +4,8 @@ export async function query(): Promise<any> {
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'}});
}
......
import {message } from 'antd';
import moment from 'moment';
export const checkParam = (values: any) => {
var flag = true
......@@ -137,3 +138,50 @@ export const filterObjbyTg = (obj:any,tg:any) => {
}
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 ={
required: 'Please enter,it is required!',
required: '*it is required!',
types: {
email: 'It is not validate email!',
number: '${label} is not a validate number!',
......@@ -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