删除多余代码
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import { Form, Input, Modal, Spin, Button, RadioChangeEvent, Popconfirm, message, DatePicker } from 'antd';
|
import { Form, Modal, Spin, Button, Popconfirm, message, DatePicker } from 'antd';
|
||||||
import { getAuthorizeList, cancelAuthorize, addAuthorize } from '../service';
|
import { getAuthorizeList, cancelAuthorize, addAuthorize } from '../service';
|
||||||
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
@ -12,7 +12,6 @@ interface AuthorizeModalProps {
|
|||||||
values: any;
|
values: any;
|
||||||
type: any;
|
type: any;
|
||||||
level: any;
|
level: any;
|
||||||
// onSubmit: any;
|
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
}
|
}
|
||||||
const layout = {
|
const layout = {
|
||||||
@ -21,22 +20,15 @@ const layout = {
|
|||||||
};
|
};
|
||||||
const AuthorizeModal: React.FC<AuthorizeModalProps> = (props) => {
|
const AuthorizeModal: React.FC<AuthorizeModalProps> = (props) => {
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
//查看页弹窗visible
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const { title, modalVisible, values, type, level, onCancel } = props;//, onSubmit: handleUpdate
|
const { title, modalVisible, values, type, level, onCancel } = props;//, onSubmit: handleUpdate
|
||||||
//loading
|
//loading
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [value, setValue] = useState<string>("1");
|
|
||||||
//授权相关
|
//授权相关
|
||||||
const [authorizeList, setAuthorizeList] = useState<any>([]); //已授权区域信息
|
const [authorizeList, setAuthorizeList] = useState<any>([]); //已授权区域信息
|
||||||
const [unAuthorizeList, setUnAuthorizeList] = useState<any>([]); //未授权区域信息
|
const [unAuthorizeList, setUnAuthorizeList] = useState<any>([]); //未授权区域信息
|
||||||
const [timeModalVisible, setTimeModalVisible] = useState<boolean>(false);
|
const [timeModalVisible, setTimeModalVisible] = useState<boolean>(false);
|
||||||
const [modelform] = Form.useForm();
|
const [modelform] = Form.useForm();
|
||||||
|
|
||||||
const onChange = (e: RadioChangeEvent) => {
|
|
||||||
console.log('radio checked', e.target.value);
|
|
||||||
setValue(e.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import ProTable, { ActionType } from '@ant-design/pro-table';
|
import ProTable, { ActionType } from '@ant-design/pro-table';
|
||||||
import { getGroupPageList, saveSiteGroup, delSiteGroup, getAuthorizeList } from '../service';
|
import { getGroupPageList, saveSiteGroup, delSiteGroup } from '../service';
|
||||||
import { Button, Card, Form, message, Spin, Popconfirm } from 'antd';
|
import { Button, Form, message, Spin, Popconfirm } from 'antd';
|
||||||
import SiteGroupModal from './SiteGroupModal';
|
import SiteGroupModal from './SiteGroupModal';
|
||||||
import AuthorizeModal from './AuthorizeModal';
|
import AuthorizeModal from './AuthorizeModal';
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ const GroupPermission: React.FC<{}> = () => {
|
|||||||
const [type, setType] = useState<any>('cease');//弹窗类型
|
const [type, setType] = useState<any>('cease');//弹窗类型
|
||||||
|
|
||||||
//授权相关
|
//授权相关
|
||||||
const [authorizeList, setAuthorizeList] = useState<any>([]); //授权区域信息
|
|
||||||
const [isAuthorizeModalVisible, setAuthorizeModalVisible] = useState<boolean>(false) //控制授权模态框是否显示
|
const [isAuthorizeModalVisible, setAuthorizeModalVisible] = useState<boolean>(false) //控制授权模态框是否显示
|
||||||
let typename = "新增";
|
let typename = "新增";
|
||||||
|
|
||||||
@ -77,7 +76,6 @@ const GroupPermission: React.FC<{}> = () => {
|
|||||||
|
|
||||||
// 授权
|
// 授权
|
||||||
const setAuthorize = (item: any) => {
|
const setAuthorize = (item: any) => {
|
||||||
selectAuthorizeList(item.id)
|
|
||||||
typename = "编辑";
|
typename = "编辑";
|
||||||
setEditForm(item);
|
setEditForm(item);
|
||||||
setAuthorizeModalVisible(true)
|
setAuthorizeModalVisible(true)
|
||||||
@ -100,16 +98,6 @@ const GroupPermission: React.FC<{}> = () => {
|
|||||||
setSping(false);
|
setSping(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询授权区域信息集合
|
|
||||||
const selectAuthorizeList = (id: any) => {
|
|
||||||
//查询当前人员权限下所有现场分组
|
|
||||||
getAuthorizeList(id).then(res => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
setAuthorizeList(res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
}, [])
|
}, [])
|
||||||
@ -174,7 +162,6 @@ const GroupPermission: React.FC<{}> = () => {
|
|||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
setIsEditModalVisible(false);
|
setIsEditModalVisible(false);
|
||||||
setEditForm({});
|
setEditForm({});
|
||||||
// getSitePerson();
|
|
||||||
checkRelationRef.current?.reload();
|
checkRelationRef.current?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,6 @@ import ExpertPhotoUpload from '@/components/ElecBidEvaluation/ExpertPhotoUpload'
|
|||||||
interface SitePersonModalProps {
|
interface SitePersonModalProps {
|
||||||
title: any;
|
title: any;
|
||||||
modalVisible: boolean;
|
modalVisible: boolean;
|
||||||
formDisabled: boolean;
|
|
||||||
values: any;
|
values: any;
|
||||||
onSubmit: any;
|
onSubmit: any;
|
||||||
type: string;
|
type: string;
|
||||||
@ -19,7 +18,7 @@ const layout = {
|
|||||||
};
|
};
|
||||||
const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { title, modalVisible, formDisabled, type, values, onSubmit: handleUpdate, onCancel, groupList } = props;
|
const { title, modalVisible, type, values, onSubmit: handleUpdate, onCancel, groupList } = props;
|
||||||
//loading
|
//loading
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
|
|
||||||
@ -64,16 +63,11 @@ const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
|||||||
const onOk = async () => {
|
const onOk = async () => {
|
||||||
const fieldsValue = await form.validateFields();
|
const fieldsValue = await form.validateFields();
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
console.log(fieldsValue)
|
|
||||||
if (fieldsValue.groupStatus == 1) {
|
if (fieldsValue.groupStatus == 1) {
|
||||||
fieldsValue["groupId"] = fieldsValue.groupId.value
|
fieldsValue["groupId"] = fieldsValue.groupId.value
|
||||||
}
|
}
|
||||||
fieldsValue["facePicName"] = fieldsValue.personName
|
fieldsValue["facePicName"] = fieldsValue.personName
|
||||||
|
|
||||||
// await getFileListByBid(fieldsValue.facePic).then(res => {
|
|
||||||
// fieldsValue["facePicName"] = res[0].name
|
|
||||||
// })
|
|
||||||
console.log(fieldsValue)
|
|
||||||
await handleUpdate({ ...fieldsValue }).finally(() => {
|
await handleUpdate({ ...fieldsValue }).finally(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
});
|
});
|
||||||
@ -179,7 +173,7 @@ const SitePersonModal: React.FC<SitePersonModalProps> = (props) => {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Select placeholder="请选择所属分组" labelInValue disabled={formDisabled}>
|
<Select placeholder="请选择所属分组" labelInValue>
|
||||||
{
|
{
|
||||||
groupList.map((item: any, index: any) => {
|
groupList.map((item: any, index: any) => {
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import ProTable, { ActionType } from '@ant-design/pro-table';
|
import ProTable, { ActionType } from '@ant-design/pro-table';
|
||||||
import { getUserList, saveSiteUser, delSiteUser, getGroupList, getAuthorizeList } from '../service';
|
import { getUserList, saveSiteUser, delSiteUser, getGroupList } from '../service';
|
||||||
import { Button, Card, Form, message, Spin, Popconfirm } from 'antd';
|
import { Button, Form, message, Spin, Popconfirm } from 'antd';
|
||||||
import SiteUserModal from './SiteUserModal';
|
import SiteUserModal from './SiteUserModal';
|
||||||
import AuthorizeModal from './AuthorizeModal';
|
import AuthorizeModal from './AuthorizeModal';
|
||||||
|
|
||||||
@ -15,12 +15,9 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
const [editForm, setEditForm] = useState<any>({});
|
const [editForm, setEditForm] = useState<any>({});
|
||||||
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
|
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
|
||||||
const [groupList, setGroupList] = useState<any>([]); //省分公司信息
|
const [groupList, setGroupList] = useState<any>([]); //省分公司信息
|
||||||
//下拉框是否可编辑
|
|
||||||
const [groupFormDisabled, setGroupFormDisabled] = useState<any>(false);
|
|
||||||
const [type, setType] = useState<any>('cease');//弹窗类型
|
const [type, setType] = useState<any>('cease');//弹窗类型
|
||||||
|
|
||||||
//授权相关
|
//授权相关
|
||||||
const [authorizeList, setAuthorizeList] = useState<any>([]); //授权区域信息
|
|
||||||
const [isAuthorizeModalVisible, setAuthorizeModalVisible] = useState<boolean>(false) //控制授权模态框是否显示
|
const [isAuthorizeModalVisible, setAuthorizeModalVisible] = useState<boolean>(false) //控制授权模态框是否显示
|
||||||
|
|
||||||
let typename = "新增";
|
let typename = "新增";
|
||||||
@ -106,7 +103,6 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
|
|
||||||
// 授权
|
// 授权
|
||||||
const setAuthorize = (item: any) => {
|
const setAuthorize = (item: any) => {
|
||||||
selectAuthorizeList(item.id)
|
|
||||||
typename = "编辑";
|
typename = "编辑";
|
||||||
setEditForm(item);
|
setEditForm(item);
|
||||||
setAuthorizeModalVisible(true)
|
setAuthorizeModalVisible(true)
|
||||||
@ -141,17 +137,6 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询授权区域信息集合
|
|
||||||
const selectAuthorizeList = (id: any) => {
|
|
||||||
//查询当前人员权限下所有现场分组
|
|
||||||
getAuthorizeList(id).then(res => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
setAuthorizeList(res.data)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
@ -208,7 +193,6 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
title={typename+"人员信息"}
|
title={typename+"人员信息"}
|
||||||
type={type}
|
type={type}
|
||||||
modalVisible={isEditModalVisible}
|
modalVisible={isEditModalVisible}
|
||||||
formDisabled={groupFormDisabled}
|
|
||||||
groupList={groupList}
|
groupList={groupList}
|
||||||
values={editForm}
|
values={editForm}
|
||||||
onSubmit={async (value: any) => {
|
onSubmit={async (value: any) => {
|
||||||
@ -217,7 +201,6 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
message.success("保存成功!");
|
message.success("保存成功!");
|
||||||
setIsEditModalVisible(false);
|
setIsEditModalVisible(false);
|
||||||
setEditForm({});
|
setEditForm({});
|
||||||
// getSiteUser();
|
|
||||||
checkRelationRef.current?.reload();
|
checkRelationRef.current?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -238,17 +221,6 @@ const UserPermission: React.FC<{}> = () => {
|
|||||||
values={editForm}
|
values={editForm}
|
||||||
type={editForm.personType}
|
type={editForm.personType}
|
||||||
level={"user"}
|
level={"user"}
|
||||||
// onSubmit={async (value: any) => {
|
|
||||||
// await saveSiteGroup(value).then((res: any) => {
|
|
||||||
// if (res.success === true) {
|
|
||||||
// message.success("保存成功!");
|
|
||||||
// setAuthorizeModalVisible(false);
|
|
||||||
// setEditForm({});
|
|
||||||
// // getSitePerson();
|
|
||||||
// checkRelationRef.current?.reload();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }}
|
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setAuthorizeModalVisible(!isAuthorizeModalVisible);
|
setAuthorizeModalVisible(!isAuthorizeModalVisible);
|
||||||
setEditForm({});
|
setEditForm({});
|
||||||
|
Reference in New Issue
Block a user