st-comp 0.0.249 → 0.0.250

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.
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("./base-ef747d02.cjs"),q=require("./el-dialog-1b185570.cjs");require("./el-overlay-ea65cb05.cjs");const B=require("./el-button-974ff9e9.cjs"),x=require("./el-input-fa18ef84.cjs"),e=require("vue"),g=require("./dayjs.min-2c20abe6.cjs"),h=require("./index-33f80550.cjs"),T=require("./_plugin-vue_export-helper-f246444f.cjs"),k=require("./index-6ca95c8a.cjs"),V=require("./use-form-common-props-d3ed62c6.cjs");require("./index-28e03bad.cjs");require("./index-9780a537.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c80f33a4.cjs");require("./index-37b8d3c6.cjs");require("./index-eea0bcb3.cjs");require("./typescript-b63f8e83.cjs");require("./index-7dce9f59.cjs");require("./config-provider-2ae47cc8.cjs");const z=l.buildProps({size:{type:[Number,String],values:V.componentSizes,default:"",validator:s=>l.isNumber(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:V.iconPropType},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:l.definePropType(String),default:"cover"}}),A={error:s=>s instanceof Event},C=e.defineComponent({name:"ElAvatar"}),I=e.defineComponent({...C,props:z,emits:A,setup(s,{emit:_}){const c=s,a=l.useNamespace("avatar"),o=e.ref(!1),n=e.computed(()=>{const{size:t,icon:y,shape:d}=c,r=[a.b()];return l.isString(t)&&r.push(a.m(t)),y&&r.push(a.m("icon")),d&&r.push(a.m(d)),r}),p=e.computed(()=>{const{size:t}=c;return l.isNumber(t)?a.cssVarBlock({size:l.addUnit(t)||""}):void 0}),m=e.computed(()=>({objectFit:c.fit}));e.watch(()=>c.src,()=>o.value=!1);function f(t){o.value=!0,_("error",t)}return(t,y)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(n)),style:e.normalizeStyle(e.unref(p))},[(t.src||t.srcSet)&&!o.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,srcset:t.srcSet,style:e.normalizeStyle(e.unref(m)),onError:f},null,44,["src","alt","srcset"])):t.icon?(e.openBlock(),e.createBlock(e.unref(h.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))]),_:1})):e.renderSlot(t.$slots,"default",{key:2})],6))}});var H=l._export_sfc(I,[["__file","avatar.vue"]]);const $=l.withInstall(H);const j=async({appId:s,apiKey:_,value:c})=>{var a;try{const o=await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${s}/completion`,{method:"POST",headers:{Authorization:`Bearer ${_}`,"Content-Type":"application/json"},body:JSON.stringify({input:{prompt:c},parameters:{incremental_output:!1}})});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);const n=await o.json();return(a=n==null?void 0:n.output)==null?void 0:a.text}catch(o){throw o.name==="AbortError"?new Error("请求超时"):o}};const N=s=>(e.pushScopeId("data-v-3b75cb12"),s=s(),e.popScopeId(),s),P={class:"chat-container"},L={class:"avatar"},D={class:"message-content"},K={class:"message-text"},M={class:"message-time"},R={key:0,class:"message-item assistant"},F={class:"avatar"},O=N(()=>e.createElementVNode("div",{class:"message-content"},[e.createElementVNode("div",{class:"typing-indicator"},[e.createElementVNode("span"),e.createElementVNode("span"),e.createElementVNode("span")])],-1)),U={class:"input-area"},J={class:"input-actions"},G=N(()=>e.createElementVNode("div",{class:"input-hint"},[e.createElementVNode("span",null,"Ctrl + Enter 发送")],-1)),Q={__name:"index",emits:["callBack"],setup(s,{expose:_,emit:c}){const a=c,o=e.ref(!1),n=e.ref(!1),p=e.ref(!1),m=e.ref(null),f=e.ref([{role:"assistant",time:g.dayjs().format("HH:mm"),content:`你好呀!我是你的品种池AI助手,会根据您的自然语言去进行品种的条件查询
1
+ "use strict";const l=require("./base-ef747d02.cjs"),b=require("./el-dialog-1b185570.cjs");require("./el-overlay-ea65cb05.cjs");const x=require("./el-button-974ff9e9.cjs"),T=require("./el-input-fa18ef84.cjs"),e=require("vue"),E=require("./dayjs.min-2c20abe6.cjs"),g=require("./index-33f80550.cjs"),z=require("./_plugin-vue_export-helper-f246444f.cjs"),V=require("./index-6ca95c8a.cjs"),N=require("./use-form-common-props-d3ed62c6.cjs");require("./index-28e03bad.cjs");require("./index-9780a537.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c80f33a4.cjs");require("./index-37b8d3c6.cjs");require("./index-eea0bcb3.cjs");require("./typescript-b63f8e83.cjs");require("./index-7dce9f59.cjs");require("./config-provider-2ae47cc8.cjs");const C=l.buildProps({size:{type:[Number,String],values:N.componentSizes,default:"",validator:s=>l.isNumber(s)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:N.iconPropType},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:l.definePropType(String),default:"cover"}}),I={error:s=>s instanceof Event},A=e.defineComponent({name:"ElAvatar"}),H=e.defineComponent({...A,props:C,emits:I,setup(s,{emit:v}){const i=s,a=l.useNamespace("avatar"),o=e.ref(!1),n=e.computed(()=>{const{size:t,icon:p,shape:y}=i,r=[a.b()];return l.isString(t)&&r.push(a.m(t)),p&&r.push(a.m("icon")),y&&r.push(a.m(y)),r}),d=e.computed(()=>{const{size:t}=i;return l.isNumber(t)?a.cssVarBlock({size:l.addUnit(t)||""}):void 0}),_=e.computed(()=>({objectFit:i.fit}));e.watch(()=>i.src,()=>o.value=!1);function m(t){o.value=!0,v("error",t)}return(t,p)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(n)),style:e.normalizeStyle(e.unref(d))},[(t.src||t.srcSet)&&!o.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,srcset:t.srcSet,style:e.normalizeStyle(e.unref(_)),onError:m},null,44,["src","alt","srcset"])):t.icon?(e.openBlock(),e.createBlock(e.unref(g.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))]),_:1})):e.renderSlot(t.$slots,"default",{key:2})],6))}});var $=l._export_sfc(H,[["__file","avatar.vue"]]);const M=l.withInstall($);const j=async({appId:s,apiKey:v,value:i})=>{var a;try{const o=await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${s}/completion`,{method:"POST",headers:{Authorization:`Bearer ${v}`,"Content-Type":"application/json"},body:JSON.stringify({input:{prompt:i},parameters:{incremental_output:!1}})});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);const n=await o.json();return(a=n==null?void 0:n.output)==null?void 0:a.text}catch(o){throw o.name==="AbortError"?new Error("请求超时"):o}};const w=s=>(e.pushScopeId("data-v-e461ef4d"),s=s(),e.popScopeId(),s),P={class:"chat-container"},L={class:"avatar"},D={class:"message-content"},K={class:"message-text"},R={class:"message-time"},F={key:0,class:"message-item assistant"},O={class:"avatar"},U=w(()=>e.createElementVNode("div",{class:"message-content"},[e.createElementVNode("div",{class:"typing-indicator"},[e.createElementVNode("span"),e.createElementVNode("span"),e.createElementVNode("span")])],-1)),J={class:"input-area"},W={class:"input-actions"},G=w(()=>e.createElementVNode("div",{class:"input-hint"},[e.createElementVNode("span",null,"Ctrl + Enter 发送")],-1)),Q={__name:"index",props:{defaultMessage:{type:String,default:`你好呀!我是你的品种池AI助手,会根据您的自然语言去进行品种的条件查询
2
2
 
3
3
  示例:
4
- 帮我查找A股,总市值1000亿,流通股本大于等于1000万`}]),t=e.ref(""),y=async()=>{const r=t.value.trim();if(!r)return k.ElMessage.warning("请输入消息内容");if(n.value)return;f.value.push({role:"user",time:g.dayjs().format("HH:mm"),content:r}),t.value="",await d(),n.value=!0,p.value=!0;let i="{}";try{i=await j({appId:"9e54d112acfe4531bd1fc4fee8827fef",apiKey:"sk-d995eb26a4334bdeb2ccb4cbfaf51de8",value:r}),f.value.push({role:"assistant",time:g.dayjs().format("HH:mm"),content:i}),await d()}catch(v){k.ElMessage.error(`AI响应异常: ${v}`),console.error("AI响应异常:",v)}finally{n.value=!1,p.value=!1}a("callBack",JSON.parse(i))},d=async()=>{await e.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)};return e.watch(()=>f.value,()=>{d()},{deep:!0}),_({open:r=>{o.value=!0,e.nextTick(()=>{d()})}}),(r,i)=>{const v=$,E=x.ElInput,w=B.ElButton,S=q.ElDialog;return e.openBlock(),e.createBlock(S,{class:"ai-dialog",modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=u=>o.value=u),title:"✨ 品种池参数解析AI助手",width:"500px",center:"",draggable:"",overflow:"",modal:!1,"modal-penetrable":!0},{default:e.withCtx(()=>[e.createElementVNode("div",P,[e.createElementVNode("div",{ref_key:"messageListRef",ref:m,class:"message-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(u,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["message-item",u.role])},[e.createElementVNode("div",L,[e.createVNode(v,{size:32,icon:u.role==="user"?e.unref(h.user_filled_default):e.unref(h.service_default)},null,8,["icon"])]),e.createElementVNode("div",D,[e.createElementVNode("div",K,e.toDisplayString(u.content),1),e.createElementVNode("div",M,e.toDisplayString(u.time),1)])],2))),128)),p.value?(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",F,[e.createVNode(v,{size:32,icon:e.unref(h.service_default)},null,8,["icon"])]),O])):e.createCommentVNode("",!0)],512),e.createElementVNode("div",U,[e.createVNode(E,{class:"message-input",modelValue:t.value,"onUpdate:modelValue":i[0]||(i[0]=u=>t.value=u),type:"textarea",rows:4,autosize:{minRows:2,maxRows:4},placeholder:"输入您想查询的品种条件...",onKeydown:e.withKeys(e.withModifiers(y,["ctrl"]),["enter"])},null,8,["modelValue","onKeydown"]),e.createElementVNode("div",J,[G,e.createVNode(w,{class:"send-btn",type:"primary",icon:e.unref(h.promotion_default),loading:n.value,onClick:y,round:""},{default:e.withCtx(()=>[e.createTextVNode(" 发送 ")]),_:1},8,["icon","loading"])])])])]),_:1},8,["modelValue"])}}},W=T._export_sfc(Q,[["__scopeId","data-v-3b75cb12"]]),X={install(s){s.component("st-varietyAiHelper",W)}};module.exports=X;
4
+ 科创板里总市值大于1000W的, 帮我按照总市值升序进行排序`}},emits:["callBack"],setup(s,{expose:v,emit:i}){const a=i,o=s,n=e.ref(!1),d=e.ref(!1),_=e.ref(!1),m=e.ref(null),t=e.ref([]),p=e.ref(""),y=async()=>{const h=p.value.trim();if(!h)return V.ElMessage.warning("请输入消息内容");if(d.value)return;t.value.push({role:"user",time:E.dayjs().format("HH:mm"),content:h}),p.value="",await r(),d.value=!0,_.value=!0;let c="{}";try{c=await j({appId:"9e54d112acfe4531bd1fc4fee8827fef",apiKey:"sk-d995eb26a4334bdeb2ccb4cbfaf51de8",value:h}),t.value.push({role:"assistant",time:E.dayjs().format("HH:mm"),content:c}),await r()}catch(f){V.ElMessage.error(`AI响应异常: ${f}`),console.error("AI响应异常:",f)}finally{d.value=!1,_.value=!1}a("callBack",JSON.parse(c))},r=async()=>{await e.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)};return e.onMounted(()=>{t.value.push({role:"assistant",time:E.dayjs().format("HH:mm"),content:o.defaultMessage})}),e.watch(()=>t.value,()=>{r()},{deep:!0}),v({open:h=>{n.value=!0,e.nextTick(()=>{r()})}}),(h,c)=>{const f=M,k=T.ElInput,S=x.ElButton,q=b.ElDialog;return e.openBlock(),e.createBlock(q,{class:"ai-dialog",modelValue:n.value,"onUpdate:modelValue":c[1]||(c[1]=u=>n.value=u),title:"✨ 品种池参数解析AI助手",width:"500px",center:"",draggable:"",overflow:"",modal:!1,"modal-penetrable":!0},{default:e.withCtx(()=>[e.createElementVNode("div",P,[e.createElementVNode("div",{ref_key:"messageListRef",ref:m,class:"message-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(u,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["message-item",u.role])},[e.createElementVNode("div",L,[e.createVNode(f,{size:32,icon:u.role==="user"?e.unref(g.user_filled_default):e.unref(g.service_default)},null,8,["icon"])]),e.createElementVNode("div",D,[e.createElementVNode("div",K,e.toDisplayString(u.content),1),e.createElementVNode("div",R,e.toDisplayString(u.time),1)])],2))),128)),_.value?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",O,[e.createVNode(f,{size:32,icon:e.unref(g.service_default)},null,8,["icon"])]),U])):e.createCommentVNode("",!0)],512),e.createElementVNode("div",J,[e.createVNode(k,{class:"message-input",modelValue:p.value,"onUpdate:modelValue":c[0]||(c[0]=u=>p.value=u),type:"textarea",rows:4,autosize:{minRows:2,maxRows:4},placeholder:"输入您想查询的品种条件...",onKeydown:e.withKeys(e.withModifiers(y,["ctrl"]),["enter"])},null,8,["modelValue","onKeydown"]),e.createElementVNode("div",W,[G,e.createVNode(S,{class:"send-btn",type:"primary",icon:e.unref(g.promotion_default),loading:d.value,onClick:y,round:""},{default:e.withCtx(()=>[e.createTextVNode(" 发送 ")]),_:1},8,["icon","loading"])])])])]),_:1},8,["modelValue"])}}},X=z._export_sfc(Q,[["__scopeId","data-v-e461ef4d"]]),Y={install(s){s.component("st-varietyAiHelper",X)}};module.exports=Y;
@@ -1,14 +1,14 @@
1
- import { b as j, p as H, e as M, u as D, c as O, n as U, _ as F, w as J } from "./base-29f73b05.js";
2
- import { E as q } from "./el-dialog-eedcfd3e.js";
1
+ import { b as j, p as N, e as D, u as O, c as U, n as F, _ as J, w as q } from "./base-29f73b05.js";
2
+ import { E as W } from "./el-dialog-eedcfd3e.js";
3
3
  import "./el-overlay-1ee0338d.js";
