st-comp 0.0.274 → 0.0.276

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.
Files changed (143) hide show
  1. package/es/ChartLayout.js +4 -4
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +70 -71
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +35 -36
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +19 -20
  8. package/es/KlineBasic.cjs +1 -1
  9. package/es/KlineBasic.js +28 -29
  10. package/es/KlineConfig.cjs +1 -1
  11. package/es/KlineConfig.js +49 -50
  12. package/es/KlineNew.cjs +1 -1
  13. package/es/KlineNew.js +18 -19
  14. package/es/KlinePlus.cjs +1 -1
  15. package/es/KlinePlus.js +21 -22
  16. package/es/MonacoEditor.cjs +1 -1
  17. package/es/MonacoEditor.js +26 -27
  18. package/es/Pagination.cjs +1 -1
  19. package/es/Pagination.js +76 -77
  20. package/es/PasswordPrompt.js +3 -3
  21. package/es/Table.cjs +1 -1
  22. package/es/Table.js +37 -38
  23. package/es/User.cjs +1 -1
  24. package/es/User.js +141 -142
  25. package/es/VarSelectDialog.cjs +1 -1
  26. package/es/VarSelectDialog.js +27 -28
  27. package/es/VarietyAiHelper.cjs +7 -7
  28. package/es/VarietyAiHelper.js +488 -479
  29. package/es/VarietyAutoComplete.cjs +1 -1
  30. package/es/VarietyAutoComplete.js +12 -13
  31. package/es/VarietySearch.cjs +9 -9
  32. package/es/VarietySearch.js +298 -298
  33. package/es/{VarietySelect-7da473c5.cjs → VarietySelect-610903f0.cjs} +1 -1
  34. package/es/{VarietySelect-b01281d3.js → VarietySelect-6a166293.js} +4 -4
  35. package/es/VarietyTextCopy.cjs +1 -1
  36. package/es/VarietyTextCopy.js +22 -23
  37. package/es/VirtualTable.js +14 -14
  38. package/es/{_initCloneObject-6243b839.js → _initCloneObject-152b4f4e.js} +3 -3
  39. package/es/aiTools-9fd42de8.cjs +2 -0
  40. package/es/aiTools-d7bd47c3.js +113 -0
  41. package/es/aiTools.js +12 -2
  42. package/es/{base-29f73b05.js → base-a5af3db3.js} +2 -2
  43. package/es/{castArray-609a313e.js → castArray-7741a212.js} +1 -1
  44. package/es/{config-provider-20b05e99.js → config-provider-7a3aca55.js} +4 -4
  45. package/es/{debounce-a09ce9a3.js → debounce-8d53f4dd.js} +1 -1
  46. package/es/{dropdown-f8d9fe56.js → dropdown-01e09205.js} +19 -20
  47. package/es/dropdown-987c47fb.cjs +1 -0
  48. package/es/el-autocomplete-16f66b34.cjs +1 -0
  49. package/es/{el-autocomplete-3f34a1c3.js → el-autocomplete-342ae823.js} +17 -18
  50. package/es/{el-button-cd144ee1.js → el-button-314171a0.js} +4 -4
  51. package/es/{el-checkbox-d6c883f4.js → el-checkbox-5899681f.js} +4 -4
  52. package/es/el-checkbox-bdf64663.cjs +1 -0
  53. package/es/el-dialog-0ef95df6.cjs +1 -0
  54. package/es/{el-dialog-59a23c2b.js → el-dialog-86a3eec2.js} +6 -6
  55. package/es/{el-divider-523e5874.js → el-divider-4e059794.js} +1 -1
  56. package/es/{el-empty-f5a1607a.js → el-empty-33cb66f1.js} +3 -3
  57. package/es/{el-form-item-3475aaad.cjs → el-form-item-77ef6784.cjs} +1 -1
  58. package/es/{el-form-item-a9556441.js → el-form-item-cda4d93c.js} +8 -8
  59. package/es/el-input-89222943.cjs +1 -0
  60. package/es/{el-input-1f14a6e2.js → el-input-fa1445ad.js} +14 -14
  61. package/es/{el-input-number-411ac93d.js → el-input-number-8f6dbf74.js} +6 -6
  62. package/es/el-input-number-d3338e5e.cjs +1 -0
  63. package/es/{el-loading-cbeb3b86.js → el-loading-9b671203.js} +2 -2
  64. package/es/el-menu-item-4531fd0e.cjs +1 -0
  65. package/es/{el-menu-item-77152904.js → el-menu-item-535fef90.js} +17 -18
  66. package/es/{el-message-box-a26e3ed4.js → el-message-box-621ed2f1.js} +11 -11
  67. package/es/el-message-box-f5717070.cjs +1 -0
  68. package/es/el-overlay-151708cb.cjs +1 -0
  69. package/es/{el-overlay-465cd11e.js → el-overlay-23de4324.js} +19 -19
  70. package/es/el-popconfirm-b8aa490e.cjs +1 -0
  71. package/es/{el-popconfirm-289b3e89.js → el-popconfirm-bcff0aa5.js} +20 -21
  72. package/es/el-popper-03988662.js +2094 -0
  73. package/es/el-popper-43ec37f4.cjs +1 -0
  74. package/es/el-segmented-79a1367c.cjs +1 -0
  75. package/es/{el-segmented-598b92b0.js → el-segmented-db3a86be.js} +4 -4
  76. package/es/{el-select-d47b5923.js → el-select-4bd0010d.js} +43 -44
  77. package/es/el-select-ec04e7ce.cjs +1 -0
  78. package/es/el-table-column-35e47229.cjs +14 -0
  79. package/es/{el-table-column-f1017e75.js → el-table-column-7af2bec7.js} +24 -25
  80. package/es/el-tag-5d5608e0.cjs +1 -0
  81. package/es/{el-tag-0a4197f5.js → el-tag-bef9e83d.js} +13 -13
  82. package/es/{el-text-c3ee80fe.js → el-text-f998902c.js} +2 -2
  83. package/es/{index-67180968.js → index-102edf6c.js} +3 -3
  84. package/es/{index-a76e80d9.cjs → index-2d7ac156.cjs} +2 -2
  85. package/es/{index-1b97095f.js → index-5c44d71a.js} +1 -1
  86. package/es/{index-d3e9a6f2.js → index-5ed42e9c.js} +11 -11
  87. package/es/{index-3301d870.js → index-6290ae0f.js} +3 -3
  88. package/es/{index-a17c90c5.js → index-936e7dec.js} +2 -2
  89. package/es/{index-8391a3df.js → index-960806da.js} +3 -3
  90. package/es/index-a00e0534.cjs +1 -0
  91. package/es/{index-33430c9f.js → index-a83ec4b7.js} +3 -3
  92. package/es/index-c58e90e9.cjs +1 -0
  93. package/es/{index-499cf989.js → index-ce21e2ce.js} +17 -17
  94. package/es/index-cfd00899.cjs +1 -0
  95. package/es/{index-afc4a1e5.js → index-d1b554ac.js} +3 -3
  96. package/es/{index-de24705f.js → index-d77a7336.js} +1 -1
  97. package/es/{index-3ed7914e.cjs → index-db846633.cjs} +1 -1
  98. package/es/{index-5b47cf8f.js → index-f3f6ee27.js} +11 -11
  99. package/es/{python-df3d529e.js → python-6cc6ec1b.js} +28 -29
  100. package/es/{python-b5d87b74.cjs → python-71f59893.cjs} +1 -1
  101. package/es/{raf-744cf95a.js → raf-80ef0c0a.js} +1 -1
  102. package/es/{scroll-6799bafc.js → scroll-679bd6bf.js} +1 -1
  103. package/es/style.css +1 -1
  104. package/es/{use-form-common-props-dd9617de.js → use-form-common-props-76a09d89.js} +28 -28
  105. package/es/{use-global-config-4dfc7236.js → use-global-config-0f43458b.js} +4 -4
  106. package/es/{validator-029bfc98.js → validator-0e037618.js} +1 -1
  107. package/es/{vnode-a83e6de8.js → vnode-5ddb7ed1.js} +1 -1
  108. package/es/{zh-cn-89e434f9.js → zh-cn-1227eb8a.js} +2 -2
  109. package/lib/aiTools.js +12 -2
  110. package/lib/bundle.js +1 -1
  111. package/lib/bundle.umd.cjs +172 -172
  112. package/lib/{index-a854f18c.js → index-8b55d8c8.js} +13934 -13924
  113. package/lib/{python-77c3b638.js → python-f164f783.js} +1 -1
  114. package/lib/style.css +1 -1
  115. package/package.json +1 -1
  116. package/packages/VarietyAiHelper/images/like.png +0 -0
  117. package/packages/VarietyAiHelper/images/like_no.png +0 -0
  118. package/packages/VarietyAiHelper/index.vue +351 -410
  119. package/packages/VarietySearch/index.vue +1 -1
  120. package/public/aiTools.js +12 -2
  121. package/es/aiTools-4412c56c.cjs +0 -2
  122. package/es/aiTools-e6e4e996.js +0 -111
  123. package/es/dropdown-33c19e56.cjs +0 -1
  124. package/es/el-autocomplete-525ca867.cjs +0 -1
  125. package/es/el-checkbox-95325acd.cjs +0 -1
  126. package/es/el-dialog-4056070b.cjs +0 -1
  127. package/es/el-input-c7bf8e44.cjs +0 -1
  128. package/es/el-input-number-9d810842.cjs +0 -1
  129. package/es/el-menu-item-18d7d869.cjs +0 -1
  130. package/es/el-message-box-e4b8cc99.cjs +0 -1
  131. package/es/el-overlay-d26a1b98.cjs +0 -1
  132. package/es/el-popconfirm-12f6f35c.cjs +0 -1
  133. package/es/el-popper-c7648df6.cjs +0 -1
  134. package/es/el-popper-f96fc206.js +0 -1662
  135. package/es/el-segmented-f0bce6f2.cjs +0 -1
  136. package/es/el-select-f3cc464f.cjs +0 -1
  137. package/es/el-table-column-220ae131.cjs +0 -14
  138. package/es/el-tag-51bd491c.cjs +0 -1
  139. package/es/index-09ce1753.cjs +0 -1
  140. package/es/index-4b95bae1.cjs +0 -1
  141. package/es/index-68798830.cjs +0 -1
  142. package/es/index-8e88a0bd.js +0 -440
  143. package/es/index-d2cfd4a3.cjs +0 -1
