import{_ as O,ah as j,r as m,Z as M,e as D,w as F,o as x,c as P,v as e,p as l,C as c,N as v,q as n,n as r,d9 as E,x as k,y as z,t as T,da as Z,db as A,ay as N,aE as G,ak as H,bn as J,j as K,a0 as L,a1 as Q,P as X}from"./index.8d733f79.js";import{E as Y}from"./el-image.a7c44d35.js";import"./el-image-viewer.42b4b63f.js";import"./throttle.04d7163a.js";const p=s=>(L("data-v-4c262202"),s=s(),Q(),s),ee={class:"header"},te={class:"content-body"},se={class:"form-row"},ae=p(()=>e("span",{class:"label"},"\u56FE\u4F8B\u540D\u79F0:",-1)),le={class:"field-content"},oe={class:"form-row"},ie=p(()=>e("span",{class:"label"},"\u622A\u56FE\u8BF4\u660E:",-1)),ne={class:"field-content"},de=p(()=>e("div",{class:"image-slot"},[X(" \u52A0\u8F7D\u4E2D"),e("span",{class:"dot"},"...")],-1)),ce={class:"image-slot error"},re={class:"zoom-mask"},ue={class:"footer-info"},me={class:"info-row"},ve=p(()=>e("span",{class:"label"},"\u622A\u56FE\u4EBA:",-1)),pe=["title"],fe={class:"info-row"},_e=p(()=>e("span",{class:"label"},"\u622A\u56FE\u65F6\u95F4:",-1)),ge=["title"],he={__name:"screenshotItem",props:{item:{type:Object,required:!0},selected:{type:Boolean,default:!1}},emits:["toggle","update"],setup(s,{expose:S,emit:b}){const i=s,f=j({dataRange:!1,remarks:!1}),_=m(null),g=m(null),U="./",I=M(()=>i.item.images?`${U}/equipment-web/file/downloadImage?fileId=${i.item.images}`:""),a=m(null),d=m(""),R=m(null),W=o=>{b("toggle",i.item.id,o)},y=o=>{a.value!==o&&(a.value&&w(),a.value=o,d.value=i.item[o],N(()=>{var t;(t=R.value)==null||t.focus()}))},w=()=>{if(!a.value)return;const o=a.value,t=d.value;t!==i.item[o]&&b("update",{...i.item,[o]:t}),a.value=null,d.value=""},C=()=>{N(()=>{_.value&&(f.dataRange=_.value.scrollWidth>_.value.clientWidth),g.value&&(f.remarks=g.value.scrollWidth>g.value.clientWidth)})};return D(()=>{C()}),F(()=>[i.item.dataRange,i.item.remarks],()=>{C()},{immediate:!0}),S({startEdit:y}),(o,t)=>{const $=G,h=H,V=J,B=K,q=Y;return x(),P("div",{class:v(["screenshot-item",{"is-selected":s.selected}])},[e("div",ee,[l($,{"model-value":s.selected,onChange:W,onClick:t[0]||(t[0]=c(()=>{},["stop"]))},null,8,["model-value"])]),e("div",te,[e("div",se,[ae,e("div",{class:v(["editable-field",{"is-editing":a.value==="dataRange"}])},[e("div",le,[l(h,{class:v(["edit-icon",{active:a.value==="dataRange"}]),onClick:t[1]||(t[1]=c(u=>y("dataRange"),["stop"]))},{default:n(()=>[l(r(E))]),_:1},8,["class"]),l(V,{content:s.item.dataRange||"-",disabled:!f.dataRange||a.value==="dataRange",placement:"top","popper-class":"screenshot-item-tooltip"},{default:n(()=>[e("div",{class:"display-text",ref_key:"dataRangeRef",ref:_},k(s.item.dataRange||"-"),513)]),_:1},8,["content","disabled"])]),a.value==="dataRange"?(x(),z(B,{key:0,ref_key:"inputRef",ref:R,modelValue:d.value,"onUpdate:modelValue":t[2]||(t[2]=u=>d.value=u),size:"small",type:"textarea",autosize:{minRows:1,maxRows:6},maxlength:"300",onBlur:w,onClick:t[3]||(t[3]=c(()=>{},["stop"])),placeholder:"\u8BF7\u8F93\u5165\u56FE\u4F8B\u540D\u79F0",class:"edit-input"},null,8,["modelValue"])):T("",!0)],2)]),e("div",oe,[ie,e("div",{class:v(["editable-field",{"is-editing":a.value==="remarks"}])},[e("div",ne,[l(h,{class:v(["edit-icon",{active:a.value==="remarks"}]),onClick:t[4]||(t[4]=c(u=>y("remarks"),["stop"]))},{default:n(()=>[l(r(E))]),_:1},8,["class"]),l(V,{content:s.item.remarks||"-",disabled:!f.remarks||a.value==="remarks",placement:"top","popper-class":"screenshot-item-tooltip"},{default:n(()=>[e("div",{class:"display-text",ref_key:"remarksRef",ref:g},k(s.item.remarks||"-"),513)]),_:1},8,["content","disabled"])]),a.value==="remarks"?(x(),z(B,{key:0,ref_key:"inputRef",ref:R,modelValue:d.value,"onUpdate:modelValue":t[5]||(t[5]=u=>d.value=u),size:"small",type:"textarea",autosize:{minRows:1,maxRows:6},maxlength:"300",onBlur:w,onClick:t[6]||(t[6]=c(()=>{},["stop"])),placeholder:"\u8BF7\u8F93\u5165\u622A\u56FE\u8BF4\u660E",class:"edit-input"},null,8,["modelValue"])):T("",!0)],2)]),e("div",{class:"image-wrapper",onClick:t[7]||(t[7]=c(()=>{},["stop"]))},[l(q,{class:"image",src:r(I),"preview-src-list":[r(I)],fit:"contain","preview-teleported":!0,loading:"lazy"},{placeholder:n(()=>[de]),error:n(()=>[e("div",ce,[l(h,null,{default:n(()=>[l(r(Z))]),_:1})])]),_:1},8,["src","preview-src-list"]),e("div",re,[l(h,null,{default:n(()=>[l(r(A))]),_:1})])]),e("div",ue,[e("div",me,[ve,e("span",{class:"value",title:s.item.updateBy},k(s.item.updateBy),9,pe)]),e("div",fe,[_e,e("span",{class:"value",title:s.item.screenshotTime},k(s.item.screenshotTime),9,ge)])])])],2)}}},xe=O(he,[["__scopeId","data-v-4c262202"]]);export{xe as default};
