yc-component 0.1.16 → 0.1.17
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/style.css +1 -1
- package/dist/image-selector/components/YcImageSelectorDialog.d.ts.map +1 -1
- package/dist/image-selector/components/YcImageSelectorProvider.d.ts.map +1 -1
- package/dist/image-selector/index.d.ts +1 -1
- package/dist/image-selector/index.d.ts.map +1 -1
- package/dist/image-selector/style.css +1 -1
- package/dist/image-selector/types/index.d.ts +9 -0
- package/dist/image-selector/types/index.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/page-window/style.css +1 -1
- package/dist/yc-component.cjs.full.js +21 -21
- package/dist/yc-component.cjs.js +2 -2
- package/dist/yc-component.esm.full.js +3593 -3551
- package/dist/yc-component.esm.js +1000 -958
- package/dist/yc-component.umd.full.js +34 -34
- package/dist/yc-component.umd.full.min.js +1 -1
- package/dist/yc-component.umd.js +3 -3
- package/dist/yc-component.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/yc-component.esm.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { reactive as
|
|
6
|
-
import { ElMessage as
|
|
7
|
-
import { Search as
|
|
8
|
-
import { storeToRefs as
|
|
9
|
-
const
|
|
1
|
+
var Wt = Object.defineProperty;
|
|
2
|
+
var qt = (e, n, t) => n in e ? Wt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var ot = (e, n, t) => qt(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import dt from "axios";
|
|
5
|
+
import { reactive as ft, defineComponent as ue, computed as P, ref as k, watch as ne, onMounted as Ke, onUnmounted as Ye, resolveComponent as V, resolveDirective as pt, openBlock as u, createBlock as E, withCtx as g, createElementVNode as T, createElementBlock as A, createVNode as m, withKeys as Ht, unref as w, createCommentVNode as b, createTextVNode as W, normalizeClass as me, toDisplayString as B, Fragment as ce, renderList as ye, withDirectives as we, renderSlot as Te, normalizeProps as mt, mergeProps as ze, withModifiers as Jt, nextTick as lt, render as Xt, onBeforeUnmount as Qt, Transition as gt, normalizeStyle as at, vShow as Be, inject as je, Teleport as Zt, provide as Ve, isRef as en } from "vue";
|
|
6
|
+
import { ElMessage as ee } from "element-plus";
|
|
7
|
+
import { Search as tn, Upload as nn, Check as vt, ArrowLeft as on, ArrowUpBold as ln, ArrowDownBold as an, Switch as sn, Close as _t, Refresh as it, ArrowDown as rn, CircleCheck as un, CircleClose as cn, Remove as dn } from "@element-plus/icons-vue";
|
|
8
|
+
import { storeToRefs as fn, defineStore as pn } from "pinia";
|
|
9
|
+
const Ge = {
|
|
10
10
|
projectId: "default-project",
|
|
11
11
|
storageKey: "yc-ai-task-queue-v1"
|
|
12
12
|
};
|
|
13
|
-
let
|
|
14
|
-
function
|
|
15
|
-
|
|
13
|
+
let Ie = { ...Ge };
|
|
14
|
+
function mn(e) {
|
|
15
|
+
Ie = { ...Ie, ...e };
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function ht() {
|
|
18
|
+
return Ie;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function gn() {
|
|
21
|
+
return Ie.projectId ?? Ge.projectId;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function yt() {
|
|
24
|
+
return Ie.storageKey ?? Ge.storageKey;
|
|
25
25
|
}
|
|
26
|
-
let
|
|
27
|
-
function
|
|
28
|
-
|
|
26
|
+
let de = null;
|
|
27
|
+
function vn() {
|
|
28
|
+
de = null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (
|
|
32
|
-
const { baseURL: e, getToken: n, onUnauthorized: t } =
|
|
33
|
-
return
|
|
30
|
+
function ge() {
|
|
31
|
+
if (de) return de;
|
|
32
|
+
const { baseURL: e, getToken: n, onUnauthorized: t } = ht();
|
|
33
|
+
return de = dt.create({
|
|
34
34
|
baseURL: e ?? "",
|
|
35
35
|
timeout: 6e4,
|
|
36
36
|
headers: { "Content-Type": "application/json" }
|
|
37
|
-
}),
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
}),
|
|
37
|
+
}), de.interceptors.request.use((o) => {
|
|
38
|
+
const l = n == null ? void 0 : n();
|
|
39
|
+
return l && (o.headers.Authorization = `Bearer ${l}`), o;
|
|
40
|
+
}), de.interceptors.response.use(
|
|
41
41
|
(o) => {
|
|
42
|
-
const
|
|
43
|
-
return (
|
|
42
|
+
const l = o.data;
|
|
43
|
+
return (l == null ? void 0 : l.code) != null && l.code !== 200 ? Promise.reject(new Error(l.message || "请求失败")) : (o.data = (l == null ? void 0 : l.data) ?? l, o);
|
|
44
44
|
},
|
|
45
45
|
(o) => {
|
|
46
|
-
var
|
|
47
|
-
((
|
|
48
|
-
const
|
|
49
|
-
return Promise.reject(new Error(
|
|
46
|
+
var y, c, h;
|
|
47
|
+
((y = o.response) == null ? void 0 : y.status) === 401 && (t == null || t());
|
|
48
|
+
const l = (h = (c = o.response) == null ? void 0 : c.data) == null ? void 0 : h.message;
|
|
49
|
+
return Promise.reject(new Error(l || o.message || "请求失败"));
|
|
50
50
|
}
|
|
51
|
-
),
|
|
51
|
+
), de;
|
|
52
52
|
}
|
|
53
|
-
async function
|
|
54
|
-
const o = (await
|
|
53
|
+
async function _n(e, n) {
|
|
54
|
+
const o = (await ge().get(
|
|
55
55
|
`/yc-ai/workflows/runs/${e}/artifacts/${n}`,
|
|
56
|
-
{ transformResponse: [(
|
|
56
|
+
{ transformResponse: [(l) => l] }
|
|
57
57
|
)).data;
|
|
58
58
|
if (typeof o == "string")
|
|
59
59
|
try {
|
|
@@ -63,19 +63,19 @@ async function mn(e, n) {
|
|
|
63
63
|
}
|
|
64
64
|
return o;
|
|
65
65
|
}
|
|
66
|
-
let
|
|
67
|
-
function
|
|
68
|
-
|
|
66
|
+
let Oe = {};
|
|
67
|
+
function hn(e) {
|
|
68
|
+
Oe = { ...Oe, ...e };
|
|
69
69
|
}
|
|
70
70
|
function Ae() {
|
|
71
|
-
return
|
|
71
|
+
return Oe;
|
|
72
72
|
}
|
|
73
73
|
class be extends Error {
|
|
74
74
|
constructor(n = "Image selector cancelled") {
|
|
75
75
|
super(n), this.name = "ImageSelectorCancelledError";
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
class
|
|
78
|
+
class st extends Error {
|
|
79
79
|
constructor(t, o) {
|
|
80
80
|
super(o || {
|
|
81
81
|
missing_token: "请先填写并保存云盘 Access Token",
|
|
@@ -83,74 +83,74 @@ class at extends Error {
|
|
|
83
83
|
valid_site: "请先在云盘配置有效站点",
|
|
84
84
|
unknown: "云盘鉴权失败"
|
|
85
85
|
}[t]);
|
|
86
|
-
|
|
86
|
+
ot(this, "reason");
|
|
87
87
|
this.name = "ImageSelectorAuthError", this.reason = t;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
let
|
|
91
|
-
function
|
|
92
|
-
return
|
|
93
|
-
|
|
90
|
+
let te = null;
|
|
91
|
+
function yn() {
|
|
92
|
+
return te && (te.reject(new be()), te = null), new Promise((e, n) => {
|
|
93
|
+
te = { resolve: e, reject: n };
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
96
|
+
function wn(e) {
|
|
97
|
+
te == null || te.resolve(e), te = null;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
99
|
+
function rt() {
|
|
100
|
+
te == null || te.reject(new be()), te = null;
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
function
|
|
102
|
+
const Le = "__YC_COMPONENT_IMAGE_SELECTOR__", Fe = "yc-component:image-selector-open";
|
|
103
|
+
function Tn() {
|
|
104
104
|
const e = globalThis;
|
|
105
|
-
return e[
|
|
105
|
+
return e[Le] || (e[Le] = ft({
|
|
106
106
|
visible: !1,
|
|
107
107
|
options: {}
|
|
108
|
-
})), e[
|
|
108
|
+
})), e[Le];
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
function
|
|
112
|
-
|
|
113
|
-
new CustomEvent(
|
|
110
|
+
const J = Tn();
|
|
111
|
+
function In(e = {}) {
|
|
112
|
+
J.options = { ...e }, J.visible = !0, globalThis.dispatchEvent(
|
|
113
|
+
new CustomEvent(Fe, { detail: { ...e } })
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
116
|
+
function wt() {
|
|
117
|
+
J.visible = !1;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
119
|
+
function Tt() {
|
|
120
|
+
wt();
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
const n =
|
|
124
|
-
return
|
|
122
|
+
function It(e = {}) {
|
|
123
|
+
const n = yn();
|
|
124
|
+
return In(e), n;
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const Cn = { class: "yc-image-selector" }, Sn = {
|
|
127
127
|
key: 0,
|
|
128
128
|
class: "yc-image-selector__toolbar"
|
|
129
|
-
},
|
|
129
|
+
}, xn = { class: "yc-image-selector__body" }, kn = {
|
|
130
130
|
key: 0,
|
|
131
131
|
class: "yc-image-selector__aside"
|
|
132
|
-
},
|
|
132
|
+
}, En = ["onClick"], bn = {
|
|
133
133
|
key: 0,
|
|
134
134
|
class: "yc-image-selector__category-count"
|
|
135
|
-
},
|
|
135
|
+
}, An = { class: "yc-image-selector__main" }, Mn = {
|
|
136
136
|
key: 1,
|
|
137
137
|
class: "yc-image-selector__grid"
|
|
138
|
-
},
|
|
138
|
+
}, Pn = ["onClick"], $n = { class: "yc-image-selector__thumb" }, Ln = ["src", "alt", "onLoad"], Dn = {
|
|
139
139
|
key: 0,
|
|
140
140
|
class: "yc-image-selector__order"
|
|
141
|
-
},
|
|
141
|
+
}, Bn = ["title"], Vn = {
|
|
142
142
|
key: 1,
|
|
143
143
|
class: "yc-image-selector__selected-bar"
|
|
144
|
-
},
|
|
144
|
+
}, On = { class: "yc-image-selector__selected-bar-label" }, Fn = { class: "yc-image-selector__selected-bar-list" }, Un = ["onClick"], Rn = ["src", "alt"], Nn = {
|
|
145
145
|
key: 2,
|
|
146
146
|
class: "yc-image-selector__pagination"
|
|
147
|
-
},
|
|
147
|
+
}, Kn = {
|
|
148
148
|
key: 0,
|
|
149
149
|
class: "yc-image-selector__footer"
|
|
150
|
-
},
|
|
150
|
+
}, Yn = { class: "yc-image-selector__footer-left" }, zn = { class: "yc-image-selector__selected-tip" }, jn = { class: "yc-image-selector__footer-actions" }, Gn = {
|
|
151
151
|
key: 1,
|
|
152
152
|
class: "yc-image-selector__footer yc-image-selector__footer--quick"
|
|
153
|
-
},
|
|
153
|
+
}, Wn = { class: "yc-image-selector__footer-left" }, qn = { class: "yc-image-selector__selected-tip" }, Hn = /* @__PURE__ */ ue({
|
|
154
154
|
__name: "YcImageSelectorDialog",
|
|
155
155
|
props: {
|
|
156
156
|
modelValue: { type: [Boolean, null], default: null },
|
|
@@ -171,13 +171,14 @@ const wn = { class: "yc-image-selector" }, Tn = {
|
|
|
171
171
|
cancelText: { default: "取消" },
|
|
172
172
|
emptyText: { default: "暂无图片资源" },
|
|
173
173
|
renderEmpty: {},
|
|
174
|
+
renderFooterExtra: {},
|
|
174
175
|
getImages: {},
|
|
175
176
|
upload: {},
|
|
176
177
|
urlField: { default: "url" }
|
|
177
178
|
},
|
|
178
179
|
emits: ["update:modelValue", "confirm", "cancel"],
|
|
179
180
|
setup(e, { emit: n }) {
|
|
180
|
-
const t =
|
|
181
|
+
const t = ue({
|
|
181
182
|
name: "YcImageSelectorRenderEmpty",
|
|
182
183
|
props: {
|
|
183
184
|
render: {
|
|
@@ -192,294 +193,333 @@ const wn = { class: "yc-image-selector" }, Tn = {
|
|
|
192
193
|
setup(a) {
|
|
193
194
|
return () => a.render(a.ctx);
|
|
194
195
|
}
|
|
195
|
-
}), o =
|
|
196
|
+
}), o = ue({
|
|
197
|
+
name: "YcImageSelectorRenderFooterExtra",
|
|
198
|
+
props: {
|
|
199
|
+
render: {
|
|
200
|
+
type: Function,
|
|
201
|
+
required: !0
|
|
202
|
+
},
|
|
203
|
+
ctx: {
|
|
204
|
+
type: Object,
|
|
205
|
+
required: !0
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
setup(a) {
|
|
209
|
+
return () => a.render(a.ctx);
|
|
210
|
+
}
|
|
211
|
+
}), l = e, y = n, c = P(() => l.modelValue != null), h = k(!1), p = k(null);
|
|
196
212
|
ne(
|
|
197
|
-
() =>
|
|
213
|
+
() => l.modelValue,
|
|
198
214
|
(a) => {
|
|
199
|
-
|
|
215
|
+
c.value && (h.value = !!a);
|
|
200
216
|
},
|
|
201
217
|
{ immediate: !0 }
|
|
202
|
-
), ne(
|
|
203
|
-
if (
|
|
204
|
-
|
|
218
|
+
), ne(h, (a) => {
|
|
219
|
+
if (c.value) {
|
|
220
|
+
y("update:modelValue", a);
|
|
205
221
|
return;
|
|
206
222
|
}
|
|
207
|
-
|
|
223
|
+
J.visible = a, a || wt();
|
|
208
224
|
}), ne(
|
|
209
|
-
() =>
|
|
225
|
+
() => J.visible,
|
|
210
226
|
(a) => {
|
|
211
|
-
|
|
227
|
+
c.value || (h.value = a);
|
|
212
228
|
},
|
|
213
229
|
{ immediate: !0 }
|
|
214
230
|
);
|
|
215
|
-
const
|
|
216
|
-
() => (
|
|
217
|
-
),
|
|
218
|
-
() => (
|
|
219
|
-
),
|
|
220
|
-
() => (
|
|
221
|
-
),
|
|
222
|
-
() => (
|
|
223
|
-
),
|
|
224
|
-
() => (
|
|
225
|
-
),
|
|
226
|
-
var a,
|
|
227
|
-
if ((a =
|
|
228
|
-
if (!
|
|
229
|
-
return
|
|
230
|
-
}),
|
|
231
|
-
() => (
|
|
232
|
-
),
|
|
231
|
+
const r = P(
|
|
232
|
+
() => (c.value ? void 0 : J.options.title) ?? l.title ?? "选择图片"
|
|
233
|
+
), S = P(
|
|
234
|
+
() => (c.value ? void 0 : J.options.multiple) ?? l.multiple
|
|
235
|
+
), D = P(
|
|
236
|
+
() => (c.value ? void 0 : J.options.maxCount) ?? l.maxCount
|
|
237
|
+
), N = P(
|
|
238
|
+
() => (c.value ? void 0 : J.options.showModeSwitch) ?? l.showModeSwitch
|
|
239
|
+
), q = P(
|
|
240
|
+
() => (c.value ? void 0 : J.options.showCategories) ?? l.showCategories
|
|
241
|
+
), F = P(() => {
|
|
242
|
+
var a, i;
|
|
243
|
+
if ((a = l.categories) != null && a.length) return l.categories;
|
|
244
|
+
if (!c.value && ((i = J.options.categories) != null && i.length))
|
|
245
|
+
return J.options.categories;
|
|
246
|
+
}), v = P(() => q.value ? F.value ?? Q.value : []), L = P(
|
|
247
|
+
() => (c.value ? void 0 : J.options.confirmOnSelect) ?? l.confirmOnSelect
|
|
248
|
+
), z = k("single"), $ = [
|
|
233
249
|
{ label: "单选", value: "single" },
|
|
234
250
|
{ label: "多选", value: "multiple" }
|
|
235
|
-
],
|
|
236
|
-
() =>
|
|
237
|
-
),
|
|
238
|
-
authState:
|
|
239
|
-
isEmpty:
|
|
240
|
-
reload:
|
|
241
|
-
}))
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
251
|
+
], M = P(
|
|
252
|
+
() => N.value ? z.value === "multiple" : S.value
|
|
253
|
+
), Y = k(""), _ = k(""), C = k(1), K = k(0), j = k(!1), X = k(!1), H = k([]), Q = k([]), O = k(/* @__PURE__ */ new Map()), Z = k(/* @__PURE__ */ new Map()), se = k(), U = k(), oe = k(!1), G = P(() => [...O.value.values()]), Ce = P(() => !!p.value || H.value.length === 0), Se = P(() => ({
|
|
254
|
+
authState: p.value,
|
|
255
|
+
isEmpty: H.value.length === 0,
|
|
256
|
+
reload: ve
|
|
257
|
+
}));
|
|
258
|
+
function s(a) {
|
|
259
|
+
p.value = {
|
|
260
|
+
reason: (a == null ? void 0 : a.reason) ?? "missing_token",
|
|
261
|
+
message: a == null ? void 0 : a.message
|
|
262
|
+
}, H.value = [], K.value = 0, Q.value = [], Y.value = "", _.value = "", C.value = 1;
|
|
263
|
+
}
|
|
264
|
+
const f = P(() => ({
|
|
265
|
+
isAuthenticated: !p.value,
|
|
266
|
+
enterAuthSetup: s
|
|
267
|
+
})), d = P(() => {
|
|
268
|
+
var i, x;
|
|
269
|
+
const a = G.value.length;
|
|
270
|
+
return L.value ? a ? `已选:${((i = G.value[0]) == null ? void 0 : i.name) || "1 张图片"}` : "单击图片即可完成选择" : a ? M.value ? `已选 ${a} / ${D.value} 张` : `已选:${((x = G.value[0]) == null ? void 0 : x.name) || "1 张图片"}` : M.value ? `多选模式:最多 ${D.value} 张` : "单选模式:请选择一张图片";
|
|
245
271
|
});
|
|
246
|
-
function
|
|
247
|
-
const
|
|
248
|
-
return
|
|
272
|
+
function R(a) {
|
|
273
|
+
const i = G.value.findIndex((x) => le(x) === le(a));
|
|
274
|
+
return i >= 0 ? i + 1 : "";
|
|
249
275
|
}
|
|
250
|
-
function
|
|
251
|
-
if (a === "single" &&
|
|
252
|
-
const
|
|
253
|
-
|
|
276
|
+
function fe(a) {
|
|
277
|
+
if (a === "single" && G.value.length > 1) {
|
|
278
|
+
const i = G.value[0];
|
|
279
|
+
O.value = /* @__PURE__ */ new Map([[le(i), i]]), ee.info("已切换为单选,仅保留第一张");
|
|
254
280
|
}
|
|
255
281
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
282
|
+
function pe() {
|
|
283
|
+
z.value = S.value ? "multiple" : "single";
|
|
258
284
|
}
|
|
259
|
-
function
|
|
260
|
-
|
|
285
|
+
function Dt() {
|
|
286
|
+
O.value = /* @__PURE__ */ new Map();
|
|
261
287
|
}
|
|
262
|
-
function
|
|
263
|
-
return a[
|
|
288
|
+
function He(a) {
|
|
289
|
+
return a[l.urlField];
|
|
264
290
|
}
|
|
265
|
-
function
|
|
291
|
+
function le(a) {
|
|
266
292
|
return a.id ?? a.url;
|
|
267
293
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
294
|
+
function xe(a) {
|
|
295
|
+
return O.value.has(le(a));
|
|
270
296
|
}
|
|
271
|
-
function
|
|
272
|
-
return a <
|
|
297
|
+
function Je(a, i) {
|
|
298
|
+
return a < i ? "portrait" : a > i ? "landscape" : "square";
|
|
273
299
|
}
|
|
274
|
-
function
|
|
275
|
-
const x =
|
|
276
|
-
|
|
300
|
+
function Xe(a, i) {
|
|
301
|
+
const x = le(a);
|
|
302
|
+
Z.value.get(x) !== i && (Z.value.set(x, i), Z.value = new Map(Z.value));
|
|
277
303
|
}
|
|
278
|
-
function
|
|
279
|
-
const
|
|
280
|
-
return
|
|
304
|
+
function Bt(a) {
|
|
305
|
+
const i = Z.value.get(le(a));
|
|
306
|
+
return i ? `yc-image-selector__img--${i}` : "";
|
|
281
307
|
}
|
|
282
|
-
function
|
|
308
|
+
function Vt(a, i) {
|
|
283
309
|
const x = a.target;
|
|
284
|
-
!(x != null && x.naturalWidth) || !(x != null && x.naturalHeight) ||
|
|
310
|
+
!(x != null && x.naturalWidth) || !(x != null && x.naturalHeight) || Xe(i, Je(x.naturalWidth, x.naturalHeight));
|
|
285
311
|
}
|
|
286
|
-
function
|
|
287
|
-
a.width && a.height &&
|
|
312
|
+
function Ot(a) {
|
|
313
|
+
a.width && a.height && Xe(a, Je(a.width, a.height));
|
|
288
314
|
}
|
|
289
|
-
function
|
|
290
|
-
const
|
|
315
|
+
function Qe(a) {
|
|
316
|
+
const i = /* @__PURE__ */ new Map();
|
|
291
317
|
if (!(a != null && a.length)) {
|
|
292
|
-
|
|
318
|
+
O.value = i;
|
|
293
319
|
return;
|
|
294
320
|
}
|
|
295
321
|
if (typeof a[0] == "string")
|
|
296
322
|
for (const ie of a)
|
|
297
|
-
|
|
323
|
+
i.set(ie, { id: ie, url: ie, name: ie.split("/").pop() });
|
|
298
324
|
else
|
|
299
325
|
for (const ie of a)
|
|
300
|
-
|
|
301
|
-
|
|
326
|
+
i.set(le(ie), ie);
|
|
327
|
+
O.value = i;
|
|
302
328
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
329
|
+
function Pe(a) {
|
|
330
|
+
se.value = a.onConfirm, U.value = a.onCancel, Qe(a.selected ?? l.selected);
|
|
305
331
|
}
|
|
306
|
-
function
|
|
307
|
-
if (
|
|
308
|
-
const
|
|
309
|
-
|
|
332
|
+
function Ze(a) {
|
|
333
|
+
if (c.value) return;
|
|
334
|
+
const i = a.detail ?? {};
|
|
335
|
+
Pe(i), h.value = !0;
|
|
310
336
|
}
|
|
311
337
|
Ke(() => {
|
|
312
|
-
globalThis.addEventListener(
|
|
313
|
-
}),
|
|
314
|
-
globalThis.removeEventListener(
|
|
338
|
+
globalThis.addEventListener(Fe, Ze), c.value || (h.value = J.visible);
|
|
339
|
+
}), Ye(() => {
|
|
340
|
+
globalThis.removeEventListener(Fe, Ze);
|
|
315
341
|
});
|
|
316
|
-
async function
|
|
342
|
+
async function $e() {
|
|
317
343
|
var a;
|
|
318
|
-
if (!
|
|
319
|
-
|
|
344
|
+
if (!l.getImages) {
|
|
345
|
+
ee.error("请通过 props.getImages 传入图片列表请求方法");
|
|
320
346
|
return;
|
|
321
347
|
}
|
|
322
|
-
|
|
348
|
+
j.value = !0, p.value = null;
|
|
323
349
|
try {
|
|
324
|
-
const
|
|
325
|
-
keyword:
|
|
326
|
-
category:
|
|
327
|
-
page:
|
|
328
|
-
pageSize:
|
|
350
|
+
const i = await l.getImages({
|
|
351
|
+
keyword: Y.value.trim() || void 0,
|
|
352
|
+
category: q.value && _.value || void 0,
|
|
353
|
+
page: C.value,
|
|
354
|
+
pageSize: l.pageSize
|
|
329
355
|
});
|
|
330
|
-
|
|
331
|
-
for (const x of
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
} catch (
|
|
335
|
-
if (
|
|
336
|
-
const x =
|
|
337
|
-
|
|
356
|
+
H.value = i.list, K.value = i.total;
|
|
357
|
+
for (const x of i.list)
|
|
358
|
+
Ot(x);
|
|
359
|
+
q.value && !F.value && ((a = i.categories) != null && a.length) && (Q.value = i.categories);
|
|
360
|
+
} catch (i) {
|
|
361
|
+
if (H.value = [], K.value = 0, i instanceof st || (i == null ? void 0 : i.name) === "ImageSelectorAuthError") {
|
|
362
|
+
const x = i;
|
|
363
|
+
p.value = {
|
|
338
364
|
reason: x.reason || "unknown",
|
|
339
365
|
message: x.message
|
|
340
366
|
};
|
|
341
367
|
return;
|
|
342
368
|
}
|
|
343
|
-
|
|
369
|
+
ee.error(i instanceof Error ? i.message : "加载图片失败");
|
|
344
370
|
} finally {
|
|
345
|
-
|
|
371
|
+
j.value = !1;
|
|
346
372
|
}
|
|
347
373
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
374
|
+
function ve() {
|
|
375
|
+
C.value = 1, $e();
|
|
350
376
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
377
|
+
function et(a) {
|
|
378
|
+
_.value !== a && (_.value = a, ve());
|
|
353
379
|
}
|
|
354
|
-
function
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
if (
|
|
358
|
-
|
|
380
|
+
function tt(a) {
|
|
381
|
+
const i = le(a);
|
|
382
|
+
if (M.value) {
|
|
383
|
+
if (O.value.has(i)) {
|
|
384
|
+
O.value.delete(i), O.value = new Map(O.value);
|
|
359
385
|
return;
|
|
360
386
|
}
|
|
361
|
-
if (
|
|
362
|
-
|
|
387
|
+
if (G.value.length >= D.value) {
|
|
388
|
+
ee.warning(`最多选择 ${D.value} 张图片`);
|
|
363
389
|
return;
|
|
364
390
|
}
|
|
365
|
-
|
|
391
|
+
O.value.set(i, a), O.value = new Map(O.value);
|
|
366
392
|
return;
|
|
367
393
|
}
|
|
368
|
-
if (
|
|
369
|
-
if (
|
|
370
|
-
|
|
394
|
+
if (O.value.has(i)) {
|
|
395
|
+
if (L.value) {
|
|
396
|
+
lt(() => ke());
|
|
371
397
|
return;
|
|
372
398
|
}
|
|
373
|
-
|
|
399
|
+
O.value = /* @__PURE__ */ new Map();
|
|
374
400
|
return;
|
|
375
401
|
}
|
|
376
|
-
|
|
402
|
+
O.value = /* @__PURE__ */ new Map([[i, a]]), L.value && lt(() => ke());
|
|
377
403
|
}
|
|
378
|
-
async function
|
|
379
|
-
if (!
|
|
380
|
-
|
|
404
|
+
async function Ft(a) {
|
|
405
|
+
if (!l.upload) {
|
|
406
|
+
ee.error("请通过 props.upload 传入图片上传方法");
|
|
381
407
|
return;
|
|
382
408
|
}
|
|
383
|
-
|
|
409
|
+
X.value = !0;
|
|
384
410
|
try {
|
|
385
|
-
const { resource:
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
else if (
|
|
411
|
+
const { resource: i } = await l.upload(a.file);
|
|
412
|
+
if (ee.success("上传成功"), p.value = null, M.value)
|
|
413
|
+
G.value.length < D.value && (O.value.set(le(i), i), O.value = new Map(O.value));
|
|
414
|
+
else if (O.value = /* @__PURE__ */ new Map([[le(i), i]]), L.value) {
|
|
389
415
|
ke();
|
|
390
416
|
return;
|
|
391
417
|
}
|
|
392
|
-
|
|
393
|
-
} catch (
|
|
394
|
-
if (
|
|
395
|
-
const x =
|
|
396
|
-
|
|
418
|
+
ve();
|
|
419
|
+
} catch (i) {
|
|
420
|
+
if (i instanceof st || (i == null ? void 0 : i.name) === "ImageSelectorAuthError") {
|
|
421
|
+
const x = i;
|
|
422
|
+
p.value = {
|
|
397
423
|
reason: x.reason || "unknown",
|
|
398
424
|
message: x.message
|
|
399
|
-
},
|
|
425
|
+
}, H.value = [], K.value = 0;
|
|
400
426
|
return;
|
|
401
427
|
}
|
|
402
|
-
|
|
428
|
+
ee.error(i instanceof Error ? i.message : "上传失败");
|
|
403
429
|
} finally {
|
|
404
|
-
|
|
430
|
+
X.value = !1;
|
|
405
431
|
}
|
|
406
432
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
433
|
+
function Ut() {
|
|
434
|
+
oe.value = !1, Y.value = "", _.value = "", C.value = 1, Q.value = [], Z.value = /* @__PURE__ */ new Map(), p.value = null, pe(), c.value ? Pe({}) : Pe(J.options), pe(), $e();
|
|
409
435
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
436
|
+
function Rt() {
|
|
437
|
+
X.value = !1;
|
|
412
438
|
}
|
|
413
|
-
function
|
|
439
|
+
function nt() {
|
|
414
440
|
var a;
|
|
415
|
-
|
|
441
|
+
oe.value || (oe.value = !0, (a = U.value) == null || a.call(U), c.value || rt(), y("cancel"), h.value = !1);
|
|
416
442
|
}
|
|
417
443
|
function ke() {
|
|
418
|
-
var
|
|
419
|
-
if (!
|
|
420
|
-
|
|
444
|
+
var i;
|
|
445
|
+
if (!G.value.length) {
|
|
446
|
+
ee.warning("请选择图片");
|
|
421
447
|
return;
|
|
422
448
|
}
|
|
423
|
-
if (
|
|
424
|
-
|
|
425
|
-
const a = [...
|
|
426
|
-
if (
|
|
427
|
-
|
|
449
|
+
if (oe.value) return;
|
|
450
|
+
oe.value = !0;
|
|
451
|
+
const a = [...G.value];
|
|
452
|
+
if (c.value) {
|
|
453
|
+
y("confirm", a), h.value = !1;
|
|
428
454
|
return;
|
|
429
455
|
}
|
|
430
|
-
(
|
|
456
|
+
(i = se.value) == null || i.call(se, a), c.value || wn(a), y("confirm", a), h.value = !1;
|
|
431
457
|
}
|
|
432
|
-
return ne(
|
|
458
|
+
return ne(h, (a, i) => {
|
|
433
459
|
var x;
|
|
434
|
-
|
|
460
|
+
i && !a && !oe.value && ((x = U.value) == null || x.call(U), c.value || rt(), y("cancel"));
|
|
435
461
|
}), ne(
|
|
436
|
-
() =>
|
|
462
|
+
() => l.selected,
|
|
437
463
|
(a) => {
|
|
438
|
-
|
|
464
|
+
h.value || Qe(a);
|
|
439
465
|
},
|
|
440
466
|
{ deep: !0 }
|
|
441
|
-
), (a,
|
|
442
|
-
const x =
|
|
443
|
-
return u(),
|
|
444
|
-
modelValue:
|
|
445
|
-
"onUpdate:modelValue":
|
|
446
|
-
title:
|
|
467
|
+
), (a, i) => {
|
|
468
|
+
const x = V("el-icon"), ie = V("el-input"), Nt = V("el-segmented"), _e = V("el-button"), Kt = V("el-upload"), Yt = V("el-empty"), zt = V("el-pagination"), jt = V("el-dialog"), Gt = pt("loading");
|
|
469
|
+
return u(), E(jt, {
|
|
470
|
+
modelValue: h.value,
|
|
471
|
+
"onUpdate:modelValue": i[4] || (i[4] = (I) => h.value = I),
|
|
472
|
+
title: r.value,
|
|
447
473
|
width: e.width,
|
|
448
474
|
"append-to-body": "",
|
|
449
475
|
"destroy-on-close": "",
|
|
450
476
|
class: "yc-image-selector-dialog",
|
|
451
|
-
onClosed:
|
|
452
|
-
onOpen:
|
|
477
|
+
onClosed: Rt,
|
|
478
|
+
onOpen: Ut
|
|
453
479
|
}, {
|
|
454
480
|
footer: g(() => [
|
|
455
|
-
|
|
456
|
-
T("
|
|
457
|
-
|
|
481
|
+
L.value ? (u(), A("div", Gn, [
|
|
482
|
+
T("div", Wn, [
|
|
483
|
+
T("span", qn, B(d.value), 1),
|
|
484
|
+
l.renderFooterExtra && !p.value ? (u(), E(w(o), {
|
|
485
|
+
key: 0,
|
|
486
|
+
render: l.renderFooterExtra,
|
|
487
|
+
ctx: f.value
|
|
488
|
+
}, null, 8, ["render", "ctx"])) : b("", !0)
|
|
489
|
+
]),
|
|
490
|
+
m(_e, {
|
|
458
491
|
link: "",
|
|
459
492
|
type: "primary",
|
|
460
|
-
onClick:
|
|
493
|
+
onClick: nt
|
|
461
494
|
}, {
|
|
462
495
|
default: g(() => [
|
|
463
|
-
|
|
496
|
+
W(B(e.cancelText), 1)
|
|
464
497
|
]),
|
|
465
498
|
_: 1
|
|
466
499
|
})
|
|
467
|
-
])) : (u(), A("div",
|
|
468
|
-
T("
|
|
469
|
-
|
|
470
|
-
|
|
500
|
+
])) : (u(), A("div", Kn, [
|
|
501
|
+
T("div", Yn, [
|
|
502
|
+
T("span", zn, B(d.value), 1),
|
|
503
|
+
l.renderFooterExtra && !p.value ? (u(), E(w(o), {
|
|
504
|
+
key: 0,
|
|
505
|
+
render: l.renderFooterExtra,
|
|
506
|
+
ctx: f.value
|
|
507
|
+
}, null, 8, ["render", "ctx"])) : b("", !0)
|
|
508
|
+
]),
|
|
509
|
+
T("div", jn, [
|
|
510
|
+
m(_e, { onClick: nt }, {
|
|
471
511
|
default: g(() => [
|
|
472
|
-
|
|
512
|
+
W(B(e.cancelText), 1)
|
|
473
513
|
]),
|
|
474
514
|
_: 1
|
|
475
515
|
}),
|
|
476
|
-
m(
|
|
516
|
+
m(_e, {
|
|
477
517
|
type: "primary",
|
|
478
|
-
disabled: !
|
|
518
|
+
disabled: !G.value.length,
|
|
479
519
|
onClick: ke
|
|
480
520
|
}, {
|
|
481
521
|
default: g(() => [
|
|
482
|
-
|
|
522
|
+
W(B(e.confirmText), 1)
|
|
483
523
|
]),
|
|
484
524
|
_: 1
|
|
485
525
|
}, 8, ["disabled"])
|
|
@@ -487,191 +527,191 @@ const wn = { class: "yc-image-selector" }, Tn = {
|
|
|
487
527
|
]))
|
|
488
528
|
]),
|
|
489
529
|
default: g(() => [
|
|
490
|
-
T("div",
|
|
491
|
-
|
|
530
|
+
T("div", Cn, [
|
|
531
|
+
p.value ? b("", !0) : (u(), A("div", Sn, [
|
|
492
532
|
m(ie, {
|
|
493
|
-
modelValue:
|
|
494
|
-
"onUpdate:modelValue":
|
|
533
|
+
modelValue: Y.value,
|
|
534
|
+
"onUpdate:modelValue": i[0] || (i[0] = (I) => Y.value = I),
|
|
495
535
|
clearable: "",
|
|
496
536
|
placeholder: "搜索图片名称",
|
|
497
537
|
class: "yc-image-selector__search",
|
|
498
|
-
onKeyup:
|
|
499
|
-
onClear:
|
|
538
|
+
onKeyup: Ht(ve, ["enter"]),
|
|
539
|
+
onClear: ve
|
|
500
540
|
}, {
|
|
501
541
|
prefix: g(() => [
|
|
502
542
|
m(x, null, {
|
|
503
543
|
default: g(() => [
|
|
504
|
-
m(w(
|
|
544
|
+
m(w(tn))
|
|
505
545
|
]),
|
|
506
546
|
_: 1
|
|
507
547
|
})
|
|
508
548
|
]),
|
|
509
549
|
_: 1
|
|
510
550
|
}, 8, ["modelValue"]),
|
|
511
|
-
|
|
551
|
+
N.value ? (u(), E(Nt, {
|
|
512
552
|
key: 0,
|
|
513
|
-
modelValue:
|
|
514
|
-
"onUpdate:modelValue":
|
|
515
|
-
options:
|
|
553
|
+
modelValue: z.value,
|
|
554
|
+
"onUpdate:modelValue": i[1] || (i[1] = (I) => z.value = I),
|
|
555
|
+
options: $,
|
|
516
556
|
class: "yc-image-selector__mode",
|
|
517
|
-
onChange:
|
|
518
|
-
}, null, 8, ["modelValue"])) :
|
|
519
|
-
e.showUpload && e.upload ? (u(),
|
|
557
|
+
onChange: fe
|
|
558
|
+
}, null, 8, ["modelValue"])) : b("", !0),
|
|
559
|
+
e.showUpload && e.upload ? (u(), E(Kt, {
|
|
520
560
|
key: 1,
|
|
521
561
|
"show-file-list": !1,
|
|
522
562
|
accept: e.accept,
|
|
523
|
-
"http-request":
|
|
524
|
-
disabled:
|
|
563
|
+
"http-request": Ft,
|
|
564
|
+
disabled: X.value
|
|
525
565
|
}, {
|
|
526
566
|
default: g(() => [
|
|
527
|
-
m(
|
|
567
|
+
m(_e, {
|
|
528
568
|
type: "primary",
|
|
529
569
|
plain: "",
|
|
530
|
-
loading:
|
|
570
|
+
loading: X.value
|
|
531
571
|
}, {
|
|
532
572
|
default: g(() => [
|
|
533
573
|
m(x, { class: "m-r-4" }, {
|
|
534
574
|
default: g(() => [
|
|
535
|
-
m(w(
|
|
575
|
+
m(w(nn))
|
|
536
576
|
]),
|
|
537
577
|
_: 1
|
|
538
578
|
}),
|
|
539
|
-
|
|
579
|
+
i[5] || (i[5] = W(" 上传图片 ", -1))
|
|
540
580
|
]),
|
|
541
581
|
_: 1
|
|
542
582
|
}, 8, ["loading"])
|
|
543
583
|
]),
|
|
544
584
|
_: 1
|
|
545
|
-
}, 8, ["accept", "disabled"])) :
|
|
585
|
+
}, 8, ["accept", "disabled"])) : b("", !0)
|
|
546
586
|
])),
|
|
547
|
-
T("div",
|
|
548
|
-
|
|
587
|
+
T("div", xn, [
|
|
588
|
+
q.value && !p.value ? (u(), A("aside", kn, [
|
|
549
589
|
T("div", {
|
|
550
|
-
class:
|
|
551
|
-
onClick:
|
|
552
|
-
},
|
|
553
|
-
(u(!0), A(
|
|
590
|
+
class: me(["yc-image-selector__category", { "is-active": _.value === "" }]),
|
|
591
|
+
onClick: i[2] || (i[2] = (I) => et(""))
|
|
592
|
+
}, B(e.categoryAllLabel), 3),
|
|
593
|
+
(u(!0), A(ce, null, ye(v.value, (I) => (u(), A("div", {
|
|
554
594
|
key: I.id,
|
|
555
|
-
class:
|
|
556
|
-
onClick: (
|
|
595
|
+
class: me(["yc-image-selector__category", { "is-active": _.value === I.id }]),
|
|
596
|
+
onClick: (Ee) => et(I.id)
|
|
557
597
|
}, [
|
|
558
|
-
T("span", null,
|
|
559
|
-
I.count != null ? (u(), A("span",
|
|
560
|
-
], 10,
|
|
561
|
-
])) :
|
|
562
|
-
|
|
563
|
-
!
|
|
598
|
+
T("span", null, B(I.name), 1),
|
|
599
|
+
I.count != null ? (u(), A("span", bn, B(I.count), 1)) : b("", !0)
|
|
600
|
+
], 10, En))), 128))
|
|
601
|
+
])) : b("", !0),
|
|
602
|
+
we((u(), A("div", An, [
|
|
603
|
+
!j.value && Ce.value ? Te(a.$slots, "empty", mt(ze({ key: 0 }, Se.value)), () => {
|
|
564
604
|
var I;
|
|
565
605
|
return [
|
|
566
|
-
|
|
606
|
+
l.renderEmpty ? (u(), E(w(t), {
|
|
567
607
|
key: 0,
|
|
568
|
-
render:
|
|
569
|
-
ctx:
|
|
570
|
-
}, null, 8, ["render", "ctx"])) : (u(),
|
|
608
|
+
render: l.renderEmpty,
|
|
609
|
+
ctx: Se.value
|
|
610
|
+
}, null, 8, ["render", "ctx"])) : (u(), E(Yt, {
|
|
571
611
|
key: 1,
|
|
572
|
-
description: ((I =
|
|
612
|
+
description: ((I = p.value) == null ? void 0 : I.message) || e.emptyText
|
|
573
613
|
}, null, 8, ["description"]))
|
|
574
614
|
];
|
|
575
|
-
}, !0) :
|
|
576
|
-
(u(!0), A(
|
|
615
|
+
}, !0) : Ce.value ? b("", !0) : (u(), A("div", Mn, [
|
|
616
|
+
(u(!0), A(ce, null, ye(H.value, (I) => (u(), A("div", {
|
|
577
617
|
key: String(I.id),
|
|
578
|
-
class:
|
|
579
|
-
"is-selected":
|
|
580
|
-
"is-single-mode": !
|
|
581
|
-
"is-multi-mode":
|
|
618
|
+
class: me(["yc-image-selector__item", {
|
|
619
|
+
"is-selected": xe(I),
|
|
620
|
+
"is-single-mode": !M.value,
|
|
621
|
+
"is-multi-mode": M.value
|
|
582
622
|
}]),
|
|
583
|
-
onClick: (
|
|
623
|
+
onClick: (Ee) => tt(I)
|
|
584
624
|
}, [
|
|
585
|
-
T("div",
|
|
625
|
+
T("div", $n, [
|
|
586
626
|
T("img", {
|
|
587
|
-
src:
|
|
627
|
+
src: He(I),
|
|
588
628
|
alt: I.name || "image",
|
|
589
629
|
loading: "lazy",
|
|
590
|
-
class:
|
|
591
|
-
onLoad: (
|
|
592
|
-
}, null, 42,
|
|
630
|
+
class: me(Bt(I)),
|
|
631
|
+
onLoad: (Ee) => Vt(Ee, I)
|
|
632
|
+
}, null, 42, Ln),
|
|
593
633
|
T("div", {
|
|
594
|
-
class:
|
|
595
|
-
"is-checked":
|
|
596
|
-
"is-radio": !
|
|
597
|
-
"is-checkbox":
|
|
634
|
+
class: me(["yc-image-selector__indicator", {
|
|
635
|
+
"is-checked": xe(I),
|
|
636
|
+
"is-radio": !M.value,
|
|
637
|
+
"is-checkbox": M.value
|
|
598
638
|
}])
|
|
599
639
|
}, [
|
|
600
|
-
|
|
640
|
+
xe(I) && M.value ? (u(), A("span", Dn, B(R(I)), 1)) : xe(I) ? (u(), E(x, { key: 1 }, {
|
|
601
641
|
default: g(() => [
|
|
602
|
-
m(w(
|
|
642
|
+
m(w(vt))
|
|
603
643
|
]),
|
|
604
644
|
_: 1
|
|
605
|
-
})) :
|
|
645
|
+
})) : b("", !0)
|
|
606
646
|
], 2)
|
|
607
647
|
]),
|
|
608
648
|
T("div", {
|
|
609
649
|
class: "yc-image-selector__meta",
|
|
610
650
|
title: I.name
|
|
611
|
-
},
|
|
612
|
-
], 10,
|
|
651
|
+
}, B(I.name || "未命名"), 9, Bn)
|
|
652
|
+
], 10, Pn))), 128))
|
|
613
653
|
]))
|
|
614
654
|
])), [
|
|
615
|
-
[
|
|
655
|
+
[Gt, j.value]
|
|
616
656
|
])
|
|
617
657
|
]),
|
|
618
|
-
|
|
619
|
-
T("span",
|
|
620
|
-
T("div",
|
|
621
|
-
(u(!0), A(
|
|
658
|
+
M.value && G.value.length ? (u(), A("div", Vn, [
|
|
659
|
+
T("span", On, "已选 " + B(G.value.length) + " 张", 1),
|
|
660
|
+
T("div", Fn, [
|
|
661
|
+
(u(!0), A(ce, null, ye(G.value, (I) => (u(), A("div", {
|
|
622
662
|
key: String(I.id),
|
|
623
663
|
class: "yc-image-selector__selected-chip",
|
|
624
|
-
onClick:
|
|
664
|
+
onClick: Jt((Ee) => tt(I), ["stop"])
|
|
625
665
|
}, [
|
|
626
666
|
T("img", {
|
|
627
|
-
src:
|
|
667
|
+
src: He(I),
|
|
628
668
|
alt: I.name
|
|
629
|
-
}, null, 8,
|
|
630
|
-
|
|
631
|
-
], 8,
|
|
669
|
+
}, null, 8, Rn),
|
|
670
|
+
i[6] || (i[6] = T("span", { class: "yc-image-selector__selected-chip-remove" }, "×", -1))
|
|
671
|
+
], 8, Un))), 128))
|
|
632
672
|
]),
|
|
633
|
-
m(
|
|
673
|
+
m(_e, {
|
|
634
674
|
link: "",
|
|
635
675
|
type: "primary",
|
|
636
|
-
onClick:
|
|
676
|
+
onClick: Dt
|
|
637
677
|
}, {
|
|
638
|
-
default: g(() => [...
|
|
639
|
-
|
|
678
|
+
default: g(() => [...i[7] || (i[7] = [
|
|
679
|
+
W("清空", -1)
|
|
640
680
|
])]),
|
|
641
681
|
_: 1
|
|
642
682
|
})
|
|
643
|
-
])) :
|
|
644
|
-
|
|
645
|
-
m(
|
|
646
|
-
"current-page":
|
|
647
|
-
"onUpdate:currentPage":
|
|
683
|
+
])) : b("", !0),
|
|
684
|
+
K.value > 0 ? (u(), A("div", Nn, [
|
|
685
|
+
m(zt, {
|
|
686
|
+
"current-page": C.value,
|
|
687
|
+
"onUpdate:currentPage": i[3] || (i[3] = (I) => C.value = I),
|
|
648
688
|
background: "",
|
|
649
689
|
layout: "total, prev, pager, next, jumper",
|
|
650
690
|
"page-size": e.pageSize,
|
|
651
|
-
total:
|
|
652
|
-
onCurrentChange:
|
|
691
|
+
total: K.value,
|
|
692
|
+
onCurrentChange: $e
|
|
653
693
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
654
|
-
])) :
|
|
694
|
+
])) : b("", !0)
|
|
655
695
|
])
|
|
656
696
|
]),
|
|
657
697
|
_: 3
|
|
658
698
|
}, 8, ["modelValue", "title", "width"]);
|
|
659
699
|
};
|
|
660
700
|
}
|
|
661
|
-
}),
|
|
701
|
+
}), Me = (e, n) => {
|
|
662
702
|
const t = e.__vccOpts || e;
|
|
663
|
-
for (const [o,
|
|
664
|
-
t[o] =
|
|
703
|
+
for (const [o, l] of n)
|
|
704
|
+
t[o] = l;
|
|
665
705
|
return t;
|
|
666
|
-
},
|
|
667
|
-
function
|
|
706
|
+
}, Ct = /* @__PURE__ */ Me(Hn, [["__scopeId", "data-v-03096613"]]);
|
|
707
|
+
function St() {
|
|
668
708
|
const { baseURL: e = "" } = Ae();
|
|
669
|
-
return
|
|
709
|
+
return dt.create({ baseURL: e, timeout: 3e4 });
|
|
670
710
|
}
|
|
671
|
-
async function
|
|
711
|
+
async function Jn(e) {
|
|
672
712
|
const n = Ae().fetchImages;
|
|
673
713
|
if (n) return n(e);
|
|
674
|
-
const t =
|
|
714
|
+
const t = St(), { data: o } = await t.get(
|
|
675
715
|
"/yc-media/images",
|
|
676
716
|
{ params: e }
|
|
677
717
|
);
|
|
@@ -679,44 +719,44 @@ async function jn(e) {
|
|
|
679
719
|
throw new Error("加载图片资源失败");
|
|
680
720
|
return o.data;
|
|
681
721
|
}
|
|
682
|
-
async function
|
|
722
|
+
async function Xn(e) {
|
|
683
723
|
const n = Ae().uploadImage;
|
|
684
724
|
if (n) return n(e);
|
|
685
|
-
const t =
|
|
725
|
+
const t = St(), o = new FormData();
|
|
686
726
|
o.append("file", e);
|
|
687
|
-
const { data:
|
|
727
|
+
const { data: l } = await t.post(
|
|
688
728
|
"/yc-media/images/upload",
|
|
689
729
|
o,
|
|
690
730
|
{ headers: { "Content-Type": "multipart/form-data" } }
|
|
691
731
|
);
|
|
692
|
-
if (
|
|
732
|
+
if (l.code !== 200)
|
|
693
733
|
throw new Error("上传图片失败");
|
|
694
|
-
return
|
|
734
|
+
return l.data;
|
|
695
735
|
}
|
|
696
|
-
const
|
|
697
|
-
function
|
|
736
|
+
const ut = "__YC_IMAGE_SELECTOR_MOUNT__";
|
|
737
|
+
function Qn(e) {
|
|
698
738
|
const n = globalThis;
|
|
699
|
-
if (n[
|
|
739
|
+
if (n[ut] || typeof document > "u") return;
|
|
700
740
|
const t = document.createElement("div");
|
|
701
741
|
t.setAttribute("data-yc-image-selector-host", ""), document.body.appendChild(t);
|
|
702
|
-
const o = Ae().dialog ?? {},
|
|
703
|
-
getImages:
|
|
704
|
-
upload:
|
|
742
|
+
const o = Ae().dialog ?? {}, l = m(Ct, {
|
|
743
|
+
getImages: Jn,
|
|
744
|
+
upload: Xn,
|
|
705
745
|
showUpload: o.showUpload ?? !0,
|
|
706
746
|
...o
|
|
707
747
|
});
|
|
708
|
-
|
|
748
|
+
l.appContext = e._context, Xt(l, t), n[ut] = !0;
|
|
709
749
|
}
|
|
710
|
-
function
|
|
711
|
-
e.config.globalProperties.openImageSelector =
|
|
750
|
+
function Zn(e) {
|
|
751
|
+
e.config.globalProperties.openImageSelector = It, e.config.globalProperties.closeImageSelector = Tt;
|
|
712
752
|
}
|
|
713
|
-
function
|
|
714
|
-
|
|
753
|
+
function eo(e) {
|
|
754
|
+
Qn(e), Zn(e);
|
|
715
755
|
}
|
|
716
|
-
const
|
|
756
|
+
const to = { class: "yc-page-window__header" }, no = { class: "yc-page-window__title" }, oo = {
|
|
717
757
|
key: 0,
|
|
718
758
|
class: "yc-page-window__nav"
|
|
719
|
-
},
|
|
759
|
+
}, lo = { class: "yc-page-window__opera" }, ao = { class: "yc-page-window__content" }, io = /* @__PURE__ */ ue({
|
|
720
760
|
__name: "YcPageWindow",
|
|
721
761
|
props: {
|
|
722
762
|
visible: { type: Boolean },
|
|
@@ -736,90 +776,90 @@ const Jn = { class: "yc-page-window__header" }, Xn = { class: "yc-page-window__t
|
|
|
736
776
|
},
|
|
737
777
|
emits: ["update:visible", "update:type", "confirm", "close", "opened", "changeType", "prev", "next", "checkRow"],
|
|
738
778
|
setup(e, { expose: n, emit: t }) {
|
|
739
|
-
const o = e,
|
|
779
|
+
const o = e, l = t, y = k(!1), c = P(() => o.loading || y.value), h = P(() => o.type === "detail" ? "详情" : o.type === "edit" ? "编辑" : o.type === "add" ? "新增" : ""), p = P(
|
|
740
780
|
() => o.list.length > 0 && o.row != null
|
|
741
|
-
), r =
|
|
781
|
+
), r = P(
|
|
742
782
|
() => ["detail", "edit"].includes(o.type)
|
|
743
|
-
),
|
|
744
|
-
function
|
|
783
|
+
), S = P(() => o.type !== "detail");
|
|
784
|
+
function D() {
|
|
745
785
|
if (!o.row) return -1;
|
|
746
|
-
const
|
|
747
|
-
return o.list.findIndex((
|
|
786
|
+
const $ = o.rowKey, M = o.row[$];
|
|
787
|
+
return o.list.findIndex((Y) => Y[$] === M);
|
|
748
788
|
}
|
|
749
|
-
function
|
|
750
|
-
const
|
|
751
|
-
return
|
|
789
|
+
function N($) {
|
|
790
|
+
const M = D();
|
|
791
|
+
return M < 0 ? !0 : $ === "prev" ? M <= 0 : M >= o.list.length - 1;
|
|
752
792
|
}
|
|
753
|
-
function
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
756
|
-
const
|
|
757
|
-
|
|
793
|
+
function q() {
|
|
794
|
+
const $ = D();
|
|
795
|
+
if ($ <= 0) return;
|
|
796
|
+
const M = o.list[$ - 1];
|
|
797
|
+
l("checkRow", M), l("prev", M);
|
|
758
798
|
}
|
|
759
|
-
function
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
762
|
-
const
|
|
763
|
-
|
|
799
|
+
function F() {
|
|
800
|
+
const $ = D();
|
|
801
|
+
if ($ < 0 || $ >= o.list.length - 1) return;
|
|
802
|
+
const M = o.list[$ + 1];
|
|
803
|
+
l("checkRow", M), l("next", M);
|
|
764
804
|
}
|
|
765
|
-
function
|
|
766
|
-
const
|
|
767
|
-
|
|
805
|
+
function v() {
|
|
806
|
+
const $ = o.type === "detail" ? "edit" : "detail";
|
|
807
|
+
l("update:type", $), l("changeType");
|
|
768
808
|
}
|
|
769
809
|
function L() {
|
|
770
|
-
|
|
810
|
+
l("update:visible", !1), l("close");
|
|
771
811
|
}
|
|
772
|
-
function
|
|
773
|
-
|
|
774
|
-
|
|
812
|
+
function z() {
|
|
813
|
+
y.value = !0, l("confirm", ($) => {
|
|
814
|
+
y.value = !1, $ && L();
|
|
775
815
|
});
|
|
776
816
|
}
|
|
777
817
|
return ne(
|
|
778
818
|
() => o.visible,
|
|
779
|
-
(
|
|
780
|
-
|
|
819
|
+
($) => {
|
|
820
|
+
$ && l("opened");
|
|
781
821
|
}
|
|
782
|
-
),
|
|
822
|
+
), Qt(() => {
|
|
783
823
|
o.visible && L();
|
|
784
|
-
}), n({ closeWindow: L }), (
|
|
785
|
-
const
|
|
786
|
-
return u(),
|
|
824
|
+
}), n({ closeWindow: L }), ($, M) => {
|
|
825
|
+
const Y = V("el-icon"), _ = V("el-button"), C = V("el-tooltip"), K = V("el-scrollbar"), j = pt("loading");
|
|
826
|
+
return u(), E(gt, {
|
|
787
827
|
name: "yc-page-window-fade",
|
|
788
828
|
mode: "out-in"
|
|
789
829
|
}, {
|
|
790
830
|
default: g(() => [
|
|
791
|
-
|
|
831
|
+
we(T("div", {
|
|
792
832
|
class: "yc-page-window",
|
|
793
|
-
style:
|
|
833
|
+
style: at({ zIndex: e.zIndex })
|
|
794
834
|
}, [
|
|
795
|
-
T("div",
|
|
796
|
-
T("div",
|
|
797
|
-
m(
|
|
835
|
+
T("div", to, [
|
|
836
|
+
T("div", no, [
|
|
837
|
+
m(Y, {
|
|
798
838
|
class: "yc-page-window__back",
|
|
799
839
|
onClick: L
|
|
800
840
|
}, {
|
|
801
841
|
default: g(() => [
|
|
802
|
-
m(w(
|
|
842
|
+
m(w(on))
|
|
803
843
|
]),
|
|
804
844
|
_: 1
|
|
805
845
|
}),
|
|
806
|
-
T("span", null,
|
|
807
|
-
|
|
808
|
-
m(
|
|
846
|
+
T("span", null, B(e.title) + B(h.value), 1),
|
|
847
|
+
p.value ? (u(), A("div", oo, [
|
|
848
|
+
m(C, {
|
|
809
849
|
content: "上一条",
|
|
810
850
|
placement: "top"
|
|
811
851
|
}, {
|
|
812
852
|
default: g(() => [
|
|
813
|
-
m(
|
|
853
|
+
m(_, {
|
|
814
854
|
round: "",
|
|
815
855
|
text: "",
|
|
816
|
-
disabled:
|
|
817
|
-
onClick:
|
|
856
|
+
disabled: N("prev"),
|
|
857
|
+
onClick: q
|
|
818
858
|
}, {
|
|
819
859
|
default: g(() => [
|
|
820
|
-
m(
|
|
860
|
+
m(Y, null, {
|
|
821
861
|
default: g(() => [
|
|
822
|
-
m(w(
|
|
862
|
+
m(w(ln))
|
|
823
863
|
]),
|
|
824
864
|
_: 1
|
|
825
865
|
})
|
|
@@ -829,21 +869,21 @@ const Jn = { class: "yc-page-window__header" }, Xn = { class: "yc-page-window__t
|
|
|
829
869
|
]),
|
|
830
870
|
_: 1
|
|
831
871
|
}),
|
|
832
|
-
m(
|
|
872
|
+
m(C, {
|
|
833
873
|
content: "下一条",
|
|
834
874
|
placement: "top"
|
|
835
875
|
}, {
|
|
836
876
|
default: g(() => [
|
|
837
|
-
m(
|
|
877
|
+
m(_, {
|
|
838
878
|
round: "",
|
|
839
879
|
text: "",
|
|
840
|
-
disabled:
|
|
841
|
-
onClick:
|
|
880
|
+
disabled: N("next"),
|
|
881
|
+
onClick: F
|
|
842
882
|
}, {
|
|
843
883
|
default: g(() => [
|
|
844
|
-
m(
|
|
884
|
+
m(Y, null, {
|
|
845
885
|
default: g(() => [
|
|
846
|
-
m(w(
|
|
886
|
+
m(w(an))
|
|
847
887
|
]),
|
|
848
888
|
_: 1
|
|
849
889
|
})
|
|
@@ -853,146 +893,146 @@ const Jn = { class: "yc-page-window__header" }, Xn = { class: "yc-page-window__t
|
|
|
853
893
|
]),
|
|
854
894
|
_: 1
|
|
855
895
|
})
|
|
856
|
-
])) :
|
|
857
|
-
r.value ? (u(),
|
|
896
|
+
])) : b("", !0),
|
|
897
|
+
r.value ? (u(), E(_, {
|
|
858
898
|
key: 1,
|
|
859
899
|
text: "",
|
|
860
900
|
class: "yc-page-window__type-switch",
|
|
861
901
|
type: e.type === "detail" ? "primary" : "success",
|
|
862
|
-
onClick:
|
|
902
|
+
onClick: v
|
|
863
903
|
}, {
|
|
864
904
|
default: g(() => [
|
|
865
|
-
m(
|
|
905
|
+
m(Y, { class: "m-r-4" }, {
|
|
866
906
|
default: g(() => [
|
|
867
|
-
m(w(
|
|
907
|
+
m(w(sn))
|
|
868
908
|
]),
|
|
869
909
|
_: 1
|
|
870
910
|
}),
|
|
871
|
-
|
|
911
|
+
W(" " + B(e.type === "detail" ? "切换编辑" : "切换详情"), 1)
|
|
872
912
|
]),
|
|
873
913
|
_: 1
|
|
874
|
-
}, 8, ["type"])) :
|
|
914
|
+
}, 8, ["type"])) : b("", !0)
|
|
875
915
|
]),
|
|
876
|
-
T("div",
|
|
877
|
-
|
|
878
|
-
e.showButtons &&
|
|
879
|
-
m(
|
|
916
|
+
T("div", lo, [
|
|
917
|
+
Te($.$slots, "opera", {}, void 0, !0),
|
|
918
|
+
e.showButtons && S.value ? (u(), A(ce, { key: 0 }, [
|
|
919
|
+
m(_, {
|
|
880
920
|
text: "",
|
|
881
|
-
disabled:
|
|
921
|
+
disabled: c.value,
|
|
882
922
|
onClick: L
|
|
883
923
|
}, {
|
|
884
924
|
default: g(() => [
|
|
885
|
-
m(
|
|
925
|
+
m(Y, { class: "m-r-4" }, {
|
|
886
926
|
default: g(() => [
|
|
887
|
-
m(w(
|
|
927
|
+
m(w(_t))
|
|
888
928
|
]),
|
|
889
929
|
_: 1
|
|
890
930
|
}),
|
|
891
|
-
|
|
931
|
+
W(" " + B(e.cancelText), 1)
|
|
892
932
|
]),
|
|
893
933
|
_: 1
|
|
894
934
|
}, 8, ["disabled"]),
|
|
895
|
-
e.showConfirm ? (u(),
|
|
935
|
+
e.showConfirm ? (u(), E(_, {
|
|
896
936
|
key: 0,
|
|
897
937
|
type: "primary",
|
|
898
|
-
loading:
|
|
938
|
+
loading: c.value,
|
|
899
939
|
disabled: e.disabled,
|
|
900
|
-
onClick:
|
|
940
|
+
onClick: z
|
|
901
941
|
}, {
|
|
902
942
|
default: g(() => [
|
|
903
|
-
m(
|
|
943
|
+
m(Y, { class: "m-r-4" }, {
|
|
904
944
|
default: g(() => [
|
|
905
|
-
m(w(
|
|
945
|
+
m(w(vt))
|
|
906
946
|
]),
|
|
907
947
|
_: 1
|
|
908
948
|
}),
|
|
909
|
-
|
|
949
|
+
W(" " + B(e.confirmText), 1)
|
|
910
950
|
]),
|
|
911
951
|
_: 1
|
|
912
|
-
}, 8, ["loading", "disabled"])) :
|
|
913
|
-
], 64)) :
|
|
952
|
+
}, 8, ["loading", "disabled"])) : b("", !0)
|
|
953
|
+
], 64)) : b("", !0)
|
|
914
954
|
])
|
|
915
955
|
]),
|
|
916
|
-
|
|
917
|
-
m(
|
|
956
|
+
we((u(), A("div", ao, [
|
|
957
|
+
m(K, { class: "yc-page-window__scroll" }, {
|
|
918
958
|
default: g(() => [
|
|
919
959
|
e.visible ? (u(), A("div", {
|
|
920
960
|
key: 0,
|
|
921
961
|
class: "yc-page-window__body",
|
|
922
|
-
style:
|
|
962
|
+
style: at({ minHeight: e.contentMinHeight })
|
|
923
963
|
}, [
|
|
924
|
-
|
|
925
|
-
], 4)) :
|
|
964
|
+
Te($.$slots, "default", {}, void 0, !0)
|
|
965
|
+
], 4)) : b("", !0)
|
|
926
966
|
]),
|
|
927
967
|
_: 3
|
|
928
968
|
})
|
|
929
969
|
])), [
|
|
930
|
-
[j,
|
|
970
|
+
[j, c.value]
|
|
931
971
|
])
|
|
932
972
|
], 4), [
|
|
933
|
-
[
|
|
973
|
+
[Be, e.visible]
|
|
934
974
|
])
|
|
935
975
|
]),
|
|
936
976
|
_: 3
|
|
937
977
|
});
|
|
938
978
|
};
|
|
939
979
|
}
|
|
940
|
-
}),
|
|
941
|
-
function
|
|
942
|
-
e != null && e.aiTask && (
|
|
980
|
+
}), ct = /* @__PURE__ */ Me(io, [["__scopeId", "data-v-b3e784c3"]]);
|
|
981
|
+
function so(e) {
|
|
982
|
+
e != null && e.aiTask && (mn(e.aiTask), vn()), e != null && e.imageSelector && hn(e.imageSelector);
|
|
943
983
|
}
|
|
944
|
-
function
|
|
945
|
-
(n == null ? void 0 : n.registerPageWindow) !== !1 && (e.component("YcPageWindow",
|
|
984
|
+
function ro(e, n) {
|
|
985
|
+
(n == null ? void 0 : n.registerPageWindow) !== !1 && (e.component("YcPageWindow", ct), e.component("SkyPageWindow", ct));
|
|
946
986
|
}
|
|
947
|
-
function
|
|
948
|
-
(n == null ? void 0 : n.registerImageSelector) !== !1 &&
|
|
987
|
+
function uo(e, n) {
|
|
988
|
+
(n == null ? void 0 : n.registerImageSelector) !== !1 && eo(e);
|
|
949
989
|
}
|
|
950
|
-
const
|
|
990
|
+
const ul = {
|
|
951
991
|
install(e, n) {
|
|
952
|
-
|
|
992
|
+
so(n), ro(e, n), uo(e, n);
|
|
953
993
|
}
|
|
954
|
-
},
|
|
955
|
-
function
|
|
994
|
+
}, De = "__YC_COMPONENT_AI_DIALOG__", Ue = "yc-component:ai-dialog-open";
|
|
995
|
+
function co() {
|
|
956
996
|
const e = globalThis;
|
|
957
|
-
return e[
|
|
997
|
+
return e[De] || (e[De] = ft({
|
|
958
998
|
visible: !1,
|
|
959
999
|
options: {}
|
|
960
|
-
})), e[
|
|
1000
|
+
})), e[De];
|
|
961
1001
|
}
|
|
962
|
-
const ae =
|
|
963
|
-
function
|
|
1002
|
+
const ae = co();
|
|
1003
|
+
function We(e = {}) {
|
|
964
1004
|
ae.options = { ...e }, ae.visible = !0, globalThis.dispatchEvent(
|
|
965
1005
|
new CustomEvent(Ue, { detail: { ...e } })
|
|
966
1006
|
);
|
|
967
1007
|
}
|
|
968
|
-
function
|
|
1008
|
+
function xt() {
|
|
969
1009
|
ae.visible = !1;
|
|
970
1010
|
}
|
|
971
|
-
function
|
|
972
|
-
|
|
1011
|
+
function cl(e = {}) {
|
|
1012
|
+
We(e);
|
|
973
1013
|
}
|
|
974
|
-
function
|
|
1014
|
+
function kt(e) {
|
|
975
1015
|
const {
|
|
976
1016
|
tasks: n,
|
|
977
1017
|
panelVisible: t,
|
|
978
1018
|
panelMinimized: o,
|
|
979
|
-
dialogVisible:
|
|
980
|
-
runningCount:
|
|
981
|
-
activeCount:
|
|
982
|
-
panelTitle:
|
|
983
|
-
panelSubtitle:
|
|
984
|
-
} =
|
|
1019
|
+
dialogVisible: l,
|
|
1020
|
+
runningCount: y,
|
|
1021
|
+
activeCount: c,
|
|
1022
|
+
panelTitle: h,
|
|
1023
|
+
panelSubtitle: p
|
|
1024
|
+
} = fn(e);
|
|
985
1025
|
return {
|
|
986
1026
|
tasks: n,
|
|
987
1027
|
panelVisible: t,
|
|
988
1028
|
panelMinimized: o,
|
|
989
|
-
dialogVisible:
|
|
990
|
-
runningCount:
|
|
991
|
-
activeCount:
|
|
992
|
-
panelTitle:
|
|
993
|
-
panelSubtitle:
|
|
1029
|
+
dialogVisible: l,
|
|
1030
|
+
runningCount: y,
|
|
1031
|
+
activeCount: c,
|
|
1032
|
+
panelTitle: h,
|
|
1033
|
+
panelSubtitle: p,
|
|
994
1034
|
openUseDialog: (r) => {
|
|
995
|
-
|
|
1035
|
+
We(r ?? {}), e.openDialog(r ?? {});
|
|
996
1036
|
},
|
|
997
1037
|
closeUseDialog: () => e.closeDialog(),
|
|
998
1038
|
openTaskPanel: () => e.showPanel(),
|
|
@@ -1008,19 +1048,19 @@ function St(e) {
|
|
|
1008
1048
|
onTaskFinish: (r) => e.onTaskFinish(r)
|
|
1009
1049
|
};
|
|
1010
1050
|
}
|
|
1011
|
-
const
|
|
1012
|
-
function
|
|
1051
|
+
const fo = "__YC_AI_TASK_CTX_KEY__", po = "__YC_AI_TASK_STORE_KEY__";
|
|
1052
|
+
function Et(e) {
|
|
1013
1053
|
const n = globalThis;
|
|
1014
1054
|
return n[e] || (n[e] = Symbol(e)), n[e];
|
|
1015
1055
|
}
|
|
1016
|
-
const
|
|
1056
|
+
const bt = Et(fo), At = Et(po), mo = async (e) => (await ge().post(
|
|
1017
1057
|
"/yc-ai/workflows/runs",
|
|
1018
1058
|
e
|
|
1019
|
-
)).data,
|
|
1020
|
-
async function
|
|
1021
|
-
return
|
|
1059
|
+
)).data, Mt = async (e) => (await ge().get(`/yc-ai/workflows/runs/${e}`)).data, go = (e) => ge().post(`/yc-ai/workflows/runs/${e}/cancel`), vo = (e, n) => ge().post(`/yc-ai/workflows/runs/${e}/client-continue`, n);
|
|
1060
|
+
async function Re(e, n) {
|
|
1061
|
+
return _n(e, n);
|
|
1022
1062
|
}
|
|
1023
|
-
function
|
|
1063
|
+
function _o(e, n) {
|
|
1024
1064
|
const t = e.trim();
|
|
1025
1065
|
if (!t)
|
|
1026
1066
|
return n;
|
|
@@ -1034,79 +1074,79 @@ function fo(e, n) {
|
|
|
1034
1074
|
throw new Error('请定义 function handler(result) { ... }');
|
|
1035
1075
|
`
|
|
1036
1076
|
) : o = new Function("result", `return (${t})(result);`);
|
|
1037
|
-
} catch (
|
|
1038
|
-
throw new Error(`自定义脚本语法错误: ${
|
|
1077
|
+
} catch (l) {
|
|
1078
|
+
throw new Error(`自定义脚本语法错误: ${l instanceof Error ? l.message : String(l)}`);
|
|
1039
1079
|
}
|
|
1040
1080
|
try {
|
|
1041
1081
|
return o(n);
|
|
1042
|
-
} catch (
|
|
1043
|
-
throw new Error(`自定义脚本执行失败: ${
|
|
1082
|
+
} catch (l) {
|
|
1083
|
+
throw new Error(`自定义脚本执行失败: ${l instanceof Error ? l.message : String(l)}`);
|
|
1044
1084
|
}
|
|
1045
1085
|
}
|
|
1046
|
-
async function
|
|
1047
|
-
return (await
|
|
1048
|
-
projectId:
|
|
1086
|
+
async function ho(e) {
|
|
1087
|
+
return (await mo({
|
|
1088
|
+
projectId: gn(),
|
|
1049
1089
|
freeText: e.freeText,
|
|
1050
1090
|
promptId: e.promptId,
|
|
1051
1091
|
autoMatch: e.autoMatch
|
|
1052
1092
|
})).runId;
|
|
1053
1093
|
}
|
|
1054
|
-
async function
|
|
1055
|
-
var o,
|
|
1056
|
-
const t = await
|
|
1094
|
+
async function yo(e, n) {
|
|
1095
|
+
var o, l, y, c;
|
|
1096
|
+
const t = await Mt(e);
|
|
1057
1097
|
if (t.status === "WAITING_CLIENT" && t.waitingStepKey && t.waitingClientScript) {
|
|
1058
1098
|
(o = n == null ? void 0 : n.onProgress) == null || o.call(n, 60, `执行脚本:${t.waitingStepKey}`);
|
|
1059
|
-
let
|
|
1060
|
-
t.waitingArtifactId && (
|
|
1061
|
-
const
|
|
1062
|
-
return await
|
|
1099
|
+
let h = {};
|
|
1100
|
+
t.waitingArtifactId && (h = await Re(e, t.waitingArtifactId));
|
|
1101
|
+
const p = _o(t.waitingClientScript, h);
|
|
1102
|
+
return await vo(e, {
|
|
1063
1103
|
stepKey: t.waitingStepKey,
|
|
1064
|
-
output:
|
|
1104
|
+
output: p ?? {}
|
|
1065
1105
|
}), null;
|
|
1066
1106
|
}
|
|
1067
1107
|
if (t.status === "SUCCEEDED") {
|
|
1068
1108
|
if (t.finalArtifactId) {
|
|
1069
|
-
(
|
|
1070
|
-
const
|
|
1071
|
-
return (
|
|
1109
|
+
(l = n == null ? void 0 : n.onProgress) == null || l.call(n, 95, "加载结果…");
|
|
1110
|
+
const h = await Re(e, t.finalArtifactId);
|
|
1111
|
+
return (y = n == null ? void 0 : n.onProgress) == null || y.call(n, 100, "已完成"), { phase: "SUCCEEDED", runId: e, result: h };
|
|
1072
1112
|
}
|
|
1073
1113
|
return { phase: "SUCCEEDED", runId: e, result: {} };
|
|
1074
1114
|
}
|
|
1075
|
-
return t.status === "FAILED" ? { phase: "FAILED", runId: e, errorMessage: t.errorMessage || "工作流失败" } : t.status === "CANCELLED" ? { phase: "FAILED", runId: e, errorMessage: "已取消" } : ((
|
|
1115
|
+
return t.status === "FAILED" ? { phase: "FAILED", runId: e, errorMessage: t.errorMessage || "工作流失败" } : t.status === "CANCELLED" ? { phase: "FAILED", runId: e, errorMessage: "已取消" } : ((c = n == null ? void 0 : n.onProgress) == null || c.call(n, Io(t), Co(t)), null);
|
|
1076
1116
|
}
|
|
1077
|
-
async function
|
|
1078
|
-
const n = await
|
|
1079
|
-
return n.status !== "SUCCEEDED" || !n.finalArtifactId ? null : await
|
|
1117
|
+
async function wo(e) {
|
|
1118
|
+
const n = await Mt(e);
|
|
1119
|
+
return n.status !== "SUCCEEDED" || !n.finalArtifactId ? null : await Re(e, n.finalArtifactId);
|
|
1080
1120
|
}
|
|
1081
|
-
async function
|
|
1082
|
-
await
|
|
1121
|
+
async function To(e) {
|
|
1122
|
+
await go(e);
|
|
1083
1123
|
}
|
|
1084
|
-
function
|
|
1124
|
+
function Io(e) {
|
|
1085
1125
|
if (e.status === "PENDING") return 8;
|
|
1086
1126
|
const n = e.steps ?? [];
|
|
1087
1127
|
if (!n.length) return 35;
|
|
1088
1128
|
const t = n.filter((o) => o.status === "SUCCEEDED" || o.status === "SKIPPED").length;
|
|
1089
1129
|
return Math.min(90, Math.round(20 + t / n.length * 70));
|
|
1090
1130
|
}
|
|
1091
|
-
function
|
|
1131
|
+
function Co(e) {
|
|
1092
1132
|
var t;
|
|
1093
1133
|
if (e.status === "PENDING") return "排队中…";
|
|
1094
1134
|
const n = (t = e.steps) == null ? void 0 : t.find((o) => o.status === "RUNNING");
|
|
1095
1135
|
return n ? `执行中:${n.stepKey}` : "后端处理中…";
|
|
1096
1136
|
}
|
|
1097
|
-
const
|
|
1098
|
-
function
|
|
1137
|
+
const Pt = 80;
|
|
1138
|
+
function So() {
|
|
1099
1139
|
try {
|
|
1100
|
-
const e = localStorage.getItem(
|
|
1140
|
+
const e = localStorage.getItem(yt());
|
|
1101
1141
|
if (!e) return [];
|
|
1102
1142
|
const n = JSON.parse(e);
|
|
1103
|
-
return Array.isArray(n) ? n.filter((t) => t && t.id && t.createdAt).sort((t, o) => o.createdAt - t.createdAt).slice(0,
|
|
1143
|
+
return Array.isArray(n) ? n.filter((t) => t && t.id && t.createdAt).sort((t, o) => o.createdAt - t.createdAt).slice(0, Pt) : [];
|
|
1104
1144
|
} catch {
|
|
1105
1145
|
return [];
|
|
1106
1146
|
}
|
|
1107
1147
|
}
|
|
1108
|
-
function
|
|
1109
|
-
const n = e.slice(0,
|
|
1148
|
+
function xo(e) {
|
|
1149
|
+
const n = e.slice(0, Pt).map((t) => ({
|
|
1110
1150
|
id: t.id,
|
|
1111
1151
|
title: t.title,
|
|
1112
1152
|
freeText: t.freeText,
|
|
@@ -1120,250 +1160,250 @@ function wo(e) {
|
|
|
1120
1160
|
createdAt: t.createdAt,
|
|
1121
1161
|
finishedAt: t.finishedAt
|
|
1122
1162
|
}));
|
|
1123
|
-
localStorage.setItem(
|
|
1163
|
+
localStorage.setItem(yt(), JSON.stringify(n));
|
|
1124
1164
|
}
|
|
1125
|
-
function
|
|
1165
|
+
function ko(e) {
|
|
1126
1166
|
return {
|
|
1127
1167
|
...e,
|
|
1128
1168
|
logs: e.runId ? [`ℹ 已从本地恢复,runId=${e.runId}`] : [],
|
|
1129
1169
|
result: void 0
|
|
1130
1170
|
};
|
|
1131
1171
|
}
|
|
1132
|
-
function
|
|
1172
|
+
function re(e) {
|
|
1133
1173
|
return e === "pending" || e === "running";
|
|
1134
1174
|
}
|
|
1135
|
-
let
|
|
1136
|
-
const
|
|
1137
|
-
function
|
|
1138
|
-
return
|
|
1175
|
+
let Ne = 0, he = null;
|
|
1176
|
+
const Eo = 5e3;
|
|
1177
|
+
function bo() {
|
|
1178
|
+
return Ne += 1, `ai_task_${Date.now()}_${Ne}`;
|
|
1139
1179
|
}
|
|
1140
|
-
function
|
|
1180
|
+
function Ao(e, n = 28) {
|
|
1141
1181
|
const t = e.trim();
|
|
1142
1182
|
return t.length <= n ? t : `${t.slice(0, n)}…`;
|
|
1143
1183
|
}
|
|
1144
|
-
const
|
|
1145
|
-
const e =
|
|
1146
|
-
function r(
|
|
1184
|
+
const $t = pn("ycAiTask", () => {
|
|
1185
|
+
const e = k([]), n = k(!1), t = k(!1), o = k(!1), l = k({}), y = k(!1), c = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Set();
|
|
1186
|
+
function r(s, f) {
|
|
1147
1187
|
return {
|
|
1148
|
-
taskId:
|
|
1149
|
-
runId:
|
|
1150
|
-
title:
|
|
1151
|
-
freeText:
|
|
1152
|
-
promptId:
|
|
1153
|
-
result:
|
|
1154
|
-
finishedAt:
|
|
1188
|
+
taskId: s.id,
|
|
1189
|
+
runId: s.runId,
|
|
1190
|
+
title: s.title,
|
|
1191
|
+
freeText: s.freeText,
|
|
1192
|
+
promptId: s.promptId,
|
|
1193
|
+
result: f,
|
|
1194
|
+
finishedAt: s.finishedAt ?? Date.now()
|
|
1155
1195
|
};
|
|
1156
1196
|
}
|
|
1157
|
-
function
|
|
1158
|
-
var
|
|
1159
|
-
const
|
|
1160
|
-
if (!(
|
|
1161
|
-
const
|
|
1162
|
-
(
|
|
1197
|
+
function S(s, f) {
|
|
1198
|
+
var fe;
|
|
1199
|
+
const d = e.value.find((pe) => pe.id === s);
|
|
1200
|
+
if (!(d != null && d.runId)) return;
|
|
1201
|
+
const R = r(d, f);
|
|
1202
|
+
(fe = h.get(s)) == null || fe(R), h.delete(s), p.forEach((pe) => pe(R));
|
|
1163
1203
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return
|
|
1204
|
+
function D(s) {
|
|
1205
|
+
return p.add(s), () => p.delete(s);
|
|
1166
1206
|
}
|
|
1167
|
-
const
|
|
1168
|
-
() => e.value.filter((
|
|
1169
|
-
),
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1207
|
+
const N = P(
|
|
1208
|
+
() => e.value.filter((s) => re(s.status)).length
|
|
1209
|
+
), q = P(() => e.value.filter((s) => s.status === "running").length), F = P(() => N.value > 0 ? "AI 处理中" : e.value.some((s) => s.status === "failed") ? "部分任务失败" : "AI 任务"), v = P(() => {
|
|
1210
|
+
const s = e.value.length, f = N.value;
|
|
1211
|
+
return s === 0 ? "暂无任务" : f > 0 ? `${f}/${s} 项任务进行中` : `${s} 项任务已完成`;
|
|
1172
1212
|
});
|
|
1173
1213
|
function L() {
|
|
1174
|
-
|
|
1214
|
+
xo(e.value);
|
|
1175
1215
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1216
|
+
function z(s, f) {
|
|
1217
|
+
const d = e.value.findIndex((R) => R.id === s);
|
|
1218
|
+
d >= 0 && (e.value[d] = { ...e.value[d], ...f }, L());
|
|
1179
1219
|
}
|
|
1180
|
-
function
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1220
|
+
function $(s, f) {
|
|
1221
|
+
const d = e.value.find((R) => R.id === s);
|
|
1222
|
+
d && (d.logs.unshift(f), d.logs.length > 20 && d.logs.pop());
|
|
1183
1223
|
}
|
|
1184
|
-
function
|
|
1224
|
+
function M() {
|
|
1185
1225
|
n.value = !0, t.value = !1;
|
|
1186
1226
|
}
|
|
1187
|
-
function
|
|
1227
|
+
function Y() {
|
|
1188
1228
|
n.value = !1;
|
|
1189
1229
|
}
|
|
1190
|
-
function
|
|
1230
|
+
function _() {
|
|
1191
1231
|
t.value = !t.value;
|
|
1192
1232
|
}
|
|
1193
|
-
function
|
|
1194
|
-
|
|
1233
|
+
function C(s = {}) {
|
|
1234
|
+
l.value = { ...s }, o.value = !0, We(s);
|
|
1195
1235
|
}
|
|
1196
|
-
function
|
|
1197
|
-
o.value = !1,
|
|
1236
|
+
function K() {
|
|
1237
|
+
o.value = !1, xt();
|
|
1198
1238
|
}
|
|
1199
1239
|
function j() {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1240
|
+
he || (he = setInterval(() => {
|
|
1241
|
+
H();
|
|
1242
|
+
}, Eo));
|
|
1203
1243
|
}
|
|
1204
|
-
function
|
|
1205
|
-
|
|
1244
|
+
function X() {
|
|
1245
|
+
N.value > 0 || he && (clearInterval(he), he = null);
|
|
1206
1246
|
}
|
|
1207
|
-
async function
|
|
1208
|
-
const
|
|
1209
|
-
if (!
|
|
1210
|
-
|
|
1247
|
+
async function H() {
|
|
1248
|
+
const s = e.value.filter((f) => f.runId && re(f.status));
|
|
1249
|
+
if (!s.length) {
|
|
1250
|
+
X();
|
|
1211
1251
|
return;
|
|
1212
1252
|
}
|
|
1213
|
-
await Promise.all(
|
|
1253
|
+
await Promise.all(s.map((f) => Q(f.id)));
|
|
1214
1254
|
}
|
|
1215
|
-
async function
|
|
1216
|
-
if (
|
|
1217
|
-
const
|
|
1218
|
-
if (!(!(
|
|
1219
|
-
|
|
1255
|
+
async function Q(s) {
|
|
1256
|
+
if (c.has(s)) return;
|
|
1257
|
+
const f = e.value.find((d) => d.id === s);
|
|
1258
|
+
if (!(!(f != null && f.runId) || !re(f.status))) {
|
|
1259
|
+
c.add(s);
|
|
1220
1260
|
try {
|
|
1221
|
-
const
|
|
1222
|
-
onProgress: (
|
|
1261
|
+
const d = await yo(f.runId, {
|
|
1262
|
+
onProgress: (R, fe) => z(s, { progress: R, summary: fe, status: "running" })
|
|
1223
1263
|
});
|
|
1224
|
-
if (!
|
|
1225
|
-
if (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1264
|
+
if (!d) return;
|
|
1265
|
+
if (d.phase === "SUCCEEDED") {
|
|
1266
|
+
const R = d.result ?? {};
|
|
1267
|
+
z(s, {
|
|
1228
1268
|
status: "succeeded",
|
|
1229
1269
|
progress: 100,
|
|
1230
1270
|
summary: "已完成",
|
|
1231
|
-
result:
|
|
1232
|
-
runId:
|
|
1271
|
+
result: R,
|
|
1272
|
+
runId: d.runId,
|
|
1233
1273
|
finishedAt: Date.now()
|
|
1234
|
-
}),
|
|
1274
|
+
}), S(s, R);
|
|
1235
1275
|
} else
|
|
1236
|
-
|
|
1237
|
-
status:
|
|
1276
|
+
z(s, {
|
|
1277
|
+
status: d.errorMessage === "已取消" ? "cancelled" : "failed",
|
|
1238
1278
|
progress: 100,
|
|
1239
|
-
summary:
|
|
1240
|
-
errorMessage:
|
|
1241
|
-
runId:
|
|
1279
|
+
summary: d.errorMessage || "失败",
|
|
1280
|
+
errorMessage: d.errorMessage,
|
|
1281
|
+
runId: d.runId,
|
|
1242
1282
|
finishedAt: Date.now()
|
|
1243
1283
|
});
|
|
1244
|
-
|
|
1245
|
-
} catch (
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1284
|
+
X();
|
|
1285
|
+
} catch (d) {
|
|
1286
|
+
const R = d instanceof Error ? d.message : "同步失败";
|
|
1287
|
+
$(s, `✗ ${R}`);
|
|
1248
1288
|
} finally {
|
|
1249
|
-
|
|
1289
|
+
c.delete(s);
|
|
1250
1290
|
}
|
|
1251
1291
|
}
|
|
1252
1292
|
}
|
|
1253
|
-
async function
|
|
1254
|
-
if (
|
|
1255
|
-
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1260
|
-
for (const
|
|
1261
|
-
|
|
1293
|
+
async function O() {
|
|
1294
|
+
if (y.value) return;
|
|
1295
|
+
y.value = !0;
|
|
1296
|
+
const s = So();
|
|
1297
|
+
s.length && (e.value = s.map(ko), Ne = s.length);
|
|
1298
|
+
const f = e.value.filter((d) => d.runId && re(d.status));
|
|
1299
|
+
f.length && (await Promise.all(f.map((d) => Q(d.id))), j());
|
|
1300
|
+
for (const d of e.value)
|
|
1301
|
+
d.status === "pending" && !d.runId && z(d.id, { status: "failed", summary: "页面刷新前未提交成功", finishedAt: Date.now() });
|
|
1262
1302
|
}
|
|
1263
|
-
function
|
|
1264
|
-
const
|
|
1265
|
-
id:
|
|
1266
|
-
title:
|
|
1267
|
-
freeText:
|
|
1268
|
-
promptId:
|
|
1269
|
-
autoMatch:
|
|
1303
|
+
function Z(s) {
|
|
1304
|
+
const f = bo(), d = {
|
|
1305
|
+
id: f,
|
|
1306
|
+
title: s.title ?? Ao(s.freeText),
|
|
1307
|
+
freeText: s.freeText.trim(),
|
|
1308
|
+
promptId: s.promptId,
|
|
1309
|
+
autoMatch: s.autoMatch,
|
|
1270
1310
|
status: "pending",
|
|
1271
1311
|
progress: 0,
|
|
1272
1312
|
summary: "正在提交…",
|
|
1273
1313
|
createdAt: Date.now(),
|
|
1274
1314
|
logs: []
|
|
1275
1315
|
};
|
|
1276
|
-
return e.value.unshift(
|
|
1316
|
+
return e.value.unshift(d), L(), s.onFinish && h.set(f, s.onFinish), s.showPanel !== !1 && M(), se(f), f;
|
|
1277
1317
|
}
|
|
1278
|
-
async function
|
|
1279
|
-
const
|
|
1280
|
-
if (
|
|
1318
|
+
async function se(s) {
|
|
1319
|
+
const f = e.value.find((d) => d.id === s);
|
|
1320
|
+
if (f)
|
|
1281
1321
|
try {
|
|
1282
|
-
const
|
|
1283
|
-
freeText:
|
|
1284
|
-
promptId:
|
|
1285
|
-
autoMatch:
|
|
1322
|
+
const d = await ho({
|
|
1323
|
+
freeText: f.freeText,
|
|
1324
|
+
promptId: f.promptId,
|
|
1325
|
+
autoMatch: f.autoMatch
|
|
1286
1326
|
});
|
|
1287
|
-
|
|
1288
|
-
runId:
|
|
1327
|
+
z(s, {
|
|
1328
|
+
runId: d,
|
|
1289
1329
|
status: "running",
|
|
1290
1330
|
progress: 10,
|
|
1291
1331
|
summary: "后端异步处理中…"
|
|
1292
|
-
}),
|
|
1293
|
-
} catch (
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1332
|
+
}), $(s, `▶ 已提交 runId=${d}`), j(), Q(s);
|
|
1333
|
+
} catch (d) {
|
|
1334
|
+
const R = d instanceof Error ? d.message : "提交失败";
|
|
1335
|
+
z(s, {
|
|
1296
1336
|
status: "failed",
|
|
1297
1337
|
progress: 100,
|
|
1298
|
-
summary:
|
|
1299
|
-
errorMessage:
|
|
1338
|
+
summary: R,
|
|
1339
|
+
errorMessage: R,
|
|
1300
1340
|
finishedAt: Date.now()
|
|
1301
1341
|
});
|
|
1302
1342
|
}
|
|
1303
1343
|
}
|
|
1304
|
-
async function
|
|
1305
|
-
const
|
|
1306
|
-
if (!(
|
|
1307
|
-
if (
|
|
1308
|
-
const
|
|
1309
|
-
return
|
|
1344
|
+
async function U(s) {
|
|
1345
|
+
const f = e.value.find((R) => R.id === s);
|
|
1346
|
+
if (!(f != null && f.runId)) return null;
|
|
1347
|
+
if (f.result) return f.result;
|
|
1348
|
+
const d = await wo(f.runId);
|
|
1349
|
+
return d && z(s, { result: d }), d;
|
|
1310
1350
|
}
|
|
1311
|
-
async function
|
|
1312
|
-
const
|
|
1313
|
-
if (
|
|
1351
|
+
async function oe(s) {
|
|
1352
|
+
const f = e.value.find((d) => d.id === s);
|
|
1353
|
+
if (f != null && f.runId && re(f.status))
|
|
1314
1354
|
try {
|
|
1315
|
-
await
|
|
1355
|
+
await To(f.runId);
|
|
1316
1356
|
} catch {
|
|
1317
1357
|
}
|
|
1318
|
-
|
|
1358
|
+
f && re(f.status) && z(s, { status: "cancelled", summary: "已取消", finishedAt: Date.now() }), h.delete(s), X();
|
|
1319
1359
|
}
|
|
1320
|
-
function
|
|
1321
|
-
for (const
|
|
1322
|
-
|
|
1360
|
+
function G() {
|
|
1361
|
+
for (const s of e.value)
|
|
1362
|
+
re(s.status) && oe(s.id);
|
|
1323
1363
|
}
|
|
1324
|
-
function
|
|
1325
|
-
e.value = e.value.filter((
|
|
1364
|
+
function Ce() {
|
|
1365
|
+
e.value = e.value.filter((s) => re(s.status)), L();
|
|
1326
1366
|
}
|
|
1327
|
-
function
|
|
1328
|
-
|
|
1367
|
+
function Se(s) {
|
|
1368
|
+
oe(s), h.delete(s), e.value = e.value.filter((f) => f.id !== s), L();
|
|
1329
1369
|
}
|
|
1330
1370
|
return {
|
|
1331
1371
|
tasks: e,
|
|
1332
1372
|
panelVisible: n,
|
|
1333
1373
|
panelMinimized: t,
|
|
1334
1374
|
dialogVisible: o,
|
|
1335
|
-
dialogOptions:
|
|
1336
|
-
hydrated:
|
|
1337
|
-
runningCount:
|
|
1338
|
-
activeCount:
|
|
1339
|
-
panelTitle:
|
|
1340
|
-
panelSubtitle:
|
|
1341
|
-
hydrate:
|
|
1342
|
-
showPanel:
|
|
1343
|
-
hidePanel:
|
|
1344
|
-
toggleMinimize:
|
|
1345
|
-
openDialog:
|
|
1346
|
-
closeDialog:
|
|
1347
|
-
enqueue:
|
|
1348
|
-
onTaskFinish:
|
|
1349
|
-
refreshActiveTasks:
|
|
1350
|
-
loadTaskResult:
|
|
1351
|
-
cancelTask:
|
|
1352
|
-
cancelAll:
|
|
1353
|
-
clearFinished:
|
|
1354
|
-
removeTask:
|
|
1375
|
+
dialogOptions: l,
|
|
1376
|
+
hydrated: y,
|
|
1377
|
+
runningCount: N,
|
|
1378
|
+
activeCount: q,
|
|
1379
|
+
panelTitle: F,
|
|
1380
|
+
panelSubtitle: v,
|
|
1381
|
+
hydrate: O,
|
|
1382
|
+
showPanel: M,
|
|
1383
|
+
hidePanel: Y,
|
|
1384
|
+
toggleMinimize: _,
|
|
1385
|
+
openDialog: C,
|
|
1386
|
+
closeDialog: K,
|
|
1387
|
+
enqueue: Z,
|
|
1388
|
+
onTaskFinish: D,
|
|
1389
|
+
refreshActiveTasks: H,
|
|
1390
|
+
loadTaskResult: U,
|
|
1391
|
+
cancelTask: oe,
|
|
1392
|
+
cancelAll: G,
|
|
1393
|
+
clearFinished: Ce,
|
|
1394
|
+
removeTask: Se
|
|
1355
1395
|
};
|
|
1356
1396
|
});
|
|
1357
|
-
async function
|
|
1358
|
-
return (await
|
|
1397
|
+
async function Mo(e) {
|
|
1398
|
+
return (await ge().get("/yc-ai/ai/prompts", {
|
|
1359
1399
|
params: e ? { category: e } : {}
|
|
1360
1400
|
})).data;
|
|
1361
1401
|
}
|
|
1362
|
-
function
|
|
1363
|
-
const e =
|
|
1364
|
-
return e ||
|
|
1402
|
+
function qe() {
|
|
1403
|
+
const e = je(At, null);
|
|
1404
|
+
return e || $t();
|
|
1365
1405
|
}
|
|
1366
|
-
const
|
|
1406
|
+
const Po = { class: "ai-use-dialog__footer" }, $o = { class: "ai-use-dialog__footer-actions" }, Lo = /* @__PURE__ */ ue({
|
|
1367
1407
|
__name: "AiUseDialog",
|
|
1368
1408
|
props: {
|
|
1369
1409
|
title: { default: "AI 生成" },
|
|
@@ -1386,147 +1426,147 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1386
1426
|
},
|
|
1387
1427
|
emits: ["update:modelValue", "submitted"],
|
|
1388
1428
|
setup(e, { emit: n }) {
|
|
1389
|
-
const t = e, o = n,
|
|
1429
|
+
const t = e, o = n, l = qe(), y = P(() => t.modelValue !== void 0), c = k(!1);
|
|
1390
1430
|
ne(
|
|
1391
1431
|
() => t.modelValue,
|
|
1392
|
-
(
|
|
1393
|
-
|
|
1432
|
+
(_) => {
|
|
1433
|
+
y.value && (c.value = !!_);
|
|
1394
1434
|
},
|
|
1395
1435
|
{ immediate: !0 }
|
|
1396
|
-
), ne(
|
|
1397
|
-
if (
|
|
1398
|
-
o("update:modelValue",
|
|
1436
|
+
), ne(c, (_) => {
|
|
1437
|
+
if (y.value) {
|
|
1438
|
+
o("update:modelValue", _);
|
|
1399
1439
|
return;
|
|
1400
1440
|
}
|
|
1401
|
-
ae.visible =
|
|
1441
|
+
ae.visible = _, _ || xt();
|
|
1402
1442
|
}), ne(
|
|
1403
1443
|
() => ae.visible,
|
|
1404
|
-
(
|
|
1405
|
-
|
|
1444
|
+
(_) => {
|
|
1445
|
+
y.value || (c.value = _);
|
|
1406
1446
|
},
|
|
1407
1447
|
{ immediate: !0 }
|
|
1408
1448
|
);
|
|
1409
|
-
function _
|
|
1410
|
-
if (
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1449
|
+
function h(_) {
|
|
1450
|
+
if (y.value) return;
|
|
1451
|
+
const C = _.detail ?? {};
|
|
1452
|
+
F(C), c.value = !0;
|
|
1413
1453
|
}
|
|
1414
1454
|
Ke(() => {
|
|
1415
|
-
globalThis.addEventListener(Ue,
|
|
1416
|
-
}),
|
|
1417
|
-
globalThis.removeEventListener(Ue,
|
|
1455
|
+
globalThis.addEventListener(Ue, h), y.value || (c.value = ae.visible);
|
|
1456
|
+
}), Ye(() => {
|
|
1457
|
+
globalThis.removeEventListener(Ue, h);
|
|
1418
1458
|
});
|
|
1419
|
-
const
|
|
1420
|
-
() => (
|
|
1421
|
-
), r =
|
|
1459
|
+
const p = P(
|
|
1460
|
+
() => (y.value ? void 0 : ae.options.title) ?? t.title ?? "AI 生成"
|
|
1461
|
+
), r = k({
|
|
1422
1462
|
freeText: t.freeText,
|
|
1423
1463
|
promptId: t.promptId,
|
|
1424
1464
|
autoMatch: t.autoMatch
|
|
1425
|
-
}),
|
|
1426
|
-
function
|
|
1427
|
-
var
|
|
1428
|
-
r.value.freeText =
|
|
1465
|
+
}), S = k(t.prompts ? [...t.prompts] : []), D = k(!1), N = k(!1), q = k();
|
|
1466
|
+
function F(_) {
|
|
1467
|
+
var C, K;
|
|
1468
|
+
r.value.freeText = _.freeText ?? t.freeText ?? "", r.value.promptId = _.promptId ?? t.promptId, r.value.autoMatch = _.autoMatch ?? t.autoMatch ?? !1, q.value = _.onFinish, (C = _.prompts) != null && C.length ? S.value = [..._.prompts] : (K = t.prompts) != null && K.length && (S.value = [...t.prompts]);
|
|
1429
1469
|
}
|
|
1430
|
-
async function
|
|
1431
|
-
if (!(
|
|
1432
|
-
|
|
1470
|
+
async function v() {
|
|
1471
|
+
if (!(S.value.length > 0)) {
|
|
1472
|
+
D.value = !0;
|
|
1433
1473
|
try {
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1474
|
+
const _ = ht().listPrompts;
|
|
1475
|
+
S.value = _ ? await _() : await Mo();
|
|
1436
1476
|
} catch {
|
|
1437
|
-
|
|
1477
|
+
ee.warning("加载提示词失败");
|
|
1438
1478
|
} finally {
|
|
1439
|
-
|
|
1479
|
+
D.value = !1;
|
|
1440
1480
|
}
|
|
1441
1481
|
}
|
|
1442
1482
|
}
|
|
1443
1483
|
function L() {
|
|
1444
|
-
|
|
1484
|
+
y.value ? F({}) : F(ae.options), t.showPromptSelect && v();
|
|
1445
1485
|
}
|
|
1446
1486
|
ne(
|
|
1447
1487
|
() => t.prompts,
|
|
1448
|
-
(
|
|
1449
|
-
|
|
1488
|
+
(_) => {
|
|
1489
|
+
_ != null && _.length && (S.value = [..._]);
|
|
1450
1490
|
},
|
|
1451
1491
|
{ deep: !0 }
|
|
1452
1492
|
), ne(
|
|
1453
1493
|
() => [t.freeText, t.promptId, t.autoMatch],
|
|
1454
|
-
([
|
|
1455
|
-
|
|
1494
|
+
([_, C, K]) => {
|
|
1495
|
+
c.value || (r.value.freeText = _ ?? "", r.value.promptId = C, r.value.autoMatch = K ?? !1);
|
|
1456
1496
|
}
|
|
1457
1497
|
);
|
|
1458
|
-
function
|
|
1498
|
+
function z() {
|
|
1459
1499
|
r.value.autoMatch && (r.value.promptId = void 0);
|
|
1460
1500
|
}
|
|
1461
|
-
function
|
|
1462
|
-
|
|
1501
|
+
function $() {
|
|
1502
|
+
N.value = !1;
|
|
1463
1503
|
}
|
|
1464
|
-
function
|
|
1465
|
-
|
|
1504
|
+
function M() {
|
|
1505
|
+
l.showPanel();
|
|
1466
1506
|
}
|
|
1467
|
-
async function
|
|
1468
|
-
var
|
|
1507
|
+
async function Y() {
|
|
1508
|
+
var X, H;
|
|
1469
1509
|
if (!r.value.freeText.trim()) {
|
|
1470
|
-
|
|
1510
|
+
ee.warning("请填写需求描述");
|
|
1471
1511
|
return;
|
|
1472
1512
|
}
|
|
1473
|
-
const
|
|
1474
|
-
if (!
|
|
1475
|
-
const
|
|
1476
|
-
|
|
1513
|
+
const _ = r.value.autoMatch, C = _ ? void 0 : r.value.promptId;
|
|
1514
|
+
if (!_ && C == null) {
|
|
1515
|
+
const Q = t.showPromptSelect || t.showAutoMatch ? "请选择提示词或开启自动匹配" : "请通过 promptId 传入提示词,或设置 autoMatch 为 true";
|
|
1516
|
+
ee.warning(Q);
|
|
1477
1517
|
return;
|
|
1478
1518
|
}
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1519
|
+
N.value = !0;
|
|
1520
|
+
const K = y.value ? q.value : ae.options.onFinish, j = l.enqueue({
|
|
1481
1521
|
freeText: r.value.freeText.trim(),
|
|
1482
|
-
promptId:
|
|
1483
|
-
autoMatch:
|
|
1522
|
+
promptId: C,
|
|
1523
|
+
autoMatch: _ && C == null ? !0 : void 0,
|
|
1484
1524
|
showPanel: !0,
|
|
1485
|
-
onFinish:
|
|
1525
|
+
onFinish: K
|
|
1486
1526
|
});
|
|
1487
|
-
|
|
1527
|
+
y.value ? o("submitted", j) : (H = (X = ae.options).onSubmitted) == null || H.call(X, j), c.value = !1, N.value = !1, ee.success("已加入任务队列,可在任务面板查看进度");
|
|
1488
1528
|
}
|
|
1489
|
-
return (
|
|
1490
|
-
const
|
|
1491
|
-
return u(),
|
|
1492
|
-
modelValue:
|
|
1493
|
-
"onUpdate:modelValue":
|
|
1494
|
-
title:
|
|
1529
|
+
return (_, C) => {
|
|
1530
|
+
const K = V("el-switch"), j = V("el-form-item"), X = V("el-option"), H = V("el-select"), Q = V("el-input"), O = V("el-form"), Z = V("el-button"), se = V("el-dialog");
|
|
1531
|
+
return u(), E(se, {
|
|
1532
|
+
modelValue: c.value,
|
|
1533
|
+
"onUpdate:modelValue": C[4] || (C[4] = (U) => c.value = U),
|
|
1534
|
+
title: p.value,
|
|
1495
1535
|
width: e.width,
|
|
1496
1536
|
"append-to-body": "",
|
|
1497
1537
|
class: "ai-use-dialog",
|
|
1498
|
-
onClosed:
|
|
1538
|
+
onClosed: $,
|
|
1499
1539
|
onOpen: L
|
|
1500
1540
|
}, {
|
|
1501
1541
|
footer: g(() => [
|
|
1502
|
-
T("div",
|
|
1503
|
-
e.showTaskListButton ? (u(),
|
|
1542
|
+
T("div", Po, [
|
|
1543
|
+
e.showTaskListButton ? (u(), E(Z, {
|
|
1504
1544
|
key: 0,
|
|
1505
1545
|
link: "",
|
|
1506
1546
|
type: "primary",
|
|
1507
|
-
onClick:
|
|
1547
|
+
onClick: M
|
|
1508
1548
|
}, {
|
|
1509
1549
|
default: g(() => [
|
|
1510
|
-
|
|
1550
|
+
W(B(e.taskListButtonText), 1)
|
|
1511
1551
|
]),
|
|
1512
1552
|
_: 1
|
|
1513
|
-
})) :
|
|
1514
|
-
T("div",
|
|
1515
|
-
m(
|
|
1516
|
-
onClick:
|
|
1553
|
+
})) : b("", !0),
|
|
1554
|
+
T("div", $o, [
|
|
1555
|
+
m(Z, {
|
|
1556
|
+
onClick: C[3] || (C[3] = (U) => c.value = !1)
|
|
1517
1557
|
}, {
|
|
1518
|
-
default: g(() => [...
|
|
1519
|
-
|
|
1558
|
+
default: g(() => [...C[5] || (C[5] = [
|
|
1559
|
+
W("取消", -1)
|
|
1520
1560
|
])]),
|
|
1521
1561
|
_: 1
|
|
1522
1562
|
}),
|
|
1523
|
-
m(
|
|
1563
|
+
m(Z, {
|
|
1524
1564
|
type: "primary",
|
|
1525
|
-
loading:
|
|
1526
|
-
onClick:
|
|
1565
|
+
loading: N.value,
|
|
1566
|
+
onClick: Y
|
|
1527
1567
|
}, {
|
|
1528
1568
|
default: g(() => [
|
|
1529
|
-
|
|
1569
|
+
W(B(e.submitText), 1)
|
|
1530
1570
|
]),
|
|
1531
1571
|
_: 1
|
|
1532
1572
|
}, 8, ["loading"])
|
|
@@ -1534,58 +1574,58 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1534
1574
|
])
|
|
1535
1575
|
]),
|
|
1536
1576
|
default: g(() => [
|
|
1537
|
-
m(
|
|
1577
|
+
m(O, { "label-position": "top" }, {
|
|
1538
1578
|
default: g(() => [
|
|
1539
|
-
e.showAutoMatch ? (u(),
|
|
1579
|
+
e.showAutoMatch ? (u(), E(j, {
|
|
1540
1580
|
key: 0,
|
|
1541
1581
|
label: e.autoMatchLabel
|
|
1542
1582
|
}, {
|
|
1543
1583
|
default: g(() => [
|
|
1544
|
-
m(
|
|
1584
|
+
m(K, {
|
|
1545
1585
|
modelValue: r.value.autoMatch,
|
|
1546
|
-
"onUpdate:modelValue":
|
|
1586
|
+
"onUpdate:modelValue": C[0] || (C[0] = (U) => r.value.autoMatch = U),
|
|
1547
1587
|
"active-text": "按需求自动选",
|
|
1548
1588
|
"inactive-text": "手动指定",
|
|
1549
|
-
onChange:
|
|
1589
|
+
onChange: z
|
|
1550
1590
|
}, null, 8, ["modelValue"])
|
|
1551
1591
|
]),
|
|
1552
1592
|
_: 1
|
|
1553
|
-
}, 8, ["label"])) :
|
|
1554
|
-
e.showPromptSelect ? (u(),
|
|
1593
|
+
}, 8, ["label"])) : b("", !0),
|
|
1594
|
+
e.showPromptSelect ? (u(), E(j, {
|
|
1555
1595
|
key: 1,
|
|
1556
1596
|
label: e.promptLabel,
|
|
1557
1597
|
required: !r.value.autoMatch
|
|
1558
1598
|
}, {
|
|
1559
1599
|
default: g(() => [
|
|
1560
|
-
m(
|
|
1600
|
+
m(H, {
|
|
1561
1601
|
modelValue: r.value.promptId,
|
|
1562
|
-
"onUpdate:modelValue":
|
|
1602
|
+
"onUpdate:modelValue": C[1] || (C[1] = (U) => r.value.promptId = U),
|
|
1563
1603
|
filterable: "",
|
|
1564
1604
|
clearable: "",
|
|
1565
1605
|
placeholder: r.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
|
|
1566
1606
|
style: { width: "100%" },
|
|
1567
|
-
loading:
|
|
1607
|
+
loading: D.value
|
|
1568
1608
|
}, {
|
|
1569
1609
|
default: g(() => [
|
|
1570
|
-
(u(!0), A(
|
|
1571
|
-
key:
|
|
1572
|
-
label:
|
|
1573
|
-
value:
|
|
1610
|
+
(u(!0), A(ce, null, ye(S.value, (U) => (u(), E(X, {
|
|
1611
|
+
key: U.id,
|
|
1612
|
+
label: U.name,
|
|
1613
|
+
value: U.id
|
|
1574
1614
|
}, null, 8, ["label", "value"]))), 128))
|
|
1575
1615
|
]),
|
|
1576
1616
|
_: 1
|
|
1577
1617
|
}, 8, ["modelValue", "placeholder", "loading"])
|
|
1578
1618
|
]),
|
|
1579
1619
|
_: 1
|
|
1580
|
-
}, 8, ["label", "required"])) :
|
|
1620
|
+
}, 8, ["label", "required"])) : b("", !0),
|
|
1581
1621
|
m(j, {
|
|
1582
1622
|
label: e.freeTextLabel,
|
|
1583
1623
|
required: ""
|
|
1584
1624
|
}, {
|
|
1585
1625
|
default: g(() => [
|
|
1586
|
-
m(
|
|
1626
|
+
m(Q, {
|
|
1587
1627
|
modelValue: r.value.freeText,
|
|
1588
|
-
"onUpdate:modelValue":
|
|
1628
|
+
"onUpdate:modelValue": C[2] || (C[2] = (U) => r.value.freeText = U),
|
|
1589
1629
|
type: "textarea",
|
|
1590
1630
|
rows: 4,
|
|
1591
1631
|
placeholder: e.freeTextPlaceholder
|
|
@@ -1601,104 +1641,104 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1601
1641
|
}, 8, ["modelValue", "title", "width"]);
|
|
1602
1642
|
};
|
|
1603
1643
|
}
|
|
1604
|
-
}),
|
|
1644
|
+
}), Do = /* @__PURE__ */ Me(Lo, [["__scopeId", "data-v-9aa82e83"]]), Bo = { class: "ai-task-panel" }, Vo = { class: "ai-task-panel__header" }, Oo = { class: "ai-task-panel__header-left" }, Fo = { class: "ai-task-panel__titles" }, Uo = { class: "ai-task-panel__subtitle" }, Ro = { class: "ai-task-panel__title" }, No = { class: "ai-task-panel__header-actions" }, Ko = { class: "ai-task-panel__body" }, Yo = {
|
|
1605
1645
|
key: 1,
|
|
1606
1646
|
class: "ai-task-list"
|
|
1607
|
-
},
|
|
1647
|
+
}, zo = { class: "ai-task-row__icon" }, jo = { class: "ai-task-row__main" }, Go = { class: "ai-task-row__title" }, Wo = { class: "ai-task-row__meta" }, qo = { key: 0 }, Ho = {
|
|
1608
1648
|
key: 0,
|
|
1609
1649
|
class: "ai-task-row__summary"
|
|
1610
|
-
},
|
|
1650
|
+
}, Jo = { class: "ai-task-row__ops" }, Xo = {
|
|
1611
1651
|
key: 0,
|
|
1612
1652
|
class: "ai-task-panel__footer"
|
|
1613
|
-
},
|
|
1653
|
+
}, Qo = /* @__PURE__ */ ue({
|
|
1614
1654
|
__name: "AiTaskPanel",
|
|
1615
1655
|
emits: ["use"],
|
|
1616
1656
|
setup(e, { emit: n }) {
|
|
1617
|
-
const t = n, o =
|
|
1657
|
+
const t = n, o = qe(), l = k(null), y = {
|
|
1618
1658
|
pending: "等待中",
|
|
1619
1659
|
running: "执行中",
|
|
1620
1660
|
succeeded: "已完成",
|
|
1621
1661
|
failed: "失败",
|
|
1622
1662
|
cancelled: "已取消"
|
|
1623
1663
|
};
|
|
1624
|
-
function
|
|
1625
|
-
return
|
|
1664
|
+
function c(p) {
|
|
1665
|
+
return y[p] ?? p;
|
|
1626
1666
|
}
|
|
1627
|
-
async function
|
|
1628
|
-
|
|
1667
|
+
async function h(p) {
|
|
1668
|
+
l.value = p.id;
|
|
1629
1669
|
try {
|
|
1630
|
-
const r =
|
|
1670
|
+
const r = p.result ?? await o.loadTaskResult(p.id);
|
|
1631
1671
|
if (!r) return;
|
|
1632
1672
|
t("use", {
|
|
1633
|
-
taskId:
|
|
1634
|
-
runId:
|
|
1635
|
-
title:
|
|
1636
|
-
freeText:
|
|
1637
|
-
promptId:
|
|
1673
|
+
taskId: p.id,
|
|
1674
|
+
runId: p.runId,
|
|
1675
|
+
title: p.title,
|
|
1676
|
+
freeText: p.freeText,
|
|
1677
|
+
promptId: p.promptId,
|
|
1638
1678
|
result: r,
|
|
1639
|
-
finishedAt:
|
|
1679
|
+
finishedAt: p.finishedAt ?? Date.now()
|
|
1640
1680
|
});
|
|
1641
1681
|
} finally {
|
|
1642
|
-
|
|
1682
|
+
l.value = null;
|
|
1643
1683
|
}
|
|
1644
1684
|
}
|
|
1645
|
-
return (
|
|
1646
|
-
const
|
|
1647
|
-
return u(),
|
|
1648
|
-
m(
|
|
1685
|
+
return (p, r) => {
|
|
1686
|
+
const S = V("el-icon"), D = V("el-button"), N = V("el-empty"), q = V("el-progress"), F = V("el-badge");
|
|
1687
|
+
return u(), E(Zt, { to: "body" }, [
|
|
1688
|
+
m(gt, { name: "ai-panel-slide" }, {
|
|
1649
1689
|
default: g(() => [
|
|
1650
|
-
|
|
1651
|
-
T("div",
|
|
1652
|
-
T("div",
|
|
1690
|
+
we(T("div", Bo, [
|
|
1691
|
+
T("div", Vo, [
|
|
1692
|
+
T("div", Oo, [
|
|
1653
1693
|
T("div", {
|
|
1654
|
-
class:
|
|
1694
|
+
class: me(["ai-task-panel__icon", { spinning: w(o).activeCount > 0 }])
|
|
1655
1695
|
}, [
|
|
1656
|
-
m(
|
|
1696
|
+
m(S, null, {
|
|
1657
1697
|
default: g(() => [
|
|
1658
|
-
m(w(
|
|
1698
|
+
m(w(it))
|
|
1659
1699
|
]),
|
|
1660
1700
|
_: 1
|
|
1661
1701
|
})
|
|
1662
1702
|
], 2),
|
|
1663
|
-
T("div",
|
|
1664
|
-
T("div",
|
|
1665
|
-
T("div",
|
|
1703
|
+
T("div", Fo, [
|
|
1704
|
+
T("div", Uo, B(w(o).panelSubtitle), 1),
|
|
1705
|
+
T("div", Ro, B(w(o).panelTitle), 1)
|
|
1666
1706
|
])
|
|
1667
1707
|
]),
|
|
1668
|
-
T("div",
|
|
1669
|
-
w(o).runningCount > 0 ? (u(),
|
|
1708
|
+
T("div", No, [
|
|
1709
|
+
w(o).runningCount > 0 ? (u(), E(D, {
|
|
1670
1710
|
key: 0,
|
|
1671
1711
|
link: "",
|
|
1672
1712
|
type: "primary",
|
|
1673
|
-
onClick: r[0] || (r[0] = (
|
|
1713
|
+
onClick: r[0] || (r[0] = (v) => w(o).cancelAll())
|
|
1674
1714
|
}, {
|
|
1675
1715
|
default: g(() => [...r[5] || (r[5] = [
|
|
1676
|
-
|
|
1716
|
+
W(" 取消全部 ", -1)
|
|
1677
1717
|
])]),
|
|
1678
1718
|
_: 1
|
|
1679
|
-
})) :
|
|
1680
|
-
m(
|
|
1719
|
+
})) : b("", !0),
|
|
1720
|
+
m(D, {
|
|
1681
1721
|
link: "",
|
|
1682
|
-
onClick: r[1] || (r[1] = (
|
|
1722
|
+
onClick: r[1] || (r[1] = (v) => w(o).toggleMinimize())
|
|
1683
1723
|
}, {
|
|
1684
1724
|
default: g(() => [
|
|
1685
|
-
m(
|
|
1725
|
+
m(S, null, {
|
|
1686
1726
|
default: g(() => [
|
|
1687
|
-
m(w(
|
|
1727
|
+
m(w(rn))
|
|
1688
1728
|
]),
|
|
1689
1729
|
_: 1
|
|
1690
1730
|
})
|
|
1691
1731
|
]),
|
|
1692
1732
|
_: 1
|
|
1693
1733
|
}),
|
|
1694
|
-
m(
|
|
1734
|
+
m(D, {
|
|
1695
1735
|
link: "",
|
|
1696
|
-
onClick: r[2] || (r[2] = (
|
|
1736
|
+
onClick: r[2] || (r[2] = (v) => w(o).hidePanel())
|
|
1697
1737
|
}, {
|
|
1698
1738
|
default: g(() => [
|
|
1699
|
-
m(
|
|
1739
|
+
m(S, null, {
|
|
1700
1740
|
default: g(() => [
|
|
1701
|
-
m(w(
|
|
1741
|
+
m(w(_t))
|
|
1702
1742
|
]),
|
|
1703
1743
|
_: 1
|
|
1704
1744
|
})
|
|
@@ -1707,142 +1747,142 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1707
1747
|
})
|
|
1708
1748
|
])
|
|
1709
1749
|
]),
|
|
1710
|
-
T("div",
|
|
1711
|
-
w(o).tasks.length ? (u(), A("div",
|
|
1712
|
-
(u(!0), A(
|
|
1713
|
-
key:
|
|
1750
|
+
T("div", Ko, [
|
|
1751
|
+
w(o).tasks.length ? (u(), A("div", Yo, [
|
|
1752
|
+
(u(!0), A(ce, null, ye(w(o).tasks, (v) => (u(), A("div", {
|
|
1753
|
+
key: v.id,
|
|
1714
1754
|
class: "ai-task-row"
|
|
1715
1755
|
}, [
|
|
1716
|
-
T("div",
|
|
1717
|
-
|
|
1756
|
+
T("div", zo, [
|
|
1757
|
+
v.status === "succeeded" ? (u(), E(S, {
|
|
1718
1758
|
key: 0,
|
|
1719
1759
|
class: "ok"
|
|
1720
1760
|
}, {
|
|
1721
1761
|
default: g(() => [
|
|
1722
|
-
m(w(
|
|
1762
|
+
m(w(un))
|
|
1723
1763
|
]),
|
|
1724
1764
|
_: 1
|
|
1725
|
-
})) :
|
|
1765
|
+
})) : v.status === "failed" ? (u(), E(S, {
|
|
1726
1766
|
key: 1,
|
|
1727
1767
|
class: "err"
|
|
1728
1768
|
}, {
|
|
1729
1769
|
default: g(() => [
|
|
1730
|
-
m(w(
|
|
1770
|
+
m(w(cn))
|
|
1731
1771
|
]),
|
|
1732
1772
|
_: 1
|
|
1733
|
-
})) :
|
|
1773
|
+
})) : v.status === "running" || v.status === "pending" ? (u(), E(q, {
|
|
1734
1774
|
key: 2,
|
|
1735
1775
|
type: "circle",
|
|
1736
|
-
percentage:
|
|
1776
|
+
percentage: v.progress,
|
|
1737
1777
|
width: 36,
|
|
1738
1778
|
"stroke-width": 3
|
|
1739
|
-
}, null, 8, ["percentage"])) : (u(),
|
|
1779
|
+
}, null, 8, ["percentage"])) : (u(), E(S, {
|
|
1740
1780
|
key: 3,
|
|
1741
1781
|
class: "muted"
|
|
1742
1782
|
}, {
|
|
1743
1783
|
default: g(() => [
|
|
1744
|
-
m(w(
|
|
1784
|
+
m(w(dn))
|
|
1745
1785
|
]),
|
|
1746
1786
|
_: 1
|
|
1747
1787
|
}))
|
|
1748
1788
|
]),
|
|
1749
|
-
T("div",
|
|
1750
|
-
T("div",
|
|
1751
|
-
T("div",
|
|
1752
|
-
T("span", null,
|
|
1753
|
-
|
|
1789
|
+
T("div", jo, [
|
|
1790
|
+
T("div", Go, B(v.title), 1),
|
|
1791
|
+
T("div", Wo, [
|
|
1792
|
+
T("span", null, B(c(v.status)), 1),
|
|
1793
|
+
v.runId ? (u(), A("span", qo, " · #" + B(v.runId), 1)) : b("", !0)
|
|
1754
1794
|
]),
|
|
1755
|
-
|
|
1795
|
+
v.summary ? (u(), A("div", Ho, B(v.summary), 1)) : b("", !0)
|
|
1756
1796
|
]),
|
|
1757
|
-
T("div",
|
|
1758
|
-
|
|
1797
|
+
T("div", Jo, [
|
|
1798
|
+
v.status === "running" || v.status === "pending" ? (u(), E(D, {
|
|
1759
1799
|
key: 0,
|
|
1760
1800
|
link: "",
|
|
1761
1801
|
type: "danger",
|
|
1762
1802
|
size: "small",
|
|
1763
|
-
onClick: (L) => w(o).cancelTask(
|
|
1803
|
+
onClick: (L) => w(o).cancelTask(v.id)
|
|
1764
1804
|
}, {
|
|
1765
1805
|
default: g(() => [...r[6] || (r[6] = [
|
|
1766
|
-
|
|
1806
|
+
W(" 取消 ", -1)
|
|
1767
1807
|
])]),
|
|
1768
1808
|
_: 1
|
|
1769
|
-
}, 8, ["onClick"])) :
|
|
1770
|
-
|
|
1809
|
+
}, 8, ["onClick"])) : b("", !0),
|
|
1810
|
+
v.status === "succeeded" && v.runId ? (u(), E(D, {
|
|
1771
1811
|
key: 1,
|
|
1772
1812
|
link: "",
|
|
1773
1813
|
type: "primary",
|
|
1774
1814
|
size: "small",
|
|
1775
|
-
loading:
|
|
1776
|
-
onClick: (L) =>
|
|
1815
|
+
loading: l.value === v.id,
|
|
1816
|
+
onClick: (L) => h(v)
|
|
1777
1817
|
}, {
|
|
1778
1818
|
default: g(() => [...r[7] || (r[7] = [
|
|
1779
|
-
|
|
1819
|
+
W(" 使用 ", -1)
|
|
1780
1820
|
])]),
|
|
1781
1821
|
_: 1
|
|
1782
|
-
}, 8, ["loading", "onClick"])) :
|
|
1783
|
-
|
|
1822
|
+
}, 8, ["loading", "onClick"])) : b("", !0),
|
|
1823
|
+
v.status !== "running" && v.status !== "pending" ? (u(), E(D, {
|
|
1784
1824
|
key: 2,
|
|
1785
1825
|
link: "",
|
|
1786
1826
|
size: "small",
|
|
1787
|
-
onClick: (L) => w(o).removeTask(
|
|
1827
|
+
onClick: (L) => w(o).removeTask(v.id)
|
|
1788
1828
|
}, {
|
|
1789
1829
|
default: g(() => [...r[8] || (r[8] = [
|
|
1790
|
-
|
|
1830
|
+
W(" 移除 ", -1)
|
|
1791
1831
|
])]),
|
|
1792
1832
|
_: 1
|
|
1793
|
-
}, 8, ["onClick"])) :
|
|
1833
|
+
}, 8, ["onClick"])) : b("", !0)
|
|
1794
1834
|
])
|
|
1795
1835
|
]))), 128))
|
|
1796
|
-
])) : (u(),
|
|
1836
|
+
])) : (u(), E(N, {
|
|
1797
1837
|
key: 0,
|
|
1798
1838
|
description: "暂无 AI 任务",
|
|
1799
1839
|
"image-size": 64
|
|
1800
1840
|
}))
|
|
1801
1841
|
]),
|
|
1802
|
-
w(o).tasks.some((
|
|
1803
|
-
m(
|
|
1842
|
+
w(o).tasks.some((v) => v.status !== "running" && v.status !== "pending") ? (u(), A("div", Xo, [
|
|
1843
|
+
m(D, {
|
|
1804
1844
|
link: "",
|
|
1805
1845
|
type: "info",
|
|
1806
|
-
onClick: r[3] || (r[3] = (
|
|
1846
|
+
onClick: r[3] || (r[3] = (v) => w(o).clearFinished())
|
|
1807
1847
|
}, {
|
|
1808
1848
|
default: g(() => [...r[9] || (r[9] = [
|
|
1809
|
-
|
|
1849
|
+
W("清除已完成", -1)
|
|
1810
1850
|
])]),
|
|
1811
1851
|
_: 1
|
|
1812
1852
|
})
|
|
1813
|
-
])) :
|
|
1853
|
+
])) : b("", !0)
|
|
1814
1854
|
], 512), [
|
|
1815
|
-
[
|
|
1855
|
+
[Be, w(o).panelVisible && !w(o).panelMinimized]
|
|
1816
1856
|
])
|
|
1817
1857
|
]),
|
|
1818
1858
|
_: 1
|
|
1819
1859
|
}),
|
|
1820
|
-
|
|
1860
|
+
we(T("div", {
|
|
1821
1861
|
class: "ai-task-panel-mini",
|
|
1822
|
-
onClick: r[4] || (r[4] = (
|
|
1862
|
+
onClick: r[4] || (r[4] = (v) => w(o).toggleMinimize())
|
|
1823
1863
|
}, [
|
|
1824
|
-
w(o).activeCount > 0 ? (u(),
|
|
1864
|
+
w(o).activeCount > 0 ? (u(), E(S, {
|
|
1825
1865
|
key: 0,
|
|
1826
1866
|
class: "spinning"
|
|
1827
1867
|
}, {
|
|
1828
1868
|
default: g(() => [
|
|
1829
|
-
m(w(
|
|
1869
|
+
m(w(it))
|
|
1830
1870
|
]),
|
|
1831
1871
|
_: 1
|
|
1832
|
-
})) :
|
|
1833
|
-
T("span", null,
|
|
1834
|
-
w(o).runningCount > 0 ? (u(),
|
|
1872
|
+
})) : b("", !0),
|
|
1873
|
+
T("span", null, B(w(o).panelSubtitle), 1),
|
|
1874
|
+
w(o).runningCount > 0 ? (u(), E(F, {
|
|
1835
1875
|
key: 1,
|
|
1836
1876
|
value: w(o).runningCount,
|
|
1837
1877
|
class: "m-l-8"
|
|
1838
|
-
}, null, 8, ["value"])) :
|
|
1878
|
+
}, null, 8, ["value"])) : b("", !0)
|
|
1839
1879
|
], 512), [
|
|
1840
|
-
[
|
|
1880
|
+
[Be, w(o).panelVisible && w(o).panelMinimized]
|
|
1841
1881
|
])
|
|
1842
1882
|
]);
|
|
1843
1883
|
};
|
|
1844
1884
|
}
|
|
1845
|
-
}),
|
|
1885
|
+
}), Zo = /* @__PURE__ */ Me(Qo, [["__scopeId", "data-v-812b3127"]]), dl = /* @__PURE__ */ ue({
|
|
1846
1886
|
__name: "AiTaskProvider",
|
|
1847
1887
|
props: {
|
|
1848
1888
|
title: {},
|
|
@@ -1865,10 +1905,10 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1865
1905
|
},
|
|
1866
1906
|
emits: ["finish", "use"],
|
|
1867
1907
|
setup(e, { emit: n }) {
|
|
1868
|
-
const t = e, o = n,
|
|
1869
|
-
|
|
1870
|
-
const
|
|
1871
|
-
const
|
|
1908
|
+
const t = e, o = n, l = $t();
|
|
1909
|
+
Ve(At, l), Ve(bt, kt(l));
|
|
1910
|
+
const y = P(() => {
|
|
1911
|
+
const p = {
|
|
1872
1912
|
title: t.title,
|
|
1873
1913
|
freeText: t.freeText,
|
|
1874
1914
|
promptId: t.promptId,
|
|
@@ -1885,61 +1925,61 @@ const xo = { class: "ai-use-dialog__footer" }, bo = { class: "ai-use-dialog__foo
|
|
|
1885
1925
|
taskListButtonText: t.taskListButtonText,
|
|
1886
1926
|
width: t.width
|
|
1887
1927
|
};
|
|
1888
|
-
return t.modelValue !== void 0 && (
|
|
1928
|
+
return t.modelValue !== void 0 && (p.modelValue = t.modelValue), p;
|
|
1889
1929
|
});
|
|
1890
|
-
let
|
|
1891
|
-
function
|
|
1892
|
-
o("use",
|
|
1930
|
+
let c;
|
|
1931
|
+
function h(p) {
|
|
1932
|
+
o("use", p);
|
|
1893
1933
|
}
|
|
1894
1934
|
return Ke(() => {
|
|
1895
|
-
|
|
1896
|
-
}),
|
|
1897
|
-
|
|
1898
|
-
}), (
|
|
1899
|
-
e.showDialog !== !1 ? (u(),
|
|
1900
|
-
m(
|
|
1901
|
-
|
|
1935
|
+
l.hydrate(), c = l.onTaskFinish((p) => o("finish", p));
|
|
1936
|
+
}), Ye(() => {
|
|
1937
|
+
c == null || c();
|
|
1938
|
+
}), (p, r) => (u(), A(ce, null, [
|
|
1939
|
+
e.showDialog !== !1 ? (u(), E(Do, mt(ze({ key: 0 }, y.value)), null, 16)) : b("", !0),
|
|
1940
|
+
m(Zo, { onUse: h }),
|
|
1941
|
+
Te(p.$slots, "default")
|
|
1902
1942
|
], 64));
|
|
1903
1943
|
}
|
|
1904
1944
|
});
|
|
1905
|
-
function
|
|
1906
|
-
const e =
|
|
1907
|
-
return e ||
|
|
1945
|
+
function fl() {
|
|
1946
|
+
const e = je(bt, null);
|
|
1947
|
+
return e || kt(qe());
|
|
1908
1948
|
}
|
|
1909
|
-
function
|
|
1910
|
-
const e =
|
|
1949
|
+
function el() {
|
|
1950
|
+
const e = k(!1), n = k({});
|
|
1911
1951
|
let t = null;
|
|
1912
|
-
function o(
|
|
1913
|
-
t == null || t.resolve(
|
|
1952
|
+
function o(h) {
|
|
1953
|
+
t == null || t.resolve(h), t = null;
|
|
1914
1954
|
}
|
|
1915
|
-
function
|
|
1955
|
+
function l() {
|
|
1916
1956
|
t == null || t.reject(new be()), t = null;
|
|
1917
1957
|
}
|
|
1918
|
-
function
|
|
1958
|
+
function y(h = {}) {
|
|
1919
1959
|
t && (t.reject(new be()), t = null);
|
|
1920
|
-
const
|
|
1921
|
-
t = { resolve: r, reject:
|
|
1960
|
+
const p = new Promise((r, S) => {
|
|
1961
|
+
t = { resolve: r, reject: S };
|
|
1922
1962
|
});
|
|
1923
|
-
return n.value = { ...
|
|
1963
|
+
return n.value = { ...h }, e.value = !0, p;
|
|
1924
1964
|
}
|
|
1925
|
-
function
|
|
1965
|
+
function c() {
|
|
1926
1966
|
e.value = !1;
|
|
1927
1967
|
}
|
|
1928
1968
|
return {
|
|
1929
1969
|
dialogVisible: e,
|
|
1930
1970
|
dialogOptions: n,
|
|
1931
|
-
openImageSelector:
|
|
1932
|
-
closeImageSelector:
|
|
1971
|
+
openImageSelector: y,
|
|
1972
|
+
closeImageSelector: c,
|
|
1933
1973
|
settlePendingConfirm: o,
|
|
1934
|
-
settlePendingCancel:
|
|
1974
|
+
settlePendingCancel: l
|
|
1935
1975
|
};
|
|
1936
1976
|
}
|
|
1937
|
-
const
|
|
1938
|
-
function
|
|
1977
|
+
const tl = "__YC_IMAGE_SELECTOR_CTX_KEY__";
|
|
1978
|
+
function nl(e) {
|
|
1939
1979
|
const n = globalThis;
|
|
1940
1980
|
return n[e] || (n[e] = Symbol(e)), n[e];
|
|
1941
1981
|
}
|
|
1942
|
-
const
|
|
1982
|
+
const Lt = nl(tl), pl = /* @__PURE__ */ ue({
|
|
1943
1983
|
__name: "YcImageSelectorProvider",
|
|
1944
1984
|
props: {
|
|
1945
1985
|
modelValue: { type: [Boolean, null] },
|
|
@@ -1960,113 +2000,115 @@ const Pt = Xo(Jo), rl = /* @__PURE__ */ de({
|
|
|
1960
2000
|
cancelText: { default: "取消" },
|
|
1961
2001
|
emptyText: { default: "暂无图片资源" },
|
|
1962
2002
|
renderEmpty: {},
|
|
2003
|
+
renderFooterExtra: {},
|
|
1963
2004
|
getImages: {},
|
|
1964
2005
|
upload: {},
|
|
1965
2006
|
urlField: { default: "url" },
|
|
1966
2007
|
showDialog: { type: Boolean, default: !0 }
|
|
1967
2008
|
},
|
|
1968
2009
|
setup(e, { expose: n }) {
|
|
1969
|
-
const t = e, o =
|
|
1970
|
-
dialogVisible:
|
|
1971
|
-
dialogOptions:
|
|
1972
|
-
openImageSelector:
|
|
1973
|
-
closeImageSelector:
|
|
1974
|
-
settlePendingConfirm:
|
|
2010
|
+
const t = e, o = el(), {
|
|
2011
|
+
dialogVisible: l,
|
|
2012
|
+
dialogOptions: y,
|
|
2013
|
+
openImageSelector: c,
|
|
2014
|
+
closeImageSelector: h,
|
|
2015
|
+
settlePendingConfirm: p,
|
|
1975
2016
|
settlePendingCancel: r
|
|
1976
2017
|
} = o;
|
|
1977
|
-
|
|
1978
|
-
function
|
|
1979
|
-
return
|
|
2018
|
+
Ve(Lt, o);
|
|
2019
|
+
function S(F, v) {
|
|
2020
|
+
return F in y.value ? y.value[F] : v;
|
|
1980
2021
|
}
|
|
1981
|
-
const
|
|
1982
|
-
title:
|
|
1983
|
-
multiple:
|
|
1984
|
-
maxCount:
|
|
1985
|
-
selected:
|
|
2022
|
+
const D = P(() => ({
|
|
2023
|
+
title: S("title", t.title),
|
|
2024
|
+
multiple: S("multiple", t.multiple),
|
|
2025
|
+
maxCount: S("maxCount", t.maxCount),
|
|
2026
|
+
selected: S("selected", t.selected),
|
|
1986
2027
|
width: t.width,
|
|
1987
2028
|
pageSize: t.pageSize,
|
|
1988
2029
|
showUpload: t.showUpload,
|
|
1989
2030
|
accept: t.accept,
|
|
1990
|
-
showCategories:
|
|
1991
|
-
categories:
|
|
1992
|
-
categoryAllLabel:
|
|
1993
|
-
showModeSwitch:
|
|
1994
|
-
confirmOnSelect:
|
|
2031
|
+
showCategories: S("showCategories", t.showCategories),
|
|
2032
|
+
categories: S("categories", t.categories),
|
|
2033
|
+
categoryAllLabel: S("categoryAllLabel", t.categoryAllLabel),
|
|
2034
|
+
showModeSwitch: S("showModeSwitch", t.showModeSwitch),
|
|
2035
|
+
confirmOnSelect: S("confirmOnSelect", t.confirmOnSelect),
|
|
1995
2036
|
confirmText: t.confirmText,
|
|
1996
2037
|
cancelText: t.cancelText,
|
|
1997
2038
|
emptyText: t.emptyText,
|
|
1998
2039
|
renderEmpty: t.renderEmpty,
|
|
2040
|
+
renderFooterExtra: t.renderFooterExtra,
|
|
1999
2041
|
getImages: t.getImages,
|
|
2000
2042
|
upload: t.upload,
|
|
2001
2043
|
urlField: t.urlField
|
|
2002
2044
|
}));
|
|
2003
|
-
function F
|
|
2004
|
-
var
|
|
2005
|
-
(L = (
|
|
2045
|
+
function N(F) {
|
|
2046
|
+
var v, L;
|
|
2047
|
+
(L = (v = y.value).onConfirm) == null || L.call(v, F), p(F), h();
|
|
2006
2048
|
}
|
|
2007
|
-
function
|
|
2008
|
-
var
|
|
2009
|
-
(
|
|
2049
|
+
function q() {
|
|
2050
|
+
var F, v;
|
|
2051
|
+
(v = (F = y.value).onCancel) == null || v.call(F), r(), h();
|
|
2010
2052
|
}
|
|
2011
|
-
return n({ openImageSelector:
|
|
2012
|
-
e.showDialog !== !1 ? (u(),
|
|
2053
|
+
return n({ openImageSelector: c, closeImageSelector: h }), (F, v) => (u(), A(ce, null, [
|
|
2054
|
+
e.showDialog !== !1 ? (u(), E(Ct, ze({
|
|
2013
2055
|
key: 0,
|
|
2014
|
-
modelValue: w(
|
|
2015
|
-
"onUpdate:modelValue":
|
|
2016
|
-
},
|
|
2017
|
-
onConfirm:
|
|
2018
|
-
onCancel:
|
|
2019
|
-
}), null, 16, ["modelValue"])) :
|
|
2020
|
-
|
|
2056
|
+
modelValue: w(l),
|
|
2057
|
+
"onUpdate:modelValue": v[0] || (v[0] = (L) => en(l) ? l.value = L : null)
|
|
2058
|
+
}, D.value, {
|
|
2059
|
+
onConfirm: N,
|
|
2060
|
+
onCancel: q
|
|
2061
|
+
}), null, 16, ["modelValue"])) : b("", !0),
|
|
2062
|
+
Te(F.$slots, "default")
|
|
2021
2063
|
], 64));
|
|
2022
2064
|
}
|
|
2023
2065
|
});
|
|
2024
|
-
function
|
|
2025
|
-
const e =
|
|
2066
|
+
function ml() {
|
|
2067
|
+
const e = je(Lt, null);
|
|
2026
2068
|
return e ? {
|
|
2027
2069
|
openImageSelector: (n = {}) => e.openImageSelector(n),
|
|
2028
2070
|
closeImageSelector: () => e.closeImageSelector()
|
|
2029
2071
|
} : {
|
|
2030
|
-
openImageSelector:
|
|
2031
|
-
closeImageSelector:
|
|
2072
|
+
openImageSelector: It,
|
|
2073
|
+
closeImageSelector: Tt
|
|
2032
2074
|
};
|
|
2033
2075
|
}
|
|
2034
2076
|
export {
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2077
|
+
Zo as AiTaskPanel,
|
|
2078
|
+
dl as AiTaskProvider,
|
|
2079
|
+
Do as AiUseDialog,
|
|
2080
|
+
Lt as IMAGE_SELECTOR_INJECT_KEY,
|
|
2081
|
+
st as ImageSelectorAuthError,
|
|
2040
2082
|
be as ImageSelectorCancelledError,
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2083
|
+
Ct as ImageSelectorDialog,
|
|
2084
|
+
pl as ImageSelectorProvider,
|
|
2085
|
+
ct as SkyPageWindow,
|
|
2086
|
+
Zo as YcAiTaskPanel,
|
|
2087
|
+
dl as YcAiTaskProvider,
|
|
2088
|
+
Do as YcAiUseDialog,
|
|
2089
|
+
ul as YcComponent,
|
|
2090
|
+
Ct as YcImageSelectorDialog,
|
|
2091
|
+
pl as YcImageSelectorProvider,
|
|
2092
|
+
ct as YcPageWindow,
|
|
2093
|
+
Tt as closeImageSelector,
|
|
2094
|
+
el as createImageSelectorApi,
|
|
2095
|
+
ul as default,
|
|
2096
|
+
Jn as fetchImages,
|
|
2097
|
+
ht as getAiTaskConfig,
|
|
2056
2098
|
Ae as getImageSelectorConfig,
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2099
|
+
xt as hideAiDialog,
|
|
2100
|
+
wt as hideImageSelectorDialog,
|
|
2101
|
+
eo as installImageSelector,
|
|
2102
|
+
so as installYcComponent,
|
|
2103
|
+
Mo as listPrompts,
|
|
2104
|
+
cl as openAiUseDialog,
|
|
2105
|
+
It as openImageSelector,
|
|
2106
|
+
mn as setAiTaskConfig,
|
|
2107
|
+
hn as setImageSelectorConfig,
|
|
2108
|
+
We as showAiDialog,
|
|
2109
|
+
In as showImageSelectorDialog,
|
|
2110
|
+
Xn as uploadImage,
|
|
2111
|
+
fl as useAiTask,
|
|
2112
|
+
$t as useAiTaskStore,
|
|
2113
|
+
ml as useImageSelector
|
|
2072
2114
|
};
|