"use strict";const e=require("../../common/vendor.js"),t=require("../../request/request.js"),n=require("./processChain.js"),a=require("./processChainLabels.js"),o=require("./useProcessChainScroll.js"),r={__name:"HazardProcessChainPanel",props:{chainData:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},bodyHeight:{type:Number,default:0}},setup(r){const c=a.CHAIN_LABELS,s=r,{chainData:l,loading:i}=e.toRefs(s),{historyList:f,activeIndex:u,contentScrollIntoView:m,stepScrollIntoView:p,scrollWithAnimation:h,onContentScroll:d,onScrollToLower:g,scrollToNode:y,scheduleMeasureLayout:b}=o.useProcessChainScroll(l,i),N=e.computed((()=>({height:`${s.bodyHeight>0?s.bodyHeight:400}px`}))),P=e.computed((()=>({height:`${s.bodyHeight>0?s.bodyHeight:400}px`})));e.watch((()=>s.bodyHeight),(e=>{e>0&&(b(),setTimeout(b,100))}));const v={2:"level-normal",3:"level-major"},S=e=>{const t=null==e?void 0:e.level,n=null==e?void 0:e.levelName;return null!=t&&v[t]?v[t]:n&&a.LEVEL_NAME_CLASS_MAP[n]?a.LEVEL_NAME_CLASS_MAP[n]:""},T=e=>t.toImageUrl(e),C=(e,t)=>n.resolveFieldDisplay(t,e.completed),L=(e,t)=>C(e,t)===n.PENDING_LABEL,_=(e,t=!0)=>{if(null==e||""===e)return n.resolveFieldDisplay("",t);const a=Number(e);return Number.isNaN(a)?n.resolveFieldDisplay("",t):`${a} ${c.yuan}`},A=t=>{const n=T(t);n&&e.index.previewImage({current:n,urls:[n]})},x=(t,n)=>{const a=(t||[]).filter((e=>"image"===e.fileType||!e.fileType)).map((e=>T(e.filePath))).filter(Boolean);a.length&&e.index.previewImage({current:a[n]||a[0],urls:a})};return(t,a)=>e.e({a:e.unref(i)},e.unref(i)?{b:e.t(e.unref(c).loading)}:0===e.unref(f).length?{d:e.t(e.unref(c).empty)}:{e:e.f(e.unref(f),((t,a,o)=>e.e({a:e.unref(n.getProcessStepIconPath)(t,e.unref(u)===a),b:e.unref(u)===a?1:"",c:e.t(t.nodeName),d:e.unref(u)===a?1:"",e:ae.unref(y)(a)),"step-"+a)}))),f:e.s(N.value),g:e.unref(p),h:e.f(e.unref(f),((t,a,o)=>e.e({a:t.completed},t.completed?{b:e.t(t.titlePrefix),c:e.t(e.unref(c).personnelSuffix),d:e.t(C(t,t.operator)),e:e.t(C(t,t.time))}:{f:e.t(e.unref(c).executorPrefix),g:e.t(e.unref(c).personnelSuffix),h:e.t(C(t,t.currentHandlerName)),i:e.t(e.unref(c).statusSuffix),j:e.t(e.unref(n.PENDING_LABEL))},{k:t.completed&&"add"===t.type&&t.content.levelName},t.completed&&"add"===t.type&&t.content.levelName?{l:e.t(t.content.levelName),m:e.n(S(t.content))}:{},{n:t.completed},(t.completed,{}),{o:t.completed},t.completed?e.e({p:"add"===t.type},"add"===t.type?e.e({q:e.t(e.unref(c).hazardCode),r:e.t(C(t,t.content.code)),s:e.t(e.unref(c).hazardTitle),t:e.t(C(t,t.content.title)),v:e.t(e.unref(c).checkSource),w:e.t(C(t,t.content.source)),x:e.t(e.unref(c).hazardSource),y:e.t(C(t,t.content.hazardSourceName)),z:e.t(e.unref(c).hazardArea),A:e.t(C(t,t.content.areaName)),B:e.t(e.unref(c).address),C:e.t(C(t,t.content.address)),D:e.t(e.unref(c).hazardLevel),E:e.t(C(t,t.content.levelName)),F:e.n(S(t.content)),G:e.t(e.unref(c).hazardTag),H:e.t(C(t,t.content.tagName)),I:e.t(e.unref(c).description),J:e.t(C(t,t.content.description)),K:t.content.attachments&&t.content.attachments.length||!t.completed},t.content.attachments&&t.content.attachments.length||!t.completed?e.e({L:e.t(e.unref(c).hazardAttachments),M:t.content.attachments&&t.content.attachments.length},t.content.attachments&&t.content.attachments.length?{N:e.f(t.content.attachments,((n,a,o)=>({a:a,b:T(n.filePath),c:e.o((e=>x(t.content.attachments,a)),a),d:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),a)})))}:{O:e.t(C(t,""))}):{},{P:e.t(e.unref(c).legalBasis),Q:e.t(C(t,t.content.legalBasis))}):"assign"===t.type?{S:e.t(e.unref(c).assigneeName),T:e.t(C(t,t.content.assigneeName)),U:e.t(e.unref(c).assignDeadline),V:e.t(C(t,t.content.deadline)),W:e.t(e.unref(c).assignStatus),X:e.t(C(t,t.content.assignStatusName))}:"rectify"===t.type?e.e({Z:e.t(e.unref(c).rectifyStatus),aa:e.t(C(t,t.content.rectifyStatusName)),ab:e.t(e.unref(c).rectifyPlan),ac:e.t(C(t,t.content.rectifyPlan)),ad:e.t(e.unref(c).rectifyResult),ae:e.t(C(t,t.content.rectifyResult)),af:e.t(e.unref(c).rectifyMeasures),ag:e.t(C(t,t.content.rectificationMeasures)),ah:e.t(e.unref(c).controlMeasures),ai:e.t(C(t,t.content.controlMeasures)),aj:e.t(e.unref(c).rectifierName),ak:e.t(C(t,t.content.rectifierName)),al:e.t(e.unref(c).managerNames),am:e.t(C(t,t.content.managerNames)),an:e.t(e.unref(c).memberNames),ao:e.t(C(t,t.content.memberNames)),ap:e.t(e.unref(c).planCost),aq:e.t(_(t.content.planCost,t.completed)),ar:e.t(e.unref(c).actualCost),as:e.t(_(t.content.actualCost,t.completed)),at:t.content.attachments&&t.content.attachments.length||!t.completed},t.content.attachments&&t.content.attachments.length||!t.completed?e.e({av:e.t(e.unref(c).rectifyAttachments),aw:t.content.attachments&&t.content.attachments.length},t.content.attachments&&t.content.attachments.length?{ax:e.f(t.content.attachments,((n,a,o)=>e.e({a:"image"===n.fileType||!n.fileType},"image"!==n.fileType&&n.fileType?{e:e.t(n.fileName||e.unref(c).attachmentFallback)}:{b:T(n.filePath),c:e.o((e=>x(t.content.attachments,a)),a),d:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),a)},{f:a})))}:{ay:e.t(C(t,""))}):{},{az:t.content.signPath||!t.completed},t.content.signPath||!t.completed?e.e({aA:e.t(e.unref(c).rectifySign),aB:t.content.signPath},t.content.signPath?{aC:T(t.content.signPath),aD:e.o((e=>A(t.content.signPath)),"node-"+a),aE:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),"node-"+a)}:{aF:e.t(C(t,""))}):{}):"verify"===t.type||"writeoff_approve"===t.type?e.e({aH:e.t(e.unref(c).verifyResult),aI:t.completed&&t.content.resultName},t.completed&&t.content.resultName?{aJ:e.t(t.content.resultName),aK:e.n(t.content.resultName===e.unref(c).pass?"result-tag--pass":"result-tag--fail")}:{aL:e.t(C(t,t.content.resultName))},{aM:t.content.remark||!t.completed},t.content.remark||!t.completed?{aN:e.t(e.unref(c).verifyRemark),aO:e.t(C(t,t.content.remark))}:{},{aP:t.content.attachments&&t.content.attachments.length||!t.completed},t.content.attachments&&t.content.attachments.length||!t.completed?e.e({aQ:e.t(e.unref(c).verifyAttachments),aR:t.content.attachments&&t.content.attachments.length},t.content.attachments&&t.content.attachments.length?{aS:e.f(t.content.attachments,((n,a,o)=>e.e({a:"image"===n.fileType||!n.fileType},"image"!==n.fileType&&n.fileType?{e:e.t(n.fileName||e.unref(c).attachmentFallback)}:{b:T(n.filePath),c:e.o((e=>x(t.content.attachments,a)),a),d:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),a)},{f:a})))}:{aT:e.t(C(t,""))}):{},{aU:t.content.signPath||!t.completed},t.content.signPath||!t.completed?e.e({aV:e.t(e.unref(c).verifySign),aW:t.content.signPath},t.content.signPath?{aX:T(t.content.signPath),aY:e.o((e=>A(t.content.signPath)),"node-"+a),aZ:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),"node-"+a)}:{ba:e.t(C(t,""))}):{}):"writeoff_apply"===t.type?e.e({bc:e.t(e.unref(c).writeoffDeadline),bd:e.t(C(t,t.content.rectifyDeadline)),be:e.t(e.unref(c).responsibleDept),bf:e.t(C(t,t.content.responsibleDeptName)),bg:e.t(e.unref(c).responsiblePerson),bh:e.t(C(t,t.content.responsiblePerson)),bi:e.t(e.unref(c).mainTreatment),bj:e.t(C(t,t.content.mainTreatmentContent)),bk:e.t(e.unref(c).treatmentResult),bl:e.t(C(t,t.content.treatmentResult)),bm:e.t(e.unref(c).selfVerify),bn:e.t(C(t,t.content.selfVerifyContent)),bo:t.content.signPath||!t.completed},t.content.signPath||!t.completed?e.e({bp:e.t(e.unref(c).applySign),bq:t.content.signPath},t.content.signPath?{br:T(t.content.signPath),bs:e.o((e=>A(t.content.signPath)),"node-"+a),bt:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),"node-"+a)}:{bv:e.t(C(t,""))}):{}):"approval"===t.type?e.e({bx:e.t(e.unref(c).approvalOpinion),by:t.completed&&t.content.approveTypeName},t.completed&&t.content.approveTypeName?{bz:e.t(t.content.approveTypeName),bA:e.n(t.content.pass?"result-tag--pass":"result-tag--fail")}:{bB:e.t(C(t,t.content.approveTypeName))},{bC:e.t(e.unref(c).approvalComment),bD:e.t(C(t,t.content.comment)),bE:L(t,t.content.comment)?1:"",bF:e.t(e.unref(c).smsReminder),bG:null!=t.content.sendMsgFlag},null!=t.content.sendMsgFlag?{bH:e.t(t.content.sendMsgFlag?e.unref(c).yes:e.unref(c).no)}:{bI:e.t(C(t,""))},{bJ:t.content.signPath||!t.completed},t.content.signPath||!t.completed?e.e({bK:e.t(e.unref(c).approvalSign),bL:t.content.signPath},t.content.signPath?{bM:T(t.content.signPath),bN:e.o((e=>A(t.content.signPath)),"node-"+a),bO:e.o(((...t)=>e.unref(b)&&e.unref(b)(...t)),"node-"+a)}:{bP:e.t(C(t,""))}):{}):{},{R:"assign"===t.type,Y:"rectify"===t.type,aG:"verify"===t.type||"writeoff_approve"===t.type,bb:"writeoff_apply"===t.type,bw:"approval"===t.type}):{},{bQ:e.unref(u)===a?1:"",bR:"node-"+a,bS:"process-node-"+a,bT:a===e.unref(f).length-1?1:""}))),i:e.s(N.value),j:e.unref(m),k:e.unref(h),l:e.o(((...t)=>e.unref(d)&&e.unref(d)(...t))),m:e.o(((...t)=>e.unref(g)&&e.unref(g)(...t))),n:e.s(P.value)},{c:0===e.unref(f).length,o:e.gei(t,"")})}},c=e._export_sfc(r,[["__scopeId","data-v-0fa85334"]]);wx.createComponent(c);