Commit 4c751087 authored by krysent's avatar krysent

new

parent 08e9d2e0
...@@ -207,6 +207,11 @@ export default [ ...@@ -207,6 +207,11 @@ export default [
name: "标签模板", name: "标签模板",
component: "./platform/Labeltemplate", component: "./platform/Labeltemplate",
}, },
{
path: "/platform/exceptionmanagement",
name: "异常管理",
component: "./Errormange",
},
{ {
component: "./404", component: "./404",
}, },
...@@ -309,6 +314,7 @@ export default [ ...@@ -309,6 +314,7 @@ export default [
name: "生产看板", name: "生产看板",
component: "./Storeboard", component: "./Storeboard",
}, },
{ {
component: "./404", component: "./404",
}, },
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
"precommit": "lint-staged", "precommit": "lint-staged",
"prettier": "prettier -c --write \"src/**/*\"", "prettier": "prettier -c --write \"src/**/*\"",
"serve": "umi-serve", "serve": "umi-serve",
"start": "cross-env UMI_ENV=dev umi dev", "start": "set NODE_OPTIONS=--openssl-legacy-provider & cross-env UMI_ENV=dev umi dev",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev", "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev", "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
......
import React, { useEffect, useMemo, useRef, useState } from "react"; import React, { useEffect, useMemo, useRef, useState } from "react";
import { Dropdown, Menu, Button, message } from "antd"; import { Dropdown, Menu, Button, message } from "antd";
import AutoTable from "@/components/AutoTable"; import AutoTable from "@/components/AutoTable";
import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm"; import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn import getPrem from "@/utils/getPrem"; //权限判断fn
import { useReactToPrint } from "react-to-print"; import { useReactToPrint } from "react-to-print";
import { useModel } from "umi"; import { useModel } from "umi";
import PrintDom from "./printdom";
import { PrintQrCode } from "@/components/PrintCode";
function Outstore(props) { function Errormange(props) {
const { initialState, setInitialState } = useModel("@@initialState"); const { initialState, setInitialState } = useModel("@@initialState");
const [activeTabKey, onTabChange] = useState("1"); const [activeTabKey, onTabChange] = useState("1");
const [selectKeys, setSelectKeys] = useState([]); const [selectKeys, setSelectKeys] = useState([]);
...@@ -45,50 +42,44 @@ function Outstore(props) { ...@@ -45,50 +42,44 @@ function Outstore(props) {
})); }));
} }
const handlePrint = useReactToPrint({
content: () => printRef.current.dom.current,
});
const mutiPrint = useReactToPrint({
content: () => mutiPrintRef.current.dom.current,
});
const PrintButton = (
<Button
disabled={!selectKeys.length}
onClick={() => {
mutiPrint();
}}
>
打印
</Button>
);
useEffect(() => {
const detail = defaultFields.detail(setSelectKeys, PrintButton);
setdrawprops((s) => ({
...s,
...detail,
}));
}, [selectKeys]);
const columns = useMemo(() => { const columns = useMemo(() => {
return [
{
title: "设备编号",
dataIndex: "requestEquipment",
key: "requestEquipment",
},
{
title: "错误代码",
dataIndex: "requestErrorCode",
search: false,
key: "requestErrorCode",
},
{
title: "错误说明",
dataIndex: "requestErrorMsg",
search: false,
key: "requestErrorMsg",
},
{
title: "请求时间",
dataIndex: "apiSendTime",
key: "apiSendTime",
search: false,
},
];
}, [activeTabKey]); }, [activeTabKey]);
const tableprops = { const tableprops = {
...props, ...props,
columns, columns,
path:"" path: "/ngic-workmanship/alarmReport/queryList",
}; };
return ( return (
<div> <div>
<div style={{ position: "fixed", bottom: -100000 }}>
<PrintDom ref={printRef} {...drawprops} />
</div>
<div style={{ display: "none" }}>
<PrintQrCode ref={mutiPrintRef} selectedItems={selectKeys} />
</div>
<AutoTable <AutoTable
{...tableprops} {...tableprops}
actionRef={actionRef} actionRef={actionRef}
...@@ -98,4 +89,4 @@ function Outstore(props) { ...@@ -98,4 +89,4 @@ function Outstore(props) {
); );
} }
export default Outstore; export default Errormange;
...@@ -184,7 +184,7 @@ export default ({ data }) => { ...@@ -184,7 +184,7 @@ export default ({ data }) => {
> >
<div> <div>
<div <div
style={{ backgroundColor: "green" }} style={{ backgroundColor: "rgb(127, 187, 36)" }}
className="statustitle" className="statustitle"
></div> ></div>
空闲 空闲
......
...@@ -167,6 +167,8 @@ ...@@ -167,6 +167,8 @@
color: #fff; color: #fff;
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
display: block;
width: 30px;
} }
span { span {
......
...@@ -289,8 +289,8 @@ function Outstore(props) { ...@@ -289,8 +289,8 @@ function Outstore(props) {
}, },
{ {
title: "创建人", title: "创建人",
dataIndex: "createUserName", dataIndex: "finishUserName",
key: "createUserName", key: "finishUserName",
search: false, search: false,
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment