import{d as v,o as f,A as n,J as t,P as p,O as c,r as y,c as i,g as l}from"./index-DOFLUERq.js";import{_ as h}from"./_plugin-vue_export-helper-DlAUqK2U.js";const I={key:0,class:"form-field"},b={class:"field-content"},x={class:"image-container"},k={class:"image-body",style:{"margin-bottom":"10px"}},B=["src"],E={key:1,class:"image-error"},L={class:"error-url"},O=v({__name:"Image",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{}},setup(u){const r=u,s=y(!1),a=i(()=>{const e=r.record;return e&&r.df.options&&e[r.df.options]?e[r.df.options]:""}),d=i(()=>{const e=a.value;return!!(e&&e.trim())}),m=i(()=>d.value||s.value);f(()=>{});function _(e){const o=e.target;s.value=!0,console.error("[Image] Failed to load image:",o.src)}function g(){s.value=!1}return(e,o)=>m.value?(l(),n("div",I,[t("div",b,[t("div",x,[t("div",k,[d.value&&!s.value?(l(),n("img",{key:0,src:a.value,class:"img-responsive",alt:"Image",onError:_,onLoad:g},null,40,B)):s.value?(l(),n("div",E,[o[0]||(o[0]=t("svg",{class:"icon icon-md","aria-hidden":"true"},[t("use",{href:"#icon-restriction"})],-1)),o[1]||(o[1]=t("div",{class:"error-text"},"图片加载失败",-1)),t("div",L,p(a.value),1)])):c("",!0)]),o[2]||(o[2]=t("div",{class:"clearfix"},null,-1))])])])):c("",!0)}}),S=h(O,[["__scopeId","data-v-921bd1a3"]]),M=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}));export{M as _};