4
4
  import { E as G } from "./el-button-e2c63c08.js";
5
5
  import { E as Q } from "./el-input-d47281da.js";
6
- import { defineComponent as N, ref as d, computed as S, watch as C, openBlock as p, createElementBlock as w, normalizeClass as $, unref as u, normalizeStyle as x, createBlock as k, withCtx as T, resolveDynamicComponent as W, renderSlot as X, nextTick as I, createElementVNode as t, Fragment as Y, renderList as Z, createVNode as b, toDisplayString as z, createCommentVNode as ee, withKeys as te, withModifiers as se, createTextVNode as ae, pushScopeId as oe, popScopeId as ne } from "vue";
7
- import { d as E } from "./dayjs.min-8313b006.js";
8
- import { E as re, u as ie, s as V, p as le } from "./index-c2b9bbfd.js";
9
- import { _ as ce } from "./_plugin-vue_export-helper-dad06003.js";
10
- import { E as B } from "./index-f30561d3.js";
11
- import { k as pe, i as ue } from "./use-form-common-props-cb0ca65c.js";
6
+ import { defineComponent as C, ref as f, computed as b, watch as $, openBlock as p, createElementBlock as S, normalizeClass as M, unref as u, normalizeStyle as I, createBlock as T, withCtx as x, resolveDynamicComponent as X, renderSlot as Y, onMounted as Z, nextTick as z, createElementVNode as t, Fragment as ee, renderList as te, createVNode as E, toDisplayString as V, createCommentVNode as se, withKeys as ae, withModifiers as oe, createTextVNode as ne, pushScopeId as re, popScopeId as ie } from "vue";
7
+ import { d as k } from "./dayjs.min-8313b006.js";
8
+ import { E as le, u as ce, s as B, p as pe } from "./index-c2b9bbfd.js";
9
+ import { _ as ue } from "./_plugin-vue_export-helper-dad06003.js";
10
+ import { E as H } from "./index-f30561d3.js";
11
+ import { k as de, i as me } from "./use-form-common-props-cb0ca65c.js";
12
12
  import "./index-0f79095c.js";
