nxd-plugin 1.8.35 → 1.8.37
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/chunks/YCServiceSummary-tHEqhFHj.mjs +2 -0
- package/dist/chunks/{component-Agent-Cr-ntDoH.mjs → component-Agent-DqXO06Ql.mjs} +27610 -1518
- package/dist/chunks/{component-AiChat-DApn4-2y.mjs → component-AiChat-C8NFYtVc.mjs} +155 -151
- package/dist/chunks/{component-AqiMonitor-BUXDYKbQ.mjs → component-AqiMonitor-WvrknfI9.mjs} +9 -9
- package/dist/chunks/{component-ChartCumulativePre-BaHd1iUO.mjs → component-ChartCumulativePre-B9Prk8Sx.mjs} +7 -7
- package/dist/chunks/{component-ChartServiceMaterial-R-h4rGRH.mjs → component-ChartServiceMaterial-dSZ_Pec0.mjs} +6 -6
- package/dist/chunks/{component-Duty-D_8KvfNe.mjs → component-Duty-CcPTE385.mjs} +6 -6
- package/dist/chunks/{component-EarlyWarningStatistic-BCrTZD4q.mjs → component-EarlyWarningStatistic-Ug-1jfiU.mjs} +6 -6
- package/dist/chunks/{component-EarlyWarningStatistic2-BR0gmPUZ.mjs → component-EarlyWarningStatistic2-BnZqgK4P.mjs} +15 -15
- package/dist/chunks/{component-Forecast72h-B85PYYlt.mjs → component-Forecast72h-5DGIhVUd.mjs} +16 -16
- package/dist/chunks/{component-GeologyLiveAlarm-D-8PLp8C.mjs → component-GeologyLiveAlarm-Bg710d1g.mjs} +7 -7
- package/dist/chunks/{component-GridForecastMsg-DP0QB8OG.mjs → component-GridForecastMsg-D0jzurbN.mjs} +8 -8
- package/dist/chunks/{component-HDSeaLegend-Lx4CVdBe.mjs → component-HDSeaLegend-D5FWHvmR.mjs} +2 -2
- package/dist/chunks/component-HdCameraList-4ArboSf0.mjs +916 -0
- package/dist/chunks/{component-HdFarmStation-QWV3F5p7.mjs → component-HdFarmStation-D9qZ2csY.mjs} +11 -11
- package/dist/chunks/{component-HdFarmStationDialog-C42Kalh1.mjs → component-HdFarmStationDialog-DHGlfkae.mjs} +33 -33
- package/dist/chunks/{component-HdForecastProducts-BgjJEfkx.mjs → component-HdForecastProducts-qj9Yzh7D.mjs} +10 -10
- package/dist/chunks/{component-HdHeatChart-CCRZPuMc.mjs → component-HdHeatChart-Br63YpFN.mjs} +65 -63
- package/dist/chunks/{component-HdHeatChartDialog-DeoxDSyl.mjs → component-HdHeatChartDialog-DOkB8heB.mjs} +11 -11
- package/dist/chunks/{component-HdHeatService-CmbwlkaA.mjs → component-HdHeatService-BeUpAmBA.mjs} +34 -34
- package/dist/chunks/{component-HdInsectDetailList-By-U2peB.mjs → component-HdInsectDetailList-C9tAtciq.mjs} +16 -16
- package/dist/chunks/{component-HdInsectList-BlVzoIgO.mjs → component-HdInsectList-pU1-mQ-C.mjs} +18 -18
- package/dist/chunks/{component-HdMajorActivity-DNeXIzo9.mjs → component-HdMajorActivity-DSPYsbdQ.mjs} +23 -23
- package/dist/chunks/{component-HdObservation-CT3xn1ly.mjs → component-HdObservation-osOGizJv.mjs} +10 -10
- package/dist/chunks/{component-HdPreSituation-DDNcwiwp.mjs → component-HdPreSituation-Ca_d4L11.mjs} +9 -9
- package/dist/chunks/{component-HdQxServiceEffects-BBzdn4-G.mjs → component-HdQxServiceEffects-CtlLJVdx.mjs} +10 -10
- package/dist/chunks/{component-HdRadarList-BqobCRLG.mjs → component-HdRadarList-CgWMdwBo.mjs} +3 -3
- package/dist/chunks/{component-HdRadarTime-D_4TfBtL.mjs → component-HdRadarTime-Bp7D80GJ.mjs} +12 -12
- package/dist/chunks/{component-HdRadarTimeLine-1eC-qOqz.mjs → component-HdRadarTimeLine-DfOce6fK.mjs} +13 -13
- package/dist/chunks/{component-HdRisk-Dq273IqG.mjs → component-HdRisk-Bd3if-1-.mjs} +11 -11
- package/dist/chunks/{component-HdSeaCase-FmlzNkBj.mjs → component-HdSeaCase-CbY3FsOy.mjs} +26 -26
- package/dist/chunks/{component-HdServiceMarterial-C7D1ZwhV.mjs → component-HdServiceMarterial-B7FEviHO.mjs} +17 -17
- package/dist/chunks/{component-HdServiceRequirements-BTUKNojU.mjs → component-HdServiceRequirements-DKJ8uQja.mjs} +13 -13
- package/dist/chunks/{component-HdSoil-2_TlWGNW.mjs → component-HdSoil-ztBxJspH.mjs} +11 -11
- package/dist/chunks/{component-HdSoilDetailList-BwRGMjV9.mjs → component-HdSoilDetailList-1gMQt-uL.mjs} +12 -12
- package/dist/chunks/{component-HdStationTem-D0Dt3LHl.mjs → component-HdStationTem-DfJ0I_2S.mjs} +17 -17
- package/dist/chunks/{component-HdSuggestion-ofUMSp3s.mjs → component-HdSuggestion-FXvLu_OD.mjs} +13 -13
- package/dist/chunks/{component-HdThreeWeatherTrend-Kh64QzKx.mjs → component-HdThreeWeatherTrend-DGLSVUb8.mjs} +18 -18
- package/dist/chunks/{component-HdWaveForcast-DppP_HvM.mjs → component-HdWaveForcast-dTEB0h8d.mjs} +11 -11
- package/dist/chunks/{component-HighQuality-C7RXFw-E.mjs → component-HighQuality-DZGJXvJC.mjs} +16 -16
- package/dist/chunks/{component-HighWayEarlyWarningRed-Cv-Rh-cC.mjs → component-HighWayEarlyWarningRed-F0q1FCTw.mjs} +16 -16
- package/dist/chunks/{component-HighWayFreeze-DLqbbIG5.mjs → component-HighWayFreeze-d4Xwkwf1.mjs} +8 -8
- package/dist/chunks/{component-HighwayLiveAlarm-B7jI-RZI.mjs → component-HighwayLiveAlarm-ChAdlgNB.mjs} +6 -6
- package/dist/chunks/{component-HighwayLiveAlarmNew-B-jkZXom.mjs → component-HighwayLiveAlarmNew-B-KnOey_.mjs} +11 -11
- package/dist/chunks/{component-HighwayStations-C7bVg74m.mjs → component-HighwayStations-CknEywO_.mjs} +6 -6
- package/dist/chunks/{component-HighwayWeatherForecast-C0Z_0C3X.mjs → component-HighwayWeatherForecast-B4szOq2G.mjs} +9 -9
- package/dist/chunks/{component-IframeWeb-BM0dqiO9.mjs → component-IframeWeb-iDh9lrPn.mjs} +1 -1
- package/dist/chunks/{component-ImageGeneration-5Bdvbyfs.mjs → component-ImageGeneration-CsIZ2Kz2.mjs} +2 -2
- package/dist/chunks/{component-IntroducePic-_nigmGDe.mjs → component-IntroducePic-BggfUWvz.mjs} +13 -13
- package/dist/chunks/{component-LithiumBatteryMiningArea-B21dEJLE.mjs → component-LithiumBatteryMiningArea-RpuBju1r.mjs} +12 -12
- package/dist/chunks/{component-MapPopup-52oQnhOj.mjs → component-MapPopup-LFWUnUl3.mjs} +1 -1
- package/dist/chunks/{component-MaterialPreview-CrfvJxHz.mjs → component-MaterialPreview-DvNKoDNy.mjs} +5 -5
- package/dist/chunks/{component-PieLegend-CgHQfWD4.mjs → component-PieLegend-B2Nor3pz.mjs} +1 -1
- package/dist/chunks/{component-PrecipitationRanking-C0TROtSR.mjs → component-PrecipitationRanking-ClwjH24B.mjs} +27 -27
- package/dist/chunks/{component-RadarChart-COc4gmuU.mjs → component-RadarChart-BMoy8MXR.mjs} +10 -10
- package/dist/chunks/{component-RadarLegend-CjhaPfOW.mjs → component-RadarLegend-rXlAb8lF.mjs} +1 -1
- package/dist/chunks/{component-RadarShortTerm-DJgvtI9c.mjs → component-RadarShortTerm-4RS7HYWc.mjs} +13 -13
- package/dist/chunks/{component-RadarTime-Br0xVEuq.mjs → component-RadarTime-W1ZVEA9e.mjs} +18 -18
- package/dist/chunks/{component-RenderMarkdown-InDC2lO4.mjs → component-RenderMarkdown-DO4bEFoj.mjs} +6 -6
- package/dist/chunks/{component-ReservoirLiveAlarm-DP-lWjfx.mjs → component-ReservoirLiveAlarm-ZD1RSFHm.mjs} +8 -8
- package/dist/chunks/{component-ServiceMaterial-Cijz6IMh.mjs → component-ServiceMaterial-DrxeAmRt.mjs} +9 -9
- package/dist/chunks/{component-ServiceMaterialsBtn-BdnH5TSY.mjs → component-ServiceMaterialsBtn-CZFRzpDr.mjs} +2 -2
- package/dist/chunks/{component-StationDialog-CcpEWARd.mjs → component-StationDialog-NhNr3lY1.mjs} +9 -9
- package/dist/chunks/{component-StationList-DyspLaBT.mjs → component-StationList-CSU1nUgF.mjs} +9 -9
- package/dist/chunks/{component-TimeBasedForecast-DS12UnL3.mjs → component-TimeBasedForecast-BObdyMNh.mjs} +10 -10
- package/dist/chunks/{component-Typhoon-BLL7-FHD.mjs → component-Typhoon-AxGQ8VuM.mjs} +16 -16
- package/dist/chunks/{component-WarningLine-CjXljhuQ.mjs → component-WarningLine-Biz0NEC8.mjs} +2 -2
- package/dist/chunks/{component-WarningSignal-BUq7JNyw.mjs → component-WarningSignal-D5ux6LCy.mjs} +17 -17
- package/dist/chunks/{component-WeatherForecast-CBY40Y1j.mjs → component-WeatherForecast-DnvELAB8.mjs} +16 -16
- package/dist/chunks/{component-YCDataMonitor-Clu5RdqK.mjs → component-YCDataMonitor-Dumu7_mw.mjs} +16 -16
- package/dist/chunks/{component-YCDataService-BX8obEW9.mjs → component-YCDataService-CibX3y21.mjs} +10 -10
- package/dist/chunks/{component-YCHighWaySummary-DfDlTv13.mjs → component-YCHighWaySummary-B4rfNY9B.mjs} +7 -7
- package/dist/chunks/{component-YCHome-CoTwNCRI.mjs → component-YCHome-BgH2uOoL.mjs} +36 -36
- package/dist/chunks/{component-YCHomeLegend--xlIidkR.mjs → component-YCHomeLegend-BpForfu4.mjs} +2 -2
- package/dist/chunks/{component-YCLoginNew-CQ9V5l-b.mjs → component-YCLoginNew-BsQr4jFy.mjs} +17 -17
- package/dist/chunks/{component-YCServiceSummary-DeDBpyuC.mjs → component-YCServiceSummary-CnnEfTaE.mjs} +162 -162
- package/dist/components/Agent/Agent.vue.d.ts +1 -0
- package/dist/nxd-plugin.mjs +73 -73
- package/dist/styles/component-Agent.css +1 -1
- package/dist/styles/component-AiChat.css +1 -1
- package/dist/styles/component-HdHeatChart.css +1 -1
- package/dist/styles/component-YCLoginNew.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/YCServiceSummary-D6Jrh3KH.mjs +0 -2
- package/dist/chunks/component-HdCameraList-BkpFsBPc.mjs +0 -26871
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, d as t, f as n, i as r, m as i } from "./component-Agent-DqXO06Ql.mjs";
|
|
2
2
|
import { ElButton as a, ElCheckbox as o, ElDialog as s, ElTree as c } from "element-plus/es";
|
|
3
3
|
import { Fragment as l, Teleport as u, Transition as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, nextTick as b, normalizeClass as x, normalizeStyle as ee, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as S, ref as C, renderList as w, toDisplayString as T, unref as ie, useAttrs as ae, vShow as oe, watch as E, withCtx as se, withDirectives as D, withModifiers as O } from "vue";
|
|
4
4
|
import * as k from "echarts";
|
|
@@ -96,37 +96,37 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
96
96
|
},
|
|
97
97
|
emits: ["complete"],
|
|
98
98
|
setup(e, { emit: t }) {
|
|
99
|
-
let
|
|
100
|
-
E(() =>
|
|
99
|
+
let n = e, i = t, a = C(n.defaultExpanded), o = C(/* @__PURE__ */ new Set());
|
|
100
|
+
E(() => n.status, (e) => {
|
|
101
101
|
(e === "end" || e === "error") && i("complete");
|
|
102
102
|
}, { immediate: !0 });
|
|
103
|
-
let s = f(() =>
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
if (c.value &&
|
|
107
|
-
let e =
|
|
103
|
+
let s = f(() => n.reasoning_content?.trim().length > 0 || n.steps.length > 0 || n.tools.length > 0 || n.status === "thinking"), c = f(() => n.type === "smartMake"), u = f(() => {
|
|
104
|
+
if (n.status === "error") return "思考异常";
|
|
105
|
+
if (n.status === "end") return "思考完成";
|
|
106
|
+
if (c.value && n.tools.length) {
|
|
107
|
+
let e = n.tools.find((e) => e.status === "calling");
|
|
108
108
|
if (e) return `正在执行:${e.name}`;
|
|
109
|
-
let t =
|
|
109
|
+
let t = n.tools.find((e) => e.status === "thinking");
|
|
110
110
|
if (t) return `等待执行:${t.name}`;
|
|
111
111
|
}
|
|
112
112
|
return "思考中...";
|
|
113
113
|
});
|
|
114
|
-
f(() =>
|
|
114
|
+
f(() => n.tools.some((e) => e.status === "thinking" || e.status === "calling"));
|
|
115
115
|
let d = (e) => c.value ? e.status === "calling" ? "执行中..." : e.status === "success" ? "已完成" : e.status === "error" ? "失败" : "等待中" : e.status === "calling" ? "调用中..." : e.status === "success" ? "调用成功" : e.status === "error" ? "调用失败" : "", p = (e) => {
|
|
116
|
-
if (!
|
|
116
|
+
if (!n.showContent || !e.content?.trim()) return;
|
|
117
117
|
let t = new Set(o.value);
|
|
118
118
|
t.has(e.id) ? t.delete(e.id) : t.add(e.id), o.value = t;
|
|
119
|
-
}, v = (e) => e === "text" || e === "markdown", y = (e) => e ? /^(https?:)?\/\//i.test(e) || e.startsWith("data:") || !
|
|
119
|
+
}, v = (e) => e === "text" || e === "markdown", y = (e) => e ? /^(https?:)?\/\//i.test(e) || e.startsWith("data:") || !n.baseHttp ? e : n.baseHttp.replace(/\/$/, "") + (e.startsWith("/") ? e : `/${e}`) : "", b = () => {
|
|
120
120
|
a.value = !a.value;
|
|
121
121
|
};
|
|
122
|
-
return (t,
|
|
122
|
+
return (t, n) => s.value ? (S(), h("div", {
|
|
123
123
|
key: 0,
|
|
124
124
|
class: x(["AiChatThinking", `AiChatThinking--${e.theme}`])
|
|
125
125
|
}, [g("div", {
|
|
126
126
|
class: "AiChatThinking__header",
|
|
127
127
|
onClick: b
|
|
128
128
|
}, [
|
|
129
|
-
g("span", j, [e.status === "thinking" ? (S(), h("svg", M, [...
|
|
129
|
+
g("span", j, [e.status === "thinking" ? (S(), h("svg", M, [...n[0] ||= [g("path", { d: "M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z" }, null, -1)]])) : e.status === "end" ? (S(), h("svg", N, [...n[1] ||= [g("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)]])) : (S(), h("svg", P, [...n[2] ||= [g("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, null, -1)]])), n[3] ||= _(" 思考过程 ", -1)]),
|
|
130
130
|
g("span", F, T(u.value), 1),
|
|
131
131
|
(S(), h("svg", {
|
|
132
132
|
class: x(["AiChatThinking__arrow", { "is-open": a.value }]),
|
|
@@ -134,12 +134,12 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
134
134
|
width: "16",
|
|
135
135
|
height: "16",
|
|
136
136
|
fill: "currentColor"
|
|
137
|
-
}, [...
|
|
137
|
+
}, [...n[4] ||= [g("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }, null, -1)]], 2))
|
|
138
138
|
]), D(g("div", I, [e.tools.length ? (S(), h("div", L, [(S(!0), h(l, null, w(e.tools, (t) => (S(), h(l, { key: t.id }, [c.value ? (S(), h("div", R, [g("div", {
|
|
139
139
|
class: x(["AiChatThinking__tool is-smartMake", [`is-${t.status}`, { "is-expandable": e.showContent && t.content?.trim() }]]),
|
|
140
140
|
onClick: (e) => p(t)
|
|
141
141
|
}, [
|
|
142
|
-
t.status === "calling" ? (S(), h("svg", ue, [...
|
|
142
|
+
t.status === "calling" ? (S(), h("svg", ue, [...n[5] ||= [g("path", { d: "M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z" }, null, -1)]])) : t.status === "success" ? (S(), h("svg", de, [...n[6] ||= [g("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }, null, -1)]])) : t.status === "error" ? (S(), h("svg", B, [...n[7] ||= [g("path", { d: "M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z" }, null, -1)]])) : (S(), h("svg", fe, [...n[8] ||= [g("circle", {
|
|
143
143
|
cx: "12",
|
|
144
144
|
cy: "12",
|
|
145
145
|
r: "5"
|
|
@@ -153,16 +153,16 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
153
153
|
width: "14",
|
|
154
154
|
height: "14",
|
|
155
155
|
fill: "currentColor"
|
|
156
|
-
}, [...
|
|
156
|
+
}, [...n[9] ||= [g("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }, null, -1)]], 2)) : m("", !0)
|
|
157
157
|
], 10, z), e.showContent && t.content?.trim() && !o.value.has(t.id) ? (S(), h("div", {
|
|
158
158
|
key: 0,
|
|
159
159
|
class: "AiChatThinking__toolContent markdown-body",
|
|
160
|
-
innerHTML: ie(
|
|
160
|
+
innerHTML: ie(r)(t.content)
|
|
161
161
|
}, null, 8, he)) : m("", !0)])) : (S(), h("div", {
|
|
162
162
|
key: 1,
|
|
163
163
|
class: x(["AiChatThinking__tool", `is-${t.status}`])
|
|
164
164
|
}, [
|
|
165
|
-
|
|
165
|
+
n[10] ||= g("svg", {
|
|
166
166
|
class: "AiChatThinking__toolIcon",
|
|
167
167
|
viewBox: "0 0 24 24",
|
|
168
168
|
width: "14",
|
|
@@ -174,14 +174,14 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
174
174
|
], 2))], 64))), 128))])) : m("", !0), e.reasoning_content?.trim() ? (S(), h("div", {
|
|
175
175
|
key: 1,
|
|
176
176
|
class: "AiChatThinking__content markdown-body",
|
|
177
|
-
innerHTML: ie(
|
|
177
|
+
innerHTML: ie(r)(e.reasoning_content)
|
|
178
178
|
}, null, 8, ge)) : e.steps.length ? (S(), h("div", U, [(S(!0), h(l, null, w(e.steps, (e, t) => (S(), h("div", {
|
|
179
179
|
key: t,
|
|
180
180
|
class: "AiChatThinking__step"
|
|
181
|
-
}, [
|
|
181
|
+
}, [n[12] ||= g("span", { class: "AiChatThinking__dot" }, [g("span", { class: "AiChatThinking__pulse" })], -1), g("div", W, [v(e.type) ? (S(), h(l, { key: 0 }, [e.type === "text" ? (S(), h("span", _e, T(e.content), 1)) : (S(), h("div", {
|
|
182
182
|
key: 1,
|
|
183
183
|
class: "AiChatThinking__markdown markdown-body",
|
|
184
|
-
innerHTML: ie(
|
|
184
|
+
innerHTML: ie(r)(e.content || "")
|
|
185
185
|
}, null, 8, ve))], 64)) : e.type === "table" ? (S(), h("div", ye, [g("table", null, [g("thead", null, [g("tr", null, [(S(!0), h(l, null, w(e.columns, (e) => (S(), h("th", {
|
|
186
186
|
key: e.key,
|
|
187
187
|
class: x(`is-${e.align || "left"}`)
|
|
@@ -198,7 +198,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
198
198
|
key: 3,
|
|
199
199
|
class: x(["AiChatThinking__tool", `is-${e.tool.status}`])
|
|
200
200
|
}, [
|
|
201
|
-
|
|
201
|
+
n[11] ||= g("svg", {
|
|
202
202
|
class: "AiChatThinking__toolIcon",
|
|
203
203
|
viewBox: "0 0 24 24",
|
|
204
204
|
width: "14",
|
|
@@ -416,17 +416,17 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
416
416
|
},
|
|
417
417
|
emits: ["publish"],
|
|
418
418
|
setup(e, { emit: t }) {
|
|
419
|
-
let
|
|
419
|
+
let n = e, i = t, a = f(() => [...n.message.blocks || []].sort((e, t) => e.sort - t.sort)), o = f(() => a.value.filter((e) => e.type === "thinking")), s = f(() => !!n.message.reasoning_content?.trim() || (n.message.tools?.length ?? 0) > 0 || o.value.length > 0 || n.message.thinkingStatus === "thinking"), c = f(() => {
|
|
420
420
|
let e = o.value[0];
|
|
421
421
|
return !e || !e.steps || !e.steps.length ? [] : e.steps;
|
|
422
|
-
}), u = C(!s.value), _ = f(() => !s.value || u.value), y = f(() => a.value.filter((e) => e.type !== "thinking")), b = f(() => !!
|
|
423
|
-
let e =
|
|
422
|
+
}), u = C(!s.value), _ = f(() => !s.value || u.value), y = f(() => a.value.filter((e) => e.type !== "thinking")), b = f(() => !!n.message.content?.trim()), ee = f(() => (n.message.resources?.length ?? 0) > 0), te = f(() => !!n.message.audioUrl), ae = f(() => {
|
|
423
|
+
let e = n.message.structuredData;
|
|
424
424
|
return e && (e.analysisText || e.distributionMapUrl || e.rawData || e.detailData);
|
|
425
425
|
}), O = f(() => {
|
|
426
|
-
let e =
|
|
426
|
+
let e = n.message.structuredData?.analysisText;
|
|
427
427
|
return e ? typeof e == "string" ? e : typeof e == "object" && e.strings && Array.isArray(e.strings) ? e.strings.join("") : String(e) : "";
|
|
428
|
-
}), ce = f(() =>
|
|
429
|
-
let e =
|
|
428
|
+
}), ce = f(() => n.message.structuredData?.distributionMapUrl || ""), A = f(() => {
|
|
429
|
+
let e = n.message.structuredData;
|
|
430
430
|
if (!e) return [];
|
|
431
431
|
let t = e.detailData || e.rawData;
|
|
432
432
|
if (!t) return [];
|
|
@@ -439,7 +439,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
439
439
|
}), le = f(() => {
|
|
440
440
|
let e = A.value;
|
|
441
441
|
return e.length ? Object.keys(e[0]) : [];
|
|
442
|
-
}), j = (e) => e ? /^(https?:)?\/\//i.test(e) || e.startsWith("data:") || !
|
|
442
|
+
}), j = (e) => e ? /^(https?:)?\/\//i.test(e) || e.startsWith("data:") || !n.baseHttp ? e : n.baseHttp.replace(/\/$/, "") + (e.startsWith("/") ? e : `/${e}`) : "", M = C(null), N = f(() => j(M.value?.url)), P = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map(), I = C(/* @__PURE__ */ new Set()), L = (e, t) => {
|
|
443
443
|
e && P.set(t, e);
|
|
444
444
|
}, R = (e) => {
|
|
445
445
|
M.value = e;
|
|
@@ -489,9 +489,9 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
489
489
|
if (e.type !== "echarts") return;
|
|
490
490
|
let t = P.get(e.sort);
|
|
491
491
|
if (!t) return;
|
|
492
|
-
let
|
|
493
|
-
|
|
494
|
-
let i =
|
|
492
|
+
let r = F.get(e.sort);
|
|
493
|
+
r || (r = k.init(t, void 0, { renderer: "canvas" }), F.set(e.sort, r));
|
|
494
|
+
let i = n.theme === "dark" ? {
|
|
495
495
|
backgroundColor: "transparent",
|
|
496
496
|
textStyle: { color: "#e5e7eb" },
|
|
497
497
|
title: { textStyle: { color: "#e5e7eb" } },
|
|
@@ -535,7 +535,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
535
535
|
xAxis: { splitLine: { show: !1 } },
|
|
536
536
|
yAxis: { splitLine: { show: !1 } }
|
|
537
537
|
};
|
|
538
|
-
|
|
538
|
+
r.setOption(pe(i, e.option || {}), !0);
|
|
539
539
|
});
|
|
540
540
|
}, he = () => {
|
|
541
541
|
F.forEach((e) => e.dispose()), F.clear();
|
|
@@ -548,13 +548,13 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
548
548
|
let V = () => {
|
|
549
549
|
F.forEach((e) => e.resize());
|
|
550
550
|
};
|
|
551
|
-
return E(() =>
|
|
551
|
+
return E(() => n.message.thinkingStatus, (e) => {
|
|
552
552
|
e === "end" || e === "error" ? u.value = !0 : e === "thinking" && (u.value = !1);
|
|
553
|
-
}, { immediate: !0 }), E(() =>
|
|
553
|
+
}, { immediate: !0 }), E(() => n.message, () => {
|
|
554
554
|
he(), setTimeout(me, 0);
|
|
555
555
|
}, { deep: !0 }), E(_, (e) => {
|
|
556
556
|
e && setTimeout(me, 0);
|
|
557
|
-
}), (t,
|
|
557
|
+
}), (t, n) => (S(), h("div", { class: x(["AiChatResponse", `AiChatResponse--${e.theme}`]) }, [
|
|
558
558
|
s.value ? (S(), p(Ce, {
|
|
559
559
|
key: 0,
|
|
560
560
|
reasoning_content: e.message.reasoning_content,
|
|
@@ -580,7 +580,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
580
580
|
_.value ? (S(), h(l, { key: 1 }, [
|
|
581
581
|
b.value ? (S(), h("div", Ge, [g("div", {
|
|
582
582
|
class: "markdown-body",
|
|
583
|
-
innerHTML: ie(
|
|
583
|
+
innerHTML: ie(r)(e.message.content || "")
|
|
584
584
|
}, null, 8, Ke)])) : m("", !0),
|
|
585
585
|
ee.value ? (S(), p(We, {
|
|
586
586
|
key: 1,
|
|
@@ -590,14 +590,14 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
590
590
|
ae.value ? (S(), h("div", X, [
|
|
591
591
|
O.value ? (S(), h("div", qe, [g("div", {
|
|
592
592
|
class: "markdown-body",
|
|
593
|
-
innerHTML: ie(
|
|
593
|
+
innerHTML: ie(r)(O.value)
|
|
594
594
|
}, null, 8, Je)])) : m("", !0),
|
|
595
|
-
ce.value ? (S(), h("div", Ye, [
|
|
595
|
+
ce.value ? (S(), h("div", Ye, [n[0] ||= g("div", { class: "block-title" }, "实况分布图", -1), g("div", Xe, [g("img", {
|
|
596
596
|
src: j(ce.value),
|
|
597
597
|
alt: "实况分布图",
|
|
598
598
|
loading: "lazy"
|
|
599
599
|
}, null, 8, Ze)])])) : m("", !0),
|
|
600
|
-
A.value.length > 0 ? (S(), h("div", Qe, [
|
|
600
|
+
A.value.length > 0 ? (S(), h("div", Qe, [n[1] ||= g("div", { class: "block-title" }, "数据列表", -1), g("div", Z, [g("table", null, [g("thead", null, [g("tr", null, [(S(!0), h(l, null, w(le.value, (e) => (S(), h("th", { key: e }, T(e), 1))), 128))])]), g("tbody", null, [(S(!0), h(l, null, w(A.value, (e, t) => (S(), h("tr", { key: t }, [(S(!0), h(l, null, w(le.value, (t) => (S(), h("td", { key: t }, T(e[t] ?? ""), 1))), 128))]))), 128))])])])])) : m("", !0)
|
|
601
601
|
])) : m("", !0),
|
|
602
602
|
te.value ? (S(), h("div", $e, [g("audio", {
|
|
603
603
|
src: j(e.message.audioUrl),
|
|
@@ -608,7 +608,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
608
608
|
(S(!0), h(l, null, w(y.value, (e) => (S(), h(l, { key: e.sort }, [e.type === "markdown" || e.type === "text" ? (S(), h("div", tt, [e.title ? (S(), h("div", nt, T(e.title), 1)) : m("", !0), e.type === "markdown" && e.content ? (S(), h("div", {
|
|
609
609
|
key: 1,
|
|
610
610
|
class: "markdown-body",
|
|
611
|
-
innerHTML: ie(
|
|
611
|
+
innerHTML: ie(r)(e.content)
|
|
612
612
|
}, null, 8, rt)) : e.type === "text" && e.content ? (S(), h("p", it, T(e.content), 1)) : m("", !0)])) : e.type === "table" ? (S(), h("div", at, [e.title ? (S(), h("div", ot, T(e.title), 1)) : m("", !0), g("div", st, [g("table", null, [g("thead", null, [g("tr", null, [(S(!0), h(l, null, w(e.columns, (e) => (S(), h("th", {
|
|
613
613
|
key: e.key,
|
|
614
614
|
class: x(`is-${e.align || "left"}`)
|
|
@@ -633,7 +633,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
633
633
|
class: "file-list-header",
|
|
634
634
|
onClick: (e) => ue(t)
|
|
635
635
|
}, [
|
|
636
|
-
|
|
636
|
+
n[3] ||= g("div", { class: "file-list-icon" }, [g("svg", {
|
|
637
637
|
viewBox: "0 0 24 24",
|
|
638
638
|
width: "16",
|
|
639
639
|
height: "16",
|
|
@@ -645,12 +645,12 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
645
645
|
class: x(["file-list-arrow", { "is-open": de(t) }]),
|
|
646
646
|
viewBox: "0 0 24 24",
|
|
647
647
|
fill: "currentColor"
|
|
648
|
-
}, [...
|
|
648
|
+
}, [...n[2] ||= [g("path", { d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" }, null, -1)]], 2))
|
|
649
649
|
], 8, bt), D(g("div", Ct, [e.description ? (S(), h("p", wt, T(e.description), 1)) : m("", !0), g("button", {
|
|
650
650
|
class: "file-list-download",
|
|
651
651
|
onClick: (t) => B(j(e.url), e.name)
|
|
652
652
|
}, "下载", 8, Tt)], 512), [[oe, de(t)]])]))), 128))])])) : e.type === "file" ? (S(), h("div", Et, [e.title ? (S(), h("div", Dt, T(e.title), 1)) : m("", !0), g("div", Ot, [
|
|
653
|
-
|
|
653
|
+
n[5] ||= g("div", { class: "file-icon" }, [g("svg", {
|
|
654
654
|
viewBox: "0 0 24 24",
|
|
655
655
|
width: "20",
|
|
656
656
|
height: "20",
|
|
@@ -665,7 +665,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
665
665
|
class: "file-download",
|
|
666
666
|
title: "下载",
|
|
667
667
|
onClick: (t) => B(j(e.fileUrl), e.name)
|
|
668
|
-
}, [...
|
|
668
|
+
}, [...n[4] ||= [g("svg", {
|
|
669
669
|
viewBox: "0 0 24 24",
|
|
670
670
|
fill: "currentColor"
|
|
671
671
|
}, [g("path", { d: "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" })], -1)]], 8, Pt)])
|
|
@@ -828,7 +828,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
828
828
|
"error",
|
|
829
829
|
"changeType"
|
|
830
830
|
],
|
|
831
|
-
setup(t, { expose:
|
|
831
|
+
setup(t, { expose: r, emit: d }) {
|
|
832
832
|
let y = t, re = d, oe = ae(), D = C(!1), k = C(!1), le = C(!1), j = C(null), M = C(null), N = C(!1), P = C(""), F = C(y.defaultType), I = C(""), L = C(!1), R = C(null), z = null, ue = C(y.appKey || ""), de = C(), B = C(), fe = C(null), pe = C(null), me = C(null), he = C(null), V = C(null), H = C(!1), ge = C(""), U = C(""), W = null, _e = C(!1), ve = C([]), ye = C([]), be = C([]), xe = C(!1), Se = C(!1), Ce = C(!1), we = C(null), Te = C(null), Ee = f(() => ve.value.map((e) => {
|
|
833
833
|
let t = [];
|
|
834
834
|
try {
|
|
@@ -882,31 +882,34 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
882
882
|
做材料: "smartMake",
|
|
883
883
|
查知识: "knowledge",
|
|
884
884
|
查材料: "material"
|
|
885
|
-
}, Ie = f(() =>
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
885
|
+
}, Ie = f(() => {
|
|
886
|
+
let e = Me.value.filter((e) => !e.agentId);
|
|
887
|
+
return e.length ? e.map((e) => ({
|
|
888
|
+
value: Fe[(e.label || "").trim()] || "data",
|
|
889
|
+
label: (e.label || "").trim()
|
|
890
|
+
})) : [
|
|
891
|
+
{
|
|
892
|
+
value: "data",
|
|
893
|
+
label: "查数据"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
value: "smartMake",
|
|
897
|
+
label: "做材料"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
value: "knowledge",
|
|
901
|
+
label: "查知识"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
value: "material",
|
|
905
|
+
label: "查材料"
|
|
906
|
+
}
|
|
907
|
+
];
|
|
908
|
+
}), Le = f(() => {
|
|
906
909
|
if (!G.value) return [];
|
|
907
910
|
let e = G.value.trim();
|
|
908
|
-
return Me.value.find((t) => (t.label || "").trim() === e)?.list || [];
|
|
909
|
-
}), Re = f(() => !!G.value && !!P.value.trim() && !N.value && !L.value), { x: ze, y: Be, dragging: Ve, onStart: He } =
|
|
911
|
+
return Me.value.find((t) => !t.agentId && (t.label || "").trim() === e)?.list || [];
|
|
912
|
+
}), Re = f(() => !!G.value && !!P.value.trim() && !N.value && !L.value), { x: ze, y: Be, dragging: Ve, onStart: He } = e({
|
|
910
913
|
initialX: y.defaultX,
|
|
911
914
|
initialY: y.defaultY,
|
|
912
915
|
disabled: f(() => !y.draggable || D.value)
|
|
@@ -945,38 +948,39 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
945
948
|
return console.error("[AiChat] 登录失败:", e), y.appKey || "";
|
|
946
949
|
}
|
|
947
950
|
}, Je = async () => {
|
|
948
|
-
let
|
|
949
|
-
if (!
|
|
951
|
+
let e = y.ids?.subMenu;
|
|
952
|
+
if (!e?.id) {
|
|
950
953
|
console.warn("[AiChat] 未配置 subMenu 工作流 id");
|
|
951
954
|
return;
|
|
952
955
|
}
|
|
953
956
|
try {
|
|
954
|
-
let
|
|
957
|
+
let t = await i({
|
|
955
958
|
appKey: y.appKey,
|
|
956
959
|
appSalt: y.appSalt,
|
|
957
|
-
id:
|
|
960
|
+
id: e.id,
|
|
958
961
|
variables: { newParam: "subMenu" },
|
|
959
962
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
960
|
-
reqType:
|
|
961
|
-
isFormData:
|
|
963
|
+
reqType: e.reqType || "post",
|
|
964
|
+
isFormData: e.isFormData ?? !1
|
|
962
965
|
});
|
|
963
|
-
console.log("[AiChat] subMenu 原始响应:",
|
|
964
|
-
let
|
|
965
|
-
if (typeof
|
|
966
|
-
|
|
966
|
+
console.log("[AiChat] subMenu 原始响应:", t);
|
|
967
|
+
let n = t?.data?.result ?? t?.data;
|
|
968
|
+
if (typeof n == "string") try {
|
|
969
|
+
n = JSON.parse(n);
|
|
967
970
|
} catch {
|
|
968
|
-
|
|
971
|
+
n = null;
|
|
969
972
|
}
|
|
970
|
-
let
|
|
973
|
+
let r = (e) => Array.isArray(e) ? e : !e || typeof e != "object" ? null : e.output ?? e.list ?? e.items ?? e.children ?? e.data ?? e.records ?? null, a = r(n);
|
|
971
974
|
if (typeof a == "string") try {
|
|
972
975
|
a = JSON.parse(a);
|
|
973
976
|
} catch {
|
|
974
977
|
a = null;
|
|
975
978
|
}
|
|
976
|
-
a =
|
|
977
|
-
let t =
|
|
979
|
+
a = r(a) || a, console.log("[AiChat] subMenu 解析后列表:", a), Array.isArray(a) && a.length && (Me.value = a.map((e) => {
|
|
980
|
+
let t = r(e) || e?.list || [];
|
|
978
981
|
return {
|
|
979
982
|
label: (e.label || e.name || e.title || "").trim(),
|
|
983
|
+
agentId: (e.agentId || "").trim(),
|
|
980
984
|
list: t.map((e) => ({
|
|
981
985
|
title: (e.title || e.name || e.label || e.namtitlee || "").trim(),
|
|
982
986
|
content: (e.content || e.value || e.text || "").trim(),
|
|
@@ -990,7 +994,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
990
994
|
}
|
|
991
995
|
}, Ye = (e) => {
|
|
992
996
|
G.value = e, Ne.value = e, K.value = null, P.value = "", F.value = Fe[e] || "data", re("changeType", F.value), b(() => {
|
|
993
|
-
let t = Me.value.find((t) => (t.label || "").trim() === e.trim());
|
|
997
|
+
let t = Me.value.find((t) => !t.agentId && (t.label || "").trim() === e.trim());
|
|
994
998
|
t?.list?.[0]?.id && Xe(t.list[0]), Z(), B.value?.focus();
|
|
995
999
|
});
|
|
996
1000
|
}, Xe = (e) => {
|
|
@@ -1073,16 +1077,16 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1073
1077
|
} finally {
|
|
1074
1078
|
N.value = !1, L.value = !1, nr(), kt();
|
|
1075
1079
|
}
|
|
1076
|
-
}, nt = async (
|
|
1077
|
-
let
|
|
1080
|
+
}, nt = async (e, t) => {
|
|
1081
|
+
let n = await i({
|
|
1078
1082
|
appKey: y.appKey,
|
|
1079
1083
|
appSalt: y.appSalt,
|
|
1080
|
-
id:
|
|
1081
|
-
variables: { newParam:
|
|
1084
|
+
id: t,
|
|
1085
|
+
variables: { newParam: e },
|
|
1082
1086
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
1083
1087
|
reqType: "post",
|
|
1084
1088
|
isFormData: !1
|
|
1085
|
-
}),
|
|
1089
|
+
}), r = n?.data?.result || n?.data, a = typeof r?.output == "string" ? r.output : "", o = typeof r?.url == "string" ? r.url : "", s = o, c = o ? o.split("/").pop() : "", l = (c ? decodeURIComponent(c) : "") || "智能制作材料.docx", u = l.split(".").pop() || "docx", d = [];
|
|
1086
1090
|
l && d.push({
|
|
1087
1091
|
sort: 1,
|
|
1088
1092
|
type: "file",
|
|
@@ -1097,9 +1101,9 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1097
1101
|
blocks: d,
|
|
1098
1102
|
thinkingStatus: "end",
|
|
1099
1103
|
time: $()
|
|
1100
|
-
}, s && await dt(
|
|
1104
|
+
}, s && await dt(t, s, l);
|
|
1101
1105
|
}, rt = async (e, t) => {
|
|
1102
|
-
let
|
|
1106
|
+
let r = (y.workflowBaseUrl || y.baseHttp).replace(/\/runAsyncWorkFlow$/, "").replace(/\/runAsync$/, "").replace(/\/$/, ""), i = `${r}/runAsync`, a = `${r}/getChainStatus`, o = await at(`${r}/detail`, t);
|
|
1103
1107
|
o.length && Mt({ tools: o.map((e) => ({
|
|
1104
1108
|
id: e.nodeId,
|
|
1105
1109
|
name: e.nodeName,
|
|
@@ -1107,8 +1111,8 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1107
1111
|
})) });
|
|
1108
1112
|
let s = { [K.value?.variableName || K.value?.variableKey || "newParam"]: e };
|
|
1109
1113
|
K.value?.materialType && (s.materialType = K.value.materialType);
|
|
1110
|
-
let { data: c } = await
|
|
1111
|
-
url:
|
|
1114
|
+
let { data: c } = await n.request({
|
|
1115
|
+
url: i,
|
|
1112
1116
|
method: "post",
|
|
1113
1117
|
data: {
|
|
1114
1118
|
id: t,
|
|
@@ -1175,13 +1179,13 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1175
1179
|
}));
|
|
1176
1180
|
}, at = async (e, t) => {
|
|
1177
1181
|
try {
|
|
1178
|
-
let { data:
|
|
1182
|
+
let { data: r } = await n.request({
|
|
1179
1183
|
url: e,
|
|
1180
1184
|
method: "get",
|
|
1181
1185
|
params: { id: t },
|
|
1182
1186
|
appKey: y.appKey,
|
|
1183
1187
|
appSalt: y.appSalt
|
|
1184
|
-
}),
|
|
1188
|
+
}), i = r?.data?.content, a = i ? JSON.parse(i) : r?.data, o = a?.nodes || [];
|
|
1185
1189
|
return Array.isArray(o) || (o = Object.values(o)), it({
|
|
1186
1190
|
nodes: o,
|
|
1187
1191
|
edges: a?.edges || []
|
|
@@ -1204,7 +1208,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1204
1208
|
} catch {
|
|
1205
1209
|
return String(t);
|
|
1206
1210
|
}
|
|
1207
|
-
}, ct = (e) => e === "COMPLETED" || e === "FINISHED" || e === "SUCCESS" || e === 20 || e === "20" || e === 2 || e === "2" ? "success" : e === "FAILED" || e === "ERROR" || e === "FAIL" || e === -1 || e === "-1" || e === 4 || e === "4" ? "error" : e === "RUNNING" || e === "EXECUTING" || e === 1 || e === "1" ? "calling" : "thinking", lt = (e, t,
|
|
1211
|
+
}, ct = (e) => e === "COMPLETED" || e === "FINISHED" || e === "SUCCESS" || e === 20 || e === "20" || e === 2 || e === "2" ? "success" : e === "FAILED" || e === "ERROR" || e === "FAIL" || e === -1 || e === "-1" || e === 4 || e === "4" ? "error" : e === "RUNNING" || e === "EXECUTING" || e === 1 || e === "1" ? "calling" : "thinking", lt = (e, t, r, i) => new Promise((a, o) => {
|
|
1208
1212
|
let s = Date.now();
|
|
1209
1213
|
Ot = setInterval(async () => {
|
|
1210
1214
|
if (Date.now() - s > Zn) {
|
|
@@ -1212,12 +1216,12 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1212
1216
|
return;
|
|
1213
1217
|
}
|
|
1214
1218
|
try {
|
|
1215
|
-
let { data: o } = await
|
|
1219
|
+
let { data: o } = await n.request({
|
|
1216
1220
|
url: e,
|
|
1217
1221
|
method: "post",
|
|
1218
1222
|
data: {
|
|
1219
1223
|
executeId: t,
|
|
1220
|
-
nodes:
|
|
1224
|
+
nodes: r
|
|
1221
1225
|
},
|
|
1222
1226
|
appKey: y.appKey,
|
|
1223
1227
|
appSalt: y.appSalt
|
|
@@ -1227,7 +1231,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1227
1231
|
if (c.length) {
|
|
1228
1232
|
let e = /* @__PURE__ */ new Map();
|
|
1229
1233
|
c.forEach((t) => e.set(t.nodeId, t));
|
|
1230
|
-
let t = new Set(
|
|
1234
|
+
let t = new Set(r.map((e) => e.nodeId)), n = r.map((t) => {
|
|
1231
1235
|
let n = e.get(t.nodeId);
|
|
1232
1236
|
return {
|
|
1233
1237
|
id: t.nodeId,
|
|
@@ -1242,12 +1246,12 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1242
1246
|
content: st(e)
|
|
1243
1247
|
}));
|
|
1244
1248
|
Mt({
|
|
1245
|
-
tools: [...
|
|
1249
|
+
tools: [...n, ...i],
|
|
1246
1250
|
reasoning_content: ""
|
|
1247
1251
|
});
|
|
1248
1252
|
}
|
|
1249
1253
|
let l = c.find((e) => ct(e.status) === "calling"), u = c.some((e) => ct(e.status) === "success"), d = s.result?.url || s.result?.docx || s.url || s.docx, f = s.status === 20 || s.status === "20" || s.status === "COMPLETED";
|
|
1250
|
-
!l && (u || d || f) && (kt(), await ut(s,
|
|
1254
|
+
!l && (u || d || f) && (kt(), await ut(s, i), a());
|
|
1251
1255
|
} catch (e) {
|
|
1252
1256
|
console.error("[AiChat] 轮询执行状态失败:", e), kt(), o(e);
|
|
1253
1257
|
}
|
|
@@ -1270,32 +1274,32 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1270
1274
|
reasoning_content: "",
|
|
1271
1275
|
time: $()
|
|
1272
1276
|
}, a && await dt(t, a, s);
|
|
1273
|
-
}, dt = async (t, n
|
|
1274
|
-
let
|
|
1275
|
-
if (!
|
|
1277
|
+
}, dt = async (e, t, n) => {
|
|
1278
|
+
let r = y.ids?.saveTask;
|
|
1279
|
+
if (!r?.id) {
|
|
1276
1280
|
console.warn("[AiChat] 未配置 saveTask 工作流 id");
|
|
1277
1281
|
return;
|
|
1278
1282
|
}
|
|
1279
|
-
let a =
|
|
1280
|
-
workflowId:
|
|
1283
|
+
let a = n.replace(/\.[^.]+$/, ""), o = {
|
|
1284
|
+
workflowId: e,
|
|
1281
1285
|
materialType: K.value?.materialType || "",
|
|
1282
1286
|
title: a,
|
|
1283
|
-
httpUrl:
|
|
1287
|
+
httpUrl: t
|
|
1284
1288
|
};
|
|
1285
1289
|
console.log("[AiChat] saveTask 请求参数:", o);
|
|
1286
1290
|
try {
|
|
1287
|
-
let
|
|
1291
|
+
let e = await i({
|
|
1288
1292
|
appKey: y.appKey,
|
|
1289
1293
|
appSalt: y.appSalt,
|
|
1290
|
-
id:
|
|
1294
|
+
id: r.id,
|
|
1291
1295
|
variables: o,
|
|
1292
1296
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
1293
|
-
reqType:
|
|
1294
|
-
isFormData:
|
|
1297
|
+
reqType: r.reqType || "post",
|
|
1298
|
+
isFormData: r.isFormData ?? !1
|
|
1295
1299
|
});
|
|
1296
|
-
console.log("[AiChat] saveTask 工作流响应:",
|
|
1297
|
-
let
|
|
1298
|
-
a ? (ge.value = a[1], console.log("[AiChat] saveTask 任务 id:", a[1])) : console.warn("[AiChat] saveTask 响应中未解析到任务 id,output:",
|
|
1300
|
+
console.log("[AiChat] saveTask 工作流响应:", e);
|
|
1301
|
+
let t = e?.data?.result || e?.data, n = typeof t?.output == "string" ? t.output : "", a = n.match(/^data:\s*(\d+)/m) || n.match(/data:\s*(\d+)/);
|
|
1302
|
+
a ? (ge.value = a[1], console.log("[AiChat] saveTask 任务 id:", a[1])) : console.warn("[AiChat] saveTask 响应中未解析到任务 id,output:", n);
|
|
1299
1303
|
} catch (e) {
|
|
1300
1304
|
console.error("[AiChat] saveTask 工作流失败:", e);
|
|
1301
1305
|
}
|
|
@@ -1320,35 +1324,35 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1320
1324
|
}, gt = () => {
|
|
1321
1325
|
ke([]), we.value?.setCheckedKeys([]), Te.value?.setCheckedKeys([]);
|
|
1322
1326
|
}, _t = async () => {
|
|
1323
|
-
let
|
|
1324
|
-
if (!
|
|
1327
|
+
let e = y.ids?.channel;
|
|
1328
|
+
if (!e?.id) {
|
|
1325
1329
|
console.warn("[AiChat] 未配置 channel 工作流 id");
|
|
1326
1330
|
return;
|
|
1327
1331
|
}
|
|
1328
1332
|
try {
|
|
1329
|
-
let
|
|
1333
|
+
let t = await i({
|
|
1330
1334
|
appKey: y.appKey,
|
|
1331
1335
|
appSalt: y.appSalt,
|
|
1332
|
-
id:
|
|
1336
|
+
id: e.id,
|
|
1333
1337
|
variables: { newParam: "channel" },
|
|
1334
1338
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
1335
|
-
reqType:
|
|
1336
|
-
isFormData:
|
|
1339
|
+
reqType: e.reqType || "post",
|
|
1340
|
+
isFormData: e.isFormData ?? !1
|
|
1337
1341
|
});
|
|
1338
|
-
console.log("[AiChat] channel 原始响应:",
|
|
1339
|
-
let
|
|
1340
|
-
if (typeof
|
|
1341
|
-
|
|
1342
|
+
console.log("[AiChat] channel 原始响应:", t);
|
|
1343
|
+
let n = t?.data?.result ?? t?.data;
|
|
1344
|
+
if (typeof n == "string") try {
|
|
1345
|
+
n = JSON.parse(n);
|
|
1342
1346
|
} catch {
|
|
1343
|
-
|
|
1347
|
+
n = null;
|
|
1344
1348
|
}
|
|
1345
|
-
let
|
|
1349
|
+
let r = (e) => Array.isArray(e) ? e : !e || typeof e != "object" ? null : e.output ?? e.list ?? e.items ?? e.children ?? e.data ?? e.records ?? null, a = r(n);
|
|
1346
1350
|
if (typeof a == "string") try {
|
|
1347
1351
|
a = JSON.parse(a);
|
|
1348
1352
|
} catch {
|
|
1349
1353
|
a = null;
|
|
1350
1354
|
}
|
|
1351
|
-
a =
|
|
1355
|
+
a = r(a) || a, console.log("[AiChat] channel 解析后列表:", a), ve.value = Array.isArray(a) ? a : [];
|
|
1352
1356
|
} catch (e) {
|
|
1353
1357
|
console.error("[AiChat] 获取发布渠道失败:", e), ve.value = [];
|
|
1354
1358
|
}
|
|
@@ -1363,23 +1367,23 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1363
1367
|
}
|
|
1364
1368
|
return t && typeof t == "object" ? t : null;
|
|
1365
1369
|
}, bt = (e) => yt(e)?.data?.taskId ?? null, xt = async () => {
|
|
1366
|
-
let
|
|
1367
|
-
if (!
|
|
1370
|
+
let e = Array.from(new Set(ye.value.filter((e) => e != null)));
|
|
1371
|
+
if (!e.length) {
|
|
1368
1372
|
A.warning("请选择至少一个发布渠道");
|
|
1369
1373
|
return;
|
|
1370
1374
|
}
|
|
1371
|
-
let
|
|
1372
|
-
if (!
|
|
1375
|
+
let t = y.ids?.send;
|
|
1376
|
+
if (!t?.id) {
|
|
1373
1377
|
console.warn("[AiChat] 未配置 send 工作流 id"), A.warning("未配置发布工作流");
|
|
1374
1378
|
return;
|
|
1375
1379
|
}
|
|
1376
|
-
let
|
|
1377
|
-
if (!
|
|
1380
|
+
let n = y.ids?.handleTask;
|
|
1381
|
+
if (!n?.id) {
|
|
1378
1382
|
console.warn("[AiChat] 未配置 handleTask 工作流 id"), A.warning("未配置发布任务处理工作流");
|
|
1379
1383
|
return;
|
|
1380
1384
|
}
|
|
1381
|
-
let
|
|
1382
|
-
if (!
|
|
1385
|
+
let r = V.value?.name || "", a = r.replace(/\.[^.]+$/, ""), o = V.value?.fileUrl || "";
|
|
1386
|
+
if (!r || !o) {
|
|
1383
1387
|
A.warning("未获取到文件信息");
|
|
1384
1388
|
return;
|
|
1385
1389
|
}
|
|
@@ -1388,31 +1392,31 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
1388
1392
|
file_name: a,
|
|
1389
1393
|
file_path: o,
|
|
1390
1394
|
trigger_type: "1",
|
|
1391
|
-
channelIds:
|
|
1395
|
+
channelIds: e.join(",")
|
|
1392
1396
|
};
|
|
1393
1397
|
console.log("[AiChat] 发布参数:", s), xe.value = !0;
|
|
1394
1398
|
try {
|
|
1395
|
-
let
|
|
1399
|
+
let e = await i({
|
|
1396
1400
|
appKey: y.appKey,
|
|
1397
1401
|
appSalt: y.appSalt,
|
|
1398
|
-
id:
|
|
1402
|
+
id: t.id,
|
|
1399
1403
|
variables: s,
|
|
1400
1404
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
1401
|
-
reqType:
|
|
1402
|
-
isFormData:
|
|
1405
|
+
reqType: t.reqType || "post",
|
|
1406
|
+
isFormData: t.isFormData ?? !1
|
|
1403
1407
|
});
|
|
1404
|
-
console.log("[AiChat] 发布工作流响应:",
|
|
1405
|
-
let
|
|
1406
|
-
if (!
|
|
1407
|
-
console.log("[AiChat] 提取 taskId:",
|
|
1408
|
-
let a = await
|
|
1408
|
+
console.log("[AiChat] 发布工作流响应:", e);
|
|
1409
|
+
let r = bt(e);
|
|
1410
|
+
if (!r) throw Error("未获取到任务 ID");
|
|
1411
|
+
console.log("[AiChat] 提取 taskId:", r);
|
|
1412
|
+
let a = await i({
|
|
1409
1413
|
appKey: y.appKey,
|
|
1410
1414
|
appSalt: y.appSalt,
|
|
1411
|
-
id:
|
|
1412
|
-
variables: { taskId:
|
|
1415
|
+
id: n.id,
|
|
1416
|
+
variables: { taskId: r },
|
|
1413
1417
|
baseHttp: y.baseHttp.replace(/\/$/, ""),
|
|
1414
|
-
reqType:
|
|
1415
|
-
isFormData:
|
|
1418
|
+
reqType: n.reqType || "post",
|
|
1419
|
+
isFormData: n.isFormData ?? !1
|
|
1416
1420
|
});
|
|
1417
1421
|
console.log("[AiChat] handleTask 工作流响应:", a);
|
|
1418
1422
|
let o = yt(a);
|
|
@@ -2025,7 +2029,7 @@ var le = "data:image/gif;base64,R0lGODlhIAMgA/eQAAEAAAgHBwsKChUTExgXFxsZGSMYFSIe
|
|
|
2025
2029
|
});
|
|
2026
2030
|
}), E(X, (e) => {
|
|
2027
2031
|
e && (gt(), _t());
|
|
2028
|
-
}),
|
|
2032
|
+
}), r({
|
|
2029
2033
|
setResponse: Nt,
|
|
2030
2034
|
setLoading: (e) => {
|
|
2031
2035
|
N.value = e;
|