index.54120a28.js 7.2 KB

1
  1. import{d as U,f as F,c as I,j as c,a as o,G as B,w as d,A as H,al as $,r as v,o as k,af as W,C as X,D as Y,_ as G,e as D,Y as K,a0 as A,W as O,E as z,h as L,u as r,T as Q,U as Z,b as J,t as R,n as q,ae as M,X as ee,F as j,a2 as b,am as te,a5 as se,ah as le,ai as ne,a7 as oe,an as ae,ao as ue,ap as ie,B as T,g as de,a1 as S,ag as ce,aq as pe,J as re,ar as ge,as as me,at as ve}from"./index.60df5321.js";import{I as _e,a as P}from"./right-fill-pano.vue_vue_type_style_index_0_scoped_4526d25b_lang.478c0592.js";import{R as fe}from"./right-fill-pano.63df92ea.js";const N=p=>(X("data-v-1d4d8f76"),p=p(),Y(),p),ye={class:"edit-hot-layer"},Fe={class:"edit-hot-item"},he={class:"edit-title"},Ee=H(" \u6807\u6CE8 "),ke=N(()=>c("span",null,"\u9057\u7559\u90E8\u4F4D\uFF1A",-1)),Ce=N(()=>c("span",null,"\u63D0\u53D6\u65B9\u6CD5\uFF1A",-1)),we=N(()=>c("span",null,"\u63D0\u53D6\u4EBA\uFF1A",-1)),xe=["onClick"],Ve={class:"edit-hot"},be=H(" \u786E\u5B9A "),Te=U({__name:"edit",props:{data:null},emits:["quit","save"],setup(p,{emit:_}){const h=p,e=F({...h.data,images:[...h.data.images]}),C=()=>{e.value.title.trim()?e.value.images.length?_("save",e.value):$.error("\u81F3\u5C11\u4E0A\u4F20\u4E00\u5F20\u56FE\u7247\uFF01"):$.error("\u6807\u6CE8\u6807\u9898\u5FC5\u987B\u586B\u5199\uFF01")},x=g=>{const s=Array.isArray(g)?g:[g];e.value.images=s.map(l=>typeof l=="string"||"blob"in l?l:(console.log(l),{blob:l.file,url:l.preview}))},f=async g=>{const s=e.value.images.indexOf(g);~s&&await W.confirm("\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6570\u636E\u5417\uFF1F")&&e.value.images.splice(s,1)};return(g,s)=>{const l=v("ui-icon"),n=v("ui-input");return k(),I("div",ye,[c("div",Fe,[c("h3",he,[Ee,o(l,{type:"close",ctrl:"",onClick:s[0]||(s[0]=B(t=>g.$emit("quit"),["stop"])),class:"edit-close"})]),o(n,{require:"",class:"input",width:"100%",placeholder:"\u8BF7\u8F93\u5165\u70ED\u70B9\u6807\u9898",type:"text",modelValue:e.value.title,"onUpdate:modelValue":s[1]||(s[1]=t=>e.value.title=t),maxlength:"15"},null,8,["modelValue"]),o(n,{class:"input",width:"100%",height:"158px",placeholder:"\u7279\u5F81\u63CF\u8FF0\uFF1A",type:"richtext",modelValue:e.value.desc,"onUpdate:modelValue":s[2]||(s[2]=t=>e.value.desc=t),maxlength:200},null,8,["modelValue"]),o(n,{class:"input preplace",width:"100%",placeholder:"",type:"text",modelValue:e.value.part,"onUpdate:modelValue":s[3]||(s[3]=t=>e.value.part=t)},{preIcon:d(()=>[ke]),_:1},8,["modelValue"]),o(n,{class:"input preplace",width:"100%",placeholder:"",type:"text",modelValue:e.value.method,"onUpdate:modelValue":s[4]||(s[4]=t=>e.value.method=t)},{preIcon:d(()=>[Ce]),_:1},8,["modelValue"]),o(n,{class:"input preplace",width:"100%",type:"text",placeholder:"",modelValue:e.value.principal,"onUpdate:modelValue":s[5]||(s[5]=t=>e.value.principal=t)},{preIcon:d(()=>[we]),_:1},8,["modelValue"]),o(n,{class:"input",type:"file",width:"100%",height:"225px",preview:"",placeholder:"\u4E0A\u4F20\u56FE\u7247",othPlaceholder:"\u652F\u6301JPG\u3001PNG\u56FE\u7247\u683C\u5F0F\uFF0C\u5355\u5F20\u4E0D\u8D85\u8FC75MB\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F209\u5F20\u3002",accept:".jpg, .png",disable:!0,multiple:!0,maxSize:5*1024*1024,maxLen:9,modelValue:e.value.images,"onUpdate:modelValue":x},{valuable:d(()=>[o(_e,{tagging:e.value,hideInfo:!0},{icons:d(({active:t})=>[c("span",{onClick:i=>f(t),class:"del-file"},[o(l,{type:"del",ctrl:""})],8,xe)]),_:1},8,["tagging"])]),_:1},8,["modelValue"]),c("div",Ve,[c("span",{onClick:C,class:"fun-ctrl"},[o(l,{type:"edit"}),be])])])])}}});const Pe=G(Te,[["__scopeId","data-v-1d4d8f76"]]),De={class:"info"},Ie=["src"],Se=U({__name:"sign",props:{tagging:null,selected:{type:Boolean}},emits:["delete","edit","select","flyPositions"],setup(p,{emit:_}){const h=p,e=D(()=>K(h.tagging.styleId)),C=D(()=>A(h.tagging)),x=D(()=>C.value.map(s=>O(s.modelId)).every(s=>!s||!z(s).value)),f=[{label:"\u7F16\u8F91",value:"edit"},{label:"\u5220\u9664",value:"delete"}],g={edit:()=>_("edit"),delete:()=>_("delete")};return(s,l)=>{const n=v("ui-icon"),t=v("ui-more"),i=v("ui-group-option");return k(),L(i,{class:q(["sign-tagging",{active:p.selected}]),onClick:l[3]||(l[3]=u=>_("select"))},{default:d(()=>[c("div",De,[r(e)?(k(),I("img",{key:0,src:r(Q)(r(Z)(p.tagging.images.length?p.tagging.images[0]:r(e).icon))},null,8,Ie)):J("",!0),c("div",null,[c("p",null,R(p.tagging.title),1),c("a",null,"\u653E\u7F6E\uFF1A"+R(r(C).length),1)])]),c("div",{class:"actions",onClick:l[2]||(l[2]=B(()=>{},["stop"]))},[o(n,{class:q({disabled:r(x)}),type:"pin",ctrl:"",onClick:l[0]||(l[0]=B(u=>s.$emit("flyPositions"),["stop"]))},null,8,["class"]),o(t,{options:f,style:{"margin-left":"20px"},onClick:l[1]||(l[1]=u=>g[u]())})])]),_:1},8,["class"])}}});const Be=G(Se,[["__scopeId","data-v-c0b9bfe6"]]),$e=H(" \u65B0\u589E "),He=U({__name:"index",setup(p){const _=F(""),h=D(()=>b.value.filter(n=>n.title.includes(_.value))),e=F(null),C=n=>{!e.value||(te(e.value.id)?b.value.push(n):Object.assign(e.value,n),e.value=null)},x=n=>{const t=b.value.indexOf(n),i=A(n);S.value=S.value.filter(u=>!i.includes(u)),b.value.splice(t,1)};let f;const g=n=>{const t=A(n);f&&f();let i=!1;const u=y=>{if(i||y>=t.length)return;const m=t[y],E=O(m.modelId);if(!E||!z(E).value){u(y+1);return}const a=ve.push(F(new WeakSet([m])));P.comeTo({position:m.localPos,modelId:m.modelId,dur:300,distance:3}),console.log("\u6539\u53D8\u4E86",T.showTaggingPositions.has(m)),setTimeout(()=>{a(),u(y+1)},2e3)};u(0),f=()=>i=!0},s=n=>{n.code==="Escape"&&f&&f()};M(()=>(document.documentElement.addEventListener("keyup",s,!1),()=>document.documentElement.removeEventListener("keydown",s,!1)));const l=F(null);return ee(l,(n,t,i)=>{if(l.value){const u=()=>l.value=null,y=se([le.push(F(!0)),ne.push(F(!0)),oe.push(F(!1)),ae.push(F(!1))]),m=async a=>{await ce(),await pe();const w=re.value.map(V=>P.getPositionByScreen({x:a.clientX,y:a.clientY},V.id)).filter(V=>V);if(!w.length)$.error("\u5F53\u524D\u4F4D\u7F6E\u65E0\u6CD5\u6DFB\u52A0");else if(l.value){const V=ge({...w[0],taggingId:l.value.id});S.value.push(V),u()}},E=a=>a.code==="Escape"&&u();document.documentElement.addEventListener("keyup",E,!1),P.layout.addEventListener("click",m,!1),ue(u),i(()=>{document.documentElement.removeEventListener("keyup",E,!1),P.layout.removeEventListener("click",m,!1),y()})}}),M(me),(n,t)=>{const i=v("ui-icon"),u=v("ui-button"),y=v("ui-group"),m=v("ui-input"),E=v("ui-group-option");return k(),I(j,null,[o(r(fe),null,{default:d(()=>[o(y,{borderBottom:""},{header:d(()=>[o(u,{onClick:t[0]||(t[0]=a=>e.value=r(ie)())},{default:d(()=>[o(i,{type:"add"}),$e]),_:1})]),_:1}),o(y,{title:"\u6807\u6CE8"},{icon:d(()=>[o(i,{ctrl:"",type:r(T).showTaggings?"eye-s":"eye-n",onClick:t[1]||(t[1]=a=>r(T).showTaggings=!r(T).showTaggings)},null,8,["type"])]),default:d(()=>[o(E,null,{default:d(()=>[o(m,{type:"text",width:"100%",placeholder:"\u641C\u7D22",modelValue:_.value,"onUpdate:modelValue":t[2]||(t[2]=a=>_.value=a)},{preIcon:d(()=>[o(i,{type:"search"})]),_:1},8,["modelValue"])]),_:1}),(k(!0),I(j,null,de(r(h),a=>(k(),L(Be,{key:a.id,tagging:a,selected:l.value===a,onEdit:w=>e.value=a,onDelete:w=>x(a),onSelect:w=>l.value=a,onFlyPositions:w=>g(a)},null,8,["tagging","selected","onEdit","onDelete","onSelect","onFlyPositions"]))),128))]),_:1})]),_:1}),e.value?(k(),L(Pe,{key:0,data:e.value,onQuit:t[3]||(t[3]=a=>e.value=null),onSave:C},null,8,["data"])):J("",!0)],64)}}});export{He as default};