Commit 1073fb5c authored by Sixiang_Zzb's avatar Sixiang_Zzb

权限修复

parent de1f7a8b
...@@ -112,7 +112,7 @@ const Card = (props: any) => { ...@@ -112,7 +112,7 @@ const Card = (props: any) => {
}, [Data7]); }, [Data7]);
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
if (permissionArr.indexOf('12') < 0) { if (permissionArr.indexOf('30') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
...@@ -120,6 +120,10 @@ const Card = (props: any) => { ...@@ -120,6 +120,10 @@ const Card = (props: any) => {
}; };
const goToAdd = () => { const goToAdd = () => {
if (permissionArr.indexOf('32') < 0) {
message.error('No Permissions!!!', 3);
return;
}
history.push('./AccessCardApplication/Add'); history.push('./AccessCardApplication/Add');
}; };
......
...@@ -51,6 +51,12 @@ const CardDetail = (props: any) => { ...@@ -51,6 +51,12 @@ const CardDetail = (props: any) => {
}, [DataSaveDetail]); }, [DataSaveDetail]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('31') < 0) {
message.error('No Permissions!!!', 3);
return;
}
if (values.applyStatus === '2' && !values.replyContent) { if (values.applyStatus === '2' && !values.replyContent) {
message.error('Replies must be filled in!', 3); message.error('Replies must be filled in!', 3);
return; return;
......
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './css/Detail.less'; import styles from './css/Detail.less';
import { Form, Row, Col, Spin, Button, Descriptions } from 'antd'; import { Form, Row, Col, Spin, Button, Descriptions, message } from 'antd';
import { connect } from 'umi'; import { connect } from 'umi';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
...@@ -76,6 +76,35 @@ const Detail = (props: any) => { ...@@ -76,6 +76,35 @@ const Detail = (props: any) => {
}, [CurDataDetail]); }, [CurDataDetail]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (location.query.serviceType === '1') {
if (permissionArr.indexOf('19') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (location.query.serviceType === '2') {
if (permissionArr.indexOf('38') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (location.query.serviceType === '3') {
if (permissionArr.indexOf('22') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (location.query.serviceType === '4') {
if (permissionArr.indexOf('35') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (location.query.serviceType === '5') {
if (permissionArr.indexOf('25') < 0) {
message.error('No Permissions!!!', 3);
return;
}
}
var val = values; var val = values;
val.handleName = getCookie('name'); val.handleName = getCookie('name');
val.handleContacts = getCookie('phone'); val.handleContacts = getCookie('phone');
......
...@@ -86,10 +86,35 @@ const PropertyServices = (props: any) => { ...@@ -86,10 +86,35 @@ const PropertyServices = (props: any) => {
]; ];
const goToDetail = (value: any, record: any, e: any) => { const goToDetail = (value: any, record: any, e: any) => {
if (permissionArr.indexOf('12') < 0) { console.log(serviceTypeGobal);
message.error('No Permissions!!!', 3);
return; if (serviceTypeGobal === '1') {
if (permissionArr.indexOf('18') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (serviceTypeGobal === '2') {
if (permissionArr.indexOf('37') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (serviceTypeGobal === '3') {
if (permissionArr.indexOf('21') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (serviceTypeGobal === '4') {
if (permissionArr.indexOf('34') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} else if (serviceTypeGobal === '5') {
if (permissionArr.indexOf('24') < 0) {
message.error('No Permissions!!!', 3);
return;
}
} }
//页面递进 //页面递进
history.push( history.push(
location.pathname + location.pathname +
......
...@@ -5,7 +5,7 @@ import { connect, history } from 'umi'; ...@@ -5,7 +5,7 @@ import { connect, history } from 'umi';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; import { RA, urlEncode, filterObjbyTg } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string'; import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
...@@ -102,7 +102,7 @@ const Renovation = (props: any) => { ...@@ -102,7 +102,7 @@ const Renovation = (props: any) => {
}; };
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
if (permissionArr.indexOf('12') < 0) { if (permissionArr.indexOf('27') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
......
...@@ -46,6 +46,12 @@ const RenovationDetail = (props: any) => { ...@@ -46,6 +46,12 @@ const RenovationDetail = (props: any) => {
}, [DataSaveDetail]); }, [DataSaveDetail]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('28') < 0) {
message.error('No Permissions!!!', 3);
return;
}
if ( if (
values.decorationStatus === '2' && values.decorationStatus === '2' &&
(values.replyView == undefined || values.replyView.trim() === '') (values.replyView == undefined || values.replyView.trim() === '')
......
...@@ -45,7 +45,7 @@ const ChargeManager = (props: any) => { ...@@ -45,7 +45,7 @@ const ChargeManager = (props: any) => {
// 详情页 // 详情页
const goToDetail = (values: any) => { const goToDetail = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || ''); const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('10') < 0) { if (permissionArr.indexOf('16') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
......
...@@ -16,7 +16,7 @@ const Detail = (props: any) => { ...@@ -16,7 +16,7 @@ const Detail = (props: any) => {
const status = ['Normal', 'Cancelled']; const status = ['Normal', 'Cancelled'];
const [loading, setLoding] = useState(false); const [loading, setLoding] = useState(false);
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
const TosSecurityGuarderGet = (values: any) => { const TosSecurityGuarderGet = (values: any) => {
dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values }); dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values });
}; };
...@@ -45,6 +45,10 @@ const Detail = (props: any) => { ...@@ -45,6 +45,10 @@ const Detail = (props: any) => {
// 保安详情页 // 保安详情页
const goToGuard = (values: any, e: any) => { const goToGuard = (values: any, e: any) => {
if (permissionArr.indexOf('13') < 0) {
message.error('No Permissions!!!', 3);
return;
}
GuarderById(values); GuarderById(values);
history.push(location.pathname + '/Guard?saferName=' + values.saferName); history.push(location.pathname + '/Guard?saferName=' + values.saferName);
}; };
...@@ -77,8 +81,7 @@ const Detail = (props: any) => { ...@@ -77,8 +81,7 @@ const Detail = (props: any) => {
// 注销 // 注销
const handleClick = (id: string) => { const handleClick = (id: string) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || ''); if (permissionArr.indexOf('12') < 0) {
if (permissionArr.indexOf('9') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
...@@ -104,7 +107,6 @@ const Detail = (props: any) => { ...@@ -104,7 +107,6 @@ const Detail = (props: any) => {
setLoding(false); setLoding(false);
if (Result) { if (Result) {
message.success('Logout successful!'); message.success('Logout successful!');
console.log('跳转页面');
history.goBack(); history.goBack();
} else { } else {
message.error('Logout failed. Please try again!', 3); message.error('Logout failed. Please try again!', 3);
......
import React, { useState, useEffect } from 'react'; import React, { useEffect } from 'react';
import styles from './Guard.less'; import styles from './Guard.less';
import { Modal, Button } from 'antd'; import { Modal, Button, message } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal; const { confirm } = Modal;
import { Link, useIntl, connect, Dispatch } from 'umi'; import { connect } from 'umi';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton'; import BackButton from '../../../components/BackButton/BackButton';
...@@ -23,6 +23,11 @@ const Guard = (props: any) => { ...@@ -23,6 +23,11 @@ const Guard = (props: any) => {
// 删除保安 // 删除保安
const handleClickBtn = (id: string) => { const handleClickBtn = (id: string) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('14') < 0) {
message.error('No Permissions!!!', 3);
return;
}
confirm({ confirm({
title: 'Do you Want to delete these items?', title: 'Do you Want to delete these items?',
icon: <ExclamationCircleOutlined />, icon: <ExclamationCircleOutlined />,
......
...@@ -55,7 +55,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -55,7 +55,7 @@ const ServiceProviderManagement = (props: propsType) => {
}; };
const goToDetail = (values: valuesType, e: any) => { const goToDetail = (values: valuesType, e: any) => {
if (permissionArr.indexOf('6') < 0) { if (permissionArr.indexOf('9') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
...@@ -70,7 +70,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -70,7 +70,7 @@ const ServiceProviderManagement = (props: propsType) => {
}; };
const goToEdit = (values: object, e: any) => { const goToEdit = (values: object, e: any) => {
if (permissionArr.indexOf('7') < 0) { if (permissionArr.indexOf('10') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
...@@ -79,7 +79,7 @@ const ServiceProviderManagement = (props: propsType) => { ...@@ -79,7 +79,7 @@ const ServiceProviderManagement = (props: propsType) => {
}; };
const goToCreate = () => { const goToCreate = () => {
if (permissionArr.indexOf('8') < 0) { if (permissionArr.indexOf('11') < 0) {
message.error('No Permissions!!!', 3); message.error('No Permissions!!!', 3);
return; return;
} }
......
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