@@ -1,34 +1,35 @@
1
- import { b as de, p as pe, e as te, u as fe, c as oe, n as _e, _ as me, w as ve, x as ye } from "./base-29f73b05.js";
2
- import { E as be } from "./el-dialog-59a23c2b.js";
3
- import "./el-overlay-465cd11e.js";
4
- import { E as we } from "./el-button-cd144ee1.js";
5
- import { E as Te } from "./el-input-1f14a6e2.js";
6
- import { defineComponent as se, ref as w, computed as f, watch as re, openBlock as i, createElementBlock as d, normalizeClass as y, unref as s, normalizeStyle as x, createBlock as K, withCtx as P, resolveDynamicComponent as ge, renderSlot as le, createElementVNode as r, toDisplayString as O, createCommentVNode as A, inject as Se, reactive as Ce, nextTick as ae, Fragment as q, createVNode as C, renderList as ue, createTextVNode as ne, pushScopeId as $e, popScopeId as Ee } from "vue";
7
- import { d as X } from "./dayjs.min-8313b006.js";
8
- import { V as Pe, U as De } from "./index-7ed0999e.js";
9
- import { s as Fe } from "./aiTools-e6e4e996.js";
10
- import { E as ie, w as Ne, o as Ve, p as Me, s as Ae, c as Ye, u as He, t as Le, v as Be, x as Ie, y as ze } from "./index-1b97095f.js";
11
- import { _ as xe } from "./_plugin-vue_export-helper-dad06003.js";
12
- import { E as ee } from "./index-499cf989.js";
13
- import { k as Oe, i as Re } from "./use-form-common-props-dd9617de.js";
14
- import "./index-8e88a0bd.js";
15
- import "./index-8391a3df.js";
16
- import "./index-de24705f.js";
1
+ import { b as de, p as pe, e as ee, u as fe, c as ae, n as ye, _ as me, w as ve, x as we } from "./base-a5af3db3.js";
2
+ import { E as be } from "./el-dialog-86a3eec2.js";
3
+ import "./el-overlay-23de4324.js";
4
+ import { E as _e } from "./el-input-fa1445ad.js";
5
+ import { E as Te } from "./el-button-314171a0.js";
6
+ import "./el-tooltip-4ed993c7.js";
7
+ import { E as Se } from "./el-popper-03988662.js";
8
+ import { defineComponent as te, ref as k, computed as m, watch as oe, openBlock as l, createElementBlock as p, normalizeClass as w, unref as s, normalizeStyle as J, createBlock as O, withCtx as y, resolveDynamicComponent as ge, renderSlot as ne, createElementVNode as d, toDisplayString as H, createCommentVNode as N, inject as De, reactive as Ce, nextTick as se, Fragment as X, createVNode as h, renderList as ue, createTextVNode as Z, pushScopeId as Me, popScopeId as Ee } from "vue";
9
+ import { d as j } from "./dayjs.min-8313b006.js";
10
+ import { V as Ve, U as Be } from "./index-7ed0999e.js";
11
+ import { s as Ue } from "./aiTools-d7bd47c3.js";
12
+ import { E as re, w as Ie, o as Fe, p as Ne, s as Pe, c as Qe, u as Ye, t as ze, v as Je, x as He, y as Ke } from "./index-5c44d71a.js";
13
+ import { _ as Oe } from "./_plugin-vue_export-helper-dad06003.js";
14
+ import { E as W } from "./index-ce21e2ce.js";
15
+ import { k as Re, i as Le } from "./use-form-common-props-76a09d89.js";
16
+ import "./index-d77a7336.js";
17
+ import "./index-960806da.js";
17
18
  import "./index-2e331d74.js";
18
- import "./vnode-a83e6de8.js";
19
- import "./scroll-6799bafc.js";
20
- import "./use-global-config-4dfc7236.js";
21
- import "./index-33430c9f.js";
22
- import "./index-657047bb.js";
19
+ import "./vnode-5ddb7ed1.js";
20
+ import "./scroll-679bd6bf.js";
21
+ import "./use-global-config-0f43458b.js";
22
+ import "./index-a83ec4b7.js";
23
23
  import "./typescript-7ae59c4c.js";
