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