yc-component 0.1.2 → 0.1.3
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/ai-task/components/AiTaskPanel.css +1 -1
- package/dist/ai-task/components/AiTaskPanel.d.ts +6 -1
- package/dist/ai-task/components/AiTaskPanel.d.ts.map +1 -1
- package/dist/ai-task/components/AiTaskPanel.vue.js +2 -2
- package/dist/ai-task/components/AiTaskPanel.vue2.js +101 -104
- package/dist/ai-task/components/AiTaskProvider.d.ts +2 -0
- package/dist/ai-task/components/AiTaskProvider.d.ts.map +1 -1
- package/dist/ai-task/components/AiTaskProvider.vue.js +22 -19
- package/dist/ai-task/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.ai-task-panel[data-v-
|
|
1
|
+
.ai-task-panel[data-v-812b3127]{position:fixed;right:24px;bottom:24px;width:420px;max-height:min(520px,100vh - 48px);display:flex;flex-direction:column;background:var(--el-bg-color);border-radius:12px;box-shadow:0 8px 32px #0000001f;border:1px solid var(--el-border-color-lighter);z-index:3000;overflow:hidden}.ai-task-panel__header[data-v-812b3127]{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 16px 12px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-panel__header-left[data-v-812b3127]{display:flex;gap:12px;align-items:center;min-width:0}.ai-task-panel__icon[data-v-812b3127]{width:44px;height:44px;border-radius:50%;background:var(--el-color-primary-light-9);color:var(--el-color-primary);display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}.ai-task-panel__subtitle[data-v-812b3127]{font-size:12px;color:var(--el-text-color-secondary)}.ai-task-panel__title[data-v-812b3127]{font-size:18px;font-weight:700;color:var(--el-text-color-primary);line-height:1.3}.ai-task-panel__header-actions[data-v-812b3127]{display:flex;align-items:center;gap:4px;flex-shrink:0}.ai-task-panel__body[data-v-812b3127]{flex:1;overflow:auto;padding:8px 0}.ai-task-list[data-v-812b3127]{display:flex;flex-direction:column}.ai-task-row[data-v-812b3127]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-row[data-v-812b3127]:last-child{border-bottom:none}.ai-task-row__icon[data-v-812b3127]{width:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.ai-task-row__icon .ok[data-v-812b3127]{color:var(--el-color-success);font-size:28px}.ai-task-row__icon .err[data-v-812b3127]{color:var(--el-color-danger);font-size:28px}.ai-task-row__icon .muted[data-v-812b3127]{color:var(--el-text-color-secondary);font-size:24px}.ai-task-row__main[data-v-812b3127]{flex:1;min-width:0}.ai-task-row__title[data-v-812b3127]{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-task-row__meta[data-v-812b3127]{font-size:12px;color:var(--el-text-color-secondary);margin-top:2px}.ai-task-row__summary[data-v-812b3127]{font-size:12px;color:var(--el-text-color-regular);margin-top:4px;line-height:1.4}.ai-task-row__ops[data-v-812b3127]{flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:2px}.ai-task-panel__footer[data-v-812b3127]{padding:8px 16px;border-top:1px solid var(--el-border-color-extra-light);text-align:center}.ai-task-panel-mini[data-v-812b3127]{position:fixed;right:24px;bottom:24px;z-index:3000;display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--el-bg-color);border-radius:24px;box-shadow:0 4px 16px #0000001f;border:1px solid var(--el-border-color-lighter);cursor:pointer;font-size:13px;color:var(--el-text-color-primary)}.ai-task-panel-mini[data-v-812b3127]:hover{border-color:var(--el-color-primary-light-5)}.spinning[data-v-812b3127]{animation:ai-spin-812b3127 1.2s linear infinite}@keyframes ai-spin-812b3127{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ai-panel-slide-enter-active[data-v-812b3127],.ai-panel-slide-leave-active[data-v-812b3127]{transition:all .25s ease}.ai-panel-slide-enter-from[data-v-812b3127],.ai-panel-slide-leave-to[data-v-812b3127]{opacity:0;transform:translateY(16px)}.m-l-8[data-v-812b3127]{margin-left:8px}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { AiTaskFinishPayload } from '../types';
|
|
1
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
-
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}
|
|
3
|
+
declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
4
|
+
use: (payload: AiTaskFinishPayload) => any;
|
|
5
|
+
}, string, PublicProps, Readonly<{}> & Readonly<{
|
|
6
|
+
onUse?: ((payload: AiTaskFinishPayload) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
3
8
|
export default _default;
|
|
4
9
|
//# sourceMappingURL=AiTaskPanel.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiTaskPanel.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskPanel.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AiTaskPanel.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskPanel.vue"],"names":[],"mappings":";AAqGA;AA4WA,OAAO,KAAK,EAA4B,mBAAmB,EAAE,MAAM,UAAU,CAAA;;;;;;AAyjB7E,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AiTaskPanel.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-812b3127"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,94 +1,104 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Refresh as
|
|
3
|
-
import { useScopedAiTaskStore as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as x, ref as V, resolveComponent as k, openBlock as s, createBlock as r, Teleport as B, createVNode as a, Transition as D, withCtx as o, withDirectives as y, createElementVNode as l, normalizeClass as L, unref as n, toDisplayString as p, createTextVNode as v, createCommentVNode as u, createElementBlock as m, Fragment as M, renderList as N, vShow as C } from "vue";
|
|
2
|
+
import { Refresh as w, ArrowDown as R, Close as E, CircleCheck as F, CircleClose as P, Remove as U } from "@element-plus/icons-vue";
|
|
3
|
+
import { useScopedAiTaskStore as j } from "../useScopedStore.js";
|
|
4
|
+
const q = { class: "ai-task-panel" }, G = { class: "ai-task-panel__header" }, H = { class: "ai-task-panel__header-left" }, J = { class: "ai-task-panel__titles" }, K = { class: "ai-task-panel__subtitle" }, O = { class: "ai-task-panel__title" }, Q = { class: "ai-task-panel__header-actions" }, W = { class: "ai-task-panel__body" }, X = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "ai-task-list"
|
|
7
|
-
},
|
|
7
|
+
}, Y = { class: "ai-task-row__icon" }, Z = { class: "ai-task-row__main" }, ee = { class: "ai-task-row__title" }, ne = { class: "ai-task-row__meta" }, te = { key: 0 }, ie = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "ai-task-row__summary"
|
|
10
|
-
},
|
|
10
|
+
}, se = { class: "ai-task-row__ops" }, le = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "ai-task-panel__footer"
|
|
13
|
-
},
|
|
13
|
+
}, ue = /* @__PURE__ */ x({
|
|
14
14
|
__name: "AiTaskPanel",
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
emits: ["use"],
|
|
16
|
+
setup(oe, { emit: h }) {
|
|
17
|
+
const T = h, t = j(), f = V(null), b = {
|
|
17
18
|
pending: "等待中",
|
|
18
19
|
running: "执行中",
|
|
19
20
|
succeeded: "已完成",
|
|
20
21
|
failed: "失败",
|
|
21
22
|
cancelled: "已取消"
|
|
22
23
|
};
|
|
23
|
-
function
|
|
24
|
-
return
|
|
24
|
+
function I(d) {
|
|
25
|
+
return b[d] ?? d;
|
|
25
26
|
}
|
|
26
|
-
async function z(
|
|
27
|
-
|
|
27
|
+
async function z(d) {
|
|
28
|
+
f.value = d.id;
|
|
28
29
|
try {
|
|
29
|
-
const
|
|
30
|
-
|
|
30
|
+
const i = d.result ?? await t.loadTaskResult(d.id);
|
|
31
|
+
if (!i) return;
|
|
32
|
+
T("use", {
|
|
33
|
+
taskId: d.id,
|
|
34
|
+
runId: d.runId,
|
|
35
|
+
title: d.title,
|
|
36
|
+
freeText: d.freeText,
|
|
37
|
+
promptId: d.promptId,
|
|
38
|
+
result: i,
|
|
39
|
+
finishedAt: d.finishedAt ?? Date.now()
|
|
40
|
+
});
|
|
31
41
|
} finally {
|
|
32
|
-
|
|
42
|
+
f.value = null;
|
|
33
43
|
}
|
|
34
44
|
}
|
|
35
|
-
return (
|
|
36
|
-
const
|
|
37
|
-
return s(),
|
|
38
|
-
a(
|
|
45
|
+
return (d, i) => {
|
|
46
|
+
const _ = k("el-icon"), c = k("el-button"), A = k("el-empty"), S = k("el-progress"), $ = k("el-badge");
|
|
47
|
+
return s(), r(B, { to: "body" }, [
|
|
48
|
+
a(D, { name: "ai-panel-slide" }, {
|
|
39
49
|
default: o(() => [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class: L(["ai-task-panel__icon", { spinning: t
|
|
50
|
+
y(l("div", q, [
|
|
51
|
+
l("div", G, [
|
|
52
|
+
l("div", H, [
|
|
53
|
+
l("div", {
|
|
54
|
+
class: L(["ai-task-panel__icon", { spinning: n(t).activeCount > 0 }])
|
|
45
55
|
}, [
|
|
46
|
-
a(
|
|
56
|
+
a(_, null, {
|
|
47
57
|
default: o(() => [
|
|
48
|
-
a(
|
|
58
|
+
a(n(w))
|
|
49
59
|
]),
|
|
50
60
|
_: 1
|
|
51
61
|
})
|
|
52
62
|
], 2),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
l("div", J, [
|
|
64
|
+
l("div", K, p(n(t).panelSubtitle), 1),
|
|
65
|
+
l("div", O, p(n(t).panelTitle), 1)
|
|
56
66
|
])
|
|
57
67
|
]),
|
|
58
|
-
|
|
59
|
-
t
|
|
68
|
+
l("div", Q, [
|
|
69
|
+
n(t).runningCount > 0 ? (s(), r(c, {
|
|
60
70
|
key: 0,
|
|
61
71
|
link: "",
|
|
62
72
|
type: "primary",
|
|
63
|
-
onClick:
|
|
73
|
+
onClick: i[0] || (i[0] = (e) => n(t).cancelAll())
|
|
64
74
|
}, {
|
|
65
|
-
default: o(() => [...
|
|
66
|
-
|
|
75
|
+
default: o(() => [...i[5] || (i[5] = [
|
|
76
|
+
v(" 取消全部 ", -1)
|
|
67
77
|
])]),
|
|
68
78
|
_: 1
|
|
69
79
|
})) : u("", !0),
|
|
70
|
-
a(
|
|
80
|
+
a(c, {
|
|
71
81
|
link: "",
|
|
72
|
-
onClick:
|
|
82
|
+
onClick: i[1] || (i[1] = (e) => n(t).toggleMinimize())
|
|
73
83
|
}, {
|
|
74
84
|
default: o(() => [
|
|
75
|
-
a(
|
|
85
|
+
a(_, null, {
|
|
76
86
|
default: o(() => [
|
|
77
|
-
a(
|
|
87
|
+
a(n(R))
|
|
78
88
|
]),
|
|
79
89
|
_: 1
|
|
80
90
|
})
|
|
81
91
|
]),
|
|
82
92
|
_: 1
|
|
83
93
|
}),
|
|
84
|
-
a(
|
|
94
|
+
a(c, {
|
|
85
95
|
link: "",
|
|
86
|
-
onClick:
|
|
96
|
+
onClick: i[2] || (i[2] = (e) => n(t).hidePanel())
|
|
87
97
|
}, {
|
|
88
98
|
default: o(() => [
|
|
89
|
-
a(
|
|
99
|
+
a(_, null, {
|
|
90
100
|
default: o(() => [
|
|
91
|
-
a(
|
|
101
|
+
a(n(E))
|
|
92
102
|
]),
|
|
93
103
|
_: 1
|
|
94
104
|
})
|
|
@@ -97,155 +107,142 @@ const j = { class: "ai-task-panel" }, q = { class: "ai-task-panel__header" }, G
|
|
|
97
107
|
})
|
|
98
108
|
])
|
|
99
109
|
]),
|
|
100
|
-
|
|
101
|
-
t
|
|
102
|
-
(s(!0),
|
|
110
|
+
l("div", W, [
|
|
111
|
+
n(t).tasks.length ? (s(), m("div", X, [
|
|
112
|
+
(s(!0), m(M, null, N(n(t).tasks, (e) => (s(), m("div", {
|
|
103
113
|
key: e.id,
|
|
104
114
|
class: "ai-task-row"
|
|
105
115
|
}, [
|
|
106
|
-
|
|
107
|
-
e.status === "succeeded" ? (s(),
|
|
116
|
+
l("div", Y, [
|
|
117
|
+
e.status === "succeeded" ? (s(), r(_, {
|
|
108
118
|
key: 0,
|
|
109
119
|
class: "ok"
|
|
110
120
|
}, {
|
|
111
121
|
default: o(() => [
|
|
112
|
-
a(
|
|
122
|
+
a(n(F))
|
|
113
123
|
]),
|
|
114
124
|
_: 1
|
|
115
|
-
})) : e.status === "failed" ? (s(),
|
|
125
|
+
})) : e.status === "failed" ? (s(), r(_, {
|
|
116
126
|
key: 1,
|
|
117
127
|
class: "err"
|
|
118
128
|
}, {
|
|
119
129
|
default: o(() => [
|
|
120
|
-
a(
|
|
130
|
+
a(n(P))
|
|
121
131
|
]),
|
|
122
132
|
_: 1
|
|
123
|
-
})) : e.status === "running" || e.status === "pending" ? (s(),
|
|
133
|
+
})) : e.status === "running" || e.status === "pending" ? (s(), r(S, {
|
|
124
134
|
key: 2,
|
|
125
135
|
type: "circle",
|
|
126
136
|
percentage: e.progress,
|
|
127
137
|
width: 36,
|
|
128
138
|
"stroke-width": 3
|
|
129
|
-
}, null, 8, ["percentage"])) : (s(),
|
|
139
|
+
}, null, 8, ["percentage"])) : (s(), r(_, {
|
|
130
140
|
key: 3,
|
|
131
141
|
class: "muted"
|
|
132
142
|
}, {
|
|
133
143
|
default: o(() => [
|
|
134
|
-
a(
|
|
144
|
+
a(n(U))
|
|
135
145
|
]),
|
|
136
146
|
_: 1
|
|
137
147
|
}))
|
|
138
148
|
]),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
e.runId ? (s(),
|
|
149
|
+
l("div", Z, [
|
|
150
|
+
l("div", ee, p(e.title), 1),
|
|
151
|
+
l("div", ne, [
|
|
152
|
+
l("span", null, p(I(e.status)), 1),
|
|
153
|
+
e.runId ? (s(), m("span", te, " · #" + p(e.runId), 1)) : u("", !0)
|
|
144
154
|
]),
|
|
145
|
-
e.summary ? (s(),
|
|
155
|
+
e.summary ? (s(), m("div", ie, p(e.summary), 1)) : u("", !0)
|
|
146
156
|
]),
|
|
147
|
-
|
|
148
|
-
e.status === "running" || e.status === "pending" ? (s(),
|
|
157
|
+
l("div", se, [
|
|
158
|
+
e.status === "running" || e.status === "pending" ? (s(), r(c, {
|
|
149
159
|
key: 0,
|
|
150
160
|
link: "",
|
|
151
161
|
type: "danger",
|
|
152
162
|
size: "small",
|
|
153
|
-
onClick: (
|
|
163
|
+
onClick: (g) => n(t).cancelTask(e.id)
|
|
154
164
|
}, {
|
|
155
|
-
default: o(() => [...
|
|
156
|
-
|
|
165
|
+
default: o(() => [...i[6] || (i[6] = [
|
|
166
|
+
v(" 取消 ", -1)
|
|
157
167
|
])]),
|
|
158
168
|
_: 1
|
|
159
169
|
}, 8, ["onClick"])) : u("", !0),
|
|
160
|
-
e.status === "succeeded" && e.runId ? (s(),
|
|
170
|
+
e.status === "succeeded" && e.runId ? (s(), r(c, {
|
|
161
171
|
key: 1,
|
|
162
172
|
link: "",
|
|
163
173
|
type: "primary",
|
|
164
174
|
size: "small",
|
|
165
|
-
loading:
|
|
166
|
-
onClick: (
|
|
175
|
+
loading: f.value === e.id,
|
|
176
|
+
onClick: (g) => z(e)
|
|
167
177
|
}, {
|
|
168
|
-
default: o(() => [...
|
|
169
|
-
|
|
178
|
+
default: o(() => [...i[7] || (i[7] = [
|
|
179
|
+
v(" 使用 ", -1)
|
|
170
180
|
])]),
|
|
171
181
|
_: 1
|
|
172
182
|
}, 8, ["loading", "onClick"])) : u("", !0),
|
|
173
|
-
e.status !== "running" && e.status !== "pending" ? (s(),
|
|
183
|
+
e.status !== "running" && e.status !== "pending" ? (s(), r(c, {
|
|
174
184
|
key: 2,
|
|
175
185
|
link: "",
|
|
176
186
|
size: "small",
|
|
177
|
-
onClick: (
|
|
187
|
+
onClick: (g) => n(t).removeTask(e.id)
|
|
178
188
|
}, {
|
|
179
|
-
default: o(() => [...
|
|
180
|
-
|
|
189
|
+
default: o(() => [...i[8] || (i[8] = [
|
|
190
|
+
v(" 移除 ", -1)
|
|
181
191
|
])]),
|
|
182
192
|
_: 1
|
|
183
193
|
}, 8, ["onClick"])) : u("", !0)
|
|
184
194
|
])
|
|
185
195
|
]))), 128))
|
|
186
|
-
])) : (s(),
|
|
196
|
+
])) : (s(), r(A, {
|
|
187
197
|
key: 0,
|
|
188
198
|
description: "暂无 AI 任务",
|
|
189
199
|
"image-size": 64
|
|
190
200
|
}))
|
|
191
201
|
]),
|
|
192
|
-
t
|
|
193
|
-
a(
|
|
202
|
+
n(t).tasks.some((e) => e.status !== "running" && e.status !== "pending") ? (s(), m("div", le, [
|
|
203
|
+
a(c, {
|
|
194
204
|
link: "",
|
|
195
205
|
type: "info",
|
|
196
|
-
onClick:
|
|
206
|
+
onClick: i[3] || (i[3] = (e) => n(t).clearFinished())
|
|
197
207
|
}, {
|
|
198
|
-
default: o(() => [...
|
|
199
|
-
|
|
208
|
+
default: o(() => [...i[9] || (i[9] = [
|
|
209
|
+
v("清除已完成", -1)
|
|
200
210
|
])]),
|
|
201
211
|
_: 1
|
|
202
212
|
})
|
|
203
213
|
])) : u("", !0)
|
|
204
214
|
], 512), [
|
|
205
|
-
[
|
|
215
|
+
[C, n(t).panelVisible && !n(t).panelMinimized]
|
|
206
216
|
])
|
|
207
217
|
]),
|
|
208
218
|
_: 1
|
|
209
219
|
}),
|
|
210
|
-
|
|
220
|
+
y(l("div", {
|
|
211
221
|
class: "ai-task-panel-mini",
|
|
212
|
-
onClick:
|
|
222
|
+
onClick: i[4] || (i[4] = (e) => n(t).toggleMinimize())
|
|
213
223
|
}, [
|
|
214
|
-
t
|
|
224
|
+
n(t).activeCount > 0 ? (s(), r(_, {
|
|
215
225
|
key: 0,
|
|
216
226
|
class: "spinning"
|
|
217
227
|
}, {
|
|
218
228
|
default: o(() => [
|
|
219
|
-
a(
|
|
229
|
+
a(n(w))
|
|
220
230
|
]),
|
|
221
231
|
_: 1
|
|
222
232
|
})) : u("", !0),
|
|
223
|
-
|
|
224
|
-
t
|
|
233
|
+
l("span", null, p(n(t).panelSubtitle), 1),
|
|
234
|
+
n(t).runningCount > 0 ? (s(), r($, {
|
|
225
235
|
key: 1,
|
|
226
|
-
value: t
|
|
236
|
+
value: n(t).runningCount,
|
|
227
237
|
class: "m-l-8"
|
|
228
238
|
}, null, 8, ["value"])) : u("", !0)
|
|
229
239
|
], 512), [
|
|
230
|
-
[
|
|
231
|
-
])
|
|
232
|
-
a(x, {
|
|
233
|
-
modelValue: g.value,
|
|
234
|
-
"onUpdate:modelValue": n[5] || (n[5] = (e) => g.value = e),
|
|
235
|
-
title: "任务结果",
|
|
236
|
-
width: "640px",
|
|
237
|
-
"append-to-body": "",
|
|
238
|
-
"destroy-on-close": ""
|
|
239
|
-
}, {
|
|
240
|
-
default: o(() => [
|
|
241
|
-
i("pre", ae, _(C.value), 1)
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
}, 8, ["modelValue"])
|
|
240
|
+
[C, n(t).panelVisible && n(t).panelMinimized]
|
|
241
|
+
])
|
|
245
242
|
]);
|
|
246
243
|
};
|
|
247
244
|
}
|
|
248
245
|
});
|
|
249
246
|
export {
|
|
250
|
-
|
|
247
|
+
ue as default
|
|
251
248
|
};
|
|
@@ -10,8 +10,10 @@ declare function __VLS_template(): {
|
|
|
10
10
|
};
|
|
11
11
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
12
|
declare const __VLS_component: DefineComponent<AiUseDialogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
13
|
+
use: (data: AiTaskFinishPayload) => any;
|
|
13
14
|
finish: (data: AiTaskFinishPayload) => any;
|
|
14
15
|
}, string, PublicProps, Readonly<AiUseDialogProps> & Readonly<{
|
|
16
|
+
onUse?: ((data: AiTaskFinishPayload) => any) | undefined;
|
|
15
17
|
onFinish?: ((data: AiTaskFinishPayload) => any) | undefined;
|
|
16
18
|
}>, {
|
|
17
19
|
showDialog: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiTaskProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskProvider.vue"],"names":[],"mappings":";AAKA;
|
|
1
|
+
{"version":3,"file":"AiTaskProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskProvider.vue"],"names":[],"mappings":";AAKA;AAyEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AA+DrE,iBAAS,cAAc;WA8CT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;6EAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createAiTaskApi as
|
|
3
|
-
import { AI_TASK_STORE_KEY as
|
|
4
|
-
import { useAiTaskStore as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const C = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as u, provide as l, computed as c, onMounted as h, onUnmounted as d, openBlock as i, createElementBlock as T, Fragment as f, createBlock as k, normalizeProps as x, mergeProps as B, createCommentVNode as L, createVNode as w, renderSlot as b } from "vue";
|
|
2
|
+
import { createAiTaskApi as A } from "../context.js";
|
|
3
|
+
import { AI_TASK_STORE_KEY as P, AI_TASK_INJECT_KEY as M } from "../inject.js";
|
|
4
|
+
import { useAiTaskStore as _ } from "../store/useAiTaskStore.js";
|
|
5
|
+
import y from "./AiUseDialog.vue.js";
|
|
6
|
+
import S from "./AiTaskPanel.vue.js";
|
|
7
|
+
const C = /* @__PURE__ */ u({
|
|
8
8
|
__name: "AiTaskProvider",
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
@@ -25,11 +25,11 @@ const C = /* @__PURE__ */ n({
|
|
|
25
25
|
modelValue: { type: Boolean },
|
|
26
26
|
showDialog: { type: Boolean, default: !0 }
|
|
27
27
|
},
|
|
28
|
-
emits: ["finish"],
|
|
29
|
-
setup(r, { emit:
|
|
30
|
-
const e = r,
|
|
31
|
-
l(
|
|
32
|
-
const
|
|
28
|
+
emits: ["finish", "use"],
|
|
29
|
+
setup(r, { emit: n }) {
|
|
30
|
+
const e = r, s = n, o = _();
|
|
31
|
+
l(P, o), l(M, A(o));
|
|
32
|
+
const m = c(() => {
|
|
33
33
|
const t = {
|
|
34
34
|
title: e.title,
|
|
35
35
|
freeText: e.freeText,
|
|
@@ -50,14 +50,17 @@ const C = /* @__PURE__ */ n({
|
|
|
50
50
|
return e.modelValue !== void 0 && (t.modelValue = e.modelValue), t;
|
|
51
51
|
});
|
|
52
52
|
let a;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
53
|
+
function p(t) {
|
|
54
|
+
s("use", t);
|
|
55
|
+
}
|
|
56
|
+
return h(() => {
|
|
57
|
+
o.hydrate(), a = o.onTaskFinish((t) => s("finish", t));
|
|
58
|
+
}), d(() => {
|
|
56
59
|
a == null || a();
|
|
57
|
-
}), (t,
|
|
58
|
-
r.showDialog !== !1 ? (
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
}), (t, g) => (i(), T(f, null, [
|
|
61
|
+
r.showDialog !== !1 ? (i(), k(y, x(B({ key: 0 }, m.value)), null, 16)) : L("", !0),
|
|
62
|
+
w(S, { onUse: p }),
|
|
63
|
+
b(t.$slots, "default")
|
|
61
64
|
], 64));
|
|
62
65
|
}
|
|
63
66
|
});
|
package/dist/ai-task/style.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.ai-task-panel[data-v-
|
|
1
|
+
.ai-task-panel[data-v-812b3127]{position:fixed;right:24px;bottom:24px;width:420px;max-height:min(520px,100vh - 48px);display:flex;flex-direction:column;background:var(--el-bg-color);border-radius:12px;box-shadow:0 8px 32px #0000001f;border:1px solid var(--el-border-color-lighter);z-index:3000;overflow:hidden}.ai-task-panel__header[data-v-812b3127]{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 16px 12px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-panel__header-left[data-v-812b3127]{display:flex;gap:12px;align-items:center;min-width:0}.ai-task-panel__icon[data-v-812b3127]{width:44px;height:44px;border-radius:50%;background:var(--el-color-primary-light-9);color:var(--el-color-primary);display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}.ai-task-panel__subtitle[data-v-812b3127]{font-size:12px;color:var(--el-text-color-secondary)}.ai-task-panel__title[data-v-812b3127]{font-size:18px;font-weight:700;color:var(--el-text-color-primary);line-height:1.3}.ai-task-panel__header-actions[data-v-812b3127]{display:flex;align-items:center;gap:4px;flex-shrink:0}.ai-task-panel__body[data-v-812b3127]{flex:1;overflow:auto;padding:8px 0}.ai-task-list[data-v-812b3127]{display:flex;flex-direction:column}.ai-task-row[data-v-812b3127]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-row[data-v-812b3127]:last-child{border-bottom:none}.ai-task-row__icon[data-v-812b3127]{width:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.ai-task-row__icon .ok[data-v-812b3127]{color:var(--el-color-success);font-size:28px}.ai-task-row__icon .err[data-v-812b3127]{color:var(--el-color-danger);font-size:28px}.ai-task-row__icon .muted[data-v-812b3127]{color:var(--el-text-color-secondary);font-size:24px}.ai-task-row__main[data-v-812b3127]{flex:1;min-width:0}.ai-task-row__title[data-v-812b3127]{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-task-row__meta[data-v-812b3127]{font-size:12px;color:var(--el-text-color-secondary);margin-top:2px}.ai-task-row__summary[data-v-812b3127]{font-size:12px;color:var(--el-text-color-regular);margin-top:4px;line-height:1.4}.ai-task-row__ops[data-v-812b3127]{flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:2px}.ai-task-panel__footer[data-v-812b3127]{padding:8px 16px;border-top:1px solid var(--el-border-color-extra-light);text-align:center}.ai-task-panel-mini[data-v-812b3127]{position:fixed;right:24px;bottom:24px;z-index:3000;display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--el-bg-color);border-radius:24px;box-shadow:0 4px 16px #0000001f;border:1px solid var(--el-border-color-lighter);cursor:pointer;font-size:13px;color:var(--el-text-color-primary)}.ai-task-panel-mini[data-v-812b3127]:hover{border-color:var(--el-color-primary-light-5)}.spinning[data-v-812b3127]{animation:ai-spin-812b3127 1.2s linear infinite}@keyframes ai-spin-812b3127{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ai-panel-slide-enter-active[data-v-812b3127],.ai-panel-slide-leave-active[data-v-812b3127]{transition:all .25s ease}.ai-panel-slide-enter-from[data-v-812b3127],.ai-panel-slide-leave-to[data-v-812b3127]{opacity:0;transform:translateY(16px)}.m-l-8[data-v-812b3127]{margin-left:8px}
|
|
2
2
|
|
|
3
3
|
.ai-use-dialog[data-v-9aa82e83] .el-overlay{z-index:4000}.ai-use-dialog[data-v-9aa82e83] .el-dialog{z-index:4001}.ai-use-dialog[data-v-9aa82e83] .el-dialog__body{padding-top:8px}.ai-use-dialog__footer[data-v-9aa82e83]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.ai-use-dialog__footer-actions[data-v-9aa82e83]{display:flex;align-items:center;gap:8px;margin-left:auto}
|