2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
"use strict";const e=require("../../common/vendor.js"),a=require("../../request/api.js"),t=require("../../request/request.js");if(!Array){(e.resolveComponent("up-input")+e.resolveComponent("up-textarea"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-input/u-input.js")+(()=>"../../uni_modules/uview-plus/components/u-textarea/u-textarea.js"))();const r={__name:"view",setup(r){const o=e.reactive({hazardId:"",assignId:"",title:"",level:0,levelName:"",source:"",description:"",address:"",areaName:"",areaColor:"",tagName:"",legalBasis:"",regulationName:"",attachments:[]}),s=e.computed((()=>o.legalBasis||o.regulationName||"")),l=e=>t.toImageUrl(e);return e.onLoad((t=>{t.hazardId&&(async(t,r)=>{try{const s={hazardId:t};r&&(s.assignId=r);const l=await a.getHiddenDangerDetail(s);0===l.code&&l.data?Object.assign(o,l.data):e.index.showToast({title:l.msg||"获取详情失败",icon:"none"})}catch(s){console.error("获取隐患详情失败:",s),e.index.showToast({title:"请求失败",icon:"none"})}})(t.hazardId,t.assignId)})),(a,t)=>e.e({a:e.t(o.source||"暂无"),b:o.attachments&&o.attachments.length>0},o.attachments&&o.attachments.length>0?{c:e.f(o.attachments,((a,t,r)=>({a:t,b:l(a.filePath),c:e.o((a=>{return r=t,void(o.attachments&&0!==o.attachments.length&&e.index.previewImage({current:r,urls:o.attachments.map((e=>l(e.filePath)))}));var r}),t)})))}:{},{d:e.o((e=>o.title=e)),e:e.p({disabled:!0,disabledColor:"#F6F6F6",border:"surround",placeholder:"暂无",modelValue:o.title}),f:e.n(2===o.level?"bg-blue light":"bg-gray"),g:e.n(3===o.level?"bg-blue light":"bg-gray"),h:e.o((e=>o.address=e)),i:e.p({disabled:!0,disabledColor:"#F6F6F6",border:"surround",placeholder:"暂无地址",modelValue:o.address}),j:e.t(s.value||"暂无"),k:s.value?"":1,l:o.areaColor},o.areaColor?{m:o.areaColor}:{},{n:e.t(o.areaName||"暂无"),o:o.areaName?"":1,p:e.o((e=>o.description=e)),q:e.p({placeholder:"暂无描述",disabled:!0,autoHeight:!0,modelValue:o.description}),r:e.t(o.tagName||"暂无"),s:e.gei(a,"")})}},o=e._export_sfc(r,[["__scopeId","data-v-52ff0d96"]]);wx.createPage(o);
|