24
- import "./index-d3e9a6f2.js";
25
- import "./config-provider-20b05e99.js";
26
- const Ue = de({
24
+ import "./index-5ed42e9c.js";
25
+ import "./index-657047bb.js";
26
+ import "./config-provider-7a3aca55.js";
27
+ const xe = de({
27
28
  size: {
28
29
  type: [Number, String],
29
- values: Oe,
30
+ values: Re,
30
31
  default: "",
31
- validator: (p) => pe(p)
32
+ validator: (f) => pe(f)
32
33
  },
33
34
  shape: {
34
35
  type: String,
@@ -36,7 +37,7 @@ const Ue = de({
36
37
  default: "circle"
37
38
  },
38
39
  icon: {
39
- type: Re
40
+ type: Le
40
41
  },
41
42
  src: {
42
43
  type: String,
@@ -45,55 +46,55 @@ const Ue = de({
45
46
  alt: String,
46
47
  srcSet: String,
47
48
  fit: {
48
- type: te(String),
49
+ type: ee(String),
49
50
  default: "cover"
50
51
  }
51
- }), je = {
52
- error: (p) => p instanceof Event
53
- }, Je = se({
52
+ }), $e = {
53
+ error: (f) => f instanceof Event
54
+ }, je = te({
54
55
  name: "ElAvatar"
55
- }), We = /* @__PURE__ */ se({
56
- ...Je,
57
- props: Ue,
58
- emits: je,
59
- setup(p, { emit: c }) {
60
- const D = p, l = fe("avatar"), F = w(!1), N = f(() => {
61
- const { size: u, icon: v, shape: $ } = D, T = [l.b()];
62
- return oe(u) && T.push(l.m(u)), v && T.push(l.m("icon")), $ && T.push(l.m($)), T;
63
- }), U = f(() => {
64
- const { size: u } = D;
65
- return pe(u) ? l.cssVarBlock({
66
- size: _e(u) || ""
56
+ }), qe = /* @__PURE__ */ te({
57
+ ...je,
58
+ props: xe,
59
+ emits: $e,
60
+ setup(f, { emit: i }) {
61
+ const C = f, r = fe("avatar"), M = k(!1), E = m(() => {
62
+ const { size: c, icon: T, shape: V } = C, a = [r.b()];
63
+ return ae(c) && a.push(r.m(c)), T && a.push(r.m("icon")), V && a.push(r.m(V)), a;
64
+ }), R = m(() => {
65
+ const { size: c } = C;
66
+ return pe(c) ? r.cssVarBlock({
67
+ size: ye(c) || ""
67
68
  }) : void 0;
68
- }), J = f(() => ({
69
- objectFit: D.fit
69
+ }), L = m(() => ({
70
+ objectFit: C.fit
70
71
  }));
71
- re(() => D.src, () => F.value = !1);
72
- function k(u) {
73
- F.value = !0, c("error", u);
72
+ oe(() => C.src, () => M.value = !1);
73
+ function A(c) {
74
+ M.value = !0, i("error", c);
74
75
  }
75
- return (u, v) => (i(), d("span", {
76
- class: y(s(N)),
77
- style: x(s(U))
76
+ return (c, T) => (l(), p("span", {
77
+ class: w(s(E)),
78
+ style: J(s(R))
78
79
  }, [
79
- (u.src || u.srcSet) && !F.value ? (i(), d("img", {
80
+ (c.src || c.srcSet) && !M.value ? (l(), p("img", {
80
81
  key: 0,
81
- src: u.src,
82
- alt: u.alt,
83
- srcset: u.srcSet,
84
- style: x(s(J)),
85
- onError: k
86
- }, null, 44, ["src", "alt", "srcset"])) : u.icon ? (i(), K(s(ie), { key: 1 }, {
87
- default: P(() => [
88
- (i(), K(ge(u.icon)))
82
+ src: c.src,
83
+ alt: c.alt,
84
+ srcset: c.srcSet,
85
+ style: J(s(L)),
86
+ onError: A
87
+ }, null, 44, ["src", "alt", "srcset"])) : c.icon ? (l(), O(s(re), { key: 1 }, {
88
+ default: y(() => [
89
+ (l(), O(ge(c.icon)))
89
90
  ]),
90
91
  _: 1
91
- })) : le(u.$slots, "default", { key: 2 })
92
+ })) : ne(c.$slots, "default", { key: 2 })
92
93
  ], 6));
93
94
  }
94
95
  });
95
- var qe = /* @__PURE__ */ me(We, [["__file", "avatar.vue"]]);
96
- const Ke = ve(qe), Ge = de({
96
+ var Ge = /* @__PURE__ */ me(qe, [["__file", "avatar.vue"]]);
97
+ const Xe = ve(Ge), Ze = de({
97
98
  type: {
98
99
  type: String,
99
100
  default: "line",
@@ -102,7 +103,7 @@ const Ke = ve(qe), Ge = de({
102
103
  percentage: {
103
104
  type: Number,
104
105
  default: 0,
105
- validator: (p) => p >= 0 && p <= 100
106
+ validator: (f) => f >= 0 && f <= 100
106
107
  },
107
108
  status: {
108
109
  type: String,
@@ -119,7 +120,7 @@ const Ke = ve(qe), Ge = de({
119
120
  default: 6
120
121
  },
121
122
  strokeLinecap: {
122
- type: te(String),
123
+ type: ee(String),
123
124
  default: "round"
124
125
  },
125
126
  textInside: Boolean,
@@ -132,7 +133,7 @@ const Ke = ve(qe), Ge = de({
132
133
  default: !0
133
134
  },
134
135
  color: {
135
- type: te([
136
+ type: ee([
136
137
  String,
137
138
  Array,
138
139
  Function
@@ -142,75 +143,75 @@ const Ke = ve(qe), Ge = de({
142
143
  striped: Boolean,
143
144
  stripedFlow: Boolean,
144
145
  format: {
145
- type: te(Function),
146
- default: (p) => `${p}%`
146
+ type: ee(Function),
147
+ default: (f) => `${f}%`
147
148
  }
148
- }), Qe = se({
149
+ }), We = te({
149
150
  name: "ElProgress"
150
- }), Xe = /* @__PURE__ */ se({
151
- ...Qe,
152
- props: Ge,
153
- setup(p) {
154
- const c = p, D = {
151
+ }), et = /* @__PURE__ */ te({
152
+ ...We,
153
+ props: Ze,
154
+ setup(f) {
155
+ const i = f, C = {
155
156
  success: "#13ce66",
156
157
  exception: "#ff4949",
157
158
  warning: "#e6a23c",
158
159
  default: "#20a0ff"
159
- }, l = fe("progress"), F = f(() => {
160
+ }, r = fe("progress"), M = m(() => {
160
161
  const e = {
161
- width: `${c.percentage}%`,
162
- animationDuration: `${c.duration}s`
163
- }, g = G(c.percentage);
162
+ width: `${i.percentage}%`,
163
+ animationDuration: `${i.duration}s`
164
+ }, g = b(i.percentage);
164
165
  return g.includes("gradient") ? e.background = g : e.backgroundColor = g, e;
165
- }), N = f(() => (c.strokeWidth / c.width * 100).toFixed(1)), U = f(() => ["circle", "dashboard"].includes(c.type) ? Number.parseInt(`${50 - Number.parseFloat(N.value) / 2}`, 10) : 0), J = f(() => {
166
- const e = U.value, g = c.type === "dashboard";
166
+ }), E = m(() => (i.strokeWidth / i.width * 100).toFixed(1)), R = m(() => ["circle", "dashboard"].includes(i.type) ? Number.parseInt(`${50 - Number.parseFloat(E.value) / 2}`, 10) : 0), L = m(() => {
167
+ const e = R.value, g = i.type === "dashboard";
167
168
  return `
168
169
  M 50 50
169
170
  m 0 ${g ? "" : "-"}${e}
170
171
  a ${e} ${e} 0 1 1 0 ${g ? "-" : ""}${e * 2}
171
172
  a ${e} ${e} 0 1 1 0 ${g ? "" : "-"}${e * 2}
172
173
  `;
173
- }), k = f(() => 2 * Math.PI * U.value), u = f(() => c.type === "dashboard" ? 0.75 : 1), v = f(() => `${-1 * k.value * (1 - u.value) / 2}px`), $ = f(() => ({
174
- strokeDasharray: `${k.value * u.value}px, ${k.value}px`,
175
- strokeDashoffset: v.value
176
- })), T = f(() => ({
177
- strokeDasharray: `${k.value * u.value * (c.percentage / 100)}px, ${k.value}px`,
178
- strokeDashoffset: v.value,
174
+ }), A = m(() => 2 * Math.PI * R.value), c = m(() => i.type === "dashboard" ? 0.75 : 1), T = m(() => `${-1 * A.value * (1 - c.value) / 2}px`), V = m(() => ({
175
+ strokeDasharray: `${A.value * c.value}px, ${A.value}px`,
176
+ strokeDashoffset: T.value
177
+ })), a = m(() => ({
178
+ strokeDasharray: `${A.value * c.value * (i.percentage / 100)}px, ${A.value}px`,
179
+ strokeDashoffset: T.value,
179
180
  transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
180
- })), o = f(() => {
181
+ })), q = m(() => {
181
182
  let e;
182
- return c.color ? e = G(c.percentage) : e = D[c.status] || D.default, e;
183
- }), V = f(() => c.status === "warning" ? Ne : c.type === "line" ? c.status === "success" ? Ve : Me : c.status === "success" ? Ae : Ye), Y = f(() => c.type === "line" ? 12 + c.strokeWidth * 0.4 : c.width * 0.111111 + 2), H = f(() => c.format(c.percentage));
184
- function Z(e) {
183
+ return i.color ? e = b(i.percentage) : e = C[i.status] || C.default, e;
184
+ }), B = m(() => i.status === "warning" ? Ie : i.type === "line" ? i.status === "success" ? Fe : Ne : i.status === "success" ? Pe : Qe), P = m(() => i.type === "line" ? 12 + i.strokeWidth * 0.4 : i.width * 0.111111 + 2), Q = m(() => i.format(i.percentage));
185
+ function G(e) {
185
186
  const g = 100 / e.length;
186
- return e.map((b, B) => oe(b) ? {
187
- color: b,
188
- percentage: (B + 1) * g
189
- } : b).sort((b, B) => b.percentage - B.percentage);
187
+ return e.map((S, U) => ae(S) ? {
188
+ color: S,
189
+ percentage: (U + 1) * g
190
+ } : S).sort((S, U) => S.percentage - U.percentage);
190
191
  }
191
- const G = (e) => {
192
+ const b = (e) => {
192
193
  var g;
193
- const { color: L } = c;
194
- if (ye(L))
195
- return L(e);
196
- if (oe(L))
197
- return L;
194
+ const { color: Y } = i;
195
+ if (we(Y))
196
+ return Y(e);
197
+ if (ae(Y))
198
+ return Y;
198
199
  {
199
- const b = Z(L);
200
- for (const B of b)
201
- if (B.percentage > e)
202
- return B.color;
203
- return (g = b[b.length - 1]) == null ? void 0 : g.color;
200
+ const S = G(Y);
201
+ for (const U of S)
202
+ if (U.percentage > e)
203
+ return U.color;
204
+ return (g = S[S.length - 1]) == null ? void 0 : g.color;
204
205
  }
205
206
  };
206
- return (e, g) => (i(), d("div", {
207
- class: y([
208
- s(l).b(),
209
- s(l).m(e.type),
210
- s(l).is(e.status),
207
+ return (e, g) => (l(), p("div", {
208
+ class: w([
209
+ s(r).b(),
210
+ s(r).m(e.type),
211
+ s(r).is(e.status),
211
212
  {
212
- [s(l).m("without-text")]: !e.showText,
213
- [s(l).m("text-inside")]: e.textInside
213
+ [s(r).m("without-text")]: !e.showText,
214
+ [s(r).m("text-inside")]: e.textInside
214
215
  }
215
216
  ]),
216
217
  role: "progressbar",
@@ -218,97 +219,95 @@ const Ke = ve(qe), Ge = de({
218
219
  "aria-valuemin": "0",
219
220
  "aria-valuemax": "100"
220
221
  }, [
221
- e.type === "line" ? (i(), d("div", {
222
+ e.type === "line" ? (l(), p("div", {
222
223
  key: 0,
223
- class: y(s(l).b("bar"))
224
+ class: w(s(r).b("bar"))
224
225
  }, [
225
- r("div", {
226
- class: y(s(l).be("bar", "outer")),
227
- style: x({ height: `${e.strokeWidth}px` })
226
+ d("div", {
227
+ class: w(s(r).be("bar", "outer")),
228
+ style: J({ height: `${e.strokeWidth}px` })
228
229
  }, [
229
- r("div", {
230
- class: y([
231
- s(l).be("bar", "inner"),
232
- { [s(l).bem("bar", "inner", "indeterminate")]: e.indeterminate },
233
- { [s(l).bem("bar", "inner", "striped")]: e.striped },
234
- { [s(l).bem("bar", "inner", "striped-flow")]: e.stripedFlow }
230
+ d("div", {
231
+ class: w([
232
+ s(r).be("bar", "inner"),
233
+ { [s(r).bem("bar", "inner", "indeterminate")]: e.indeterminate },
234
+ { [s(r).bem("bar", "inner", "striped")]: e.striped },
235
+ { [s(r).bem("bar", "inner", "striped-flow")]: e.stripedFlow }
235
236
  ]),
236
- style: x(s(F))
237
+ style: J(s(M))
237
238
  }, [
238
- (e.showText || e.$slots.default) && e.textInside ? (i(), d("div", {
239
+ (e.showText || e.$slots.default) && e.textInside ? (l(), p("div", {
239
240
  key: 0,
240
- class: y(s(l).be("bar", "innerText"))
241
+ class: w(s(r).be("bar", "innerText"))
241
242
  }, [
242
- le(e.$slots, "default", { percentage: e.percentage }, () => [
243
- r("span", null, O(s(H)), 1)
243
+ ne(e.$slots, "default", { percentage: e.percentage }, () => [
244
+ d("span", null, H(s(Q)), 1)
244
245
  ])
245
- ], 2)) : A("v-if", !0)
246
+ ], 2)) : N("v-if", !0)
246
247
  ], 6)
247
248
  ], 6)
248
- ], 2)) : (i(), d("div", {
249
+ ], 2)) : (l(), p("div", {
249
250
  key: 1,
250
- class: y(s(l).b("circle")),
251
- style: x({ height: `${e.width}px`, width: `${e.width}px` })
251
+ class: w(s(r).b("circle")),
252
+ style: J({ height: `${e.width}px`, width: `${e.width}px` })
252
253
  }, [
253
- (i(), d("svg", { viewBox: "0 0 100 100" }, [
254
- r("path", {
255
- class: y(s(l).be("circle", "track")),
256
- d: s(J),
257
- stroke: `var(${s(l).cssVarName("fill-color-light")}, #e5e9f2)`,
254
+ (l(), p("svg", { viewBox: "0 0 100 100" }, [
255
+ d("path", {
256
+ class: w(s(r).be("circle", "track")),
257
+ d: s(L),
258
+ stroke: `var(${s(r).cssVarName("fill-color-light")}, #e5e9f2)`,
258
259
  "stroke-linecap": e.strokeLinecap,
259
- "stroke-width": s(N),
260
+ "stroke-width": s(E),
260
261
  fill: "none",
261
- style: x(s($))
262
+ style: J(s(V))
262
263
  }, null, 14, ["d", "stroke", "stroke-linecap", "stroke-width"]),
263
- r("path", {
264
- class: y(s(l).be("circle", "path")),
265
- d: s(J),
266
- stroke: s(o),
264
+ d("path", {
265
+ class: w(s(r).be("circle", "path")),
266
+ d: s(L),
267
+ stroke: s(q),
267
268
  fill: "none",
268
269
  opacity: e.percentage ? 1 : 0,
269
270
  "stroke-linecap": e.strokeLinecap,
270
- "stroke-width": s(N),
271
- style: x(s(T))
271
+ "stroke-width": s(E),
272
+ style: J(s(a))
272
273
  }, null, 14, ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"])
273
274
  ]))
274
275
  ], 6)),
275
- (e.showText || e.$slots.default) && !e.textInside ? (i(), d("div", {
276
+ (e.showText || e.$slots.default) && !e.textInside ? (l(), p("div", {
276
277
  key: 2,
277
- class: y(s(l).e("text")),
278
- style: x({ fontSize: `${s(Y)}px` })
278
+ class: w(s(r).e("text")),
279
+ style: J({ fontSize: `${s(P)}px` })
279
280
  }, [
280
- le(e.$slots, "default", { percentage: e.percentage }, () => [
281
- e.status ? (i(), K(s(ie), { key: 1 }, {
282
- default: P(() => [
283
- (i(), K(ge(s(V))))
281
+ ne(e.$slots, "default", { percentage: e.percentage }, () => [
282
+ e.status ? (l(), O(s(re), { key: 1 }, {
283
+ default: y(() => [
284
+ (l(), O(ge(s(B))))
284
285
  ]),
285
286
  _: 1
286
- })) : (i(), d("span", { key: 0 }, O(s(H)), 1))
287
+ })) : (l(), p("span", { key: 0 }, H(s(Q)), 1))
287
288
  ])
288
- ], 6)) : A("v-if", !0)
289
+ ], 6)) : N("v-if", !0)
289
290
  ], 10, ["aria-valuenow"]));
290
291
  }
291
292
  });
292
- var Ze = /* @__PURE__ */ me(Xe, [["__file", "progress.vue"]]);
293
- const et = ve(Ze);
294
- const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-dialog-body" }, st = { class: "avatar" }, at = { class: "message-content" }, nt = {
293
+ var tt = /* @__PURE__ */ me(et, [["__file", "progress.vue"]]);
294
+ const st = ve(tt);
295
+ const at = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMaSURBVHgB7ZhdbhMxEMf/9lLRN3oDlhMQTkB6AnqDlqdSVYgaDkD6zIdTKGqLkJreoD1BywnIDdiegPBWKYmH8e4mdZbAeqlTrcT+pJX8MV57dsee8QANDQ0NDf8zAgtA608tRJEGIeYZEjOmk1dqq4cFEFwBrQ9iSHzjV68UuhIYWlVqK0FAJAJDEDtzFm9hxcS51scrCEhwBYQUj6cVQ7tk6MTpjg2udhCQoAqk5gNqOU29l2prw7Ai0wmlfIGABFXAAG2n2p/Yu8RV97qZVvb3v9xHIIIqIKV4PSnzVz+blJVSAyyIYAroj0d28bHz4h5ugSAKvNVHa7xhO9MGtnn3uNRaz5w8w2H0E4G4sQJ28ZE0x05TwovvuDIjLDsbWwyUehrMpO74CqYmQtTmg74920O49oc04J28Whwr05Pp2mfqD4fH82cRAzMeX0qIU1+H5+WJecLz3xdexC7esKfd7v/b+AJSdNTzzd1SsTKBd/pgw2NyDhPwaN7iLRwLfUVVeE+lc5dQakKZ46GsQjhlM1Lp+0Fr3Kfz9uRvv5wDuQ47ucQ4p9Q8BIcgQuIJcjkZiXWUnGYee8DxrDTm02U7sUX+OpU2ovKMRlnRLpvP92w+0SqTr3QKLS3d/YFbhUoDv+DB3E0ZzZpZv0y+dgpEEGuTMkeyl2XytVMg38RZGXxolFArBbT+bDdt7DRdlI2plQIGo7ZT7ft441opIGW0PikbI068xqAmFG9zEqMLn3G1UaBwm0v+FJYUqY0CediQQgZn3uNQA1LzcQJGgXHPd6yHAjSNeYbD4QMsADafDafa9zUfS3kwJ0R/+nU4+nyjD9JoVEbyIUemuQxulKziZMDUfDiM3kMFyhXgvCZHh+2sQq07nF3LiuRKtfTeIWV/SwxsPjRvT7JblrF34IQgBwSTPmMuW4HliDMZVM15uXjdyN7rwy67+KAJqblkyYBOlSHeyV1tb0ci/dVx4Q0xQkC4UDvPVqsOC5KdzhK2V3YfxHlTbGN5Y29Y9hG4N9MnbJyfJ4B54XxxOVNqs4uGhoaGhoaK/AINQhvhDFaFYAAAAABJRU5ErkJggg==", ot = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMxSURBVHgB7ZhdbtNAEMdn1wmlTzUnIJyA9ASkNwgnaCMh0aKK1uIATV4R1bbQUlVCSrhBewLCCSg3CCfAPBFoM8PsxnHcVGHX7UZYwj/JytrecXb2a+a/ACUlJSUl/zMCPKBUNxzCMAwAQwEylAA1AAr586EM5Mq4zM9IhOPy+F3ShAtEPHwVbfXgFjg78Ea9bwaBXAeC+syrGvhAwFn0cvMp5MTJAfX2VAHRLiwYROrwSLTz2Fgd2FcnG1KKLjhBMU+TmD/LFw34QUwEP4if87QaJJX4F/m95AtDCII9HtVm0pwY8N6jKGrF4EjFVkEGQk+bBHEBOOroP0KABju2N2439KPdzTW4BUqpFsj7jfGaoBBhqEe67WovrTUIGmkZr1pR9OIsirb6MO3ROxFFUYwIh2mDAvEkh7mDAxmq1aXvsAC4Eb30hjtMqZNGDtt/D4/ogFdjf3Kvp6erbSEc0OAIzydlXlvrrnaFcUDCr17mtqbUcd3NriDoxXx9Gsmmi11hHNDgiD5Pyq67UaEcuLkbdUMHm+JgdqNMfEH4vWGzKZQDGkJIdyMB2LDVL5wDCNiflIUUj231C+dAoPOtKTVb/cI5wC5YF24WazZqMlAgE1Qu8ergtTrujDgVFhWxomO+KzotB0uPGvVG1Egf0DQuzMPqAMu9cw7t9eSDzaoMmlXzIlNJiDonYLVkF7nBvjrdlZIU2CCavf9oM7FOIaOQhK0nWONK+WVe+JcB5EqRDazOIged7KyJlZ4CQu6AoL/kKFpR4ersSPD0aafiR9chOpv7CcKvetommsPKnU8lFIt9MJJzcsrAgQiXVrOy0OT3UnxK/jKOdp4/AE/ceRfSCo2Hu5V5VEtkYYZhZmuk8Ojow0PwhJdtVDtBWVko5U42jzGZ5oLwFgcE/GybUwlDKs4XjjcHbojzjKrik4dcwSkPXiPxtXSY18JkrlNlOSsRB9vbz76BJ7w6MJsOX9JoQ7073RMIB2klh+iaB++5EB8PTqMnUttcUwYcAzrgEe8OSBgeTBfzNTg+0Nq8dOO2eDlen8WkFKLSTY7Vudf1kclyL8+ZZ0lJSUlJiQt/AOgzKhZAFyVoAAAAAElFTkSuQmCC";
296
+ const le = (f) => (Me("data-v-4ba59779"), f = f(), Ee(), f), nt = { class: "ai-dialog-body" }, rt = { class: "avatar" }, lt = { class: "message-content" }, it = {
295
297
  key: 0,
296
- class: "node-progress"
297
- }, ot = { class: "node-status-icon" }, rt = { class: "node-name" }, lt = { class: "progress-footer" }, it = { class: "progress-text" }, ct = ["innerHTML"], ut = { class: "message-createTime" }, dt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), pt = { class: "feedback-buttons" }, ft = ["onClick"], mt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-emoji" }, "👍", -1)), vt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-text" }, "满意", -1)), gt = [
298
- mt,
299
- vt
300
- ], ht = ["onClick"], kt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-emoji" }, "👎", -1)), _t = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-text" }, "不满意", -1)), yt = [
301
- kt,
302
- _t
303
- ], bt = {
298
+ style: { "font-weight": "bold", "margin-bottom": "10px" }
299
+ }, ct = {
304
300
  key: 1,
305
- class: "message-createTime"
306
- }, wt = {
301
+ class: "node-progress"
302
+ }, ut = { class: "node-status-icon" }, dt = { class: "node-name" }, pt = { class: "progress-footer" }, ft = { class: "progress-text" }, mt = ["innerHTML"], vt = {
303
+ key: 4,
304
+ class: "message-content-footer"
305
+ }, gt = {
307
306
  key: 0,
308
- class: "thinking-placeholder"
309
- }, Tt = { class: "input-area" }, St = { class: "input-actions" }, Ct = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "input-hint" }, [
310
- /* @__PURE__ */ r("span", null, "Enter 发送 | Ctrl + Enter 换行")
311
- ], -1)), $t = { class: "feedback-dialog-content" }, Et = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "feedback-emoji" }, "😟", -1)), Pt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), Dt = { class: "dialog-footer" }, Ft = {
307
+ class: "feedback-box"
308
+ }, At = ["onClick"], ht = ["onClick"], kt = { class: "input-area" }, yt = { class: "input-actions" }, wt = /* @__PURE__ */ le(() => /* @__PURE__ */ d("div", { class: "input-hint" }, [
309
+ /* @__PURE__ */ d("span", null, "Enter 发送 | Ctrl + Enter 换行")
310
+ ], -1)), bt = { class: "feedback-dialog-content" }, _t = /* @__PURE__ */ le(() => /* @__PURE__ */ d("div", { class: "feedback-emoji" }, "😟", -1)), Tt = /* @__PURE__ */ le(() => /* @__PURE__ */ d("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), St = { class: "dialog-footer" }, Dt = {
312
311
  __name: "index",
313
312
  props: {
314
313
  defaultMessage: {
@@ -320,218 +319,208 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
320
319
  }
321
320
  },
322
321
  emits: ["callBack"],
323
- setup(p, { expose: c, emit: D }) {
324
- const l = Se("stConfig"), F = Ce(Pe()), N = w(!1), U = D, J = p, k = w(!1), u = w(!1), v = w([]), $ = w(!1), T = w(null), o = w([
322
+ setup(f, { expose: i, emit: C }) {
323
+ const r = De("stConfig"), M = Ce(Ve()), E = k(!1), R = C, L = f, A = k(!1), c = k(!1), T = k(!1), V = k(null), a = k([
325
324
  {
326
- role: "assistant",
327
- content: J.defaultMessage,
325
+ role: "defaultMessage",
326
+ // defaultMessage-组件内置, assistant-智能体, user-用户
327
+ content: L.defaultMessage,
328
+ fullQuery: "",
328
329
  userContent: null,
329
330
  showFeedback: !1,
330
- hasFeedback: !1,
331
- createTime: X().format("YYYY-MM-DD HH:mm:ss"),
331
+ createTime: j().format("YYYY-MM-DD HH:mm:ss"),
332
332
  resTime: 0,
333
333
  firstPackageTime: 0
334
334
  }
335
- ]), V = w(""), Y = w(!1), H = w(""), Z = w({}), G = f(() => v.value.filter((a) => a.status === "success").length), e = f(() => v.value.length), g = f(() => e.value ? G.value / e.value * 100 : 0), L = f(() => {
336
- const a = v.value.find((t) => t.status === "executing");
337
- return a ? a.name : "处理中";
338
- }), b = (a) => {
339
- if (typeof a != "string")
340
- return !1;
341
- try {
342
- const t = JSON.parse(a);
343
- return t !== null && typeof t == "object";
344
- } catch {
345
- return !1;
346
- }
347
- }, B = (a) => {
348
- if (!b(a))
349
- return null;
335
+ ]), q = k(null), B = k(""), P = k(!1), Q = k(""), G = k({}), b = k([]), e = m(() => b.value.length), g = m(() => b.value.filter((n) => n.status === "success").length), Y = m(() => e.value ? g.value / e.value * 100 : 0), S = m(() => {
336
+ const n = b.value.find((t) => t.status === "executing");
337
+ return n ? n.name : "处理中";
338
+ }), U = async () => {
339
+ const n = B.value.trim();
340
+ if (!n)
341
+ return W.warning("请输入消息内容");
342
+ if (A.value)
343
+ return;
344
+ b.value = [], T.value = !1, a.value.push({
345
+ role: "user",
346
+ content: n,
347
+ createTime: j().format("YYYY-MM-DD HH:mm:ss")
348
+ }), B.value = "", await z(), a.value.push({
349
+ role: "assistant",
350
+ content: "",
351
+ fullQuery: "",
352
+ userContent: n,
353
+ showFeedback: !1,
354
+ createTime: j().format("YYYY-MM-DD HH:mm:ss"),
355
+ resTime: 0,
356
+ firstPackageTime: 0
357
+ }), await z(), A.value = !0, c.value = !0;
358
+ let t = "", o = (/* @__PURE__ */ new Date()).getTime(), I = !1;
350
359
  try {
351
- const t = JSON.parse(a), { parsedConditions: n, ...S } = t;
352
- return { parsedConditions: n, webParams: S };
353
- } catch {
354
- return null;
360
+ await Ue({
361
+ baseUrl: r.env.VITE_BASE_URL,
362
+ token: Be(),
363
+ value: n,
364
+ sessionId: q.value,
365
+ callback: (D, _) => {
366
+ if (D === "session" && (q.value = _), D === "fullQuery") {
367
+ const v = a.value[a.value.length - 1];
368
+ v.fullQuery = _, console.log(_);
369
+ }
370
+ if (D === "node") {
371
+ if (!I) {
372
+ I = !0, c.value = !1;
373
+ const F = a.value[a.value.length - 1];
374
+ F && F.role === "assistant" && F.firstPackageTime === 0 && (F.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - o);
375
+ }
376
+ const v = b.value.find((F) => F.name === _.name);
377
+ v ? v.status = _.status : b.value.push({ name: _.name, status: _.status }), z();
378
+ return;
379
+ }
380
+ if (D === "message") {
381
+ t = _;
382
+ const v = a.value[a.value.length - 1];
383
+ v && v.role === "assistant" && (v.content = t, z());
384
+ }
385
+ if (D === "finish") {
386
+ A.value = !1, T.value = !0;
387
+ const v = a.value[a.value.length - 1];
388
+ v && v.role === "assistant" && (v.showFeedback = !0, v.resTime = (/* @__PURE__ */ new Date()).getTime() - o, x("default", a.value.length - 1));
389
+ }
390
+ if (D === "error") {
391
+ c.value = !1, A.value = !1, a.value.pop(), a.value.push({
392
+ role: "assistant",
393
+ userContent: n,
394
+ content: `❌ ${_}`,
395
+ showFeedback: !1,
396
+ createTime: j().format("YYYY-MM-DD HH:mm:ss"),
397
+ resTime: (/* @__PURE__ */ new Date()).getTime() - o,
398
+ firstPackageTime: 0
399
+ }), x("default", a.value.length - 1), z();
400
+ return;
401
+ }
402
+ }
403
+ });
404
+ } catch (D) {
405
+ W.error(`AI响应异常: ${D}`), a.value.pop(), a.value.push({
406
+ role: "assistant",
407
+ userContent: n,
408
+ content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
409
+ showFeedback: !0,
410
+ createTime: j().format("YYYY-MM-DD HH:mm:ss"),
411
+ resTime: (/* @__PURE__ */ new Date()).getTime() - o,
412
+ firstPackageTime: 0
413
+ }), x("default", a.value.length - 1), await z(), A.value = !1, c.value = !1;
355
414
  }
356
- }, he = (a) => {
357
- var n;
358
- if (!a)
359
- return "";
360
- let t = "";
361
- return (n = a.parsedConditions) != null && n.length && (t += '<div class="parsed-conditions">', a.parsedConditions.forEach((S) => {
362
- t += `<div class="parsed-conditions-item">${S}</div>`;
363
- }), t += "</div>"), t;
364
- }, W = async (a, t) => {
365
- switch (a) {
415
+ }, Ae = (n) => {
416
+ const { parsedConditions: t, ...o } = JSON.parse(n);
417
+ console.log({ parsedConditions: t, webParams: o }), R("callBack", o);
418
+ }, x = async (n, t) => {
419
+ switch (n) {
366
420
  case "satisfied": {
367
- const n = o.value[t];
368
- await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
369
- userName: F.username,
370
- userContent: n.userContent,
371
- aiContent: n.content,
421
+ const o = a.value[t];
422
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
423
+ userName: M.username,
424
+ userContent: o.userContent,
425
+ aiContent: o.content,
372
426
  type: 1,
373
- createTime: n.createTime,
374
- resTime: n.resTime,
375
- firstPackageTime: n.firstPackageTime,
427
+ createTime: o.createTime,
428
+ resTime: o.resTime,
429
+ firstPackageTime: o.firstPackageTime,
376
430
  isSolved: 1,
377
431
  logOrigin: 1
378
- }), ee.success("感谢您的评价!"), o.value[t].hasFeedback = !0;
432
+ }), W.success("感谢您的评价!"), a.value[t].showFeedback = !1;
379
433
  break;
380
434
  }
381
435
  case "open": {
382
- Z.value = t, Y.value = !0;
436
+ G.value = t, P.value = !0;
383
437
  break;
384
438
  }
385
439
  case "unsatisfied": {
386
- const n = o.value[t];
387
- await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
388
- userName: F.username,
389
- userContent: n.userContent,
390
- userSuggestion: H.value,
391
- aiContent: n.content,
440
+ const o = a.value[t];
441
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
442
+ userName: M.username,
443
+ userContent: o.userContent,
444
+ userSuggestion: Q.value,
445
+ aiContent: o.content,
392
446
  type: 2,
393
- resTime: n.resTime,
394
- createTime: n.createTime,
395
- firstPackageTime: n.firstPackageTime,
447
+ resTime: o.resTime,
448
+ createTime: o.createTime,
449
+ firstPackageTime: o.firstPackageTime,
396
450
  isSolved: 0,
397
451
  logOrigin: 1
398
- }), ee.success("感谢您的反馈!我们将持续跟踪并进行优化"), Y.value = !1, o.value[t].hasFeedback = !0;
452
+ }), W.success("感谢您的反馈!我们将持续跟踪并进行优化"), P.value = !1, a.value[t].showFeedback = !1;
399
453
  break;
400
454
  }
401
455
  case "default": {
402
- const n = o.value[t];
403
- await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
404
- userName: F.username,
405
- userContent: n.userContent,
406
- userSuggestion: H.value,
407
- aiContent: n.content,
456
+ const o = a.value[t];
457
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
458
+ userName: M.username,
459
+ userContent: o.userContent,
460
+ userSuggestion: Q.value,
461
+ aiContent: o.content,
408
462
  type: null,
409
- resTime: n.resTime,
410
- createTime: n.createTime,
411
- firstPackageTime: n.firstPackageTime,
463
+ resTime: o.resTime,
464
+ createTime: o.createTime,
465
+ firstPackageTime: o.firstPackageTime,
412
466
  isSolved: 1,
413
467
  logOrigin: 1
414
468
  });
415
469
  }
416
470
  }
417
- }, ce = async () => {
418
- const a = V.value.trim();
419
- if (!a)
420
- return ee.warning("请输入消息内容");
421
- if (k.value)
422
- return;
423
- v.value = [], $.value = !1, o.value.push({
424
- role: "user",
425
- content: a,
426
- createTime: X().format("YYYY-MM-DD HH:mm:ss")
427
- }), V.value = "", await I(), o.value.push({
428
- role: "assistant",
429
- content: "",
430
- userContent: a,
431
- showFeedback: !1,
432
- hasFeedback: !1,
433
- createTime: X().format("YYYY-MM-DD HH:mm:ss"),
434
- resTime: 0,
435
- firstPackageTime: 0
436
- }), await I(), k.value = !0, u.value = !0;
437
- let t = "", n = (/* @__PURE__ */ new Date()).getTime(), S = !1;
438
- try {
439
- await Fe({
440
- baseUrl: l.env.VITE_BASE_URL,
441
- token: De(),
442
- value: a,
443
- callback: (z, M) => {
444
- if (z === "error") {
445
- u.value = !1, k.value = !1, o.value.pop(), o.value.push({
446
- role: "assistant",
447
- userContent: a,
448
- content: `❌ ${M}`,
449
- showFeedback: !1,
450
- hasFeedback: !1,
451
- createTime: X().format("YYYY-MM-DD HH:mm:ss"),
452
- resTime: (/* @__PURE__ */ new Date()).getTime() - n,
453
- firstPackageTime: 0
454
- }), W("default", o.value.length - 1), I();
455
- return;
456
- }
457
- if (z === "node") {
458
- if (!S) {
459
- S = !0, u.value = !1;
460
- const _ = o.value[o.value.length - 1];
461
- _ && _.role === "assistant" && _.firstPackageTime === 0 && (_.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - n);
462
- }
463
- const h = v.value.find((_) => _.name === M.name);
464
- h ? h.status = M.status : v.value.push({ name: M.name, status: M.status }), I();
465
- return;
466
- }
467
- if (z === "message") {
468
- t = M;
469
- const h = o.value[o.value.length - 1];
470
- h && h.role === "assistant" && (h.content = t, I());
471
- }
472
- if (z === "finish") {
473
- k.value = !1, $.value = !0;
474
- const h = o.value[o.value.length - 1];
475
- h && h.role === "assistant" && (h.showFeedback = !0, h.resTime = (/* @__PURE__ */ new Date()).getTime() - n, W("default", o.value.length - 1));
476
- try {
477
- const _ = JSON.parse(t);
478
- _.parsedConditions && delete _.parsedConditions, U("callBack", _);
479
- } catch {
480
- U("callBack", t);
481
- }
482
- }
483
- }
484
- });
485
- } catch (z) {
486
- ee.error(`AI响应异常: ${z}`), o.value.pop(), o.value.push({
487
- role: "assistant",
488
- userContent: a,
489
- content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
490
- showFeedback: !0,
491
- hasFeedback: !1,
492
- createTime: X().format("YYYY-MM-DD HH:mm:ss"),
493
- resTime: (/* @__PURE__ */ new Date()).getTime() - n,
494
- firstPackageTime: 0
495
- }), W("default", o.value.length - 1), await I(), k.value = !1, u.value = !1;
496
- }
497
- }, ke = (a) => {
498
- if (a.key === "Enter")
499
- if (a.ctrlKey) {
500
- a.preventDefault();
501
- const t = a.target, n = t.selectionStart, S = t.selectionEnd;
502
- V.value = V.value.substring(0, n) + `
503
- ` + V.value.substring(S), ae(() => {
504
- t.selectionStart = t.selectionEnd = n + 1;
471
+ }, he = (n) => {
472
+ if (n.key === "Enter")
473
+ if (n.ctrlKey) {
474
+ n.preventDefault();
475
+ const t = n.target, o = t.selectionStart, I = t.selectionEnd;
476
+ B.value = B.value.substring(0, o) + `
477
+ ` + B.value.substring(I), se(() => {
478
+ t.selectionStart = t.selectionEnd = o + 1;
505
479
  });
506
480
  } else
507
- a.preventDefault(), ce();
508
- }, I = async () => {
509
- await ae(), T.value && (T.value.scrollTop = T.value.scrollHeight);
481
+ n.preventDefault(), U();
482
+ }, z = async () => {
483
+ await se(), V.value && (V.value.scrollTop = V.value.scrollHeight);
484
+ }, ie = (n) => {
485
+ if (typeof n != "string")
486
+ return !1;
487
+ try {
488
+ const t = JSON.parse(n);
489
+ return t !== null && typeof t == "object";
490
+ } catch {
491
+ return !1;
492
+ }
493
+ }, ke = (n) => {
494
+ const { parsedConditions: t } = JSON.parse(n);
495
+ let o = "";
496
+ return t != null && t.length && (o += '<div class="parsed-conditions">', t.forEach((I) => {
497
+ o += `<div class="parsed-conditions-item">${I}</div>`;
498
+ }), o += "</div>"), o;
510
499
  };
511
- return re(
512
- () => o.value,
500
+ return oe(
501
+ () => a.value,
513
502
  () => {
514
- I();
503
+ z();
515
504
  },
516
505
  { deep: !0 }
517
- ), re(
518
- () => Y.value,
519
- (a) => {
520
- a || (H.value = "");
506
+ ), oe(
507
+ () => P.value,
508
+ (n) => {
509
+ n || (Q.value = "");
521
510
  }
522
- ), c({
511
+ ), i({
523
512
  open: () => {
524
- N.value = !0, ae(() => {
525
- I();
513
+ E.value = !0, se(() => {
514
+ z();
526
515
  });
527
516
  }
528
- }), (a, t) => {
529
- const n = Ke, S = ie, z = et, M = Te, h = we, _ = be;
530
- return i(), d(q, null, [
531
- C(_, {
517
+ }), (n, t) => {
518
+ const o = Xe, I = re, D = st, _ = Se, v = Te, F = _e, ce = be;
519
+ return l(), p(X, null, [
520
+ h(ce, {
532
521
  class: "ai-dialog",
533
- modelValue: N.value,
534
- "onUpdate:modelValue": t[1] || (t[1] = (E) => N.value = E),
522
+ modelValue: E.value,
523
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => E.value = u),
535
524
  title: "✨ 品种池参数解析AI助手",
536
525
  width: "500px",
537
526
  center: "",
@@ -540,160 +529,180 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
540
529
  modal: !1,
541
530
  "modal-penetrable": !0
542
531
  }, {
543
- default: P(() => {
544
- var E;
545
- return [
546
- r("div", tt, [
547
- r("div", {
548
- ref_key: "messageListRef",
549
- ref: T,
550
- class: "message-list"
532
+ default: y(() => [
533
+ d("div", nt, [
534
+ d("div", {
535
+ ref_key: "messageListRef",
536
+ ref: V,
537
+ class: "message-list"
538
+ }, [
539
+ (l(!0), p(X, null, ue(a.value, (u, K) => (l(), p("div", {
540
+ key: K,
541
+ class: w([u.role, "message-item"])
551
542
  }, [
552
- (i(!0), d(q, null, ue(o.value, (m, j) => (i(), d("div", {
553
- key: j,
554
- class: y([m.role, "message-item"])
555
- }, [
556
- m.content || j === o.value.length - 1 && m.role === "assistant" && v.value.length > 0 ? (i(), d(q, { key: 0 }, [
557
- r("div", st, [
558
- C(n, {
559
- size: 32,
560
- icon: m.role === "user" ? s(He) : s(Le)
561
- }, null, 8, ["icon"])
562
- ]),
563
- r("div", at, [
564
- j === o.value.length - 1 && m.role === "assistant" && v.value.length > 0 && !$.value ? (i(), d("div", nt, [
565
- (i(!0), d(q, null, ue(v.value, (Q) => (i(), d("div", {
566
- key: Q.name,
567
- class: "node-progress-item"
568
- }, [
569
- r("span", ot, [
570
- Q.status === "success" ? (i(), K(S, {
571
- key: 0,
572
- class: "node-icon done"
573
- }, {
574
- default: P(() => [
575
- C(s(Be))
576
- ]),
577
- _: 1
578
- })) : (i(), K(S, {
579
- key: 1,
580
- class: "node-icon running"
581
- }, {
582
- default: P(() => [
583
- C(s(Ie))
584
- ]),
585
- _: 1
586
- }))
543
+ u.content || K === a.value.length - 1 && u.role === "assistant" && b.value.length > 0 ? (l(), p(X, { key: 0 }, [
544
+ d("div", rt, [
545
+ h(o, {
546
+ size: 32,
547
+ icon: u.role === "user" ? s(Ye) : s(ze)
548
+ }, null, 8, ["icon"])
549
+ ]),
550
+ d("div", lt, [
551
+ u.fullQuery ? (l(), p("div", it, "筛选结果: " + H(u.fullQuery), 1)) : N("", !0),
552
+ K === a.value.length - 1 && u.role === "assistant" && b.value.length > 0 && !T.value ? (l(), p("div", ct, [
553
+ (l(!0), p(X, null, ue(b.value, ($) => (l(), p("div", {
554
+ key: $.name,
555
+ class: "node-progress-item"
556
+ }, [
557
+ d("span", ut, [
558
+ $.status === "success" ? (l(), O(I, {
559
+ key: 0,
560
+ class: "node-icon done"
561
+ }, {
562
+ default: y(() => [
563
+ h(s(Je))
564
+ ]),
565
+ _: 1
566
+ })) : (l(), O(I, {
567
+ key: 1,
568
+ class: "node-icon running"
569
+ }, {
570
+ default: y(() => [
571
+ h(s(He))
572
+ ]),
573
+ _: 1
574
+ }))
575
+ ]),
576
+ d("span", dt, H($.name), 1)
577
+ ]))), 128)),
578
+ d("div", pt, [
579
+ h(D, {
580
+ percentage: Y.value,
581
+ "show-text": !1,
582
+ "stroke-width": 4,
583
+ color: "#667eea"
584
+ }, null, 8, ["percentage"]),
585
+ d("span", ft, "第 " + H(g.value) + "/" + H(e.value) + " 步 · " + H(S.value), 1)
586
+ ])
587
+ ])) : N("", !0),
588
+ ie(u.content) ? (l(), p("div", {
589
+ key: 2,
590
+ class: w(["message-content-json", { "result-animation": K === a.value.length - 1 && T.value }]),
591
+ innerHTML: ke(u.content)
592
+ }, null, 10, mt)) : u.content ? (l(), p("div", {
593
+ key: 3,
594
+ class: w(["message-content-text", { "result-animation": K === a.value.length - 1 && T.value }])
595
+ }, H(u.content), 3)) : N("", !0),
596
+ u.role === "assistant" ? (l(), p("div", vt, [
597
+ u.showFeedback ? (l(), p("div", gt, [
598
+ h(_, {
599
+ content: "满意",
600
+ placement: "bottom"
601
+ }, {
602
+ default: y(() => [
603
+ d("img", {
604
+ src: at,
605
+ alt: "满意",
606
+ onClick: ($) => x("satisfied", K)
607
+ }, null, 8, At)
608
+ ]),
609
+ _: 2
610
+ }, 1024),
611
+ h(_, {
612
+ content: "满意",
613
+ placement: "bottom"
614
+ }, {
615
+ default: y(() => [
616
+ d("img", {
617
+ src: ot,
618
+ alt: "不满意",
619
+ onClick: ($) => x("open", K)
620
+ }, null, 8, ht)
587
621
  ]),
588
- r("span", rt, O(Q.name), 1)
589
- ]))), 128)),
590
- r("div", lt, [
591
- C(z, {
592
- percentage: g.value,
593
- "show-text": !1,
594
- "stroke-width": 4,
595
- color: "#667eea"
596
- }, null, 8, ["percentage"]),
597
- r("span", it, "第 " + O(G.value) + "/" + O(e.value) + " 步 · " + O(L.value), 1)
598
- ])
599
- ])) : A("", !0),
600
- b(m.content) ? (i(), d("div", {
622
+ _: 2
623
+ }, 1024)
624
+ ])) : N("", !0),
625
+ ie(u.content) ? (l(), O(v, {
601
626
  key: 1,
602
- class: y(["message-json", { "result-animation": j === o.value.length - 1 && $.value }]),
603
- innerHTML: he(B(m.content))
604
- }, null, 10, ct)) : m.content ? (i(), d("div", {
605
- key: 2,
606
- class: y(["message-text", { "result-animation": j === o.value.length - 1 && $.value }])
607
- }, O(m.content), 3)) : A("", !0),
608
- r("div", ut, O(m.createTime), 1),
609
- m.role === "assistant" ? (i(), d(q, { key: 3 }, [
610
- m.showFeedback && !m.hasFeedback ? (i(), d(q, { key: 0 }, [
611
- dt,
612
- r("div", pt, [
613
- r("button", {
614
- class: "feedback-btn satisfied-btn",
615
- onClick: (Q) => W("satisfied", j)
616
- }, gt, 8, ft),
617
- r("button", {
618
- class: "feedback-btn unsatisfied-btn",
619
- onClick: (Q) => W("open", j)
620
- }, yt, 8, ht)
621
- ])
622
- ], 64)) : A("", !0),
623
- m.showFeedback && m.hasFeedback ? (i(), d("div", bt, "感谢您进行的评价反馈")) : A("", !0)
624
- ], 64)) : A("", !0)
625
- ])
626
- ], 64)) : A("", !0)
627
- ], 2))), 128)),
628
- u.value && v.value.length === 0 && !((E = o.value[o.value.length - 1]) != null && E.content) ? (i(), d("div", wt, " 🤔 正在分析您的需求... ")) : A("", !0)
629
- ], 512),
630
- r("div", Tt, [
631
- C(M, {
632
- class: "message-input",
633
- modelValue: V.value,
634
- "onUpdate:modelValue": t[0] || (t[0] = (m) => V.value = m),
635
- type: "textarea",
636
- rows: 4,
637
- autosize: { minRows: 2, maxRows: 4 },
638
- placeholder: "输入您想查询的品种条件...",
639
- onKeydown: ke
640
- }, null, 8, ["modelValue"]),
641
- r("div", St, [
642
- Ct,
643
- C(h, {
644
- class: "send-btn",
645
- type: "primary",
646
- icon: s(ze),
647
- loading: k.value,
648
- onClick: ce,
649
- round: ""
650
- }, {
651
- default: P(() => [
652
- ne(" 发送 ")
653
- ]),
654
- _: 1
655
- }, 8, ["icon", "loading"])
656
- ])
627
+ class: "confirm-btn",
628
+ onClick: ($) => Ae(u.content)
629
+ }, {
630
+ default: y(() => [
631
+ Z(" 查看结果 ")
632
+ ]),
633
+ _: 2
634
+ }, 1032, ["onClick"])) : N("", !0)
635
+ ])) : N("", !0)
636
+ ])
637
+ ], 64)) : N("", !0)
638
+ ], 2))), 128))
639
+ ], 512),
640
+ d("div", kt, [
641
+ h(F, {
642
+ class: "message-input",
643
+ modelValue: B.value,
644
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => B.value = u),
645
+ type: "textarea",
646
+ rows: 4,
647
+ autosize: { minRows: 2, maxRows: 4 },
648
+ placeholder: "输入您想查询的品种条件...",
649
+ onKeydown: he
650
+ }, null, 8, ["modelValue"]),
651
+ d("div", yt, [
652
+ wt,
653
+ h(v, {
654
+ class: "send-btn",
655
+ type: "primary",
656
+ icon: s(Ke),
657
+ loading: A.value,
658
+ onClick: U,
659
+ round: ""
660
+ }, {
661
+ default: y(() => [
662
+ Z(" 发送 ")
663
+ ]),
664
+ _: 1
665
+ }, 8, ["icon", "loading"])
657
666
  ])
658
667
  ])
659
- ];
660
- }),
668
+ ])
669
+ ]),
661
670
  _: 1
662
671
  }, 8, ["modelValue"]),
663
- C(_, {
664
- modelValue: Y.value,
665
- "onUpdate:modelValue": t[5] || (t[5] = (E) => Y.value = E),
672
+ h(ce, {
673
+ modelValue: P.value,
674
+ "onUpdate:modelValue": t[5] || (t[5] = (u) => P.value = u),
666
675
  title: "📝 反馈意见",
667
676
  width: "400px"
668
677
  }, {
669
- footer: P(() => [
670
- r("span", Dt, [
671
- C(h, {
672
- onClick: t[3] || (t[3] = (E) => Y.value = !1)
678
+ footer: y(() => [
679
+ d("span", St, [
680
+ h(v, {
681
+ onClick: t[3] || (t[3] = (u) => P.value = !1)
673
682
  }, {
674
- default: P(() => [
675
- ne("取消")
683
+ default: y(() => [
684
+ Z("取消")
676
685
  ]),
677
686
  _: 1
678
687
  }),
679
- C(h, {
688
+ h(v, {
680
689
  type: "primary",
681
- onClick: t[4] || (t[4] = (E) => W("unsatisfied", Z.value))
690
+ onClick: t[4] || (t[4] = (u) => x("unsatisfied", G.value))
682
691
  }, {
683
- default: P(() => [
684
- ne("提交反馈")
692
+ default: y(() => [
693
+ Z("提交反馈")
685
694
  ]),
686
695
  _: 1
687
696
  })
688
697
  ])
689
698
  ]),
690
- default: P(() => [
691
- r("div", $t, [
692
- Et,
693
- Pt,
694
- C(M, {
695
- modelValue: H.value,
696
- "onUpdate:modelValue": t[2] || (t[2] = (E) => H.value = E),
699
+ default: y(() => [
700
+ d("div", bt, [
701
+ _t,
702
+ Tt,
703
+ h(F, {
704
+ modelValue: Q.value,
705
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => Q.value = u),
697
706
  type: "textarea",
698
707
  rows: 4,
699
708
  placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
@@ -705,11 +714,11 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
705
714
  ], 64);
706
715
  };
707
716
  }
708
- }, Nt = /* @__PURE__ */ xe(Ft, [["__scopeId", "data-v-f40b6b16"]]), as = {
709
- install(p) {
710
- p.component("st-varietyAiHelper", Nt);
717
+ }, Ct = /* @__PURE__ */ Oe(Dt, [["__scopeId", "data-v-4ba59779"]]), es = {
718
+ install(f) {
719
+ f.component("st-varietyAiHelper", Ct);
711
720
  }
712
721
  };
713
722
  export {
714
- as as default
723
+ es as default
715
724
  };