cnhis-design-vue 3.2.13-beta.23 → 3.2.13-beta.24

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.
Files changed (31) hide show
  1. package/es/components/ai-chat/index.d.ts +2 -3
  2. package/es/components/ai-chat/src/Index.vue.d.ts +2 -3
  3. package/es/components/ai-chat/src/components/ChatBI.vue.d.ts +101 -0
  4. package/es/components/ai-chat/src/components/ChatBI.vue.js +1 -0
  5. package/es/components/ai-chat/src/components/ChatBI.vue2.js +1 -0
  6. package/es/components/ai-chat/src/components/ChatCard.js +1 -1
  7. package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +1 -2
  8. package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
  9. package/es/components/ai-chat/src/components/ChatMain.d.ts +1 -1
  10. package/es/components/ai-chat/src/components/ChatMain.js +1 -1
  11. package/es/components/form-config/index.d.ts +2 -0
  12. package/es/components/form-config/src/FormConfig.vue.d.ts +2 -0
  13. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  14. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +2 -0
  15. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +2 -1
  16. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  17. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  18. package/es/components/form-config/src/constants/index.d.ts +1 -0
  19. package/es/components/form-config/src/constants/index.js +1 -1
  20. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  21. package/es/components/form-config/src/types/index.d.ts +1 -0
  22. package/es/components/form-config/src/utils/index.d.ts +1 -0
  23. package/es/components/form-config/src/utils/index.js +1 -1
  24. package/es/components/form-render/src/utils/index.js +1 -1
  25. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +3 -3
  26. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  27. package/es/components/iho-table/src/types/index.d.ts +1 -0
  28. package/es/components/iho-table/style/index.css +1 -1
  29. package/es/components/index.css +1 -1
  30. package/es/shared/package.json.js +1 -1
  31. package/package.json +2 -2
@@ -104,7 +104,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
104
104
  NMessageProvider: any;
105
105
  ChatMain: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
106
106
  [x: string]: unknown;
107
- }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
107
+ }>>, () => JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
108
108
  [x: string]: unknown;
