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