cnhis-design-vue 3.2.10-beta.0 → 3.2.10-beta.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/es/components/ai-chat/index.d.ts +16 -1
- package/es/components/ai-chat/src/Index.vue.d.ts +16 -1
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +3 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -23,6 +23,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
23
23
|
uiStyle: {
|
24
24
|
type: StringConstructor;
|
25
25
|
};
|
26
|
+
audioTimed: {
|
27
|
+
type: NumberConstructor;
|
28
|
+
default: number;
|
29
|
+
};
|
26
30
|
}, {
|
27
31
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
28
32
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -49,6 +53,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
49
53
|
uiStyle: {
|
50
54
|
type: StringConstructor;
|
51
55
|
};
|
56
|
+
audioTimed: {
|
57
|
+
type: NumberConstructor;
|
58
|
+
default: number;
|
59
|
+
};
|
52
60
|
}>> & {
|
53
61
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
54
62
|
}>>;
|
@@ -66,8 +74,10 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
66
74
|
emit: (event: string, ...args: any[]) => void;
|
67
75
|
shortcutList: any;
|
68
76
|
state: any;
|
69
|
-
|
77
|
+
uiStyle: any;
|
78
|
+
audioTimed: any;
|
70
79
|
content: import("vue").Ref<string>;
|
80
|
+
isSmall: import("vue").ComputedRef<boolean>;
|
71
81
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
72
82
|
recorderStart: () => Promise<void>;
|
73
83
|
recorderStop: () => Promise<void>;
|
@@ -105,9 +115,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
105
115
|
uiStyle: {
|
106
116
|
type: StringConstructor;
|
107
117
|
};
|
118
|
+
audioTimed: {
|
119
|
+
type: NumberConstructor;
|
120
|
+
default: number;
|
121
|
+
};
|
108
122
|
}>> & {
|
109
123
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
110
124
|
}, {
|
111
125
|
hideInput: boolean;
|
126
|
+
audioTimed: number;
|
112
127
|
}>>;
|
113
128
|
export default AiChat;
|
@@ -25,6 +25,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
25
25
|
uiStyle: {
|
26
26
|
type: StringConstructor;
|
27
27
|
};
|
28
|
+
audioTimed: {
|
29
|
+
type: NumberConstructor;
|
30
|
+
default: number;
|
31
|
+
};
|
28
32
|
}, {
|
29
33
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
30
34
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -51,6 +55,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
51
55
|
uiStyle: {
|
52
56
|
type: StringConstructor;
|
53
57
|
};
|
58
|
+
audioTimed: {
|
59
|
+
type: NumberConstructor;
|
60
|
+
default: number;
|
61
|
+
};
|
54
62
|
}>> & {
|
55
63
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
56
64
|
}>>;
|
@@ -68,8 +76,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
68
76
|
emit: (event: string, ...args: any[]) => void;
|
69
77
|
shortcutList: any;
|
70
78
|
state: any;
|
71
|
-
|
79
|
+
uiStyle: any;
|
80
|
+
audioTimed: any;
|
72
81
|
content: import("vue").Ref<string>;
|
82
|
+
isSmall: import("vue").ComputedRef<boolean>;
|
73
83
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
74
84
|
recorderStart: () => Promise<void>;
|
75
85
|
recorderStop: () => Promise<void>;
|
@@ -107,9 +117,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
107
117
|
uiStyle: {
|
108
118
|
type: StringConstructor;
|
109
119
|
};
|
120
|
+
audioTimed: {
|
121
|
+
type: NumberConstructor;
|
122
|
+
default: number;
|
123
|
+
};
|
110
124
|
}>> & {
|
111
125
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
112
126
|
}, {
|
113
127
|
hideInput: boolean;
|
128
|
+
audioTimed: number;
|
114
129
|
}>;
|
115
130
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as
|
1
|
+
import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as u,unref as m,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import h from"./components/ChatMain.js";import c from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as v,InjectionAIChatEmits as f}from"./types/index.js";var S=e({__name:"Index",props:{userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10}},emits:["button-click"],setup(e,{emit:S}){const j=e,k=y(),g=t({beingSent:!1,sendContent:""});return o(v,{...r(j),state:g,isSmall:s((()=>"small"===j.uiStyle))}),o(f,S),(t,o)=>(i(),a("div",{class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:u(m(k))},[p(m(h)),e.hideInput?l("v-if",!0):(i(),d(c,{key:0}))],6))}});export{S as default};
|
@@ -5,8 +5,10 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
5
5
|
emit: (event: string, ...args: any[]) => void;
|
6
6
|
shortcutList: any;
|
7
7
|
state: any;
|
8
|
-
|
8
|
+
uiStyle: any;
|
9
|
+
audioTimed: any;
|
9
10
|
content: import("vue").Ref<string>;
|
11
|
+
isSmall: import("vue").ComputedRef<boolean>;
|
10
12
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
11
13
|
recorderStart: () => Promise<void>;
|
12
14
|
recorderStop: () => Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as o,watch as l,onBeforeUnmount as i,openBlock as a,createElementBlock as s,normalizeClass as r,unref as d,Fragment as c,renderList as u,createBlock as v,withCtx as f,createTextVNode as p,toDisplayString as k,createCommentVNode as m,createElementVNode as b,createVNode as h,getCurrentInstance as w}from"vue";import{NButton as y,NInput as g,NIcon as x}from"naive-ui";import{PaperPlane as S}from"@vicons/ionicons5";import{InjectionAIChatEmits as C,InjectionAIChat as K}from"../types/index.js";import _ from"../../../audio-sdk/src/audioSDK.js";import{isString as j}from"lodash-es";const z={key:0,class:"menu-box fillet-8"},M={class:"input-wrapper fillet-10"},E=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),R={class:"btn-box"},D=["disabled"];var F=e({__name:"ChatFooter",setup(e){const F=_.create(),N=n(C),{shortcutList:T,state:U,uiStyle:B,audioTimed:J}=n(K),L=t(""),O=o((()=>"small"===B.value)),P=o((()=>!L.value.replace(/( |\s|<br>)+/g,"")));async function V(){await F.recorderStart(w(),{onStop:q,allowPunctuationMark:!1,timed:J.value||10,realTimeRecognition:!0})}async function q(){try{const e=await F.recorderStop();if("success"!==e.result)return;const{text:n}=e.data;L.value=n}catch(e){console.log(e)}}function A(e){var n,t;if(j(e))return e;return JSON.parse((null==(t=null==(n=null==e?void 0:e.contents)?void 0:n[0])?void 0:t.content)||"{}").instructionName}function G(e){["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),H()))}function H(){P.value||(U.beingSent=!0,U.sendContent=L.value,L.value="")}return l((()=>U.sendContent),(e=>{e&&!U.beingSent&&(L.value=e)})),i((()=>{F.destroy()})),(e,n)=>(a(),s("section",{class:r(["chat-footer",d(U).beingSent?"disabled":""])},[d(T)&&d(T).length>0?(a(),s("div",z,[(a(!0),s(c,null,u(d(T),(e=>(a(),v(d(y),{secondary:"",size:"small",round:d(O),key:A(e),onClick:()=>function(e){var n;if(j(e))L.value=e;else{const t=null==(n=null==e?void 0:e.contents)?void 0:n[0];N("button-click",t,e)}}(e)},{default:f((()=>[p(k(A(e)),1)])),_:2},1032,["round","onClick"])))),128))])):m("v-if",!0),b("div",M,[d(O)?(a(),v(d(g),{key:0,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:d(U).beingSent,value:L.value,"onUpdate:value":n[0]||(n[0]=e=>L.value=e),onKeydown:G},{suffix:f((()=>[h(d(y),{text:"",disabled:d(U).beingSent,onClick:V},{icon:f((()=>[h(d(x),{size:"30"},{default:f((()=>[E])),_:1})])),_:1},8,["disabled"]),h(d(y),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:d(P),onClick:H},{icon:f((()=>[h(d(x),{color:"#fff",size:"20",component:d(S)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(a(),s(c,{key:1},[h(d(g),{type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:d(U).beingSent,autosize:{minRows:2,maxRows:7},value:L.value,"onUpdate:value":n[1]||(n[1]=e=>L.value=e),onKeydown:G},null,8,["disabled","value"]),b("div",R,[b("span",{class:r(["btn-send","gradient","fillet-8",d(P)?"disabled":""]),disabled:d(P),onClick:H},[h(d(x),{color:"#fff",size:"22",component:d(S)},null,8,["component"])],10,D)])],64))])],2))}});export{F as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,computed as l,watch as
|
1
|
+
import{defineComponent as e,inject as n,ref as t,computed as l,watch as a,createVNode as s,createTextVNode as o,mergeProps as i,isVNode as r}from"vue";import{NAvatar as u,NSpin as c,NButton as d,NSpace as p,NIcon as m}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as f}from"../types/index.js";import g from"../../../../shared/assets/img/ai__avatar.png.js";import h from"../../../../shared/assets/img/logo.png.js";import{isArray as b,isFunction as y}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{ChevronForward as k}from"@vicons/ionicons5";import{useScrollLoading as x}from"../../../../shared/hooks/useScrollLoading.js";function S(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!r(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:r,slots:j,emit:C}){const E=n(v),{userAvatar:T,queryData:_,state:z,queryRecord:w,defaultShortcutList:I,hideInput:L=!1,isSmall:M}=n(f),N=t(null),O=t([]),A=t(!1),q=l((()=>M.value?h:g)),H={page:0,hasMore:!0};async function J(e=!1){if(!H.hasMore)return;H.page++,1==H.page&&(O.value=[]);const{records:n,rows:t}=await w.value({page:H.page});b(t)&&O.value.length<=+n&&(O.value=H.page>1?[...O.value,...t]:t,D(),O.value.length>=+n&&(e&&(A.value=!0),H.hasMore=!1,console.log("没有更多消息了")))}function D(){O.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function R(e){const{item:n,msgItem:t,isLink:l}=e;if(t)return E("button-click",t,n),void O.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));O.value.forEach((e=>e.buttonType&&(e.disabled=!0))),n.link||(z.beingSent=!0,z.sendContent="确定")}function B(e,n){const{contentType:t,content:l=""}=n;if("json"!==t||!function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l))return null;const a=JSON.parse(l),i=["journaling","dashboard"].includes(a.buttonType);return s("div",{class:"card"},[[s("p",null,[a.title]),i?a.fields.map((t=>s(d,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>R({item:e,msgItem:n,isLink:i})},{default:()=>t.name,icon:()=>s(m,{component:k},null)}))):[s("div",{class:"card-body"},[s("p",{class:"card-body__head"},[a.instructionName]),s("div",{class:"card-body__content"},[a.fields.map((e=>s("div",null,[s("span",{class:"label"},[e.name]),o(":"),s("span",null,[e.value])])))])]),s(d,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:n.disabled,onClick:()=>R({item:e,msgItem:n})},{default:()=>[a.buttonName]})]]])}function F(e,n){const{contents:t=[],buttonType:l=""}=e,a=B(e,t[n]);if(a)return a;return[t[n].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:s("br",null,null)])),l&&0===n?[s("br",null,null),s(d,i({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>R({item:e})}),{default:()=>[o("确定")]})]:null]}function G({role:e=""}){return"user"===e}function K(){let e;return s("div",{class:"message-item"},[s(u,{round:!0,size:M.value?64:40,src:q.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[o("Hi,我是你的AI助理")]),s("p",null,[o("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),o("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),b(I.value)&&I.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[o("你可以试着问我:")]),s(p,{"wrap-item":!1},S(e=I.value.map((e=>s(d,{size:"large",secondary:!0,onClick:()=>z.sendContent=e,disabled:z.beingSent},S(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return x(N,(()=>{J()}),L.value?"bottom":"top"),J(!0),a((()=>z.beingSent),(async e=>{var n;if(e){null==(n=N.value)||n.scrollTo({top:0,behavior:"auto"}),O.value.unshift({contents:[{role:"user",content:z.sendContent}]}),D();const e=await _.value({content:z.sendContent,contentType:"text"});b(null==e?void 0:e.contents)&&O.value.unshift(e),z.beingSent=!1,z.sendContent=""}})),()=>s("section",{class:"chat-main",ref:N,style:{"flex-direction":L.value?"column":"column-reverse"}},[[z.beingSent?s("div",{class:"message-item"},[[M.value?null:s(u,{round:!0,size:40,src:q.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(c,{size:22,stroke:"#4170EE"},null),s("span",null,[o("正在加载中,请稍等...")])])])]]):null,O.value.map((e=>e.contents.map(((n,t)=>s("div",{class:"message-item"},[[M.value?null:s(u,{round:!0,size:40,src:G(n)?T.value:q.value},null),s("div",{class:["content-box",G(n)?"mine":""]},[s("div",{class:"content"},[y(n.render)?n.render():F(e,t)])])]]))))),A.value?K():null]])}});export{j as default};
|
@@ -527,9 +527,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
527
527
|
}>;
|
528
528
|
developMode: boolean;
|
529
529
|
draggable: boolean;
|
530
|
-
isHighlightRow: boolean;
|
531
530
|
idx: number;
|
532
531
|
isHighlight: boolean;
|
532
|
+
isHighlightRow: boolean;
|
533
533
|
isFieldSet: boolean;
|
534
534
|
fieldDescribeMode: "column" | "tooltip";
|
535
535
|
hideExpressionOption: AnyObject[];
|
@@ -549,9 +549,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
549
549
|
}>;
|
550
550
|
developMode: boolean;
|
551
551
|
draggable: boolean;
|
552
|
-
isHighlightRow: boolean;
|
553
552
|
idx: number;
|
554
553
|
isHighlight: boolean;
|
554
|
+
isHighlightRow: boolean;
|
555
555
|
isFieldSet: boolean;
|
556
556
|
fieldDescribeMode: "column" | "tooltip";
|
557
557
|
hideExpressionOption: AnyObject[];
|
@@ -717,9 +717,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
717
717
|
}>;
|
718
718
|
developMode: boolean;
|
719
719
|
draggable: boolean;
|
720
|
-
isHighlightRow: boolean;
|
721
720
|
idx: number;
|
722
721
|
isHighlight: boolean;
|
722
|
+
isHighlightRow: boolean;
|
723
723
|
isFieldSet: boolean;
|
724
724
|
fieldDescribeMode: "column" | "tooltip";
|
725
725
|
hideExpressionOption: AnyObject[];
|
@@ -380,9 +380,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
380
380
|
}>;
|
381
381
|
developMode: boolean;
|
382
382
|
draggable: boolean;
|
383
|
-
isHighlightRow: boolean;
|
384
383
|
idx: number;
|
385
384
|
isHighlight: boolean;
|
385
|
+
isHighlightRow: boolean;
|
386
386
|
isFieldSet: boolean;
|
387
387
|
fieldDescribeMode: "column" | "tooltip";
|
388
388
|
hideExpressionOption: AnyObject[];
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.2.10-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.2.10-beta.1",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.10-beta.1",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "cnhis-design-vue",
|
3
|
-
"version": "3.2.10-beta.
|
3
|
+
"version": "3.2.10-beta.1",
|
4
4
|
"license": "ISC",
|
5
5
|
"module": "./es/components/index.js",
|
6
6
|
"main": "./es/components/index.js",
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"iOS 7",
|
73
73
|
"last 3 iOS versions"
|
74
74
|
],
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "9b3ff974e26fb0d1c1d41d638263e28595aa6c15"
|
76
76
|
}
|