Commit 8a60803f authored by krysent's avatar krysent

异常管理

parent 153a904e
import React, { useEffect, useMemo, useRef, useState } from "react";
import { Dropdown, Menu, Button, message } from "antd";
import AutoTable from "@/components/AutoTable";
import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch";
import DrawInitForm from "@/components/DrawInitForm";
import getPrem from "@/utils/getPrem"; //权限判断fn
import { useReactToPrint } from "react-to-print";
import { useModel } from "umi";
import PrintDom from "./printdom";
import { PrintQrCode } from "@/components/PrintCode";
function Outstore(props) {
const { initialState, setInitialState } = useModel("@@initialState");
const [activeTabKey, onTabChange] = useState("1");
const [selectKeys, setSelectKeys] = useState([]);
let [drawprops, setdrawprops] = useState({
title: "",
visible: false,
onClose: () => {
setdrawprops((s) => ({
...s,
visible: false,
fields: {},
}));
},
fields: {},
width: 1200,
}),
actionRef = useRef(),
ChildRef = null,
printRef = useRef(),
mutiPrintRef = useRef();
//操作完成后刷新
function reload() {
actionRef.current.reload();
ChildRef?.onRefresh();
message.success("操作成功");
setdrawprops((s) => ({
...s,
visible: false,
fields: {},
}));
}
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(() => {
}, [activeTabKey]);
const tableprops = {
...props,
columns,
path:""
};
return (
<div>
<div style={{ position: "fixed", bottom: -100000 }}>
<PrintDom ref={printRef} {...drawprops} />
</div>
<div style={{ display: "none" }}>
<PrintQrCode ref={mutiPrintRef} selectedItems={selectKeys} />
</div>
<AutoTable
{...tableprops}
actionRef={actionRef}
onRef={(node) => (ChildRef = node)}
></AutoTable>
</div>
);
}
export default Outstore;
...@@ -161,7 +161,7 @@ export function getColumns(setDrawer, formRef) { ...@@ -161,7 +161,7 @@ export function getColumns(setDrawer, formRef) {
}, },
fieldProps: { fieldProps: {
mode: "multiple", mode: "multiple",
precision: 3, precision: 0,
max: 999999, max: 999999,
}, },
......
...@@ -201,7 +201,7 @@ export default ({ data }) => { ...@@ -201,7 +201,7 @@ export default ({ data }) => {
style={{ backgroundColor: "#9E9E9E" }} style={{ backgroundColor: "#9E9E9E" }}
className="statustitle" className="statustitle"
></div> ></div>
不可
</div> </div>
</div> </div>
</div> </div>
......
...@@ -112,21 +112,21 @@ export default { ...@@ -112,21 +112,21 @@ export default {
type: "input", type: "input",
title: "排", title: "排",
name: ["row"], name: ["row"],
required: false, required: true,
}, },
line: { line: {
value: null, value: null,
type: "input", type: "input",
title: "列", title: "列",
name: ["line"], name: ["line"],
required: false, required: true,
}, },
level: { level: {
value: null, value: null,
type: "input", type: "input",
title: "层", title: "层",
name: ["level"], name: ["level"],
required: false, required: true,
allowHalf: true, allowHalf: true,
}, },
roadway: { roadway: {
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
type: "input", type: "input",
title: "巷道", title: "巷道",
name: ["roadway"], name: ["roadway"],
required: false, required: true,
allowHalf: true, allowHalf: true,
}, },
......
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