Commit 16513394 authored by cellee's avatar cellee

权限绑定修改

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent b32b2ffc
...@@ -86,15 +86,15 @@ export default { ...@@ -86,15 +86,15 @@ export default {
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
'/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': { // '/tos/': {
// target: 'http://192.168.1.28:8651', // target: 'http://47.74.233.180:8651',
// changeOrigin: true, // changeOrigin: true,
// pathRewrite: { '^': '' }, // pathRewrite: { '^': '' },
// }, // },
'/tos/': {
target: 'http://192.168.1.28:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
}, },
}; };
...@@ -27,16 +27,11 @@ const Facilitys = (props: any) => { ...@@ -27,16 +27,11 @@ const Facilitys = (props: any) => {
const [previewTitle, setpreviewTitle] = useState(''); const [previewTitle, setpreviewTitle] = useState('');
// 图片地址 // 图片地址
const [previewImage, setpreviewImage] = useState(''); const [previewImage, setpreviewImage] = useState('');
// 默认Id //
const [idKey, setidKey] = useState(10001); const [idKey, setidKey] = useState(10001);
// 当前操作的Id
const [idPush, setidPush] = useState(null as any);
// 传递给后台加 key // 传递给后台加 key
const updetaTow = (key: any) => { const updetaTow = (key: any) => {
console.log(key);
setidPush(key);
let data = updata; let data = updata;
data.identification = key; data.identification = key;
return data; return data;
...@@ -63,12 +58,14 @@ const Facilitys = (props: any) => { ...@@ -63,12 +58,14 @@ const Facilitys = (props: any) => {
accept: '.jpeg,.png,.jpg', accept: '.jpeg,.png,.jpg',
action: '/tos/image/upload', action: '/tos/image/upload',
onChange(info: any) { onChange(info: any) {
// console.log(info);
if (info.file.status === 'done') { if (info.file.status === 'done') {
message.success(`${info.file.name} file uploaded successfully`); message.success(`${info.file.name} file uploaded successfully`);
// 后台返回的内容 // 后台返回的
let data = info.file.response.data; let data = info.file.response.data;
// 拿到key 值 开始存储 // 拿到key 值 开始存储
let key = parseInt(data.identification); let key = parseInt(data.identification);
// 重命名图片的名称 // 重命名图片的名称
info.file.name = data.imageName; info.file.name = data.imageName;
...@@ -84,8 +81,7 @@ const Facilitys = (props: any) => { ...@@ -84,8 +81,7 @@ const Facilitys = (props: any) => {
// 存储到mode里面去 // 存储到mode里面去
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
// 清除操作ID console.log(list);
setidPush(null);
} 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.`);
} }
...@@ -123,9 +119,9 @@ const Facilitys = (props: any) => { ...@@ -123,9 +119,9 @@ const Facilitys = (props: any) => {
//删除动作 //删除动作
const deleteImg = (key: any, id: any) => { const deleteImg = (key: any, id: any) => {
// console.log(key);
let list = FacilitysList; let list = FacilitysList;
// list[key].name = '';
list[key].name = '';
list.splice(key, 1); list.splice(key, 1);
// 存储到mode里面去 // 存储到mode里面去
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
...@@ -156,11 +152,6 @@ const Facilitys = (props: any) => { ...@@ -156,11 +152,6 @@ const Facilitys = (props: any) => {
dispatch({ type: module + '/genxin', list }); dispatch({ type: module + '/genxin', list });
}; };
//点击新增按钮
const handleChange = (a) => {
console.log(a);
};
return ( return (
<> <>
<Form.Item name="picList" required={false} style={{ marginBottom: 0 }}> <Form.Item name="picList" required={false} style={{ marginBottom: 0 }}>
...@@ -183,7 +174,6 @@ const Facilitys = (props: any) => { ...@@ -183,7 +174,6 @@ const Facilitys = (props: any) => {
onRemove={() => { onRemove={() => {
deleteImgs(index, item.id); deleteImgs(index, item.id);
}} //移除 }} //移除
// onChange={handleChange} // 点击确认
> >
{FacilitysList[index].fileList.length > 0 ? null : uploadButton} {FacilitysList[index].fileList.length > 0 ? null : uploadButton}
</Upload> </Upload>
......
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-01-27 17:23:53
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\CompanyInformation\CompanyInformation.tsx
*/
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, Button } from 'antd'; import { Input, Menu, Table, Space, Pagination, Tooltip, Button } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
const CompanyInformation = () => { const CompanyInformation = () => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Management Company</div> <div className={styles.box1item1}>Management Company :</div>
<div className={styles.box1item2}>Singapore Management Company</div> <div style={{ position: 'absolute', left: 160 }}>
<div className={styles.box1item3}> <Button>Edit</Button></div> <Input style={{ width: 200 }} value="TOS Pte Ltd" />
</div>
{/* <div className={styles.box1item3}> <Button>Edit</Button></div> */}
</div> </div>
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Contact Number</div> <div className={styles.box2item1}>Contact Number :</div>
<div className={styles.box2item2}><Input style={{width:200}} /></div> <div className={styles.box2item2}>
<Input style={{ width: 200 }} value="67441692" />
</div>
</div> </div>
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Contact Email</div> <div className={styles.box2item1}>Contact Email :</div>
<div className={styles.box2item2}><Input style={{width:200}}/></div> <div className={styles.box2item2}>
<Input style={{ width: 200 }} value="admin.tos@crems.com.sg" />
</div>
</div> </div>
</div> </div>
); );
}; };
export default CompanyInformation; export default CompanyInformation;
...@@ -2,41 +2,39 @@ ...@@ -2,41 +2,39 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px;
} }
.box1{ .box1 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box1item1{ .box1item1 {
position: absolute; position: absolute;
} }
.box1item2{ .box1item2 {
position: absolute; position: absolute;
left: 197px; left: 197px;
} }
.box1item3{ .box1item3 {
position: absolute; position: absolute;
right: 0; right: 0;
} }
.box2 {
.box2{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; margin-bottom: 28px;
margin-bottom: 28px; }
} .box2item1 {
.box2item1{ position: absolute;
position: absolute; }
} .box2item2 {
.box2item2{ position: absolute;
position: absolute; left: 158px;
left: 158px; }
}
\ No newline at end of file
...@@ -88,9 +88,7 @@ const SystemFeedback = (props: any) => { ...@@ -88,9 +88,7 @@ const SystemFeedback = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
Refresh();
},
setting: false, setting: false,
}} }}
loading={loading} loading={loading}
......
...@@ -284,9 +284,7 @@ const Account = (props: any) => { ...@@ -284,9 +284,7 @@ const Account = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
Refresh();
},
setting: false, setting: false,
}} }}
headerTitle="Account list" headerTitle="Account list"
......
...@@ -36,7 +36,9 @@ const Account = (props: any) => { ...@@ -36,7 +36,9 @@ const Account = (props: any) => {
const { Option } = Select; const { Option } = Select;
//二级账户列表 //二级账户列表
const towAccount = JSON.parse(localStorage.getItem('towAccount') || '[]'); const towAccount = JSON.parse(
localStorage.getItem('towAccount') || '[{"id":1,"tosAccountName":"2"}]',
);
// 当前账户权限 // 当前账户权限
useEffect(() => { useEffect(() => {
...@@ -73,7 +75,7 @@ const Account = (props: any) => { ...@@ -73,7 +75,7 @@ const Account = (props: any) => {
// 且禁用最后两个账户管理 // 且禁用最后两个账户管理
_p[_p.length - 1].children[2].disableCheckbox = true; _p[_p.length - 1].children[2].disableCheckbox = true;
_p[_p.length - 1].children[3].disableCheckbox = true; _p[_p.length - 1].children[3].disableCheckbox = true;
} else { } else if (values == 3) {
// 如果是一级账户获取挂靠的二级账户名称 // 如果是一级账户获取挂靠的二级账户名称
RA(56, {}, module, dispatch); // 权限上传 RA(56, {}, module, dispatch); // 权限上传
} }
...@@ -261,15 +263,6 @@ const Account = (props: any) => { ...@@ -261,15 +263,6 @@ const Account = (props: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, '')); return getNumber(value.replace(/[^\d^\.]+/g, ''));
}; };
// 二级账户
const listItems = towAccount.map((item: any) => {
return (
<Option key={item.id} value={item.id}>
{item.tosAccountName}
</Option>
);
});
// 选择哪个二级账号 // 选择哪个二级账号
const handleChange = (value: any) => { const handleChange = (value: any) => {
RA(57, { tosUserLevelId: value }, module, dispatch); // 根据用户id获取用户管辖小区名和权限 RA(57, { tosUserLevelId: value }, module, dispatch); // 根据用户id获取用户管辖小区名和权限
...@@ -343,7 +336,15 @@ const Account = (props: any) => { ...@@ -343,7 +336,15 @@ const Account = (props: any) => {
onChange={handleChange} onChange={handleChange}
placeholder="Please select affiliated account" placeholder="Please select affiliated account"
> >
{towAccount ? listItems : ''} {towAccount
? towAccount.map((item: any) => {
return (
<Option key={item.id} value={item.id}>
{item.tosAccountName}
</Option>
);
})
: ''}
</Select> </Select>
) : ( ) : (
'' ''
......
...@@ -29,7 +29,8 @@ const Account = (props: any) => { ...@@ -29,7 +29,8 @@ const Account = (props: any) => {
const [towAccountId, settowAccountId] = useState(null); // 二级账户id const [towAccountId, settowAccountId] = useState(null); // 二级账户id
//提醒次数 //提醒次数
const [frequency, setfrequency] = useState(0); // 权限列表 // const [frequency, setfrequency] = useState(0); // 权限列表
const [TreeDisabled, setTreeDisabled] = useState(true); // 权限是否可编辑
// 表单标识 // 表单标识
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -56,6 +57,14 @@ const Account = (props: any) => { ...@@ -56,6 +57,14 @@ const Account = (props: any) => {
settowAccountId(DataSave.userLeader); //上级id settowAccountId(DataSave.userLeader); //上级id
} }
// 二级账户可以编辑下级但不可编辑自身
if (
user.currentUser.userModel.tosUserLevel == 1 ||
(user.currentUser.userModel.tosUserLevel == 2 && DataSave.tosUserLevel == 3)
) {
setTreeDisabled(false);
}
// 发起获取权限请求 // 发起获取权限请求
RA(54, { tosUserName: DataSave.tosUserName }, module, dispatch); // 发起获取权限请求 RA(54, { tosUserName: DataSave.tosUserName }, module, dispatch); // 发起获取权限请求
} else { } else {
...@@ -175,6 +184,7 @@ const Account = (props: any) => { ...@@ -175,6 +184,7 @@ const Account = (props: any) => {
value.userLeader = towAccountId; value.userLeader = towAccountId;
} }
delete value.community; delete value.community;
// 编辑的时候传id 新增则没有
DataSave ? (value.id = DataSave.id) : ''; DataSave ? (value.id = DataSave.id) : '';
// 判断有没有 0 有就删除 // 判断有没有 0 有就删除
...@@ -313,7 +323,7 @@ const Account = (props: any) => { ...@@ -313,7 +323,7 @@ const Account = (props: any) => {
cancelText: 'No', cancelText: 'No',
onOk() { onOk() {
setCheckedKeys(checkedKeys); setCheckedKeys(checkedKeys);
setfrequency(1); // setfrequency(1);
}, },
onCancel() {}, onCancel() {},
}); });
...@@ -380,7 +390,7 @@ const Account = (props: any) => { ...@@ -380,7 +390,7 @@ const Account = (props: any) => {
<Descriptions column={{ xs: 1, sm: 1, md: 2, xl: 3 }}> <Descriptions column={{ xs: 1, sm: 1, md: 2, xl: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0] as any}> <Form.Item name="tosUserName" label="Account ID" rules={AccountTip[0] as any}>
<Input placeholder="Login Account" className="input" /> <Input placeholder="Login Account" className="input" disabled />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
...@@ -407,10 +417,10 @@ const Account = (props: any) => { ...@@ -407,10 +417,10 @@ const Account = (props: any) => {
<div className="label"> <div className="label">
<Radio.Group value={values} onChange={onRadio}> <Radio.Group value={values} onChange={onRadio}>
<Radio style={radioStyle} disabled value={2}> <Radio style={radioStyle} disabled value={2}>
Two Level Administrator Second Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} disabled value={3}> <Radio style={radioStyle} disabled value={3}>
Three Level Administrator Third Level Administrator
</Radio> </Radio>
</Radio.Group> </Radio.Group>
...@@ -451,7 +461,7 @@ const Account = (props: any) => { ...@@ -451,7 +461,7 @@ const Account = (props: any) => {
onSelect={onSelect} onSelect={onSelect}
selectedKeys={selectedKeys} selectedKeys={selectedKeys}
treeData={treeDataList} treeData={treeDataList}
disabled={user && user.currentUser.userModel.tosUserLevel != 1 ? true : false} disabled={TreeDisabled}
/> />
</div> </div>
</div> </div>
......
...@@ -13,7 +13,7 @@ import { RA } from '@/utils/method'; ...@@ -13,7 +13,7 @@ import { RA } from '@/utils/method';
const Account = (props: any) => { const Account = (props: any) => {
const module = 'Account'; const module = 'Account';
const { Option } = Select; const { Option } = Select;
const { dispatch, SubResult, loading, user, DataSave, Permission } = props; const { dispatch, SubResult, loading, user, DataSave, Permission, Info } = props;
// 权限列表 // 权限列表
const treeData = localStorage.getItem('umi_locale') == 'zh-CN' ? zhCnFaci : enUsFaci; const treeData = localStorage.getItem('umi_locale') == 'zh-CN' ? zhCnFaci : enUsFaci;
...@@ -26,7 +26,7 @@ const Account = (props: any) => { ...@@ -26,7 +26,7 @@ const Account = (props: any) => {
// 单选 二级还是三级管理员 // 单选 二级还是三级管理员
const [values, setvalues] = useState(2); // 树形菜单展开关闭 const [values, setvalues] = useState(2); // 树形菜单展开关闭
const [towAccountId, settowAccountId] = useState(null); // 二级账户id const [towAccountId, settowAccountId] = useState(null as any); // 二级账户id
//提醒次数 //提醒次数
// const [frequency, setfrequency] = useState(0); // 权限列表 // const [frequency, setfrequency] = useState(0); // 权限列表
...@@ -55,6 +55,9 @@ const Account = (props: any) => { ...@@ -55,6 +55,9 @@ const Account = (props: any) => {
if (DataSave.tosUserLevel == 3) { if (DataSave.tosUserLevel == 3) {
settowAccountId(DataSave.userLeader); //上级id settowAccountId(DataSave.userLeader); //上级id
// 获取列表
RA(56, {}, module, dispatch); // 获取三级
} }
// 二级账户可以编辑下级但不可编辑自身 // 二级账户可以编辑下级但不可编辑自身
...@@ -354,16 +357,183 @@ const Account = (props: any) => { ...@@ -354,16 +357,183 @@ const Account = (props: any) => {
marginBottom: '15px', marginBottom: '15px',
}; };
/* -------------------------- 2021年1月27日 更新----------------------------------- */
//级别切换 //级别切换
const onRadio = (e: any) => { const onRadio = (e: any) => {
setvalues(e.target.value);
// setCheckedKeys([]); // setCheckedKeys([]);
if (e.target.value == 2) { if (e.target.value == 2) {
//否则打开 //否则打开
settowAccountId(null); settowAccountId(null);
setvalues(e.target.value);
// 原本是二级的话就要还原之前的
if (DataSave.tosUserLevel == 2) {
power2();
} else {
power3(user.currentUser.permission);
}
} else if (DataSave.subordinateAccountStatus == 1) {
message.info('There Is A Subordinate Acount And Cannot Be Modified !');
// setvalues(2);
return false;
} else {
setvalues(e.target.value);
RA(56, {}, module, dispatch); // 获取三级
} }
}; };
// 二级管辖小区和权限
useEffect(() => {
if (Info != null) {
power(Info.permissions);
setCheckedKeys([]);
}
}, [Info]);
//权限赋值
const power = (val: any) => {
let _tmp = JSON.stringify(treeData); //将对象转换为json字符串形式
let treeDatas = JSON.parse(_tmp); //将转换而来的字符串转换为原生js对
let _a = val; // 当前账户权限
let _p = treeDatas[0].children; // 所有权限列表
let arr: any = []; // 一级栏目权限
let erArr: any = []; // 一级栏目权限
// 循环一级 判断当前账户有没有权限修改增加
for (let i of _a) {
for (let j in _p) {
if (_p[j].key == i) {
arr.push(_p[j].key);
_p[j].disabled = false;
}
// 二级权限
for (let k in _p[j].children) {
if (_p[j].children[k].key == i) {
erArr.push(_p[j].children[k].key);
_p[j].children[k].disableCheckbox = false;
}
}
}
}
// 且禁用最后两个账户管理
_p[_p.length - 1].children[2].disableCheckbox = true;
_p[_p.length - 1].children[3].disableCheckbox = true;
// 赋值改变
treeDatas[0].children = _p;
settreeDataList(treeDatas as any); // 可勾选列表
};
//权限恢复 2->3->2
const power2 = () => {
let data = Permission.curUserPermission ? Permission.curUserPermission.split(',') : [];
let dataTow = Permission.beloginPermission ? Permission.beloginPermission.split(',') : [];
// 深拷贝权限列表
let treeDatas = JSON.parse(JSON.stringify(treeData));
// 如果是三级账户 可编辑的就是 上级权限,否者是登录的账户权限
let _a = DataSave.tosUserLevel == 3 ? dataTow : user.currentUser.permission; // 当前账户权限
let _p = treeDatas[0].children; // 所有权限列表
let arr: any = []; // 一级栏目权限
let erArr: any = []; // 一级栏目权限
// 循环一级 判断当前账户有没有权限修改增加
for (let i of _a) {
for (let j in _p) {
if (_p[j].key == i) {
arr.push(_p[j].key);
_p[j].disabled = false;
}
// 二级权限
for (let k in _p[j].children) {
if (_p[j].children[k].key == i) {
erArr.push(_p[j].children[k].key);
_p[j].children[k].disableCheckbox = false;
}
}
}
}
// 赋值 可勾选的权限
treeDatas[0].children = _p;
settreeDataList([...treeDatas]);
//-----------------分割--------------------
// 在解决默认已勾选的值
for (let i in _p) {
let arr = _p[i].children; // 每个权限
let newArr = []; // 每个权限下的子权限列表
for (let j in arr) {
newArr.push(arr[j].key);
}
if (!newArr.every((val) => data.includes(val))) {
// 判断数组是否包含另一个数组
// console.log('不包含' + _p[i].key);
// 不全部包含就删除数组的元素
var index = data.indexOf(_p[i].key);
if (index > -1) {
data.splice(index, 1);
}
}
}
// 再赋值给列表
if (DataSave.tosUserLevel == 3) {
// 且禁用最后两个账户管理
_p[_p.length - 1].children[2].disableCheckbox = true;
_p[_p.length - 1].children[3].disableCheckbox = true;
}
setCheckedKeys(data);
};
//权限恢复 3-> 2
const power3 = (val: any) => {
let _tmp = JSON.stringify(treeData); //将对象转换为json字符串形式
let treeDatas = JSON.parse(_tmp); //将转换而来的字符串转换为原生js对
let _a = val; // 当前账户权限
let _p = treeDatas[0].children; // 所有权限列表
let arr: any = []; // 一级栏目权限
let erArr: any = []; // 一级栏目权限
// 循环一级 判断当前账户有没有权限修改增加
for (let i of _a) {
for (let j in _p) {
if (_p[j].key == i) {
arr.push(_p[j].key);
_p[j].disabled = false;
}
// 二级权限
for (let k in _p[j].children) {
if (_p[j].children[k].key == i) {
erArr.push(_p[j].children[k].key);
_p[j].children[k].disableCheckbox = false;
}
}
}
}
// 赋值改变
treeDatas[0].children = _p;
settreeDataList(treeDatas as any); // 可勾选列表
};
//二级账户列表
const towAccount = JSON.parse(
localStorage.getItem('towAccount') || '[{"id":1,"tosAccountName":"test"}]',
);
console.log(towAccount);
// 选择哪个二级账号
const handleChange = (value: any) => {
RA(57, { tosUserLevelId: value }, module, dispatch); // 根据用户id获取用户管辖小区名和权限
settowAccountId(value);
};
/* --------------------------- 更新 End---------------------------------- */
return ( return (
<Spin spinning={loading}> <Spin spinning={loading}>
<div className="contop" style={{ padding: '12px 20px' }}> <div className="contop" style={{ padding: '12px 20px' }}>
...@@ -415,11 +585,15 @@ const Account = (props: any) => { ...@@ -415,11 +585,15 @@ const Account = (props: any) => {
<span className="title">Privilege Level:</span> <span className="title">Privilege Level:</span>
</div> </div>
<div className="label"> <div className="label">
<Radio.Group value={values} onChange={onRadio}> <Radio.Group
<Radio style={radioStyle} disabled value={2}> value={values}
onChange={onRadio}
disabled={user.currentUser.userModel.tosUserLevel != 1}
>
<Radio style={radioStyle} value={2}>
Second Level Administrator Second Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} disabled value={3}> <Radio style={radioStyle} value={3}>
Third Level Administrator Third Level Administrator
</Radio> </Radio>
</Radio.Group> </Radio.Group>
...@@ -429,16 +603,29 @@ const Account = (props: any) => { ...@@ -429,16 +603,29 @@ const Account = (props: any) => {
<Select <Select
style={{ width: 260 }} style={{ width: 260 }}
placeholder="Please select affiliated account" placeholder="Please select affiliated account"
disabled defaultValue={towAccountId}
defaultValue={DataSave.userLeader} onChange={handleChange}
> >
{DataSave ? ( {towAccount
? towAccount.map((item: any) => {
return (
<Option
key={item.id}
value={item.id}
disabled={DataSave && item.id == DataSave.id}
>
{item.tosAccountName}
</Option>
);
})
: ''}
{/* {DataSave ? (
<Option key={DataSave.userLeader} value={DataSave.userLeader}> <Option key={DataSave.userLeader} value={DataSave.userLeader}>
{DataSave.userLeaderAccountName} {DataSave.userLeaderAccountName}
</Option> </Option>
) : ( ) : (
'' ''
)} )} */}
</Select> </Select>
) : ( ) : (
'' ''
......
...@@ -159,9 +159,10 @@ const CellLists = (props: any) => { ...@@ -159,9 +159,10 @@ const CellLists = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { // reload: () => {
resetHandler(); // resetHandler();
}, // },
reload: false,
setting: false, setting: false,
}} }}
headerTitle="Community List" headerTitle="Community List"
......
...@@ -248,9 +248,7 @@ const CommunityAnnouncement = (props: any) => { ...@@ -248,9 +248,7 @@ const CommunityAnnouncement = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
onReset();
},
setting: false, setting: false,
}} }}
headerTitle="Announcement list" headerTitle="Announcement list"
......
...@@ -235,12 +235,7 @@ const BookingDetail = (props: any) => { ...@@ -235,12 +235,7 @@ const BookingDetail = (props: any) => {
<InputNumber <InputNumber
placeholder="00.00" placeholder="00.00"
min={0} min={0}
max={ max={parseInt(DataSaveDetail.marginFee).toFixed(2) as any}
(
parseInt(DataSaveDetail.marginFee) +
parseInt(DataSaveDetail.managerFee)
).toFixed(2) as any
}
maxLength={6} maxLength={6}
step={0.01} step={0.01}
prefix="$" prefix="$"
......
...@@ -431,7 +431,7 @@ const Facility = (props: any) => { ...@@ -431,7 +431,7 @@ const Facility = (props: any) => {
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="No Deposit To Cancel Reservation" label="Cancel Reservation Without Payment"
name="nomarginCancelReservationDay" name="nomarginCancelReservationDay"
rules={NewFaci[6]} rules={NewFaci[6]}
> >
...@@ -460,7 +460,7 @@ const Facility = (props: any) => { ...@@ -460,7 +460,7 @@ const Facility = (props: any) => {
{/* 设置次数 */} {/* 设置次数 */}
<Input.Group> <Input.Group>
<Form.Item label="Booking Quotas" rules={NewFaci[8]}> <Form.Item label="Booking Limits" rules={NewFaci[8]}>
<Select <Select
placeholder="Cycle" placeholder="Cycle"
allowClear allowClear
......
...@@ -400,9 +400,7 @@ const FacilityBookings = (props: any) => { ...@@ -400,9 +400,7 @@ const FacilityBookings = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
onReset();
},
setting: false, setting: false,
}} }}
// headerTitle="预约列表" // headerTitle="预约列表"
......
...@@ -106,10 +106,6 @@ const FacilityTow = (props: any) => { ...@@ -106,10 +106,6 @@ const FacilityTow = (props: any) => {
}, },
], ],
}; };
// 设施图片列表默认值
form.setFieldsValue({
['shebei_' + index]: item.categoriesName,
});
return sam; return sam;
}) })
: []; : [];
...@@ -448,7 +444,7 @@ const FacilityTow = (props: any) => { ...@@ -448,7 +444,7 @@ const FacilityTow = (props: any) => {
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="No Deposit To Cancel Reservation" label="Cancel Reservation Without Payment"
name="nomarginCancelReservationDay" name="nomarginCancelReservationDay"
rules={NewFaci[6]} rules={NewFaci[6]}
> >
...@@ -477,7 +473,7 @@ const FacilityTow = (props: any) => { ...@@ -477,7 +473,7 @@ const FacilityTow = (props: any) => {
{/* 设置次数 */} {/* 设置次数 */}
<Input.Group> <Input.Group>
<Form.Item label="Booking Quotas" rules={NewFaci[8]}> <Form.Item label="Booking Limits" rules={NewFaci[8]}>
<Select <Select
placeholder="Cycle" placeholder="Cycle"
allowClear allowClear
......
...@@ -240,9 +240,7 @@ const VisitorRecord = (props: any) => { ...@@ -240,9 +240,7 @@ const VisitorRecord = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
onReset();
},
setting: false, setting: false,
}} }}
headerTitle="Visitor List" headerTitle="Visitor List"
......
...@@ -240,9 +240,7 @@ const VisitorRecord = (props: any) => { ...@@ -240,9 +240,7 @@ const VisitorRecord = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
onReset();
},
setting: false, setting: false,
}} }}
headerTitle="Visitor List" headerTitle="Visitor List"
......
...@@ -51,7 +51,7 @@ const Contract = (props: any) => { ...@@ -51,7 +51,7 @@ const Contract = (props: any) => {
render: function (record: any) { render: function (record: any) {
let mom = moment(record.contractValidEndDate).diff(moment(), 'months'); let mom = moment(record.contractValidEndDate).diff(moment(), 'months');
// console.log(mom); // console.log(mom);
if (mom < 2) { if (mom < 3) {
return ( return (
<Tooltip title="Due Soon" placement="right" color={'red'} key={record.id}> <Tooltip title="Due Soon" placement="right" color={'red'} key={record.id}>
<span className={styles.red}>{record.contractNumber}</span> <span className={styles.red}>{record.contractNumber}</span>
...@@ -210,9 +210,7 @@ const Contract = (props: any) => { ...@@ -210,9 +210,7 @@ const Contract = (props: any) => {
options={{ options={{
density: false, density: false,
fullScreen: false, fullScreen: false,
reload: () => { reload: false,
onReset();
},
setting: false, setting: false,
}} }}
headerTitle="Contract list" headerTitle="Contract list"
......
...@@ -35,7 +35,7 @@ const contentState = { ...@@ -35,7 +35,7 @@ const contentState = {
fileList: [], // 图片列表 fileList: [], // 图片列表
uploadUp: true, // 禁止上传 直到选择了小区后 uploadUp: true, // 禁止上传 直到选择了小区后
comtyName: null, // 已选小区名字 comtyName: null, // 已选小区名字
tipTime: ['previous month', 'two months'], //时间提示 tipTime: ['previous month', 'two months', 'there months'], //时间提示
tipModal: false, //附件弹窗 tipModal: false, //附件弹窗
fileInfo: null, //附件内容 fileInfo: null, //附件内容
numPages: 1, // pdf 总页码数 numPages: 1, // pdf 总页码数
...@@ -45,7 +45,7 @@ const contentState = { ...@@ -45,7 +45,7 @@ const contentState = {
imgLoad: false, //本地图片上传加载 imgLoad: false, //本地图片上传加载
}; };
// 方法 // 方法
const contentReducer = (state, action) => { const contentReducer = (state: any, action: any) => {
switch (action.type) { switch (action.type) {
case 'setFileList': // 改变图片列表 case 'setFileList': // 改变图片列表
return { ...state, fileList: action.payload }; return { ...state, fileList: action.payload };
...@@ -119,15 +119,12 @@ const ContractContent = (props: any) => { ...@@ -119,15 +119,12 @@ const ContractContent = (props: any) => {
dispatchs({ type: 'setUploadUp', payload: false }); dispatchs({ type: 'setUploadUp', payload: false });
// 提示时间 // 提示时间
let a1 = moment(DataSaveDetail.contractValidEndDate) let a1 = timeOver(DataSaveDetail.contractValidEndDate, 2);
.subtract(2, 'month') let a2 = timeOver(DataSaveDetail.contractValidEndDate, 1);
.format('YYYY-MM-DD'); let a3 = timeOver(DataSaveDetail.contractValidEndDate, 3);
let a2 = moment(DataSaveDetail.contractValidEndDate)
.subtract(1, 'month')
.format('YYYY-MM-DD');
// setTipTime([a1, a2]); // setTipTime([a1, a2]);
dispatchs({ type: 'setTipTime', payload: [a1, a2] }); dispatchs({ type: 'setTipTime', payload: [a3, a1, a2] });
// 给到上传绑定 // 给到上传绑定
// setComtyName(DataSaveDetail.communityName); // setComtyName(DataSaveDetail.communityName);
...@@ -144,6 +141,11 @@ const ContractContent = (props: any) => { ...@@ -144,6 +141,11 @@ const ContractContent = (props: any) => {
} }
}, [DataSaveDetail]); }, [DataSaveDetail]);
// 时间转换
const timeOver = (time: any, day: any) => {
return moment(time).subtract(day, 'month').format('YYYY-MM-DD');
};
// 监听上传图片列表 // 监听上传图片列表
useEffect(() => { useEffect(() => {
if (FileImg != null) { if (FileImg != null) {
...@@ -249,10 +251,11 @@ const ContractContent = (props: any) => { ...@@ -249,10 +251,11 @@ const ContractContent = (props: any) => {
// // 设置提示倒计时 // // 设置提示倒计时
const changeTime = (data: any, dateStrings: any) => { const changeTime = (data: any, dateStrings: any) => {
if (data != null) { if (data != null) {
let a1 = moment(data[1]).subtract(2, 'month').format('YYYY-MM-DD'); let a1 = timeOver(data[1], 2);
let a2 = moment(data[1]).subtract(1, 'month').format('YYYY-MM-DD'); let a2 = timeOver(data[1], 1);
let a3 = timeOver(data[1], 3);
// setTipTime([a1, a2]); // setTipTime([a1, a2]);
dispatchs({ type: 'setTipTime', payload: [a1, a2] }); dispatchs({ type: 'setTipTime', payload: [a3, a1, a2] });
} }
}; };
...@@ -505,7 +508,8 @@ const ContractContent = (props: any) => { ...@@ -505,7 +508,8 @@ const ContractContent = (props: any) => {
<p style={{ marginBottom: 0 }}> <p style={{ marginBottom: 0 }}>
The system will send e-mail notification in the{' '} The system will send e-mail notification in the{' '}
<span style={{ color: 'red' }}>{state.tipTime[0]}</span> and{' '} <span style={{ color: 'red' }}>{state.tipTime[0]}</span> and{' '}
<span style={{ color: 'red' }}>{state.tipTime[1]}</span> that the contract is <span style={{ color: 'red' }}>{state.tipTime[1]}</span> and{' '}
<span style={{ color: 'red' }}>{state.tipTime[2]}</span> that the contract is
about to expire ! about to expire !
</p> </p>
<p style={{ marginBottom: 0 }}> <p style={{ marginBottom: 0 }}>
......
...@@ -186,9 +186,7 @@ const ChargeManager = (props: any) => { ...@@ -186,9 +186,7 @@ const ChargeManager = (props: any) => {
options={{ options={{
density: true, density: true,
fullScreen: true, fullScreen: true,
reload: () => { reload: false,
resetHandler();
},
setting: false, setting: false,
}} }}
/> />
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2020-11-19 20:34:18 * @Date: 2020-11-19 20:34:18
* @LastEditTime: 2021-01-20 17:30:05 * @LastEditTime: 2021-01-27 14:48:03
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \tostumi\src\utils\params.ts * @FilePath: \tostumi\src\utils\params.ts
...@@ -88,8 +88,8 @@ export const requestList = [ ...@@ -88,8 +88,8 @@ export const requestList = [
['/tos/tosServiceScope/cancel', '53 删除服务范围'], ['/tos/tosServiceScope/cancel', '53 删除服务范围'],
['/tos/user/permission/get', '54 根据用户名称获取用户权限', {}], ['/tos/user/permission/get', '54 根据用户名称获取用户权限', {}],
['/tos/tosCommunity/get/user', '55 根据用户id获取用户管辖小区名', {}], ['/tos/tosCommunity/get/user', '55 根据用户id获取用户管辖小区名', {}],
['/tos/user/twoLevel/get', '56 获取二级账号', {}], ['/tos/user/twoLevel/get', '56 获取二级账号列表', {}],
['/tos/user/twoLevel/get/CommunityAuth', '57 根据户id获取用户管辖小区名和权限', {}], ['/tos/user/twoLevel/get/CommunityAuth', '57 根据二级账户id获取用户管辖小区名和权限', {}],
['/tos/community/categories/subscribe/reservationInfo', '58 获取小区设施可预约次数', {}], ['/tos/community/categories/subscribe/reservationInfo', '58 获取小区设施可预约次数', {}],
['/tos/bug/feedback/list', '59 获取用户反馈列表', {}], ['/tos/bug/feedback/list', '59 获取用户反馈列表', {}],
['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}], ['/tos/community/facilities/get/detail', '60 获取小区设施详情', {}],
......
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