st-comp 0.0.274 → 0.0.275

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 +4 -4
  28. package/es/VarietyAiHelper.js +472 -473
  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-0c653fa6.js +113 -0
  40. package/es/aiTools-336e4de3.cjs +2 -0
  41. package/es/aiTools.js +8 -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 +8 -2
  110. package/lib/bundle.js +1 -1
  111. package/lib/bundle.umd.cjs +172 -172
  112. package/lib/{index-a854f18c.js → index-298ca804.js} +14406 -14406
  113. package/lib/{python-77c3b638.js → python-4b8051bd.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 +342 -410
  119. package/packages/VarietySearch/index.vue +1 -1
  120. package/public/aiTools.js +8 -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,32 +1,33 @@
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 f, watch as oe, openBlock as l, createElementBlock as m, 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 K, createCommentVNode as Q, 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 x } from "./dayjs.min-8313b006.js";
10
+ import { V as Ve, U as Be } from "./index-7ed0999e.js";
11
+ import { s as Ue } from "./aiTools-0c653fa6.js";
12
+ import { E as re, w as Ie, o as Fe, p as Ne, s as Pe, c as Ye, u as ze, t as Je, v as Qe, 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 $e = de({
27
28
  size: {
28
29
  type: [Number, String],
29
- values: Oe,
30
+ values: Re,
30
31
  default: "",
31
32
  validator: (p) => pe(p)
32
33
  },
@@ -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
52
  }), je = {
52
53
  error: (p) => p instanceof Event
53
- }, Je = se({
54
+ }, xe = te({
54
55
  name: "ElAvatar"
55
- }), We = /* @__PURE__ */ se({
56
- ...Je,
57
- props: Ue,
56
+ }), qe = /* @__PURE__ */ te({
57
+ ...xe,
58
+ props: $e,
58
59
  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) || ""
60
+ setup(p, { emit: i }) {
61
+ const D = p, r = fe("avatar"), C = k(!1), M = f(() => {
62
+ const { size: c, icon: _, shape: E } = D, o = [r.b()];
63
+ return ae(c) && o.push(r.m(c)), _ && o.push(r.m("icon")), E && o.push(r.m(E)), o;
64
+ }), R = f(() => {
65
+ const { size: c } = D;
66
+ return pe(c) ? r.cssVarBlock({
67
+ size: ye(c) || ""
67
68
  }) : void 0;
68
- }), J = f(() => ({
69
+ }), L = f(() => ({
69
70
  objectFit: D.fit
70
71
  }));
71
- re(() => D.src, () => F.value = !1);
72
- function k(u) {
73
- F.value = !0, c("error", u);
72
+ oe(() => D.src, () => C.value = !1);
73
+ function A(c) {
74
+ C.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, _) => (l(), m("span", {
77
+ class: w(s(M)),
78
+ style: J(s(R))
78
79
  }, [
79
- (u.src || u.srcSet) && !F.value ? (i(), d("img", {
80
+ (c.src || c.srcSet) && !C.value ? (l(), m("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",
@@ -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
+ type: ee(Function),
146
147
  default: (p) => `${p}%`
147
148
  }
148
- }), Qe = se({
149
+ }), We = te({
149
150
  name: "ElProgress"
150
- }), Xe = /* @__PURE__ */ se({
151
- ...Qe,
152
- props: Ge,
151
+ }), et = /* @__PURE__ */ te({
152
+ ...We,
153
+ props: Ze,
153
154
  setup(p) {
154
- const c = p, D = {
155
+ const i = p, D = {
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"), C = f(() => {
160
161
  const e = {
161
- width: `${c.percentage}%`,
162
- animationDuration: `${c.duration}s`
163
- }, g = G(c.percentage);
164
- 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";
162
+ width: `${i.percentage}%`,
163
+ animationDuration: `${i.duration}s`
164
+ }, v = b(i.percentage);
165
+ return v.includes("gradient") ? e.background = v : e.backgroundColor = v, e;
166
+ }), M = f(() => (i.strokeWidth / i.width * 100).toFixed(1)), R = f(() => ["circle", "dashboard"].includes(i.type) ? Number.parseInt(`${50 - Number.parseFloat(M.value) / 2}`, 10) : 0), L = f(() => {
167
+ const e = R.value, v = i.type === "dashboard";
167
168
  return `
168
169
  M 50 50
169
- m 0 ${g ? "" : "-"}${e}
170
- a ${e} ${e} 0 1 1 0 ${g ? "-" : ""}${e * 2}
171
- a ${e} ${e} 0 1 1 0 ${g ? "" : "-"}${e * 2}
170
+ m 0 ${v ? "" : "-"}${e}
171
+ a ${e} ${e} 0 1 1 0 ${v ? "-" : ""}${e * 2}
172
+ a ${e} ${e} 0 1 1 0 ${v ? "" : "-"}${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 = f(() => 2 * Math.PI * R.value), c = f(() => i.type === "dashboard" ? 0.75 : 1), _ = f(() => `${-1 * A.value * (1 - c.value) / 2}px`), E = f(() => ({
175
+ strokeDasharray: `${A.value * c.value}px, ${A.value}px`,
176
+ strokeDashoffset: _.value
177
+ })), o = f(() => ({
178
+ strokeDasharray: `${A.value * c.value * (i.percentage / 100)}px, ${A.value}px`,
179
+ strokeDashoffset: _.value,
179
180
  transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
180
- })), o = f(() => {
181
+ })), q = f(() => {
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) {
185
- 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);
183
+ return i.color ? e = b(i.percentage) : e = D[i.status] || D.default, e;
184
+ }), V = f(() => i.status === "warning" ? Ie : i.type === "line" ? i.status === "success" ? Fe : Ne : i.status === "success" ? Pe : Ye), N = f(() => i.type === "line" ? 12 + i.strokeWidth * 0.4 : i.width * 0.111111 + 2), P = f(() => i.format(i.percentage));
185
+ function G(e) {
186
+ const v = 100 / e.length;
187
+ return e.map((T, B) => ae(T) ? {
188
+ color: T,
189
+ percentage: (B + 1) * v
190
+ } : T).sort((T, B) => T.percentage - B.percentage);
190
191
  }
191
- const G = (e) => {
192
- var g;
193
- const { color: L } = c;
194
- if (ye(L))
195
- return L(e);
196
- if (oe(L))
197
- return L;
192
+ const b = (e) => {
193
+ var v;
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)
200
+ const T = G(Y);
201
+ for (const B of T)
201
202
  if (B.percentage > e)
202
203
  return B.color;
203
- return (g = b[b.length - 1]) == null ? void 0 : g.color;
204
+ return (v = T[T.length - 1]) == null ? void 0 : v.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, v) => (l(), m("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,92 @@ 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(), m("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(C))
237
238
  }, [
238
- (e.showText || e.$slots.default) && e.textInside ? (i(), d("div", {
239
+ (e.showText || e.$slots.default) && e.textInside ? (l(), m("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, K(s(P)), 1)
244
245
  ])
245
- ], 2)) : A("v-if", !0)
246
+ ], 2)) : Q("v-if", !0)
246
247
  ], 6)
247
248
  ], 6)
248
- ], 2)) : (i(), d("div", {
249
+ ], 2)) : (l(), m("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(), m("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(M),
260
261
  fill: "none",
261
- style: x(s($))
262
+ style: J(s(E))
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(M),
272
+ style: J(s(o))
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(), m("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(N)}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(V))))
284
285
  ]),
285
286
  _: 1
286
- })) : (i(), d("span", { key: 0 }, O(s(H)), 1))
287
+ })) : (l(), m("span", { key: 0 }, K(s(P)), 1))
287
288
  ])
288
- ], 6)) : A("v-if", !0)
289
+ ], 6)) : Q("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 = (p) => (Me("data-v-652408e0"), p = p(), Ee(), p), nt = { class: "ai-dialog-body" }, rt = { class: "avatar" }, lt = { class: "message-content" }, it = {
295
297
  key: 0,
296
298
  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 = {
304
- key: 1,
305
- class: "message-createTime"
306
- }, wt = {
299
+ }, ct = { class: "node-status-icon" }, ut = { class: "node-name" }, dt = { class: "progress-footer" }, pt = { class: "progress-text" }, ft = ["innerHTML"], mt = {
300
+ key: 3,
301
+ class: "message-content-footer"
302
+ }, vt = {
307
303
  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 = {
304
+ class: "feedback-box"
305
+ }, gt = ["onClick"], At = ["onClick"], ht = { class: "input-area" }, kt = { class: "input-actions" }, yt = /* @__PURE__ */ le(() => /* @__PURE__ */ d("div", { class: "input-hint" }, [
306
+ /* @__PURE__ */ d("span", null, "Enter 发送 | Ctrl + Enter 换行")
307
+ ], -1)), wt = { class: "feedback-dialog-content" }, bt = /* @__PURE__ */ le(() => /* @__PURE__ */ d("div", { class: "feedback-emoji" }, "😟", -1)), _t = /* @__PURE__ */ le(() => /* @__PURE__ */ d("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), Tt = { class: "dialog-footer" }, St = {
312
308
  __name: "index",
313
309
  props: {
314
310
  defaultMessage: {
@@ -320,218 +316,202 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
320
316
  }
321
317
  },
322
318
  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([
319
+ setup(p, { expose: i, emit: D }) {
320
+ const r = De("stConfig"), C = Ce(Ve()), M = k(!1), R = D, L = p, A = k(!1), c = k(!1), _ = k(!1), E = k(null), o = k([
325
321
  {
326
- role: "assistant",
327
- content: J.defaultMessage,
322
+ role: "defaultMessage",
323
+ // defaultMessage-组件内置, assistant-智能体, user-用户
324
+ content: L.defaultMessage,
328
325
  userContent: null,
329
326
  showFeedback: !1,
330
- hasFeedback: !1,
331
- createTime: X().format("YYYY-MM-DD HH:mm:ss"),
327
+ createTime: x().format("YYYY-MM-DD HH:mm:ss"),
332
328
  resTime: 0,
333
329
  firstPackageTime: 0
334
330
  }
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;
331
+ ]), q = k(null), V = k(""), N = k(!1), P = k(""), G = k({}), b = k([]), e = f(() => b.value.length), v = f(() => b.value.filter((n) => n.status === "success").length), Y = f(() => e.value ? v.value / e.value * 100 : 0), T = f(() => {
332
+ const n = b.value.find((t) => t.status === "executing");
333
+ return n ? n.name : "处理中";
334
+ }), B = async () => {
335
+ const n = V.value.trim();
336
+ if (!n)
337
+ return W.warning("请输入消息内容");
338
+ if (A.value)
339
+ return;
340
+ b.value = [], _.value = !1, o.value.push({
341
+ role: "user",
342
+ content: n,
343
+ createTime: x().format("YYYY-MM-DD HH:mm:ss")
344
+ }), V.value = "", await z(), o.value.push({
345
+ role: "assistant",
346
+ content: "",
347
+ userContent: n,
348
+ showFeedback: !1,
349
+ createTime: x().format("YYYY-MM-DD HH:mm:ss"),
350
+ resTime: 0,
351
+ firstPackageTime: 0
352
+ }), await z(), A.value = !0, c.value = !0;
353
+ let t = "", a = (/* @__PURE__ */ new Date()).getTime(), U = !1;
350
354
  try {
351
- const t = JSON.parse(a), { parsedConditions: n, ...S } = t;
352
- return { parsedConditions: n, webParams: S };
353
- } catch {
354
- return null;
355
+ await Ue({
356
+ baseUrl: r.env.VITE_BASE_URL,
357
+ token: Be(),
358
+ value: n,
359
+ sessionId: q.value,
360
+ callback: (I, S) => {
361
+ if (I === "session" && (q.value = S), I === "node") {
362
+ if (!U) {
363
+ U = !0, c.value = !1;
364
+ const F = o.value[o.value.length - 1];
365
+ F && F.role === "assistant" && F.firstPackageTime === 0 && (F.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - a);
366
+ }
367
+ const g = b.value.find((F) => F.name === S.name);
368
+ g ? g.status = S.status : b.value.push({ name: S.name, status: S.status }), z();
369
+ return;
370
+ }
371
+ if (I === "message") {
372
+ t = S;
373
+ const g = o.value[o.value.length - 1];
374
+ g && g.role === "assistant" && (g.content = t, z());
375
+ }
376
+ if (I === "finish") {
377
+ A.value = !1, _.value = !0;
378
+ const g = o.value[o.value.length - 1];
379
+ g && g.role === "assistant" && (g.showFeedback = !0, g.resTime = (/* @__PURE__ */ new Date()).getTime() - a, $("default", o.value.length - 1));
380
+ }
381
+ if (I === "error") {
382
+ c.value = !1, A.value = !1, o.value.pop(), o.value.push({
383
+ role: "assistant",
384
+ userContent: n,
385
+ content: `❌ ${S}`,
386
+ showFeedback: !1,
387
+ createTime: x().format("YYYY-MM-DD HH:mm:ss"),
388
+ resTime: (/* @__PURE__ */ new Date()).getTime() - a,
389
+ firstPackageTime: 0
390
+ }), $("default", o.value.length - 1), z();
391
+ return;
392
+ }
393
+ }
394
+ });
395
+ } catch (I) {
396
+ W.error(`AI响应异常: ${I}`), o.value.pop(), o.value.push({
397
+ role: "assistant",
398
+ userContent: n,
399
+ content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
400
+ showFeedback: !0,
401
+ createTime: x().format("YYYY-MM-DD HH:mm:ss"),
402
+ resTime: (/* @__PURE__ */ new Date()).getTime() - a,
403
+ firstPackageTime: 0
404
+ }), $("default", o.value.length - 1), await z(), A.value = !1, c.value = !1;
355
405
  }
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) {
406
+ }, Ae = (n) => {
407
+ const { parsedConditions: t, ...a } = JSON.parse(n);
408
+ console.log({ parsedConditions: t, webParams: a }), R("callBack", a);
409
+ }, $ = async (n, t) => {
410
+ switch (n) {
366
411
  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,
412
+ const a = o.value[t];
413
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
414
+ userName: C.username,
415
+ userContent: a.userContent,
416
+ aiContent: a.content,
372
417
  type: 1,
373
- createTime: n.createTime,
374
- resTime: n.resTime,
375
- firstPackageTime: n.firstPackageTime,
418
+ createTime: a.createTime,
419
+ resTime: a.resTime,
420
+ firstPackageTime: a.firstPackageTime,
376
421
  isSolved: 1,
377
422
  logOrigin: 1
378
- }), ee.success("感谢您的评价!"), o.value[t].hasFeedback = !0;
423
+ }), W.success("感谢您的评价!"), o.value[t].showFeedback = !1;
379
424
  break;
380
425
  }
381
426
  case "open": {
382
- Z.value = t, Y.value = !0;
427
+ G.value = t, N.value = !0;
383
428
  break;
384
429
  }
385
430
  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,
431
+ const a = o.value[t];
432
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
433
+ userName: C.username,
434
+ userContent: a.userContent,
435
+ userSuggestion: P.value,
436
+ aiContent: a.content,
392
437
  type: 2,
393
- resTime: n.resTime,
394
- createTime: n.createTime,
395
- firstPackageTime: n.firstPackageTime,
438
+ resTime: a.resTime,
439
+ createTime: a.createTime,
440
+ firstPackageTime: a.firstPackageTime,
396
441
  isSolved: 0,
397
442
  logOrigin: 1
398
- }), ee.success("感谢您的反馈!我们将持续跟踪并进行优化"), Y.value = !1, o.value[t].hasFeedback = !0;
443
+ }), W.success("感谢您的反馈!我们将持续跟踪并进行优化"), N.value = !1, o.value[t].showFeedback = !1;
399
444
  break;
400
445
  }
401
446
  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,
447
+ const a = o.value[t];
448
+ await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
449
+ userName: C.username,
450
+ userContent: a.userContent,
451
+ userSuggestion: P.value,
452
+ aiContent: a.content,
408
453
  type: null,
409
- resTime: n.resTime,
410
- createTime: n.createTime,
411
- firstPackageTime: n.firstPackageTime,
454
+ resTime: a.resTime,
455
+ createTime: a.createTime,
456
+ firstPackageTime: a.firstPackageTime,
412
457
  isSolved: 1,
413
458
  logOrigin: 1
414
459
  });
415
460
  }
416
461
  }
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;
462
+ }, he = (n) => {
463
+ if (n.key === "Enter")
464
+ if (n.ctrlKey) {
465
+ n.preventDefault();
466
+ const t = n.target, a = t.selectionStart, U = t.selectionEnd;
467
+ V.value = V.value.substring(0, a) + `
468
+ ` + V.value.substring(U), se(() => {
469
+ t.selectionStart = t.selectionEnd = a + 1;
505
470
  });
506
471
  } else
507
- a.preventDefault(), ce();
508
- }, I = async () => {
509
- await ae(), T.value && (T.value.scrollTop = T.value.scrollHeight);
472
+ n.preventDefault(), B();
473
+ }, z = async () => {
474
+ await se(), E.value && (E.value.scrollTop = E.value.scrollHeight);
475
+ }, ie = (n) => {
476
+ if (typeof n != "string")
477
+ return !1;
478
+ try {
479
+ const t = JSON.parse(n);
480
+ return t !== null && typeof t == "object";
481
+ } catch {
482
+ return !1;
483
+ }
484
+ }, ke = (n) => {
485
+ const { parsedConditions: t } = JSON.parse(n);
486
+ let a = "";
487
+ return t != null && t.length && (a += '<div class="parsed-conditions">', t.forEach((U) => {
488
+ a += `<div class="parsed-conditions-item">${U}</div>`;
489
+ }), a += "</div>"), a;
510
490
  };
511
- return re(
491
+ return oe(
512
492
  () => o.value,
513
493
  () => {
514
- I();
494
+ z();
515
495
  },
516
496
  { deep: !0 }
517
- ), re(
518
- () => Y.value,
519
- (a) => {
520
- a || (H.value = "");
497
+ ), oe(
498
+ () => N.value,
499
+ (n) => {
500
+ n || (P.value = "");
521
501
  }
522
- ), c({
502
+ ), i({
523
503
  open: () => {
524
- N.value = !0, ae(() => {
525
- I();
504
+ M.value = !0, se(() => {
505
+ z();
526
506
  });
527
507
  }
528
- }), (a, t) => {
529
- const n = Ke, S = ie, z = et, M = Te, h = we, _ = be;
530
- return i(), d(q, null, [
531
- C(_, {
508
+ }), (n, t) => {
509
+ const a = Xe, U = re, I = st, S = Se, g = Te, F = _e, ce = be;
510
+ return l(), m(X, null, [
511
+ h(ce, {
532
512
  class: "ai-dialog",
533
- modelValue: N.value,
534
- "onUpdate:modelValue": t[1] || (t[1] = (E) => N.value = E),
513
+ modelValue: M.value,
514
+ "onUpdate:modelValue": t[1] || (t[1] = (u) => M.value = u),
535
515
  title: "✨ 品种池参数解析AI助手",
536
516
  width: "500px",
537
517
  center: "",
@@ -540,160 +520,179 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
540
520
  modal: !1,
541
521
  "modal-penetrable": !0
542
522
  }, {
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"
523
+ default: y(() => [
524
+ d("div", nt, [
525
+ d("div", {
526
+ ref_key: "messageListRef",
527
+ ref: E,
528
+ class: "message-list"
529
+ }, [
530
+ (l(!0), m(X, null, ue(o.value, (u, H) => (l(), m("div", {
531
+ key: H,
532
+ class: w([u.role, "message-item"])
551
533
  }, [
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
- }))
534
+ u.content || H === o.value.length - 1 && u.role === "assistant" && b.value.length > 0 ? (l(), m(X, { key: 0 }, [
535
+ d("div", rt, [
536
+ h(a, {
537
+ size: 32,
538
+ icon: u.role === "user" ? s(ze) : s(Je)
539
+ }, null, 8, ["icon"])
540
+ ]),
541
+ d("div", lt, [
542
+ H === o.value.length - 1 && u.role === "assistant" && b.value.length > 0 && !_.value ? (l(), m("div", it, [
543
+ (l(!0), m(X, null, ue(b.value, (j) => (l(), m("div", {
544
+ key: j.name,
545
+ class: "node-progress-item"
546
+ }, [
547
+ d("span", ct, [
548
+ j.status === "success" ? (l(), O(U, {
549
+ key: 0,
550
+ class: "node-icon done"
551
+ }, {
552
+ default: y(() => [
553
+ h(s(Qe))
554
+ ]),
555
+ _: 1
556
+ })) : (l(), O(U, {
557
+ key: 1,
558
+ class: "node-icon running"
559
+ }, {
560
+ default: y(() => [
561
+ h(s(He))
562
+ ]),
563
+ _: 1
564
+ }))
565
+ ]),
566
+ d("span", ut, K(j.name), 1)
567
+ ]))), 128)),
568
+ d("div", dt, [
569
+ h(I, {
570
+ percentage: Y.value,
571
+ "show-text": !1,
572
+ "stroke-width": 4,
573
+ color: "#667eea"
574
+ }, null, 8, ["percentage"]),
575
+ d("span", pt, "第 " + K(v.value) + "/" + K(e.value) + " 步 · " + K(T.value), 1)
576
+ ])
577
+ ])) : Q("", !0),
578
+ ie(u.content) ? (l(), m("div", {
579
+ key: 1,
580
+ class: w(["message-content-json", { "result-animation": H === o.value.length - 1 && _.value }]),
581
+ innerHTML: ke(u.content)
582
+ }, null, 10, ft)) : u.content ? (l(), m("div", {
583
+ key: 2,
584
+ class: w(["message-content-text", { "result-animation": H === o.value.length - 1 && _.value }])
585
+ }, K(u.content), 3)) : Q("", !0),
586
+ u.role === "assistant" ? (l(), m("div", mt, [
587
+ u.showFeedback ? (l(), m("div", vt, [
588
+ h(S, {
589
+ content: "满意",
590
+ placement: "bottom"
591
+ }, {
592
+ default: y(() => [
593
+ d("img", {
594
+ src: at,
595
+ alt: "满意",
596
+ onClick: (j) => $("satisfied", H)
597
+ }, null, 8, gt)
587
598
  ]),
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", {
599
+ _: 2
600
+ }, 1024),
601
+ h(S, {
602
+ content: "满意",
603
+ placement: "bottom"
604
+ }, {
605
+ default: y(() => [
606
+ d("img", {
607
+ src: ot,
608
+ alt: "不满意",
609
+ onClick: (j) => $("open", H)
610
+ }, null, 8, At)
611
+ ]),
612
+ _: 2
613
+ }, 1024)
614
+ ])) : Q("", !0),
615
+ ie(u.content) ? (l(), O(g, {
601
616
  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
- ])
617
+ class: "confirm-btn",
618
+ onClick: (j) => Ae(u.content)
619
+ }, {
620
+ default: y(() => [
621
+ Z(" 查看结果 ")
622
+ ]),
623
+ _: 2
624
+ }, 1032, ["onClick"])) : Q("", !0)
625
+ ])) : Q("", !0)
626
+ ])
627
+ ], 64)) : Q("", !0)
628
+ ], 2))), 128))
629
+ ], 512),
630
+ d("div", ht, [
631
+ h(F, {
632
+ class: "message-input",
633
+ modelValue: V.value,
634
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => V.value = u),
635
+ type: "textarea",
636
+ rows: 4,
637
+ autosize: { minRows: 2, maxRows: 4 },
638
+ placeholder: "输入您想查询的品种条件...",
639
+ onKeydown: he
640
+ }, null, 8, ["modelValue"]),
641
+ d("div", kt, [
642
+ yt,
643
+ h(g, {
644
+ class: "send-btn",
645
+ type: "primary",
646
+ icon: s(Ke),
647
+ loading: A.value,
648
+ onClick: B,
649
+ round: ""
650
+ }, {
651
+ default: y(() => [
652
+ Z(" 发送 ")
653
+ ]),
654
+ _: 1
655
+ }, 8, ["icon", "loading"])
657
656
  ])
658
657
  ])
659
- ];
660
- }),
658
+ ])
659
+ ]),
661
660
  _: 1
662
661
  }, 8, ["modelValue"]),
663
- C(_, {
664
- modelValue: Y.value,
665
- "onUpdate:modelValue": t[5] || (t[5] = (E) => Y.value = E),
662
+ h(ce, {
663
+ modelValue: N.value,
664
+ "onUpdate:modelValue": t[5] || (t[5] = (u) => N.value = u),
666
665
  title: "📝 反馈意见",
667
666
  width: "400px"
668
667
  }, {
669
- footer: P(() => [
670
- r("span", Dt, [
671
- C(h, {
672
- onClick: t[3] || (t[3] = (E) => Y.value = !1)
668
+ footer: y(() => [
669
+ d("span", Tt, [
670
+ h(g, {
671
+ onClick: t[3] || (t[3] = (u) => N.value = !1)
673
672
  }, {
674
- default: P(() => [
675
- ne("取消")
673
+ default: y(() => [
674
+ Z("取消")
676
675
  ]),
677
676
  _: 1
678
677
  }),
679
- C(h, {
678
+ h(g, {
680
679
  type: "primary",
681
- onClick: t[4] || (t[4] = (E) => W("unsatisfied", Z.value))
680
+ onClick: t[4] || (t[4] = (u) => $("unsatisfied", G.value))
682
681
  }, {
683
- default: P(() => [
684
- ne("提交反馈")
682
+ default: y(() => [
683
+ Z("提交反馈")
685
684
  ]),
686
685
  _: 1
687
686
  })
688
687
  ])
689
688
  ]),
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),
689
+ default: y(() => [
690
+ d("div", wt, [
691
+ bt,
692
+ _t,
693
+ h(F, {
694
+ modelValue: P.value,
695
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => P.value = u),
697
696
  type: "textarea",
698
697
  rows: 4,
699
698
  placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
@@ -705,11 +704,11 @@ const R = (p) => ($e("data-v-f40b6b16"), p = p(), Ee(), p), tt = { class: "ai-di
705
704
  ], 64);
706
705
  };
707
706
  }
708
- }, Nt = /* @__PURE__ */ xe(Ft, [["__scopeId", "data-v-f40b6b16"]]), as = {
707
+ }, Dt = /* @__PURE__ */ Oe(St, [["__scopeId", "data-v-652408e0"]]), Wt = {
709
708
  install(p) {
710
- p.component("st-varietyAiHelper", Nt);
709
+ p.component("st-varietyAiHelper", Dt);
711
710
  }
712
711
  };
713
712
  export {
714
- as as default
713
+ Wt as default
715
714
  };