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 ( {text} ); }, }, { title: '操作', fixed: 'right', align: 'center', width: 200, render: (text, record) => { return (
this.handleViewModalVisible(true, record)}> 详情 this.handleUpdateModalVisible(true, record)}> 修改 删除
) } }, ] getPieChartOption = () => { return { tooltip: { trigger: 'item', formatter: '{a}
{b}: {c}% ({d}%)' }, legend: { orient: 'vertical', right: '20%', top: '27%', itemWidth: 16, itemHeight: 4, itemGap: 16, textStyle: { fontSize: 12, color: '#666', fontWeight: 'normal' } }, series: [ { name: '功能区域占比', type: 'pie', radius: ['30%', '45%'], center: ['30%', '45%'], avoidLabelOverlap: false, label: { show: false }, emphasis: { scale: true, scaleSize: 5 }, labelLine: { show: false }, data: [ { value: 45, name: '生产区', itemStyle: { color: '#4B69F1' } }, { value: 20, name: '仓储区', itemStyle: { color: '#44BB5F' } }, { value: 20, name: '办公区', itemStyle: { color: '#A493FB' } }, { value: 15, name: '辅助区', itemStyle: { color: '#FFD85A' } } ] } ] }; } handleStandardTableChange = (pagination, sorter) => { const { dispatch } = this.props const { formValues } = this.state const params = { currentPage: pagination.current, pageSize: pagination.pageSize, ...formValues } sorter.field && (params.sorter = `${sorter.field}_${sorter.order}`) // 这里应该调用实际的数据获取方法 // 由于当前使用的是mockData,我们可以在这里添加日志或者调用相应的action console.log('分页参数:', params); // 如果有实际的数据获取action,应该这样调用: // dispatch({ // type: 'namespace/fetch', // payload: params, // }); } handleFormReset = () => { const { dispatch } = this.props this.setState({ formValues: {} }) } toggleForm = () => { const { expandForm } = this.state this.setState({ expandForm: !expandForm }) } handleSelectRows = rows => { this.setState({ selectedRows: rows }) } handleSearch = values => { const { dispatch } = this.props const { expandForm } = this.state this.setState({ formValues: values }) } handleModalVisible = flag => { this.setState({ modalVisible: !!flag }) } handleUpdateModalVisible = (flag, record) => { this.setState({ updateModalVisible: !!flag, updateFormValues: record || {} }) } handleViewModalVisible = (flag, record) => { this.setState({ viewModalVisible: !!flag, viewFormValues: record || {} }) } handleAdd = fields => { const { dispatch } = this.props // 添加逻辑 } handleDeleteRecord = record => { const { dispatch } = this.props // 删除逻辑 } handleUpdate = fields => { const { dispatch } = this.props // 更新逻辑 } handleCollapse = () => { const { toggleExpand } = this.state this.setState({ toggleExpand: !toggleExpand }) } handleImportModalVisible = (flag) => { this.setState({ importModalVisible: !!flag }); } render() { const { loading, dispatch } = this.props const { selectedRows, modalVisible, updateModalVisible, viewModalVisible, updateFormValues, viewFormValues, toggleExpand, importModalVisible, } = this.state const parentMethods = { handleAdd: this.handleAdd, handleModalVisible: this.handleModalVisible, dispatch: dispatch, loading, } const updateMethods = { handleUpdateModalVisible: this.handleUpdateModalVisible, handleUpdate: this.handleUpdate, dispatch: dispatch, loading, } const viewMethods = { handleViewModalVisible: this.handleViewModalVisible } return ( {/* 主要内容区域 */} {/* 左侧:组织机构人员管理 */}
组织机构与人员管理
{/* 组织架构图 */}
{/* 顶部按钮 */}
{/* 连接线 - 顶部到第一层 */}
{/* 第一层水平连接线 */}
{/* 第一层垂直连接线 */}
{/* 第一层部门 */}
安监部
{/* 安监部连接线 */}
生产部
{/* 生产部连接线 */}
设备部
{/* 设备部连接线 */}
{/* 第二层子部门 */}
{/* 安监部子部门 */}
安全监督岗
风险评估岗
{/* 生产部子部门 */}
生产调度岗
现场管理岗
{/* 设备部子部门 */}
设备维护岗
备件管理岗
{/* 中间:功能区域占比 */}
功能区面积占比
{/* 右侧:实时风险评估 */}
{/* 顶部装饰性背景层 */} {/*
*/} {/* 底部装饰性背景层 */} {/*
*/} {/* 标题 */}
实时风险评估
{/* 主要内容区域 */}
{/* 左侧盾牌图标 */}
风险盾牌
{/* 右侧内容 */}
{/* 风险等级提示框 */}
当前风险等级: 重大风险
{/* 提示信息 */}
提示
提示:安全等级分为 红、橙、黄、蓝四级,当前风险等级为红区,存在重大风险
{/* 底部表格区域 */}
筛选条件