import React, { useState } from 'react';
import ViewRishFormModal from './components/ViewRishFormModal';
import ViewQuoteWarningFormModal from './components/ViewQuoteWarningFormModal';
import ViewBlacklistFormModal from './components/ViewBlacklistFormModal';
import ViewReviewResultFormModal from './components/ViewReviewResultFormModal';
import ViewJuryScoringRemindFormModal from './components/ViewJuryScoringRemindFormModal';
import ViewJuryScoringAnalysisFormModal from './components/ViewJuryScoringAnalysisFormModal';
import ViewRiskSupplierModal from './components/ViewRiskSupplierModal';
import BidDocSmartCheckFormModal from './components/BidDocSmartCheckFormModal';
import ViewEvalFormModal from './components/ViewEvalFormModal';
import ZhiQiCha from './components/ZhiQiCha';
import { getDefId } from '@/utils/session';

const Sing: React.FC<{}> = () => {
  //ip mac
  const [ViewRishFormVisible, setViewRishFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewRishValues, setViewRishValues] = useState<any>({});

  //一致性
  const [ViewQuoteWarningFormVisible, setViewQuoteWarningFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewQuoteWarningValues, setViewQuoteWarningValues] = useState<any>({});

  //黑名单
  const [ViewBlacklistFormVisible, setViewBlacklistFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewBlacklistValues, setViewBlacklistValues] = useState<any>({});

  //评审结果展示及预警
  const [ViewReviewResultFormVisible, setViewReviewResultFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewReviewResultValues, setViewReviewResultValues] = useState<any>({});

  //评审专家打分偏离度提醒
  const [ViewJuryScoringRemindFormVisible, setViewJuryScoringRemindFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewJuryScoringRemindValues, setViewJuryScoringRemindValues] = useState<any>({});

  //评审专家打分偏离度分析
  const [ViewJuryScoringAnalysisFormVisible, setViewJuryScoringAnalysisFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewJuryScoringAnalysisValues, setViewJuryScoringAnalysisValues] = useState<any>({});
  //风控中心-风险限定供应商
  const [BidRiskSupplierVisible, setBidRiskSupplierVisible] = useState<any>(false);
  //风控中心-风险限定供应商record
  const [BidRiskSupplierValues, setRiskSupplierValues] = useState<any>({});

  //投标文件智能审查
  const [BidDocSmartCheckFormVisible, setBidDocSmartCheckFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [BidDocSmartCheckValues, setBidDocSmartCheckValues] = useState<any>({});

  //投标文件智能审查
  const [ViewEvalFormVisible, setViewEvalFormVisible] = useState<any>(false);
  //查看详情窗口record
  const [ViewEvalCheckValues, setViewEvalCheckValues] = useState<any>({});
  //获取流程id
  const defId = getDefId();
  return (
    <>
      {/**智企查-供应商关联关系疑似违规行为 */}
      {((defId != "negotiation_single") && (defId != "recruit_multi") && (defId != "inquiry")) && <ZhiQiCha />}
      {
        ViewRishFormModal ? (
          <ViewRishFormModal
            modalVisible={ViewRishFormVisible}
            values={ViewRishValues}
            onCancel={() => {
              setViewRishFormVisible(!ViewRishFormVisible);
              setViewRishValues({});
            }}
          >
          </ViewRishFormModal>
        ) : null
      }
      {
        ViewQuoteWarningFormModal ? (
          <ViewQuoteWarningFormModal
            modalVisible={ViewQuoteWarningFormVisible}
            values={ViewQuoteWarningValues}
            onCancel={() => {
              setViewQuoteWarningFormVisible(!ViewQuoteWarningFormVisible);
              setViewQuoteWarningValues({});
            }}
          >

          </ViewQuoteWarningFormModal>
        ) : null
      }
      {
        ViewBlacklistFormModal ? (
          <ViewBlacklistFormModal
            modalVisible={ViewBlacklistFormVisible}
            values={ViewBlacklistValues}
            onCancel={() => {
              setViewBlacklistFormVisible(!ViewBlacklistFormVisible);
              setViewBlacklistValues({});
            }}
          >
          </ViewBlacklistFormModal>
        ) : null
      }
      {
        ViewReviewResultFormModal ? (
          <ViewReviewResultFormModal
            modalVisible={ViewReviewResultFormVisible}
            values={ViewReviewResultValues}
            onCancel={() => {
              setViewReviewResultFormVisible(!ViewReviewResultFormVisible);
              setViewReviewResultValues({});
            }}
          >
          </ViewReviewResultFormModal>
        ) : null
      }
      {
        ViewJuryScoringRemindFormModal ? (
          <ViewJuryScoringRemindFormModal
            modalVisible={ViewJuryScoringRemindFormVisible}
            values={ViewJuryScoringRemindValues}
            onCancel={() => {
              setViewJuryScoringRemindFormVisible(!ViewJuryScoringRemindFormVisible);
              setViewJuryScoringRemindValues({});
            }}
          >
          </ViewJuryScoringRemindFormModal>
        ) : null
      }
      {
        ViewJuryScoringAnalysisFormModal ? (
          <ViewJuryScoringAnalysisFormModal
            modalVisible={ViewJuryScoringAnalysisFormVisible}
            values={ViewJuryScoringAnalysisValues}
            onCancel={() => {
              setViewJuryScoringAnalysisFormVisible(!ViewJuryScoringAnalysisFormVisible);
              setViewJuryScoringAnalysisValues({});
            }}
          >
          </ViewJuryScoringAnalysisFormModal>
        ) : null
      }
      {
        BidDocSmartCheckFormModal ? (
          <BidDocSmartCheckFormModal
            modalVisible={BidDocSmartCheckFormVisible}
            values={BidDocSmartCheckValues}
            onCancel={() => {
              setBidDocSmartCheckFormVisible(!BidDocSmartCheckFormVisible);
              setBidDocSmartCheckValues({});
            }}
          >
          </BidDocSmartCheckFormModal>
        ) : null
      }
      {
        ViewRiskSupplierModal ? (
          <ViewRiskSupplierModal
            modalVisible={BidRiskSupplierVisible}
            values={BidRiskSupplierValues}
            onCancel={() => {
              setBidRiskSupplierVisible(!BidRiskSupplierVisible);
              setRiskSupplierValues({});
            }}
          >
          </ViewRiskSupplierModal>
        ) : null
      }
      {
        ViewEvalFormModal ? (
          <ViewEvalFormModal
            modalVisible={ViewEvalFormVisible}
            values={ViewEvalCheckValues}
            onCancel={() => {
              setViewEvalFormVisible(!ViewEvalFormVisible);
              setViewEvalCheckValues({});
            }}
          >
          </ViewEvalFormModal>
        ) : null
      }
    </>
  )
}
export default Sing;