index-BP7v9n-Z.js 5.5 KB

1
  1. import{ae as W,af as X,ag as v,a$ as P,d as _,aQ as $,bo as Y,bs as Z,ah as T,ai as t,aj as A,ak as ee,b as le,al as U,am as ae,an as e,ao as o,az as y,at as n,ap as V,aF as g,aD as te,as as x,b7 as se,b9 as ue,bn as oe,aA as ne,aB as ie,bR as re,av as F,ax as de,ay as Q,aC as me,aG as fe,w as z,aV as S,ba as ve,O as ce,c0 as pe,aw as ye}from"./index-D68iA7pN.js";import{M as Ve}from"./index-AOcxwHT9.js";const Ce={class:"px-2 mt-5"},ke=W({__name:"index",setup(be){const{isShow:w,showDialog:O}=X(!1,"Mx_QuickSelect");let c={};const D=v([]),b=v("所有图元");P(w,s=>{s&&ve(()=>{c={};const a=new ce;a.allSelect(),a.forEach(l=>{const u=l.getObjectName();c[u]?c[u].push(l):c[u]=[l]}),D.value=[{title:"所有图元",value:"all"},...Object.keys(c).map(l=>({title:pe[l]||l,value:l}))],b.value=D.value[0].value})});const j=[{title:"Color",value:1},{title:"Layer",value:2},{title:"LineType",value:3}],r=v(j[0].value),G=[{title:"= "+_("等于"),value:"="},{title:"!= "+_("不等于"),value:"!="},{title:"> "+_("大于"),value:">"},{title:_("全部选择"),value:"all"}],d=v(G[0].value),B=v(!0),{list:L}=$(Y()),C=v(L.value[0]?.name),{lineTypeList:h}=$(Z()),k=v(h.value[0]?.name),E=v(!0);P(r,()=>{C.value||(C.value=L.value[0].name),k.value||(k.value=h.value[0].name)});const M=v(),H=[{name:"确定",fun:()=>{O(!1);const s=le.getCurrentMxCAD(),a=l=>{let u;if(r.value===1&&(u="trueColor"),r.value===2&&(u="layer"),r.value===3&&(u="linetype"),!u)return;const q=p=>{if(p instanceof z&&u==="trueColor"){const i=new z,m=M.value?.color?.method;if(m!==S.kByColor&&(m===S.kByLayer&&p.method===m||m===S.kByBlock&&p.method===m||m===S.kByACI&&p.colorIndex===M.value?.color?.index))return!0;const{r:f,g:J,b:K}=new THREE.Color(M.value?.color?.color);i.setRGB(f*255,J*255,K*255);const N=Number(i.getColorValue()),R=Number(p.getColorValue());return d.value==="="?N===R:d.value==="!="?N!==R:d.value===">"?N<R:!1}return!1};E.value||s.mxdraw.clearMxCurrentSelect();const I=[];c[l]?.forEach(p=>{let i=!1;const m=p.getMcDbEntity();if(m){if(d.value==="all")i=!0;else{const f=m[u];q(f)&&(i=!0),d.value==="="?(u==="layer"&&f===C.value||u==="linetype"&&f===k.value)&&(i=!0):d.value==="!="?(u==="layer"&&f!==C.value||u==="linetype"&&f!==k.value)&&(i=!0):d.value===">"&&(u==="layer"&&f>C.value||u==="linetype"&&f>k.value)&&(i=!0),B.value||(i=!i)}i&&I.push(p)}}),s.addCurrentSelect(I,I.length<30)};b.value==="all"?Object.keys(c).forEach(l=>{a(l)}):B.value?a(b.value):Object.keys(c).filter(l=>l!==b.value).forEach(l=>{a(l)}),s.updateDisplay()},primary:!0},{name:"关闭",fun:()=>O(!1)}];return(s,a)=>(U(),T(Ve,{title:s.t("322"),"max-width":"320",modelValue:A(w),"onUpdate:modelValue":a[6]||(a[6]=l=>ee(w)?w.value=l:null),footerBtnList:H},{default:t(()=>[ae("div",Ce,[e(x,null,{default:t(()=>[e(o,{cols:"4",class:"text-right"},{default:t(()=>[e(y,{"key-name":"V"},{default:t(()=>[n(V(s.t("681")),1)]),_:1}),a[7]||(a[7]=n(": "))]),_:1}),e(o,{cols:"6"},{default:t(()=>[e(g,{class:"mx-1",items:[s.t("682")],"model-value":s.t("682")},null,8,["items","model-value"])]),_:1}),e(o,{cols:"2"},{default:t(()=>[e(te,{disabled:""})]),_:1})]),_:1}),e(x,null,{default:t(()=>[e(o,{cols:"4",class:"text-right"},{default:t(()=>[e(y,{"key-name":"B"},{default:t(()=>[n(V(s.t("683")),1)]),_:1}),a[8]||(a[8]=n(": "))]),_:1}),e(o,{cols:"6"},{default:t(()=>[e(g,{class:"mx-1",items:D.value,modelValue:b.value,"onUpdate:modelValue":a[0]||(a[0]=l=>b.value=l)},null,8,["items","modelValue"])]),_:1}),e(o,{cols:"2"})]),_:1}),e(x,null,{default:t(()=>[e(o,{cols:"4",class:"text-right","align-self":"start"},{default:t(()=>[e(y,{"key-name":"P"},{default:t(()=>[n(V(s.t("684")),1)]),_:1}),a[9]||(a[9]=n(": "))]),_:1}),e(o,{cols:"6"},{default:t(()=>[e(se,{items:j,border:"",height:"160",density:"compact",variant:"text"},{item:t(({props:l})=>[e(ue,oe(l,{onClick:u=>r.value=l.value,class:r.value===l.value?"bg-light-blue-darken-2":""}),null,16,["onClick","class"])]),_:1})]),_:1}),e(o,{cols:"2"})]),_:1}),e(x,null,{default:t(()=>[e(o,{cols:"4",class:"text-right"},{default:t(()=>[e(y,{"key-name":"O"},{default:t(()=>[n(V(s.t("685")),1)]),_:1}),a[10]||(a[10]=n(": "))]),_:1}),e(o,{cols:"6"},{default:t(()=>[e(g,{class:"mx-1",items:G,modelValue:d.value,"onUpdate:modelValue":a[1]||(a[1]=l=>d.value=l)},null,8,["modelValue"])]),_:1}),e(o,{cols:"2"})]),_:1}),e(x,null,{default:t(()=>[e(o,{cols:"4",class:"text-right"},{default:t(()=>[e(y,{"key-name":"V"},{default:t(()=>[n(V(s.t("686")),1)]),_:1}),a[11]||(a[11]=n(": "))]),_:1}),e(o,{cols:"6"},{default:t(()=>[ne(e(re,{ref_key:"selectColor",ref:M},null,512),[[ie,r.value===1]]),r.value===2?(U(),T(g,{key:0,modelValue:C.value,"onUpdate:modelValue":a[2]||(a[2]=l=>C.value=l),items:A(L),"item-title":"name","item-value":"name"},null,8,["modelValue","items"])):F("",!0),r.value===3?(U(),T(g,{key:1,modelValue:k.value,"onUpdate:modelValue":a[3]||(a[3]=l=>k.value=l),items:A(h),"item-title":"name","item-value":"name"},null,8,["modelValue","items"])):F("",!0)]),_:1}),e(o,{cols:"2"})]),_:1}),e(me,{title:s.t("681")},{default:t(()=>[e(de,{class:"",inline:!1,modelValue:B.value,"onUpdate:modelValue":a[4]||(a[4]=l=>B.value=l)},{default:t(()=>[e(Q,{value:!0},{label:t(()=>[e(y,{"key-name":"I"},{default:t(()=>[n(V(s.t("687")),1)]),_:1})]),_:1}),e(Q,{value:!1,class:"mt-1"},{label:t(()=>[e(y,{"key-name":"E"},{default:t(()=>[n(V(s.t("688")),1)]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["title"]),e(fe,{class:"mt-2",modelValue:E.value,"onUpdate:modelValue":a[5]||(a[5]=l=>E.value=l)},{label:t(()=>[e(y,{"key-name":"A"},{default:t(()=>[n(V(s.t("689")),1)]),_:1})]),_:1},8,["modelValue"])])]),_:1},8,["title","modelValue"]))}}),Be=ye(ke,[["__scopeId","data-v-9004301d"]]);export{Be as default};