import{a as R,u as $,S as C,B as A,r as j,b as E,U as J,aq as L,d as h,o as r,w as n,f as t,a3 as N,x as T,Q as K,i as v,F as U,p as W,v as d,g as G,h as H,k as S,l as m,t as p,e as c,m as b,a2 as I,n as X,a6 as Y,a8 as Z,y as ee}from"./index-CS0Lg7FU.js";import{Q as ae}from"./QPageScroller-C9-qXFSe.js";import{Q as te}from"./QSlideItem-a__vadzS.js";import{Q as oe}from"./QSpinnerPuff-DuMtRbAq.js";import{Q as ne}from"./QInnerLoading-C383b2GP.js";import{E as se,Q as re}from"./EmptyPlaceholder-Ch5Jl2AI.js";import{_ as le,u as ie}from"./_plugin-vue_export-helper-BrVfw-gY.js";import{u as ce}from"./lookup-Cd-CHNw1.js";const _e={key:0},fe={class:"list-item-bottom",style:{"font-size":"14px"}},ue={class:"left"},de={class:"right"},me={class:"task-person"},pe={class:"task-date"},we={__name:"TabList",setup(P){const{t:l}=R();ie();const w=$(),_=C(),g=ce(),{filteredCompletedTasks:k}=A(_),i=j(!1),B=E(),D=e=>{if(!e)return"";let a=e.__customized_set.workflow_process_name;return a===""?e.name:`${e.name}-${a}`},M=e=>e.sender,V=e=>Z(e.creation_datetime);let f=j({});const q=e=>{if(!f.value||!e.workflow_meta_task_classification||!f.value[e.workflow_meta_task_classification])return"";const a=w.lang.toLowerCase();return f.value[e.workflow_meta_task_classification][a]||""},z=e=>{const a=e.workflow_task_state==="running"&&e.overdue_flag&&e.overdue_number!==0?"overdue":e.workflow_task_state==="running"&&e.warning_flag&&e.warning_number!==0?"warning":e.workflow_task_state;return a=="overdue"?"color-iconfont caxacolor-yanqi":a=="warning"?"color-iconfont caxacolor-yujing":a=="terminated"?"color-iconfont caxacolor-tingzhi":a=="running"?"iconfont caxa-jinhang":a=="canceled"?"iconfont caxa-quxiao":a=="completed"?"iconfont caxa-wancheng":"iconfont caxa-jinhang"},F=async e=>{try{await x(),e(),i.value=!1}catch(a){console.error("Failed to get completed tasks:",a),e()}finally{e()}};async function x(){try{i.value=!0,await _._getCompletedTasks()}finally{i.value=!1}}const O=async e=>{console.log("todetail",e),_.setCurrTask(e);let a=e.workflow_meta_task_use_type.includes("project"),o=e.workflow_meta_task_classification==="project_management"&&!a,y=e.workflow_meta_task_classification=="material_management",Q,s;(a||o||y)&&(Q=await Y(e.internal_name,e.object_id),s=Q.workflow_processable_objects[0]);let u;a?u={from:"completed",node_id:s.internal_name+"-"+s.object_id,node_type:"taskDetails",node_name:e.name,special:JSON.stringify({object_id:e.object_id})}:y?u={from:"completed",node_id:e.internal_name+"-"+e.object_id,node_type:"taskDetails",node_name:e.name,special:JSON.stringify({wfworkitemName:e.name,prjInfo:{name:s.name,class_internal_name:s.internal_name,link_internal_name:s.link_internal_name?s.link_internal_name:"",class_objectid:s.object_id,link_objectid:s.link_objectid?s.link_objectid:"",state:e.workflow_task_state,metaIcon:""}})}:u={from:"completed",node_id:e.internal_name+"-"+e.object_id,node_type:"taskDetails",node_name:e.name},setTimeout(()=>{B.push({name:"taskDetail",params:{id:e.object_id},query:u})},200)};return J(()=>{x()}),L(async()=>{await g.getWorkflowMetaTemplateClassifications(),f.value=g.workflowMetaTemplateClassifications}),(e,a)=>(r(),h(re,{onRefresh:F},{default:n(()=>[t(N,null,{default:n(()=>[t(K,{separator:"",class:"scroll"},{default:n(()=>[(r(!0),v(U,null,W(d(k),o=>(r(),h(te,{key:o.object_id},{default:n(()=>[o?(r(),v("div",_e,[t(G,{clickable:"",onClick:y=>O(o),class:"list-item"},{default:n(()=>[t(H,null,{default:n(()=>[t(S,{class:"list-item-top"},{default:n(()=>[m(p(D(o)),1)]),_:2},1024),t(S,{caption:"",class:"gray"},{default:n(()=>[c("div",fe,[c("div",ue,[t(b,{class:I(z(o))},null,8,["class"]),m(p(q(o)),1)]),c("div",de,[c("span",me,[t(b,{class:"iconfont caxa-fanhui1"}),m(p(M(o)),1)]),c("span",pe,[t(b,{class:"iconfont caxa-shijian"}),m(p(V(o)),1)])])])]),_:2},1024)]),_:2},1024)]),_:2},1032,["onClick"])])):T("",!0)]),_:2},1024))),128)),t(X),t(ne,{showing:i.value},{default:n(()=>[t(oe,{size:"50px",color:"primary"})]),_:1},8,["showing"])]),_:1}),!i.value&&(!d(k)||!d(k).length)?(r(),h(se,{key:0,message:d(l)("uncompletedView.noCompletedTasks")},null,8,["message"])):T("",!0)]),_:1})]),_:1}))}},ge=le(we,[["__scopeId","data-v-530d52cb"]]),Te={__name:"completedTask",setup(P){const l=C(),w=j(null);return L(()=>{l.resetAdvancedSearchCond(),l.setSearchText(""),l.activeFilter="lastmonth",console.log("myCompletedTask onMounted")}),(_,g)=>(r(),v("div",null,[t(N,null,{default:n(()=>[t(ge,{ref_key:"completeList",ref:w},null,512),t(ae,{position:"bottom-right","scroll-offset":10,offset:[18,18]},{default:n(()=>[t(ee,{fab:"",icon:"keyboard_arrow_up",color:"primary"})]),_:1})]),_:1})]))}};export{Te as default};
