Commit 568b0654 authored by cellee's avatar cellee

预览跨域问题,以及账号管理界面更新

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 2e104c6c
...@@ -344,6 +344,7 @@ export default defineConfig({ ...@@ -344,6 +344,7 @@ export default defineConfig({
routes: [ routes: [
{ path: './', component: './AccountManagement/account/Account' }, { path: './', component: './AccountManagement/account/Account' },
{ path: './edit', component: './AccountManagement/account/AccountEdit' }, { path: './edit', component: './AccountManagement/account/AccountEdit' },
{ path: './Add', component: './AccountManagement/account/AccountEdit' },
{ path: './reset', component: './AccountManagement/account/AccountReset' }, { path: './reset', component: './AccountManagement/account/AccountReset' },
], ],
}, },
......
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
'/cash/tos-manager/bill/': { '/cash/tos-manager/': {
target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com', target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
'/cash/tos-manager/bill/': { '/cash/tos-manager/': {
target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com', target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
'/cash/tos-manager/bill/': { '/cash/tos-manager/': {
target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com', target: 'http://acc-huahui.oss-cn-shenzhen.aliyuncs.com',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
......
...@@ -11,6 +11,8 @@ import IconNone from '@/assets/logo_icon_bg.png'; ...@@ -11,6 +11,8 @@ import IconNone from '@/assets/logo_icon_bg.png';
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
import { stringSplit } from '@/utils/string';
const PreView = (props: any) => { const PreView = (props: any) => {
const module = 'CellList'; const module = 'CellList';
...@@ -113,7 +115,7 @@ const PreView = (props: any) => { ...@@ -113,7 +115,7 @@ const PreView = (props: any) => {
{ModalInfo != null && ModalInfo.type == 'pdf' ? ( {ModalInfo != null && ModalInfo.type == 'pdf' ? (
<> <>
<PDF <PDF
file={ModalInfo ? ModalInfo.url : ''} file={ModalInfo ? stringSplit(ModalInfo.url, 'm/cash') : ''}
page={pageNumber} page={pageNumber}
onDocumentComplete={onDocumentLoadSuccess} onDocumentComplete={onDocumentLoadSuccess}
/> />
......
...@@ -65,7 +65,7 @@ export default { ...@@ -65,7 +65,7 @@ export default {
break; break;
case 27: case 27:
{ {
message.success('save success !'); message.success('Save Success !');
var tmp = resp; var tmp = resp;
yield put({ type: 'returnResult', tmp }); yield put({ type: 'returnResult', tmp });
setTimeout(function () { setTimeout(function () {
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Input, Button, Pagination, message, Modal } from 'antd'; import { Form, Input, Button, Pagination, message, Modal, Tag } from 'antd';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { SearchOutlined, ClearOutlined, PlusOutlined } from '@ant-design/icons'; import { SearchOutlined, ClearOutlined, PlusOutlined } from '@ant-design/icons';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
...@@ -28,13 +28,11 @@ const Account = (props: any) => { ...@@ -28,13 +28,11 @@ const Account = (props: any) => {
} }
}, [Data]); //页面进来执行一次 }, [Data]); //页面进来执行一次
// 拉取数据的条件存储 const [term, setTerm] = useState({} as any); // 拉取数据的条件存储
const [term, setTerm] = useState({} as any); const [over, setOver] = useState(false); // 关闭账号确认弹窗
// 关闭账号 const [accountName, setaccountName] = useState(null as any); // 弹窗账号信息
const [over, setOver] = useState(false);
// 表单标识 const [form] = Form.useForm(); // 表单标识
const [form] = Form.useForm();
// 表头 // 表头
const columns = [ const columns = [
...@@ -49,11 +47,10 @@ const Account = (props: any) => { ...@@ -49,11 +47,10 @@ const Account = (props: any) => {
key: 'userLevel', key: 'userLevel',
render: (text: any) => ( render: (text: any) => (
<span> <span>
{text == 5 || text == 0 ? '超级管理员' : ''} {text == 0 ? 'Administrator' : ''}
{text == 4 ? '一级管理员' : ''} {text == 1 ? 'First Level' : ''}
{text == 3 ? '二级管理员' : ''} {text == 2 ? 'Two Level' : ''}
{text == 2 ? '三级管理员' : ''} {text == 3 ? 'Three Level' : ''}
{text == 1 ? '一级管理员' : ''}
</span> </span>
), ),
}, },
...@@ -62,7 +59,13 @@ const Account = (props: any) => { ...@@ -62,7 +59,13 @@ const Account = (props: any) => {
title: 'Status', title: 'Status',
dataIndex: 'userStatus', dataIndex: 'userStatus',
key: 'userStatus', key: 'userStatus',
render: (text: any) => <span>{text != 1 ? '启用' : '禁用'}</span>, render: (text: any) => {
return (
<Tag color={text != 1 ? '#87d068' : '#f20'} key={text}>
<span> {text != 1 ? 'Enable' : 'Close'}</span>
</Tag>
);
},
}, },
{ {
title: 'Created By', title: 'Created By',
...@@ -70,16 +73,13 @@ const Account = (props: any) => { ...@@ -70,16 +73,13 @@ const Account = (props: any) => {
key: 'createAccount', key: 'createAccount',
width: 280, width: 280,
ellipsis: true, ellipsis: true,
// render: (text: any) => {
// <span>{text == 0 ? '启用' : '禁用'}</span>
// },
}, },
{ {
title: 'Creation Time', title: 'Creation Time',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
render: (text: any) => { render: (text: any) => {
return moment(text.time).format('YYYY-MM-DD'); return moment(text).format('YYYY-MM-DD');
}, },
}, },
...@@ -87,7 +87,7 @@ const Account = (props: any) => { ...@@ -87,7 +87,7 @@ const Account = (props: any) => {
title: 'Actions', title: 'Actions',
dataIndex: 'action', dataIndex: 'action',
key: 'action', key: 'action',
render: (record: any) => ( render: (text: any, record: any) => (
<span> <span>
<Button <Button
type="link" type="link"
...@@ -103,7 +103,7 @@ const Account = (props: any) => { ...@@ -103,7 +103,7 @@ const Account = (props: any) => {
lockS(record); lockS(record);
}} }}
> >
{record.userStatus == 1 ? 'Lock' : 'Unlock'} {record.userStatus != 1 ? 'Close' : 'Open'}
</Button> </Button>
{/*{record.userID == 1||record.userID == this.props.currentUser.userid?'': {/*{record.userID == 1||record.userID == this.props.currentUser.userid?'':
<Button style={{background: 'transparent', border: 0, color: '#1890FF'}} <Button style={{background: 'transparent', border: 0, color: '#1890FF'}}
...@@ -116,12 +116,14 @@ const Account = (props: any) => { ...@@ -116,12 +116,14 @@ const Account = (props: any) => {
// 编辑- 新增 // 编辑- 新增
const edit = (item: any) => { const edit = (item: any) => {
history.push('./account/edit'); item == 1 ? history.push('./account/Add') : history.push('./account/edit');
}; };
// 停用账号 // 停用账号
const lockS = (item: any) => { const lockS = (item: any) => {
setOver(true); setOver(true);
setaccountName(item);
console.log(item);
}; };
// 表头单搜索 // 表头单搜索
...@@ -204,6 +206,7 @@ const Account = (props: any) => { ...@@ -204,6 +206,7 @@ const Account = (props: any) => {
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={() => { onClick={() => {
// Jump(0, 'Add'); // Jump(0, 'Add');
edit(1);
}} }}
> >
Add Account Add Account
...@@ -233,10 +236,23 @@ const Account = (props: any) => { ...@@ -233,10 +236,23 @@ const Account = (props: any) => {
</div> </div>
{/* 确认关闭账号 */} {/* 确认关闭账号 */}
<Modal title="Basic Modal" visible={over} onOk={handleOk} onCancel={handleCancel}> <Modal
<p>Some contents...</p> title="Operation Tips"
<p>Some contents...</p> visible={over}
<p>Some contents...</p> okText={'Confirm'}
cancelText={'Cancel'}
onOk={handleOk}
onCancel={handleCancel}
>
{accountName != null ? (
<p>
Are You Sure To{' '}
<span style={{ color: 'red' }}>{accountName.userStatus != 1 ? 'Close' : 'Open'}</span>{' '}
The Account '<span style={{ color: 'red' }}> {accountName.tosUserName} </span>' ?
</p>
) : (
''
)}
</Modal> </Modal>
</> </>
); );
......
...@@ -19,7 +19,7 @@ import { zhCnFaci } from '@/utils/power'; ...@@ -19,7 +19,7 @@ import { zhCnFaci } from '@/utils/power';
import { AccountTip } from '@/utils/tip'; import { AccountTip } from '@/utils/tip';
import SelectCommunity from '@/components/SelectCommunity'; import SelectCommunity from '@/components/SelectCommunity';
import { getNumber } from '@/utils/string'; // 正则
import { RA } from '@/utils/method'; import { RA } from '@/utils/method';
import moment from 'moment'; import moment from 'moment';
...@@ -57,6 +57,16 @@ const Account = (props: any) => { ...@@ -57,6 +57,16 @@ const Account = (props: any) => {
// 保存提交 // 保存提交
const onFinishContract = (value: any) => { const onFinishContract = (value: any) => {
if (checkedKeys.length == 0) {
message.error('Please Select Permission!');
return false;
} else if (value.community.value == 0) {
message.error('Please Select The Jurisdiction Area!');
return false;
} else if (value.tosUserName.length < 6 || value.tosUserPwd.length < 6) {
message.error('The Account Password is Greater Than 6 Digits!');
return false;
} else {
value.tosUserServiceCellList = value.community.value; // 管辖小区 value.tosUserServiceCellList = value.community.value; // 管辖小区
value.tosUserEmail = value.tosUserName; // 邮箱就是账号 value.tosUserEmail = value.tosUserName; // 邮箱就是账号
value.tosUserLevel = values; //级别 value.tosUserLevel = values; //级别
...@@ -75,8 +85,9 @@ const Account = (props: any) => { ...@@ -75,8 +85,9 @@ const Account = (props: any) => {
}; };
console.log(obj); console.log(obj);
RA(38, value, module, dispatch); // 信息上传 // RA(38, value, module, dispatch); // 信息上传
RA(42, obj, module, dispatch); // 权限上传 // RA(42, obj, module, dispatch); // 权限上传
}
}; };
//goToReturn //goToReturn
const goToReturn = () => {}; const goToReturn = () => {};
...@@ -115,6 +126,13 @@ const Account = (props: any) => { ...@@ -115,6 +126,13 @@ const Account = (props: any) => {
setvalues(e.target.value); setvalues(e.target.value);
}; };
//手机号
const keyup_communityManagerFee = (e: any) => {
e.target.value = keyup_tool(e.target.value);
};
const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, ''));
};
// 选择小区名字并赋值 // 选择小区名字并赋值
return ( return (
...@@ -143,50 +161,55 @@ const Account = (props: any) => { ...@@ -143,50 +161,55 @@ const Account = (props: any) => {
> >
<Descriptions column={{ xs: 1, sm: 2, md: 3 }}> <Descriptions column={{ xs: 1, sm: 2, md: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosAccountName" label="管理员姓名" rules={AccountTip[0]}> <Form.Item name="tosAccountName" label="Name" rules={AccountTip[0]}>
<Input placeholder="6 Postcode" className="input" /> <Input placeholder="Name Of Administrator" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserPhone" label="联系方式"> <Form.Item name="tosUserPhone" label="Phone" rules={AccountTip[1]}>
<Input placeholder="6 Postcode" className="input" /> <Input
placeholder="Contact Information"
className="input"
maxLength={11}
onKeyUp={keyup_communityManagerFee}
/>
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserToCompany" label="所属公司"> <Form.Item name="tosUserToCompany" label="Company">
<Input placeholder="6 Postcode" className="input" /> <Input placeholder="Affiliated Company" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
<Descriptions column={{ xs: 1, sm: 2, md: 3 }}> <Descriptions column={{ xs: 1, sm: 2, md: 3 }}>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserName" label="账号ID"> <Form.Item name="tosUserName" label="Account ID" rules={AccountTip[2]}>
<Input placeholder="6 Postcode" className="input" /> <Input placeholder="Login Account" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item> <Descriptions.Item>
<Form.Item name="tosUserPwd" label="登录密码"> <Form.Item name="tosUserPwd" label="PassWord" rules={AccountTip[3]}>
<Input placeholder="6 Postcode" className="input" /> <Input placeholder="Login PassWord" className="input" />
</Form.Item> </Form.Item>
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
<Form.Item name="community" label="服务小区"> <Form.Item name="community" label="Community">
<SelectCommunity /> <SelectCommunity />
</Form.Item> </Form.Item>
<div className="diy" style={{ marginBottom: '14px' }}> <div className="diy" style={{ marginBottom: '14px' }}>
<div className="label"> <div className="label">
<span className="title">权限配置</span> <span className="title">Privilege Level</span>
</div> </div>
<div className="label"> <div className="label">
<Radio.Group defaultValue={values} onChange={onRadio}> <Radio.Group defaultValue={values} onChange={onRadio}>
<Radio style={radioStyle} value={2}> <Radio style={radioStyle} value={2}>
二级管理员 Two Level Administrator
</Radio> </Radio>
<Radio style={radioStyle} value={3}> <Radio style={radioStyle} value={3}>
三级管理员 Three Level Administrator
{/* <Input placeholder="三级管理员" style={{ width: 160, marginLeft: 10 }} /> */} {/* <Input placeholder="三级管理员" style={{ width: 160, marginLeft: 10 }} /> */}
</Radio> </Radio>
</Radio.Group> </Radio.Group>
...@@ -195,7 +218,7 @@ const Account = (props: any) => { ...@@ -195,7 +218,7 @@ const Account = (props: any) => {
<div className="diy" style={{ marginBottom: '24px' }}> <div className="diy" style={{ marginBottom: '24px' }}>
<div className="label"> <div className="label">
<span className="title">权限选择</span> <span className="title">Permission List</span>
</div> </div>
<div className="label"> <div className="label">
<Tree <Tree
...@@ -215,7 +238,7 @@ const Account = (props: any) => { ...@@ -215,7 +238,7 @@ const Account = (props: any) => {
<div className="diy"> <div className="diy">
<div className="label"></div> <div className="label"></div>
<div className="label"> <div className="label">
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit" loading={loading}>
Submit Submit
</Button> </Button>
</div> </div>
......
...@@ -31,6 +31,7 @@ import { tipList } from '@/utils/tip'; ...@@ -31,6 +31,7 @@ import { tipList } from '@/utils/tip';
import FileViewer from 'react-file-viewer'; import FileViewer from 'react-file-viewer';
import PDF from 'react-pdf-js'; import PDF from 'react-pdf-js';
import { stringSplit } from '@/utils/string';
const ContractContent = (props: any) => { const ContractContent = (props: any) => {
const { ContractModel, dispatch, FileImg, loading } = props; const { ContractModel, dispatch, FileImg, loading } = props;
...@@ -108,6 +109,7 @@ const ContractContent = (props: any) => { ...@@ -108,6 +109,7 @@ const ContractContent = (props: any) => {
type: FileImg[i].fileName.match(/\.([^\.]+)$/)[1].toLowerCase(), type: FileImg[i].fileName.match(/\.([^\.]+)$/)[1].toLowerCase(),
url: FileImg[i].fileUrl, url: FileImg[i].fileUrl,
}; };
console.log();
obj.push(a); obj.push(a);
} }
setFileList([...obj]); setFileList([...obj]);
...@@ -182,7 +184,6 @@ const ContractContent = (props: any) => { ...@@ -182,7 +184,6 @@ const ContractContent = (props: any) => {
//点击预览 //点击预览
const onPreviews = (file: any) => { const onPreviews = (file: any) => {
console.log(file);
setfileInfo(file); // 设置选择的文件 setfileInfo(file); // 设置选择的文件
settipModal(true); settipModal(true);
}; };
...@@ -378,7 +379,7 @@ const ContractContent = (props: any) => { ...@@ -378,7 +379,7 @@ const ContractContent = (props: any) => {
// pdf 换一种 // pdf 换一种
<> <>
<PDF <PDF
file={fileInfo.url} file={stringSplit(fileInfo.url, 'm/cash')}
page={pageNumber} page={pageNumber}
onDocumentComplete={onDocumentLoadSuccess} onDocumentComplete={onDocumentLoadSuccess}
/> />
...@@ -392,13 +393,17 @@ const ContractContent = (props: any) => { ...@@ -392,13 +393,17 @@ const ContractContent = (props: any) => {
</> </>
) : fileInfo.type == 'jpg' || fileInfo.type == 'png' ? ( ) : fileInfo.type == 'jpg' || fileInfo.type == 'png' ? (
// 图片用指定格式 // 图片用指定格式
<Image <Image
src={fileInfo.url} src={stringSplit(fileInfo.url, 'm/cash')}
preview={false} preview={false}
style={{ margin: '0 auto', textAlign: 'center' }} style={{ margin: '0 auto', textAlign: 'center' }}
/> />
) : ( ) : (
<FileViewer fileType={fileInfo.type} filePath={fileInfo.url} /> <FileViewer
fileType={fileInfo.type}
filePath={stringSplit(fileInfo.url, 'm/cash')}
/>
) )
) : ( ) : (
'' ''
......
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