jvs-draw 1.1.19 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jvs-draw.css +1 -1
- package/dist/jvs-draw.es.js +4 -4
- package/dist/jvs-draw.umd.js +1 -1
- package/package.json +1 -1
package/dist/jvs-draw.es.js
CHANGED
|
@@ -458996,9 +458996,9 @@ ${JSON.stringify(d2)}`);
|
|
|
458996
458996
|
});
|
|
458997
458997
|
const p0 = (H0, y0) => {
|
|
458998
458998
|
if (typeof document > "u" || document.getElementById(y0)) return;
|
|
458999
|
-
const _0 = "
|
|
458999
|
+
const _0 = "<svg>", a2 = "</svg>", i2 = H0.indexOf(_0), o2 = H0.indexOf(a2);
|
|
459000
459000
|
if (i2 !== -1 && o2 !== -1) {
|
|
459001
|
-
const d2 = H0.substring(i2
|
|
459001
|
+
const d2 = H0.substring(i2, o2 + a2.length), r2 = document.createElement("div");
|
|
459002
459002
|
r2.innerHTML = d2;
|
|
459003
459003
|
const M2 = r2.querySelector("svg");
|
|
459004
459004
|
M2 && (M2.id = y0, M2.setAttribute("aria-hidden", "true"), M2.style.position = "absolute", M2.style.width = "0", M2.style.height = "0", M2.style.overflow = "hidden", document.body && document.body.insertBefore(M2, document.body.firstChild));
|
|
@@ -459147,7 +459147,7 @@ ${JSON.stringify(d2)}`);
|
|
|
459147
459147
|
onClick: y0[2] || (y0[2] = (o2) => m1.value = !0),
|
|
459148
459148
|
title: "信息图"
|
|
459149
459149
|
}, [...y0[19] || (y0[19] = [
|
|
459150
|
-
createStaticVNode('<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-
|
|
459150
|
+
createStaticVNode('<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-e4ea1bab><rect x="2" y="6" width="5" height="12" rx="1" fill="#3b82f6" data-v-e4ea1bab></rect><rect x="9" y="6" width="5" height="12" rx="1" fill="#22d3ee" data-v-e4ea1bab></rect><rect x="16" y="6" width="5" height="12" rx="1" fill="#f97316" data-v-e4ea1bab></rect><path d="M6 12L10 12" stroke="#3b82f6" stroke-width="1.5" data-v-e4ea1bab></path><path d="M13 12L17 12" stroke="#22d3ee" stroke-width="1.5" data-v-e4ea1bab></path></svg><span class="template-text" style="font-size:14px;font-weight:bold;color:#1E6FFF;" data-v-e4ea1bab>信息图</span>', 2)
|
|
459151
459151
|
])])) : createCommentVNode("", !0),
|
|
459152
459152
|
createElementVNode("div", {
|
|
459153
459153
|
class: normalizeClass(["action-group", { "is-searching": W1.value }])
|
|
@@ -459402,7 +459402,7 @@ ${JSON.stringify(d2)}`);
|
|
|
459402
459402
|
]);
|
|
459403
459403
|
};
|
|
459404
459404
|
}
|
|
459405
|
-
}), JvsDraw = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
459405
|
+
}), JvsDraw = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e4ea1bab"]]);
|
|
459406
459406
|
JvsDraw.install = function(e1, n1) {
|
|
459407
459407
|
n1 && setConfig(n1), e1.component("JvsDraw", JvsDraw);
|
|
459408
459408
|
};
|
package/dist/jvs-draw.umd.js
CHANGED
|
@@ -5267,4 +5267,4 @@ Accounts`,containerId:null,autoResize:!0,baseline:34}]}],cloudDesignPatternsMate
|
|
|
5267
5267
|
【上下文:当前选中的画布元素 JSON 数据】:
|
|
5268
5268
|
${JSON.stringify(d2)}`)}if(b1.value.push({role:"user",content:_0}),b1.value.push({role:"assistant",content:""}),f1.value="",g1.value=!0,h1.value="",w1.value="",await vue.nextTick(),k1.value){const d2=k1.value.$el.querySelector(".el-scrollbar__wrap");k1.value.setScrollTop(d2.scrollHeight)}try{const d2=window.innerWidth/2/u1.appState.zoom-u1.appState.scrollX,r2=window.innerHeight/2/u1.appState.zoom-u1.appState.scrollY;r1();let M2=!1;const V2=getCommonBoundingBox(u1.elements.filter(u5=>!u5.isDeleted));let d5=null;const X2=new Set(u1.elements.map(u5=>u5.id)),N2=new Map,r5=new Map,P2=new Map,F2=!!(urlParsParams(window.location.href)?.sse&&window.BroadcastChannel);await streamAiDiagramElements(a2,d2,r2,u5=>{console.log(u5),M2||(M2=!0);const A5=u5.find(I5=>I5.type==="frame");if(A5&&!d5&&(d5=A5.id),o2){const I5=new Set(u5.map(N1=>N1.id)),X5=u1.elements.map(N1=>{const U1=u5.find(P1=>P1.id===N1.id);return U1?{...N1,...U1,version:(N1.version||0)+1}:N1}),a0=u5.filter(N1=>!X2.has(N1.id));u1.elements=[...X5,...a0]}else{const I5=u1.elements.filter(a0=>X2.has(a0.id)),X5=u5.map(a0=>{const N1={...a0};if(N1.id&&X2.has(N1.id)&&!N2.has(N1.id)&&N2.set(N1.id,nanoid()),N2.has(N1.id)&&(N1.id=N2.get(N1.id)),N1.startBinding?.elementId&&N2.has(N1.startBinding.elementId)&&(N1.startBinding={...N1.startBinding,elementId:N2.get(N1.startBinding.elementId)}),N1.endBinding?.elementId&&N2.has(N1.endBinding.elementId)&&(N1.endBinding={...N1.endBinding,elementId:N2.get(N1.endBinding.elementId)}),N1.containerId&&N2.has(N1.containerId)&&(N1.containerId=N2.get(N1.containerId)),N1.groupIds&&(N1.groupIds=N1.groupIds.map(U1=>(P2.has(U1)||P2.set(U1,nanoid()),P2.get(U1)))),N1.compoundGroupId&&(r5.has(N1.compoundGroupId)||r5.set(N1.compoundGroupId,nanoid()),N1.compoundGroupId=r5.get(N1.compoundGroupId)),N1.compoundGroupOps){const U1={};for(const[P1,q1]of Object.entries(N1.compoundGroupOps))r5.has(P1)||r5.set(P1,nanoid()),U1[r5.get(P1)]=q1;N1.compoundGroupOps=U1}return N1});u1.elements=[...I5,...X5]}},u5=>{w1.value=u5;const A5=b1.value[b1.value.length-1];A5&&A5.role==="assistant"&&(A5.content=u5),vue.nextTick(()=>{if(k1.value){const I5=k1.value.$el.querySelector(".el-scrollbar__wrap");k1.value.setScrollTop(I5.scrollHeight)}})},y0,F2);const H5=u1.elements.filter(u5=>!X2.has(u5.id)&&!u5.isDeleted),F5=getCommonBoundingBox(H5);if(F5){if(V2&&F5.x<V2.x+V2.width+40&&F5.x+F5.width>V2.x-40&&F5.y<V2.y+V2.height+40&&F5.y+F5.height>V2.y-40){const I5=V2.x+V2.width+40-F5.x;H5.forEach(X5=>{X5.x+=I5})}vue.nextTick(()=>{const u5=getCommonBoundingBox(H5);if(u5){const A5=u1.appState.zoom,I5=document.querySelector(".jvs-draw-container")?.clientWidth||window.innerWidth,X5=document.querySelector(".jvs-draw-container")?.clientHeight||window.innerHeight;u1.appState.scrollX=I5/2/A5-(u5.x+u5.width/2),u1.appState.scrollY=X5/2/A5-(u5.y+u5.height/2)}})}u1.recordHistory();const j2=b1.value[b1.value.length-1];j2&&j2.role==="assistant"&&!j2.content&&(j2.content="图表已生成")}catch(d2){if(H0){const r2=b1.value[b1.value.length-1];r2&&r2.role==="assistant"&&(r2.content="生成失败:"+d2.message),h1.value=d2.message}}finally{g1.value=!1,s1()}},e0=async H0=>{try{r1();let y0=l1[H0];if(!y0){const N2=await fetch(`/draw-specs/template-${H0}.jsonl`);if(!N2.ok)throw new Error("模板文件未找到或加载失败");y0=await N2.text()}const a2=y0.split(`
|
|
5269
5269
|
`).filter(N2=>N2.trim()).map(N2=>({type:"message",data:N2+`
|
|
5270
|
-
`})),i2=window.innerWidth/2/u1.appState.zoom-u1.appState.scrollX,o2=window.innerHeight/2/u1.appState.zoom-u1.appState.scrollY,d2=new Set(u1.elements.map(N2=>N2.id)),r2=new Map,M2=new Map,V2=new Map,d5=[...u1.elements],X2=getCommonBoundingBox(d5.filter(N2=>!N2.isDeleted));await analysisAiRenderData(a2,Date.now().toString(),i2,o2,N2=>{const r5=N2.map(P2=>{const T2={...P2};if(T2.id&&d2.has(T2.id)&&!r2.has(T2.id)&&r2.set(T2.id,nanoid()),r2.has(T2.id)&&(T2.id=r2.get(T2.id)),T2.startBinding?.elementId&&r2.has(T2.startBinding.elementId)&&(T2.startBinding={...T2.startBinding,elementId:r2.get(T2.startBinding.elementId)}),T2.endBinding?.elementId&&r2.has(T2.endBinding.elementId)&&(T2.endBinding={...T2.endBinding,elementId:r2.get(T2.endBinding.elementId)}),T2.containerId&&r2.has(T2.containerId)&&(T2.containerId=r2.get(T2.containerId)),T2.groupIds&&(T2.groupIds=T2.groupIds.map(F2=>(V2.has(F2)||V2.set(F2,nanoid()),V2.get(F2)))),T2.compoundGroupId&&(M2.has(T2.compoundGroupId)||M2.set(T2.compoundGroupId,nanoid()),T2.compoundGroupId=M2.get(T2.compoundGroupId)),T2.compoundGroupOps){const F2={};for(const[H5,F5]of Object.entries(T2.compoundGroupOps))M2.has(H5)||M2.set(H5,nanoid()),F2[M2.get(H5)]=F5;T2.compoundGroupOps=F2}return T2});if(X2){const P2=getCommonBoundingBox(r5);if(P2){const F2=X2.x+X2.width+40-P2.x,H5=X2.y+X2.height+40-P2.y;if(P2.x<X2.x+X2.width+40&&P2.x+P2.width>X2.x-40&&P2.y<X2.y+X2.height+40&&P2.y+P2.height>X2.y-40){const j2=X2.x+X2.width+40-P2.x;r5.forEach(u5=>{u5.x+=j2})}}}u1.elements=[...d5,...r5],vue.nextTick(()=>{const P2=getCommonBoundingBox(r5);if(P2){const T2=u1.appState.zoom,F2=document.querySelector(".jvs-draw-container")?.clientWidth||window.innerWidth,H5=document.querySelector(".jvs-draw-container")?.clientHeight||window.innerHeight,F5=P2.x+P2.width/2,j2=P2.y+P2.height/2;u1.appState.scrollX=F2/2/T2-F5,u1.appState.scrollY=H5/2/T2-j2}})},()=>{}),u1.recordHistory(),elementPlus.ElMessage.success(`成功加载模板: ${H0}`)}catch(y0){elementPlus.ElMessage.error(`加载模板失败: ${y0.message}`)}finally{s1()}},o0=H0=>{try{const y0=document.querySelector(".jvs-draw-container")?.clientWidth||window.innerWidth,_0=document.querySelector(".jvs-draw-container")?.clientHeight||window.innerHeight,a2=y0/2/u1.appState.zoom-u1.appState.scrollX,i2=_0/2/u1.appState.zoom-u1.appState.scrollY,o2=infographicToElements(H0,a2,i2);if(o2.length===0){elementPlus.ElMessage.warning("DSL 数据为空,未生成任何元素");return}console.log("[debug-app] newElements count:",o2.length),o2.forEach(r2=>{(r2.type==="ellipse"||r2.type==="line")&&console.log(`[debug-app] newElement type: ${r2.type}, id: ${r2.id}, strokeWidth: ${r2.strokeWidth}`)}),u1.elements=[...u1.elements,...o2],console.log("[debug-app] store.elements after assign:",u1.elements.filter(r2=>o2.some(M2=>M2.id===r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth})));const d2=o2.map(r2=>r2.id);d2.length>=2&&(u1.groupElements(d2),console.log("[debug-app] store.elements after group:",u1.elements.filter(r2=>d2.includes(r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth})))),u1.setSelectedElementIds(d2),u1.recordHistory(),console.log("[debug-app] store.elements after select & history:",u1.elements.filter(r2=>d2.includes(r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth}))),vue.nextTick(()=>{const r2=getCommonBoundingBox(o2);r2&&(u1.appState.scrollX=y0/2/u1.appState.zoom-(r2.x+r2.width/2),u1.appState.scrollY=_0/2/u1.appState.zoom-(r2.y+r2.height/2))}),elementPlus.ElMessage.success("信息图已生成")}catch(y0){elementPlus.ElMessage.error(`生成失败: ${y0.message}`)}};a1.initialData&&(u1.appConfig.initialData=a1.initialData),a1.loadFromLocal!==void 0&&(u1.appConfig.loadFromLocal=a1.loadFromLocal);const w0=()=>{const H0={elements:JSON.parse(JSON.stringify(u1.elements)),appState:JSON.parse(JSON.stringify(u1.appState))};return delete H0.appState.scrollX,delete H0.appState.scrollY,delete H0.appState.zoom,delete H0.appState.activeTool,delete H0.appState.activeToolType,delete H0.appState.showHelp,delete H0.appState.isPanningCanvas,delete H0.appState.isDraggingElement,delete H0.appState.isBoxSelecting,delete H0.appState.showGrid,delete H0.appState.isPropertiesPanelOpen,delete H0.appState.isShapeLibraryOpen,delete H0.appState.floatingToolbarOffset,delete H0.appState.selectedElementIds,H0},P0=H0=>{u1.updateCanvasData(H0)},B0=H0=>{H0&&(u1.appConfig=Object.assign(u1.appConfig,H0))},R0=H0=>{const y0=Array.isArray(H0)&&H0.length>0?H0:u1.elements;exportToImage(y0,{viewBackgroundColor:"transparent",gridType:u1.appState.gridType,images:u1.images})},_1=async()=>{try{const H0=w0(),y0=urlParsParams(window.location.href),_0={id:y0?.id||"",identification:y0?.scene||"default",businessId:y0?.businessId||"",fileName:u1.appState.name,displayName:u1.appState.name,fileType:y0?.scene||"canvas_scene",source:"GENERATE",summary:JSON.stringify(H0)};await saveDesign("/api",_0),elementPlus.ElMessage.success("画板保存成功!")}catch(H0){elementPlus.ElMessage.error(H0.message||"画布保存异常失败")}},C0=H0=>{const y0=Array.isArray(H0)&&H0.length>0?H0:u1.elements;exportToSVG(y0,{viewBackgroundColor:"transparent",images:u1.images})},g0=()=>{const H0=u1.elements.filter(r2=>!r2.isDeleted),y0={};H0.forEach(r2=>{if(r2.type==="image"&&r2.fileId){const M2=u1.images[r2.fileId];M2&&(y0[r2.fileId]=M2)}});const _0={type:"jvs-draw",version:1,elements:H0,appState:{viewBackgroundColor:u1.appState.viewBackgroundColor,gridType:u1.appState.gridType},files:y0},a2=JSON.stringify(_0,null,2),i2=new Blob([a2],{type:"application/json"}),o2=URL.createObjectURL(i2),d2=document.createElement("a");d2.href=o2,d2.download=(u1.appState.name||"jvs-draw")+".json",d2.click(),URL.revokeObjectURL(o2)};n1({getCanvasData:w0,setCanvasData:P0,setConfig:B0,exportImage:R0,exportSVG:C0,applyCollabAction:H0=>{applyRemoteAction(u1,H0)}});const p0=(H0,y0)=>{if(typeof document>"u"||document.getElementById(y0))return;const _0="'<svg>",a2="</svg>'",i2=H0.indexOf(_0),o2=H0.indexOf(a2);if(i2!==-1&&o2!==-1){const d2=H0.substring(i2+1,o2+6),r2=document.createElement("div");r2.innerHTML=d2;const M2=r2.querySelector("svg");M2&&(M2.id=y0,M2.setAttribute("aria-hidden","true"),M2.style.position="absolute",M2.style.width="0",M2.style.height="0",M2.style.overflow="hidden",document.body&&document.body.insertBefore(M2,document.body.firstChild))}};vue.onMounted(()=>{p0(iconfontRaw,"jvs-draw-svg-iconfont"),p0(publicIconfontRaw,"jvs-draw-svg-public-iconfont"),window.addEventListener("jvs-draw:close-ai-dialog",Q1);const H0=urlParsParams(window.location.href);H0&&H0?.sse&&H0?.id&&(B0({loadFromLocal:!1,editable:!1}),y1.value=!0,window.parent.postMessage({type:"get_draw_list",id:H0.id},"*"),window.addEventListener("message",W0)),globalConfig.applyRemoteAction=y0=>{applyRemoteAction(u1,y0)},u1.recordHistory(),u1.initImages(),S1.value=!0});async function W0(H0){const y0=urlParsParams(window.location.href);let _0=null;const a2=new Set(u1.elements.map(r2=>r2.id)),i2=new Map,o2=new Map,d2=new Map;if(H0.data.type=="draw_ai_data")if(H1.value=H0.data.data.isFinish,!H1.value)r1(),g1.value=!0,E1.value=H0.data.data.list;else{g1.value=!1,s1(),G0(y0.id);return}if(H0.data.type=="draw_ai_data_item"&&(E1.value.push(H0.data.data),H0.data.isFinish&&(g1.value=!1,s1())),!H1.value){const r2=H0.data?.isFinish===!0,M2=window.innerWidth/2/u1.appState.zoom-u1.appState.scrollX,V2=window.innerHeight/2/u1.appState.zoom-u1.appState.scrollY;await analysisAiRenderData(E1.value,y0?.id,M2,V2,d5=>{const X2=d5.find(r5=>r5.type==="frame");X2&&!_0&&(_0=X2.id);const N2=d5.map(r5=>{const P2={...r5};if(P2.id&&a2.has(P2.id)&&!i2.has(P2.id)&&i2.set(P2.id,nanoid()),i2.has(P2.id)&&(P2.id=i2.get(P2.id)),P2.startBinding?.elementId&&i2.has(P2.startBinding.elementId)&&(P2.startBinding={...P2.startBinding,elementId:i2.get(P2.startBinding.elementId)}),P2.endBinding?.elementId&&i2.has(P2.endBinding.elementId)&&(P2.endBinding={...P2.endBinding,elementId:i2.get(P2.endBinding.elementId)}),P2.containerId&&i2.has(P2.containerId)&&(P2.containerId=i2.get(P2.containerId)),P2.groupIds&&(P2.groupIds=P2.groupIds.map(T2=>(d2.has(T2)||d2.set(T2,nanoid()),d2.get(T2)))),P2.compoundGroupId&&(o2.has(P2.compoundGroupId)||o2.set(P2.compoundGroupId,nanoid()),P2.compoundGroupId=o2.get(P2.compoundGroupId)),P2.compoundGroupOps){const T2={};for(const[F2,H5]of Object.entries(P2.compoundGroupOps))o2.has(F2)||o2.set(F2,nanoid()),T2[o2.get(F2)]=H5;P2.compoundGroupOps=T2}return P2});u1.elements=[...N2],r2&&u1.recordHistory()},d5=>{w1.value=d5,vue.nextTick(()=>{D1.value&&(D1.value.scrollTop=D1.value.scrollHeight)})})}}function G0(H0){getFileInfo("/jvs-ai",H0).then(y0=>{console.log(y0)})}return vue.onUnmounted(()=>{window.removeEventListener("message",W0),window.removeEventListener("jvs-draw:close-ai-dialog",Q1)}),(H0,y0)=>{const _0=vue.resolveComponent("el-input"),a2=vue.resolveComponent("el-popover"),i2=vue.resolveComponent("el-scrollbar");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createVNode(ShapeLibraryDrawer),vue.createElementVNode("div",_hoisted_2,[vue.unref(u1).appConfig.showToolbar!==!1&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(Toolbar,{key:0})):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showPropertiesPanel!==!1&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(PropertiesPanel,{key:1})):vue.createCommentVNode("",!0),(vue.unref(u1).appConfig.showBoardName!==!1||vue.unref(u1).appConfig.showGlobalSettings!==!1)&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(BoardName,{key:2,showExport:vue.unref(u1).appConfig.showExport!==!1},null,8,["showExport"])):vue.createCommentVNode("",!0),S1.value?(vue.openBlock(),vue.createBlock(ExcalidrawCanvas,{key:3,elements:vue.unref(u1).elements,zoom:vue.unref(u1).appState.zoom,scrollX:vue.unref(u1).appState.scrollX,scrollY:vue.unref(u1).appState.scrollY},null,8,["elements","zoom","scrollX","scrollY"])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(EmptyState,{key:4})):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(FloatingPropertiesBar,{key:5,zoom:vue.unref(u1).appState.zoom,scrollX:vue.unref(u1).appState.scrollX,scrollY:vue.unref(u1).appState.scrollY},null,8,["zoom","scrollX","scrollY"])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showFooter!==!1?(vue.openBlock(),vue.createBlock(Footer,{key:6})):vue.createCommentVNode("",!0),vue.createVNode(HelpDialog),vue.unref(u1).appConfig.editable!==!1&&vue.unref(u1).appConfig.showWatermark!==!1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[...y0[15]||(y0[15]=[vue.createElementVNode("a",{href:"https://bctools.cn/",target:"_blank",rel:"noopener noreferrer"}," 技术支持: 软开企服(bctools.cn) ↗ ",-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1&&vue.unref(u1).appConfig.showToolbar!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:8,class:"top-right-actions",style:vue.normalizeStyle({right:vue.unref(u1).appState.isPropertiesPanelOpen?"345px":"24px"})},[y1.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"action-btn template-btn",onClick:_1,title:"保存"},[...y0[16]||(y0[16]=[vue.createElementVNode("svg",{class:"svg-icon",viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M163.712 83.968h694.336c45.12 0 81.728 36.608 81.6 81.728v694.272c0 45.056-36.48 81.6-81.6 81.6H163.648c-44.992 0-81.6-36.48-81.6-81.6V165.568c0-44.992 36.48-81.6 81.664-81.6z m694.336 779.712a3.712 3.712 0 0 0 3.712-3.712h0.32V165.696a3.712 3.712 0 0 0-3.776-3.712h-74.24v272.96c0 43.072-34.944 78.016-78.08 78.016H316.16a78.08 78.08 0 0 1-78.016-78.08V162.048H163.84a3.712 3.712 0 0 0-3.776 3.712v694.272c0 2.048 1.664 3.712 3.712 3.712h694.272z m-152.256-428.8V162.048h-389.76v272.96h389.76zM588.8 339.2q5.056 0 9.984-0.96 4.928-1.024 9.6-2.944t8.832-4.736q4.224-2.816 7.808-6.4 3.52-3.52 6.4-7.68 2.752-4.224 4.672-8.896 1.92-4.672 2.944-9.6Q640 293.12 640 288t-0.96-9.984q-1.024-4.928-2.944-9.6t-4.736-8.832q-2.816-4.224-6.4-7.808-3.52-3.52-7.68-6.4-4.224-2.752-8.896-4.672-4.672-1.92-9.6-2.944Q593.856 236.8 588.8 236.8t-9.984 0.96q-4.928 1.024-9.6 2.944t-8.896 4.736q-4.16 2.816-7.68 6.4-3.584 3.52-6.4 7.68-2.816 4.224-4.736 8.896-1.92 4.672-2.944 9.6Q537.6 282.88 537.6 288t0.96 9.984q1.024 4.928 2.944 9.6t4.736 8.832q2.816 4.224 6.4 7.808 3.52 3.52 7.68 6.4 4.224 2.752 8.896 4.672 4.672 1.92 9.6 2.944 4.928 0.96 9.984 0.96z",fill:"#363B4C","p-id":"23168"})],-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showAI?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"action-btn ai-btn",onClick:y0[0]||(y0[0]=o2=>vue.unref(u1).setTool("aidraw")),title:"AI 绘制"},[...y0[17]||(y0[17]=[vue.createElementVNode("svg",{width:"24",height:"24"},[vue.createElementVNode("use",{"xlink:href":"#icon-AI"})],-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showTemplate!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:"action-btn template-btn",onClick:y0[1]||(y0[1]=o2=>A1.value=!0),title:"模板库"},[...y0[18]||(y0[18]=[vue.createElementVNode("svg",{width:"24",height:"24"},[vue.createElementVNode("use",{"xlink:href":"#icon-mobanku"})],-1),vue.createElementVNode("span",{class:"template-text",style:{"font-size":"14px","font-weight":"bold",color:"#1E6FFF"}},"模板库",-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showInfographic!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:"action-btn template-btn",onClick:y0[2]||(y0[2]=o2=>m1.value=!0),title:"信息图"},[...y0[19]||(y0[19]=[vue.createStaticVNode('<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-a0044550><rect x="2" y="6" width="5" height="12" rx="1" fill="#3b82f6" data-v-a0044550></rect><rect x="9" y="6" width="5" height="12" rx="1" fill="#22d3ee" data-v-a0044550></rect><rect x="16" y="6" width="5" height="12" rx="1" fill="#f97316" data-v-a0044550></rect><path d="M6 12L10 12" stroke="#3b82f6" stroke-width="1.5" data-v-a0044550></path><path d="M13 12L17 12" stroke="#22d3ee" stroke-width="1.5" data-v-a0044550></path></svg><span class="template-text" style="font-size:14px;font-weight:bold;color:#1E6FFF;" data-v-a0044550>信息图</span>',2)])])):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["action-group",{"is-searching":W1.value}])},[vue.createVNode(a2,{visible:M1.value,ref:"searchPopover",placement:"bottom-end",width:266,trigger:"manual","popper-class":"search-results-popper","show-arrow":!1,offset:12},{reference:vue.withCtx(()=>[vue.createElementVNode("div",{class:"search-container",onClick:y0[5]||(y0[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("div",{class:"action-btn search-toggle",onClick:vue.withModifiers(R1,["stop"]),title:"搜索"},[...y0[20]||(y0[20]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-sousuo"})],-1)])]),vue.createElementVNode("div",_hoisted_4,[vue.createVNode(_0,{ref_key:"searchInputRef",ref:O1,modelValue:V1.value,"onUpdate:modelValue":y0[3]||(y0[3]=o2=>V1.value=o2),placeholder:"搜索文字内容...",onInput:z1,onFocus:j1,onKeydown:[vue.withKeys(I1,["esc"]),vue.withKeys(T1,["enter"])],onClick:y0[4]||(y0[4]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"]),vue.createElementVNode("div",{class:"search-close-icon",onClick:vue.withModifiers(I1,["stop"])},[...y0[21]||(y0[21]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-guanbi"})],-1)])])])])]),default:vue.withCtx(()=>[B1.value.length>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(B1.value,o2=>(vue.openBlock(),vue.createElementBlock("div",{key:o2.id,class:"search-result-item",onClick:d2=>Y1(o2)},[vue.createElementVNode("div",_hoisted_7,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_8,[vue.createElementVNode("use",{"xlink:href":G1(o2)},null,8,_hoisted_9)]))]),vue.createElementVNode("div",_hoisted_10,[vue.createElementVNode("div",_hoisted_11,vue.toDisplayString(o2.type==="text"?o2.text:o2.name),1),vue.createElementVNode("div",_hoisted_12,vue.toDisplayString(X1(o2)),1)])],8,_hoisted_6))),128))])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_13," 未找到相关内容 "))]),_:1},8,["visible"]),y0[26]||(y0[26]=vue.createElementVNode("div",{class:"separator-line"},null,-1)),vue.createVNode(a2,{placement:"bottom-end",width:140,trigger:"click","popper-class":"export-popover","show-arrow":!1,offset:12},{reference:vue.withCtx(()=>[...y0[22]||(y0[22]=[vue.createElementVNode("div",{class:"action-btn",title:"导出"},[vue.createElementVNode("svg",{class:"svg-icon",viewBox:"0 0 24 24"},[vue.createElementVNode("use",{"xlink:href":"#icon-daochu"})])],-1)])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14,[vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[6]||(y0[6]=o2=>R0())},[...y0[23]||(y0[23]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-tupian1"})],-1),vue.createElementVNode("span",null,"导出图片",-1)])]),vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[7]||(y0[7]=o2=>C0())},[...y0[24]||(y0[24]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-svg"})],-1),vue.createElementVNode("span",null,"导出SVG",-1)])]),vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[8]||(y0[8]=o2=>g0())},[...y0[25]||(y0[25]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-daoruwendang"})],-1),vue.createElementVNode("span",null,"导出数据",-1)])])])]),_:1})],2)],4)):vue.createCommentVNode("",!0),(g1.value,vue.createCommentVNode("",!0)),vue.withDirectives(vue.createElementVNode("div",_hoisted_17,[...y0[28]||(y0[28]=[vue.createElementVNode("div",{id:"loaidng-animiate",class:"lottie-container"},null,-1)])],512),[[vue.vShow,i1.value]])]),c1.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_18,[vue.createElementVNode("div",_hoisted_19,[y0[30]||(y0[30]=vue.createElementVNode("span",{class:"ai-panel-title"},"AI 内容生成",-1)),vue.createElementVNode("div",{class:"ai-panel-close",onClick:y0[9]||(y0[9]=o2=>c1.value=!1)},[...y0[29]||(y0[29]=[vue.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{fill:"#909399",d:"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"})],-1)])])]),vue.createVNode(i2,{style:{height:"calc(100% - 134px)"},ref_key:"aiChatContainerRef",ref:k1},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_20,[b1.value.length===0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_21,[...y0[31]||(y0[31]=[vue.createElementVNode("p",null,"描述你想要生成的内容,AI 将为你自动绘制",-1)])])):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(b1.value,(o2,d2)=>(vue.openBlock(),vue.createElementBlock("div",{key:d2,class:vue.normalizeClass(["ai-chat-bubble",o2.role==="user"?"ai-chat-bubble-user":"ai-chat-bubble-assistant"])},[vue.createElementVNode("div",_hoisted_22,[o2.role==="assistant"?(vue.openBlock(),vue.createElementBlock("svg",_hoisted_23,[...y0[32]||(y0[32]=[vue.createElementVNode("rect",{width:"24",height:"24",rx:"6",fill:"#1E6FFF"},null,-1),vue.createElementVNode("text",{x:"12",y:"17","text-anchor":"middle",fill:"#fff","font-size":"13","font-weight":"bold"},"AI",-1)])])):(vue.openBlock(),vue.createElementBlock("svg",_hoisted_24,[...y0[33]||(y0[33]=[vue.createElementVNode("rect",{width:"24",height:"24",rx:"6",fill:"#67c23a"},null,-1),vue.createElementVNode("text",{x:"12",y:"17","text-anchor":"middle",fill:"#fff","font-size":"13","font-weight":"bold"},"Me",-1)])]))]),vue.createElementVNode("div",_hoisted_25,[o2.role==="assistant"&&g1.value&&d2===b1.value.length-1&&!o2.content?(vue.openBlock(),vue.createElementBlock("span",_hoisted_26,"AI 正在生成图表...")):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(o2.content),1)],64))])],2))),128))])]),_:1},512),vue.createElementVNode("div",_hoisted_27,[vue.createVNode(_0,{ref_key:"aiInputRef",ref:p1,modelValue:f1.value,"onUpdate:modelValue":y0[10]||(y0[10]=o2=>f1.value=o2),type:"textarea",rows:2,placeholder:"描述你想要的内容,按 Enter 发送,Shift+Enter 换行",resize:"none",onKeydown:n0,onPaste:y0[11]||(y0[11]=vue.withModifiers(()=>{},["stop"])),onKeyup:y0[12]||(y0[12]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"])])])):vue.createCommentVNode("",!0),vue.createVNode(TemplateDialog,{modelValue:A1.value,"onUpdate:modelValue":y0[13]||(y0[13]=o2=>A1.value=o2),onSelect:e0},null,8,["modelValue"]),vue.createVNode(InfographicDialog,{modelValue:m1.value,"onUpdate:modelValue":y0[14]||(y0[14]=o2=>m1.value=o2),onGenerate:o0},null,8,["modelValue"])])}}}),JvsDraw=_export_sfc(_sfc_main,[["__scopeId","data-v-a0044550"]]);JvsDraw.install=function(e1,n1){n1&&setConfig(n1),e1.component("JvsDraw",JvsDraw)},exports.JvsDraw=JvsDraw,exports.default=JvsDraw,exports.getDesignById=getDesignById,exports.globalConfig=globalConfig,exports.saveDesign=saveDesign,exports.setConfig=setConfig,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
5270
|
+
`})),i2=window.innerWidth/2/u1.appState.zoom-u1.appState.scrollX,o2=window.innerHeight/2/u1.appState.zoom-u1.appState.scrollY,d2=new Set(u1.elements.map(N2=>N2.id)),r2=new Map,M2=new Map,V2=new Map,d5=[...u1.elements],X2=getCommonBoundingBox(d5.filter(N2=>!N2.isDeleted));await analysisAiRenderData(a2,Date.now().toString(),i2,o2,N2=>{const r5=N2.map(P2=>{const T2={...P2};if(T2.id&&d2.has(T2.id)&&!r2.has(T2.id)&&r2.set(T2.id,nanoid()),r2.has(T2.id)&&(T2.id=r2.get(T2.id)),T2.startBinding?.elementId&&r2.has(T2.startBinding.elementId)&&(T2.startBinding={...T2.startBinding,elementId:r2.get(T2.startBinding.elementId)}),T2.endBinding?.elementId&&r2.has(T2.endBinding.elementId)&&(T2.endBinding={...T2.endBinding,elementId:r2.get(T2.endBinding.elementId)}),T2.containerId&&r2.has(T2.containerId)&&(T2.containerId=r2.get(T2.containerId)),T2.groupIds&&(T2.groupIds=T2.groupIds.map(F2=>(V2.has(F2)||V2.set(F2,nanoid()),V2.get(F2)))),T2.compoundGroupId&&(M2.has(T2.compoundGroupId)||M2.set(T2.compoundGroupId,nanoid()),T2.compoundGroupId=M2.get(T2.compoundGroupId)),T2.compoundGroupOps){const F2={};for(const[H5,F5]of Object.entries(T2.compoundGroupOps))M2.has(H5)||M2.set(H5,nanoid()),F2[M2.get(H5)]=F5;T2.compoundGroupOps=F2}return T2});if(X2){const P2=getCommonBoundingBox(r5);if(P2){const F2=X2.x+X2.width+40-P2.x,H5=X2.y+X2.height+40-P2.y;if(P2.x<X2.x+X2.width+40&&P2.x+P2.width>X2.x-40&&P2.y<X2.y+X2.height+40&&P2.y+P2.height>X2.y-40){const j2=X2.x+X2.width+40-P2.x;r5.forEach(u5=>{u5.x+=j2})}}}u1.elements=[...d5,...r5],vue.nextTick(()=>{const P2=getCommonBoundingBox(r5);if(P2){const T2=u1.appState.zoom,F2=document.querySelector(".jvs-draw-container")?.clientWidth||window.innerWidth,H5=document.querySelector(".jvs-draw-container")?.clientHeight||window.innerHeight,F5=P2.x+P2.width/2,j2=P2.y+P2.height/2;u1.appState.scrollX=F2/2/T2-F5,u1.appState.scrollY=H5/2/T2-j2}})},()=>{}),u1.recordHistory(),elementPlus.ElMessage.success(`成功加载模板: ${H0}`)}catch(y0){elementPlus.ElMessage.error(`加载模板失败: ${y0.message}`)}finally{s1()}},o0=H0=>{try{const y0=document.querySelector(".jvs-draw-container")?.clientWidth||window.innerWidth,_0=document.querySelector(".jvs-draw-container")?.clientHeight||window.innerHeight,a2=y0/2/u1.appState.zoom-u1.appState.scrollX,i2=_0/2/u1.appState.zoom-u1.appState.scrollY,o2=infographicToElements(H0,a2,i2);if(o2.length===0){elementPlus.ElMessage.warning("DSL 数据为空,未生成任何元素");return}console.log("[debug-app] newElements count:",o2.length),o2.forEach(r2=>{(r2.type==="ellipse"||r2.type==="line")&&console.log(`[debug-app] newElement type: ${r2.type}, id: ${r2.id}, strokeWidth: ${r2.strokeWidth}`)}),u1.elements=[...u1.elements,...o2],console.log("[debug-app] store.elements after assign:",u1.elements.filter(r2=>o2.some(M2=>M2.id===r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth})));const d2=o2.map(r2=>r2.id);d2.length>=2&&(u1.groupElements(d2),console.log("[debug-app] store.elements after group:",u1.elements.filter(r2=>d2.includes(r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth})))),u1.setSelectedElementIds(d2),u1.recordHistory(),console.log("[debug-app] store.elements after select & history:",u1.elements.filter(r2=>d2.includes(r2.id)).map(r2=>({type:r2.type,id:r2.id,strokeWidth:r2.strokeWidth}))),vue.nextTick(()=>{const r2=getCommonBoundingBox(o2);r2&&(u1.appState.scrollX=y0/2/u1.appState.zoom-(r2.x+r2.width/2),u1.appState.scrollY=_0/2/u1.appState.zoom-(r2.y+r2.height/2))}),elementPlus.ElMessage.success("信息图已生成")}catch(y0){elementPlus.ElMessage.error(`生成失败: ${y0.message}`)}};a1.initialData&&(u1.appConfig.initialData=a1.initialData),a1.loadFromLocal!==void 0&&(u1.appConfig.loadFromLocal=a1.loadFromLocal);const w0=()=>{const H0={elements:JSON.parse(JSON.stringify(u1.elements)),appState:JSON.parse(JSON.stringify(u1.appState))};return delete H0.appState.scrollX,delete H0.appState.scrollY,delete H0.appState.zoom,delete H0.appState.activeTool,delete H0.appState.activeToolType,delete H0.appState.showHelp,delete H0.appState.isPanningCanvas,delete H0.appState.isDraggingElement,delete H0.appState.isBoxSelecting,delete H0.appState.showGrid,delete H0.appState.isPropertiesPanelOpen,delete H0.appState.isShapeLibraryOpen,delete H0.appState.floatingToolbarOffset,delete H0.appState.selectedElementIds,H0},P0=H0=>{u1.updateCanvasData(H0)},B0=H0=>{H0&&(u1.appConfig=Object.assign(u1.appConfig,H0))},R0=H0=>{const y0=Array.isArray(H0)&&H0.length>0?H0:u1.elements;exportToImage(y0,{viewBackgroundColor:"transparent",gridType:u1.appState.gridType,images:u1.images})},_1=async()=>{try{const H0=w0(),y0=urlParsParams(window.location.href),_0={id:y0?.id||"",identification:y0?.scene||"default",businessId:y0?.businessId||"",fileName:u1.appState.name,displayName:u1.appState.name,fileType:y0?.scene||"canvas_scene",source:"GENERATE",summary:JSON.stringify(H0)};await saveDesign("/api",_0),elementPlus.ElMessage.success("画板保存成功!")}catch(H0){elementPlus.ElMessage.error(H0.message||"画布保存异常失败")}},C0=H0=>{const y0=Array.isArray(H0)&&H0.length>0?H0:u1.elements;exportToSVG(y0,{viewBackgroundColor:"transparent",images:u1.images})},g0=()=>{const H0=u1.elements.filter(r2=>!r2.isDeleted),y0={};H0.forEach(r2=>{if(r2.type==="image"&&r2.fileId){const M2=u1.images[r2.fileId];M2&&(y0[r2.fileId]=M2)}});const _0={type:"jvs-draw",version:1,elements:H0,appState:{viewBackgroundColor:u1.appState.viewBackgroundColor,gridType:u1.appState.gridType},files:y0},a2=JSON.stringify(_0,null,2),i2=new Blob([a2],{type:"application/json"}),o2=URL.createObjectURL(i2),d2=document.createElement("a");d2.href=o2,d2.download=(u1.appState.name||"jvs-draw")+".json",d2.click(),URL.revokeObjectURL(o2)};n1({getCanvasData:w0,setCanvasData:P0,setConfig:B0,exportImage:R0,exportSVG:C0,applyCollabAction:H0=>{applyRemoteAction(u1,H0)}});const p0=(H0,y0)=>{if(typeof document>"u"||document.getElementById(y0))return;const _0="<svg>",a2="</svg>",i2=H0.indexOf(_0),o2=H0.indexOf(a2);if(i2!==-1&&o2!==-1){const d2=H0.substring(i2,o2+a2.length),r2=document.createElement("div");r2.innerHTML=d2;const M2=r2.querySelector("svg");M2&&(M2.id=y0,M2.setAttribute("aria-hidden","true"),M2.style.position="absolute",M2.style.width="0",M2.style.height="0",M2.style.overflow="hidden",document.body&&document.body.insertBefore(M2,document.body.firstChild))}};vue.onMounted(()=>{p0(iconfontRaw,"jvs-draw-svg-iconfont"),p0(publicIconfontRaw,"jvs-draw-svg-public-iconfont"),window.addEventListener("jvs-draw:close-ai-dialog",Q1);const H0=urlParsParams(window.location.href);H0&&H0?.sse&&H0?.id&&(B0({loadFromLocal:!1,editable:!1}),y1.value=!0,window.parent.postMessage({type:"get_draw_list",id:H0.id},"*"),window.addEventListener("message",W0)),globalConfig.applyRemoteAction=y0=>{applyRemoteAction(u1,y0)},u1.recordHistory(),u1.initImages(),S1.value=!0});async function W0(H0){const y0=urlParsParams(window.location.href);let _0=null;const a2=new Set(u1.elements.map(r2=>r2.id)),i2=new Map,o2=new Map,d2=new Map;if(H0.data.type=="draw_ai_data")if(H1.value=H0.data.data.isFinish,!H1.value)r1(),g1.value=!0,E1.value=H0.data.data.list;else{g1.value=!1,s1(),G0(y0.id);return}if(H0.data.type=="draw_ai_data_item"&&(E1.value.push(H0.data.data),H0.data.isFinish&&(g1.value=!1,s1())),!H1.value){const r2=H0.data?.isFinish===!0,M2=window.innerWidth/2/u1.appState.zoom-u1.appState.scrollX,V2=window.innerHeight/2/u1.appState.zoom-u1.appState.scrollY;await analysisAiRenderData(E1.value,y0?.id,M2,V2,d5=>{const X2=d5.find(r5=>r5.type==="frame");X2&&!_0&&(_0=X2.id);const N2=d5.map(r5=>{const P2={...r5};if(P2.id&&a2.has(P2.id)&&!i2.has(P2.id)&&i2.set(P2.id,nanoid()),i2.has(P2.id)&&(P2.id=i2.get(P2.id)),P2.startBinding?.elementId&&i2.has(P2.startBinding.elementId)&&(P2.startBinding={...P2.startBinding,elementId:i2.get(P2.startBinding.elementId)}),P2.endBinding?.elementId&&i2.has(P2.endBinding.elementId)&&(P2.endBinding={...P2.endBinding,elementId:i2.get(P2.endBinding.elementId)}),P2.containerId&&i2.has(P2.containerId)&&(P2.containerId=i2.get(P2.containerId)),P2.groupIds&&(P2.groupIds=P2.groupIds.map(T2=>(d2.has(T2)||d2.set(T2,nanoid()),d2.get(T2)))),P2.compoundGroupId&&(o2.has(P2.compoundGroupId)||o2.set(P2.compoundGroupId,nanoid()),P2.compoundGroupId=o2.get(P2.compoundGroupId)),P2.compoundGroupOps){const T2={};for(const[F2,H5]of Object.entries(P2.compoundGroupOps))o2.has(F2)||o2.set(F2,nanoid()),T2[o2.get(F2)]=H5;P2.compoundGroupOps=T2}return P2});u1.elements=[...N2],r2&&u1.recordHistory()},d5=>{w1.value=d5,vue.nextTick(()=>{D1.value&&(D1.value.scrollTop=D1.value.scrollHeight)})})}}function G0(H0){getFileInfo("/jvs-ai",H0).then(y0=>{console.log(y0)})}return vue.onUnmounted(()=>{window.removeEventListener("message",W0),window.removeEventListener("jvs-draw:close-ai-dialog",Q1)}),(H0,y0)=>{const _0=vue.resolveComponent("el-input"),a2=vue.resolveComponent("el-popover"),i2=vue.resolveComponent("el-scrollbar");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createVNode(ShapeLibraryDrawer),vue.createElementVNode("div",_hoisted_2,[vue.unref(u1).appConfig.showToolbar!==!1&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(Toolbar,{key:0})):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showPropertiesPanel!==!1&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(PropertiesPanel,{key:1})):vue.createCommentVNode("",!0),(vue.unref(u1).appConfig.showBoardName!==!1||vue.unref(u1).appConfig.showGlobalSettings!==!1)&&vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(BoardName,{key:2,showExport:vue.unref(u1).appConfig.showExport!==!1},null,8,["showExport"])):vue.createCommentVNode("",!0),S1.value?(vue.openBlock(),vue.createBlock(ExcalidrawCanvas,{key:3,elements:vue.unref(u1).elements,zoom:vue.unref(u1).appState.zoom,scrollX:vue.unref(u1).appState.scrollX,scrollY:vue.unref(u1).appState.scrollY},null,8,["elements","zoom","scrollX","scrollY"])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(EmptyState,{key:4})):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1?(vue.openBlock(),vue.createBlock(FloatingPropertiesBar,{key:5,zoom:vue.unref(u1).appState.zoom,scrollX:vue.unref(u1).appState.scrollX,scrollY:vue.unref(u1).appState.scrollY},null,8,["zoom","scrollX","scrollY"])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showFooter!==!1?(vue.openBlock(),vue.createBlock(Footer,{key:6})):vue.createCommentVNode("",!0),vue.createVNode(HelpDialog),vue.unref(u1).appConfig.editable!==!1&&vue.unref(u1).appConfig.showWatermark!==!1?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[...y0[15]||(y0[15]=[vue.createElementVNode("a",{href:"https://bctools.cn/",target:"_blank",rel:"noopener noreferrer"}," 技术支持: 软开企服(bctools.cn) ↗ ",-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.editable!==!1&&vue.unref(u1).appConfig.showToolbar!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:8,class:"top-right-actions",style:vue.normalizeStyle({right:vue.unref(u1).appState.isPropertiesPanelOpen?"345px":"24px"})},[y1.value?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"action-btn template-btn",onClick:_1,title:"保存"},[...y0[16]||(y0[16]=[vue.createElementVNode("svg",{class:"svg-icon",viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M163.712 83.968h694.336c45.12 0 81.728 36.608 81.6 81.728v694.272c0 45.056-36.48 81.6-81.6 81.6H163.648c-44.992 0-81.6-36.48-81.6-81.6V165.568c0-44.992 36.48-81.6 81.664-81.6z m694.336 779.712a3.712 3.712 0 0 0 3.712-3.712h0.32V165.696a3.712 3.712 0 0 0-3.776-3.712h-74.24v272.96c0 43.072-34.944 78.016-78.08 78.016H316.16a78.08 78.08 0 0 1-78.016-78.08V162.048H163.84a3.712 3.712 0 0 0-3.776 3.712v694.272c0 2.048 1.664 3.712 3.712 3.712h694.272z m-152.256-428.8V162.048h-389.76v272.96h389.76zM588.8 339.2q5.056 0 9.984-0.96 4.928-1.024 9.6-2.944t8.832-4.736q4.224-2.816 7.808-6.4 3.52-3.52 6.4-7.68 2.752-4.224 4.672-8.896 1.92-4.672 2.944-9.6Q640 293.12 640 288t-0.96-9.984q-1.024-4.928-2.944-9.6t-4.736-8.832q-2.816-4.224-6.4-7.808-3.52-3.52-7.68-6.4-4.224-2.752-8.896-4.672-4.672-1.92-9.6-2.944Q593.856 236.8 588.8 236.8t-9.984 0.96q-4.928 1.024-9.6 2.944t-8.896 4.736q-4.16 2.816-7.68 6.4-3.584 3.52-6.4 7.68-2.816 4.224-4.736 8.896-1.92 4.672-2.944 9.6Q537.6 282.88 537.6 288t0.96 9.984q1.024 4.928 2.944 9.6t4.736 8.832q2.816 4.224 6.4 7.808 3.52 3.52 7.68 6.4 4.224 2.752 8.896 4.672 4.672 1.92 9.6 2.944 4.928 0.96 9.984 0.96z",fill:"#363B4C","p-id":"23168"})],-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showAI?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"action-btn ai-btn",onClick:y0[0]||(y0[0]=o2=>vue.unref(u1).setTool("aidraw")),title:"AI 绘制"},[...y0[17]||(y0[17]=[vue.createElementVNode("svg",{width:"24",height:"24"},[vue.createElementVNode("use",{"xlink:href":"#icon-AI"})],-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showTemplate!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:"action-btn template-btn",onClick:y0[1]||(y0[1]=o2=>A1.value=!0),title:"模板库"},[...y0[18]||(y0[18]=[vue.createElementVNode("svg",{width:"24",height:"24"},[vue.createElementVNode("use",{"xlink:href":"#icon-mobanku"})],-1),vue.createElementVNode("span",{class:"template-text",style:{"font-size":"14px","font-weight":"bold",color:"#1E6FFF"}},"模板库",-1)])])):vue.createCommentVNode("",!0),vue.unref(u1).appConfig.showInfographic!==!1?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:"action-btn template-btn",onClick:y0[2]||(y0[2]=o2=>m1.value=!0),title:"信息图"},[...y0[19]||(y0[19]=[vue.createStaticVNode('<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-e4ea1bab><rect x="2" y="6" width="5" height="12" rx="1" fill="#3b82f6" data-v-e4ea1bab></rect><rect x="9" y="6" width="5" height="12" rx="1" fill="#22d3ee" data-v-e4ea1bab></rect><rect x="16" y="6" width="5" height="12" rx="1" fill="#f97316" data-v-e4ea1bab></rect><path d="M6 12L10 12" stroke="#3b82f6" stroke-width="1.5" data-v-e4ea1bab></path><path d="M13 12L17 12" stroke="#22d3ee" stroke-width="1.5" data-v-e4ea1bab></path></svg><span class="template-text" style="font-size:14px;font-weight:bold;color:#1E6FFF;" data-v-e4ea1bab>信息图</span>',2)])])):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["action-group",{"is-searching":W1.value}])},[vue.createVNode(a2,{visible:M1.value,ref:"searchPopover",placement:"bottom-end",width:266,trigger:"manual","popper-class":"search-results-popper","show-arrow":!1,offset:12},{reference:vue.withCtx(()=>[vue.createElementVNode("div",{class:"search-container",onClick:y0[5]||(y0[5]=vue.withModifiers(()=>{},["stop"]))},[vue.createElementVNode("div",{class:"action-btn search-toggle",onClick:vue.withModifiers(R1,["stop"]),title:"搜索"},[...y0[20]||(y0[20]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-sousuo"})],-1)])]),vue.createElementVNode("div",_hoisted_4,[vue.createVNode(_0,{ref_key:"searchInputRef",ref:O1,modelValue:V1.value,"onUpdate:modelValue":y0[3]||(y0[3]=o2=>V1.value=o2),placeholder:"搜索文字内容...",onInput:z1,onFocus:j1,onKeydown:[vue.withKeys(I1,["esc"]),vue.withKeys(T1,["enter"])],onClick:y0[4]||(y0[4]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"]),vue.createElementVNode("div",{class:"search-close-icon",onClick:vue.withModifiers(I1,["stop"])},[...y0[21]||(y0[21]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-guanbi"})],-1)])])])])]),default:vue.withCtx(()=>[B1.value.length>0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_5,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(B1.value,o2=>(vue.openBlock(),vue.createElementBlock("div",{key:o2.id,class:"search-result-item",onClick:d2=>Y1(o2)},[vue.createElementVNode("div",_hoisted_7,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_8,[vue.createElementVNode("use",{"xlink:href":G1(o2)},null,8,_hoisted_9)]))]),vue.createElementVNode("div",_hoisted_10,[vue.createElementVNode("div",_hoisted_11,vue.toDisplayString(o2.type==="text"?o2.text:o2.name),1),vue.createElementVNode("div",_hoisted_12,vue.toDisplayString(X1(o2)),1)])],8,_hoisted_6))),128))])):(vue.openBlock(),vue.createElementBlock("div",_hoisted_13," 未找到相关内容 "))]),_:1},8,["visible"]),y0[26]||(y0[26]=vue.createElementVNode("div",{class:"separator-line"},null,-1)),vue.createVNode(a2,{placement:"bottom-end",width:140,trigger:"click","popper-class":"export-popover","show-arrow":!1,offset:12},{reference:vue.withCtx(()=>[...y0[22]||(y0[22]=[vue.createElementVNode("div",{class:"action-btn",title:"导出"},[vue.createElementVNode("svg",{class:"svg-icon",viewBox:"0 0 24 24"},[vue.createElementVNode("use",{"xlink:href":"#icon-daochu"})])],-1)])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_14,[vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[6]||(y0[6]=o2=>R0())},[...y0[23]||(y0[23]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-tupian1"})],-1),vue.createElementVNode("span",null,"导出图片",-1)])]),vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[7]||(y0[7]=o2=>C0())},[...y0[24]||(y0[24]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-svg"})],-1),vue.createElementVNode("span",null,"导出SVG",-1)])]),vue.createElementVNode("div",{class:"export-menu-item",onClick:y0[8]||(y0[8]=o2=>g0())},[...y0[25]||(y0[25]=[vue.createElementVNode("svg",{class:"svg-icon"},[vue.createElementVNode("use",{"xlink:href":"#icon-daoruwendang"})],-1),vue.createElementVNode("span",null,"导出数据",-1)])])])]),_:1})],2)],4)):vue.createCommentVNode("",!0),(g1.value,vue.createCommentVNode("",!0)),vue.withDirectives(vue.createElementVNode("div",_hoisted_17,[...y0[28]||(y0[28]=[vue.createElementVNode("div",{id:"loaidng-animiate",class:"lottie-container"},null,-1)])],512),[[vue.vShow,i1.value]])]),c1.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_18,[vue.createElementVNode("div",_hoisted_19,[y0[30]||(y0[30]=vue.createElementVNode("span",{class:"ai-panel-title"},"AI 内容生成",-1)),vue.createElementVNode("div",{class:"ai-panel-close",onClick:y0[9]||(y0[9]=o2=>c1.value=!1)},[...y0[29]||(y0[29]=[vue.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[vue.createElementVNode("path",{fill:"#909399",d:"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"})],-1)])])]),vue.createVNode(i2,{style:{height:"calc(100% - 134px)"},ref_key:"aiChatContainerRef",ref:k1},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_20,[b1.value.length===0?(vue.openBlock(),vue.createElementBlock("div",_hoisted_21,[...y0[31]||(y0[31]=[vue.createElementVNode("p",null,"描述你想要生成的内容,AI 将为你自动绘制",-1)])])):vue.createCommentVNode("",!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(b1.value,(o2,d2)=>(vue.openBlock(),vue.createElementBlock("div",{key:d2,class:vue.normalizeClass(["ai-chat-bubble",o2.role==="user"?"ai-chat-bubble-user":"ai-chat-bubble-assistant"])},[vue.createElementVNode("div",_hoisted_22,[o2.role==="assistant"?(vue.openBlock(),vue.createElementBlock("svg",_hoisted_23,[...y0[32]||(y0[32]=[vue.createElementVNode("rect",{width:"24",height:"24",rx:"6",fill:"#1E6FFF"},null,-1),vue.createElementVNode("text",{x:"12",y:"17","text-anchor":"middle",fill:"#fff","font-size":"13","font-weight":"bold"},"AI",-1)])])):(vue.openBlock(),vue.createElementBlock("svg",_hoisted_24,[...y0[33]||(y0[33]=[vue.createElementVNode("rect",{width:"24",height:"24",rx:"6",fill:"#67c23a"},null,-1),vue.createElementVNode("text",{x:"12",y:"17","text-anchor":"middle",fill:"#fff","font-size":"13","font-weight":"bold"},"Me",-1)])]))]),vue.createElementVNode("div",_hoisted_25,[o2.role==="assistant"&&g1.value&&d2===b1.value.length-1&&!o2.content?(vue.openBlock(),vue.createElementBlock("span",_hoisted_26,"AI 正在生成图表...")):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createTextVNode(vue.toDisplayString(o2.content),1)],64))])],2))),128))])]),_:1},512),vue.createElementVNode("div",_hoisted_27,[vue.createVNode(_0,{ref_key:"aiInputRef",ref:p1,modelValue:f1.value,"onUpdate:modelValue":y0[10]||(y0[10]=o2=>f1.value=o2),type:"textarea",rows:2,placeholder:"描述你想要的内容,按 Enter 发送,Shift+Enter 换行",resize:"none",onKeydown:n0,onPaste:y0[11]||(y0[11]=vue.withModifiers(()=>{},["stop"])),onKeyup:y0[12]||(y0[12]=vue.withModifiers(()=>{},["stop"]))},null,8,["modelValue"])])])):vue.createCommentVNode("",!0),vue.createVNode(TemplateDialog,{modelValue:A1.value,"onUpdate:modelValue":y0[13]||(y0[13]=o2=>A1.value=o2),onSelect:e0},null,8,["modelValue"]),vue.createVNode(InfographicDialog,{modelValue:m1.value,"onUpdate:modelValue":y0[14]||(y0[14]=o2=>m1.value=o2),onGenerate:o0},null,8,["modelValue"])])}}}),JvsDraw=_export_sfc(_sfc_main,[["__scopeId","data-v-e4ea1bab"]]);JvsDraw.install=function(e1,n1){n1&&setConfig(n1),e1.component("JvsDraw",JvsDraw)},exports.JvsDraw=JvsDraw,exports.default=JvsDraw,exports.getDesignById=getDesignById,exports.globalConfig=globalConfig,exports.saveDesign=saveDesign,exports.setConfig=setConfig,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|