index.0481f111.js 5.8 KB

1
  1. import{d as ue,u as te,r as c,A as q,b4 as z,cs as se,cr as oe,o as L,c as I,w as a,a as ne,b as e,V as s,$ as v,n as o,ag as x,ae as re,h as k,b_ as ie,b$ as de,D as ce,ab as me,ac as fe,cO as ve,e as N,k as K,a9 as _e,aa as W,ad as pe,ah as ye,l as Ve,al as Ce,c9 as Ee,cJ as X,b8 as h,bJ as xe,c_ as ke,_ as be}from"./index.6c36cb53.js";import{M as Be}from"./index.a696a3d7.js";const ge={class:"px-2 mt-5"},he=ue({__name:"index",setup(we){var O,$;const{isShow:b,showDialog:R}=te(!1,"Mx_QuickSelect");let m={};const w=c([]),y=c("\u6240\u6709\u56FE\u5143");q(b,V=>{!V||Ee(()=>{m={};const u=new xe;u.allSelect(),u.forEach(l=>{const t=l.getObjectName();m[t]?m[t].push(l):m[t]=[l]}),w.value=[{title:"\u6240\u6709\u56FE\u5143",value:"all"},...Object.keys(m).map(l=>({title:ke[l]||l,value:l}))],y.value=w.value[0].value})});const T=[{title:"Color",value:1},{title:"Layer",value:2},{title:"LineType",value:3}],i=c(T[0].value),U=[{title:"= \u7B49\u4E8E",value:"="},{title:"!= \u4E0D\u7B49\u4E8E",value:"!="},{title:"> \u5927\u4E8E",value:">"},{title:"\u5168\u90E8\u9009\u62E9",value:"all"}],d=c(U[0].value),B=c(!0),{list:D}=z(se()),_=c((O=D.value[0])==null?void 0:O.name),{lineTypeList:M}=z(oe()),p=c(($=M.value[0])==null?void 0:$.name),F=c(!0);q(i,()=>{_.value||(_.value=D.value[0].name),p.value||(p.value=M.value[0].name)});const g=c(),Y=[{name:"\u786E\u5B9A",fun:()=>{R(!1);const V=Ce.getCurrentMxCAD(),u=l=>{var G;let t;if(i.value===1&&(t="trueColor"),i.value===2&&(t="layer"),i.value===3&&(t="linetype"),!t)return;const Z=f=>{var n,E,r,P,J,H;if(f instanceof X&&t==="trueColor"){const Q=new X,C=(E=(n=g.value)==null?void 0:n.color)==null?void 0:E.method;if(C!==h.kByColor&&(C===h.kByLayer&&f.method===C||C===h.kByBlock&&f.method===C||C===h.kByACI&&f.colorIndex===((P=(r=g.value)==null?void 0:r.color)==null?void 0:P.index)))return!0;const{r:ee,g:le,b:ae}=new THREE.Color((H=(J=g.value)==null?void 0:J.color)==null?void 0:H.color);Q.setRGB(ee*255,le*255,ae*255);const A=Number(Q.getColorValue()),S=Number(f.getColorValue());return d.value==="="?A===S:d.value==="!="?A!==S:d.value===">"?A<S:!1}return!1};F.value||V.mxdraw.clearMxCurrentSelect();const j=[];(G=m[l])==null||G.forEach(f=>{let n=!1;const E=f.getMcDbEntity();if(!!E){if(d.value==="all")n=!0;else{const r=E[t];Z(r)&&(n=!0),d.value==="="?(t==="layer"&&r===_.value||t==="linetype"&&r===p.value)&&(n=!0):d.value==="!="?(t==="layer"&&r!==_.value||t==="linetype"&&r!==p.value)&&(n=!0):d.value===">"&&(t==="layer"&&r>_.value||t==="linetype"&&r>p.value)&&(n=!0),B.value||(n=!n)}n&&j.push(f)}}),V.addCurrentSelect(j)};y.value==="all"?Object.keys(m).forEach(l=>{u(l)}):B.value?u(y.value):Object.keys(m).filter(l=>l!==y.value).forEach(l=>{u(l)}),V.updateDisplay()},primary:!0},{name:"\u5173\u95ED",fun:()=>R(!1)}];return(V,u)=>(L(),I(Be,{title:"\u5FEB\u901F\u9009\u62E9","max-width":"320",modelValue:N(b),"onUpdate:modelValue":u[6]||(u[6]=l=>Ve(b)?b.value=l:null),footerBtnList:Y},{default:a(()=>[ne("div",ge,[e(k,null,{default:a(()=>[e(s,{cols:"4",class:"text-right"},{default:a(()=>[e(v,{"key-name":"V"},{default:a(()=>[o("\u5E94\u7528\u5230")]),_:1}),o(": ")]),_:1}),e(s,{cols:"6"},{default:a(()=>[e(x,{class:"mx-1",items:["\u6574\u4E2A\u56FE\u5F62"],"model-value":"\u6574\u4E2A\u56FE\u5F62"})]),_:1}),e(s,{cols:"2"},{default:a(()=>[e(re,{disabled:""})]),_:1})]),_:1}),e(k,null,{default:a(()=>[e(s,{cols:"4",class:"text-right"},{default:a(()=>[e(v,{"key-name":"B"},{default:a(()=>[o("\u5BF9\u8C61\u7C7B\u578B")]),_:1}),o(": ")]),_:1}),e(s,{cols:"6"},{default:a(()=>[e(x,{class:"mx-1",items:w.value,modelValue:y.value,"onUpdate:modelValue":u[0]||(u[0]=l=>y.value=l)},null,8,["items","modelValue"])]),_:1}),e(s,{cols:"2"})]),_:1}),e(k,null,{default:a(()=>[e(s,{cols:"4",class:"text-right","align-self":"start"},{default:a(()=>[e(v,{"key-name":"P"},{default:a(()=>[o("\u7279\u6027")]),_:1}),o(": ")]),_:1}),e(s,{cols:"6"},{default:a(()=>[e(ie,{items:T,border:"",height:"160",density:"compact",variant:"text"},{item:a(({props:l})=>[e(de,ce(l,{onClick:t=>i.value=l.value,class:i.value===l.value?"bg-light-blue-darken-2":""}),null,16,["onClick","class"])]),_:1})]),_:1}),e(s,{cols:"2"})]),_:1}),e(k,null,{default:a(()=>[e(s,{cols:"4",class:"text-right"},{default:a(()=>[e(v,{"key-name":"O"},{default:a(()=>[o("\u8FD0\u7B97\u7B26")]),_:1}),o(": ")]),_:1}),e(s,{cols:"6"},{default:a(()=>[e(x,{class:"mx-1",items:U,modelValue:d.value,"onUpdate:modelValue":u[1]||(u[1]=l=>d.value=l)},null,8,["modelValue"])]),_:1}),e(s,{cols:"2"})]),_:1}),e(k,null,{default:a(()=>[e(s,{cols:"4",class:"text-right"},{default:a(()=>[e(v,{"key-name":"V"},{default:a(()=>[o("\u503C")]),_:1}),o(": ")]),_:1}),e(s,{cols:"6"},{default:a(()=>[me(e(ve,{ref_key:"selectColor",ref:g},null,512),[[fe,i.value===1]]),i.value===2?(L(),I(x,{key:0,modelValue:_.value,"onUpdate:modelValue":u[2]||(u[2]=l=>_.value=l),items:N(D),"item-title":"name","item-value":"name"},null,8,["modelValue","items"])):K("",!0),i.value===3?(L(),I(x,{key:1,modelValue:p.value,"onUpdate:modelValue":u[3]||(u[3]=l=>p.value=l),items:N(M),"item-title":"name","item-value":"name"},null,8,["modelValue","items"])):K("",!0)]),_:1}),e(s,{cols:"2"})]),_:1}),e(pe,{title:"\u5E94\u7528\u5230"},{default:a(()=>[e(_e,{class:"",inline:!1,modelValue:B.value,"onUpdate:modelValue":u[4]||(u[4]=l=>B.value=l)},{default:a(()=>[e(W,{value:!0},{label:a(()=>[e(v,{"key-name":"I"},{default:a(()=>[o("\u5305\u62EC\u5728\u65B0\u9009\u62E9\u96C6\u4E2D")]),_:1})]),_:1}),e(W,{value:!1,class:"mt-1"},{label:a(()=>[e(v,{"key-name":"E"},{default:a(()=>[o("\u6392\u9664\u5728\u65B0\u9009\u62E9\u96C6\u4E4B\u5916")]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(ye,{class:"mt-2",modelValue:F.value,"onUpdate:modelValue":u[5]||(u[5]=l=>F.value=l)},{label:a(()=>[e(v,{"key-name":"A"},{default:a(()=>[o("\u9644\u52A0\u5230\u5F53\u524D\u9009\u62E9\u96C6")]),_:1})]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"]))}});const Ae=be(he,[["__scopeId","data-v-551bdd7e"]]);export{Ae as default};