13
13
  import "./index-8391a3df.js";
14
14
  import "./index-de24705f.js";
@@ -21,12 +21,12 @@ import "./index-657047bb.js";
21
21
  import "./typescript-7ae59c4c.js";
22
22
  import "./index-c71e37dc.js";
23
23
  import "./config-provider-7860903c.js";
24
- const me = j({
24
+ const fe = j({
25
25
  size: {
26
26
  type: [Number, String],
27
- values: pe,
27
+ values: de,
28
28
  default: "",
29
- validator: (a) => H(a)
29
+ validator: (s) => N(s)
30
30
  },
31
31
  shape: {
32
32
  type: String,
@@ -34,7 +34,7 @@ const me = j({
34
34
  default: "circle"
35
35
  },
36
36
  icon: {
37
- type: ue
37
+ type: me
38
38
  },
39
39
  src: {
40
40
  type: String,
@@ -43,62 +43,62 @@ const me = j({
43
43
  alt: String,
44
44
  srcSet: String,
45
45
  fit: {
46
- type: M(String),
46
+ type: D(String),
47
47
  default: "cover"
48
48
  }
49
- }), de = {
50
- error: (a) => a instanceof Event
51
- }, fe = N({
49
+ }), ve = {
50
+ error: (s) => s instanceof Event
51
+ }, _e = C({
52
52
  name: "ElAvatar"
53
- }), ve = /* @__PURE__ */ N({
54
- ...fe,
55
- props: me,
56
- emits: de,
57
- setup(a, { emit: h }) {
58
- const i = a, o = D("avatar"), s = d(!1), n = S(() => {
59
- const { size: e, icon: g, shape: m } = i, r = [o.b()];
60
- return O(e) && r.push(o.m(e)), g && r.push(o.m("icon")), m && r.push(o.m(m)), r;
61
- }), f = S(() => {
53
+ }), ye = /* @__PURE__ */ C({
54
+ ..._e,
55
+ props: fe,
56
+ emits: ve,
57
+ setup(s, { emit: y }) {
58
+ const i = s, o = O("avatar"), a = f(!1), n = b(() => {
59
+ const { size: e, icon: m, shape: g } = i, r = [o.b()];
60
+ return U(e) && r.push(o.m(e)), m && r.push(o.m("icon")), g && r.push(o.m(g)), r;
61
+ }), d = b(() => {
62
62
  const { size: e } = i;
63
- return H(e) ? o.cssVarBlock({
64
- size: U(e) || ""
63
+ return N(e) ? o.cssVarBlock({
64
+ size: F(e) || ""
65
65
  }) : void 0;
66
- }), v = S(() => ({
66
+ }), h = b(() => ({
67
67
  objectFit: i.fit
68
68
  }));
69
- C(() => i.src, () => s.value = !1);
70
- function _(e) {
71
- s.value = !0, h("error", e);
69
+ $(() => i.src, () => a.value = !1);
70
+ function v(e) {
71
+ a.value = !0, y("error", e);
72
72
  }
73
- return (e, g) => (p(), w("span", {
74
- class: $(u(n)),
75
- style: x(u(f))
73
+ return (e, m) => (p(), S("span", {
74
+ class: M(u(n)),
75
+ style: I(u(d))
76
76
  }, [
77
- (e.src || e.srcSet) && !s.value ? (p(), w("img", {
77
+ (e.src || e.srcSet) && !a.value ? (p(), S("img", {
78
78
  key: 0,
79
79
  src: e.src,
80
80
  alt: e.alt,
81
81
  srcset: e.srcSet,
82
- style: x(u(v)),
83
- onError: _
84
- }, null, 44, ["src", "alt", "srcset"])) : e.icon ? (p(), k(u(re), { key: 1 }, {
85
- default: T(() => [
86
- (p(), k(W(e.icon)))
82
+ style: I(u(h)),
83
+ onError: v
84
+ }, null, 44, ["src", "alt", "srcset"])) : e.icon ? (p(), T(u(le), { key: 1 }, {
85
+ default: x(() => [
86
+ (p(), T(X(e.icon)))
87
87
  ]),
88
88
  _: 1
89
- })) : X(e.$slots, "default", { key: 2 })
89
+ })) : Y(e.$slots, "default", { key: 2 })
90
90
  ], 6));
91
91
  }
92
92
  });
93
- var _e = /* @__PURE__ */ F(ve, [["__file", "avatar.vue"]]);
94
- const ye = J(_e);
95
- const he = async ({ appId: a, apiKey: h, value: i }) => {
93
+ var he = /* @__PURE__ */ J(ye, [["__file", "avatar.vue"]]);
94
+ const ge = q(he);
95
+ const we = async ({ appId: s, apiKey: y, value: i }) => {
96
96
  var o;
97
97
  try {
98
- const s = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${a}/completion`, {
98
+ const a = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${s}/completion`, {
99
99
  method: "POST",
100
100
  headers: {
101
- Authorization: `Bearer ${h}`,
101
+ Authorization: `Bearer ${y}`,
102
102
  "Content-Type": "application/json"
103
103
  },
104
104
  body: JSON.stringify({
@@ -109,83 +109,89 @@ const he = async ({ appId: a, apiKey: h, value: i }) => {
109
109
  }
110
110
  })
111
111
  });
112
- if (!s.ok)
113
- throw new Error(`HTTP ${s.status}: ${s.statusText}`);
114
- const n = await s.json();
112
+ if (!a.ok)
113
+ throw new Error(`HTTP ${a.status}: ${a.statusText}`);
114
+ const n = await a.json();
115
115
  return (o = n == null ? void 0 : n.output) == null ? void 0 : o.text;
116
- } catch (s) {
117
- throw s.name === "AbortError" ? new Error("请求超时") : s;
116
+ } catch (a) {
117
+ throw a.name === "AbortError" ? new Error("请求超时") : a;
118
118
  }
119
119
  };
120
- const L = (a) => (oe("data-v-3b75cb12"), a = a(), ne(), a), ge = { class: "chat-container" }, we = { class: "avatar" }, be = { class: "message-content" }, Se = { class: "message-text" }, Ee = { class: "message-time" }, ke = {
120
+ const L = (s) => (re("data-v-e461ef4d"), s = s(), ie(), s), Se = { class: "chat-container" }, Ee = { class: "avatar" }, be = { class: "message-content" }, ke = { class: "message-text" }, Te = { class: "message-time" }, xe = {
121
121
  key: 0,
122
122
  class: "message-item assistant"
123
- }, Te = { class: "avatar" }, Ae = /* @__PURE__ */ L(() => /* @__PURE__ */ t("div", { class: "message-content" }, [
123
+ }, Ae = { class: "avatar" }, Ie = /* @__PURE__ */ L(() => /* @__PURE__ */ t("div", { class: "message-content" }, [
124
124
  /* @__PURE__ */ t("div", { class: "typing-indicator" }, [
125
125
  /* @__PURE__ */ t("span"),
126
126
  /* @__PURE__ */ t("span"),
127
127
  /* @__PURE__ */ t("span")
128
128
  ])
129
- ], -1)), xe = { class: "input-area" }, Ie = { class: "input-actions" }, ze = /* @__PURE__ */ L(() => /* @__PURE__ */ t("div", { class: "input-hint" }, [
129
+ ], -1)), ze = { class: "input-area" }, Ve = { class: "input-actions" }, Be = /* @__PURE__ */ L(() => /* @__PURE__ */ t("div", { class: "input-hint" }, [
130
130
  /* @__PURE__ */ t("span", null, "Ctrl + Enter 发送")
131
- ], -1)), Ve = {
131
+ ], -1)), He = {
132
132
  __name: "index",
133
- emits: ["callBack"],
134
- setup(a, { expose: h, emit: i }) {
135
- const o = i, s = d(!1), n = d(!1), f = d(!1), v = d(null), _ = d([
136
- {
137
- role: "assistant",
138
- time: E().format("HH:mm"),
139
- content: `你好呀!我是你的品种池AI助手,会根据您的自然语言去进行品种的条件查询
133
+ props: {
134
+ defaultMessage: {
135
+ type: String,
136
+ default: `你好呀!我是你的品种池AI助手,会根据您的自然语言去进行品种的条件查询
140
137
 
141
138
  示例:
142
- 帮我查找A股,总市值1000亿,流通股本大于等于1000万`
143
- }
144
- ]), e = d(""), g = async () => {
145
- const r = e.value.trim();
146
- if (!r)
147
- return B.warning("请输入消息内容");
148
- if (n.value)
139
+ 科创板里总市值大于1000W的, 帮我按照总市值升序进行排序`
140
+ }
141
+ },
142
+ emits: ["callBack"],
143
+ setup(s, { expose: y, emit: i }) {
144
+ const o = i, a = s, n = f(!1), d = f(!1), h = f(!1), v = f(null), e = f([]), m = f(""), g = async () => {
145
+ const w = m.value.trim();
146
+ if (!w)
147
+ return H.warning("请输入消息内容");
148
+ if (d.value)
149
149
  return;
150
- _.value.push({
150
+ e.value.push({
151
151
  role: "user",
152
- time: E().format("HH:mm"),
153
- content: r
154
- }), e.value = "", await m(), n.value = !0, f.value = !0;
152
+ time: k().format("HH:mm"),
153
+ content: w
154
+ }), m.value = "", await r(), d.value = !0, h.value = !0;
155
155
  let l = "{}";
156
156
  try {
157
- l = await he({ appId: "9e54d112acfe4531bd1fc4fee8827fef", apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8", value: r }), _.value.push({
157
+ l = await we({ appId: "9e54d112acfe4531bd1fc4fee8827fef", apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8", value: w }), e.value.push({
158
158
  role: "assistant",
159
- time: E().format("HH:mm"),
159
+ time: k().format("HH:mm"),
160
160
  content: l
161
- }), await m();
162
- } catch (y) {
163
- B.error(`AI响应异常: ${y}`), console.error("AI响应异常:", y);
161
+ }), await r();
162
+ } catch (_) {
163
+ H.error(`AI响应异常: ${_}`), console.error("AI响应异常:", _);
164
164
  } finally {
165
- n.value = !1, f.value = !1;
165
+ d.value = !1, h.value = !1;
166
166
  }
167
167
  o("callBack", JSON.parse(l));
168
- }, m = async () => {
169
- await I(), v.value && (v.value.scrollTop = v.value.scrollHeight);
168
+ }, r = async () => {
169
+ await z(), v.value && (v.value.scrollTop = v.value.scrollHeight);
170
170
  };
171
- return C(
172
- () => _.value,
171
+ return Z(() => {
172
+ e.value.push({
173
+ role: "assistant",
174
+ time: k().format("HH:mm"),
175
+ content: a.defaultMessage
176
+ });
177
+ }), $(
178
+ () => e.value,
173
179
  () => {
174
- m();
180
+ r();
175
181
  },
176
182
  { deep: !0 }
177
- ), h({
178
- open: (r) => {
179
- s.value = !0, I(() => {
180
- m();
183
+ ), y({
184
+ open: (w) => {
185
+ n.value = !0, z(() => {
186
+ r();
181
187
  });
182
188
  }
183
- }), (r, l) => {
184
- const y = ye, A = Q, P = G, K = q;
185
- return p(), k(K, {
189
+ }), (w, l) => {
190
+ const _ = ge, A = Q, P = G, K = W;
191
+ return p(), T(K, {
186
192
  class: "ai-dialog",
187
- modelValue: s.value,
188
- "onUpdate:modelValue": l[1] || (l[1] = (c) => s.value = c),
193
+ modelValue: n.value,
194
+ "onUpdate:modelValue": l[1] || (l[1] = (c) => n.value = c),
189
195
  title: "✨ 品种池参数解析AI助手",
190
196
  width: "500px",
191
197
  center: "",
@@ -194,61 +200,61 @@ const L = (a) => (oe("data-v-3b75cb12"), a = a(), ne(), a), ge = { class: "chat-
194
200
  modal: !1,
195
201
  "modal-penetrable": !0
196
202
  }, {
197
- default: T(() => [
198
- t("div", ge, [
203
+ default: x(() => [
204
+ t("div", Se, [
199
205
  t("div", {
200
206
  ref_key: "messageListRef",
201
207
  ref: v,
202
208
  class: "message-list"
203
209
  }, [
204
- (p(!0), w(Y, null, Z(_.value, (c, R) => (p(), w("div", {
210
+ (p(!0), S(ee, null, te(e.value, (c, R) => (p(), S("div", {
205
211
  key: R,
206
- class: $(["message-item", c.role])
212
+ class: M(["message-item", c.role])
207
213
  }, [
208
- t("div", we, [
209
- b(y, {
214
+ t("div", Ee, [
215
+ E(_, {
210
216
  size: 32,
211
- icon: c.role === "user" ? u(ie) : u(V)
217
+ icon: c.role === "user" ? u(ce) : u(B)
212
218
  }, null, 8, ["icon"])
213
219
  ]),
214
220
  t("div", be, [
215
- t("div", Se, z(c.content), 1),
216
- t("div", Ee, z(c.time), 1)
221
+ t("div", ke, V(c.content), 1),
222
+ t("div", Te, V(c.time), 1)
217
223
  ])
218
224
  ], 2))), 128)),
219
- f.value ? (p(), w("div", ke, [
220
- t("div", Te, [
221
- b(y, {
225
+ h.value ? (p(), S("div", xe, [
226
+ t("div", Ae, [
227
+ E(_, {
222
228
  size: 32,
223
- icon: u(V)
229
+ icon: u(B)
224
230
  }, null, 8, ["icon"])
225
231
  ]),
226
- Ae
227
- ])) : ee("", !0)
232
+ Ie
233
+ ])) : se("", !0)
228
234
  ], 512),
229
- t("div", xe, [
230
- b(A, {
235
+ t("div", ze, [
236
+ E(A, {
231
237
  class: "message-input",
232
- modelValue: e.value,
233
- "onUpdate:modelValue": l[0] || (l[0] = (c) => e.value = c),
238
+ modelValue: m.value,
239
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => m.value = c),
234
240
  type: "textarea",
235
241
  rows: 4,
236
242
  autosize: { minRows: 2, maxRows: 4 },
237
243
  placeholder: "输入您想查询的品种条件...",
238
- onKeydown: te(se(g, ["ctrl"]), ["enter"])
244
+ onKeydown: ae(oe(g, ["ctrl"]), ["enter"])
239
245
  }, null, 8, ["modelValue", "onKeydown"]),
240
- t("div", Ie, [
241
- ze,
242
- b(P, {
246
+ t("div", Ve, [
247
+ Be,
248
+ E(P, {
243
249
  class: "send-btn",
244
250
  type: "primary",
245
- icon: u(le),
246
- loading: n.value,
251
+ icon: u(pe),
252
+ loading: d.value,
247
253
  onClick: g,
248
254
  round: ""
249
255
  }, {
250
- default: T(() => [
251
- ae(" 发送 ")
256
+ default: x(() => [
257
+ ne(" 发送 ")
252
258
  ]),
253
259
  _: 1
254
260
  }, 8, ["icon", "loading"])
@@ -260,11 +266,11 @@ const L = (a) => (oe("data-v-3b75cb12"), a = a(), ne(), a), ge = { class: "chat-
260
266
  }, 8, ["modelValue"]);
261
267
  };
262
268
  }
263
- }, Be = /* @__PURE__ */ ce(Ve, [["__scopeId", "data-v-3b75cb12"]]), tt = {
264
- install(a) {
265
- a.component("st-varietyAiHelper", Be);
269
+ }, Ne = /* @__PURE__ */ ue(He, [["__scopeId", "data-v-e461ef4d"]]), at = {
270
+ install(s) {
271
+ s.component("st-varietyAiHelper", Ne);
266
272
  }
267
273
  };
268
274
  export {
269
- tt as default
275
+ at as default
270
276
  };