zforg 1.0.20 → 1.0.21
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/{index-CHjvfWWi.js → index-BknsMZjh.js} +1 -1
- package/dist/{index-B5LRVoG6.js → index-C1_q8olg.js} +1 -1
- package/dist/{index-DoNFbPKB.js → index-D32GzqBv.js} +1 -1
- package/dist/{index-Mx1h2ApK.js → index-DHpcNax4.js} +1 -1
- package/dist/{index-DvRif3ay.js → index-Dm_o7B9Z.js} +4 -3
- package/dist/{index-iEpSkmbs.js → index-Duf53snG.js} +1 -1
- package/dist/{index-D8aU2rsu.js → index-L7Oaz3q4.js} +1 -1
- package/dist/{index-CCGIRRRb.js → index-jOQApkRH.js} +1 -1
- package/dist/sun-form-v3.es.js +1 -1
- package/dist/sun-form-v3.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as S, ref as C, resolveComponent as p, openBlock as U, createElementBlock as k, Fragment as O, createVNode as e, withCtx as l, createTextVNode as g, isRef as J, unref as i, createElementVNode as f } from "vue";
|
|
2
|
-
import { aR as T } from "./index-
|
|
2
|
+
import { aR as T } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const E = { class: "h-full flex flex-col" }, H = { class: "flex-1 overflow-hidden" }, B = {
|
|
4
4
|
__name: "dataConfig",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as z, ref as x, resolveComponent as p, openBlock as k, createElementBlock as U, Fragment as O, createVNode as e, withCtx as l, createTextVNode as V, isRef as J, unref as u, createElementVNode as m } from "vue";
|
|
2
|
-
import { aR as E, aT as H } from "./index-
|
|
2
|
+
import { aR as E, aT as H } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const T = { class: "h-full flex flex-col" }, h = { class: "flex-1 overflow-hidden" }, B = /* @__PURE__ */ Object.assign({ name: "commonStyleConfig" }, {
|
|
4
4
|
__name: "dataConfig",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as S, ref as C, resolveComponent as u, openBlock as k, createElementBlock as O, Fragment as U, createVNode as e, withCtx as l, createTextVNode as f, isRef as J, unref as i, createElementVNode as c } from "vue";
|
|
2
|
-
import { aR as E } from "./index-
|
|
2
|
+
import { aR as E } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const H = { class: "h-full flex flex-col" }, B = { class: "flex-1 overflow-hidden" }, R = {
|
|
4
4
|
__name: "dataConfig",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as k, resolveComponent as V, openBlock as b, createElementBlock as H, Fragment as j, createVNode as e, unref as l, withCtx as a, createTextVNode as v, isRef as A, createElementVNode as w, toDisplayString as F, createCommentVNode as T, createBlock as S, renderList as $ } from "vue";
|
|
2
|
-
import { aR as q } from "./index-
|
|
2
|
+
import { aR as q } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const J = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex h-full flex-col"
|
|
@@ -110885,7 +110885,8 @@ const Kqt = { class: "ai-chat-container !w-full max-w-full" }, Xqt = { class: "c
|
|
|
110885
110885
|
}
|
|
110886
110886
|
(typeof window.require > "u" || !window.__MONACO_CONFIGURED__) && (window.__MONACO_CONFIGURED__ = !0, require.config({
|
|
110887
110887
|
paths: {
|
|
110888
|
-
vs: "
|
|
110888
|
+
vs: "/cdn.sunform.tech/libs/monaco-editor/min/vs"
|
|
110889
|
+
//http://cdn.sunform.tech/libs/monaco-editor/min/vs
|
|
110889
110890
|
}
|
|
110890
110891
|
})), require(["vs/editor/editor.main"], function() {
|
|
110891
110892
|
S();
|
|
@@ -287477,7 +287478,7 @@ const QYn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
287477
287478
|
"@element-plus/icons-vue": _Rt,
|
|
287478
287479
|
//"vue-plugin-hiprint":HiPrint,
|
|
287479
287480
|
echarts: Tyn,
|
|
287480
|
-
"echarts-gl": () => import("./index-
|
|
287481
|
+
"echarts-gl": () => import("./index-L7Oaz3q4.js"),
|
|
287481
287482
|
//vxe-table的注册
|
|
287482
287483
|
"vxe-table": W$n,
|
|
287483
287484
|
"vxe-pc-ui": gat,
|
|
@@ -294594,7 +294595,7 @@ ${F.value}`, id: Date.now(), timestamp: (/* @__PURE__ */ new Date()).toISOString
|
|
|
294594
294595
|
},
|
|
294595
294596
|
setup(t) {
|
|
294596
294597
|
const n = Object.fromEntries(
|
|
294597
|
-
Object.entries(/* @__PURE__ */ Object.assign({ "../widgetConfigComps/config-alert/index.vue": () => import("./index-ZVIqhtUw.js"), "../widgetConfigComps/config-button/index.vue": () => import("./index-CvnfmMTc.js"), "../widgetConfigComps/config-card/index.vue": () => import("./index-BJ0vPF5A.js"), "../widgetConfigComps/config-cascader/index.vue": () => import("./index-BcUJtkEW.js"), "../widgetConfigComps/config-checkCode/index.vue": () => import("./index-kUQct_cM.js"), "../widgetConfigComps/config-checkbox/index.vue": () => import("./index-B2ieNi21.js"), "../widgetConfigComps/config-codeEditor/index.vue": () => import("./index-CzkuANsf.js"), "../widgetConfigComps/config-datatable/index.vue": () => import("./index-
|
|
294598
|
+
Object.entries(/* @__PURE__ */ Object.assign({ "../widgetConfigComps/config-alert/index.vue": () => import("./index-ZVIqhtUw.js"), "../widgetConfigComps/config-button/index.vue": () => import("./index-CvnfmMTc.js"), "../widgetConfigComps/config-card/index.vue": () => import("./index-BJ0vPF5A.js"), "../widgetConfigComps/config-cascader/index.vue": () => import("./index-BcUJtkEW.js"), "../widgetConfigComps/config-checkCode/index.vue": () => import("./index-kUQct_cM.js"), "../widgetConfigComps/config-checkbox/index.vue": () => import("./index-B2ieNi21.js"), "../widgetConfigComps/config-codeEditor/index.vue": () => import("./index-CzkuANsf.js"), "../widgetConfigComps/config-datatable/index.vue": () => import("./index-DHpcNax4.js"), "../widgetConfigComps/config-date/index.vue": () => import("./index-C0NmmaE2.js"), "../widgetConfigComps/config-div/index.vue": () => import("./index-BAEL_Fhr.js"), "../widgetConfigComps/config-dropdown/index.vue": () => import("./index-BZ_40krq.js"), "../widgetConfigComps/config-echarts/index.vue": () => import("./index-Duf53snG.js"), "../widgetConfigComps/config-editor/index.vue": () => import("./index-CXNYHPLK.js"), "../widgetConfigComps/config-file/index.vue": () => import("./index-nY_E-1Gm.js"), "../widgetConfigComps/config-flowForm/index.vue": () => import("./index-CHAFY_vi.js"), "../widgetConfigComps/config-form/index.vue": () => import("./index-CIaeKFCl.js"), "../widgetConfigComps/config-homepage/index.vue": () => import("./index-CifChfEv.js"), "../widgetConfigComps/config-iframe/index.vue": () => import("./index-BkftF1Ew.js"), "../widgetConfigComps/config-image/index.vue": () => import("./index-dGJDj4ro.js"), "../widgetConfigComps/config-input/index.vue": () => import("./index-kzElMYkk.js"), "../widgetConfigComps/config-layout/index.vue": () => import("./index-FVwll8uc.js"), "../widgetConfigComps/config-modal/index.vue": () => import("./index-DlozHxdf.js"), "../widgetConfigComps/config-modal2/index.vue": () => import("./index-D7zr1ztZ.js"), "../widgetConfigComps/config-progress/index.vue": () => import("./index-c0zw96Jm.js"), "../widgetConfigComps/config-qrcode/index.vue": () => import("./index-DHjsGntq.js"), "../widgetConfigComps/config-radio/index.vue": () => import("./index-DYFp4hH-.js"), "../widgetConfigComps/config-rate/index.vue": () => import("./index-B0fldwhm.js"), "../widgetConfigComps/config-select/index.vue": () => import("./index-B1b5cejN.js"), "../widgetConfigComps/config-selects/index.vue": () => import("./index-CE0gDB6E.js"), "../widgetConfigComps/config-slot/index.vue": () => import("./index-HNpIFY7h.js"), "../widgetConfigComps/config-statistic/index.vue": () => import("./index-C1_q8olg.js"), "../widgetConfigComps/config-steps/index.vue": () => import("./index-D32GzqBv.js"), "../widgetConfigComps/config-switch/index.vue": () => import("./index-Dag4zSq7.js"), "../widgetConfigComps/config-tag/index.vue": () => import("./index-jOQApkRH.js"), "../widgetConfigComps/config-text/index.vue": () => import("./index-BYbxnzUx.js"), "../widgetConfigComps/config-time/index.vue": () => import("./index-zkXVDNsL.js"), "../widgetConfigComps/config-timeline/index.vue": () => import("./index-BknsMZjh.js"), "../widgetConfigComps/config-title/index.vue": () => import("./index-C78PiK5v.js"), "../widgetConfigComps/config-transfer/index.vue": () => import("./index-DQ3y00Pa.js") })).map(([F, B]) => {
|
|
294598
294599
|
const U = F.match(/\/([^/]+)\/index\.vue$/);
|
|
294599
294600
|
return [U ? U[1] : null, mat(B)];
|
|
294600
294601
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed as j, ref as g, onMounted as $, resolveComponent as f, openBlock as v, createElementBlock as h, Fragment as x, createVNode as u, withCtx as o, createTextVNode as C, createElementVNode as a, renderList as B, unref as V, toDisplayString as N, nextTick as S, createBlock as U } from "vue";
|
|
2
|
-
import { aS as D, c as E } from "./index-
|
|
2
|
+
import { aS as D, c as E } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const M = { class: "flex-wrap flex" }, R = ["onClick"], T = { class: "inner cursor-pointer hover:shadow-md hover:shadow-blue-200 border w-full h-full p-1 flex flex-col overflow-hidden items-center rounded-md shadow-sm" }, z = { class: "lab border-t w-full text-center mt-1 font-bold" }, F = /* @__PURE__ */ Object.assign({ name: "chatChoose" }, {
|
|
4
4
|
__name: "chartChoose",
|
|
5
5
|
props: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as ze, i as Ys, a as Ks, b as $s, r as Qs, c as Bo, A as si, C as st, d as ar, e as Dr, S as ct, M as li, P as Js, f as lt, g as el, h as tl, j as rl, k as il, l as nl, m as al, n as ol, o as sl, p as ll, q as hl, s as ul, t as fl, v as cl, w as Qn, x as dl, y as vl, z as Ii, B as pl, D as ml, E as Jn, F as gl, G as _l, H as Bi, I as yl, J as xl, K as Tl, L as wl, N as Sl, O as bl, Q as El, R as Al, T as Ll, U as Ml, V as Dl, W as Cl, X as Pl, Y as Nl, Z as Rl, _ as Ol, $ as Il, a0 as Bl, a1 as Fl, a2 as zl, a3 as Gl, a4 as Ul, a5 as xt, a6 as xa, a7 as Hl, a8 as Vl, a9 as Fo, aa as zo, ab as kl, ac as Fn, ad as Tt, ae as Wl, af as se, ag as zt, ah as Xl, ai as Go, aj as Fi, ak as zi, al as Uo, am as Ho, an as Vo, ao as $i, ap as ea, aq as jl, ar as Zl, as as ql, at as Yl, au as hi, av as ta, aw as Kl, ax as $l, ay as Ql, az as Jl, aA as ra, aB as eh, aC as mr, aD as Ta, aE as th, aF as rh, aG as ih, aH as nh, aI as mi, aJ as ah, aK as oh, aL as sh, aM as ko, aN as lh, aO as hh, aP as wa, aQ as Sa } from "./index-
|
|
1
|
+
import { u as ze, i as Ys, a as Ks, b as $s, r as Qs, c as Bo, A as si, C as st, d as ar, e as Dr, S as ct, M as li, P as Js, f as lt, g as el, h as tl, j as rl, k as il, l as nl, m as al, n as ol, o as sl, p as ll, q as hl, s as ul, t as fl, v as cl, w as Qn, x as dl, y as vl, z as Ii, B as pl, D as ml, E as Jn, F as gl, G as _l, H as Bi, I as yl, J as xl, K as Tl, L as wl, N as Sl, O as bl, Q as El, R as Al, T as Ll, U as Ml, V as Dl, W as Cl, X as Pl, Y as Nl, Z as Rl, _ as Ol, $ as Il, a0 as Bl, a1 as Fl, a2 as zl, a3 as Gl, a4 as Ul, a5 as xt, a6 as xa, a7 as Hl, a8 as Vl, a9 as Fo, aa as zo, ab as kl, ac as Fn, ad as Tt, ae as Wl, af as se, ag as zt, ah as Xl, ai as Go, aj as Fi, ak as zi, al as Uo, am as Ho, an as Vo, ao as $i, ap as ea, aq as jl, ar as Zl, as as ql, at as Yl, au as hi, av as ta, aw as Kl, ax as $l, ay as Ql, az as Jl, aA as ra, aB as eh, aC as mr, aD as Ta, aE as th, aF as rh, aG as ih, aH as nh, aI as mi, aJ as ah, aK as oh, aL as sh, aM as ko, aN as lh, aO as hh, aP as wa, aQ as Sa } from "./index-Dm_o7B9Z.js";
|
|
2
2
|
ze([Ys, Ks]);
|
|
3
3
|
const uh = {
|
|
4
4
|
init: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as g, resolveComponent as u, openBlock as b, createElementBlock as V, Fragment as w, createVNode as e, withCtx as n, unref as a } from "vue";
|
|
2
|
-
import { aT as c } from "./index-
|
|
2
|
+
import { aT as c } from "./index-Dm_o7B9Z.js";
|
|
3
3
|
const k = /* @__PURE__ */ Object.assign({ name: "config-text" }, {
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
package/dist/sun-form-v3.es.js
CHANGED
package/dist/sun-form-v3.umd.js
CHANGED
|
@@ -204,7 +204,7 @@ let widget = props.widget;
|
|
|
204
204
|
|
|
205
205
|
正在尝试备用连接...`,Se.isTyping=!1,await a.nextTick());try{await z(J)}catch{throw Se&&(Se.content=`很抱歉,连接失败。请检查网络连接或稍后重试。
|
|
206
206
|
|
|
207
|
-
错误详情:${de.message}`,Se.isTyping=!1,await a.nextTick(),ge()),de}}finally{clearTimeout(pe),g=null}},z=async J=>{var de,Se,we;const pe=new AbortController,ye=setTimeout(()=>pe.abort(),e.requestTimeout);try{const Ee=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F()),signal:pe.signal});if(!Ee.ok)throw new Error(`HTTP ${Ee.status}: ${Ee.statusText}`);const Q=await Ee.json();if(Q.error)throw new Error(Q.error);const fe=(we=(Se=(de=Q.choices)==null?void 0:de[0])==null?void 0:Se.message)==null?void 0:we.content;if(typeof fe!="string")throw new Error("非流式API响应格式错误");let ve="";for(let Fe=0;Fe<fe.length;Fe++){ve+=fe[Fe];const _e=s.value.find(Me=>Me.id===J.id);_e&&(_e.content=ve,await a.nextTick(),se()),await new Promise(Me=>setTimeout(Me,12))}const De=s.value.find(Fe=>Fe.id===J.id);De&&(De.isTyping=!1,ge())}finally{clearTimeout(ye)}},j=a.ref(!0);let q=0,ne=null;const X=()=>{if(!d.value)return!0;const{scrollTop:J,scrollHeight:pe,clientHeight:ye}=d.value;return pe-J-ye<CZt},re=()=>{if(d.value){if(c.value){const{scrollTop:J}=d.value;J<q?j.value=!1:X()&&(j.value=!0),q=J}else j.value=X();clearTimeout(ne),ne=setTimeout(()=>{},100)}},se=()=>{d.value&&j.value&&(d.value.scrollTop=d.value.scrollHeight)},he=()=>{s.value=[],m.value={},ie(),T(),zo.success("聊天记录已清空")},me=J=>new Date(J).toLocaleTimeString(),ge=()=>{try{localStorage.setItem(o,JSON.stringify(s.value.filter(J=>!J.isTyping)))}catch{}},te=()=>{try{const J=localStorage.getItem(o);if(J){const pe=JSON.parse(J);if(Array.isArray(pe)&&pe.length)return s.value=pe.map(ye=>({...ye,isTyping:!1})),!0}}catch{}return!1},ie=()=>{try{localStorage.removeItem(o)}catch{}},ee=()=>{const J=localStorage.getItem("ai-debug-mode");J!==null&&(p.value=J==="true");const pe=localStorage.getItem("ai-selected-model");pe&&(y.value=pe);const ye=localStorage.getItem("ai-selected-rule");ye&&(b.value=ye)};return a.watch(y,J=>{if(localStorage.setItem("ai-selected-model",J),!c.value){const pe=v.value.find(ye=>ye.value===J);pe&&zo.success(`已切换到 ${pe.label}`)}}),a.watch(b,J=>localStorage.setItem("ai-selected-rule",J)),(J,pe)=>{const ye=a.resolveComponent("el-button"),de=a.resolveComponent("el-alert"),Se=a.resolveComponent("el-input");return a.openBlock(),a.createElementBlock("div",VQt,[a.createElementVNode("div",eZt,[a.createElementVNode("div",tZt,[pe[5]||(pe[5]=a.createStaticVNode('<div class="header-title" data-v-bbb6e3cf><div class="logo-icon" data-v-bbb6e3cf><svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" data-v-bbb6e3cf><path d="M12 2a2 2 0 0 1 2 2v1h3a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h3V4a2 2 0 0 1 2-2Zm-3.5 9a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm7 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM9 16h6a.75.75 0 0 1 0 1.5H9A.75.75 0 0 1 9 16Z" data-v-bbb6e3cf></path></svg></div><span class="title-text" data-v-bbb6e3cf>AI 代码助手</span></div>',1)),a.createElementVNode("div",nZt,[a.createVNode(ye,{size:"small",text:"",onClick:he,disabled:c.value||s.value.length===0,title:"清空聊天"},{default:a.withCtx(()=>[...pe[4]||(pe[4]=[a.createTextVNode(" 🗑 清空 ",-1)])]),_:1},8,["disabled"])])]),a.createElementVNode("div",rZt,[a.createElementVNode("div",{class:a.normalizeClass(["rule-segmented",{"is-disabled":c.value}])},[a.createElementVNode("button",{class:a.normalizeClass(["seg-item",{active:b.value==="vuecode"}]),disabled:c.value,onClick:pe[0]||(pe[0]=we=>b.value="vuecode")}," 普通 Vue 代码 ",10,iZt),a.createElementVNode("button",{class:a.normalizeClass(["seg-item",{active:b.value==="reportcode"}]),disabled:c.value,onClick:pe[1]||(pe[1]=we=>b.value="reportcode")}," 报表生成器 ",10,aZt)],2)])]),a.createElementVNode("div",{class:"chat-messages w-full",ref_key:"messagesContainer",ref:d,onScroll:re},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(we,Ee)=>{var Q;return a.openBlock(),a.createElementBlock("div",{key:we.id||Ee,class:a.normalizeClass(["message",we.role==="user"?"user-message":"ai-message"])},[a.createElementVNode("div",oZt,[a.createElementVNode("div",sZt,[a.createElementVNode("div",lZt,a.toDisplayString(we.role==="user"?"用户":"AI助手"),1),a.createElementVNode("div",cZt,[we.role==="assistant"?(a.openBlock(),a.createElementBlock("button",{key:0,class:"copy-button-simple",onClick:fe=>S(we.content),title:"复制内容"}," 📋 ",8,uZt)):a.createCommentVNode("",!0),p.value&&we.timestamp?(a.openBlock(),a.createElementBlock("div",dZt,a.toDisplayString(me(we.timestamp)),1)):a.createCommentVNode("",!0)])]),we.role==="user"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-text",innerHTML:C(we.content)},null,8,fZt)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["assistant-content",{typing:we.isTyping}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(M(we.content),(fe,ve)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:ve},[fe.type==="normal"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"normal-content",innerHTML:C(fe.content)},null,8,pZt)):fe.type==="thinking"?(a.openBlock(),a.createElementBlock("div",hZt,[a.createElementVNode("div",{class:"thinking-header",onClick:De=>R(we.id,ve)},[a.createElementVNode("span",{class:a.normalizeClass([{"rotate-icon":P(we.id,ve)},"thinking-toggle"])},"►",2),pe[6]||(pe[6]=a.createElementVNode("span",null,"AI思考过程",-1)),fe.content?(a.openBlock(),a.createElementBlock("span",gZt," ("+a.toDisplayString(fe.content.length>1e3?"长内容":`${fe.content.length}字符`)+") ",1)):a.createCommentVNode("",!0)],8,mZt),a.withDirectives(a.createElementVNode("div",vZt,[a.createElementVNode("pre",null,a.toDisplayString(fe.content),1)],512),[[a.vShow,P(we.id,ve)]])])):a.createCommentVNode("",!0)],64))),128))],2)),p.value?(a.openBlock(),a.createElementBlock("div",yZt,[a.createElementVNode("div",null,"ID: "+a.toDisplayString(we.id||"N/A"),1),a.createElementVNode("div",null,"长度: "+a.toDisplayString(((Q=we.content)==null?void 0:Q.length)||0)+"字符",1),we.role==="assistant"?(a.openBlock(),a.createElementBlock("details",_Zt,[pe[7]||(pe[7]=a.createElementVNode("summary",{style:{cursor:"pointer","font-size":"12px"}},"查看原始内容",-1)),a.createElementVNode("pre",bZt,a.toDisplayString(we.content),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],2)}),128)),c.value?(a.openBlock(),a.createElementBlock("div",SZt,[...pe[8]||(pe[8]=[a.createElementVNode("span",null,null,-1),a.createElementVNode("span",null,null,-1),a.createElementVNode("span",null,null,-1)])])):a.createCommentVNode("",!0)],544),u.value?(a.openBlock(),a.createElementBlock("div",EZt,[a.createVNode(de,{title:u.value,type:"error","show-icon":"",closable:!0,onClose:pe[2]||(pe[2]=we=>u.value=null)},null,8,["title"])])):a.createCommentVNode("",!0),a.createElementVNode("div",xZt,[a.createElementVNode("div",wZt,[a.createVNode(Se,{modelValue:l.value,"onUpdate:modelValue":pe[3]||(pe[3]=we=>l.value=we),type:"textarea",rows:3,placeholder:"请输入您的问题...",disabled:c.value,onKeydown:[a.withKeys(a.withModifiers(B,["ctrl"]),["enter"]),a.withKeys(a.withModifiers(B,["meta"]),["enter"])],ref_key:"inputField",ref:f,class:"chat-input"},null,8,["modelValue","disabled","onKeydown"]),a.createElementVNode("div",TZt,[pe[11]||(pe[11]=a.createElementVNode("div",{class:"input-tips"},[a.createElementVNode("span",{class:"tip-text"},"按 Ctrl+Enter 发送")],-1)),c.value?(a.openBlock(),a.createBlock(ye,{key:1,type:"danger",onClick:k},{default:a.withCtx(()=>[...pe[10]||(pe[10]=[a.createTextVNode("停止生成",-1)])]),_:1})):(a.openBlock(),a.createBlock(ye,{key:0,type:"primary",onClick:B,disabled:!l.value.trim()},{default:a.withCtx(()=>[...pe[9]||(pe[9]=[a.createTextVNode("发送",-1)])]),_:1},8,["disabled"]))])])])])}}}),[["__scopeId","data-v-bbb6e3cf"]]),NZt={class:"flex w-full h-full bg-[#171717]","element-loading-text":"编辑器加载中","element-loading-background":"rgba(0, 0, 0, 1)"},OZt={key:0,class:"tree_wrap flex-none w-[400px] border flex"},IZt={key:0,class:"flex-1 bg-white h-full"},MZt={class:"h-full w-full flex flex-col flex-1"},RZt={key:0,class:"head py-2 px-2 box-border bg-[#191c20]"},PZt={key:0,class:"text-[#d25462] italic"},DZt={class:"text-[#d4d4d4]"},kZt={key:1,class:"footer text-[#ffd700] bg-[#2f3129] py-2 px-2"},LZt={class:"flex justify-end w-full"},Pie=Object.assign({name:"commonCodeEditor",inheritAttrs:!1},{__name:"editor",props:{modelValue:[String,null],designer:{type:Object,default:{}},width:{type:[String],default:"100%"},height:{type:[String],default:"100%"},language:{type:[String],default:"javascript"},theme:{type:[String],default:"vs-dark"},params:{type:[Array],default:[]},minimap:{type:[Boolean],default:!0},pure:{type:[Boolean],default:!1},tabSize:{type:[Number],default:4},isAsync:{type:[Boolean],default:!0},fontSize:{type:[Number],default:12}},emits:["update:modelValue","chosenWidget"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=a.ref(null);a.ref(null);const s=a.ref(!0),l=a.ref(null);let c=null,u=a.ref(0);const d=a.ref(null),f=a.ref({visible:!1,x:0,y:0}),p=a.ref(!1),m=a.ref([]),h=a.ref(null),g=N=>{const M=[];for(const[R,P]of Object.entries(N.props))M.push({key:R,value:typeof P=="object"?JSON.stringify(P):P,description:`${R} 属性`});return M},v=({cellValue:N})=>typeof N=="object"&&N!==null?JSON.stringify(N,null,2):String(N),y=async N=>{try{let M=`app.getPropsById("${l.value}").${N.key}`;navigator.clipboard&&window.isSecureContext?(await navigator.clipboard.writeText(M),r.designer.$message.success(`获取属性方法:"${M}" 已复制到剪贴板`),p.value=!1):b(M,`获取属性方法:"${M}" 已复制到剪贴板`)}catch(M){console.error("复制失败:",M);let R=`app.getPropsById("${l.value}").${N.key}`;b(R,`获取属性方法:"${R}" 已复制到剪贴板`)}},b=(N,M)=>{const R=document.createElement("textarea");R.value=N,R.style.top="0",R.style.left="0",R.style.position="fixed",R.style.opacity="0",document.body.appendChild(R),R.focus(),R.select();try{document.execCommand("copy")?(r.designer.$message.success(M),p.value=!1):r.designer.$message.error("复制失败")}catch{r.designer.$message.error("复制失败")}document.body.removeChild(R)},_=()=>{f.value.visible=!1};a.onMounted(()=>{if(typeof window.monaco<"u"){E();return}(typeof window.require>"u"||!window.__MONACO_CONFIGURED__)&&(window.__MONACO_CONFIGURED__=!0,require.config({paths:{vs:"http://cdn.sunform.tech/libs/monaco-editor/min/vs"}})),require(["vs/editor/editor.main"],function(){E()})});const E=()=>{o.value?(c=monaco.editor.create(o.value,{value:r.modelValue||"",language:r.language,theme:r.theme,automaticLayout:!0,minimap:{enabled:r.minimap},folding:!0,foldingStrategy:"auto",renderLineHighlight:"all",scrollBeyondLastLine:!1,quickSuggestions:!0,suggestOnTriggerCharacters:!0,parameterHints:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",guides:{indentation:!0},autoIndent:"full",formatOnType:!0,formatOnPaste:!0,wordWrap:"off",tabSize:r.tabSize,locale:"zh-cn",fontSize:r.fontSize,suggest:{preview:!0}}),c.addAction({id:"show-component-location",label:"显示组件所在位置",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.I],contextMenuGroupId:"navigation",contextMenuOrder:0,run:function(N){const M=N.getModel(),R=N.getSelection(),P=M.getValueInRange(R);let k=r.designer.getWidgetById(P);k&&d.value.highlightRow(k.id)}}),c.addAction({id:"show-component-properties",label:"显示组件所有属性",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.J],contextMenuGroupId:"navigation",contextMenuOrder:1,run:function(N){const M=N.getModel(),R=N.getSelection(),P=M.getValueInRange(R);let k=r.designer.getWidgetById(P);k&&(h.value=k,m.value=g(k),p.value=!0,l.value=k.id)}}),c.onMouseDown(N=>{if(N.event.rightButton){N.event.preventDefault();const M=N.event.browserEvent;f.value.x=M.clientX,f.value.y=M.clientY,f.value.visible=!0,setTimeout(()=>{document.addEventListener("click",_,{once:!0})},0)}}),c.onDidChangeModelContent(N=>{i("update:modelValue",c.getValue())}),setTimeout(()=>{w(),s.value=!1},20),a.watch(()=>r.modelValue,N=>{},{deep:!0,immediate:!0}),monaco.languages.registerCompletionItemProvider("javascript",{provideCompletionItems:function(N,M){return{suggestions:[{label:"clog",kind:monaco.languages.CompletionItemKind.Snippet,insertText:"console.log( $1 );",insertTextRules:monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"打印语句"},{label:"jp",kind:monaco.languages.CompletionItemKind.Snippet,insertText:"console.log(JSON.parse(JSON.stringify( $1 )))",insertTextRules:monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"打印原始对象"},{label:"each",kind:monaco.languages.CompletionItemKind.Snippet,insertText:`$1.forEach((e,i)=>{
|
|
207
|
+
错误详情:${de.message}`,Se.isTyping=!1,await a.nextTick(),ge()),de}}finally{clearTimeout(pe),g=null}},z=async J=>{var de,Se,we;const pe=new AbortController,ye=setTimeout(()=>pe.abort(),e.requestTimeout);try{const Ee=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F()),signal:pe.signal});if(!Ee.ok)throw new Error(`HTTP ${Ee.status}: ${Ee.statusText}`);const Q=await Ee.json();if(Q.error)throw new Error(Q.error);const fe=(we=(Se=(de=Q.choices)==null?void 0:de[0])==null?void 0:Se.message)==null?void 0:we.content;if(typeof fe!="string")throw new Error("非流式API响应格式错误");let ve="";for(let Fe=0;Fe<fe.length;Fe++){ve+=fe[Fe];const _e=s.value.find(Me=>Me.id===J.id);_e&&(_e.content=ve,await a.nextTick(),se()),await new Promise(Me=>setTimeout(Me,12))}const De=s.value.find(Fe=>Fe.id===J.id);De&&(De.isTyping=!1,ge())}finally{clearTimeout(ye)}},j=a.ref(!0);let q=0,ne=null;const X=()=>{if(!d.value)return!0;const{scrollTop:J,scrollHeight:pe,clientHeight:ye}=d.value;return pe-J-ye<CZt},re=()=>{if(d.value){if(c.value){const{scrollTop:J}=d.value;J<q?j.value=!1:X()&&(j.value=!0),q=J}else j.value=X();clearTimeout(ne),ne=setTimeout(()=>{},100)}},se=()=>{d.value&&j.value&&(d.value.scrollTop=d.value.scrollHeight)},he=()=>{s.value=[],m.value={},ie(),T(),zo.success("聊天记录已清空")},me=J=>new Date(J).toLocaleTimeString(),ge=()=>{try{localStorage.setItem(o,JSON.stringify(s.value.filter(J=>!J.isTyping)))}catch{}},te=()=>{try{const J=localStorage.getItem(o);if(J){const pe=JSON.parse(J);if(Array.isArray(pe)&&pe.length)return s.value=pe.map(ye=>({...ye,isTyping:!1})),!0}}catch{}return!1},ie=()=>{try{localStorage.removeItem(o)}catch{}},ee=()=>{const J=localStorage.getItem("ai-debug-mode");J!==null&&(p.value=J==="true");const pe=localStorage.getItem("ai-selected-model");pe&&(y.value=pe);const ye=localStorage.getItem("ai-selected-rule");ye&&(b.value=ye)};return a.watch(y,J=>{if(localStorage.setItem("ai-selected-model",J),!c.value){const pe=v.value.find(ye=>ye.value===J);pe&&zo.success(`已切换到 ${pe.label}`)}}),a.watch(b,J=>localStorage.setItem("ai-selected-rule",J)),(J,pe)=>{const ye=a.resolveComponent("el-button"),de=a.resolveComponent("el-alert"),Se=a.resolveComponent("el-input");return a.openBlock(),a.createElementBlock("div",VQt,[a.createElementVNode("div",eZt,[a.createElementVNode("div",tZt,[pe[5]||(pe[5]=a.createStaticVNode('<div class="header-title" data-v-bbb6e3cf><div class="logo-icon" data-v-bbb6e3cf><svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" data-v-bbb6e3cf><path d="M12 2a2 2 0 0 1 2 2v1h3a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h3V4a2 2 0 0 1 2-2Zm-3.5 9a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm7 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM9 16h6a.75.75 0 0 1 0 1.5H9A.75.75 0 0 1 9 16Z" data-v-bbb6e3cf></path></svg></div><span class="title-text" data-v-bbb6e3cf>AI 代码助手</span></div>',1)),a.createElementVNode("div",nZt,[a.createVNode(ye,{size:"small",text:"",onClick:he,disabled:c.value||s.value.length===0,title:"清空聊天"},{default:a.withCtx(()=>[...pe[4]||(pe[4]=[a.createTextVNode(" 🗑 清空 ",-1)])]),_:1},8,["disabled"])])]),a.createElementVNode("div",rZt,[a.createElementVNode("div",{class:a.normalizeClass(["rule-segmented",{"is-disabled":c.value}])},[a.createElementVNode("button",{class:a.normalizeClass(["seg-item",{active:b.value==="vuecode"}]),disabled:c.value,onClick:pe[0]||(pe[0]=we=>b.value="vuecode")}," 普通 Vue 代码 ",10,iZt),a.createElementVNode("button",{class:a.normalizeClass(["seg-item",{active:b.value==="reportcode"}]),disabled:c.value,onClick:pe[1]||(pe[1]=we=>b.value="reportcode")}," 报表生成器 ",10,aZt)],2)])]),a.createElementVNode("div",{class:"chat-messages w-full",ref_key:"messagesContainer",ref:d,onScroll:re},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(we,Ee)=>{var Q;return a.openBlock(),a.createElementBlock("div",{key:we.id||Ee,class:a.normalizeClass(["message",we.role==="user"?"user-message":"ai-message"])},[a.createElementVNode("div",oZt,[a.createElementVNode("div",sZt,[a.createElementVNode("div",lZt,a.toDisplayString(we.role==="user"?"用户":"AI助手"),1),a.createElementVNode("div",cZt,[we.role==="assistant"?(a.openBlock(),a.createElementBlock("button",{key:0,class:"copy-button-simple",onClick:fe=>S(we.content),title:"复制内容"}," 📋 ",8,uZt)):a.createCommentVNode("",!0),p.value&&we.timestamp?(a.openBlock(),a.createElementBlock("div",dZt,a.toDisplayString(me(we.timestamp)),1)):a.createCommentVNode("",!0)])]),we.role==="user"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-text",innerHTML:C(we.content)},null,8,fZt)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["assistant-content",{typing:we.isTyping}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(M(we.content),(fe,ve)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:ve},[fe.type==="normal"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"normal-content",innerHTML:C(fe.content)},null,8,pZt)):fe.type==="thinking"?(a.openBlock(),a.createElementBlock("div",hZt,[a.createElementVNode("div",{class:"thinking-header",onClick:De=>R(we.id,ve)},[a.createElementVNode("span",{class:a.normalizeClass([{"rotate-icon":P(we.id,ve)},"thinking-toggle"])},"►",2),pe[6]||(pe[6]=a.createElementVNode("span",null,"AI思考过程",-1)),fe.content?(a.openBlock(),a.createElementBlock("span",gZt," ("+a.toDisplayString(fe.content.length>1e3?"长内容":`${fe.content.length}字符`)+") ",1)):a.createCommentVNode("",!0)],8,mZt),a.withDirectives(a.createElementVNode("div",vZt,[a.createElementVNode("pre",null,a.toDisplayString(fe.content),1)],512),[[a.vShow,P(we.id,ve)]])])):a.createCommentVNode("",!0)],64))),128))],2)),p.value?(a.openBlock(),a.createElementBlock("div",yZt,[a.createElementVNode("div",null,"ID: "+a.toDisplayString(we.id||"N/A"),1),a.createElementVNode("div",null,"长度: "+a.toDisplayString(((Q=we.content)==null?void 0:Q.length)||0)+"字符",1),we.role==="assistant"?(a.openBlock(),a.createElementBlock("details",_Zt,[pe[7]||(pe[7]=a.createElementVNode("summary",{style:{cursor:"pointer","font-size":"12px"}},"查看原始内容",-1)),a.createElementVNode("pre",bZt,a.toDisplayString(we.content),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],2)}),128)),c.value?(a.openBlock(),a.createElementBlock("div",SZt,[...pe[8]||(pe[8]=[a.createElementVNode("span",null,null,-1),a.createElementVNode("span",null,null,-1),a.createElementVNode("span",null,null,-1)])])):a.createCommentVNode("",!0)],544),u.value?(a.openBlock(),a.createElementBlock("div",EZt,[a.createVNode(de,{title:u.value,type:"error","show-icon":"",closable:!0,onClose:pe[2]||(pe[2]=we=>u.value=null)},null,8,["title"])])):a.createCommentVNode("",!0),a.createElementVNode("div",xZt,[a.createElementVNode("div",wZt,[a.createVNode(Se,{modelValue:l.value,"onUpdate:modelValue":pe[3]||(pe[3]=we=>l.value=we),type:"textarea",rows:3,placeholder:"请输入您的问题...",disabled:c.value,onKeydown:[a.withKeys(a.withModifiers(B,["ctrl"]),["enter"]),a.withKeys(a.withModifiers(B,["meta"]),["enter"])],ref_key:"inputField",ref:f,class:"chat-input"},null,8,["modelValue","disabled","onKeydown"]),a.createElementVNode("div",TZt,[pe[11]||(pe[11]=a.createElementVNode("div",{class:"input-tips"},[a.createElementVNode("span",{class:"tip-text"},"按 Ctrl+Enter 发送")],-1)),c.value?(a.openBlock(),a.createBlock(ye,{key:1,type:"danger",onClick:k},{default:a.withCtx(()=>[...pe[10]||(pe[10]=[a.createTextVNode("停止生成",-1)])]),_:1})):(a.openBlock(),a.createBlock(ye,{key:0,type:"primary",onClick:B,disabled:!l.value.trim()},{default:a.withCtx(()=>[...pe[9]||(pe[9]=[a.createTextVNode("发送",-1)])]),_:1},8,["disabled"]))])])])])}}}),[["__scopeId","data-v-bbb6e3cf"]]),NZt={class:"flex w-full h-full bg-[#171717]","element-loading-text":"编辑器加载中","element-loading-background":"rgba(0, 0, 0, 1)"},OZt={key:0,class:"tree_wrap flex-none w-[400px] border flex"},IZt={key:0,class:"flex-1 bg-white h-full"},MZt={class:"h-full w-full flex flex-col flex-1"},RZt={key:0,class:"head py-2 px-2 box-border bg-[#191c20]"},PZt={key:0,class:"text-[#d25462] italic"},DZt={class:"text-[#d4d4d4]"},kZt={key:1,class:"footer text-[#ffd700] bg-[#2f3129] py-2 px-2"},LZt={class:"flex justify-end w-full"},Pie=Object.assign({name:"commonCodeEditor",inheritAttrs:!1},{__name:"editor",props:{modelValue:[String,null],designer:{type:Object,default:{}},width:{type:[String],default:"100%"},height:{type:[String],default:"100%"},language:{type:[String],default:"javascript"},theme:{type:[String],default:"vs-dark"},params:{type:[Array],default:[]},minimap:{type:[Boolean],default:!0},pure:{type:[Boolean],default:!1},tabSize:{type:[Number],default:4},isAsync:{type:[Boolean],default:!0},fontSize:{type:[Number],default:12}},emits:["update:modelValue","chosenWidget"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=a.ref(null);a.ref(null);const s=a.ref(!0),l=a.ref(null);let c=null,u=a.ref(0);const d=a.ref(null),f=a.ref({visible:!1,x:0,y:0}),p=a.ref(!1),m=a.ref([]),h=a.ref(null),g=N=>{const M=[];for(const[R,P]of Object.entries(N.props))M.push({key:R,value:typeof P=="object"?JSON.stringify(P):P,description:`${R} 属性`});return M},v=({cellValue:N})=>typeof N=="object"&&N!==null?JSON.stringify(N,null,2):String(N),y=async N=>{try{let M=`app.getPropsById("${l.value}").${N.key}`;navigator.clipboard&&window.isSecureContext?(await navigator.clipboard.writeText(M),r.designer.$message.success(`获取属性方法:"${M}" 已复制到剪贴板`),p.value=!1):b(M,`获取属性方法:"${M}" 已复制到剪贴板`)}catch(M){console.error("复制失败:",M);let R=`app.getPropsById("${l.value}").${N.key}`;b(R,`获取属性方法:"${R}" 已复制到剪贴板`)}},b=(N,M)=>{const R=document.createElement("textarea");R.value=N,R.style.top="0",R.style.left="0",R.style.position="fixed",R.style.opacity="0",document.body.appendChild(R),R.focus(),R.select();try{document.execCommand("copy")?(r.designer.$message.success(M),p.value=!1):r.designer.$message.error("复制失败")}catch{r.designer.$message.error("复制失败")}document.body.removeChild(R)},_=()=>{f.value.visible=!1};a.onMounted(()=>{if(typeof window.monaco<"u"){E();return}(typeof window.require>"u"||!window.__MONACO_CONFIGURED__)&&(window.__MONACO_CONFIGURED__=!0,require.config({paths:{vs:"/cdn.sunform.tech/libs/monaco-editor/min/vs"}})),require(["vs/editor/editor.main"],function(){E()})});const E=()=>{o.value?(c=monaco.editor.create(o.value,{value:r.modelValue||"",language:r.language,theme:r.theme,automaticLayout:!0,minimap:{enabled:r.minimap},folding:!0,foldingStrategy:"auto",renderLineHighlight:"all",scrollBeyondLastLine:!1,quickSuggestions:!0,suggestOnTriggerCharacters:!0,parameterHints:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",guides:{indentation:!0},autoIndent:"full",formatOnType:!0,formatOnPaste:!0,wordWrap:"off",tabSize:r.tabSize,locale:"zh-cn",fontSize:r.fontSize,suggest:{preview:!0}}),c.addAction({id:"show-component-location",label:"显示组件所在位置",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.I],contextMenuGroupId:"navigation",contextMenuOrder:0,run:function(N){const M=N.getModel(),R=N.getSelection(),P=M.getValueInRange(R);let k=r.designer.getWidgetById(P);k&&d.value.highlightRow(k.id)}}),c.addAction({id:"show-component-properties",label:"显示组件所有属性",keybindings:[monaco.KeyMod.CtrlCmd|monaco.KeyCode.J],contextMenuGroupId:"navigation",contextMenuOrder:1,run:function(N){const M=N.getModel(),R=N.getSelection(),P=M.getValueInRange(R);let k=r.designer.getWidgetById(P);k&&(h.value=k,m.value=g(k),p.value=!0,l.value=k.id)}}),c.onMouseDown(N=>{if(N.event.rightButton){N.event.preventDefault();const M=N.event.browserEvent;f.value.x=M.clientX,f.value.y=M.clientY,f.value.visible=!0,setTimeout(()=>{document.addEventListener("click",_,{once:!0})},0)}}),c.onDidChangeModelContent(N=>{i("update:modelValue",c.getValue())}),setTimeout(()=>{w(),s.value=!1},20),a.watch(()=>r.modelValue,N=>{},{deep:!0,immediate:!0}),monaco.languages.registerCompletionItemProvider("javascript",{provideCompletionItems:function(N,M){return{suggestions:[{label:"clog",kind:monaco.languages.CompletionItemKind.Snippet,insertText:"console.log( $1 );",insertTextRules:monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"打印语句"},{label:"jp",kind:monaco.languages.CompletionItemKind.Snippet,insertText:"console.log(JSON.parse(JSON.stringify( $1 )))",insertTextRules:monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"打印原始对象"},{label:"each",kind:monaco.languages.CompletionItemKind.Snippet,insertText:`$1.forEach((e,i)=>{
|
|
208
208
|
$2
|
|
209
209
|
})`,insertTextRules:monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,documentation:"遍历"},{label:"map",kind:monaco.languages.CompletionItemKind.Snippet,insertText:`$1.map((e,i)=>{
|
|
210
210
|
$2
|