diff --git a/src/api/driver/index.js b/src/api/driver/index.js new file mode 100644 index 0000000..fd60e2e --- /dev/null +++ b/src/api/driver/index.js @@ -0,0 +1,7 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const queryDriverConfig = declareRequest( + "queryDriverConfigLoading", + "Get > /safetyEval/account/checkTerminalType", + "driverConfig: {} | res.data", +); diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js index 3233af6..70aef9e 100644 --- a/src/enumerate/namespace/index.js +++ b/src/enumerate/namespace/index.js @@ -20,3 +20,4 @@ export const NS_EQUIP_INFO = defineNamespace("equipInfo"); export const NS_QUAL_FILING = defineNamespace("qualFiling"); export const NS_QUAL_REVIEW = defineNamespace("qualReview"); export const NS_QUAL_EXPERT = defineNamespace("qualExpert"); +export const NS_DRIVER = defineNamespace("driver"); diff --git a/src/pages/Container/Driver/index.js b/src/pages/Container/Driver/index.js new file mode 100644 index 0000000..98683f4 --- /dev/null +++ b/src/pages/Container/Driver/index.js @@ -0,0 +1,58 @@ +import React, { useEffect, useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Skeleton, Tabs } from "antd"; +import { NS_DRIVER } from "~/enumerate/namespace"; +import Institution from "~/pages/Container/Institution/Dashboard"; +import Supervision from "~/pages/Container/Supervision/Dashboard"; +import Cockpit from "~/pages/Container/Supervision/Cockpit"; + +import "./index.less"; + +const Driver = (props) => { + const { queryDriverConfig, driver } = props; + const [activeKey, setActiveKey] = useState("1"); + const { queryDriverConfigLoading, driverConfig } = driver; + useEffect(() => { + queryDriverConfig(); + }, []); + const isInstitution = driverConfig === 1; + const isSupervision = driverConfig === 2; + + return ( +
+ +
+
+ {isSupervision && ( + + )} +
+
+ +
+
+
+ {isInstitution && } + {isSupervision && activeKey === "1" && } + {isSupervision && activeKey === "2" && } +
+
+
+ ); +}; + +export default Connect([NS_DRIVER], true)(Driver); diff --git a/src/pages/Container/Driver/index.less b/src/pages/Container/Driver/index.less new file mode 100644 index 0000000..2c46870 --- /dev/null +++ b/src/pages/Container/Driver/index.less @@ -0,0 +1,12 @@ +.driver-container{ + height: 100%; + padding: 6px 10px 10px 10px; + .driver-container-header{ + display: flex; + justify-content: space-between; + align-items: center; + } + .micro-temp-tabs-nav{ + margin-bottom: 0; + } +} \ No newline at end of file diff --git a/src/pages/Container/index.js b/src/pages/Container/index.js index 43ef683..3c8a527 100644 --- a/src/pages/Container/index.js +++ b/src/pages/Container/index.js @@ -59,7 +59,8 @@ export default class Container extends React.Component { } function AppMiddle(props) { - const content = process.env.NODE_ENV === "development" && !window.__POWERED_BY_QIANKUN__ + + const content = process.env.NODE_ENV === "development" && !window.__POWERED_BY_QIANKUN__ && props.location.pathname !== "/container/Driver" ? {props.children} : props.children;