From 140d6720c223216028307c3ef91c634e328d9d27 Mon Sep 17 00:00:00 2001 From: zhangds Date: Fri, 12 Aug 2022 18:18:28 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=89=20=E4=BF=AE=E5=A4=8D=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=B8=A6hash=E5=80=BC=202=EF=BC=89=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AE=A2=E5=8D=95=E5=A4=8D=E5=88=B6=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/plan-copy.js | 2 +- src/pages/plan/keyList/index.jsx | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/pages/plan/add/plan-copy.js b/src/pages/plan/add/plan-copy.js index 55c68bb5..0bcc08bb 100644 --- a/src/pages/plan/add/plan-copy.js +++ b/src/pages/plan/add/plan-copy.js @@ -104,7 +104,7 @@ export default class add extends React.Component { */ getDetails(plan_id) { 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); handelResponse( res, diff --git a/src/pages/plan/keyList/index.jsx b/src/pages/plan/keyList/index.jsx index cd4af2fb..d077ce81 100644 --- a/src/pages/plan/keyList/index.jsx +++ b/src/pages/plan/keyList/index.jsx @@ -270,7 +270,12 @@ const UseKeyList = (props, ref) => { */ const onQueryBtn = () => { 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); setTableData([]); setDataCount(0); + dispatch({ type: "setHash", payload: "" }); }; /** @@ -409,6 +415,18 @@ const UseKeyList = (props, ref) => { 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) { exportKey(param).then((res) => { if (res.type == "application/json") { @@ -433,6 +451,7 @@ const UseKeyList = (props, ref) => { }; const selectionFun = (data) => { + console.log("data select =>", data); if (data.length > 0) { setMultipleDisabledBtn(false); } else { @@ -531,20 +550,19 @@ const UseKeyList = (props, ref) => { const onPageChange = (e) => { dispatch({ type: "setPages", payload: { page: e } }); - getTable({ page: e }); + getTable({ page: e, hash: state.hash }); }; const onCountChange = (e) => { console.log("2", e); dispatch({ type: "setPages", payload: { page: 1, limit: e } }); - getTable({ page: 1, limit: e }); + getTable({ page: 1, limit: e, hash: state.hash }); }; const bachOnClose = () => { setBachUploadPop({ ...bachUploadPop, bachVisible: false }); }; const bachImportBtn = (data) => { - console.log("setHash =>", data); if (bachUploadPop.bachApiType === 1) { dispatch({ type: "setHash", payload: data }); getTable({ hash: data }); @@ -579,8 +597,6 @@ const UseKeyList = (props, ref) => { return; } }; - - const onSwitchChange = () => {}; return (