From 251a7350dd18a061f367d1eb5151101bd5b5d74f Mon Sep 17 00:00:00 2001 From: yezian Date: Fri, 29 Mar 2024 23:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=94=B9=E4=B8=BA=E5=85=88?= =?UTF-8?q?=E5=AE=A1=E5=90=8E=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/PostMachineReview/index.jsx | 68 +++++++++------------------ 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/src/pages/PostMachineReview/index.jsx b/src/pages/PostMachineReview/index.jsx index 075780a..5dbec30 100644 --- a/src/pages/PostMachineReview/index.jsx +++ b/src/pages/PostMachineReview/index.jsx @@ -247,12 +247,10 @@ const PostMachineReviewContent = (props) => {
- {(current === "rollbackbymachine" || - current === "machinereviewfail") && ( - - )} + +
@@ -261,10 +259,16 @@ const PostMachineReviewContent = (props) => { ]; //给表单绑定ref const formRef = useRef(null); - //点击修改状态按钮 - const onClickSubmit = (record) => { + //点击通过按钮 + const onClickPass = (record) => { formRef.current.record = record; - formRef.current.btn = "submit"; + formRef.current.type = 0; + formRef.current.submit(); + }; + //点击拒绝按钮 + const onClickReject = (record) => { + formRef.current.record = record; + formRef.current.type = 1; formRef.current.submit(); }; //提交表单 @@ -272,45 +276,26 @@ const PostMachineReviewContent = (props) => { try { //通过图片审核,如果是视频直接跳过 const base = baseRequest(); - if (formRef.current.record.others.media.id !== undefined) { - const response = await fetch("/op/image_audit_task/pass_batch", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - tasks: [formRef.current.record.others.media], - ...base, - }), - }); - const approveData = await response.json(); - console.log(approveData); - if (approveData.ret === -1) { - alert(approveData.msg); - return; - } - } - //通过文案审核 - const response2 = await fetch("/op/text_audit_task/pass_batch", { + const response = await fetch("/op/moment/review", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ - tasks: [formRef.current.record.others.text], + moment_ids: [parseInt(formRef.current.record.momentId, 10)], + op_type: formRef.current.type, ...base, }), }); - const approveData2 = await response2.json(); - console.log(approveData2); - if (approveData2.ret === -1) { - alert(approveData2.msg); + const _data = await response.json(); + if (_data.ret === -1) { + alert(_data.msg); return; } //取消数据展示 setShowData( showData.filter( - (item) => item.id.media !== formRef.current.record.others.media.id + (item) => item.momentId !== formRef.current.record.momentId ) ); } catch (error) { @@ -334,9 +319,6 @@ const PostMachineReviewContent = (props) => { case "passbymachine": querryStatus = 2; break; - case "passbyoperator": - querryStatus = 5; - break; default: break; } @@ -364,6 +346,7 @@ const PostMachineReviewContent = (props) => { const structedData = temData.data.list.map((item, index) => { return { key: index, + momentId: item.moment_audit_task.associative_table_id, id: { media: item.image_audit_task_vo.id, text: item.text_audit_task_vo.id, @@ -444,7 +427,6 @@ const PostMachineReviewContent = (props) => {

{current === "rollbackbymachine" && `机审核违规${showData.length}条`} {current === "passbymachine" && `机审核通过${showData.length}条`} - {current === "passbyoperator" && `运营通过${showData.length}条`}

{ setCurrent(e.key); @@ -519,10 +497,6 @@ export default function PostMachineReview() { path="/passbymachine" element={} /> - } - /> );