1 |
- import{ae as b,al as S,aW as M,an as n,ai as a,az as f,at as d,ap as u,aG as h,as as N,ao as g,am as G,aX as R,aY as j,aO as B,aP as L,aC as I,ah as A,aN as $,au as T,ag as D,ba as z,a$ as O,bb as c,bc as P,bd as _,be as V,bf as F,bg as Q,bh as U,aL as E,bi as i,bj as t,b0 as w,n as W,af as X,aj as v,ak as q}from"./index-D68iA7pN.js";import{M as Y}from"./index-AOcxwHT9.js";import{M as x}from"./index-fM-yRA8C.js";const H={class:"d-flex flex-wrap"},J={class:"d-flex my-1 w-50"},K=b({__name:"ObjectSnaps",props:{data:{},options:{},allSelect:{type:Function},allCancel:{type:Function}},setup(l){return(e,s)=>(S(),M("div",null,[n(h,{modelValue:e.options.isOpen,"onUpdate:modelValue":s[0]||(s[0]=o=>e.options.isOpen=o)},{label:a(()=>[n(f,{"key-name":"S"},{default:a(()=>[d(u(e.t("启动对象捕捉")),1)]),_:1})]),_:1},8,["modelValue"]),n(I,{title:e.t("对象捕捉模式"),class:"mt-2"},{default:a(()=>[n(N,null,{default:a(()=>[n(g,{cols:9},{default:a(()=>[G("div",H,[(S(!0),M(R,null,j(e.data,(o,m)=>(S(),M("div",J,[n(h,{class:"",modelValue:o.check,"onUpdate:modelValue":r=>o.check=r},{prepend:a(()=>[n(B,{icon:o.icon,class:"mr-1"},null,8,["icon"])]),label:a(()=>[n(f,{"key-name":o.key},{default:a(()=>[d(u(o.name),1)]),_:2},1032,["key-name"])]),_:2},1032,["modelValue","onUpdate:modelValue"])]))),256))])]),_:1}),n(g,{cols:2,"align-self":"start"},{default:a(()=>[n(L,{onClick:e.allSelect},{default:a(()=>[d(u(e.t("全部选择")),1)]),_:1},8,["onClick"]),n(L,{class:"mt-3",onClick:e.allCancel},{default:a(()=>[d(u(e.t("全部取消")),1)]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["title"])]))}}),Z=b({__name:"PolarTracking",props:{options:{}},setup(l){return(e,s)=>(S(),A(N,null,{default:a(()=>[n(g,{cols:5},{default:a(()=>[n(h,{modelValue:e.options.isOpen,"onUpdate:modelValue":s[0]||(s[0]=o=>e.options.isOpen=o)},{label:a(()=>[n(f,{"key-name":"P"},{default:a(()=>[d(u(e.t("589")),1)]),_:1})]),_:1},8,["modelValue"]),n(I,{title:e.t("581"),class:"mt-2",style:{height:"200px"}},{default:a(()=>[n(f,{"key-name":"I",colon:""},{default:a(()=>[d(u(e.t("582")),1)]),_:1}),n($,{class:"mt-2",items:[5,10,15,20,30,45,60,90],modelValue:e.options.polarang,"onUpdate:modelValue":s[1]||(s[1]=o=>e.options.polarang=o)},null,8,["modelValue"])]),_:1},8,["title"])]),_:1}),n(g,{cols:7})]),_:1}))}}),ee=b({__name:"GridSnap",props:{options:{}},setup(l){return(e,s)=>(S(),A(N,null,{default:a(()=>[n(g,{cols:7},{default:a(()=>[n(h,{modelValue:e.options.isOpen,"onUpdate:modelValue":s[0]||(s[0]=o=>e.options.isOpen=o)},{label:a(()=>[n(f,{"key-name":"S"},{default:a(()=>[d(u(e.t("580")),1)]),_:1})]),_:1},8,["modelValue"]),n(I,{title:e.t("581"),class:"mt-2",style:{height:"200px"}},{default:a(()=>[n(f,{"key-name":"I",class:"mt-1",colon:""},{default:a(()=>[d(u(e.t("582")),1)]),_:1}),n(T,{class:"mt-1",modelValue:e.options.ptSnapUnit.x,"onUpdate:modelValue":s[1]||(s[1]=o=>e.options.ptSnapUnit.x=o)},{prepend:a(()=>[n(f,{"key-name":"P",colon:""},{default:a(()=>[d(u(e.t("583")),1)]),_:1})]),_:1},8,["modelValue"]),n(T,{class:"mt-1",modelValue:e.options.ptSnapUnit.y,"onUpdate:modelValue":s[2]||(s[2]=o=>e.options.ptSnapUnit.y=o)},{prepend:a(()=>[n(f,{"key-name":"C",colon:""},{default:a(()=>[d(u(e.t("584")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["title"])]),_:1}),n(g,{cols:5})]),_:1}))}}),ne=()=>{const l=E({options:{isOpen:!1},data:[{icon:"class:iconfont fangkuang",check:i(t.End),type:t.End,name:"端点",key:"E"},{icon:"class:iconfont merge",check:i(t.Ins),type:t.Ins,name:"插入点",key:"S"},{icon:"class:iconfont sanjiao",check:i(t.Mid),type:t.Mid,name:"中心",key:"M"},{icon:"class:iconfont chuizu",check:i(t.Perp),type:t.Perp,name:"垂足",key:"P"},{icon:"class:iconfont yuan",check:i(t.Cen),type:t.Cen,name:"圆心",key:"C"},{icon:"class:iconfont qiedian",check:i(t.Tan),type:t.Tan,name:"切点",key:"N"},{icon:"class:iconfont yuanzhoncha",check:i(t.Node),type:t.Node,name:"节点",key:"D"},{icon:"class:iconfont zuijindian",check:i(t.Near),type:t.Near,name:"最近点",key:"R"},{icon:"class:iconfont lingxingfangkuang",check:i(t.Quad),type:t.Quad,name:"象限点",key:"Q"},{icon:"class:iconfont shizikuang",check:i(t.App),type:t.App,name:"外观交点",key:"A"},{icon:"class:iconfont cha",check:i(t.Int),type:t.Int,name:"交点",key:"I"},{icon:"class:iconfont pinghangdu",check:i(t.Par),type:t.Par,name:"平行",key:"L"},{icon:"class:iconfont yanshen",check:i(t.Ext),type:t.Ext,name:"延伸",key:"X"}],allSelect:function(){l.data.forEach(e=>{e.check=!0})},allCancel:function(){l.data.forEach(e=>{e.check=!1})}});return{tab:"对象捕捉",props:l,component:()=>w(K,l)}},ae=()=>{const l=E({options:{isOpen:!1,polarang:0}});return{tab:"极轴追踪",props:l,component:()=>w(Z,l)}},oe=()=>{const l=E({options:{ptSnapUnit:new W,isOpen:!1}});return{tab:"栅格和捕捉",props:l,component:()=>w(ee,l)}},te=l=>{const e=D([]),s=D(()=>{});return z(()=>{const o=ne(),m=ae(),r=oe();e.value=[o,m,r],O(()=>P.GRIDMODE,p=>{r.props.options.isOpen=p===c.On}),O(()=>P.AUTOSNAP,p=>{m.props.options.isOpen=p===c.On}),O(()=>P.OSMODE,p=>{o.props.options.isOpen=p===c.On}),O(l,p=>{p&&(r.props.options.isOpen=_("GRIDMODE")===c.On,r.props.options.ptSnapUnit=V().getSysVarPoint("SNAPUNIT"),m.props.options.isOpen=_("AUTOSNAP")===c.On,m.props.options.polarang=Math.round(V().getSysVarDouble("POLARANG")*(180/Math.PI)),o.props.options.isOpen=_("OSMODE")===c.On)}),s.value=()=>{let p;o.props.data.forEach(({check:k,type:y})=>{p=F(y,k,p)}),typeof p<"u"&&Q(p),U("GRIDMODE",r.props.options.isOpen?c.On:c.Off),U("AUTOSNAP",m.props.options.isOpen?c.On:c.Off),V().setSysVarPoint2d("SNAPUNIT",r.props.options.ptSnapUnit),V().setSysVarDouble("POLARANG",m.props.options.polarang*(Math.PI/180)),U("OSMODE",o.props.options.isOpen?c.On:c.Off)}}),{items:e,define:s}},se={class:"px-3"},ce=b({__name:"index",setup(l){const e=D(0),{isShow:s,showDialog:o}=X(!1,"showDraftingSettingsDialog",(k={})=>{o(),k.tab&&(e.value=k.tab)}),{items:m,define:r}=te(s),p=[{name:"确定",fun:()=>{r.value(),o(!1)},primary:!0},{name:"关闭",fun:()=>o(!1)}];return(k,y)=>(S(),A(Y,{title:k.t("草图设置"),modelValue:v(s),"onUpdate:modelValue":y[1]||(y[1]=C=>q(s)?s.value=C:null),footerBtnList:p,"max-width":"600"},{default:a(()=>[G("div",se,[n(x,{items:v(m),modelValue:e.value,"onUpdate:modelValue":y[0]||(y[0]=C=>e.value=C),height:312,tabsProps:{grow:!0}},null,8,["items","modelValue"])])]),_:1},8,["title","modelValue"]))}});export{ce as default};
|