import React, { PureComponent } from 'react';
import {
DeleteOutlined,
EditOutlined,
PlusOutlined,
SearchOutlined,
RedoOutlined,
DownOutlined,
ExclamationCircleFilled,
UpOutlined,
SafetyOutlined,
ImportOutlined,
ExportOutlined,
UserOutlined,
TeamOutlined,
SettingOutlined,
FileTextOutlined,
ProjectOutlined,
WarningOutlined,
AlertOutlined,
} from '@ant-design/icons';
import { Button, Card, Divider, Dropdown, message, Modal, Popconfirm, Space, Switch, Tag, Row, Col, Tree, Progress, Input, Select } from 'antd';
import StandardTable from '@/components/StandardTable';
import ReactECharts from 'echarts-for-react';
import { MyIcon } from "@/components/Icon"
import style from "@/global.less";
import BasicInfoCreateForm from '../form/BasicInfoCreateForm'; //新增表单
import BasicInfoUpdateForm from '../form/BasicInfoUpdateForm'; //修改表单
import BasicInfoViewForm from '../form/BasicInfoViewForm'; //查看表单
import BasicInfoImportForm from '../form/BasicInfoImportForm'; //修改表单
import styles from '../BasicInformation.less';
import datadictionary from "@/utils/dataDictionary";
import { formatDate } from "@/utils/formatUtils";
import { formatDictText, checkButtonAuthority } from "@/utils/globalCommon";
import riskShieldImg from '@/assets/basic_information/risk-shield.png'; // 新增:引入盾牌图片
import riskTip from '@/assets/basic_information/risk-tip.png';
const { confirm } = Modal;
//预约类型
const sex_type = datadictionary.sex
const user_status = datadictionary.user_status
const sys_user_post = datadictionary.sys_user_post
const mockData = {
list: [
{
id: '01',
projectName: '安全项目一',
location: '北京朝阳区',
area: '15,000m²',
organization: '安全生产部',
staffCount: 168,
safetyLevel: '高',
},
{
id: '02',
projectName: '安全项目二',
location: '北京朝阳区',
area: '15,000m²',
organization: '安全生产部',
staffCount: 168,
safetyLevel: '中',
},
{
id: '03',
projectName: '安全项目三',
location: '北京朝阳区',
area: '15,000m²',
organization: '安全生产部',
staffCount: 168,
safetyLevel: '低',
},
{
id: '04',
projectName: '安全项目四',
location: '北京朝阳区',
area: '15,000m²',
organization: '安全生产部',
staffCount: 168,
safetyLevel: '低',
},
{
id: '05',
projectName: '安全项目五',
location: '北京朝阳区',
area: '15,000m²',
organization: '安全生产部',
staffCount: 168,
safetyLevel: '中',
},
],
pagination: {
total: 48,
current: 1,
pageSize: 5,
},
}
class BasicInfoManagement extends PureComponent {
state = {
modalVisible: false,
updateModalVisible: false,
viewModalVisible: false,
importModalVisible: false, // 新增导入弹窗状态
expandForm: false,
selectedRows: [],
formValues: {},
updateFormValues: {},
viewFormValues: {},
toggleExpand: false,
}
columns = [
{
title: '编号',
dataIndex: 'id',
key: 'id',
width: 80,
fixed: 'left',
render: (text) => (
{text}
),
},
{
title: '项目名称',
dataIndex: 'projectName',
key: 'projectName',
width: 150,
fixed: 'left',
render: (text) => (
{text}
),
},
{
title: '地理信息',
dataIndex: 'location',
key: 'location',
width: 120,
render: (text) => (
{text}
),
},
{
title: '占地面积',
dataIndex: 'area',
key: 'area',
width: 100,
render: (text) => (
{text}
),
},
{
title: '组织机构',
dataIndex: 'organization',
key: 'organization',
width: 120,
render: (text) => (
{text}
),
},
{
title: '职业人数',
dataIndex: 'staffCount',
key: 'staffCount',
width: 100,
render: (text) => (
{text} 人
),
},
{
title: '安全等级',
dataIndex: 'safetyLevel',
key: 'safetyLevel',
width: 100,
render: (text) => {
let color = '#FF2526';
let bgColor = '#FFE0E2';
if (text === '中') {
color = '#FF8800';
bgColor = '#FFF3E9';
} else if (text === '低') {
color = '#00AAFA';
bgColor = '#DAF3FF';
}
return (