import{d as v,r as p,c as n,o as f,e as i,f as t,g as y,k as c,n as l}from"./index-a0da86f0.js";import{_ as I}from"./_plugin-vue_export-helper-c27b6911.js";const b={key:0,class:"form-field"},h={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"},S=v({__name:"Image",props:{df:{},record:{},canEdit:{type:Boolean},ctx:{}},setup(u){const r=u,s=p(!1),a=n(()=>{const e=r.record;return e&&r.df.options&&e[r.df.options]?e[r.df.options]:""}),d=n(()=>{const e=a.value;return!!(e&&e.trim())}),_=n(()=>d.value||s.value);f(()=>{});function m(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)=>_.value?(l(),i("div",b,[t("div",h,[t("div",x,[t("div",k,[d.value&&!s.value?(l(),i("img",{key:0,src:a.value,class:"img-responsive",alt:"Image",onError:m,onLoad:g},null,40,B)):s.value?(l(),i("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,y(a.value),1)])):c("",!0)]),o[2]||(o[2]=t("div",{class:"clearfix"},null,-1))])])])):c("",!0)}});const j=I(S,[["__scopeId","data-v-921bd1a3"]]),N=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"}));export{N as _};
