1) 修复导出带hash值 2) 修复订单复制回显数据

This commit is contained in:
zhangds 2022-08-12 18:18:28 +08:00
parent e729725d52
commit 140d6720c2
2 changed files with 23 additions and 7 deletions

View File

@ -104,7 +104,7 @@ export default class add extends React.Component {
*/ */
getDetails(plan_id) { getDetails(plan_id) {
let copy_count_golod = sessionStorage.getItem("copy_count_golod"); let copy_count_golod = sessionStorage.getItem("copy_count_golod");
getDraftInfo(plan_id).then((res) => { get_copy_data(plan_id).then((res) => {
console.log("res 1=>", res); console.log("res 1=>", res);
handelResponse( handelResponse(
res, res,

View File

@ -270,7 +270,12 @@ const UseKeyList = (props, ref) => {
*/ */
const onQueryBtn = () => { const onQueryBtn = () => {
dispatch({ type: "setHash", payload: "" }); dispatch({ type: "setHash", payload: "" });
getTable({ hash: null }); let data = {
page: 1,
limit: 10,
hash: null,
};
getTable(data);
}; };
/** /**
@ -280,6 +285,7 @@ const UseKeyList = (props, ref) => {
setLodgingTable(false); setLodgingTable(false);
setTableData([]); setTableData([]);
setDataCount(0); setDataCount(0);
dispatch({ type: "setHash", payload: "" });
}; };
/** /**
@ -409,6 +415,18 @@ const UseKeyList = (props, ref) => {
tag = true; tag = true;
} }
} }
//
if (selectTable.length > 0) {
let key_arr = [];
key_arr = selectTable.map((item) => {
return item.key;
});
param = {
keys: key_arr.join(","),
};
tag = true;
}
if (tag) { if (tag) {
exportKey(param).then((res) => { exportKey(param).then((res) => {
if (res.type == "application/json") { if (res.type == "application/json") {
@ -433,6 +451,7 @@ const UseKeyList = (props, ref) => {
}; };
const selectionFun = (data) => { const selectionFun = (data) => {
console.log("data select =>", data);
if (data.length > 0) { if (data.length > 0) {
setMultipleDisabledBtn(false); setMultipleDisabledBtn(false);
} else { } else {
@ -531,20 +550,19 @@ const UseKeyList = (props, ref) => {
const onPageChange = (e) => { const onPageChange = (e) => {
dispatch({ type: "setPages", payload: { page: e } }); dispatch({ type: "setPages", payload: { page: e } });
getTable({ page: e }); getTable({ page: e, hash: state.hash });
}; };
const onCountChange = (e) => { const onCountChange = (e) => {
console.log("2", e); console.log("2", e);
dispatch({ type: "setPages", payload: { page: 1, limit: e } }); dispatch({ type: "setPages", payload: { page: 1, limit: e } });
getTable({ page: 1, limit: e }); getTable({ page: 1, limit: e, hash: state.hash });
}; };
const bachOnClose = () => { const bachOnClose = () => {
setBachUploadPop({ ...bachUploadPop, bachVisible: false }); setBachUploadPop({ ...bachUploadPop, bachVisible: false });
}; };
const bachImportBtn = (data) => { const bachImportBtn = (data) => {
console.log("setHash =>", data);
if (bachUploadPop.bachApiType === 1) { if (bachUploadPop.bachApiType === 1) {
dispatch({ type: "setHash", payload: data }); dispatch({ type: "setHash", payload: data });
getTable({ hash: data }); getTable({ hash: data });
@ -579,8 +597,6 @@ const UseKeyList = (props, ref) => {
return; return;
} }
}; };
const onSwitchChange = () => {};
return ( return (
<div className="key-container" id="dislist"> <div className="key-container" id="dislist">
<TabPage tabs={tabList} style={{ paddingBottom: 0 }}> <TabPage tabs={tabList} style={{ paddingBottom: 0 }}>