var A=Object.defineProperty,B=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var P=(e,a,o)=>a in e?A(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o,b=(e,a)=>{for(var o in a||(a={}))j.call(a,o)&&P(e,o,a[o]);if(E)for(var o of E(a))N.call(a,o)&&P(e,o,a[o]);return e},I=(e,a)=>B(e,O(a));import{d as S,e as w,u as L,U as i,a2 as n,a3 as l,F as M,ae as U,ad as f,af as d,k as p,ag as k,ay as V,V as c,G as _,a5 as $}from"./vue-vendor-CxLCUzY4.js";import{b as D,u as H,c5 as R,_ as G}from"./index-CLZzJyTP.js";import"./index-Bz3DhbXN.js";import{e as K,u as q,c as z}from"./useFileCell-DKGDmzx9.js";import{c as Q}from"./index-Bn2zmO2L.js";import{U as W}from"./JUpload-DgDEmizw.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";const X=S({name:"JVxeImageCell",components:z,props:R(),setup(e){const{createErrorModal:a}=H(),o=q(e,W.image,{multiple:!0}),F="image/*",y=w(()=>L(o.cellProps).disabled?null:"click"),{innerFile:s,maxCount:g}=o,u=w(()=>{if(s.value){if(s.value.url)return[s.value.url];if(s.value.path)return s.value.path.split(",").map(v=>D(v))}return[]});function m(){let r=s.value||null;r&&r.message&&a({title:"上传出错",content:"错误信息："+r.message,maskClosable:!0})}const h=()=>{L(o.cellProps).disabled&&Q({imageList:u.value})};return I(b({},o),{imgList:u,maxCount:g,handleClickShowImageError:m,clickEvent:y,handlePreview:h,acceptFileType:F})},enhanced:K}),Y=["src"],Z={key:1,class:"j-vxe-image-upload"};function x(e,a,o,F,y,s){const g=i("LoadingOutlined"),u=i("a-tooltip"),m=i("Icon"),h=i("a-button"),r=i("a-upload"),v=i("JUploadModal");return n(),l("div",null,[e.hasFile?(n(!0),l(M,{key:0},U([e.innerFile||{}],(t,J)=>(n(),l("div",{key:J,class:"j-vxe-image-list"},[!t||!(t.url||t.path||t.message)?(n(),f(u,{key:0,title:"请稍后: "+JSON.stringify(t)+(t.url||t.path||t.message)},{default:d(()=>[p(g)]),_:2},1032,["title"])):t.path?(n(!0),l(M,{key:1},U(e.imgList,T=>(n(),l("img",k({class:"j-vxe-image",src:T,alt:"图片错误"},{[V(e.clickEvent)]:a[0]||(a[0]=(...C)=>e.handleMoreOperation&&e.handleMoreOperation(...C))},{onClick:a[1]||(a[1]=(...C)=>e.handlePreview&&e.handlePreview(...C))}),null,16,Y))),256)):(n(),f(u,k({key:2,title:t.message||"上传失败"},{[V(e.clickEvent)]:e.handleClickShowImageError}),{default:d(()=>[p(m,{icon:"ant-design:exclamation-circle",style:{color:"red"}})]),_:2},1040,["title"]))]))),128)):c("",!0),e.cellProps.disabledTable?c("",!0):(n(),l("div",Z,[p(r,k({accept:e.acceptFileType,name:"file",data:{isup:1},multiple:!1,action:e.uploadAction,headers:e.uploadHeaders,showUploadList:!1},e.cellProps,{onChange:e.handleChangeUpload}),{default:d(()=>[e.hasFile?c("",!0):(n(),f(h,{key:0,preIcon:"ant-design:upload"},{default:d(()=>[_($(e.originColumn.btnText||"上传图片"),1)]),_:1})),e.hasFile&&e.imgList.length<e.maxCount?(n(),l("div",{key:1,class:"j-vxe-plus",onClick:a[2]||(a[2]=()=>{})},[p(m,{icon:"ant-design:plus"})])):c("",!0)]),_:1},16,["accept","action","headers","onChange"])])),p(v,{value:e.modalValue,onRegister:e.registerModel,onChange:e.onModalChange},null,8,["value","onRegister","onChange"])])}const ke=G(X,[["render",x],["__scopeId","data-v-27ffa3d4"]]);export{ke as default};
