index.cf7bb917.js 5.2 KB

123
  1. var K=Object.defineProperty;var S=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var T=(n,a,e)=>a in n?K(n,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[a]=e,A=(n,a)=>{for(var e in a||(a={}))N.call(a,e)&&T(n,e,a[e]);if(S)for(var e of S(a))O.call(a,e)&&T(n,e,a[e]);return n};var E=(n,a,e)=>new Promise((B,_)=>{var x=o=>{try{D(e.next(o))}catch(y){_(y)}},F=o=>{try{D(e.throw(o))}catch(y){_(y)}},D=o=>o.done?B(o.value):Promise.resolve(o.value).then(x,F);D((e=e.apply(n,a)).next())});import{r as v,cr as W,b4 as z,u as X,cy as Y,cz as Z,al as M,cA as h,a3 as q,cv as G,bO as H,a8 as J,d as Q,av as ee,o as C,c as te,w,a as m,b as V,n as ae,Z as se,ab as k,cx as ne,e as L,l as R,X as U,Y as ue,bA as ie,U as le,t as I,a0 as oe,p as ce,m as re,_ as pe}from"./index.6c36cb53.js";import{M as de}from"./index.a696a3d7.js";import{r as P,f as fe}from"./file.11b18773.js";import{V as me}from"./VTable.c59a0e01.js";const _e=()=>{const n=v(0),a=W(),{createLineType:e}=a,{currentLineType:B,lineTypeList:_}=z(a),x=v([]),F=X(!1,"Mx_Linetype",()=>E(void 0,null,function*(){const s=new Y,t=new Z;s.setKeyWords("[\u4ECE\u6587\u4EF6\u52A0\u8F7D\u7EBF\u578B(F)/\u8BBE\u7F6E\u5168\u5C40\u6BD4\u4F8B(S)/\u8BBE\u7F6E\u9ED8\u8BA4\u6BD4\u4F8B(R)/\u4FEE\u6539\u5BF9\u8C61\u6BD4\u4F8B(A)]");const c=M.getCurrentMxCAD(),i=yield s.go();if(i==="F"&&F.showDialog(!0,B.value),i==="S"){if(t.setMessage(h("LinearManagerDialog_LTSCALE",`\u8F93\u5165\u6BD4\u4F8B<${c.getSysVarDouble("LTSCALE")}>`)),!(yield t.go()))return;c.setSysVarDouble("LTSCALE",t.value())}if(i==="R"){if(t.setMessage(h("LinearManagerDialog_CELTSCALE",`\u8F93\u5165\u6BD4\u4F8B<${c.getSysVarDouble("CELTSCALE")}>`)),!(yield t.go()))return;c.setSysVarDouble("CELTSCALE",t.value())}if(i==="A"){const p=yield q.userSelect(`
  2. \u9009\u62E9\u4FEE\u6539\u7EBF\u578B\u6BD4\u4F8B\u7684\u5BF9\u8C61`),u=[];if(p.forEach(d=>{if(d.type===G.kMxCAD){const l=d.getMcDbEntity();l&&u.push(l)}}),u.length===0||(t.setMessage(h("LinearManagerDialog_Object_lineType",`\u8F93\u5165\u6BD4\u4F8B<${u[0].linetypeScale}>`)),!(yield t.go())))return;u.forEach(d=>{d.linetypeScale=t.value()})}})),D=v("");return A({lineTypeList:x,createLineType:e,index:n,filePath:D,parseTextLineTypes:s=>{const t=s.split(`
  3. `),c=[];let i=null;for(let p=0;p<t.length;p++){const u=t[p].trim();if(u.startsWith("*")){i&&c.push(i);const d=u.split(","),l=d[0].slice(1).trim(),f=d.slice(1).join(",").trim(),r=t[p+1].trim().replace(/^A,/,"");i=e({name:l,appearance:f,explain:f,value:r}),p+=1}}return i&&c.push(i),c},addLineType:s=>E(void 0,null,function*(){let t=!1;const c=M.getCurrentMxCAD(),i=c.database.getLinetypeTable().get(s.name);if(i.isErase())t=!0;else{if(!(yield(()=>new Promise(l=>{H().open({title:"MxCAD",text:"\u7EBF\u578B "+s.name+" \u5DF2\u52A0\u8F7D, \u662F\u5426\u91CD\u8F7D",cancelTitle:"\u5426",defineTitle:"\u662F",cancel:()=>{l(!1)},define:()=>{l(!0)}})}))()))return;i.erase()}if(!c.addLinetypeEx(s.name,s.value||"","").isValid()){J().error("\u7EBF\u578B:"+s.name+"\u52A0\u8F7D\u5931\u8D25\uFF01");return}t&&_.value.push(s);const u=_.value.find(({name:d})=>s.name===d);u&&(u.value=s.value,u.explain=u.appearance=s.appearance),B.value=u||s})},F)},$=n=>(ce("data-v-3cb7dc83"),n=n(),re(),n),De={class:"d-flex algin-center mt-3"},Fe={class:"mt-2"},xe=$(()=>m("p",null,"\u53EF\u7528\u7EBF\u578B",-1)),ye=$(()=>m("thead",{class:"w-100"},[m("tr",{class:"w-100"},[m("th",{class:"text-left"},"\u7EBF\u578B"),m("th",{class:"text-left"},"\u8BF4\u660E")])],-1)),ge={class:"w-100"},Be=["onClick"],Ee={class:"text-left"},Le={class:"text-left"},ve=Q({__name:"index",emits:["change"],setup(n,{expose:a,emit:e}){const{createLineType:B,lineTypeList:_,showDialog:x,isShow:F,index:D,filePath:o,parseTextLineTypes:y,addLineType:s,onReveal:t}=_e(),c=()=>{s(_.value[D.value]),x(!1)},i=[{name:"\u786E\u5B9A",fun:c,primary:!0},{name:"\u53D6\u6D88",fun:()=>x(!1)}],p=v(),u=()=>{p.value&&p.value.click()},d=l=>E(this,null,function*(){const r=l.target.files;if(!r)return;const g=r[0],b=yield fe(g),j=yield P(b);_.value=y(j),o.value=g.name});return ee(()=>E(this,null,function*(){const l=new URL(""+new URL("mx.30f95a42.lin",import.meta.url).href,self.location).href,r=yield(yield fetch(l)).blob(),g=yield P(r);o.value=l,_.value=y(g)})),t(l=>{D.value=_.value.findIndex(({name:f})=>l.name===f)}),a({showDialog:x}),(l,f)=>(C(),te(de,{title:"\u7EBF\u578B\u52A0\u8F7D\u6216\u91CD\u8F7D","max-width":"600",modelValue:L(F),"onUpdate:modelValue":f[1]||(f[1]=r=>R(F)?F.value=r:null),footerBtnList:i},{default:w(()=>[m("div",De,[V(se,{onClick:u,class:"ml-1"},{default:w(()=>[ae("\u6587\u4EF6(F)...")]),_:1}),k(m("input",{class:"form__inset w-100",disabled:!0,"onUpdate:modelValue":f[0]||(f[0]=r=>R(o)?o.value=r:null)},null,512),[[ne,L(o)]])]),m("input",{type:"file",ref_key:"fillSelectEl",ref:p,onChange:d,style:{display:"none"},accept:".lin"},null,544),m("div",Fe,[xe,V(me,{class:"w-100",cellpadding:"20",height:"300"},{default:w(()=>[ye,m("tbody",ge,[(C(!0),U(oe,null,ue(L(_),(r,g)=>k((C(),U("tr",{key:r.id,class:le(L(D)===g?"active":""),onClick:b=>D.value=g,onDblclick:c},[m("td",Ee,I(r.name),1),m("td",Le,I(r.appearance),1)],42,Be)),[[ie]])),128))])]),_:1})])]),_:1},8,["modelValue"]))}});const Te=pe(ve,[["__scopeId","data-v-3cb7dc83"]]);export{Te as default};