Files
threeonecheck_web/unpackage/dist/build/mp-weixin/pages/hiddendanger/process-chain.js

2 lines
1.9 KiB
JavaScript

"use strict";const e=require("../../common/vendor.js"),t=require("../../common/assets.js"),a=require("../../request/api.js"),o=require("../../components/hazardDetail/processChain.js");if(!Array){e.resolveComponent("u-navbar")()}Math||((()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js")+n)();const n=()=>"../../components/hazardDetail/HazardProcessChainPanel.js",s={__name:"process-chain",setup(n){const s=e.getCurrentInstance(),r=(null==s?void 0:s.proxy)||s,i=e.ref({}),c=e.ref(!1),l=e.ref(0),u=e.computed((()=>o.resolveProcessChainSummary(i.value))),d=()=>{e.nextTick$1((()=>{const t=e.index.createSelectorQuery().in(r);t.select(".panel-wrap").boundingClientRect(),t.exec((t=>{const a=null==t?void 0:t[0];if((null==a?void 0:a.height)>0)return void(l.value=Math.floor(a.height));const o=e.index.getSystemInfoSync();l.value=Math.floor(.55*o.windowHeight)}))}))};return e.onReady((()=>{d(),setTimeout(d,100),setTimeout(d,400)})),e.watch(c,(e=>{e||(d(),setTimeout(d,100),setTimeout(d,400))})),e.onLoad((t=>{t.hazardId?(async t=>{c.value=!0;try{const o=await a.getHazardProcessChain(t);0===o.code&&o.data?i.value=o.data:(i.value={},e.index.showToast({title:o.msg||"获取流程链失败",icon:"none"}))}catch(o){console.error("获取隐患流程链失败:",o),i.value={},e.index.showToast({title:"获取流程链失败",icon:"none"})}finally{c.value=!1,d(),setTimeout(d,100),setTimeout(d,400)}})(t.hazardId):(e.index.showToast({title:"缺少隐患ID",icon:"none"}),setTimeout((()=>{e.index.navigateBack()}),1500))})),(a,o)=>({a:e.p({title:"查看隐患",placeholder:!0,safeAreaInsetTop:!0,bgColor:"transparent",titleColor:"#ffffff",leftIconColor:"#ffffff",autoBack:!0,border:!1}),b:t._imports_0$2,c:e.t(u.value.statusName),d:t._imports_1,e:e.t(u.value.createdAt),f:e.p({"chain-data":i.value,loading:c.value,"body-height":l.value}),g:e.gei(a,"")})}},r=e._export_sfc(s,[["__scopeId","data-v-892a6ee3"]]);wx.createPage(r);