Commit 8a8364cb authored by cellee's avatar cellee

重做权限管理页面

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 5a981862
......@@ -21,6 +21,7 @@ const TitleSearch = (props: any) => {
defaultValue,
time,
username,
searchNone, // 隐藏搜索框
} = props;
const key = props.listkey;
......@@ -184,15 +185,19 @@ const TitleSearch = (props: any) => {
/>
) : null}
<Form.Item style={{ marginBottom: 5 }}>
<Button
type="primary"
htmlType="submit"
style={{ backgroundColor: '#e7f4ff', color: 'rgba(24,144,255,1)' }}
>
<SearchOutlined /> Search
</Button>
</Form.Item>
{searchNone == null ? (
<Form.Item style={{ marginBottom: 5 }}>
<Button
type="primary"
htmlType="submit"
style={{ backgroundColor: '#e7f4ff', color: 'rgba(24,144,255,1)' }}
>
<SearchOutlined /> Search
</Button>
</Form.Item>
) : (
''
)}
</>
) : null}
</Form>
......
......@@ -58,6 +58,12 @@ export default {
yield put({ type: 'returnPage', Data });
}
break;
case 51:
{
let Data = resp.data;
yield put({ type: 'returnPage', Data });
}
break;
}
}
},
......
......@@ -3,10 +3,47 @@
padding: 20px;
border-right: 4px;
margin-bottom: 15px;
h3 {
margin-bottom: 0;
position: relative;
.back {
position: absolute;
right: 0;
top: 0;
top: -2px;
background: #fff;
}
}
.capi {
text-transform: capitalize;
line-height: 34px;
}
.pages {
text-align: right;
padding: 10px;
}
.ant-descriptions-row > th,
.ant-descriptions-row > td {
margin-bottom: 0;
padding-bottom: 0;
}
.ant-form-item-label,
.label {
min-width: 100px;
}
.label {
span.title {
line-height: 32px;
display: block;
text-align: right;
}
}
.input {
width: 180px;
}
.diy {
display: flex;
}
}
.contop2 {
padding: 0 10px 20px;
......
import React, { useState, useEffect } from 'react';
import { Form, Input, Button, Pagination } from 'antd';
import { Form, Input, Button, Pagination, message } from 'antd';
import { connect, history } from 'umi';
import { SearchOutlined, ClearOutlined, PlusOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table';
......@@ -15,24 +15,22 @@ const Account = (props: any) => {
dispatch({ type: 'Account/RA', playload: { index: index, body: values } });
};
// 数据
useEffect(() => {
let obj = {
leaderID: getCookie('id'),
};
RA(45, obj);
}, [1]); //页面进来执行一次
// 数据
useEffect(() => {
if (Data == null) {
let obj = {
leaderID: getCookie('id'),
pageNum: 1,
};
RA(45, obj);
// RA(45, obj);
setTerm(obj);
RA(51, obj);
}
}, [Data]); //页面进来执行一次
// 拉取数据的条件存储
const [term, setTerm] = useState({} as any);
// 表单标识
const [form] = Form.useForm();
......@@ -109,12 +107,36 @@ const Account = (props: any) => {
},
];
// 编辑- 新增
const edit = (item: any) => {
history.push('./account/edit');
};
// 停用账号
const lockS = (item: any) => {};
// 表头单搜索
const onFinishContract = (value: any) => {
if (value.creatorName || value.accountName) {
let t = { ...term, ...value };
delete t.pageNum; // 搜索的时候 删除页码
setTerm(t);
RA(51, t);
} else {
message.error('Enter At Least One Entry!');
}
};
// 页码切换
const sopens = (page: any) => {
let p = {
pageNum: page,
};
let t = { ...term, ...p };
setTerm(t);
RA(51, t);
};
return (
<>
<div className="contop">
......@@ -123,12 +145,12 @@ const Account = (props: any) => {
layout="inline"
form={form}
name="contract"
// onFinish={onFinishContract}
onFinish={onFinishContract}
>
<Form.Item name="username">
<Form.Item name="accountName">
<Input allowClear placeholder="Account Name" />
</Form.Item>
<Form.Item name="creator">
<Form.Item name="creatorName">
<Input allowClear placeholder="Account Creator" />
</Form.Item>
<Form.Item>
......@@ -153,7 +175,7 @@ const Account = (props: any) => {
<ProTable
// request={requestHeadl}
rowKey={'id'}
dataSource={Data ? Data.rows : null}
dataSource={Data ? Data.list : null}
columns={columns}
pagination={false} // 隐藏默认分页
search={false}
......@@ -185,9 +207,10 @@ const Account = (props: any) => {
<div className="pages">
<Pagination
// onShowSizeChange={pageSizeHandler}
// current={Data.total}
total={Data ? Data.total : 0}
pageSize={Data ? Data.total : 0}
current={Data ? Data.page.currentPage : 0}
onChange={sopens}
total={Data ? Data.page.totalRow : 0}
pageSize={Data ? Data.page.curPageSize : 0}
/>
</div>
</div>
......
This diff is collapsed.
......@@ -29,8 +29,6 @@ const Add = (props: any) => {
// 图片地址
const [ImageSrc, setImageSrc] = useState([] as any);
console.log(ImgSrc);
// 监听传递过来的值
useEffect(() => {
if (DataSave != null) {
......@@ -134,7 +132,6 @@ const Add = (props: any) => {
ref={formRef}
form={form}
// {...layout}
name="nest-messages"
onFinish={onFinish}
validateMessages={validateMessages}
>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './ContractContent.less';
import { Input, Form, message, Upload, Button, DatePicker, Space } from 'antd';
import { Input, Form, message, Upload, Button, DatePicker, Space, Modal } from 'antd';
import { PlusOutlined, LeftOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch, Loading } from 'umi';
......@@ -18,8 +18,6 @@ import locale from 'antd/es/date-picker/locale/en_US';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
import { tipList } from '@/utils/tip';
import FileViewer from 'react-file-viewer';
const ContractContent = (props: any) => {
const { ContractModel, dispatch } = props;
const { RangePicker } = DatePicker; // 日期组件
......@@ -32,14 +30,12 @@ const ContractContent = (props: any) => {
function disabledDate(current: any) {
return current && current <= moment().subtract(1, 'days').endOf('day');
}
const startTime = moment().format('YYYY-MM-DD'); // 开始默认事件
const overTime = moment().add(1, 'month').format('YYYY-MM-DD'); // 结束默认事件
const [fileList, setFileList] = useState([] as any); // 图片列表
const [uploadUp, setUploadUp] = useState(true); // 禁止上传 直到选择了小区后
const [comtyName, setComtyName] = useState(null); // 小区名字
console.log(tipList);
const [tipTime, setTipTime] = useState(['previous month', 'two months'] as any); //提示时间
const [tipModal, settipModal] = useState(false); //附件弹窗
useEffect(() => {
// 如果是添加传来没有值的时候 就清空 否则 赋值给表单
......@@ -58,15 +54,23 @@ const ContractContent = (props: any) => {
uid: i,
name: arr[i],
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.pdf',
};
obj.push(a);
}
setFileList([...obj]);
// setFileList([{ uid: 1,name:DataSaveDetail.contractFileName }])
// 提示时间
let a1 = moment(ContractModel.record.contractValidEndDate)
.subtract(2, 'month')
.format('YYYY-MM-DD');
let a2 = moment(ContractModel.record.contractValidEndDate)
.subtract(1, 'month')
.format('YYYY-MM-DD');
setTipTime([a1, a2]);
// 表单内容
form.setFieldsValue({
...ContractModel.record,
time: [
......@@ -77,6 +81,7 @@ const ContractContent = (props: any) => {
}
}, [1]);
// 返回
const goToReturn = () => {
// console.log(fileList)
history.back();
......@@ -118,22 +123,16 @@ const ContractContent = (props: any) => {
},
};
// 时间提示
// let tipTime = moment(defForm.time[1]).subtract(25, 'days').format('YYYY-MM-DD');
// let dec = moment(tipTime).diff(startTime,'days') > 1 ? tipTime : 'Due soon';
// const [stateTime,setmodalTime] = useState(dec); // 监听时间变化 -- 结束时间
// // 设置提示倒计时 25 天
// // 设置提示倒计时
const changeTime = (data: any, dateStrings: any) => {
// if(overTime != dateStrings[1]){
// moment(dateStrings[1]).diff(startTime,'days') > 25 ?
// setmodalTime(moment(dateStrings[1]).subtract(25, 'days').format('YYYY-MM-DD')) :
// setmodalTime('Due soon');
// }
// form.setFieldsValue({
// 'time' : [moment(dateStrings[0]),moment(dateStrings[1])]
// })
if (data != null) {
let a1 = moment(data[1]).subtract(2, 'month').format('YYYY-MM-DD');
let a2 = moment(data[1]).subtract(1, 'month').format('YYYY-MM-DD');
setTipTime([a1, a2]);
}
console.log(dateStrings);
};
// 选择小区名字并赋值
const opname = (value: any) => {
// 打开上传 如果选择了 小区就打开 否则 禁止上传
......@@ -148,6 +147,16 @@ const ContractContent = (props: any) => {
});
};
//点击预览
const onPreviews = () => {
console.log('预览');
settipModal(true);
};
// 关闭预览
const handleCancel = () => {
settipModal(false);
};
return (
<div className={styles.base}>
{/* 头部组件 */}
......@@ -241,7 +250,7 @@ const ContractContent = (props: any) => {
defaultValue={ContractModel.time}
disabledDate={disabledDate}
placeholder={['Effective Date', 'Expiration Date']}
// onChange={changeTime}
onChange={changeTime}
/>
</Form.Item>
</div>
......@@ -253,7 +262,12 @@ const ContractContent = (props: any) => {
label="Contract Annex"
rules={[{ required: true, message: `${tipList[6]}` }]}
>
<Upload {...uploadProps} listType={'picture-card'} disabled={uploadUp}>
<Upload
{...uploadProps}
listType={'picture-card'}
disabled={uploadUp}
onPreview={onPreviews}
>
{fileList.length >= 3 ? null : <PlusOutlined />}
</Upload>
</Form.Item>
......@@ -266,16 +280,29 @@ const ContractContent = (props: any) => {
rules={[{ required: true, message: `${tipList[5]}` }]}
label="Contract Remarks"
name="contractRemindContent"
style={{ marginBottom: 0 }}
>
<TextArea
autoSize={false}
style={{ padding: 8, width: 600, height: 194 }}
placeholder="remarks"
style={{ padding: 8, width: 600 }}
placeholder="Remarks"
showCount={true}
autoSize={{ minRows: 6, maxRows: 6 }}
></TextArea>
</Form.Item>
</div>
<div className={styles.box8item2x2} style={{ marginLeft: 150 }}>
The system will send out reminders of contract expiration on 25 .
<div
className={styles.box8item2x2}
style={{ marginLeft: 150, textTransform: 'capitalize' }}
>
<p style={{ marginBottom: 0 }}>
The system will send e-mail notification in the{' '}
<span style={{ color: 'red' }}>{tipTime[0]}</span> and{' '}
<span style={{ color: 'red' }}>{tipTime[1]}</span> that the contract is about to
expire !
</p>
<p style={{ marginBottom: 0 }}>
<span style={{ color: 'red' }}>*</span> If the time has passed, it will not be sent
</p>
{/* <span style={{color:'#f00'}}>&nbsp;{stateTime}</span> */}
</div>
</div>
......@@ -288,6 +315,20 @@ const ContractContent = (props: any) => {
</div>
</div>
</Form>
{/* 附件预览 */}
<Modal
title="File Preview"
visible={tipModal}
// centered={true}
width={800}
onOk={handleCancel}
onCancel={handleCancel}
>
<p>预览接口调整中。。。</p>
<p>预览接口调整中。。。</p>
<p>预览接口调整中。。。</p>
</Modal>
</div>
);
};
......
......@@ -137,6 +137,7 @@ export const requestList = [
['/tos/tosCommunity/get/list', '48 修改获取小区列表', {}],
['/tos/community/delete', '49 关闭小区', {}],
['/tos/community/facilities/subscribeTime/query', '50 设施预订时间段查询', {}],
['/tos/user/infromation/get', '51 获取后台所有账号', {}],
];
const params = [
......
export const zhCnFaci = [
{
title: 'Check all',
key: '0',
children: [
{
title: 'life用户管理',
key: '1',
children: [
{ title: '查看LIFE用户', key: '2' },
{ title: '编辑LIFE用户', key: '3' },
{ title: '添加业主档案', key: '4' },
{ title: '注销业主档案', key: '5' },
{ title: '添加家属/租户', key: '6' },
{ title: '注销家属/租户', key: '7' },
],
},
{
title: '物业费管理',
key: '8',
children: [
{ title: '查看物业费', key: '9' },
{ title: '编辑物业费', key: '10' },
{ title: '0-0-1-2', key: '11' },
],
},
],
},
];
\ No newline at end of file
......@@ -50,3 +50,14 @@ export const BookingsTip = [
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Please Select The Date' }],
];
// 账号新增编辑
export const AccountTip = [
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }],
];
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