import{c as p,u as g}from"./index-0f3e2c06-1779868775780v=1.0.0.js";import{a as E,b as D,g as y}from"./common-e1875f9b-1779868775780v=1.0.0.js";import{c as B}from"./codeManage-8e2aaa3d-1779868775780v=1.0.0.js";import{y as n,E as a}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{e as C,a as h}from"./vendor-98154105-1779868775780v=1.0.0.js";const A=()=>{const i=p(),r=g(),o=t=>{let e=!1;const s=i.userInfo;return t.auditType==="personal"&&(e=t.auditRolePersIds.split(",").map(Number).includes(s.accountId)),t.auditType==="role"&&(e=t.auditRolePersIds.split(",").filter(u=>new Set(s.roleIds).has(u))),t.auditType==="orgs"&&(e=t.auditAreaLevelId==s.levelId),e&&t.auditStatus=="auditing"},m=t=>new Promise(e=>{n.prompt("\u5907\u6CE8","\u901A\u8FC7",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88"}).then(async({value:s})=>{t.auditDesc=s;let u=await E(t);u.code===0?(a.success("\u64CD\u4F5C\u6210\u529F"),e(!0)):(a.warning(u.msg),e(!1))}).catch(()=>{e(!1)})}),d=t=>new Promise(e=>{n.prompt("\u5907\u6CE8","\u9A73\u56DE",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88"}).then(async({value:s})=>{t.auditDesc=s;let u=await D(t);u.code===0?(a.success("\u64CD\u4F5C\u6210\u529F"),e(!0)):(a.warning(u.msg),e(!1))}).catch(()=>{e(!1)})}),l=t=>new Promise(e=>{let s="\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6570\u636E\u5417";n.confirm(s,"\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88"}).then(async()=>{let u=B(t);u.code===0?(a.success("\u5220\u9664\u6210\u529F"),e(!0)):(a.warning(u.msg),e(!1))}).catch(()=>{e(!1)})}),f=C(()=>r.getEnumObjByKey("codePushStatus")),c=h([]);return{judgeUserIsCheck:o,confirmFn:m,rejectFn:d,auditStatusMap:f,getAuditEntityList:async(t,e)=>{let u=await y({bizConfType:t,bizContentId:e});u.code==0&&(c.value=u.data?u.data:[])},progressList:c,deleteFn:l}},L=A;export{L as u};
