@glodon-aiot/agent-cli-ui 2.4.7 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/AgentClientUI.mjs +97 -110
- package/dist/es/Dialog/AgentChat/index.mjs +516 -467
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +25 -24
- package/dist/es/Dialog/FileCard/index.mjs +48 -55
- package/dist/es/Dialog/FilePreview/index.mjs +35 -42
- package/dist/es/Dialog/HistoryItem/index.mjs +48 -53
- package/dist/es/Dialog/KnowledgeList/index.mjs +55 -48
- package/dist/es/Dialog/PromptManager/index.mjs +29 -36
- package/dist/es/Dialog/PromptSetting/index.mjs +53 -66
- package/dist/es/Dialog/SessionAction/index.mjs +92 -91
- package/dist/es/Dialog/SessionList/index.mjs +135 -121
- package/dist/es/Dialog/SessionListDrawer/index.mjs +8 -7
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +29 -36
- package/dist/es/Dialog/SessionRefer/index.mjs +29 -36
- package/dist/es/Dialog/SessionRelated/index.mjs +17 -14
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +125 -132
- package/dist/es/Dialog/index.mjs +125 -93
- package/dist/es/QuillEditor/index.mjs +91 -86
- package/dist/es/_virtual/index.mjs +2 -2
- package/dist/es/components/Markdown/Image/index.mjs +20 -20
- package/dist/es/components/Markdown/index.mjs +27 -22
- package/dist/es/constant.mjs +8 -5
- package/dist/es/index.mjs +178 -152
- package/dist/es/node_modules/classnames/index.mjs +1 -1
- package/dist/es/node_modules/comma-separated-tokens/index.mjs +13 -0
- package/dist/es/node_modules/devlop/lib/default.mjs +5 -0
- package/dist/es/node_modules/hast-util-from-dom/lib/index.mjs +93 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/create-h.mjs +126 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/index.mjs +8 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/hastscript/lib/svg-case-sensitive-tag-names.mjs +4 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/index.mjs +12 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/aria.mjs +61 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/find.mjs +33 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/html.mjs +368 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/normalize.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/svg.mjs +566 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-insensitive-transform.mjs +7 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/case-sensitive-transform.mjs +6 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/create.mjs +14 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/defined-info.mjs +36 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/info.mjs +28 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/merge.mjs +10 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/schema.mjs +21 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/util/types.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xlink.mjs +19 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xml.mjs +15 -0
- package/dist/es/node_modules/hast-util-from-dom/node_modules/property-information/lib/xmlns.mjs +16 -0
- package/dist/es/node_modules/hast-util-from-html-isomorphic/lib/browser.mjs +16 -0
- package/dist/es/node_modules/hast-util-is-element/lib/index.mjs +61 -0
- package/dist/es/node_modules/hast-util-parse-selector/lib/index.mjs +20 -0
- package/dist/es/node_modules/hast-util-to-text/lib/index.mjs +223 -0
- package/dist/es/node_modules/katex/dist/katex.min.css.mjs +4 -0
- package/dist/es/node_modules/katex/dist/katex.mjs +11700 -0
- package/dist/es/node_modules/longest-streak/index.mjs +12 -0
- package/dist/es/node_modules/mdast-util-math/lib/index.mjs +170 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-flow.mjs +76 -0
- package/dist/es/node_modules/micromark-extension-math/lib/math-text.mjs +48 -0
- package/dist/es/node_modules/micromark-extension-math/lib/syntax.mjs +15 -0
- package/dist/es/node_modules/micromark-factory-space/index.mjs +15 -0
- package/dist/es/node_modules/micromark-util-character/index.mjs +10 -0
- package/dist/es/node_modules/rehype-katex/lib/index.mjs +83 -0
- package/dist/es/node_modules/remark-math/lib/index.mjs +13 -0
- package/dist/es/node_modules/space-separated-tokens/index.mjs +7 -0
- package/dist/es/node_modules/unist-util-find-after/lib/index.mjs +32 -0
- package/dist/es/node_modules/unist-util-is/lib/index.mjs +81 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/color.mjs +6 -0
- package/dist/es/node_modules/unist-util-visit-parents/lib/index.mjs +56 -0
- package/dist/es/node_modules/web-namespaces/index.mjs +11 -0
- package/dist/es/utils/index.mjs +44 -27
- package/dist/lib/index.js +278 -138
- package/dist/src/Dialog/AgentChat/index.d.ts +4 -2
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +1 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +1 -1
- package/dist/src/Dialog/KnowledgeList/index.d.ts +2 -3
- package/dist/src/Dialog/PromptSetting/index.d.ts +1 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +2 -0
- package/dist/src/Dialog/SessionList/index.d.ts +5 -4
- package/dist/src/QuillEditor/index.d.ts +1 -0
- package/dist/src/components/Markdown/Text/index.d.ts +8 -0
- package/dist/src/components/MathJaxLoader/index.d.ts +7 -0
- package/dist/src/components/MathJaxRender/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/contexts/MathJaxContext.d.ts +12 -0
- package/dist/src/index.d.ts +4 -1
- package/dist/src/types.d.ts +26 -6
- package/dist/src/utils/index.d.ts +15 -0
- package/package.json +18 -17
- package/dist/es/_virtual/index2.mjs +0 -4
- package/dist/es/_virtual/index3.mjs +0 -4
- package/dist/es/_virtual/index4.mjs +0 -4
- package/dist/es/_virtual/minio-zj.mjs +0 -4
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +0 -26485
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +0 -54
- package/dist/es/node_modules/base64-js/index.mjs +0 -47
- package/dist/es/node_modules/buffer/index.mjs +0 -927
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +0 -9
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +0 -18
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +0 -24
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +0 -19
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +0 -4
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +0 -317
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +0 -113
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +0 -11
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +0 -273
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +0 -8
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +0 -87
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +0 -52
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +0 -21
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +0 -23
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +0 -21
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +0 -14
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +0 -39
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +0 -28
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +0 -105
- package/dist/es/node_modules/ieee754/index.mjs +0 -28
- package/dist/es/node_modules/js-base64/base64.mjs +0 -31
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +0 -26
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +0 -25
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +0 -242
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +0 -8
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +0 -608
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +0 -19
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +0 -52
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +0 -203
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +0 -26
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +0 -243
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +0 -242
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +0 -34
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +0 -281
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +0 -64
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +0 -31
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +0 -4
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +0 -527
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +0 -112
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +0 -97
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +0 -48
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +0 -11
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +0 -5
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +0 -9
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +0 -8
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +0 -414
- package/dist/es/packages/apis/dist/es/base/index.mjs +0 -154
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +0 -431
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +0 -6
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +0 -10
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +0 -9
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +0 -19
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +0 -106
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +0 -97
|
@@ -1,101 +1,88 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
for (var e in
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
|
|
10
|
-
return
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var h = Object.getOwnPropertySymbols;
|
|
3
|
+
var P = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var y = (n, t, e) => t in n ? I(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, v = (n, t) => {
|
|
5
|
+
for (var e in t || (t = {}))
|
|
6
|
+
P.call(t, e) && y(n, e, t[e]);
|
|
7
|
+
if (h)
|
|
8
|
+
for (var e of h(t))
|
|
9
|
+
q.call(t, e) && y(n, e, t[e]);
|
|
10
|
+
return n;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as r, jsxs as
|
|
13
|
-
import { forwardRef as
|
|
12
|
+
import { jsx as r, jsxs as d } from "../../_virtual/jsx-runtime.mjs";
|
|
13
|
+
import { forwardRef as B, useState as S, useContext as b, useImperativeHandle as w, useEffect as g } from "react";
|
|
14
14
|
import "./style.less.mjs";
|
|
15
|
-
import { Form as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
19
|
-
var N;
|
|
15
|
+
import { Form as p, Space as k, Button as E, Popover as L, Input as j } from "antd";
|
|
16
|
+
import A from "../../context.mjs";
|
|
17
|
+
import u from "../../Iconfont/index.mjs";
|
|
18
|
+
const z = B((n, t) => {
|
|
20
19
|
const {
|
|
21
20
|
promptVariables: e,
|
|
22
|
-
setPromptVariables:
|
|
23
|
-
currentSession:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = A(W);
|
|
28
|
-
z(a, () => ({
|
|
21
|
+
setPromptVariables: f,
|
|
22
|
+
currentSession: l,
|
|
23
|
+
setCurrentSession: D
|
|
24
|
+
} = n, [c] = p.useForm(), [m, C] = S(!0);
|
|
25
|
+
b(A), w(t, () => ({
|
|
29
26
|
clear() {
|
|
30
|
-
|
|
27
|
+
c.resetFields();
|
|
31
28
|
}
|
|
32
|
-
})),
|
|
33
|
-
|
|
34
|
-
const n = ((d == null ? void 0 : d.promptVariables) || []).filter((l) => l.key !== "query" && l.status === 1).map((l, c) => ({
|
|
35
|
-
id: c + "",
|
|
36
|
-
key: l.key,
|
|
37
|
-
name: l.name,
|
|
38
|
-
value: ""
|
|
39
|
-
}));
|
|
40
|
-
p([...n].sort((l, c) => l.key.localeCompare(c.key))), g && (d == null || d.reloadSession((m = t == null ? void 0 : t.data) == null ? void 0 : m.id));
|
|
41
|
-
}, [g]), h(() => {
|
|
42
|
-
var s;
|
|
43
|
-
if (!((s = t == null ? void 0 : t.data) != null && s.id))
|
|
29
|
+
})), g(() => {
|
|
30
|
+
if (!l)
|
|
44
31
|
return;
|
|
45
32
|
const o = () => {
|
|
46
|
-
const
|
|
47
|
-
|
|
33
|
+
const a = l.promptVariables.filter((i) => i.key !== "query");
|
|
34
|
+
f(a.sort((i, x) => i.key.localeCompare(x.key)));
|
|
48
35
|
};
|
|
49
|
-
return
|
|
50
|
-
|
|
36
|
+
return l.addEventListener("activated", o), () => {
|
|
37
|
+
l == null || l.removeEventListener("activated", o);
|
|
51
38
|
};
|
|
52
|
-
}, [
|
|
39
|
+
}, [l]), g(() => {
|
|
53
40
|
if (!e)
|
|
54
41
|
return;
|
|
55
|
-
const o = e == null ? void 0 : e.reduce((s,
|
|
56
|
-
|
|
42
|
+
const o = e == null ? void 0 : e.reduce((s, a) => (s[a.key] = a.value, s), {});
|
|
43
|
+
c.setFieldsValue(v({}, o));
|
|
57
44
|
}, [e]);
|
|
58
|
-
const
|
|
59
|
-
e.map((
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
},
|
|
63
|
-
|
|
45
|
+
const N = (o, s) => {
|
|
46
|
+
e.map((a) => {
|
|
47
|
+
a.id === o && (a.value = s.target.value);
|
|
48
|
+
}), f([...e].sort((a, i) => a.key.localeCompare(i.key)));
|
|
49
|
+
}, F = () => {
|
|
50
|
+
C(!m);
|
|
64
51
|
};
|
|
65
52
|
return e != null && e.length ? /* @__PURE__ */ r("div", {
|
|
66
53
|
className: "prompt-setting-panel",
|
|
67
|
-
children: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ d("div", {
|
|
68
55
|
className: "agent-prompt",
|
|
69
56
|
children: [/* @__PURE__ */ r("div", {
|
|
70
57
|
className: "prompt-header",
|
|
71
|
-
children: /* @__PURE__ */
|
|
72
|
-
children: [/* @__PURE__ */ r(
|
|
58
|
+
children: /* @__PURE__ */ d(k, {
|
|
59
|
+
children: [/* @__PURE__ */ r(E, {
|
|
73
60
|
className: "prompt-action",
|
|
74
|
-
icon:
|
|
61
|
+
icon: m ? /* @__PURE__ */ r(u, {
|
|
75
62
|
type: "icon-biaoge-shouqi"
|
|
76
|
-
}) : /* @__PURE__ */ r(
|
|
63
|
+
}) : /* @__PURE__ */ r(u, {
|
|
77
64
|
type: "icon-biaoge-zhankai"
|
|
78
65
|
}),
|
|
79
66
|
type: "link",
|
|
80
|
-
onClick:
|
|
81
|
-
}), /* @__PURE__ */
|
|
67
|
+
onClick: F
|
|
68
|
+
}), /* @__PURE__ */ d(k, {
|
|
82
69
|
className: "prompt-title",
|
|
83
70
|
children: [/* @__PURE__ */ r("span", {
|
|
84
71
|
children: "变量输入"
|
|
85
|
-
}), /* @__PURE__ */ r(
|
|
72
|
+
}), /* @__PURE__ */ r(L, {
|
|
86
73
|
placement: "top",
|
|
87
74
|
overlayClassName: "title-popover",
|
|
88
75
|
content: "填入变量的值,每次启动新会话时该变量将自动替换提示词中的变量",
|
|
89
|
-
children: /* @__PURE__ */ r(
|
|
76
|
+
children: /* @__PURE__ */ r(u, {
|
|
90
77
|
className: "icon-prompt-question",
|
|
91
78
|
type: "icon-wenti"
|
|
92
79
|
})
|
|
93
80
|
})]
|
|
94
81
|
})]
|
|
95
82
|
})
|
|
96
|
-
}),
|
|
83
|
+
}), m && /* @__PURE__ */ r(p, {
|
|
97
84
|
autoComplete: "off",
|
|
98
|
-
form:
|
|
85
|
+
form: c,
|
|
99
86
|
labelWrap: !0,
|
|
100
87
|
labelAlign: "left",
|
|
101
88
|
labelCol: {
|
|
@@ -104,7 +91,7 @@ const G = L((i, a) => {
|
|
|
104
91
|
}
|
|
105
92
|
},
|
|
106
93
|
className: "prompt-form",
|
|
107
|
-
children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ r(
|
|
94
|
+
children: e == null ? void 0 : e.map((o) => /* @__PURE__ */ r(p.Item, {
|
|
108
95
|
label: o.name,
|
|
109
96
|
name: o.key,
|
|
110
97
|
style: {
|
|
@@ -114,17 +101,17 @@ const G = L((i, a) => {
|
|
|
114
101
|
required: !0,
|
|
115
102
|
message: "请输入"
|
|
116
103
|
}],
|
|
117
|
-
children: /* @__PURE__ */ r(
|
|
104
|
+
children: /* @__PURE__ */ r(j, {
|
|
118
105
|
placeholder: "请输入",
|
|
119
106
|
maxLength: 1e3,
|
|
120
|
-
onBlur: (s) =>
|
|
107
|
+
onBlur: (s) => N(o.id, s)
|
|
121
108
|
})
|
|
122
109
|
}, o.key))
|
|
123
110
|
})]
|
|
124
111
|
})
|
|
125
112
|
}) : null;
|
|
126
113
|
});
|
|
127
|
-
|
|
114
|
+
z.displayName = "PromptSetting";
|
|
128
115
|
export {
|
|
129
|
-
|
|
116
|
+
z as default
|
|
130
117
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Space as z, Popover as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as r, jsx as n } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useState as l, useContext as O, useEffect as D } from "react";
|
|
3
|
+
import { Space as z, Popover as L, Popconfirm as M, Input as H, message as w, notification as u, Button as Q } from "antd";
|
|
4
|
+
import m from "../../Iconfont/index.mjs";
|
|
5
|
+
import $ from "../../node_modules/copy-to-clipboard/index.mjs";
|
|
6
|
+
import F from "../../node_modules/classnames/index.mjs";
|
|
7
7
|
import "./style.less.mjs";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
8
|
+
import G from "../../context.mjs";
|
|
9
|
+
const J = [{
|
|
10
10
|
id: 1,
|
|
11
11
|
name: "展示信息不正确"
|
|
12
12
|
}, {
|
|
@@ -18,97 +18,98 @@ const M = [{
|
|
|
18
18
|
}, {
|
|
19
19
|
id: 4,
|
|
20
20
|
name: "其他原因"
|
|
21
|
-
}],
|
|
22
|
-
var
|
|
21
|
+
}], te = (P) => {
|
|
22
|
+
var A;
|
|
23
23
|
const {
|
|
24
|
-
appId:
|
|
24
|
+
appId: v,
|
|
25
25
|
history: t,
|
|
26
|
-
isLastHistory:
|
|
27
|
-
sessionId:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
isLastHistory: T = !1,
|
|
27
|
+
sessionId: d,
|
|
28
|
+
currentSession: i,
|
|
29
|
+
onAgainClick: g
|
|
30
|
+
} = P, [a, h] = l([]), [C, x] = l(), [_, I] = l(!1), [y, b] = l(!1), {
|
|
31
|
+
service: K,
|
|
32
|
+
popupContainer: o,
|
|
33
|
+
transform: N,
|
|
34
|
+
features: U,
|
|
35
|
+
onComment: p
|
|
36
|
+
} = O(G), [f, k] = l(() => {
|
|
36
37
|
var e;
|
|
37
38
|
return (e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree;
|
|
38
39
|
});
|
|
39
|
-
|
|
40
|
+
D(() => {
|
|
40
41
|
var e;
|
|
41
|
-
|
|
42
|
-
}, [(
|
|
42
|
+
k((e = t == null ? void 0 : t.comment) == null ? void 0 : e.isAgree);
|
|
43
|
+
}, [(A = t == null ? void 0 : t.comment) == null ? void 0 : A.isAgree]);
|
|
43
44
|
const R = () => {
|
|
44
|
-
|
|
45
|
-
getContainer: () => (
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
if (!
|
|
45
|
+
w.config({
|
|
46
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
47
|
+
}), $(t.content), w.success("复制成功");
|
|
48
|
+
}, S = (e) => {
|
|
49
|
+
if (!d || !(t != null && t.messageId))
|
|
49
50
|
return;
|
|
50
|
-
const
|
|
51
|
+
const s = {
|
|
51
52
|
messageId: t.messageId,
|
|
52
53
|
isAgree: e
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
i == null || i.postMessageComment(s).then(() => {
|
|
56
|
+
k(e), t != null && t.comment && (t.comment.isAgree = e), !(e <= 0) && (b(!0), setTimeout(() => {
|
|
57
|
+
b(!1);
|
|
57
58
|
}, 2e3));
|
|
58
|
-
}),
|
|
59
|
-
applicationId:
|
|
60
|
-
sessionId:
|
|
61
|
-
comment:
|
|
59
|
+
}), p && p({
|
|
60
|
+
applicationId: v,
|
|
61
|
+
sessionId: d,
|
|
62
|
+
comment: s
|
|
62
63
|
});
|
|
63
|
-
},
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
|
|
64
|
+
}, j = (e) => {
|
|
65
|
+
if (a.some((s) => s.id === e.id)) {
|
|
66
|
+
const s = a.filter((c) => c.id !== e.id);
|
|
67
|
+
h([...s]);
|
|
67
68
|
} else
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
if (!
|
|
69
|
+
h([...a, e]);
|
|
70
|
+
}, B = (e) => {
|
|
71
|
+
x(e.target.value);
|
|
72
|
+
}, E = () => {
|
|
73
|
+
if (!d)
|
|
73
74
|
return;
|
|
74
|
-
if (!(
|
|
75
|
-
return
|
|
75
|
+
if (!(a != null && a.length))
|
|
76
|
+
return I(!0), Promise.reject();
|
|
76
77
|
let e = [];
|
|
77
|
-
|
|
78
|
-
const
|
|
78
|
+
a != null && a.length && (e = [...e, ...a.map((c) => c.name)]), C && (e = [...e, C]);
|
|
79
|
+
const s = {
|
|
79
80
|
messageId: t.messageId,
|
|
80
81
|
isAgree: -1,
|
|
81
82
|
againstReason: e
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
-
getContainer: () => (
|
|
85
|
-
}),
|
|
86
|
-
|
|
84
|
+
u.config({
|
|
85
|
+
getContainer: () => (o == null ? void 0 : o.current) || document.body
|
|
86
|
+
}), i == null || i.postMessageComment(s).then(() => {
|
|
87
|
+
k(-1), t != null && t.comment && (t.comment.isAgree = -1);
|
|
87
88
|
const c = `open${Date.now()}`;
|
|
88
|
-
|
|
89
|
+
u.success({
|
|
89
90
|
message: "提交反馈成功",
|
|
90
91
|
description: "感谢您的参与,我们会认真评估每一条建议!",
|
|
91
92
|
duration: 2,
|
|
92
|
-
btn: /* @__PURE__ */ n(
|
|
93
|
+
btn: /* @__PURE__ */ n(Q, {
|
|
93
94
|
type: "primary",
|
|
94
|
-
onClick: () =>
|
|
95
|
+
onClick: () => u.close(c),
|
|
95
96
|
children: "我知道了"
|
|
96
97
|
}),
|
|
97
98
|
key: c,
|
|
98
|
-
onClose: () =>
|
|
99
|
+
onClose: () => u.close(c)
|
|
99
100
|
});
|
|
100
|
-
}),
|
|
101
|
-
applicationId:
|
|
102
|
-
sessionId:
|
|
103
|
-
comment:
|
|
101
|
+
}), p && p({
|
|
102
|
+
applicationId: v,
|
|
103
|
+
sessionId: d,
|
|
104
|
+
comment: s
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
|
-
return
|
|
107
|
+
return /* @__PURE__ */ r("div", {
|
|
107
108
|
className: "session-action",
|
|
108
|
-
children: [
|
|
109
|
+
children: [N != null && N.again && T ? /* @__PURE__ */ r(z, {
|
|
109
110
|
className: "session-action-again",
|
|
110
|
-
onClick: () =>
|
|
111
|
-
children: [/* @__PURE__ */ n(
|
|
111
|
+
onClick: () => g == null ? void 0 : g(),
|
|
112
|
+
children: [/* @__PURE__ */ n(m, {
|
|
112
113
|
type: "icon-zaicihuida"
|
|
113
114
|
}), /* @__PURE__ */ n("span", {
|
|
114
115
|
style: {
|
|
@@ -118,23 +119,23 @@ const M = [{
|
|
|
118
119
|
})]
|
|
119
120
|
}) : /* @__PURE__ */ n("span", {}), /* @__PURE__ */ n("div", {
|
|
120
121
|
className: "session-action-comment",
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ r(z, {
|
|
122
123
|
size: 8,
|
|
123
124
|
className: "action-comment-feedback",
|
|
124
125
|
children: [!t.isSuspend && /* @__PURE__ */ n("span", {
|
|
125
126
|
className: "comment-feedback-item comment-feedback-copy",
|
|
126
127
|
onClick: R,
|
|
127
|
-
children: /* @__PURE__ */ n(
|
|
128
|
+
children: /* @__PURE__ */ n(m, {
|
|
128
129
|
type: "icon-fuzhi"
|
|
129
130
|
})
|
|
130
|
-
}),
|
|
131
|
+
}), f === 0 && !t.isSuspend && /* @__PURE__ */ n("span", {
|
|
131
132
|
className: "comment-feedback-item",
|
|
132
|
-
children: /* @__PURE__ */ n(
|
|
133
|
+
children: /* @__PURE__ */ n(m, {
|
|
133
134
|
type: "icon-zan",
|
|
134
|
-
onClick: () =>
|
|
135
|
+
onClick: () => S(1)
|
|
135
136
|
})
|
|
136
|
-
}),
|
|
137
|
-
open:
|
|
137
|
+
}), f === 1 && /* @__PURE__ */ n(L, {
|
|
138
|
+
open: y,
|
|
138
139
|
getPopupContainer: (e) => e.parentNode,
|
|
139
140
|
content: /* @__PURE__ */ n("div", {
|
|
140
141
|
className: "zan-text",
|
|
@@ -143,23 +144,23 @@ const M = [{
|
|
|
143
144
|
trigger: "click",
|
|
144
145
|
children: /* @__PURE__ */ n("span", {
|
|
145
146
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
146
|
-
children: /* @__PURE__ */ n(
|
|
147
|
+
children: /* @__PURE__ */ n(m, {
|
|
147
148
|
type: "icon-zan"
|
|
148
149
|
})
|
|
149
150
|
})
|
|
150
|
-
}),
|
|
151
|
+
}), f === 0 && !t.isSuspend && /* @__PURE__ */ n(M, {
|
|
151
152
|
showArrow: !1,
|
|
152
153
|
arrowPointAtCenter: !0,
|
|
153
154
|
okText: "确定",
|
|
154
155
|
cancelText: "取消",
|
|
155
156
|
getPopupContainer: (e) => e.parentNode,
|
|
156
157
|
onOpenChange: (e) => {
|
|
157
|
-
e && (
|
|
158
|
+
e && (h([]), x(""), I(!1));
|
|
158
159
|
},
|
|
159
160
|
icon: !1,
|
|
160
|
-
title: /* @__PURE__ */
|
|
161
|
+
title: /* @__PURE__ */ r("div", {
|
|
161
162
|
className: "cai-pannel",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ r("div", {
|
|
163
164
|
className: "cai-title",
|
|
164
165
|
children: [/* @__PURE__ */ n("span", {
|
|
165
166
|
className: "cai-require",
|
|
@@ -170,15 +171,15 @@ const M = [{
|
|
|
170
171
|
})]
|
|
171
172
|
}), /* @__PURE__ */ n("div", {
|
|
172
173
|
className: "cai-list",
|
|
173
|
-
children:
|
|
174
|
-
className:
|
|
174
|
+
children: J.map((e) => /* @__PURE__ */ n("span", {
|
|
175
|
+
className: F({
|
|
175
176
|
"cai-item": !0,
|
|
176
|
-
"cai-item__active":
|
|
177
|
+
"cai-item__active": a.some((s) => s.id === e.id)
|
|
177
178
|
}),
|
|
178
|
-
onClick: () =>
|
|
179
|
+
onClick: () => j(e),
|
|
179
180
|
children: e.name
|
|
180
181
|
}, e.id))
|
|
181
|
-
}),
|
|
182
|
+
}), _ && /* @__PURE__ */ n("div", {
|
|
182
183
|
className: "cai-error",
|
|
183
184
|
children: /* @__PURE__ */ n("span", {
|
|
184
185
|
className: "cai-error-text",
|
|
@@ -190,9 +191,9 @@ const M = [{
|
|
|
190
191
|
className: "cai-question",
|
|
191
192
|
children: "您还有哪些建议?"
|
|
192
193
|
})
|
|
193
|
-
}), /* @__PURE__ */ n(
|
|
194
|
-
onChange:
|
|
195
|
-
value:
|
|
194
|
+
}), /* @__PURE__ */ n(H.TextArea, {
|
|
195
|
+
onChange: B,
|
|
196
|
+
value: C,
|
|
196
197
|
autoSize: {
|
|
197
198
|
minRows: 3,
|
|
198
199
|
maxRows: 6
|
|
@@ -204,7 +205,7 @@ const M = [{
|
|
|
204
205
|
maxLength: 300
|
|
205
206
|
})]
|
|
206
207
|
}),
|
|
207
|
-
onConfirm: () =>
|
|
208
|
+
onConfirm: () => E(),
|
|
208
209
|
cancelButtonProps: {
|
|
209
210
|
size: "middle"
|
|
210
211
|
},
|
|
@@ -213,13 +214,13 @@ const M = [{
|
|
|
213
214
|
},
|
|
214
215
|
children: /* @__PURE__ */ n("span", {
|
|
215
216
|
className: "comment-feedback-item",
|
|
216
|
-
children: /* @__PURE__ */ n(
|
|
217
|
+
children: /* @__PURE__ */ n(m, {
|
|
217
218
|
type: "icon-cai"
|
|
218
219
|
})
|
|
219
220
|
})
|
|
220
|
-
}),
|
|
221
|
+
}), f === -1 && /* @__PURE__ */ n("span", {
|
|
221
222
|
className: "comment-feedback-item comment-feedback-item__active",
|
|
222
|
-
children: /* @__PURE__ */ n(
|
|
223
|
+
children: /* @__PURE__ */ n(m, {
|
|
223
224
|
type: "icon-cai"
|
|
224
225
|
})
|
|
225
226
|
})]
|
|
@@ -228,5 +229,5 @@ const M = [{
|
|
|
228
229
|
});
|
|
229
230
|
};
|
|
230
231
|
export {
|
|
231
|
-
|
|
232
|
+
te as default
|
|
232
233
|
};
|