cnhis-design-vue 3.3.1-beta.0 → 3.3.1-beta.2
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/src/components/ChatMainInner.js +1 -1
- package/es/components/form-config/index.d.ts +1 -1
- package/es/components/form-config/src/FormConfig.vue.d.ts +3 -4
- package/es/components/form-config/src/FormConfig.vue2.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as n,ref as t,
|
1
|
+
import{defineComponent as e,inject as n,ref as t,watch as o,createVNode as r,nextTick as s,resolveComponent as a}from"vue";import{NTooltip as l,NButton as i,NIcon as c}from"naive-ui";import{InjectionAIChat as u}from"../types/index.js";import{isArray as d,cloneDeep as m,isFunction as p}from"lodash-es";import{uuidGenerator as v}from"../../../../shared/utils/index.js";import{promiseTimeout as g}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{SyncOutline as h}from"@vicons/ionicons5";import{useScrollLoading as f}from"../../../../shared/hooks/useScrollLoading.js";import y from"./card/JsonCard.js";import{getHistoryRecordApi as x,conversationApi as T}from"../api/index.js";import{useProgram as _}from"../hooks/useProgram.js";var j=e({name:"ChatMain",inheritAttrs:!1,components:{JsonCard:y},setup(e,{attrs:y,slots:j,emit:C}){const{patientInfo:b,state:w,vaa07:M}=n(u),{programMethod:q,MedicalOrderId:I}=_(),k=t(null),O=t([]),R={page:0,hasMore:!0};async function S(){if(!M.value)return;if(!R.hasMore||!M.value)return;R.page++,1==R.page&&(O.value=[]);const e=await x({sessionId:M.value,page:R.page,pageSize:20}),{rows:n,query:t={}}=e||{};d(n)&&(n.forEach((e=>{d(e.contents)&&e.contents.length>1&&e.contents.reverse()})),O.value.length<=+t.records&&(O.value=R.page>1?[...O.value,...n]:n,O.value.length>=+t.records&&(R.hasMore=!1,console.log("没有更多消息了"))))}async function J(e){var n;d(e.contents)&&(O.value.unshift(e),await s(),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}))}function U(e,n){var t;const{contentType:o,messageType:r}=(null==(t=null==e?void 0:e.contents)?void 0:t[n])||{};return"json"===o&&"retry_inquiry"!==r}function z(e){const n=e.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,n,t)=>[e,n===t.length-1?null:r("br",null,null)]));return n.length?[n]:null}function A(e,n){var t,o,s,u,d;const{contents:m=[],msgId:p=""}=e;return"json"===(null==(t=m[n])?void 0:t.contentType)?"retry_inquiry"===(null==(o=m[n])?void 0:o.messageType)?[z((null==(u=null==(s=m[n])?void 0:s.content)?void 0:u.errorMsg)||""),r(l,{trigger:"hover"},{default:()=>"重新生成",trigger:()=>r(i,{style:"position: relative;top: 3px;margin-left: 8px",type:"primary",text:!0,onClick:()=>{var e,t,o;return o=null==(t=null==(e=m[n])?void 0:e.content)?void 0:t.audioUrl,w.params={audioUrl:o,opType:"create_inquiry"},w.sending=!0,w.loading=!0,void(w.loadingText="系统正在对您的对话内容进行梳理整合,转化为规范的结构化问诊记录")}},{icon:()=>r(c,{component:h},null)})})]:function(e,n){return r(a("json-card"),{item:e,messageItem:n},null)}(e,m[n]):z((null==(d=m[n])?void 0:d.content)||"")}function E({role:e=""}){return"user"===e}return f(k,(()=>{S()}),"top"),o((()=>M.value),(e=>{w.showRight=!1,O.value=[],R.page=0,R.hasMore=!0,S()}),{immediate:!0}),o((()=>w.reportContent),(e=>{e&&(J(e),w.reportContent=null)})),o((()=>w.sending),(async e=>{var n,t,o,r,s;if(e){const{opType:e}=w.params||{};if(!e&&w.sendContent&&O.value.unshift({msgId:v(),contents:[{role:"user",content:w.sendContent}]}),null==(n=k.value)||n.scrollTo({top:0,behavior:"auto"}),e&&["recommend_treatment_plan","recommend_diagnosis","recommend_examination"].includes(e)){if(O.value.length>0){const e=O.value.find((e=>{var n;return!E(null==(n=null==e?void 0:e.contents)?void 0:n[0])}));e&&Object.assign(w.params,m(e))}Object.assign(w.params,{contents:[{role:"user",content:"",contentType:"text"}]})}try{const n=await T({contents:[{role:"user",content:w.sendContent,contentType:"text"}],platform:"web",sessionType:"text_chat",source:"global",configs:b.value.info,...w.params});"diagnosis"===e&&(w.refreshMedical=!0),d(n.contents)&&n.contents.length>1&&n.contents.reverse(),J(n),e&&["create_inquiry","create_medical"].includes(e)&&("create_inquiry"===e?"retry_inquiry"!==(null==(o=null==(t=null==n?void 0:n.contents)?void 0:t[0])?void 0:o.messageType)&&(w.consultationContent=n,w.showRight=!0):(w.consultationContent=null,await g(1e3),w.showRight=!0,await q(I,{vac01:(null==(s=null==(r=b.value)?void 0:r.info)?void 0:s.vac01)||"1878974046080958465",type:1}))),e||(w.sendContent=""),w.params={}}catch(e){console.log("error ==>",e)}finally{w.sending=!1,w.loading=!1,w.loadingText=""}}})),()=>[r("section",{class:"chat-main",ref:k,style:"column-reverse"},[[w.loading?r("div",{class:"message-item"},[r("div",{class:"content-box"},[r("div",{class:"content loading"},[r("span",{class:"ai-chat__loading-icon"},null),r("span",null,[w.loadingText||"正在整合数据..."])])])]):null,O.value.map((e=>e.contents.map(((n,t)=>A(e,t)?r("div",{class:"message-item",key:e.msgId+t},[r("div",{class:["content-box",E(n)?"mine":""]},[r("div",{class:["content",{"content-json":!p(n.render)&&U(e,t)}]},[p(n.render)?n.render():A(e,t)])])]):null))))]])]}});export{j as default};
|
@@ -322,7 +322,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
322
322
|
extraOptions: import("vue").ComputedRef<import("./src/types").FormConfigItem[]>;
|
323
323
|
onFocus: () => Promise<void>;
|
324
324
|
useVersion: typeof import("../../shared/hooks").useVersion;
|
325
|
-
useFormConfigLocale:
|
325
|
+
useFormConfigLocale: any;
|
326
326
|
Draggable: import("vue").DefineComponent<{
|
327
327
|
list: {
|
328
328
|
type: ArrayConstructor;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { useVersion } from '../../../shared/hooks';
|
2
2
|
import { AnyFn, LowCodeTypes } from '../../../shared/types';
|
3
|
-
import { useFormConfigLocale } from '@cnhis-design-vue/components/form-config/src/hooks/useLocale';
|
4
3
|
import { PropType, Ref } from 'vue';
|
5
4
|
import { FormConfigItem, FormConfigTextFormatter, FormConfigVisitor } from '../../../components/form-config/src/types';
|
6
5
|
import { FormRenderExpose } from '../../../components/form-render';
|
@@ -325,7 +324,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
325
324
|
extraOptions: import("vue").ComputedRef<FormConfigItem[]>;
|
326
325
|
onFocus: () => Promise<void>;
|
327
326
|
useVersion: typeof useVersion;
|
328
|
-
useFormConfigLocale:
|
327
|
+
useFormConfigLocale: any;
|
329
328
|
Draggable: import("vue").DefineComponent<{
|
330
329
|
list: {
|
331
330
|
type: ArrayConstructor;
|
@@ -413,7 +412,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
413
412
|
NButton: any;
|
414
413
|
NButtonGroup: any;
|
415
414
|
NPopconfirm: any;
|
416
|
-
useFormConfigLocale: typeof useFormConfigLocale;
|
415
|
+
useFormConfigLocale: typeof import("..").useFormConfigLocale;
|
417
416
|
CFormRender: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
418
417
|
formRenderRef: Ref<FormRenderExpose | undefined>;
|
419
418
|
key: Ref<number>;
|
@@ -2697,7 +2696,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
2697
2696
|
}[]>;
|
2698
2697
|
onOptionModalCancel: () => void;
|
2699
2698
|
onOptionModalConfirm: () => void;
|
2700
|
-
useFormConfigLocale: typeof useFormConfigLocale;
|
2699
|
+
useFormConfigLocale: typeof import("..").useFormConfigLocale;
|
2701
2700
|
NModal: any;
|
2702
2701
|
NInput: any;
|
2703
2702
|
CFormRender: import("../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{}, {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,provide as o,ref as r,computed as t,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,toDisplayString as f,createVNode as u,isRef as d,withCtx as c,createBlock as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import"@vue/shared";import{uuidGenerator as j,traverse as k}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as L,NSpace as C}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{useFormConfigLocale as b}from"
|
1
|
+
import{defineComponent as e,provide as o,ref as r,computed as t,toRaw as a,openBlock as i,createElementBlock as s,mergeProps as l,unref as n,createElementVNode as m,toDisplayString as f,createVNode as u,isRef as d,withCtx as c,createBlock as p,createCommentVNode as v,createTextVNode as g}from"vue";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isArray as _,cloneDeep as y,isFunction as x}from"lodash-es";import"@vue/shared";import{uuidGenerator as j,traverse as k}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NSelect as L,NSpace as C}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{useFormConfigLocale as b}from"@cnhis-design-vue/components/form-config/src/hooks/useLocale";import V from"../../../shared/components/VueDraggable/src/vuedraggable.js";import M from"./components/FormConfigCreator.vue.js";import R from"./components/FormConfigDragDisplay.vue.js";import w from"./components/FormConfigEdit.vue.js";import D from"./components/FormConfigEventSetting.vue.js";import E from"./components/FormConfigMaterialItem.js";import{useDataNormalize as H}from"./hooks/useDataNormalize.js";import{InjectionFormConfigProps as S,InjectionFormConfigEmit as A,InjectionFieldList as I,InjectionMaterialList as U,InjectionLowCodeReactions as O,InjectionActiveFieldItem as P,FORM_CONFIG_GROUP as T}from"./constants/index.js";import{fieldItemNormalize as z}from"./utils/index.js";import{useSortableConfig as B}from"./hooks/useSortalbeConfig.js";import"./hooks/useConfigurationField.js";const N=["id"],W={class:"form-config__material"},q={class:"form-config__materialHeader"},G={class:"form-config__displayWrapper"},J={class:"form-config__displayHeader"},K={class:"form-config__config"},Q={class:"form-config__configHeader"},X={class:"form-config__configContent"};var Y=e({__name:"FormConfig",props:{maxHeight:{type:String},fieldVisitor:{type:Object},textFormatter:{type:Function},formRenderRef:{type:Object},extraMaterialList:{type:[Array,Function]},formProps:{type:Object},beforeMove:{type:Function},showLowCodeReactions:Boolean},emits:["addItem","removeItem","reactionsValidateFailure"],setup(e,{expose:Y,emit:Z}){const $=e;o(S,$),o(A,Z);const ee=j(),oe=h(),re=r([]);o(I,re);const te=r([]);o(U,te);const ae=r([]);function ie(e){re.value.some((o=>o.key===e.key))||re.value.push(e)}o(O,ae);const se=(e,o)=>x($.textFormatter)?$.textFormatter(e,o):o,le=r();o(P,le);const ne=r(),{transform:me,inverseTransform:fe}=H($),ue=t({get:()=>null,set(e){if(!e)return;const o=ce.value.find((o=>o.key===e));o&&(o.__extra=!0,z(o),te.value.push(o),Z("addItem",o))}}),de=r([]),ce=t((()=>{if(!_(de.value))return[];const e=[];return k([...te.value,...re.value],(o=>e.push(o.key))),de.value.filter((o=>!e.find((e=>e===o.key))))}));async function pe(){$.extraMaterialList&&!de.value.length&&(de.value=x($.extraMaterialList)?await $.extraMaterialList():$.extraMaterialList)}return Y({loadData({fieldList:e,lowCodeReactions:o=[]}){let r=[],t=[];e.forEach((e=>{return!1===(o=y(a(e))).show?t.push(o):r.push(o),void z(o);var o})),re.value=me(r),te.value=t,ae.value=o,le.value=void 0},validate(){var e;return null==(e=ne.value)?void 0:e.validate()},getData:(e=!1)=>({fieldList:fe(y(a(re.value)),e,{show:!0}),materialList:fe(y(a(te.value)),e,{show:!1}),lowCodeReactions:y(a(ae.value))}),clearExtraList(){de.value=[]}}),(o,r)=>(i(),s("section",l({class:"form-config",style:{"--max-height":e.maxHeight,...n(oe)},id:n(ee)},n(F)()),[m("section",W,[m("header",q,f(n(b)("materialArea")),1),u(n(V),l(B({fieldList:re,materialList:te,hooks:{beforeMove:$.beforeMove}}),{class:"form-config__materialContent",modelValue:n(te),"onUpdate:modelValue":r[0]||(r[0]=e=>d(te)?te.value=e:null)}),{item:c((({element:e})=>[u(n(E),{"form-config-item":e,"text-formatter":se,"material-List":n(te)},null,8,["form-config-item","material-List"])])),_:1},16,["modelValue"]),e.extraMaterialList?(i(),p(n(L),{key:0,class:"form-config__materialExtraList",filterable:"",value:n(ue),"onUpdate:value":r[1]||(r[1]=e=>d(ue)?ue.value=e:null),placeholder:n(b)("materialArea.createMaterialPlaceholder"),options:n(ce),"label-field":"name","value-field":"key",onFocus:pe},null,8,["value","placeholder","options"])):v("v-if",!0)]),m("section",G,[m("header",J,[g(f(n(b)("layoutArea"))+" ",1),u(n(C),null,{default:c((()=>[e.showLowCodeReactions?(i(),p(D,{key:0,modelValue:ae.value,"onUpdate:modelValue":r[2]||(r[2]=e=>ae.value=e),"bind-form-render-ref":e.formRenderRef,onValidateFailure:r[3]||(r[3]=e=>Z("reactionsValidateFailure",e))},null,8,["modelValue","bind-form-render-ref"])):v("v-if",!0),u(M,{onSubmit:ie})])),_:1})]),u(R,{class:"form-config__displayContent",group:n(T),"text-formatter":se,modelValue:n(re),"onUpdate:modelValue":r[4]||(r[4]=e=>d(re)?re.value=e:null)},null,8,["group","modelValue"])]),m("section",K,[m("header",Q,f(n(b)("configArea")),1),m("section",X,[u(w,{ref_key:"formConfigEditRef",ref:ne,uuid:n(ee),"bind-form-render-ref":e.formRenderRef,"form-props":e.formProps},null,8,["uuid","bind-form-render-ref","form-props"])])])],16,N))}});export{Y as default};
|
@@ -1 +1 @@
|
|
1
|
-
var e="@cnhis-design-vue/shared",i="3.3.1-beta.
|
1
|
+
var e="@cnhis-design-vue/shared",i="3.3.1-beta.2",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.3.1-beta.2",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.3.1-beta.
|
3
|
+
"version": "3.3.1-beta.2",
|
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": "5a9446b0c1c0b8cb9f838fb2762db06407d0f6e2"
|
76
76
|
}
|