yc-component 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -122,10 +122,11 @@ function onAiFinish(data: AiTaskFinishPayload) {
122
122
  |------|------|------|
123
123
  | `title` | 弹窗标题 | `AI 生成` |
124
124
  | `freeText` | 默认需求描述 | `''` |
125
- | `promptId` | 默认选中提示词 ID | - |
126
- | `autoMatch` | 默认开启自动匹配提示词 | `false` |
125
+ | `promptId` | 提示词 ID(弹窗不展示选择器时由 props 传入) | - |
126
+ | `autoMatch` | 是否按需求自动匹配提示词 | `false`(手动指定) |
127
127
  | `prompts` | 提示词列表(传入后不请求接口) | - |
128
- | `showAutoMatch` | 是否显示自动匹配开关 | `true` |
128
+ | `showAutoMatch` | 是否显示自动匹配开关 | `false` |
129
+ | `showPromptSelect` | 是否显示提示词下拉 | `false` |
129
130
  | `autoMatchLabel` | 自动匹配区域标签 | `自动匹配提示词` |
130
131
  | `promptLabel` | 提示词字段标签 | `提示词` |
131
132
  | `freeTextLabel` | 需求描述标签 | `需求描述` |
@@ -1 +1 @@
1
- {"version":3,"file":"AiTaskProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskProvider.vue"],"names":[],"mappings":";AAKA;AAiEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAuDrE,iBAAS,cAAc;WAsCT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;6EAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"AiTaskProvider.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiTaskProvider.vue"],"names":[],"mappings":";AAKA;AAkEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAwDrE,iBAAS,cAAc;WAsCT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;6EAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as n, provide as l, computed as u, onMounted as c, onUnmounted as d, openBlock as m, createElementBlock as h, Fragment as f, createBlock as T, normalizeProps as b, mergeProps as x, createCommentVNode as A, createVNode as M, renderSlot as k } from "vue";
2
- import { createAiTaskApi as L } from "../context.js";
3
- import { AI_TASK_STORE_KEY as _, AI_TASK_INJECT_KEY as w } from "../inject.js";
4
- import { useAiTaskStore as P } from "../store/useAiTaskStore.js";
1
+ import { defineComponent as n, provide as l, computed as c, onMounted as u, onUnmounted as d, openBlock as m, createElementBlock as h, Fragment as f, createBlock as T, normalizeProps as b, mergeProps as x, createCommentVNode as A, createVNode as w, renderSlot as P } from "vue";
2
+ import { createAiTaskApi as M } from "../context.js";
3
+ import { AI_TASK_STORE_KEY as k, AI_TASK_INJECT_KEY as L } from "../inject.js";
4
+ import { useAiTaskStore as _ } from "../store/useAiTaskStore.js";
5
5
  import B from "./AiUseDialog.vue.js";