109
109
  }>>>> & {}, {
110
110
  readonly [x: number]: string;
@@ -112,7 +112,6 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
112
112
  ChatFooter: import("vue").DefineComponent<{}, {
113
113
  cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
114
114
  audioSdk: import("..").CAudioSDK;
115
- message: import("naive-ui").MessageApi;
116
115
  emit: (event: string, ...args: any[]) => void;
117
116
  shortcutList: any;
118
117
  state: any;
@@ -138,7 +137,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
138
137
  showPrompt: import("vue").Ref<boolean>;
139
138
  currentShortcutId: import("vue").Ref<string>;
140
139
  showPatient: import("vue").Ref<boolean>;
141
- btnDisabled: import("vue").ComputedRef<boolean>;
140
+ btnDisabled: import("vue").ComputedRef<any>;
142
141
  showMagicWand: import("vue").ComputedRef<boolean>;
143
142
  patient: import("vue").ComputedRef<string>;
144
143
  recorderStart: () => Promise<void>;
@@ -106,7 +106,7 @@ declare const _default: import("vue").DefineComponent<{
106
106
  NMessageProvider: any;
107
107
  ChatMain: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
108
108
  [x: string]: unknown;
109
- }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
109
+ }>>, () => JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
110
110
  [x: string]: unknown;
111
111
  }>>>> & {}, {
112
112
  readonly [x: number]: string;
@@ -114,7 +114,6 @@ declare const _default: import("vue").DefineComponent<{
114
114
  ChatFooter: import("vue").DefineComponent<{}, {
115
115
  cssVars: import("vue").ComputedRef<AnyObject>;
116
116
  audioSdk: import("../..").CAudioSDK;
117
- message: import("naive-ui").MessageApi;
118
117
  emit: (event: string, ...args: any[]) => void;
119
118
  shortcutList: any;
120
119
  state: any;
@@ -140,7 +139,7 @@ declare const _default: import("vue").DefineComponent<{
140
139
  showPrompt: import("vue").Ref<boolean>;
141
140
  currentShortcutId: import("vue").Ref<string>;
142
141
  showPatient: import("vue").Ref<boolean>;
143
- btnDisabled: import("vue").ComputedRef<boolean>;
142
+ btnDisabled: import("vue").ComputedRef<any>;
144
143
  showMagicWand: import("vue").ComputedRef<boolean>;
145
144
  patient: import("vue").ComputedRef<string>;
146
145
  recorderStart: () => Promise<void>;
@@ -0,0 +1,101 @@
1
+ import { PropType } from 'vue';
2
+ import { AnyObject } from '../../../../shared/types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ show: {
5
+ type: BooleanConstructor;
6
+ };
7
+ data: {
8
+ type: PropType<AnyObject>;
9
+ };
10
+ }, {
11
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
+ show: {
13
+ type: BooleanConstructor;
14
+ };
15
+ data: {
16
+ type: PropType<AnyObject>;
17
+ };
18
+ }>> & {
19
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
20
+ }>>;
21
+ emit: (event: string, ...args: any[]) => void;
22
+ _emit: (event: "update:show", ...args: any[]) => void;
23
+ state: any;
24
+ templateProps: import("vue").ComputedRef<{
25
+ config: any;
26
+ data: any;
27
+ }>;
28
+ handleModuleClick: (param: AnyObject) => void;
29
+ NDrawer: any;
30
+ NDrawerContent: any;
31
+ CTemplateRender: import("../../../../shared/types").SFCWithInstall<import("vue").DefineComponent<{
32
+ config: {
33
+ type: PropType<{
34
+ templateStyle?: import("vue").CSSProperties | undefined;
35
+ templates: AnyObject[];
36
+ }>;
37
+ };
38
+ data: {
39
+ default: () => {};
40
+ type: PropType<AnyObject>;
41
+ };
42
+ renders: {
43
+ type: PropType<Record<string, () => import("vue").VNodeChild>>;
44
+ };
45
+ }, {
46
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
47
+ config: {
48
+ type: PropType<{
49
+ templateStyle?: import("vue").CSSProperties | undefined;
50
+ templates: AnyObject[];
51
+ }>;
52
+ };
53
+ data: {
54
+ default: () => {};
55
+ type: PropType<AnyObject>;
56
+ };
57
+ renders: {
58
+ type: PropType<Record<string, () => import("vue").VNodeChild>>;
59
+ };
60
+ }>> & {
61
+ "onButton-click"?: ((...args: any[]) => any) | undefined;
62
+ "onModule-click"?: ((...args: any[]) => any) | undefined;
63
+ }>>;
64
+ cssVars: import("vue").ComputedRef<AnyObject>;
65
+ emit: (event: "button-click" | "module-click", ...args: any[]) => void;
66
+ style: import("vue").ComputedRef<any>;
67
+ componentsFieldList: import("vue").ComputedRef<AnyObject[]>;
68
+ getComponent: typeof import("../../../template-render/src/components").getComponent;
69
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("button-click" | "module-click")[], "button-click" | "module-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
70
+ config: {
71
+ type: PropType<{
72
+ templateStyle?: import("vue").CSSProperties | undefined;
73
+ templates: AnyObject[];
74
+ }>;
75
+ };
76
+ data: {
77
+ default: () => {};
78
+ type: PropType<AnyObject>;
79
+ };
80
+ renders: {
81
+ type: PropType<Record<string, () => import("vue").VNodeChild>>;
82
+ };
83
+ }>> & {
84
+ "onButton-click"?: ((...args: any[]) => any) | undefined;
85
+ "onModule-click"?: ((...args: any[]) => any) | undefined;
86
+ }, {
87
+ data: AnyObject;
88
+ }>>;
89
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
+ show: {
91
+ type: BooleanConstructor;
92
+ };
93
+ data: {
94
+ type: PropType<AnyObject>;
95
+ };
96
+ }>> & {
97
+ "onUpdate:show"?: ((...args: any[]) => any) | undefined;
98
+ }, {
99
+ show: boolean;
100
+ }>;
101
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./ChatBI.vue2.js";import r from"../../../../_virtual/_plugin-vue_export-helper.js";var t=r(e,[["__file","ChatBI.vue"]]);export{t as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as t,inject as e,computed as o,openBlock as n,createBlock as a,unref as s,withCtx as i,createVNode as d,mergeProps as l,createCommentVNode as r}from"vue";import{NDrawer as u,NDrawerContent as m}from"naive-ui";import{InjectionAIChatEmits as p,InjectionAIChat as c}from"../types/index.js";import"../../../index.js";import{isValidJSON as f}from"../utils/index.js";import h from"../../../template-render/index.js";var v=t({__name:"ChatBI",props:{show:{type:Boolean},data:{type:Object}},emits:["update:show"],setup(t,{emit:v}){const g=t,w=e(p),{state:j}=e(c),k=o((()=>{var t,e,o;const{content:n={}}=(null==(t=g.data)?void 0:t.msgItem)||{};return{config:f(null==(e=n.settings)?void 0:e.setting)?JSON.parse(null==(o=n.settings)?void 0:o.setting):null,data:n.data}}));function x(t){const{eventName:e,data:o}=t;v("update:show",!1),e&&w("button-click",{buttonInfo:o,isBI:!0,...g.data})}return(e,o)=>(n(),a(s(u),{placement:"bottom",height:"80%","trap-focus":!1,to:"#"+s(j).id,show:t.show,onMaskClick:o[0]||(o[0]=()=>v("update:show",!1))},{default:i((()=>[d(s(m),null,{default:i((()=>[t.data?(n(),a(s(h),l({key:0},s(k),{onModuleClick:x}),null,16)):r("v-if",!0)])),_:1})])),_:1},8,["to","show"]))}});export{v as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as n,computed as o,createVNode as l}from"vue";import{NButton as i}from"naive-ui";import{InjectionAIChat as a}from"../types/index.js";import"../../../index.js";import{isArray as s}from"lodash-es";import{isValidJSON as u}from"../utils/index.js";import r from"../../../form-render/index.js";import d from"../../../template-render/index.js";var c=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object}},emits:["button-click"],setup(e,{attrs:c,slots:m,emit:p}){const f={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATETIME-INPUT",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},{patientInfo:v,state:g,axiosInstance:b,isSmall:E}=t(a),y=n([]),T=n(),I=o((()=>{var t,n;return!!(null==(n=null==(t=e.msgItem)?void 0:t.content)?void 0:n.body)})),h=e.msgItem.content,_={};function C(e){const{eventName:t,data:n}=e;t&&p("button-click",{buttonInfo:n,isBI:!0})}function x(e){h.data[e.button.id+"Disabled"]="1",p("button-click",{buttonInfo:e.button})}function M(e){const{fieldInstance:t,context:n,value:o,fieldKey:l}=e;"REMOTE_SEARCH"===t.componentType&&(null==o?void 0:o.length)&&(_[l]=[null==n?void 0:n.currentOption])}return I.value&&(y.value=(h.body.items||[]).map((t=>{var n;const o={html_type:f[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("REMOTE_SEARCH"===o.html_type){if(o.componentProps={fallbackOption:!1},o.option=t.options||[],o.default_val=null,t.value&&s(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(o.default_val=t.value)}Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:E.value?"inner":"global",configs:v.value.info||g.selectedPatient},dependKey:[]}),s(t.dependencies)&&t.dependencies.length&&(o.urlConfig.dependKey=t.dependencies)}return o}))),()=>{var t;return l("div",{class:"card"},[I.value?[l("p",null,[h.title||h.header.title]),l(r,{"request-instance":{get:b.get,post:b.post},column:12,ref:T,"field-list":y.value,onFormChange:M},null),h.footer.buttons.map((t=>function(t){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},o=I.value?{...n,marginTop:"0"}:n;return l(i,{style:o,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){if(I.value){if(!T.value)return;const e=T.value.getFormValues();try{await T.value.validate(),h.body.items.forEach((t=>{var n;e[t.code]&&(t.value=e[t.code]),(null==(n=_[t.code])?void 0:n[0])&&(t.options=_[t.code])})),g.loading=!0,p("button-click",{values:e,buttonInfo:t,isForm:!0})}catch(e){}}else p("button-click")}},{default:()=>[I.value?null==t?void 0:t.text:h.buttonName]})}(t)))]:l(d,{config:u(null==(t=h.settings)?void 0:t.setting)?JSON.parse(h.settings.setting):null,data:h.data,"onModule-click":C,"onButton-click":x},null)])}}});export{c as default};
1
+ import{defineComponent as e,inject as t,ref as n,computed as o,createVNode as l}from"vue";import{NButton as i,NIcon as s}from"naive-ui";import{InjectionAIChat as a}from"../types/index.js";import"../../../index.js";import{isArray as r}from"lodash-es";import{isValidJSON as u}from"../utils/index.js";import{ChevronForward as c}from"@vicons/ionicons5";import{useTheme as d}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import p from"../../../form-render/index.js";import m from"../../../template-render/index.js";var f=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},selectParams:{type:Object}},emits:["button-click"],setup(e,{attrs:f,slots:v,emit:g}){const h={TEXT:"INPUT",NUMBER:"INPUT_NUMBER",DATETIME:"DATETIME-INPUT",MULTI_SELECT:"REMOTE_SEARCH",SELECT:"REMOTE_SEARCH"},b=d(),{patientInfo:y,state:E,axiosInstance:T,isSmall:k}=t(a),I=n([]),C=n(),_=o((()=>{var t,n;return!!(null==(n=null==(t=e.msgItem)?void 0:t.content)?void 0:n.body)})),x=e.msgItem.content,S={};function j(e){const{eventName:t,data:n}=e;t&&g("button-click",{buttonInfo:n,isBI:!0})}function M(e){x.data[e.button.id+"Disabled"]="1",g("button-click",{buttonInfo:e.button})}function O(e){const{fieldInstance:t,context:n,value:o,fieldKey:l}=e;"REMOTE_SEARCH"===t.componentType&&(null==o?void 0:o.length)&&(S[l]=[null==n?void 0:n.currentOption])}function R(){g("button-click",{showMore:!0})}function N(){var e;if("1834043761964638208"!==(null==(e=x.settings)?void 0:e.id)||!x.data)return null;const t=JSON.parse(x.settings.setting),n=e=>{var t;let o="";for(let l=0;l<e.length;l++){const i=e[l];if(i.setting.scopeKey){o=i.setting.scopeKey;break}if((null==(t=i.childrens)?void 0:t.length)&&(o=n(i.childrens),o))break}return o},o=n(t.templates);return!o||!r(x.data[o])||x.data[o].length<=5?null:l(i,{block:!0,text:!0,"icon-placement":"right",color:b.value["--c-primary-color"],style:"margin-top: 10px",onClick:R},{icon:()=>l(s,{component:c},null),default:()=>"查看更多"})}return _.value&&(I.value=(x.body.items||[]).map((t=>{var n;const o={html_type:h[t.type]||t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1",is_edit:e.msgItem.disabled?"0":"1",componentProps:{},multi_select:"MULTI_SELECT"===t.type?"0":"1"};if("REMOTE_SEARCH"===o.html_type){if(o.componentProps={fallbackOption:!1},o.option=t.options||[],o.default_val=null,t.value&&r(t.options)&&t.options.length>0){t.options.find((e=>(null==e?void 0:e.value)===t.value))&&(o.default_val=t.value)}Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{...e.selectParams,code:t.code,source:k.value?"inner":"global",configs:y.value.info||E.selectedPatient},dependKey:[]}),r(t.dependencies)&&t.dependencies.length&&(o.urlConfig.dependKey=t.dependencies)}return o}))),()=>{var t;return l("div",{class:"card"},[_.value?[l("p",null,[x.title||x.header.title]),l(p,{"request-instance":{get:T.get,post:T.post},column:12,ref:C,"field-list":I.value,onFormChange:O},null),x.footer.buttons.map((t=>function(t){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},o=_.value?{...n,marginTop:"0"}:n;return l(i,{style:o,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){if(_.value){if(!C.value)return;const e=C.value.getFormValues();try{await C.value.validate(),x.body.items.forEach((t=>{var n;e[t.code]&&(t.value=e[t.code]),(null==(n=S[t.code])?void 0:n[0])&&(t.options=S[t.code])})),E.loading=!0,g("button-click",{values:e,buttonInfo:t,isForm:!0})}catch(e){}}else g("button-click")}},{default:()=>[_.value?null==t?void 0:t.text:x.buttonName]})}(t)))]:[l(m,{config:u(null==(t=x.settings)?void 0:t.setting)?JSON.parse(x.settings.setting):null,data:x.data,"onModule-click":j,"onButton-click":M},null),N()]])}}});export{f as default};
@@ -4,7 +4,6 @@ import { AnyObject } from '../../../../shared/types';
4
4
  declare const _default: import("vue").DefineComponent<{}, {
5
5
  cssVars: import("vue").ComputedRef<AnyObject>;
6
6
  audioSdk: CAudioSDK;
7
- message: import("naive-ui").MessageApi;
8
7
  emit: (event: string, ...args: any[]) => void;
9
8
  shortcutList: any;
10
9
  state: any;
@@ -30,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{}, {
30
29
  showPrompt: import("vue").Ref<boolean>;
31
30
  currentShortcutId: import("vue").Ref<string>;
32
31
  showPatient: import("vue").Ref<boolean>;
33
- btnDisabled: import("vue").ComputedRef<boolean>;
32
+ btnDisabled: import("vue").ComputedRef<any>;
34
33
  showMagicWand: import("vue").ComputedRef<boolean>;
35
34
  patient: import("vue").ComputedRef<string>;
36
35
  recorderStart: () => Promise<void>;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as o,computed as n,onBeforeUnmount as l,openBlock as s,createElementBlock as a,normalizeClass as r,unref as i,createElementVNode as u,createBlock as d,withCtx as c,createVNode as v,createTextVNode as m,toDisplayString as p,createCommentVNode as h,Fragment as f,renderList as k,withModifiers as C,getCurrentInstance as y}from"vue";import{useMessage as w,NButton as g,NIcon as b,NPopover as x,NInput as _,NTag as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{PeopleOutline as T,SparklesSharp as P,PaperPlane as D,ChevronBack as K,ChevronForward as M}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as U}from"../types/index.js";import R from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as E,last as L}from"lodash-es";import{useTheme as W}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import B from"./ChatPrompt.vue.js";import F from"./ChatPatient.vue.js";const N={class:"menu-box fillet-8"},q={class:"input-wrapper fillet-10"},H=u("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),u("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"}),u("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),u("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),V={class:"btn-box"},G=["disabled"],J={class:"command-box"},O={class:"command-box__header"},Q={key:0,class:"title"},X={class:"command-box__menu"},Y=["onMouseover","onClick"],Z={class:"label"},$={class:"remark"};var ee=e({__name:"ChatFooter",setup(e){const ee=W(),te=R.create(),oe=w(),ne=t(S),{shortcutList:le,state:se,isSmall:ae,audioTimed:re,commandList:ie}=t(U),ue=o(),de=o(!1),ce=o([]),ve=o(A(ie.value||[])),me=o(!1),pe=o(""),he=o(!1),fe=n((()=>!se.sendContent.replace(/(&nbsp;|\s|<br>)+/g,""))),ke=n((()=>{var e;return!se.sendContent&&!(null==(e=ue.value)?void 0:e.activated.value)})),Ce=n((()=>{if(!se.selectedPatient)return"选择患者";const{bcq04b:e,vaa05:t}=se.selectedPatient;let o="";e&&(o+=e+"床");return t&&(o+=(!o||o.endsWith("/")?"":"/")+t),o}));async function ye(){try{const e=await te.start(y(),{allowPunctuationMark:!1,timed:re.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;se.sendContent=t}catch(e){console.log(e)}}function we(e){var t;if(E(e))return e;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return o.instructionName}function ge(){var e;de.value=!1,ve.value=A(ie.value||[]),ce.value=[],(null==(e=ie.value)?void 0:e.length)&&(de.value=!0,pe.value=ve.value[0].shortcutId)}function be(e){if(!["Slash","NumpadDivide"].includes(e.code)||se.selectedCommand||se.sendContent)if("Backspace"===e.key)de.value=!1,!se.sendContent.startsWith("/")&&!se.sendContent.startsWith("、")||2!==se.sendContent.length||se.selectedCommand?!se.sendContent&&se.selectedCommand&&(e.preventDefault(),se.selectedCommand=null,se.sendContent="/",ge()):ge();else if(de.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=ve.value.findIndex((e=>e.shortcutId===pe.value));if("ArrowUp"===e.key){const e=t>0?t-1:ve.value.length-1;pe.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<ve.value.length-1?t+1:0;pe.value=ve.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),de.value){Ie(ve.value.find((e=>e.shortcutId===pe.value)))}else _e()}else de.value=!1;else ge()}function xe(e){!e&&se.selectedPrompt&&(se.selectedPrompt=null)}function _e(){fe.value||(ae.value||se.selectedPatient?(se.sending=!0,se.loading=!0):oe.warning("请先选择患者!"))}function Ie(e){var t;pe.value=e.shortcutId,ue.value.focus(),(null==(t=e.children)?void 0:t.length)?(ve.value=e.children,pe.value=ve.value[0].shortcutId,ce.value.push(e)):(se.selectedCommand=e||{},de.value=!1,se.sendContent="")}function je(){var e;ce.value.pop(),ve.value=L(ce.value)?null==(e=L(ce.value))?void 0:e.children:A(ie.value||[]),pe.value=ve.value[0].shortcutId,ue.value.focus()}return l((()=>{te.destroy()})),(e,t)=>(s(),a("section",{class:r(["chat-footer",i(se).loading?"disabled":""])},[u("div",N,[i(ae)?h("v-if",!0):(s(),d(i(g),{key:0,secondary:"",size:"small",onClick:t[0]||(t[0]=()=>he.value=!0)},{icon:c((()=>[v(i(b),{color:i(ee)["--c-primary-color"],size:"20",component:i(T)},null,8,["color","component"])])),default:c((()=>[m(" "+p(i(Ce)),1)])),_:1})),i(le)&&i(le).length>0?(s(!0),a(f,{key:1},k(i(le),(e=>(s(),d(i(g),{secondary:"",size:"small",round:i(ae),key:we(e),onClick:()=>function(e){var t;if(E(e))se.sendContent=e;else{const o=null==(t=null==e?void 0:e.contents)?void 0:t[0];ne("button-click",{msgItem:o,item:e})}}(e)},{default:c((()=>[m(p(we(e)),1)])),_:2},1032,["round","onClick"])))),128)):h("v-if",!0)]),v(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:de.value,onClickoutside:t[5]||(t[5]=e=>de.value=!1)},{trigger:c((()=>[u("div",q,[i(ae)?(s(),d(i(_),{key:0,ref_key:"inputRef",ref:ue,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(se).loading,value:i(se).sendContent,"onUpdate:value":t[2]||(t[2]=e=>i(se).sendContent=e),onKeydownCapture:be,onInput:xe},{prefix:c((()=>[i(se).selectedCommand&&i(se).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:c((()=>[m(" /"+p(i(se).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(ke)?(s(),d(i(g),{key:1,text:"",onClick:t[1]||(t[1]=()=>me.value=!0)},{default:c((()=>[v(i(b),{color:"#8f66f7",size:"18",component:i(P)},null,8,["component"])])),_:1})):h("v-if",!0)])),suffix:c((()=>[v(i(g),{text:"",disabled:i(se).loading,onClick:ye},{icon:c((()=>[v(i(b),{size:"30"},{default:c((()=>[H])),_:1})])),_:1},8,["disabled"]),v(i(g),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(fe),onClick:_e},{icon:c((()=>[v(i(b),{color:"#fff",size:"20",component:i(D)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),a(f,{key:1},[v(i(_),{ref_key:"inputRef",ref:ue,type:"textarea",placeholder:'请向我提问或输入"/"查看指令,Shift+Enter换行',disabled:i(se).loading,autosize:{minRows:2,maxRows:7},value:i(se).sendContent,"onUpdate:value":t[4]||(t[4]=e=>i(se).sendContent=e),onKeydownCapture:be,onInput:xe},{prefix:c((()=>[i(se).selectedCommand&&i(se).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:c((()=>{var e;return[m(" /"+p(null==(e=i(se).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(ke)?(s(),d(i(g),{key:1,text:"",onClick:t[3]||(t[3]=()=>me.value=!0)},{default:c((()=>[v(i(b),{color:"#8f66f7",size:"18",component:i(P)},null,8,["component"])])),_:1})):h("v-if",!0)])),_:1},8,["disabled","value"]),u("div",V,[u("span",{class:r(["btn-send","gradient","fillet-8",i(fe)?"disabled":""]),disabled:i(fe),onClick:_e},[v(i(b),{color:"#fff",size:"22",component:i(D)},null,8,["component"])],10,G)])],64))])])),default:c((()=>[u("div",J,[u("div",O,[0===ce.value.length?(s(),a("span",Q,"推荐指令")):(s(),a(f,{key:1},[v(i(g),{text:"",onClick:je},{default:c((()=>[v(i(b),{color:"#999",size:"20",component:i(K)},null,8,["component"])])),_:1}),v(i(j),null,{default:c((()=>[(s(!0),a(f,null,k(ce.value,(e=>(s(),d(i(z),{key:e.shortcutId},{default:c((()=>[m(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),u("div",X,[(s(!0),a(f,null,k(ve.value,(e=>(s(),a("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",pe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>pe.value=e.shortcutId),["stop"]),onClick:()=>Ie(e)},[u("span",Z,p(e.shortcutTitle),1),u("span",$,p(e.shortcutDescription),1),e.children&&e.children.length?(s(),d(i(b),{key:0,color:"#999",size:"20",component:i(M)},null,8,["component"])):h("v-if",!0)],42,Y)))),128))])])])),_:1},8,["show"]),v(B,{show:me.value,"onUpdate:show":t[6]||(t[6]=e=>me.value=e)},null,8,["show"]),v(F,{show:he.value,"onUpdate:show":t[7]||(t[7]=e=>he.value=e)},null,8,["show"])],2))}});export{ee as default};
1
+ import{defineComponent as e,inject as t,ref as o,computed as n,onBeforeUnmount as l,openBlock as s,createElementBlock as a,normalizeClass as r,unref as i,createElementVNode as d,createBlock as u,withCtx as c,createVNode as v,createTextVNode as m,toDisplayString as p,createCommentVNode as h,Fragment as f,renderList as k,withModifiers as C,getCurrentInstance as y}from"vue";import{NButton as w,NIcon as g,NPopover as b,NInput as x,NTag as _,NBreadcrumb as I,NBreadcrumbItem as j}from"naive-ui";import{PeopleOutline as z,SparklesSharp as T,PaperPlane as D,ChevronBack as K,ChevronForward as M}from"@vicons/ionicons5";import{InjectionAIChatEmits as P,InjectionAIChat as S}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as R,isString as A,last as E}from"lodash-es";import{useTheme as L}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import W from"./ChatPrompt.vue.js";import B from"./ChatPatient.vue.js";const F={class:"menu-box fillet-8"},N={class:"input-wrapper fillet-10"},q=d("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),d("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"}),d("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),d("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),H={class:"btn-box"},V=["disabled"],G={class:"command-box"},J={class:"command-box__header"},O={key:0,class:"title"},Q={class:"command-box__menu"},X=["onMouseover","onClick"],Y={class:"label"},Z={class:"remark"};var $=e({__name:"ChatFooter",setup(e){const $=L(),ee=U.create(),te=t(P),{shortcutList:oe,state:ne,isSmall:le,audioTimed:se,commandList:ae}=t(S),re=o(),ie=o(!1),de=o([]),ue=o(R(ae.value||[])),ce=o(!1),ve=o(""),me=o(!1),pe=n((()=>ne.loading||!ne.sendContent.replace(/(&nbsp;|\s|<br>)+/g,""))),he=n((()=>{var e;return!ne.sendContent&&!(null==(e=re.value)?void 0:e.activated.value)})),fe=n((()=>{if(!ne.selectedPatient)return"选择患者";const{bcq04b:e,vaa05:t}=ne.selectedPatient;let o="";e&&(o+=e+"床");return t&&(o+=(!o||o.endsWith("/")?"":"/")+t),o}));async function ke(){try{const e=await ee.start(y(),{allowPunctuationMark:!1,timed:se.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;ne.sendContent=t}catch(e){console.log(e)}}function Ce(e){var t;if(A(e))return e;const{content:o}=(null==(t=null==e?void 0:e.contents)?void 0:t[0])||{};return o.instructionName}function ye(){var e;ie.value=!1,ue.value=R(ae.value||[]),de.value=[],(null==(e=ae.value)?void 0:e.length)&&(ie.value=!0,ve.value=ue.value[0].shortcutId)}function we(e){if(!["Slash","NumpadDivide"].includes(e.code)||ne.selectedCommand||ne.sendContent)if("Backspace"===e.key)ie.value=!1,!ne.sendContent.startsWith("/")&&!ne.sendContent.startsWith("、")||2!==ne.sendContent.length||ne.selectedCommand?!ne.sendContent&&ne.selectedCommand&&(e.preventDefault(),ne.selectedCommand=null,ne.sendContent="/",ye()):ye();else if(ie.value&&["ArrowUp","ArrowDown"].includes(e.key)){const t=ue.value.findIndex((e=>e.shortcutId===ve.value));if("ArrowUp"===e.key){const e=t>0?t-1:ue.value.length-1;ve.value=ue.value[e].shortcutId}else if("ArrowDown"===e.key){const e=t<ue.value.length-1?t+1:0;ve.value=ue.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),ie.value){xe(ue.value.find((e=>e.shortcutId===ve.value)))}else be()}else ie.value=!1;else ye()}function ge(e){!e&&ne.selectedPrompt&&(ne.selectedPrompt=null)}function be(){pe.value||(ne.sending=!0,ne.loading=!0)}function xe(e){var t;ve.value=e.shortcutId,re.value.focus(),(null==(t=e.children)?void 0:t.length)?(ue.value=e.children,ve.value=ue.value[0].shortcutId,de.value.push(e)):(ne.selectedCommand=e||{},ie.value=!1,ne.sendContent="")}function _e(){var e;de.value.pop(),ue.value=E(de.value)?null==(e=E(de.value))?void 0:e.children:R(ae.value||[]),ve.value=ue.value[0].shortcutId,re.value.focus()}return l((()=>{ee.destroy()})),(e,t)=>(s(),a("section",{class:r(["chat-footer",i(ne).loading?"disabled":""])},[d("div",F,[i(le)?h("v-if",!0):(s(),u(i(w),{key:0,secondary:"",size:"small",onClick:t[0]||(t[0]=()=>me.value=!0)},{icon:c((()=>[v(i(g),{color:i($)["--c-primary-color"],size:"20",component:i(z)},null,8,["color","component"])])),default:c((()=>[m(" "+p(i(fe)),1)])),_:1})),i(oe)&&i(oe).length>0?(s(!0),a(f,{key:1},k(i(oe),(e=>(s(),u(i(w),{secondary:"",size:"small",round:i(le),key:Ce(e),onClick:()=>function(e){var t;if(A(e))ne.sendContent=e;else{const o=null==(t=null==e?void 0:e.contents)?void 0:t[0];te("button-click",{msgItem:o,item:e})}}(e)},{default:c((()=>[m(p(Ce(e)),1)])),_:2},1032,["round","onClick"])))),128)):h("v-if",!0)]),v(i(b),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ie.value,onClickoutside:t[5]||(t[5]=e=>ie.value=!1)},{trigger:c((()=>[d("div",N,[i(le)?(s(),u(i(x),{key:0,ref_key:"inputRef",ref:re,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(ne).loading,value:i(ne).sendContent,"onUpdate:value":t[2]||(t[2]=e=>i(ne).sendContent=e),onKeydownCapture:we,onInput:ge},{prefix:c((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),u(i(_),{key:0,bordered:!1,color:{textColor:i($)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:c((()=>[m(" /"+p(i(ne).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(he)?(s(),u(i(w),{key:1,text:"",onClick:t[1]||(t[1]=()=>ce.value=!0)},{default:c((()=>[v(i(g),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):h("v-if",!0)])),suffix:c((()=>[v(i(w),{text:"",disabled:i(ne).loading,onClick:ke},{icon:c((()=>[v(i(g),{size:"30"},{default:c((()=>[q])),_:1})])),_:1},8,["disabled"]),v(i(w),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(pe),onClick:be},{icon:c((()=>[v(i(g),{color:"#fff",size:"20",component:i(D)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),a(f,{key:1},[v(i(x),{ref_key:"inputRef",ref:re,type:"textarea",placeholder:'请向我提问或输入"/"查看指令,Shift+Enter换行',disabled:i(ne).loading,autosize:{minRows:2,maxRows:7},value:i(ne).sendContent,"onUpdate:value":t[4]||(t[4]=e=>i(ne).sendContent=e),onKeydownCapture:we,onInput:ge},{prefix:c((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),u(i(_),{key:0,bordered:!1,color:{textColor:i($)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:c((()=>{var e;return[m(" /"+p(null==(e=i(ne).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(he)?(s(),u(i(w),{key:1,text:"",onClick:t[3]||(t[3]=()=>ce.value=!0)},{default:c((()=>[v(i(g),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):h("v-if",!0)])),_:1},8,["disabled","value"]),d("div",H,[d("span",{class:r(["btn-send","gradient","fillet-8",i(pe)?"disabled":""]),disabled:i(pe),onClick:be},[v(i(g),{color:"#fff",size:"22",component:i(D)},null,8,["component"])],10,V)])],64))])])),default:c((()=>[d("div",G,[d("div",J,[0===de.value.length?(s(),a("span",O,"推荐指令")):(s(),a(f,{key:1},[v(i(w),{text:"",onClick:_e},{default:c((()=>[v(i(g),{color:"#999",size:"20",component:i(K)},null,8,["component"])])),_:1}),v(i(I),null,{default:c((()=>[(s(!0),a(f,null,k(de.value,(e=>(s(),u(i(j),{key:e.shortcutId},{default:c((()=>[m(p(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),d("div",Q,[(s(!0),a(f,null,k(ue.value,(e=>(s(),a("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",ve.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:C((()=>ve.value=e.shortcutId),["stop"]),onClick:()=>xe(e)},[d("span",Y,p(e.shortcutTitle),1),d("span",Z,p(e.shortcutDescription),1),e.children&&e.children.length?(s(),u(i(g),{key:0,color:"#999",size:"20",component:i(M)},null,8,["component"])):h("v-if",!0)],42,X)))),128))])])])),_:1},8,["show"]),v(W,{show:ce.value,"onUpdate:show":t[6]||(t[6]=e=>ce.value=e)},null,8,["show"]),v(B,{show:me.value,"onUpdate:show":t[7]||(t[7]=e=>me.value=e)},null,8,["show"])],2))}});export{$ as default};
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<Readonly<import("vue").ComponentPropsOptions<{
2
2
  [x: string]: unknown;
3
- }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
3
+ }>>, () => JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<readonly string[] | import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
4
4
  [x: string]: unknown;
5
5
  }>>>> & {}, {
6
6
  readonly [x: number]: string;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as s,createVNode as a,createTextVNode as i,isVNode as r}from"vue";import{NAvatar as u,NSpin as c,NSpace as d,NButton as m}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as p}from"../types/index.js";import f from"../../../../shared/assets/img/ai__avatar.png.js";import g from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as b}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"@vicons/ionicons5";import{useScrollLoading as y}from"../../../../shared/hooks/useScrollLoading.js";import C from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";function x(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!r(e)}var k=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:r,slots:k,emit:I}){const T=t(v),{userAvatar:E,queryData:S,state:w,queryRecord:z,defaultShortcutList:D,hideInput:L=!1,isSmall:M}=t(p),O=n(null),P=n([]),A=n(!1),q=l((()=>M.value?g:f)),B={page:0,hasMore:!0};async function H(e=!1){if(!B.hasMore)return;B.page++,1==B.page&&(P.value=[]);const{records:t,rows:n}=await z.value({page:B.page});h(n)&&P.value.length<=+t&&(P.value=B.page>1?[...P.value,...n]:n,R(),P.value.length>=+t&&(e&&(A.value=!0),B.hasMore=!1,console.log("没有更多消息了")))}function N(e,t,n){if(e.type!==t){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)N(e.childrens[l],t,n)}else n.push(e)}function R(){P.value.forEach((e=>{e.contents.forEach((e=>{var t;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:n,data:l,needConfirms:o}=e.content;if(o||!(null==n?void 0:n.setting)||!j(null==n?void 0:n.setting)||!(null==(t=null==l?void 0:l.buttonList)?void 0:t.length))return;const{templates:s=[]}=JSON.parse(n.setting),a=[];s.forEach((e=>{N(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:t}=e.setting;t.forEach((e=>{var t;const{conditions:n=[]}=(null==(t=null==e?void 0:e.advancedConfig)?void 0:t.disabled)||{};n.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function _(e,t){const{contentType:n,content:l}=t;return"json"===n&&l?a(C,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:t,"onButton-click":(n={})=>function(e){const{item:t,msgItem:n}=e;if(n)return T("button-click",e),void(n.disabled=!0);t.link||(w.sendContent="确定",w.sending=!0,w.loading=!0)}({item:e,msgItem:t,...n})},null):null}function J(e,t){const{contents:n=[],buttonType:l=""}=e,o=_(e,n[t]);if(o)return o;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:a("br",null,null)]))]}function U({role:e=""}){return"user"===e}function F(){let e;return a("div",{class:"message-item"},[a(u,{round:!0,size:M.value?64:40,src:q.value},null),a("div",{class:"content-box"},[a("div",{class:"content fillet-10 default"},[a("h2",null,[i("Hi,我是你的AI助理")]),a("p",null,[i("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),a("br",null,null),i("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(D.value)&&D.value.length>0?[a("p",{style:"margin: 5px 0 5px"},[i("你可以试着问我:")]),a(d,{"wrap-item":!1},x(e=D.value.map((e=>a(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.loading},x(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return y(O,(()=>{H()}),L.value?"bottom":"top"),H(!0),o((()=>w.externalData),(e=>{var t,n;e&&(t=e,P.value.unshift(t),null==(n=O.value)||n.scrollTo({top:0,behavior:"auto"}),w.loading=!1,w.externalData=null)})),o((()=>w.sending),(async e=>{var t,n;if(e){P.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=O.value)||t.scrollTo({top:0,behavior:"auto"}),R();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null,w.selectedPrompt=null;const o=await S.value({content:w.sendContent,contentType:"text",command:e,prompt:l,patient:w.selectedPatient});h(null==o?void 0:o.contents)&&(P.value.unshift(o),await s(),null==(n=O.value)||n.scrollTo({top:0,behavior:"auto"})),w.sending=!1,w.loading=!1,w.sendContent=""}})),()=>a("section",{class:"chat-main",ref:O,style:{"flex-direction":L.value?"column":"column-reverse"}},[[w.loading?a("div",{class:"message-item"},[[M.value?null:a(u,{round:!0,size:40,src:q.value},null),a("div",{class:"content-box"},[a("div",{class:"content loading"},[a(c,{size:22,stroke:"#4170EE"},null),a("span",null,[i("正在加载中,请稍等...")])])])]]):null,P.value.map((e=>e.contents.map(((t,n)=>a("div",{class:"message-item"},[[M.value?null:a(u,{round:!0,size:40,src:U(t)?E.value:q.value},null),a("div",{class:["content-box",U(t)?"mine":""]},[a("div",{class:"content"},[b(t.render)?t.render():J(e,n)])])]]))))),A.value?F():null]])}});export{k as default};
1
+ import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as s,createVNode as a,createTextVNode as i,isVNode as r}from"vue";import{NAvatar as u,NSpin as c,NSpace as d,NButton as m}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as p}from"../types/index.js";import f from"../../../../shared/assets/img/ai__avatar.png.js";import h from"../../../../shared/assets/img/logo.png.js";import{isArray as g,isFunction as b}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"@vicons/ionicons5";import{useScrollLoading as y}from"../../../../shared/hooks/useScrollLoading.js";import C from"./ChatCard.js";import{isValidJSON as j}from"../utils/index.js";import x from"./ChatBI.vue.js";function I(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!r(e)}var k=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:r,slots:k,emit:T}){const w=t(v),{userAvatar:E,queryData:S,state:z,queryRecord:M,defaultShortcutList:D,hideInput:L=!1,isSmall:O}=t(p),P=n(null),A=n([]),B=n(!1),q=n(!1),H=n(),N=l((()=>O.value?h:f)),R={page:0,hasMore:!0};async function U(e=!1){if(!R.hasMore)return;R.page++,1==R.page&&(A.value=[]);const{records:t,rows:n}=await M.value({page:R.page});g(n)&&A.value.length<=+t&&(A.value=R.page>1?[...A.value,...n]:n,J(),A.value.length>=+t&&(e&&(B.value=!0),R.hasMore=!1,console.log("没有更多消息了")))}function _(e,t,n){if(e.type!==t){if(e.childrens&&e.childrens.length)for(let l=0;l<e.childrens.length;l++)_(e.childrens[l],t,n)}else n.push(e)}function J(){A.value.forEach((e=>{e.contents.forEach((e=>{var t;if(Reflect.has(e,"disabled")||(e.disabled=!0),"json"===e.contentType&&"string"!=typeof e.content){const{settings:n,data:l,needConfirms:o}=e.content;if(o||!(null==n?void 0:n.setting)||!j(null==n?void 0:n.setting)||!(null==(t=null==l?void 0:l.buttonList)?void 0:t.length))return;const{templates:s=[]}=JSON.parse(n.setting),a=[];s.forEach((e=>{_(e,"BUTTON",a)})),a.forEach((e=>{const{buttonList:t}=e.setting;t.forEach((e=>{var t;const{conditions:n=[]}=(null==(t=null==e?void 0:e.advancedConfig)?void 0:t.disabled)||{};n.length&&(l[e.id+"Disabled"]="1")}))}))}}))}))}function F(e,t){const{contentType:n,content:l}=t;return"json"===n&&l?a(C,{selectParams:{taskId:e.taskId,instructionId:e.instructionId},msgItem:t,"onButton-click":(n={})=>function(e){const{item:t,msgItem:n,showMore:l}=e;return l?(H.value={item:t,msgItem:n},void(q.value=!0)):n?(w("button-click",e),void(n.disabled=!0)):void(t.link||(z.sendContent="确定",z.sending=!0,z.loading=!0))}({item:e,msgItem:t,...n})},null):null}function G(e,t){const{contents:n=[],buttonType:l=""}=e,o=F(e,n[t]);if(o)return o;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:a("br",null,null)]))]}function K({role:e=""}){return"user"===e}function Q(){let e;return a("div",{class:"message-item"},[a(u,{round:!0,size:O.value?64:40,src:N.value},null),a("div",{class:"content-box"},[a("div",{class:"content fillet-10 default"},[a("h2",null,[i("Hi,我是你的AI助理")]),a("p",null,[i("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),a("br",null,null),i("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),g(D.value)&&D.value.length>0?[a("p",{style:"margin: 5px 0 5px"},[i("你可以试着问我:")]),a(d,{"wrap-item":!1},I(e=D.value.map((e=>a(m,{size:"large",secondary:!0,onClick:()=>z.sendContent=e,disabled:z.loading},I(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return y(P,(()=>{U()}),L.value?"bottom":"top"),U(!0),o((()=>z.externalData),(e=>{var t,n;e&&(t=e,A.value.unshift(t),null==(n=P.value)||n.scrollTo({top:0,behavior:"auto"}),z.loading=!1,z.externalData=null)})),o((()=>z.sending),(async e=>{var t,n;if(e){A.value.unshift({contents:[{role:"user",content:z.sendContent}]}),null==(t=P.value)||t.scrollTo({top:0,behavior:"auto"}),J();const e=z.selectedCommand,l=z.selectedPrompt;z.selectedCommand=null,z.selectedPrompt=null;const o=await S.value({content:z.sendContent,contentType:"text",command:e,prompt:l,patient:z.selectedPatient});g(null==o?void 0:o.contents)&&(A.value.unshift(o),await s(),null==(n=P.value)||n.scrollTo({top:0,behavior:"auto"})),z.sending=!1,z.loading=!1,z.sendContent=""}})),()=>[a("section",{class:"chat-main",ref:P,style:{"flex-direction":L.value?"column":"column-reverse"}},[[z.loading?a("div",{class:"message-item"},[[O.value?null:a(u,{round:!0,size:40,src:N.value},null),a("div",{class:"content-box"},[a("div",{class:"content loading"},[a(c,{size:22,stroke:"#4170EE"},null),a("span",null,[i("正在加载中,请稍等...")])])])]]):null,A.value.map((e=>e.contents.map(((t,n)=>a("div",{class:"message-item"},[[O.value?null:a(u,{round:!0,size:40,src:K(t)?E.value:N.value},null),a("div",{class:["content-box",K(t)?"mine":""]},[a("div",{class:"content"},[b(t.render)?t.render():G(e,n)])])]]))))),B.value?Q():null]]),a(x,{show:q.value,"onUpdate:show":e=>q.value=e,data:H.value},null)]}});export{k as default};
@@ -1967,6 +1967,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1967
1967
  layoutWidthEnum?: import("./src/types").FormConfigWidth | undefined;
1968
1968
  type?: string | undefined;
1969
1969
  name?: string | undefined;
1970
+ alias?: string | undefined;
1970
1971
  show?: boolean | undefined;
1971
1972
  defaultValue?: any;
1972
1973
  defaultExpand?: boolean | undefined;
@@ -1983,6 +1984,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1983
1984
  layoutWidthEnum: import("./src/types").FormConfigWidth;
1984
1985
  type: string;
1985
1986
  name: string;
1987
+ alias?: string | undefined;
1986
1988
  show?: boolean | undefined;
1987
1989
  defaultValue?: any;
1988
1990
  defaultExpand?: boolean | undefined;
@@ -1970,6 +1970,7 @@ declare const _default: import("vue").DefineComponent<{
1970
1970
  layoutWidthEnum?: import("../../../components/form-config/src/types").FormConfigWidth | undefined;
1971
1971
  type?: string | undefined;
1972
1972
  name?: string | undefined;
1973
+ alias?: string | undefined;
1973
1974
  show?: boolean | undefined;
1974
1975
  defaultValue?: any;
1975
1976
  defaultExpand?: boolean | undefined;
@@ -1986,6 +1987,7 @@ declare const _default: import("vue").DefineComponent<{
1986
1987
  layoutWidthEnum: import("../../../components/form-config/src/types").FormConfigWidth;
1987
1988
  type: string;
1988
1989
  name: string;
1990
+ alias?: string | undefined;
1989
1991
  show?: boolean | undefined;
1990
1992
  defaultValue?: any;
1991
1993
  defaultExpand?: boolean | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as i,openBlock as t,createBlock as l,unref as o,withCtx as a,createVNode as r,createTextVNode as n}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as d,NPopconfirm as m,NButton as u}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import L from"../../../form-render/index.js";var c=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:c}){const p=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]),h=i(),E=i(),w={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function y(e,i,t){if(!t)return;await t.validate();const l=t.getFormValues();c("submit",{layoutWidthEnum:"ALL_LINE",...l,type:e,key:l.name,...i,__new:!0})}return(e,i)=>(t(),l(o(d),{size:"small"},{default:a((()=>[r(o(m),{width:"200px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:i[0]||(i[0]=e=>y("NEWLINE",{},E.value))},{trigger:a((()=>[r(o(u),null,{default:a((()=>[n("新建分行符")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":o(s)(w,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:o(p).slice(0,1)},null,8,["initial-data","fieldList"])])),_:1}),r(o(m),{width:"300px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:i[1]||(i[1]=e=>y("LINE_BAR",{children:[]},h.value))},{trigger:a((()=>[r(o(u),null,{default:a((()=>[n("新建分线栏")])),_:1})])),default:a((()=>[r(o(L),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":w,size:"small","label-width":"auto","label-placement":"left",fieldList:o(p)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{c as default};
1
+ import{defineComponent as e,ref as t,openBlock as i,createBlock as l,unref as o,withCtx as a,createVNode as n,createTextVNode as r}from"vue";import{pick as s}from"lodash-es";import{NButtonGroup as m,NPopconfirm as u,NButton as d}from"naive-ui";import{EditAbleField as f}from"../constants/index.js";import{useConfigurationField as _}from"../hooks/useConfigurationField.js";import"../../../index.js";import c from"../../../form-render/index.js";var p=e({__name:"FormConfigCreator",emits:{submit:e=>e},setup(e,{emit:p}){const L=_().generateFieldListByKeys([f.NAME,f.LAYOUT_WIDTH_ENUM,f.NOTES,f.DEFAULT_EXPAND,f.FOLD]);Object.assign(L[0],{html_type:"INPUT",is_null:"0"});const h=t(),E=t(),y={defaultExpand:!0,fold:!0,layoutWidthEnum:"ALL_LINE"};async function w(e,t,i){if(!i)return;await i.validate();const l=i.getFormValues();p("submit",{layoutWidthEnum:"ALL_LINE",...l,type:e,key:l.name,...t,__new:!0})}return(e,t)=>(i(),l(o(m),{size:"small"},{default:a((()=>[n(o(u),{width:"200px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:t[0]||(t[0]=e=>w("NEWLINE",{},E.value))},{trigger:a((()=>[n(o(d),null,{default:a((()=>[r("新建分行符")])),_:1})])),default:a((()=>[n(o(c),{column:12,ref_key:"lineBreakFormRef",ref:E,"initial-data":o(s)(y,["layoutWidthEnum"]),size:"small","label-width":"auto","label-placement":"left",fieldList:o(L).slice(0,1)},null,8,["initial-data","fieldList"])])),_:1}),n(o(u),{width:"300px","show-icon":!1,"show-arrow":!1,to:"body",onPositiveClick:t[1]||(t[1]=e=>w("LINE_BAR",{children:[]},h.value))},{trigger:a((()=>[n(o(d),null,{default:a((()=>[r("新建分线栏")])),_:1})])),default:a((()=>[n(o(c),{column:12,ref_key:"linebarFormRef",ref:h,"initial-data":y,size:"small","label-width":"auto","label-placement":"left",fieldList:o(L)},null,8,["fieldList"])])),_:1})])),_:1}))}});export{p as default};
@@ -457,6 +457,7 @@ declare const _default: import("vue").DefineComponent<{
457
457
  layoutWidthEnum?: import("../../../../components/index").FormConfigWidth | undefined;
458
458
  type?: string | undefined;
459
459
  name?: string | undefined;
460
+ alias?: string | undefined;
460
461
  show?: boolean | undefined;
461
462
  defaultValue?: any;
462
463
  defaultExpand?: boolean | undefined;
@@ -473,6 +474,7 @@ declare const _default: import("vue").DefineComponent<{
473
474
  layoutWidthEnum: import("../../../../components/index").FormConfigWidth;
474
475
  type: string;
475
476
  name: string;
477
+ alias?: string | undefined;
476
478
  show?: boolean | undefined;
477
479
  defaultValue?: any;
478
480
  defaultExpand?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { FormConfigItem, FormConfigTextFormatter } from '../../../../../components/form-config';
3
- import { bindHover } from '../../../../../components/form-config/src/utils';
3
+ import { bindHover, getFormConfigTitle } from '../../../../../components/form-config/src/utils';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  formConfigItem: {
6
6
  type: PropType<FormConfigItem>;
@@ -162,6 +162,7 @@ declare const _default: import("vue").DefineComponent<{
162
162
  };
163
163
  }>>, {}>;
164
164
  bindHover: typeof bindHover;
165
+ getFormConfigTitle: typeof getFormConfigTitle;
165
166
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
166
167
  formConfigItem: {
167
168
  type: PropType<FormConfigItem>;
@@ -1 +1 @@
1
- import{defineComponent as e,inject as o,computed as r,openBlock as t,createElementBlock as m,normalizeClass as a,unref as i,createElementVNode as f,mergeProps as n,withModifiers as d,createTextVNode as l,toDisplayString as s,createVNode as c}from"vue";import g from"../FormConfigDragDisplay.vue.js";import p from"./CloseButton.vue.js";import{InjectionActiveFieldItem as u}from"../../constants/index.js";import{bindHover as C}from"../../utils/index.js";const I=["data-type","data-key","data-required","data-extra"],x=["onClick"];var y=e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const y=e,_=o(u);function v(){_.value=y.formConfigItem}const k=r((()=>[{"is-active--text":_.value===y.formConfigItem},"form-config__renderer--complexHeader"])),q=r((()=>["form-config__renderer--complex form-config__renderer",{"is-active--shadow":_.value===y.formConfigItem}]));return(o,r)=>(t(),m("section",{class:a(i(q)),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra},[f("header",n(i(C)(e.formConfigItem),{class:i(k),onClick:d(v,["stop"])}),[l(s(y.formConfigItem.name)+" ",1),c(p,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,x),c(g,n(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid","data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),null,16,["modelValue","data-type","data-key","data-required","data-extra"])],10,I))}});export{y as default};
1
+ import{defineComponent as e,inject as o,computed as r,openBlock as t,createElementBlock as m,normalizeClass as a,unref as i,createElementVNode as f,mergeProps as n,withModifiers as d,createTextVNode as l,toDisplayString as s,createVNode as c}from"vue";import g from"../FormConfigDragDisplay.vue.js";import p from"./CloseButton.vue.js";import{InjectionActiveFieldItem as u}from"../../constants/index.js";import{bindHover as C,getFormConfigTitle as I}from"../../utils/index.js";const x=["data-type","data-key","data-required","data-extra"],y=["onClick"];var _=e({__name:"ComplexNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0}},setup(e){const _=e,v=o(u);function k(){v.value=_.formConfigItem}const q=r((()=>[{"is-active--text":v.value===_.formConfigItem},"form-config__renderer--complexHeader"])),j=r((()=>["form-config__renderer--complex form-config__renderer",{"is-active--shadow":v.value===_.formConfigItem}]));return(o,r)=>(t(),m("section",{class:a(i(j)),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra},[f("header",n(i(C)(e.formConfigItem),{class:i(q),onClick:d(k,["stop"])}),[l(s(i(I)(_.formConfigItem))+" ",1),c(p,{"form-config-item":e.formConfigItem},null,8,["form-config-item"])],16,y),c(g,n(o.$props,{modelValue:e.formConfigItem.children,"onUpdate:modelValue":r[0]||(r[0]=o=>e.formConfigItem.children=o),class:"form-config__renderer--complex--grid","data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),null,16,["modelValue","data-type","data-key","data-required","data-extra"])],10,x))}});export{_ as default};
@@ -1 +1 @@
1
- import{defineComponent as e,inject as t,computed as o,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as a,normalizeClass as l,withCtx as d,createTextVNode as u,toDisplayString as s,renderSlot as C,createBlock as g,createCommentVNode as c}from"vue";import{NEllipsis as p}from"naive-ui";import I from"./CloseButton.vue.js";import{InjectionActiveFieldItem as _,WidgetTextMap as v}from"../../constants/index.js";import{bindHover as y}from"../../utils/index.js";const x=["onClick","data-type","data-key","data-required","data-extra"];var k=e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const k=e,q=t(_);function B(){k.allowClick&&(q.value=k.formConfigItem)}const b=o((()=>["form-config__renderer--default",{"is-required":k.formConfigItem.required}])),j=o((()=>{var e;return[{"is-active":q.value===k.formConfigItem,"is-disabled":w.value,"is-extra":null==(e=k.formConfigItem)?void 0:e.__extra},"form-config__renderer","form-config__renderer--defaultWrapper"]})),w=o((()=>!1===k.formConfigItem.editable)),$=o((()=>{const e=v.get(k.formConfigItem.type);return k.textFormatter(k.formConfigItem,`${k.formConfigItem.name}${e?`(${e})`:""}`)})),h=o((()=>k.showCloseButton&&(!k.formConfigItem.required&&!k.formConfigItem.__isCombinationChild||k.formConfigItem.__extra)));return(t,o)=>(r(),i("div",f(m(y)(e.formConfigItem),{onClick:n(B,["stop"]),class:m(j),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),[a(m(p),{class:l(m(b))},{default:d((()=>[u(s(m($)),1)])),_:1},8,["class"]),C(t.$slots,"default"),m(h)?(r(),g(I,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"])):c("v-if",!0)],16,x))}});export{k as default};
1
+ import{defineComponent as e,inject as t,computed as o,openBlock as r,createElementBlock as i,mergeProps as f,unref as m,withModifiers as n,createVNode as a,normalizeClass as l,withCtx as d,createTextVNode as u,toDisplayString as s,renderSlot as C,createBlock as g,createCommentVNode as c}from"vue";import{NEllipsis as p}from"naive-ui";import I from"./CloseButton.vue.js";import{InjectionActiveFieldItem as _,WidgetTextMap as v}from"../../constants/index.js";import{getFormConfigTitle as y,bindHover as x}from"../../utils/index.js";const k=["onClick","data-type","data-key","data-required","data-extra"];var q=e({__name:"DefaultNode",props:{formConfigItem:{type:Object,required:!0},textFormatter:{type:Function,required:!0},showCloseButton:{type:Boolean,default:!0},allowClick:{type:Boolean,default:!0}},setup(e){const q=e,B=t(_);function b(){q.allowClick&&(B.value=q.formConfigItem)}const j=o((()=>["form-config__renderer--default",{"is-required":q.formConfigItem.required}])),w=o((()=>{var e;return[{"is-active":B.value===q.formConfigItem,"is-disabled":$.value,"is-extra":null==(e=q.formConfigItem)?void 0:e.__extra},"form-config__renderer","form-config__renderer--defaultWrapper"]})),$=o((()=>!1===q.formConfigItem.editable)),h=o((()=>{const e=v.get(q.formConfigItem.type);return q.textFormatter(q.formConfigItem,`${y(q.formConfigItem)}${e?`(${e})`:""}`)})),F=o((()=>q.showCloseButton&&(!q.formConfigItem.required&&!q.formConfigItem.__isCombinationChild||q.formConfigItem.__extra)));return(t,o)=>(r(),i("div",f(m(x)(e.formConfigItem),{onClick:n(b,["stop"]),class:m(w),"data-type":e.formConfigItem.type,"data-key":e.formConfigItem.key,"data-required":!!e.formConfigItem.required,"data-extra":!!e.formConfigItem.__extra}),[a(m(p),{class:l(m(j))},{default:d((()=>[u(s(m(h)),1)])),_:1},8,["class"]),C(t.$slots,"default"),m(F)?(r(),g(I,{key:0,"form-config-item":e.formConfigItem},null,8,["form-config-item"])):c("v-if",!0)],16,k))}});export{q as default};
@@ -5,6 +5,7 @@ export declare const WidgetTextMap: Map<string, string>;
5
5
  export declare enum EditAbleField {
6
6
  KEY = "key",
7
7
  NAME = "name",
8
+ ALIAS = "alias",
8
9
  NOTES = "notes",
9
10
  DEFAULT_VALUE = "defaultValue",
10
11
  LAYOUT_WIDTH_ENUM = "layoutWidthEnum",
@@ -1 +1 @@
1
- import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.KEY="key",e.NAME="name",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],c="__display",s=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit"),_=Symbol("InjectionFormConfigProps");export{a as EditAbleField,c as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,s as InjectionFieldList,S as InjectionFormConfigEmit,_ as InjectionFormConfigProps,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
1
+ import{range as e}from"lodash-es";const l=new Map([["LINE_BAR","分线栏"],["NEWLINE","分行符"]]);var a=(e=>(e.KEY="key",e.NAME="name",e.ALIAS="alias",e.NOTES="notes",e.DEFAULT_VALUE="defaultValue",e.LAYOUT_WIDTH_ENUM="layoutWidthEnum",e.DESC="desc",e.DEFAULT_EXPAND="defaultExpand",e.FOLD="fold",e.REQUIRED="required",e.EDITABLE="editable",e.SHOW="show",e.ROWS="initialHigh",e))(a||{});function i(){return{option:[{text:"整行",value:"ALL_LINE"},{text:"半行",value:"HALF_LINE"},{text:"5/6",value:"FIVE_SIX"},{text:"2/3",value:"TWO_THREE"},{text:"1/3",value:"ONE_THREE"},{text:"3/4",value:"THREE_FOUR"},{text:"1/4",value:"ONE_FOUR"},{text:"1/6",value:"ONE_SIX"},{text:"1/8",value:"ONE_EIGHT"}]}}function t(){return{option:e(1,11).map((e=>({text:`${e}行`,value:e})))}}function u(){return{open:{describe:"默认展开",value:!0},close:{describe:"默认收起",value:!1}}}function d(){return{open:{describe:"可折叠",value:!0},close:{describe:"不可折叠",value:!1}}}function n(){return{open:{describe:"可编辑",value:!0},close:{describe:"不可编辑",value:!1}}}function o(){return{open:{describe:"必填",value:!0},close:{describe:"不必填",value:!1}}}function E(){return{open:{describe:"显示",value:!0},close:{describe:"隐藏",value:!1}}}const r={EQ:"NEQ",NEQ:"EQ",CL:"NC",NC:"CL",NULL:"NOT_NULL",NOT_NULL:"NULL",BIG:"LESSEQ",BIGEQ:"LESS",LESS:"BIGEQ",LESSEQ:"BIG"},b=[{value:"EQ",label:"等于"},{value:"NEQ",label:"不等于"},{value:"CL",label:"包含"},{value:"NC",label:"不包含"},{value:"NULL",label:"为空"},{value:"NOT_NULL",label:"不为空"},{value:"BIG",label:"大于"},{value:"BIGEQ",label:"大于等于"},{value:"LESS",label:"小于"},{value:"LESSEQ",label:"小于等于"}],v={showField:"hideField",hideField:"showField",requiredField:"notRequiredField",notRequiredField:"requiredField",enabledField:"disabledField",disabledField:"enabledField"},L=[{value:"showField",label:"显示字段"},{value:"hideField",label:"隐藏字段"},{value:"requiredField",label:"必填字段"},{value:"notRequiredField",label:"非必填字段"},{value:"enabledField",label:"启用字段"},{value:"disabledField",label:"禁用字段"}],s="__display",c=Symbol("InjectionFieldList"),F=Symbol("InjectionMaterialList"),N=Symbol("InjectionLowCodeReactions"),I=Symbol("InjectionActiveFieldItem"),S=Symbol("InjectionFormConfigEmit"),_=Symbol("InjectionFormConfigProps");export{a as EditAbleField,s as FORM_CONFIG_GROUP,I as InjectionActiveFieldItem,c as InjectionFieldList,S as InjectionFormConfigEmit,_ as InjectionFormConfigProps,N as InjectionLowCodeReactions,F as InjectionMaterialList,l as WidgetTextMap,r as conditionOppositeMap,b as conditionTypeOptions,v as connectionTypeOppositeMap,L as connectionTypeOptions,n as isEditOptionConfig,d as isNotFoldOptionConfig,o as isNullOptionConfig,u as isShowOptionConfig,E as isVisibleOptionConfig,t as rowsOptionConfig,i as widgetWidthOptionConfig};
@@ -1 +1 @@
1
- import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as o,isEditOptionConfig as _,isNullOptionConfig as n,isVisibleOptionConfig as m,rowsOptionConfig as r}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as s}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=s();function E(){const s=new Map([[l.KEY,e=>({alias:"字段",elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.NAME,()=>({alias:"名称",elem_width:6,is_null:"0",html_type:"INPUT"})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...o()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",requiredReminderContent:null==e?void 0:e.requiredReminderContent,...n()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...m()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...r()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=s.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],["NEWLINE",[l.KEY,l.NAME]],...["COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.KEY,l.NAME,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
1
+ import{omit as e,pick as t}from"lodash-es";import{EditAbleField as l,widgetWidthOptionConfig as i,isShowOptionConfig as a,isNotFoldOptionConfig as o,isEditOptionConfig as _,isNullOptionConfig as n,isVisibleOptionConfig as m,rowsOptionConfig as r}from"../constants/index.js";import"../../../form-render/index.js";import{useFieldNormalize as s}from"../../../form-render/src/hooks/useFieldNormalize.js";const{FieldNormalizeWaterfallHook:d}=s();function E(){const s=new Map([[l.KEY,e=>({alias:"字段",elem_width:6,html_type:"TEXT",content:null==e?void 0:e.key,decoratorProps:{labelPlacement:"left"}})],[l.ALIAS,()=>({alias:"别名",elem_width:6,default_val:"",html_type:"INPUT"})],[l.NAME,()=>({alias:"名称",elem_width:6,html_type:"TEXT",decoratorProps:{labelPlacement:"left"}})],[l.NOTES,()=>({alias:"问号提示",elem_width:6,html_type:"INPUT",is_empty:"0"})],[l.DEFAULT_VALUE,(l,i)=>{const a=d.call(Object.assign({},null==l?void 0:l.originalSetting,i),{});return{alias:"默认值",elem_width:6,html_type:"INPUT",is_empty:"0",componentProps:e(a.componentProps,["class","style","disabled"]),...t(a,["html_type","validate","option","multi_select","multi_select_value","wordbook","open","close","date_format","step_length","urlConfig","autograph","defined_error_msg","free_entry","validator","allowSlash","is_allow_check_mid","allow_check_mid_level"])}}],[l.LAYOUT_WIDTH_ENUM,()=>({alias:"宽度",fieldType:"number",html_type:"SELECT",elem_width:6,...i()})],[l.DESC,()=>({alias:"说明文本",elem_width:6,html_type:"INPUT",is_empty:"0",validate:{max_length:30}})],[l.DEFAULT_EXPAND,()=>({alias:"是否默认展开",html_type:"SWITCH",elem_width:6,...a()})],[l.FOLD,()=>({alias:"是否可折叠",html_type:"SWITCH",elem_width:6,...o()})],[l.EDITABLE,e=>({alias:"是否可编辑",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.editableDisabled)?"0":"1",..._()})],[l.REQUIRED,e=>({alias:"是否必填",html_type:"SWITCH",elem_width:6,is_edit:(null==e?void 0:e.requiredDisabled)?"0":"1",requiredReminderContent:null==e?void 0:e.requiredReminderContent,...n()})],[l.SHOW,e=>({alias:"是否显示",html_type:"SWITCH",elem_width:6,is_show:(null==e?void 0:e.__isCombinationChild)?"1":"0",...m()})],[l.ROWS,()=>({alias:"高度",elem_width:6,remark:"默认为3行高度,可调整为1-10行高度",default_val:3,is_empty:"0",html_type:"SELECT",...r()})]]);function E(e,t,l){return e.map((e=>{var i,a;return{...null!=(a=null==(i=s.get(e))?void 0:i(t,l))?a:{},val_key:e}}))}const p=new Map([["LINE_BAR",[l.KEY,l.NAME,l.ALIAS,l.LAYOUT_WIDTH_ENUM,l.NOTES,l.DEFAULT_EXPAND,l.FOLD]],["NEWLINE",[l.KEY,l.NAME,l.ALIAS]],...["COMPLEX","COMBINATION"].map((e=>[e,[l.KEY,l.NAME,l.ALIAS,l.LAYOUT_WIDTH_ENUM]]))]),h=[l.KEY,l.NAME,l.ALIAS,l.DEFAULT_VALUE,l.LAYOUT_WIDTH_ENUM,l.DESC,l.NOTES,l.EDITABLE,l.REQUIRED,l.SHOW];return{generateFieldListByKeys:E,generateFieldListByFormConfigItem:function(e,t){var i;const a=p.get(e.type)||h;return"TEXTAREA"===(t?t.html_type:null==(i=e.originalSetting)?void 0:i.html_type)&&a.splice(3,0,l.ROWS),E(a,e,t)}}}export{E as useConfigurationField};
@@ -28,6 +28,7 @@ export type FormConfigItem = {
28
28
  type: FormConfigType;
29
29
  name: string;
30
30
  } & Partial<{
31
+ alias: string;
31
32
  show: boolean;
32
33
  defaultValue: any;
33
34
  defaultExpand: boolean;
@@ -9,3 +9,4 @@ export declare function bindHover(formConfigItem: FormConfigItem): {
9
9
  };
10
10
  export declare function findFieldItemByKey(fieldList: Nullable<FieldItem[]>, key: string): FieldItem | undefined;
11
11
  export declare function fieldItemNormalize(item: FormConfigItem): void;
12
+ export declare function getFormConfigTitle(field: FormConfigItem): string;
@@ -1 +1 @@
1
- import{traverse as e}from"../../../../shared/utils/index.js";import{isArray as n}from"lodash-es";import{ref as r}from"vue";function i(e){return{ALL_LINE:24,HALF_LINE:12,FIVE_SIX:20,TWO_THREE:16,ONE_THREE:8,THREE_FOUR:18,ONE_FOUR:6,ONE_SIX:4,ONE_EIGHT:3}[e]||24}const o=r();function t(e){return{onMouseenter:()=>o.value=e,onMouseleave:()=>o.value=void 0,"is-hovering":o.value===e}}function l(r,i){if(!n(r)||!r.length)return;let o;return e(r,((e,n)=>{(null==e?void 0:e.val_key)===i&&(o=e,n())}),["children","properties"]),o}function u(e){"LINE_BAR"===e.type&&(e.children=[]),"COMBINATION"===e.type&&n(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}export{t as bindHover,u as fieldItemNormalize,l as findFieldItemByKey,i as layoutWidthEnum2Column};
1
+ import{traverse as e}from"../../../../shared/utils/index.js";import{isArray as n}from"lodash-es";import{ref as r}from"vue";function i(e){return{ALL_LINE:24,HALF_LINE:12,FIVE_SIX:20,TWO_THREE:16,ONE_THREE:8,THREE_FOUR:18,ONE_FOUR:6,ONE_SIX:4,ONE_EIGHT:3}[e]||24}const o=r();function t(e){return{onMouseenter:()=>o.value=e,onMouseleave:()=>o.value=void 0,"is-hovering":o.value===e}}function l(r,i){if(!n(r)||!r.length)return;let o;return e(r,((e,n)=>{(null==e?void 0:e.val_key)===i&&(o=e,n())}),["children","properties"]),o}function u(e){"LINE_BAR"===e.type&&(e.children=[]),"COMBINATION"===e.type&&n(e.children)&&e.children.length&&e.children.forEach((e=>{e.__isCombinationChild=!0}))}function E(e){return e.alias||e.name}export{t as bindHover,u as fieldItemNormalize,l as findFieldItemByKey,E as getFormConfigTitle,i as layoutWidthEnum2Column};
@@ -1 +1 @@
1
- import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{traverse as i,arrayed as u}from"../../../../shared/utils/index.js";import{isGeneralField as c}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as l}from"@vue/shared";import{useMemoize as a}from"@vueuse/core";import{isString as p,isFunction as d,omit as E,castArray as T,flattenDeep as h}from"lodash-es";import{NTooltip as m,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as y}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function R(e){console.warn(`[FormRender]: ${e}`)}function g(e){return"1"===e||!0===e||1===e}function v(e){return"0"===e||!1===e||0===e}function I(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{l(r)&&(null!=c(r)&&null==t[i(r)]&&s.setIn(t,i(r),c(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],u(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function c(e){return e[o]}}function A(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function D(e){return e&&p(e)?+e:e}function P(e,t,n){if(l(e)&&!d(e)){const n={};return Object.entries(e).forEach((([e,r])=>{d(r)&&(n[e]=()=>r(t))})),n}return{default:()=>d(e)?e(t):n?n(e):[e]}}function W(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[P(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[P(e.suffix,e,t).default()])),n}))}function _(e,t){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function G(e){return e.reduce(((e,t)=>(p(t.extendKey)&&t.extendKey&&e.push(t),j(t)&&e.push(...G(t.children||[])),e)),[])}function S(e,t){const n=G(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:s}=u,f=o.get(s)||{};o.set(s,f),f[c]=t[c]})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=G(e);if(!n.length)return t;const r=a((e=>{try{return l(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=E(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&y.includes(e)}function j(e){return b(c(e)?e.componentType:e.html_type)}function w(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(m,null,{trigger:()=>r(x,{component:f},null),default:()=>t.desc}):null])}function K(e,t){return s.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function X(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function k(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=k(n.properties,t)),n.children&&(n.children=k(n.children,t))),e)),[])}function C(e,t){let n=null;return i(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var F=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(F||{});function O(e){const t=[...e],n=[];let r=F.PREPARE,o="";function i(e){switch(r=e,r){case F.PREPARE:case F.WIDGET_START:case F.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case F.PREPARE:return"#"===e?(i(F.WIDGET_START),void(s&&u())):(i(F.TEXT),o=e,void(s&&u()));case F.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(F.WIDGET_START))):(o+=e,void(s&&u()));case F.WIDGET_START:return"{"!==e||s?(c(),i(F.TEXT),o+=`#${e}`,void(s&&u())):void i(F.WIDGET);case F.WIDGET:return"}"===e?(u("widget"),void i(F.PREPARE)):"#"===e?(c(),u(),i(F.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function N(e,t){let n=T(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{p(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=h(n)})),n}function B(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{k as FieldListFilter,S as combineExtendKey,W as createInputSlot,P as createSlot,X as editorUnescape,C as findItemByValCondition,R as formRenderLog,K as getAbsoluteKey,A as injectOrProvide,B as isEnter,v as isNegative,j as isNestedFieldType,b as isNestedType,g as isPositive,I as mergeDeepProperties,O as parseEnhanceText,D as parseNumberFromMaybeString,w as renderDescOption,N as replace2Any,$ as splitExtendKey,_ as validateMessageParser};
1
+ import{inject as e,provide as t,computed as n,createVNode as r,Fragment as o}from"vue";import{traverse as i,arrayed as u}from"../../../../shared/utils/index.js";import{isGeneralField as c}from"@formily/core";import{Path as s}from"@formily/path";import{HelpCircleSharp as f}from"@vicons/ionicons5";import{isObject as l}from"@vue/shared";import{useMemoize as a}from"@vueuse/core";import{isString as p,isFunction as d,omit as E,castArray as T,flattenDeep as h}from"lodash-es";import{NTooltip as m,NIcon as x}from"naive-ui";import{NESTED_FORM_ITEM_TYPE as g}from"../constants/index.js";export{businessDateParser,isForeignerID,isIdCard,isMobile,parseAge2Birthday,parseAgeFromContext,parseBirthday,parseIdCard,transformDateFormat}from"./business.js";function y(e){console.warn(`[FormRender]: ${e}`)}function R(e){return"1"===e||!0===e||1===e}function v(e){return"0"===e||!1===e||0===e}function I(e,t,n=["children","properties","suffixConfig"],r="val_key",o="default_val"){return function e(t,r){r.forEach((r=>{l(r)&&(null!=c(r)&&null==t[i(r)]&&s.setIn(t,i(r),c(r)),n.forEach((n=>{r[n]&&(t[i(r)]||(t[i(r)]={}),e(t[i(r)],u(r[n])))})))}))}(e,t),e;function i(e){return e[r]}function c(e){return e[o]}}function A(n,r){let o=e(n,null);return o||(o=r(),t(n,o)),o}function D(e){return e&&p(e)?+e:e}function P(e,t,n){if(l(e)&&!d(e)){const n={};return Object.entries(e).forEach((([e,r])=>{d(r)&&(n[e]=()=>r(t))})),n}return{default:()=>d(e)?e(t):n?n(e):[e]}}function W(e,t){return n((()=>{const n={};return e.prefix&&(n.prefix=()=>r(o,null,[P(e.prefix,e,t).default()])),e.suffix&&(n.suffix=()=>r(o,null,[P(e.suffix,e,t).default()])),n}))}function _(e,t){return p(e)&&e?e.replace(/\$\{([^}]*)}/g,(function(e,n){const r=n.split("||");for(const e of r){const n=t[e.trim()];if(n)return n}return""})):""}function G(e){return e.reduce(((e,t)=>(p(t.extendKey)&&t.extendKey&&e.push(t),j(t)&&e.push(...G(t.children||[])),e)),[])}function S(e,t){const n=G(e);if(!n.length)return t;const r={},o=new Map;return Object.entries(t).forEach((([e,i])=>{const u=n.find((t=>t.val_key===e));if(!u)return r[e]=i;const{val_key:c,extendKey:f}=u,l=o.get(f)||{};o.set(f,l);const a=s.getIn(t,e);null!=a&&s.setIn(l,c,a)})),[...o.entries()].forEach((([e,t])=>{r[e]=JSON.stringify(t)})),r}function $(e,t){const n=G(e);if(!n.length)return t;const r=a((e=>{try{return l(t[e])?t[e]:JSON.parse(t[e])||{}}catch(e){return{}}})),o=E(t,n.map((e=>e.extendKey)));return n.forEach((({val_key:e,extendKey:t})=>{Reflect.has(o,e)||(o[e]=r(t)[e])})),o}function b(e){return e&&g.includes(e)}function j(e){return b(c(e)?e.componentType:e.html_type)}function w(e,t){return r("section",{style:{display:"flex",alignItems:"center",gap:"4px"}},[e,t.desc?r(m,null,{trigger:()=>r(x,{component:f},null),default:()=>t.desc}):null])}function K(e,t){return s.parse(e.startsWith(".")?e:`.${e}`,t).toString()}function X(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")}function k(e,t){return e.reduce(((e,n)=>(t(n)||(e.push(n),n.properties&&(n.properties=k(n.properties,t)),n.children&&(n.children=k(n.children,t))),e)),[])}function C(e,t){let n=null;return i(e,((e,r)=>{t(e)&&(n=e,r())}),["children","properties"]),n}var F=function(e){return e[e.PREPARE=0]="PREPARE",e[e.TEXT=1]="TEXT",e[e.WIDGET_START=2]="WIDGET_START",e[e.WIDGET=3]="WIDGET",e}(F||{});function O(e){const t=[...e],n=[];let r=F.PREPARE,o="";function i(e){switch(r=e,r){case F.PREPARE:case F.WIDGET_START:case F.WIDGET:o=""}}function u(e="text",t=o){n.push({type:e,content:t})}function c(){const e=n.pop();e&&("text"===e.type?o=e.content:n.push(e))}return t.forEach(((e,n)=>{const s=n===t.length-1;switch(r){case F.PREPARE:return"#"===e?(i(F.WIDGET_START),void(s&&u())):(i(F.TEXT),o=e,void(s&&u()));case F.TEXT:return"#"===e?void(s?(o+=e,u()):(u(),i(F.WIDGET_START))):(o+=e,void(s&&u()));case F.WIDGET_START:return"{"!==e||s?(c(),i(F.TEXT),o+=`#${e}`,void(s&&u())):void i(F.WIDGET);case F.WIDGET:return"}"===e?(u("widget"),void i(F.PREPARE)):"#"===e?(c(),u(),i(F.WIDGET_START),o+=`#${e}`,void(s&&u())):(o+=e,void(s&&u("text",`#{${o}`)))}})),n}function N(e,t){let n=T(e);return t.forEach((({from:e,to:t})=>{n.forEach(((r,o)=>{p(r)&&(n[o]=r.split(e).map(((e,n,r)=>[e,n<r.length-1?t:null])))})),n=h(n)})),n}function B(e){return"Enter"===e.code||"NumpadEnter"===e.code}export{k as FieldListFilter,S as combineExtendKey,W as createInputSlot,P as createSlot,X as editorUnescape,C as findItemByValCondition,y as formRenderLog,K as getAbsoluteKey,A as injectOrProvide,B as isEnter,v as isNegative,j as isNestedFieldType,b as isNestedType,R as isPositive,I as mergeDeepProperties,O as parseEnhanceText,D as parseNumberFromMaybeString,w as renderDescOption,N as replace2Any,$ as splitExtendKey,_ as validateMessageParser};
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties, PropType } from 'vue';
2
2
  import { VxeColumnPropTypes, VxeTableConstructor, VxeTableMethods, VxeTablePrivateMethods } from 'vxe-table';
3
+ import { LowCodeTableFieldItem } from '../../../../../components/iho-table';
3
4
  declare const _default: import("vue").DefineComponent<{
4
5
  payload: {
5
6
  type: PropType<VxeColumnPropTypes.FilterSlotParams>;
@@ -14,9 +15,8 @@ declare const _default: import("vue").DefineComponent<{
14
15
  }>> & {}>>;
15
16
  $table: (VxeTableConstructor & VxeTablePrivateMethods & VxeTableMethods) | undefined;
16
17
  tableConfig: import("vue").Ref<import("../../../../../components/iho-table").IhoTableConfig>;
17
- filterLabelRender: import("vue").ComputedRef<((payload: VxeColumnPropTypes.FilterSlotParams & {
18
- option: import("vxe-table").VxeTableDefines.FilterOption;
19
- }) => any) | undefined>;
18
+ lowCodeField: import("vue").ComputedRef<Partial<LowCodeTableFieldItem>>;
19
+ tableFullData: import("vue").ComputedRef<any[]>;
20
20
  multipleRef: import("vue").ComputedRef<boolean>;
21
21
  optionsRef: import("vue").ComputedRef<import("vxe-table").VxeTableDefines.FilterOption[] & VxeColumnPropTypes.Filter[]>;
22
22
  checkedRef: import("vue").WritableComputedRef<string[]>;