Files
threeonecheck_web/unpackage/dist/build/mp-weixin/components/hazardDetail/HazardDetailPanelV2.js
2026-06-30 09:47:10 +08:00

2 lines
5.3 KiB
JavaScript

"use strict";const t=require("../../common/vendor.js"),e=require("../../request/request.js"),n=require("./hazardDetail.js"),a=require("./useHazardDetailScroll.js"),o={__name:"HazardDetailPanelV2",props:{detail:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},bodyHeight:{type:Number,default:0}},setup(o){const c=o,{detail:r,loading:l}=t.toRefs(c),{historyList:s,activeIndex:i,contentScrollIntoView:u,stepScrollIntoView:f,scrollWithAnimation:m,onContentScroll:h,onScrollToLower:g,scrollToNode:d,scheduleMeasureLayout:p}=a.useHazardDetailScroll(r,l),y=t.computed((()=>({height:`${c.bodyHeight>0?c.bodyHeight:400}px`}))),N=t.computed((()=>({height:`${c.bodyHeight>0?c.bodyHeight:400}px`})));t.watch((()=>c.bodyHeight),(t=>{t>0&&(p(),setTimeout(p,100))}));const v={2:"level-normal",3:"level-major"},b={"一般":"level-normal","一般隐患":"level-normal","重大":"level-major","重大隐患":"level-major"},P=t=>{const e=null==t?void 0:t.level,n=null==t?void 0:t.levelName;return null!=e&&v[e]?v[e]:n&&b[n]?b[n]:""},T=t=>e.toImageUrl(t),j=t=>{if(null==t||""===t)return"-";const e=Number(t);return Number.isNaN(e)?"-":`${e}`},w=e=>{const n=T(e);n&&t.index.previewImage({current:n,urls:[n]})},H=(e,n)=>{const a=(e||[]).filter((t=>"image"===t.fileType||!t.fileType)).map((t=>T(t.filePath))).filter(Boolean);a.length&&t.index.previewImage({current:a[n]||a[0],urls:a})};return(e,a)=>t.e({a:t.unref(l)},t.unref(l)||0===t.unref(s).length?{}:{c:t.f(t.unref(s),((e,a,o)=>t.e({a:t.unref(n.getStepIconPath)(e.type,t.unref(i)===a),b:t.unref(i)===a?1:"",c:t.t(e.nodeName),d:t.unref(i)===a?1:"",e:a<t.unref(s).length-1},(t.unref(s).length,{}),{f:"step-"+a,g:"hazard-step-"+a,h:t.unref(i)===a?1:"",i:t.o((e=>t.unref(d)(a)),"step-"+a)}))),d:t.s(y.value),e:t.unref(f),f:t.f(t.unref(s),((e,n,a)=>t.e({a:t.t(e.titlePrefix),b:t.t(e.operator),c:t.t(e.time),d:"submit"===e.type&&e.content.levelName},"submit"===e.type&&e.content.levelName?{e:t.t(e.content.levelName),f:t.n(P(e.content))}:{},{g:"submit"===e.type},"submit"===e.type?t.e({h:t.t(e.content.title),i:t.t(e.content.source),j:e.content.areaColor},e.content.areaColor?{k:e.content.areaColor}:{},{l:t.t(e.content.areaName),m:t.t(e.content.address),n:t.t(e.content.levelName||"-"),o:t.n(P(e.content)),p:t.t(e.content.tagName),q:t.t(e.content.description),r:e.content.attachments&&e.content.attachments.length},e.content.attachments&&e.content.attachments.length?{s:t.f(e.content.attachments,((n,a,o)=>({a:a,b:T(n.filePath),c:t.o((t=>H(e.content.attachments,a)),a),d:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),a)})))}:{},{t:t.t(e.content.legalBasis)}):"assign"===e.type?{w:t.t(e.content.assigneeName),x:t.t(e.content.deadline)}:"rectify"===e.type?t.e({z:t.t(e.content.rectifyStatusName),A:t.t(e.content.rectifyPlan),B:t.t(e.content.rectifyResult),C:t.t(e.content.rectificationMeasures),D:t.t(e.content.controlMeasures),E:t.t(e.content.deadline),F:t.t(e.content.rectifierNames),G:t.t(e.content.managerNames),H:t.t(j(e.content.planCost)),I:t.t(j(e.content.actualCost)),J:e.content.attachments&&e.content.attachments.length},e.content.attachments&&e.content.attachments.length?{K:t.f(e.content.attachments,((n,a,o)=>t.e({a:"image"===n.fileType},"image"===n.fileType?{b:T(n.filePath),c:t.o((t=>H(e.content.attachments,a)),a),d:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),a)}:{e:t.t(n.fileName||"附件")},{f:a})))}:{},{L:e.content.signPath},e.content.signPath?{M:T(e.content.signPath),N:t.o((t=>w(e.content.signPath)),"node-"+n),O:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),"node-"+n)}:{}):"verify"===e.type?t.e({Q:t.t(e.content.resultName),R:t.n("通过"===e.content.resultName?"result-tag--pass":"result-tag--fail"),S:e.content.remark},e.content.remark?{T:t.t(e.content.remark)}:{},{U:e.content.attachments&&e.content.attachments.length},e.content.attachments&&e.content.attachments.length?{V:t.f(e.content.attachments,((n,a,o)=>t.e({a:"image"===n.fileType},"image"===n.fileType?{b:T(n.filePath),c:t.o((t=>H(e.content.attachments,a)),a),d:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),a)}:{e:t.t(n.fileName||"附件")},{f:a})))}:{},{W:e.content.signPath},e.content.signPath?{X:T(e.content.signPath),Y:t.o((t=>w(e.content.signPath)),"node-"+n),Z:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),"node-"+n)}:{}):"writeoff"===e.type?t.e({ab:t.t(e.content.resultName),ac:t.n("通过"===e.content.resultName?"result-tag--pass":"result-tag--fail"),ad:e.content.remark},e.content.remark?{ae:t.t(e.content.remark)}:{},{af:e.content.attachments&&e.content.attachments.length},e.content.attachments&&e.content.attachments.length?{ag:t.f(e.content.attachments,((n,a,o)=>t.e({a:"image"===n.fileType},"image"===n.fileType?{b:T(n.filePath),c:t.o((t=>H(e.content.attachments,a)),a),d:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),a)}:{e:t.t(n.fileName||"附件")},{f:a})))}:{},{ah:e.content.signPath},e.content.signPath?{ai:T(e.content.signPath),aj:t.o((t=>w(e.content.signPath)),"node-"+n),ak:t.o(((...e)=>t.unref(p)&&t.unref(p)(...e)),"node-"+n)}:{}):{},{v:"assign"===e.type,y:"rectify"===e.type,P:"verify"===e.type,aa:"writeoff"===e.type,al:"node-"+n,am:"hazard-node-"+n,an:n===t.unref(s).length-1?1:""}))),g:t.s(y.value),h:t.unref(u),i:t.unref(m),j:t.o(((...e)=>t.unref(h)&&t.unref(h)(...e))),k:t.o(((...e)=>t.unref(g)&&t.unref(g)(...e))),l:t.s(N.value)},{b:0===t.unref(s).length,m:t.gei(e,"")})}},c=t._export_sfc(o,[["__scopeId","data-v-1547c16c"]]);wx.createComponent(c);