6
- import g from "./AiTaskPanel.vue.js";
6
+ import S from "./AiTaskPanel.vue.js";
7
7
  const C = /* @__PURE__ */ n({
8
8
  __name: "AiTaskProvider",
9
9
  props: {
@@ -13,6 +13,7 @@ const C = /* @__PURE__ */ n({
13
13
  autoMatch: { type: Boolean },
14
14
  prompts: {},
15
15
  showAutoMatch: { type: Boolean },
16
+ showPromptSelect: { type: Boolean },
16
17
  autoMatchLabel: {},
17
18
  promptLabel: {},
18
19
  freeTextLabel: {},
@@ -23,10 +24,10 @@ const C = /* @__PURE__ */ n({
23
24
  showDialog: { type: Boolean, default: !0 }
24
25
  },
25
26
  emits: ["finish"],
26
- setup(r, { emit: i }) {
27
- const e = r, p = i, o = P();
28
- l(_, o), l(w, L(o));
29
- const s = u(() => {
27
+ setup(a, { emit: p }) {
28
+ const e = a, s = p, o = _();
29
+ l(k, o), l(L, M(o));
30
+ const i = c(() => {
30
31
  const t = {
31
32
  title: e.title,
32
33
  freeText: e.freeText,
@@ -34,6 +35,7 @@ const C = /* @__PURE__ */ n({
34
35
  autoMatch: e.autoMatch,
35
36
  prompts: e.prompts,
36
37
  showAutoMatch: e.showAutoMatch,
38
+ showPromptSelect: e.showPromptSelect,
37
39
  autoMatchLabel: e.autoMatchLabel,
38
40
  promptLabel: e.promptLabel,
39
41
  freeTextLabel: e.freeTextLabel,
@@ -43,15 +45,15 @@ const C = /* @__PURE__ */ n({
43
45
  };
44
46
  return e.modelValue !== void 0 && (t.modelValue = e.modelValue), t;
45
47
  });
46
- let a;
47
- return c(() => {
48
- o.hydrate(), a = o.onTaskFinish((t) => p("finish", t));
48
+ let r;
49
+ return u(() => {
50
+ o.hydrate(), r = o.onTaskFinish((t) => s("finish", t));
49
51
  }), d(() => {
50
- a == null || a();
52
+ r == null || r();
51
53
  }), (t, y) => (m(), h(f, null, [
52
- r.showDialog !== !1 ? (m(), T(B, b(x({ key: 0 }, s.value)), null, 16)) : A("", !0),
53
- M(g),
54
- k(t.$slots, "default")
54
+ a.showDialog !== !1 ? (m(), T(B, b(x({ key: 0 }, i.value)), null, 16)) : A("", !0),
55
+ w(S),
56
+ P(t.$slots, "default")
55
57
  ], 64));
56
58
  }
57
59
  });
@@ -1 +1 @@
1
- .ai-use-dialog[data-v-ba49baf7] .el-overlay{z-index:4000}.ai-use-dialog[data-v-ba49baf7] .el-dialog{z-index:4001}.ai-use-dialog[data-v-ba49baf7] .el-dialog__body{padding-top:8px}
1
+ .ai-use-dialog[data-v-b4698113] .el-overlay{z-index:4000}.ai-use-dialog[data-v-b4698113] .el-dialog{z-index:4001}.ai-use-dialog[data-v-b4698113] .el-dialog__body{padding-top:8px}
@@ -11,6 +11,7 @@ declare const _default: DefineComponent<AiUseDialogProps, {}, {}, {}, {}, Compon
11
11
  freeText: string;
12
12
  autoMatch: boolean;
13
13
  showAutoMatch: boolean;
14
+ showPromptSelect: boolean;
14
15
  autoMatchLabel: string;
15
16
  promptLabel: string;
16
17
  freeTextLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AiUseDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiUseDialog.vue"],"names":[],"mappings":";AAgDA;AAgRA,OAAO,KAAK,EAAsC,gBAAgB,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;AAmcpF,wBASG"}
1
+ {"version":3,"file":"AiUseDialog.vue.d.ts","sourceRoot":"","sources":["../../../src/ai-task/components/AiUseDialog.vue"],"names":[],"mappings":";AAoDA;AA6RA,OAAO,KAAK,EAAsC,gBAAgB,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;AA+cpF,wBASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AiUseDialog.vue2.js";
2
2
  /* empty css */
3
- import a from "../../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ba49baf7"]]);
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b4698113"]]);
5
5
  export {
6
- i as default
6
+ m as default
7
7
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as $, computed as A, ref as v, watch as h, onMounted as j, onUnmounted as z, resolveComponent as m, openBlock as g, createBlock as V, withCtx as r, createVNode as p, createCommentVNode as H, createElementBlock as K, Fragment as Q, renderList as R, createTextVNode as C, toDisplayString as W } from "vue";
2
- import { ElMessage as x } from "element-plus";
3
- import { aiDialogState as s, hideAiDialog as X, AI_DIALOG_OPEN_EVENT as L } from "../dialog-state.js";
1
+ import { defineComponent as j, computed as C, ref as v, watch as h, onMounted as z, onUnmounted as H, resolveComponent as m, openBlock as b, createBlock as M, withCtx as r, createVNode as s, createCommentVNode as L, createElementBlock as K, Fragment as Q, renderList as R, createTextVNode as O, toDisplayString as W } from "vue";
2
+ import { ElMessage as w } from "element-plus";
3
+ import { aiDialogState as p, hideAiDialog as X, AI_DIALOG_OPEN_EVENT as S } from "../dialog-state.js";
4
4
  import { listPrompts as Y } from "../api/prompt.js";
5
5
  import { getAiTaskConfig as Z } from "../config.js";
6
6
  import { useScopedAiTaskStore as ee } from "../useScopedStore.js";
7
- const ie = /* @__PURE__ */ $({
7
+ const ie = /* @__PURE__ */ j({
8
8
  __name: "AiUseDialog",
9
9
  props: {
10
10
  title: { default: "AI 生成" },
@@ -12,7 +12,8 @@ const ie = /* @__PURE__ */ $({
12
12
  promptId: {},
13
13
  autoMatch: { type: Boolean, default: !1 },
14
14
  prompts: {},
15
- showAutoMatch: { type: Boolean, default: !0 },
15
+ showAutoMatch: { type: Boolean, default: !1 },
16
+ showPromptSelect: { type: Boolean, default: !1 },
16
17
  autoMatchLabel: { default: "自动匹配提示词" },
17
18
  promptLabel: { default: "提示词" },
18
19
  freeTextLabel: { default: "需求描述" },
@@ -23,168 +24,171 @@ const ie = /* @__PURE__ */ $({
23
24
  showDialog: { type: Boolean }
24
25
  },
25
26
  emits: ["update:modelValue", "submitted"],
26
- setup(d, { emit: O }) {
27
- const o = d, I = O, k = ee(), n = A(() => o.modelValue !== void 0), u = v(!1);
27
+ setup(n, { emit: B }) {
28
+ const l = n, _ = B, D = ee(), i = C(() => l.modelValue !== void 0), u = v(!1);
28
29
  h(
29
- () => o.modelValue,
30
+ () => l.modelValue,
30
31
  (e) => {
31
- n.value && (u.value = !!e);
32
+ i.value && (u.value = !!e);
32
33
  },
33
34
  { immediate: !0 }
34
35
  ), h(u, (e) => {
35
- if (n.value) {
36
- I("update:modelValue", e);
36
+ if (i.value) {
37
+ _("update:modelValue", e);
37
38
  return;
38
39
  }
39
- s.visible = e, e || X();
40
+ p.visible = e, e || X();
40
41
  }), h(
41
- () => s.visible,
42
+ () => p.visible,
42
43
  (e) => {
43
- n.value || (u.value = e);
44
+ i.value || (u.value = e);
44
45
  },
45
46
  { immediate: !0 }
46
47
  );
47
- function w(e) {
48
- if (n.value) return;
49
- const l = e.detail ?? {};
50
- M(l), u.value = !0;
48
+ function A(e) {
49
+ if (i.value) return;
50
+ const t = e.detail ?? {};
51
+ I(t), u.value = !0;
51
52
  }
52
- j(() => {
53
- globalThis.addEventListener(L, w), n.value || (u.value = s.visible);
54
- }), z(() => {
55
- globalThis.removeEventListener(L, w);
53
+ z(() => {
54
+ globalThis.addEventListener(S, A), i.value || (u.value = p.visible);
55
+ }), H(() => {
56
+ globalThis.removeEventListener(S, A);
56
57
  });
57
- const B = A(
58
- () => (n.value ? void 0 : s.options.title) ?? o.title ?? "AI 生成"
59
- ), t = v({
60
- freeText: o.freeText,
61
- promptId: o.promptId,
62
- autoMatch: o.autoMatch
63
- }), f = v(o.prompts ? [...o.prompts] : []), T = v(!1), b = v(!1), y = v();
64
- function M(e) {
65
- var l, i;
66
- t.value.freeText = e.freeText ?? o.freeText ?? "", t.value.promptId = e.promptId ?? o.promptId, t.value.autoMatch = e.autoMatch ?? o.autoMatch ?? !1, y.value = e.onFinish, (l = e.prompts) != null && l.length ? f.value = [...e.prompts] : (i = o.prompts) != null && i.length && (f.value = [...o.prompts]);
58
+ const E = C(
59
+ () => (i.value ? void 0 : p.options.title) ?? l.title ?? "AI 生成"
60
+ ), o = v({
61
+ freeText: l.freeText,
62
+ promptId: l.promptId,
63
+ autoMatch: l.autoMatch
64
+ }), f = v(l.prompts ? [...l.prompts] : []), V = v(!1), g = v(!1), P = v();
65
+ function I(e) {
66
+ var t, d;
67
+ o.value.freeText = e.freeText ?? l.freeText ?? "", o.value.promptId = e.promptId ?? l.promptId, o.value.autoMatch = e.autoMatch ?? l.autoMatch ?? !1, P.value = e.onFinish, (t = e.prompts) != null && t.length ? f.value = [...e.prompts] : (d = l.prompts) != null && d.length && (f.value = [...l.prompts]);
67
68
  }
68
- async function D() {
69
+ async function N() {
69
70
  if (!(f.value.length > 0)) {
70
- T.value = !0;
71
+ V.value = !0;
71
72
  try {
72
73
  const e = Z().listPrompts;
73
74
  f.value = e ? await e() : await Y();
74
75
  } catch {
75
- x.warning("加载提示词失败");
76
+ w.warning("加载提示词失败");
76
77
  } finally {
77
- T.value = !1;
78
+ V.value = !1;
78
79
  }
79
80
  }
80
81
  }
81
- function E() {
82
- n.value ? M({}) : M(s.options), D();
82
+ function U() {
83
+ i.value ? I({}) : I(p.options), l.showPromptSelect && N();
83
84
  }
84
85
  h(
85
- () => o.prompts,
86
+ () => l.prompts,
86
87
  (e) => {
87
88
  e != null && e.length && (f.value = [...e]);
88
89
  },
89
90
  { deep: !0 }
90
91
  ), h(
91
- () => [o.freeText, o.promptId, o.autoMatch],
92
- ([e, l, i]) => {
93
- u.value || (t.value.freeText = e ?? "", t.value.promptId = l, t.value.autoMatch = i ?? !1);
92
+ () => [l.freeText, l.promptId, l.autoMatch],
93
+ ([e, t, d]) => {
94
+ u.value || (o.value.freeText = e ?? "", o.value.promptId = t, o.value.autoMatch = d ?? !1);
94
95
  }
95
96
  );
96
- function P() {
97
- t.value.autoMatch && (t.value.promptId = void 0);
97
+ function F() {
98
+ o.value.autoMatch && (o.value.promptId = void 0);
98
99
  }
99
- function S() {
100
- b.value = !1;
100
+ function q() {
101
+ g.value = !1;
101
102
  }
102
- async function N() {
103
- var i, c;
104
- if (!t.value.freeText.trim()) {
105
- x.warning("请填写需求描述");
103
+ async function G() {
104
+ var x, T;
105
+ if (!o.value.freeText.trim()) {
106
+ w.warning("请填写需求描述");
106
107
  return;
107
108
  }
108
- if (!t.value.autoMatch && !t.value.promptId) {
109
- x.warning("请选择提示词或开启自动匹配");
109
+ const e = o.value.autoMatch, t = e ? void 0 : o.value.promptId;
110
+ if (!e && t == null) {
111
+ const y = l.showPromptSelect || l.showAutoMatch ? "请选择提示词或开启自动匹配" : "请通过 promptId 传入提示词,或设置 autoMatch 为 true";
112
+ w.warning(y);
110
113
  return;
111
114
  }
112
- b.value = !0;
113
- const e = n.value ? y.value : s.options.onFinish, l = k.enqueue({
114
- freeText: t.value.freeText.trim(),
115
- promptId: t.value.promptId,
116
- autoMatch: t.value.autoMatch && !t.value.promptId ? !0 : void 0,
115
+ g.value = !0;
116
+ const d = i.value ? P.value : p.options.onFinish, c = D.enqueue({
117
+ freeText: o.value.freeText.trim(),
118
+ promptId: t,
119
+ autoMatch: e && t == null ? !0 : void 0,
117
120
  showPanel: !0,
118
- onFinish: e
121
+ onFinish: d
119
122
  });
120
- n.value ? I("submitted", l) : (c = (i = s.options).onSubmitted) == null || c.call(i, l), u.value = !1, b.value = !1, x.success("已加入任务队列,可在任务面板查看进度");
123
+ i.value ? _("submitted", c) : (T = (x = p.options).onSubmitted) == null || T.call(x, c), u.value = !1, g.value = !1, w.success("已加入任务队列,可在任务面板查看进度");
121
124
  }
122
- return (e, l) => {
123
- const i = m("el-switch"), c = m("el-form-item"), U = m("el-option"), F = m("el-select"), q = m("el-input"), G = m("el-form"), _ = m("el-button"), J = m("el-dialog");
124
- return g(), V(J, {
125
+ return (e, t) => {
126
+ const d = m("el-switch"), c = m("el-form-item"), x = m("el-option"), T = m("el-select"), y = m("el-input"), J = m("el-form"), k = m("el-button"), $ = m("el-dialog");
127
+ return b(), M($, {
125
128
  modelValue: u.value,
126
- "onUpdate:modelValue": l[4] || (l[4] = (a) => u.value = a),
127
- title: B.value,
128
- width: d.width,
129
+ "onUpdate:modelValue": t[4] || (t[4] = (a) => u.value = a),
130
+ title: E.value,
131
+ width: n.width,
129
132
  "append-to-body": "",
130
133
  class: "ai-use-dialog",
131
- onClosed: S,
132
- onOpen: E
134
+ onClosed: q,
135
+ onOpen: U
133
136
  }, {
134
137
  footer: r(() => [
135
- p(_, {
136
- onClick: l[3] || (l[3] = (a) => u.value = !1)
138
+ s(k, {
139
+ onClick: t[3] || (t[3] = (a) => u.value = !1)
137
140
  }, {
138
- default: r(() => [...l[5] || (l[5] = [
139
- C("取消", -1)
141
+ default: r(() => [...t[5] || (t[5] = [
142
+ O("取消", -1)
140
143
  ])]),
141
144
  _: 1
142
145
  }),
143
- p(_, {
146
+ s(k, {
144
147
  type: "primary",
145
- loading: b.value,
146
- onClick: N
148
+ loading: g.value,
149
+ onClick: G
147
150
  }, {
148
151
  default: r(() => [
149
- C(W(d.submitText), 1)
152
+ O(W(n.submitText), 1)
150
153
  ]),
151
154
  _: 1
152
155
  }, 8, ["loading"])
153
156
  ]),
154
157
  default: r(() => [
155
- p(G, { "label-position": "top" }, {
158
+ s(J, { "label-position": "top" }, {
156
159
  default: r(() => [
157
- d.showAutoMatch ? (g(), V(c, {
160
+ n.showAutoMatch ? (b(), M(c, {
158
161
  key: 0,
159
- label: d.autoMatchLabel
162
+ label: n.autoMatchLabel
160
163
  }, {
161
164
  default: r(() => [
162
- p(i, {
163
- modelValue: t.value.autoMatch,
164
- "onUpdate:modelValue": l[0] || (l[0] = (a) => t.value.autoMatch = a),
165
+ s(d, {
166
+ modelValue: o.value.autoMatch,
167
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => o.value.autoMatch = a),
165
168
  "active-text": "按需求自动选",
166
169
  "inactive-text": "手动指定",
167
- onChange: P
170
+ onChange: F
168
171
  }, null, 8, ["modelValue"])
169
172
  ]),
170
173
  _: 1
171
- }, 8, ["label"])) : H("", !0),
172
- p(c, {
173
- label: d.promptLabel,
174
- required: !t.value.autoMatch
174
+ }, 8, ["label"])) : L("", !0),
175
+ n.showPromptSelect ? (b(), M(c, {
176
+ key: 1,
177
+ label: n.promptLabel,
178
+ required: !o.value.autoMatch
175
179
  }, {
176
180
  default: r(() => [
177
- p(F, {
178
- modelValue: t.value.promptId,
179
- "onUpdate:modelValue": l[1] || (l[1] = (a) => t.value.promptId = a),
181
+ s(T, {
182
+ modelValue: o.value.promptId,
183
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => o.value.promptId = a),
180
184
  filterable: "",
181
185
  clearable: "",
182
- placeholder: t.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
186
+ placeholder: o.value.autoMatch ? "留空则自动匹配" : "请选择提示词",
183
187
  style: { width: "100%" },
184
- loading: T.value
188
+ loading: V.value
185
189
  }, {
186
190
  default: r(() => [
187
- (g(!0), K(Q, null, R(f.value, (a) => (g(), V(U, {
191
+ (b(!0), K(Q, null, R(f.value, (a) => (b(), M(x, {
188
192
  key: a.id,
189
193
  label: a.name,
190
194
  value: a.id
@@ -194,18 +198,18 @@ const ie = /* @__PURE__ */ $({
194
198
  }, 8, ["modelValue", "placeholder", "loading"])
195
199
  ]),
196
200
  _: 1
197
- }, 8, ["label", "required"]),
198
- p(c, {
199
- label: d.freeTextLabel,
201
+ }, 8, ["label", "required"])) : L("", !0),
202
+ s(c, {
203
+ label: n.freeTextLabel,
200
204
  required: ""
201
205
  }, {
202
206
  default: r(() => [
203
- p(q, {
204
- modelValue: t.value.freeText,
205
- "onUpdate:modelValue": l[2] || (l[2] = (a) => t.value.freeText = a),
207
+ s(y, {
208
+ modelValue: o.value.freeText,
209
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => o.value.freeText = a),
206
210
  type: "textarea",
207
211
  rows: 4,
208
- placeholder: d.freeTextPlaceholder
212
+ placeholder: n.freeTextPlaceholder
209
213
  }, null, 8, ["modelValue", "placeholder"])
210
214
  ]),
211
215
  _: 1
@@ -1,3 +1,3 @@
1
1
  .ai-task-panel[data-v-6f781fbd]{position:fixed;right:24px;bottom:24px;width:420px;max-height:min(520px,100vh - 48px);display:flex;flex-direction:column;background:var(--el-bg-color);border-radius:12px;box-shadow:0 8px 32px #0000001f;border:1px solid var(--el-border-color-lighter);z-index:3000;overflow:hidden}.ai-task-panel__header[data-v-6f781fbd]{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 16px 12px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-panel__header-left[data-v-6f781fbd]{display:flex;gap:12px;align-items:center;min-width:0}.ai-task-panel__icon[data-v-6f781fbd]{width:44px;height:44px;border-radius:50%;background:var(--el-color-primary-light-9);color:var(--el-color-primary);display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0}.ai-task-panel__subtitle[data-v-6f781fbd]{font-size:12px;color:var(--el-text-color-secondary)}.ai-task-panel__title[data-v-6f781fbd]{font-size:18px;font-weight:700;color:var(--el-text-color-primary);line-height:1.3}.ai-task-panel__header-actions[data-v-6f781fbd]{display:flex;align-items:center;gap:4px;flex-shrink:0}.ai-task-panel__body[data-v-6f781fbd]{flex:1;overflow:auto;padding:8px 0}.ai-task-list[data-v-6f781fbd]{display:flex;flex-direction:column}.ai-task-row[data-v-6f781fbd]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--el-border-color-extra-light)}.ai-task-row[data-v-6f781fbd]:last-child{border-bottom:none}.ai-task-row__icon[data-v-6f781fbd]{width:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.ai-task-row__icon .ok[data-v-6f781fbd]{color:var(--el-color-success);font-size:28px}.ai-task-row__icon .err[data-v-6f781fbd]{color:var(--el-color-danger);font-size:28px}.ai-task-row__icon .muted[data-v-6f781fbd]{color:var(--el-text-color-secondary);font-size:24px}.ai-task-row__main[data-v-6f781fbd]{flex:1;min-width:0}.ai-task-row__title[data-v-6f781fbd]{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-task-row__meta[data-v-6f781fbd]{font-size:12px;color:var(--el-text-color-secondary);margin-top:2px}.ai-task-row__summary[data-v-6f781fbd]{font-size:12px;color:var(--el-text-color-regular);margin-top:4px;line-height:1.4}.ai-task-row__ops[data-v-6f781fbd]{flex-shrink:0;display:flex;flex-direction:column;align-items:flex-end;gap:2px}.ai-task-panel__footer[data-v-6f781fbd]{padding:8px 16px;border-top:1px solid var(--el-border-color-extra-light);text-align:center}.ai-task-panel-mini[data-v-6f781fbd]{position:fixed;right:24px;bottom:24px;z-index:3000;display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--el-bg-color);border-radius:24px;box-shadow:0 4px 16px #0000001f;border:1px solid var(--el-border-color-lighter);cursor:pointer;font-size:13px;color:var(--el-text-color-primary)}.ai-task-panel-mini[data-v-6f781fbd]:hover{border-color:var(--el-color-primary-light-5)}.spinning[data-v-6f781fbd]{animation:ai-spin-6f781fbd 1.2s linear infinite}@keyframes ai-spin-6f781fbd{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ai-panel-slide-enter-active[data-v-6f781fbd],.ai-panel-slide-leave-active[data-v-6f781fbd]{transition:all .25s ease}.ai-panel-slide-enter-from[data-v-6f781fbd],.ai-panel-slide-leave-to[data-v-6f781fbd]{opacity:0;transform:translateY(16px)}.result-pre[data-v-6f781fbd]{margin:0;max-height:420px;overflow:auto;font-size:12px;line-height:1.5;background:var(--el-fill-color-light);padding:12px;border-radius:8px;white-space:pre-wrap;word-break:break-all}.m-l-8[data-v-6f781fbd]{margin-left:8px}
2
2
 
3
- .ai-use-dialog[data-v-ba49baf7] .el-overlay{z-index:4000}.ai-use-dialog[data-v-ba49baf7] .el-dialog{z-index:4001}.ai-use-dialog[data-v-ba49baf7] .el-dialog__body{padding-top:8px}
3
+ .ai-use-dialog[data-v-b4698113] .el-overlay{z-index:4000}.ai-use-dialog[data-v-b4698113] .el-dialog{z-index:4001}.ai-use-dialog[data-v-b4698113] .el-dialog__body{padding-top:8px}
@@ -62,8 +62,10 @@ export interface AiUseDialogProps {
62
62
  * 未传则走 listPrompts 或 installYcComponent 中的 listPrompts 配置。
63
63
  */
64
64
  prompts?: AiPromptOption[];
65
- /** 是否显示「自动匹配提示词」区域,默认 true */
65
+ /** 是否显示「自动匹配提示词」开关,默认 false(由 autoMatch prop 控制) */
66
66
  showAutoMatch?: boolean;
67
+ /** 是否显示提示词下拉,默认 false(由 promptId prop 传入) */
68
+ showPromptSelect?: boolean;
67
69
  /** 自动匹配区域标签 */
68
70
  autoMatchLabel?: string;
69
71
  /** 提示词表单项标签 */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ai-task/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAA;AAErF,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,mBAAmB,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAA;AAEvF,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CA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,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,mBAAmB,CAAA;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAA;AAErE,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-component",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "天幕低代码 Vue3 组件库(AI 任务、PageWindow)",
5
5
  "type": "module",
6
6
  "sideEffects": [