Merge remote-tracking branch 'origin/dev' into dev
commit
b826dac889
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const queryDriverConfig = declareRequest(
|
||||||
|
"queryDriverConfigLoading",
|
||||||
|
"Get > /safetyEval/account/checkTerminalType",
|
||||||
|
"driverConfig: {} | res.data",
|
||||||
|
);
|
||||||
|
|
@ -20,3 +20,4 @@ export const NS_EQUIP_INFO = defineNamespace("equipInfo");
|
||||||
export const NS_QUAL_FILING = defineNamespace("qualFiling");
|
export const NS_QUAL_FILING = defineNamespace("qualFiling");
|
||||||
export const NS_QUAL_REVIEW = defineNamespace("qualReview");
|
export const NS_QUAL_REVIEW = defineNamespace("qualReview");
|
||||||
export const NS_QUAL_EXPERT = defineNamespace("qualExpert");
|
export const NS_QUAL_EXPERT = defineNamespace("qualExpert");
|
||||||
|
export const NS_DRIVER = defineNamespace("driver");
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
<div className="driver-container">
|
||||||
|
<Skeleton active loading={queryDriverConfigLoading}>
|
||||||
|
<div className="driver-container-header">
|
||||||
|
<div>
|
||||||
|
{isSupervision && (
|
||||||
|
<Tabs
|
||||||
|
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
label: "首页",
|
||||||
|
key: "1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "驾驶舱",
|
||||||
|
key: "2",
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
activeKey={activeKey}
|
||||||
|
onChange={setActiveKey}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button onClick={() => props.history.push(window.location.origin)} type="primary">去工作台</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="driver-container-content">
|
||||||
|
{isInstitution && <Institution {...props} />}
|
||||||
|
{isSupervision && activeKey === "1" && <Supervision {...props} />}
|
||||||
|
{isSupervision && activeKey === "2" && <Cockpit {...props} />}
|
||||||
|
</div>
|
||||||
|
</Skeleton>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Connect([NS_DRIVER], true)(Driver);
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -59,7 +59,8 @@ export default class Container extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
function AppMiddle(props) {
|
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"
|
||||||
? <SimulatedLayout>{props.children}</SimulatedLayout>
|
? <SimulatedLayout>{props.children}</SimulatedLayout>
|
||||||
: props.children;
|
: props.children;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue