cnhis-design-vue 3.1.41-beta.23 → 3.1.41-beta.25

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 (36) hide show
  1. package/README.md +87 -87
  2. package/es/components/button-print/src/utils/print.js +1 -1
  3. package/es/components/field-set/src/FieldSet.vue.js +1 -1
  4. package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
  5. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  6. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  7. package/es/components/info-header/index.d.ts +83 -41
  8. package/es/components/info-header/src/InfoHeader.vue.d.ts +83 -42
  9. package/es/components/info-header/src/InfoHeader.vue.js +1 -1
  10. package/es/components/info-header/src/components/index.d.ts +3 -0
  11. package/es/components/info-header/src/components/index.js +1 -0
  12. package/es/components/info-header/src/components/infoDescription/HiddenContent.vue.js +1 -0
  13. package/es/components/info-header/src/components/infoDescription/InfoEllipsis.vue.js +1 -0
  14. package/es/components/info-header/src/{InfoDescription.vue.d.ts → components/infoDescription/index.vue.d.ts} +6 -5
  15. package/es/components/info-header/src/components/infoDescription/index.vue.js +1 -0
  16. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +38 -0
  17. package/es/components/info-header/src/components/patientInfo/index.vue.js +1 -0
  18. package/es/components/info-header/src/types/index.d.ts +29 -0
  19. package/es/components/info-header/src/types/index.js +1 -0
  20. package/es/components/scale-view/src/ScaleView.vue.js +1 -1
  21. package/es/env.d.ts +24 -24
  22. package/es/shared/utils/index.d.ts +1 -1
  23. package/es/shared/utils/index.js +1 -1
  24. package/package.json +65 -65
  25. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  26. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  27. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  28. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  29. package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
  30. package/es/components/info-header/src/HiddenContent.vue.js +0 -1
  31. package/es/components/info-header/src/InfoDescription.vue.js +0 -1
  32. package/es/components/info-header/src/InfoEllipsis.vue.js +0 -1
  33. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  34. package/es/shared/utils/tapable/index.d.ts +0 -139
  35. package/es/components/info-header/src/{HiddenContent.vue.d.ts → components/infoDescription/HiddenContent.vue.d.ts} +2 -2
  36. package/es/components/info-header/src/{InfoEllipsis.vue.d.ts → components/infoDescription/InfoEllipsis.vue.d.ts} +1 -1
@@ -1,14 +1,5 @@
1
1
  import { AnyObject, Func } from '../../../../es/shared/types';
2
2
  import { PropType, VNode } from 'vue';
3
- declare type PatientTag = Partial<{
4
- type?: 'warning' | 'info';
5
- content: string;
6
- render?: any;
7
- color?: {
8
- color?: string;
9
- textColor?: string;
10
- };
11
- }>;
12
3
  declare const _default: import("vue").DefineComponent<{
13
4
  compact: {
14
5
  type: BooleanConstructor;
@@ -27,8 +18,8 @@ declare const _default: import("vue").DefineComponent<{
27
18
  name: string;
28
19
  sex: string;
29
20
  age: string;
30
- ageUnit?: string | undefined;
31
- tagList?: Partial<{
21
+ ageUnit: string;
22
+ tagList: Partial<{
32
23
  type?: "warning" | "info" | undefined;
33
24
  content: string;
34
25
  render?: any;
@@ -36,7 +27,7 @@ declare const _default: import("vue").DefineComponent<{
36
27
  color?: string | undefined;
37
28
  textColor?: string | undefined;
38
29
  } | undefined;
39
- }>[] | undefined;
30
+ }>[];
40
31
  }>>;
41
32
  default: () => {};
42
33
  };
@@ -86,8 +77,8 @@ declare const _default: import("vue").DefineComponent<{
86
77
  name: string;
87
78
  sex: string;
88
79
  age: string;
89
- ageUnit?: string | undefined;
90
- tagList?: Partial<{
80
+ ageUnit: string;
81
+ tagList: Partial<{
91
82
  type?: "warning" | "info" | undefined;
92
83
  content: string;
93
84
  render?: any;
@@ -95,7 +86,7 @@ declare const _default: import("vue").DefineComponent<{
95
86
  color?: string | undefined;
96
87
  textColor?: string | undefined;
97
88
  } | undefined;
98
- }>[] | undefined;
89
+ }>[];
99
90
  }>>;
100
91
  default: () => {};
101
92
  };
@@ -147,23 +138,6 @@ declare const _default: import("vue").DefineComponent<{
147
138
  event: Func;
148
139
  render: () => VNode[];
149
140
  }[]>;
150
- getTagColor: ({ type }: PatientTag) => {
151
- color: string;
152
- textColor: string;
153
- };
154
- tagListExcludeEmpty: import("vue").ComputedRef<Partial<{
155
- type?: "warning" | "info" | undefined;
156
- content: string;
157
- render?: any;
158
- color?: {
159
- color?: string | undefined;
160
- textColor?: string | undefined;
161
- } | undefined;
162
- }>[]>;
163
- NEllipsis: any;
164
- NImage: any;
165
- NPopover: any;
166
- NTag: any;
167
141
  InfoDescription: import("vue").DefineComponent<{
168
142
  compact: {
169
143
  type: BooleanConstructor;
@@ -202,7 +176,12 @@ declare const _default: import("vue").DefineComponent<{
202
176
  }, {
203
177
  props: {
204
178
  compact: boolean;
205
- infoList: AnyObject[];
179
+ infoList: Partial<{
180
+ [K: string]: any;
181
+ slot: string | (() => any);
182
+ tip: string;
183
+ formField: import("../..").FieldItem;
184
+ }>[];
206
185
  labelField: string;
207
186
  valueField: string;
208
187
  minColumnWidth: string | number;
@@ -296,8 +275,8 @@ declare const _default: import("vue").DefineComponent<{
296
275
  default: () => {};
297
276
  };
298
277
  }>>, {
299
- content: string;
300
278
  contentStyle: import("vue").CSSProperties;
279
+ content: string;
301
280
  }>;
302
281
  HiddenContent: import("vue").DefineComponent<{
303
282
  content: {
@@ -363,8 +342,8 @@ declare const _default: import("vue").DefineComponent<{
363
342
  default: () => {};
364
343
  };
365
344
  }>>, {
366
- content: string;
367
345
  contentStyle: import("vue").CSSProperties;
346
+ content: string;
368
347
  }>;
369
348
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
370
349
  content: {
@@ -380,8 +359,8 @@ declare const _default: import("vue").DefineComponent<{
380
359
  default: () => {};
381
360
  };
382
361
  }>>, {
383
- content: string;
384
362
  contentStyle: import("vue").CSSProperties;
363
+ content: string;
385
364
  }>;
386
365
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
387
366
  compact: {
@@ -426,6 +405,68 @@ declare const _default: import("vue").DefineComponent<{
426
405
  minColumnWidth: string | number;
427
406
  rowHeight: string | number;
428
407
  }>;
408
+ PatientInfo: import("vue").DefineComponent<{
409
+ patientInfo: {
410
+ type: null;
411
+ required: true;
412
+ default: () => {};
413
+ };
414
+ }, {
415
+ props: {
416
+ patientInfo: Partial<{
417
+ avatar: string;
418
+ avatarPreview: string;
419
+ avatarProps: string;
420
+ avatarPreviewProps: string;
421
+ name: string;
422
+ sex: string;
423
+ age: string;
424
+ ageUnit: string;
425
+ tagList: Partial<{
426
+ type?: "warning" | "info" | undefined;
427
+ content: string;
428
+ render?: any;
429
+ color?: {
430
+ color?: string | undefined;
431
+ textColor?: string | undefined;
432
+ } | undefined;
433
+ }>[];
434
+ }>;
435
+ };
436
+ tagListExcludeEmpty: import("vue").ComputedRef<Partial<{
437
+ type?: "warning" | "info" | undefined;
438
+ content: string;
439
+ render?: any;
440
+ color?: {
441
+ color?: string | undefined;
442
+ textColor?: string | undefined;
443
+ } | undefined;
444
+ }>[]>;
445
+ getTagColor: ({ type }: Partial<{
446
+ type?: "warning" | "info" | undefined;
447
+ content: string;
448
+ render?: any;
449
+ color?: {
450
+ color?: string | undefined;
451
+ textColor?: string | undefined;
452
+ } | undefined;
453
+ }>) => {
454
+ color: string;
455
+ textColor: string;
456
+ };
457
+ NImage: any;
458
+ NEllipsis: any;
459
+ NTag: any;
460
+ NPopover: any;
461
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
462
+ patientInfo: {
463
+ type: null;
464
+ required: true;
465
+ default: () => {};
466
+ };
467
+ }>>, {
468
+ patientInfo: any;
469
+ }>;
429
470
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("openPatientInfo" | "fieldSet" | "update:compact")[], "openPatientInfo" | "fieldSet" | "update:compact", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
430
471
  compact: {
431
472
  type: BooleanConstructor;
@@ -444,8 +485,8 @@ declare const _default: import("vue").DefineComponent<{
444
485
  name: string;
445
486
  sex: string;
446
487
  age: string;
447
- ageUnit?: string | undefined;
448
- tagList?: Partial<{
488
+ ageUnit: string;
489
+ tagList: Partial<{
449
490
  type?: "warning" | "info" | undefined;
450
491
  content: string;
451
492
  render?: any;
@@ -453,7 +494,7 @@ declare const _default: import("vue").DefineComponent<{
453
494
  color?: string | undefined;
454
495
  textColor?: string | undefined;
455
496
  } | undefined;
456
- }>[] | undefined;
497
+ }>[];
457
498
  }>>;
458
499
  default: () => {};
459
500
  };
@@ -498,8 +539,8 @@ declare const _default: import("vue").DefineComponent<{
498
539
  name: string;
499
540
  sex: string;
500
541
  age: string;
501
- ageUnit?: string | undefined;
502
- tagList?: Partial<{
542
+ ageUnit: string;
543
+ tagList: Partial<{
503
544
  type?: "warning" | "info" | undefined;
504
545
  content: string;
505
546
  render?: any;
@@ -507,7 +548,7 @@ declare const _default: import("vue").DefineComponent<{
507
548
  color?: string | undefined;
508
549
  textColor?: string | undefined;
509
550
  } | undefined;
510
- }>[] | undefined;
551
+ }>[];
511
552
  }>;
512
553
  labelField: string;
513
554
  valueField: string;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as n,openBlock as a,createElementBlock as i,normalizeClass as o,createElementVNode as r,createCommentVNode as s,renderSlot as f,Fragment as l,createVNode as c,unref as d,withCtx as p,mergeProps as u,toDisplayString as v,renderList as g,createBlock as m,resolveDynamicComponent as h,createTextVNode as y,h as _,nextTick as I}from"vue";import{isString as b,isArray as k}from"lodash-es";import{NPopover as w,NImage as x,NTag as $,NEllipsis as S}from"naive-ui";import z from"./InfoDescription.vue.js";import H from"../../../_virtual/plugin-vue_export-helper.js";const P={class:"c-info-header__operation"},j={key:0,class:"c-info-header__divider"},C={class:"c-info-header__patient"},L={class:"c-info-header__patientHeader"},F={key:0,class:"c-info-header__patientHeader--name"},M={key:1,class:"c-info-header__patientHeader--sex"},q={key:2,class:"c-info-header__patientHeader--age"},A={class:"c-info-header__setting"},D=["onClick"];var N=H(e({__name:"InfoHeader",props:{compact:{type:Boolean,required:!0},separator:{type:String,default:":"},patientInfo:{type:Object,default:()=>({})},infoList:{type:Array,required:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},minColumnWidth:{type:[String,Number],default:180},rowHeight:{type:[String,Number],default:32},settingIcons:{type:Array,default:()=>["patientInfo","fieldSet","compact"]}},emits:["openPatientInfo","fieldSet","update:compact"],setup(e,{expose:H,emit:N}){const B=e,O=t();function R(){var e;return null==(e=O.value)?void 0:e.updateColumn()}const U={patientInfo:{event:function(){N("openPatientInfo")},render:()=>[_("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaobianji"})]},fieldSet:{event:function(){N("fieldSet")},render:()=>[_("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaoshezhi"})]},compact:{event:async function(){N("update:compact",!B.compact),await I(),await R()},render:()=>[_("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaojiantouxia"})]}},W=n((()=>B.settingIcons.map((e=>(b(e)?U[e]:e)||{}))));function E({type:e="warning"}){return{color:{warning:"#fcc200",info:"rgba(45, 122, 255, 0.1)"}[e],textColor:{warning:"#fff",info:"#2563F4"}[e]}}const G=n((()=>B.patientInfo&&k(B.patientInfo.tagList)?B.patientInfo.tagList.filter((e=>e.render||b(e.content)&&e.content)):[]));return H({update:R}),(t,n)=>(a(),i("div",{class:o(["c-info-header",{"is-compact":e.compact}])},[r("section",P,[s(" 操作区插槽 "),f(t.$slots,"operation")]),t.$slots.operation?(a(),i("div",j)):s("v-if",!0),r("section",C,[s(" 患者信息区插槽 "),f(t.$slots,"patientModule"),s(" 头像区插槽 "),f(t.$slots,"avatarModule",{},(()=>[t.$slots.avatarModule?s("v-if",!0):(a(),i(l,{key:0},[s(" 头像插槽 "),f(t.$slots,"avatar",{},(()=>[c(d(w),null,{trigger:p((()=>[c(d(x),u({style:{"border-radius":"50%"},width:40,height:40,"preview-disabled":"",src:e.patientInfo.avatar},e.patientInfo.avatarProps),null,16,["src"])])),default:p((()=>[c(d(x),u({width:200,"preview-disabled":"",src:e.patientInfo.avatarPreview||e.patientInfo.avatar},e.patientInfo.avatarPreviewProps),null,16,["src"])])),_:1})])),r("section",null,[r("header",L,[e.patientInfo.name?(a(),i("div",F,v(e.patientInfo.name),1)):s("v-if",!0),e.patientInfo.sex?(a(),i("div",M,"/ "+v(e.patientInfo.sex),1)):s("v-if",!0),null!=e.patientInfo.age?(a(),i("div",q," / "+v(e.patientInfo.age)+v(e.patientInfo.ageUnit||"岁"),1)):s("v-if",!0),s(" tag区插槽 "),f(t.$slots,"tags",{tagList:d(G)},(()=>[(a(!0),i(l,null,g(e.patientInfo.tagList||[],(e=>(a(),m(d($),u({key:e.content,size:"medium",bordered:!1,color:E(e)},e),{default:p((()=>[e.render?(a(),m(h(e.render),{key:0})):(a(),m(d(S),{key:1,style:{"max-width":"96px"}},{default:p((()=>[y(v(e.content),1)])),_:2},1024))])),_:2},1040,["color"])))),128))]))]),s(" 头像信息区插槽 "),f(t.$slots,"avatarInfo")])],64))]))]),c(z,u({ref_key:"infoDescriptionRef",ref:O,"root-slot":t.$slots},t.$props),{info:p((()=>[s(" 信息描述区插槽 "),f(t.$slots,"info")])),_:3},16,["root-slot"]),r("section",A,[s(" 设置区插槽 "),f(t.$slots,"setting"),t.$slots.setting?s("v-if",!0):(a(!0),i(l,{key:0},g(d(W),(e=>(a(),i("div",{key:e,class:"c-info-header__settingIcon",onClick:e.event},[(a(),m(h(e.render)))],8,D)))),128))])],2))}}),[["__file","InfoHeader.vue"]]);export{N as default};
1
+ import{defineComponent as e,ref as t,computed as n,openBlock as o,createElementBlock as i,normalizeClass as a,createElementVNode as s,createCommentVNode as r,renderSlot as l,createVNode as c,unref as f,withCtx as p,mergeProps as d,Fragment as u,renderList as m,createBlock as v,resolveDynamicComponent as h,h as g,nextTick as y}from"vue";import{isString as _}from"lodash-es";import I from"./components/infoDescription/index.vue.js";import $ from"./components/patientInfo/index.vue.js";import b from"../../../_virtual/plugin-vue_export-helper.js";const x={class:"c-info-header__operation"},S={key:0,class:"c-info-header__divider"},z={class:"c-info-header__setting"},j=["onClick"];var k=b(e({__name:"InfoHeader",props:{compact:{type:Boolean,required:!0},separator:{type:String,default:":"},patientInfo:{type:Object,default:()=>({})},infoList:{type:Array,required:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},minColumnWidth:{type:[String,Number],default:180},rowHeight:{type:[String,Number],default:32},settingIcons:{type:Array,default:()=>["patientInfo","fieldSet","compact"]}},emits:["openPatientInfo","fieldSet","update:compact"],setup(e,{expose:b,emit:k}){const C=e,w=t();function H(){var e;return null==(e=w.value)?void 0:e.updateColumn()}const M={patientInfo:{event:function(){k("openPatientInfo")},render:()=>[g("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaobianji"})]},fieldSet:{event:function(){k("fieldSet")},render:()=>[g("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaoshezhi"})]},compact:{event:async function(){k("update:compact",!C.compact),await y(),await H()},render:()=>[g("i",{class:"iconfont info-header--icon-a-menzhenyishengzhanxitongtubiaojiantouxia"})]}},q=n((()=>C.settingIcons.map((e=>(_(e)?M[e]:e)||{}))));return b({update:H}),(t,n)=>(o(),i("div",{class:a(["c-info-header",{"is-compact":e.compact}])},[s("section",x,[r(" 操作区插槽 "),l(t.$slots,"operation")]),t.$slots.operation?(o(),i("div",S)):r("v-if",!0),r(" 患者信息区插槽,需要自己实现整个患者信息区时使用 "),l(t.$slots,"patientModule",{},(()=>[c(f($),{"patient-info":e.patientInfo},{avatarInfo:p((()=>[r(" 头像区补充内容插槽 (会插入头像下方) "),l(t.$slots,"avatarInfo")])),avatar:p((()=>[r(" 头像插槽 "),l(t.$slots,"avatar")])),tags:p((()=>[r(" 标签插槽 "),l(t.$slots,"tags")])),avatarModule:p((()=>[r(" 头像信息区插槽 (包含头像, 文本, 标签) "),l(t.$slots,"avatarModule")])),_:3},8,["patient-info"])])),c(f(I),d({ref_key:"infoDescriptionRef",ref:w,"root-slot":t.$slots},t.$props),{info:p((()=>[r(" 信息描述区插槽 "),l(t.$slots,"info")])),_:3},16,["root-slot"]),s("section",z,[r(" 设置区插槽 "),l(t.$slots,"setting",{},(()=>[(o(!0),i(u,null,m(f(q),(e=>(o(),i("div",{key:e,class:"c-info-header__settingIcon",onClick:e.event},[(o(),v(h(e.render)))],8,j)))),128))]))])],2))}}),[["__file","InfoHeader.vue"]]);export{k as default};
@@ -0,0 +1,3 @@
1
+ import InfoDescription from './infoDescription/index.vue';
2
+ import PatientInfo from './patientInfo/index.vue';
3
+ export { InfoDescription, PatientInfo };
@@ -0,0 +1 @@
1
+ export{default as InfoDescription}from"./infoDescription/index.vue.js";export{default as PatientInfo}from"./patientInfo/index.vue.js";
@@ -0,0 +1 @@
1
+ import{defineComponent as t,ref as n,computed as e,openBlock as i,createElementBlock as o,normalizeStyle as r,unref as l,createElementVNode as u,createVNode as a,normalizeClass as c}from"vue";import s from"./InfoEllipsis.vue.js";import d from"../../../../../_virtual/plugin-vue_export-helper.js";const f={class:"c-info-header__hidden--content"};var p=d(t({__name:"HiddenContent",props:{content:{type:String,default:""},tip:String,width:{type:Number},contentStyle:{type:Object,default:()=>({})}},setup(t){const d=t,p=n(!0);function h(){p.value=!p.value}const v=e((()=>{const t=d.width+"px";return{maxWidth:t,width:t}})),_=e((()=>{if(!d.width)return{};const t=d.width-40+"px";return Object.assign({},d.contentStyle,{maxWidth:t})})),g=e((()=>{let{content:t}=d;if(t+="",!p.value)return t;if(!t)return"-";const n=t.length;if(!n||1===n)return t;const e=Math.floor(n/2),i=Math.floor((n-e)/2);return`${t.substring(0,i)}${"*".repeat(e)}${null==t?void 0:t.substring(i+e)}`}));return(n,e)=>(i(),o("div",{class:"c-info-header__hidden",style:r(l(v))},[u("div",f,[a(s,{"content-style":l(_),content:l(g),tip:t.tip},null,8,["content-style","content","tip"])]),u("i",{onClick:h,class:c(["c-info-header__hidden--icon","iconfont","info-header--icon-"+(p.value?"guanbi-yanjing":"faxian-yanjing")])},null,2)],4))}}),[["__file","HiddenContent.vue"]]);export{p as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as t,openBlock as e,createBlock as l,unref as i,withCtx as o,createElementVNode as p,createVNode as n,normalizeStyle as r,createTextVNode as u,toDisplayString as a}from"vue";import{NTooltip as s,NEllipsis as f}from"naive-ui";import d from"../../../../../_virtual/plugin-vue_export-helper.js";var m=d(t({__name:"InfoEllipsis",props:{content:{type:String,default:""},tip:{type:String},contentStyle:{type:Object,default:()=>({})}},setup:t=>(d,m)=>(e(),l(i(s),{disabled:!t.tip},{trigger:o((()=>[p("section",null,[n(i(f),{style:r(t.contentStyle),tooltip:{placement:t.tip?"bottom":"top"}},{default:o((()=>{var e;return[u(a(null!=(e=t.content)?e:"-"),1)]})),_:1},8,["style","tooltip"])])])),default:o((()=>[u(" "+a(t.tip),1)])),_:1},8,["disabled"]))}),[["__file","InfoEllipsis.vue"]]);export{m as default};
@@ -1,5 +1,6 @@
1
- import { AnyObject, Func } from '../../../../es/shared/types';
1
+ import { AnyObject, Func } from '../../../../../../es/shared/types';
2
2
  import { CSSProperties } from 'vue';
3
+ import { InfoHeaderTypes } from '../../../../../../es/components/info-header/src/types';
3
4
  declare const _default: import("vue").DefineComponent<{
4
5
  compact: {
5
6
  type: BooleanConstructor;
@@ -38,7 +39,7 @@ declare const _default: import("vue").DefineComponent<{
38
39
  }, {
39
40
  props: {
40
41
  compact: boolean;
41
- infoList: AnyObject[];
42
+ infoList: InfoHeaderTypes.InfoItem[];
42
43
  labelField: string;
43
44
  valueField: string;
44
45
  minColumnWidth: string | number;
@@ -132,8 +133,8 @@ declare const _default: import("vue").DefineComponent<{
132
133
  default: () => {};
133
134
  };
134
135
  }>>, {
135
- content: string;
136
136
  contentStyle: CSSProperties;
137
+ content: string;
137
138
  }>;
138
139
  HiddenContent: import("vue").DefineComponent<{
139
140
  content: {
@@ -199,8 +200,8 @@ declare const _default: import("vue").DefineComponent<{
199
200
  default: () => {};
200
201
  };
201
202
  }>>, {
202
- content: string;
203
203
  contentStyle: CSSProperties;
204
+ content: string;
204
205
  }>;
205
206
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
206
207
  content: {
@@ -216,8 +217,8 @@ declare const _default: import("vue").DefineComponent<{
216
217
  default: () => {};
217
218
  };
218
219
  }>>, {
219
- content: string;
220
220
  contentStyle: CSSProperties;
221
+ content: string;
221
222
  }>;
222
223
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
223
224
  compact: {
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as t,nextTick as l,onMounted as n,watch as o,onBeforeUnmount as i,onDeactivated as r,onActivated as a,openBlock as u,createElementBlock as s,normalizeStyle as d,createVNode as c,unref as f,withCtx as p,createCommentVNode as m,renderSlot as h,Fragment as v,renderList as y,createBlock as _,createElementVNode as w}from"vue";import{useThrottleFn as b,useEventListener as g}from"@vueuse/core";import{NScrollbar as x,NDescriptions as W,NDescriptionsItem as F}from"naive-ui";import S from"../../../../../shared/components/SlotRender/SlotRender.js";import k from"./InfoEllipsis.vue.js";import C from"./HiddenContent.vue.js";import j from"../../../../../_virtual/plugin-vue_export-helper.js";const H=w("section",{style:{height:"10px"}},null,-1),I=w("section",{style:{height:"12px"}},null,-1);var L=j(e({__name:"index",props:{compact:{type:Boolean,default:!0},infoList:{default:()=>[]},labelField:{default:"label"},valueField:{default:"value"},minColumnWidth:{default:180},rowHeight:{default:32},rootSlot:null},setup(e,{expose:w}){const j=e;function L({bold:e=!0,contentStyle:t={}}={}){return{fontWeight:e?700:500,...t}}function R(e,{bold:t=!0,contentStyle:l={}}={}){const n=B.value[e]+"px";return{width:n,maxWidth:n,fontWeight:t?700:500,...l}}function A(e){return["电话","身份证"].some((t=>{var l,n;return null==(n=null==(l=e[j.labelField])?void 0:l.includes)?void 0:n.call(l,t)}))}const M=t(3),q=t(),z=t(0),B=t([]),E=b((async function(){await l();const e=q.value;if(!e)return;const{clientWidth:t}=e;M.value=Math.floor(t/+j.minColumnWidth),z.value=Math.floor(t/M.value),await l();const n=e.querySelectorAll(".n-descriptions-table-content__label");n&&(B.value=Array.from(n).map((e=>z.value-e.clientWidth-8)))}),200,!0,!1);let $;function D(){clearInterval($)}function G(){D(),$=setInterval(E,700)}return n(E),o([()=>j.minColumnWidth,()=>j.infoList],E,{flush:"post",deep:!0}),g(window,"resize",E),i(D),r(D),a(G),n(G),w({updateColumn:E}),(t,l)=>(u(),s("section",{class:"c-info-header__info",ref_key:"infoRef",ref:q,style:d({"--row-height":e.rowHeight,"--column-width":z.value})},[c(f(x),{class:"c-info-header__infoWrapper",style:d({"--row-num":e.compact?1:2})},{default:p((()=>[m(" 描述信息区插槽 "),h(t.$slots,"info",{},(()=>[H,c(f(W),{"label-align":"right",style:{width:"100%"},"label-placement":"left",separator:":",column:M.value},{default:p((()=>[(u(!0),s(v,null,y(e.infoList,((t,l)=>(u(),_(f(F),{key:t[e.labelField],label:t[e.labelField]},{default:p((()=>[t.slot?(u(),_(f(S),{key:0,renderer:t.slot,"root-slots":e.rootSlot,item:t,style:d(L(t)),width:B.value[l]},null,8,["renderer","root-slots","item","style","width"])):A(t)?(u(),_(C,{key:1,content:t[e.valueField],tip:t.tip,"content-style":L(t),width:B.value[l]},null,8,["content","tip","content-style","width"])):(u(),_(k,{key:2,"content-style":R(l,t),content:t[e.valueField],tip:t.tip},null,8,["content-style","content","tip"]))])),_:2},1032,["label"])))),128))])),_:1},8,["column"]),I]))])),_:3},8,["style"])],4))}}),[["__file","index.vue"]]);export{L as default};
@@ -0,0 +1,38 @@
1
+ import { InfoHeaderTypes } from '../../../../../../es/components/info-header/src/types';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ patientInfo: {
4
+ type: null;
5
+ required: true;
6
+ default: () => {};
7
+ };
8
+ }, {
9
+ props: {
10
+ patientInfo: InfoHeaderTypes.PatientInfo;
11
+ };
12
+ tagListExcludeEmpty: import("vue").ComputedRef<Partial<{
13
+ type?: "warning" | "info" | undefined;
14
+ content: string;
15
+ render?: any;
16
+ color?: {
17
+ color?: string | undefined;
18
+ textColor?: string | undefined;
19
+ } | undefined;
20
+ }>[]>;
21
+ getTagColor: ({ type }: InfoHeaderTypes.PatientTag) => {
22
+ color: string;
23
+ textColor: string;
24
+ };
25
+ NImage: any;
26
+ NEllipsis: any;
27
+ NTag: any;
28
+ NPopover: any;
29
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
30
+ patientInfo: {
31
+ type: null;
32
+ required: true;
33
+ default: () => {};
34
+ };
35
+ }>>, {
36
+ patientInfo: any;
37
+ }>;
38
+ export default _default;
@@ -0,0 +1 @@
1
+ import{defineComponent as e,computed as t,openBlock as a,createElementBlock as n,renderSlot as i,createVNode as r,unref as o,withCtx as s,mergeProps as f,createElementVNode as l,toDisplayString as p,createCommentVNode as d,Fragment as c,renderList as u,createBlock as v,resolveDynamicComponent as _,createTextVNode as I}from"vue";import{isArray as g,isString as m}from"lodash-es";import{NPopover as h,NImage as w,NTag as x,NEllipsis as y}from"naive-ui";import k from"../../../../../_virtual/plugin-vue_export-helper.js";const b={class:"c-info-header__patient"},H={class:"c-info-header__patientHeader"},L={key:0,class:"c-info-header__patientHeader--name"},P={key:1,class:"c-info-header__patientHeader--sex"},$={key:2,class:"c-info-header__patientHeader--age"};var j=k(e({__name:"index",props:{patientInfo:{default:()=>({})}},setup(e){const k=e,j=t((()=>k.patientInfo&&g(k.patientInfo.tagList)?k.patientInfo.tagList.filter((e=>e.render||m(e.content)&&e.content)):[]));function z({type:e="warning"}){return{color:{warning:"#fcc200",info:"rgba(45, 122, 255, 0.1)"}[e],textColor:{warning:"#fff",info:"#2563F4"}[e]}}return(t,g)=>(a(),n("section",b,[i(t.$slots,"avatarModule",{},(()=>[i(t.$slots,"avatar",{},(()=>[r(o(h),null,{trigger:s((()=>[r(o(w),f({style:{"border-radius":"50%"},width:40,height:40,"preview-disabled":"",src:e.patientInfo.avatar},e.patientInfo.avatarProps),null,16,["src"])])),default:s((()=>[r(o(w),f({width:200,"preview-disabled":"",src:e.patientInfo.avatarPreview||e.patientInfo.avatar},e.patientInfo.avatarPreviewProps),null,16,["src"])])),_:1})])),l("section",null,[l("header",H,[e.patientInfo.name?(a(),n("div",L,p(e.patientInfo.name),1)):d("v-if",!0),e.patientInfo.sex?(a(),n("div",P,"/ "+p(e.patientInfo.sex),1)):d("v-if",!0),null!=e.patientInfo.age?(a(),n("div",$," / "+p(e.patientInfo.age)+p(e.patientInfo.ageUnit||"岁"),1)):d("v-if",!0),i(t.$slots,"tags",{tagList:o(j)},(()=>[(a(!0),n(c,null,u(e.patientInfo.tagList||[],(e=>(a(),v(o(x),f({key:e.content,size:"medium",bordered:!1,color:z(e)},e),{default:s((()=>[e.render?(a(),v(_(e.render),{key:0})):(a(),v(o(y),{key:1,style:{"max-width":"96px"}},{default:s((()=>[I(p(e.content),1)])),_:2},1024))])),_:2},1040,["color"])))),128))]))]),i(t.$slots,"avatarInfo")])]))]))}}),[["__file","index.vue"]]);export{j as default};
@@ -0,0 +1,29 @@
1
+ import { FieldItem } from '../../../../../es/components/form-render';
2
+ export declare namespace InfoHeaderTypes {
3
+ type InfoItem = Partial<{
4
+ slot: string | (() => any);
5
+ tip: string;
6
+ formField: FieldItem;
7
+ [K: string]: any;
8
+ }>;
9
+ type PatientTag = Partial<{
10
+ type?: 'warning' | 'info';
11
+ content: string;
12
+ render?: any;
13
+ color?: {
14
+ color?: string;
15
+ textColor?: string;
16
+ };
17
+ }>;
18
+ type PatientInfo = Partial<{
19
+ avatar: string;
20
+ avatarPreview: string;
21
+ avatarProps: string;
22
+ avatarPreviewProps: string;
23
+ name: string;
24
+ sex: string;
25
+ age: string;
26
+ ageUnit: string;
27
+ tagList: PatientTag[];
28
+ }>;
29
+ }
@@ -1 +1 @@
1
- import{defineComponent as e,reactive as o,ref as a,watch as t,nextTick as i,openBlock as n,createElementBlock as s,normalizeClass as l,unref as r,createCommentVNode as u,Fragment as c,createBlock as m,mergeProps as v,createElementVNode as p,normalizeStyle as d,createVNode as f,withCtx as g,renderList as y,toDisplayString as k,createTextVNode as h,resolveDynamicComponent as C,h as w}from"vue";import b from"./hooks/use-noData.js";import{getScaleViewState as S}from"./hooks/scaleview-state.js";import E from"./hooks/scaleview-props.js";import{ScaleViewComputed as _}from"./hooks/scaleview-computed.js";import{ScaleViewInit as A}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as j}from"./hooks/scaleview-submit.js";import{handleQueryParams as T,isCollection as D,isEvaluation as O}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import x from"./components/NoData.vue.js";import I from"../../../shared/components/SvgIcon/SvgIcon.vue.js";import P from"./components/EvaluateCountdown.vue.js";import N from"./components/EvaluatePage.vue.js";import q from"./components/AnswerParse.vue.js";import M from"./components/ScaleScore.js";import{useDialog as B,useMessage as R,NForm as V,NFormItem as F,NButton as K}from"naive-ui";import H from"../../../_virtual/plugin-vue_export-helper.js";const W=["innerHTML"],U={key:0,class:"required-text"},J={key:1,class:"evalute-label"},X=["onClick"],G={key:1,class:"footer"};var Q=H(e({__name:"ScaleView",props:E,emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:E,emit:H}){const Q=e,{ScaleViewState:$}=S(),z=o($),Y=B(),Z=R(),ee=a(null),oe=a(null),{noDataState:ae,setNoData:te,resetNodata:ie}=b(),ne=T(),{showEvatip:se,isFormBoldOpen:le,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:me,hasScore:ve,isPreviewScale:pe,showEvaluateEntry:de,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:ke,propsConfig:he,evaluatePageProps:Ce,evaluateCountdownProps:we,skipCover:be,scaleEdit:Se}=_(Q,z,{query:ne}),{initForm:Ee}=A(Q,z,H,{query:ne}),{submitMethod:_e}=j(Q,z,H,{query:ne}),{nextLogicEvent:Ae,handleDynamicDataRelation:je}=L(Q,z);(()=>{let{id:e}=ne;e&&(z.shareId=e)})();const Te=e=>{try{ie(),Ee(e)}catch(e){console.log(e,"--error"),z.spinning=!1,z.hasFrontAddress=!1,te(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};t((()=>Q.ids),((e,o)=>{o?e.guage_id&&e.guage_id!=o.guage_id&&Te(e):e.guage_id&&Te(e)}),{immediate:!0}),t((()=>Q.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;z.form={},z.formArray=[];const o=JSON.parse(JSON.stringify(e));i((()=>{Ee(o)}))}),{immediate:!0});const De=e=>{z.showEvaluateSettingWrap=!1,z.showEvaluateCountdown=!!e,H("startWriteScale")},Oe=()=>{console.log("----closeEvaluateCountdown"),z.showEvaluateCountdown=!1,pe.value||(z.banSubmit=!0,_e(),Y.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>{}}))},Le=e=>{Y.warning({title:"提示",content:()=>w("div",{class:"evatip-container"},[w("span","答案解析:"),w("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},xe=(e,o,a)=>{console.log(e,"--val");let{choiceObj:t,isSetObj:i}=a||{};switch(o.type.includes("SELECT")||(z.form[o.val_key]=e),o.type){case"SELECT":case"EVALUATE_SELECT":let{value:a,list:n=[]}=e;z.form[o.val_key]=a,Ae(e,o,z.formArray),je(n,o,z.formArray);break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&(z.choiceComObj[o.val_key]=t),Ae(e,o,z.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,o,z.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":z.submitForm[o.val_key]=e}},Ie=(e,o)=>{console.log(o),z.form[o.val_key]=e},Pe=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const o=e||[],a=[],t=[];return o.forEach((e=>{t.push(e),a.push(e.labelName)})),z.labelSelectedList=o,{labelStr:a.join(","),labels:t}},Ne=()=>{var e;if(!z.formArray.find((e=>O(e.type))))return void qe("确认要提交吗?");let{evaluateResultSetting:o}=z.config;if(!o||!Object.keys(o).length&&!de.value||Se.value)return void qe("确认要结束测评吗?");if("formIframe"==Q.openType&&de.value)return void H("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:o,totalLen:t}=e;o<t?a="存在未作答的题目,确定要提前结束测评吗?":!(null==z?void 0:z.showEvaluateCountdown)&&(a="确认要结束测评吗?")}qe(a)},qe=e=>{Y.warning({title:"温馨提示",content:()=>w("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:()=>{Me()},onNegativeClick(){}})},Me=()=>{var e;null==(e=oe.value)||e.validate((e=>{var o;if(e){console.log(e);let a=(null==(o=e[0])?void 0:o[0])||{},t=a.field,i=a.message,n=z.formArray.find((e=>e.databaseTitle===t));return n&&(t=n.title),Z.error(t+i),!1}_e()}))},Be=()=>{H("onCloseSetting")};return E({getScaleData:()=>({...z}),onSubmit:Ne,cancel:Be}),(e,o)=>(n(),s("div",{class:l(["c-scale",{"c-scale-nobtn":r(ge)}])},[u(' <template v-if="state.spinning">\n <n-spin :show="state.spinning" description="加载中"></n-spin>\n </template> '),z.spinning||z.hasFrontAddress?u("v-if",!0):(n(),s(c,{key:0},[r(ae).noData?(n(),m(x,{key:0,noDataImg:r(ae).noDataImg,noDataTip:r(ae).noDataTip},null,8,["noDataImg","noDataTip"])):(n(),s(c,{key:1},[r(de)&&!r(be)?(n(),m(N,v({key:0},r(Ce),{onWriteGuage:De}),null,16)):(n(),s(c,{key:1},[r(fe)?(n(),m(P,v({key:0,ref_key:"countdownDom",ref:ee},r(we),{onCloseEvaluateCountdown:Oe}),null,16)):u("v-if",!0),p("div",{class:l(["scale-container",{"scale-container-nopadding":r(ue),"scale-container-hasfooter":r(ge)}]),style:d(r(re))},[r(ve)?(n(),m(r(M),{key:0,config:z.config,maxScore:z.maxScore},null,8,["config","maxScore"])):u("v-if",!0),f(r(V),{ref_key:"formRef",ref:oe,model:z.form,rules:z.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(n(!0),s(c,null,y(z.formArray,((e,o)=>(n(),s(c,{key:(e.id||e.seq)+o},[r(ce)(e)?(n(),m(r(F),{key:0,path:e.val_key,"show-label":!r(D)(e.type),class:"c-scle-form-item"},{label:g((()=>[p("span",{class:l({"scale-label-required":r(le)(e)}),innerHTML:r(me)(e)},null,10,W),r(le)(e)?(n(),s("span",U,"(必填)")):u("v-if",!0),r(ye)(e)?(n(),s("span",J,k(r(ye)(e)),1)):u("v-if",!0),r(se)(e)?(n(),s("span",{key:2,class:"evalute-tip",onClick:o=>(async e=>{var o;if(z.evatipMap[e.id])return void Le(z.evatipMap[e.id]);let a="getSubjectAnswer";const t=(null==(o=Q.scaleApiConfig)?void 0:o[a])||null;if(!t||"function"!=typeof t)return void Z.error(`${a} Is not a function`);let i=await t(e.id);i&&(z.evatipMap[e.id]||(z.evatipMap[e.id]=i,Le(i)))})(e)},[f(r(I),{"icon-class":"a-xitongtubiaotishi"}),h(" 查看提示 ")],8,X)):u("v-if",!0)])),default:g((()=>[(n(),m(C(e.renderCom),v(r(he)(e,o),{key:(e.id||e.seq)+o,onScaleChange:xe,onOnChange:o=>((e,o)=>{z.form[o.val_key]=Pe(e)})(o,e),onVodFileList:Ie}),null,16,["onOnChange"])),r(ke)(e)?(n(),m(q,{key:0,item:e},null,8,["item"])):u("v-if",!0)])),_:2},1032,["path","show-label"])):u("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),r(ge)?(n(),s("div",G,[u(" 分享的链接 隐藏取消按钮 "),"guage"!==Q.sourceType?(n(),m(r(K),{key:0,onClick:Be},{default:g((()=>[h("取消")])),_:1})):u("v-if",!0),Q.isLock?u("v-if",!0):(n(),m(r(K),{key:1,onClick:Ne,disabled:z.banSubmit,type:"primary"},{default:g((()=>[h("保存")])),_:1},8,["disabled"]))])):u("v-if",!0)],64))],64))],64))],2))}}),[["__file","ScaleView.vue"]]);export{Q as default};
1
+ import{defineComponent as e,reactive as o,ref as a,watch as t,nextTick as i,openBlock as n,createElementBlock as s,normalizeClass as l,unref as r,createCommentVNode as u,Fragment as c,createBlock as m,mergeProps as v,createElementVNode as p,normalizeStyle as d,createVNode as f,withCtx as g,renderList as y,toDisplayString as k,createTextVNode as h,resolveDynamicComponent as C,h as w}from"vue";import b from"./hooks/use-noData.js";import{getScaleViewState as S}from"./hooks/scaleview-state.js";import E from"./hooks/scaleview-props.js";import{ScaleViewComputed as _}from"./hooks/scaleview-computed.js";import{ScaleViewInit as A}from"./hooks/scaleview-init.js";import{ScaleViewSubmit as j}from"./hooks/scaleview-submit.js";import{handleQueryParams as T,isCollection as D,isEvaluation as O}from"./utils/judge-types.js";import{useEvent as L}from"./hooks/use-event.js";import x from"./components/NoData.vue.js";import I from"../../../shared/components/SvgIcon/SvgIcon.vue.js";import P from"./components/EvaluateCountdown.vue.js";import N from"./components/EvaluatePage.vue.js";import q from"./components/AnswerParse.vue.js";import M from"./components/ScaleScore.js";import{useDialog as B,useMessage as R,NForm as V,NFormItem as F,NButton as K}from"naive-ui";import H from"../../../_virtual/plugin-vue_export-helper.js";const W=["innerHTML"],U={key:0,class:"required-text"},J={key:1,class:"evalute-label"},X=["onClick"],G={key:1,class:"footer"};var Q=H(e({__name:"ScaleView",props:E,emits:["onCloseSetting","submitNoRequest","onSubmit","startWriteScale"],setup(e,{expose:E,emit:H}){const Q=e,{ScaleViewState:$}=S(),z=o($),Y=B(),Z=R(),ee=a(null),oe=a(null),{noDataState:ae,setNoData:te,resetNodata:ie}=b(),ne=T(),{showEvatip:se,isFormBoldOpen:le,scaleStyle:re,handlePageClass:ue,isShowItem:ce,handleShowQuestionNumber:me,hasScore:ve,isPreviewScale:pe,showEvaluateEntry:de,showEvaluateCoundownPage:fe,showSaveBtn:ge,showEvaluateLabel:ye,showAnswerParse:ke,propsConfig:he,evaluatePageProps:Ce,evaluateCountdownProps:we,skipCover:be,scaleEdit:Se}=_(Q,z,{query:ne}),{initForm:Ee}=A(Q,z,H,{query:ne}),{submitMethod:_e}=j(Q,z,H,{query:ne}),{nextLogicEvent:Ae,handleDynamicDataRelation:je}=L(Q,z);(()=>{let{id:e}=ne;e&&(z.shareId=e)})();const Te=e=>{try{ie(),Ee(e)}catch(e){console.log(e,"--error"),z.spinning=!1,z.hasFrontAddress=!1,te(!0,null==e?void 0:e.resultMsg,null==e?void 0:e.result)}};t((()=>Q.ids),((e,o)=>{o?e.guage_id&&e.guage_id!=o.guage_id&&Te(e):e.guage_id&&Te(e)}),{immediate:!0}),t((()=>Q.guageData),(e=>{if(!e||!Object.keys(e||{}).length)return;z.form={},z.formArray=[];const o=JSON.parse(JSON.stringify(e));i((()=>{Ee(o)}))}),{immediate:!0});const De=e=>{z.showEvaluateSettingWrap=!1,z.showEvaluateCountdown=!!e,H("startWriteScale")},Oe=()=>{console.log("----closeEvaluateCountdown"),z.showEvaluateCountdown=!1,pe.value||(z.banSubmit=!0,_e(),Y.warning({title:"温馨提示",content:"测评时间到了,结束测评!",maskClosable:!1,positiveText:"确定",onPositiveClick:()=>{}}))},Le=e=>{Y.warning({title:"提示",content:()=>w("div",{class:"evatip-container"},[w("span","答案解析:"),w("p",e)]),class:"c-evatip-dialog-wrap",showIcon:!1,positiveText:"确定",negativeText:"关闭",maskClosable:!1,onPositiveClick(){},onNegativeClick(){}})},xe=(e,o,a)=>{console.log(e,"--val");let{choiceObj:t,isSetObj:i}=a||{};switch(o.type.includes("SELECT")||(z.form[o.val_key]=e),o.type){case"SELECT":case"EVALUATE_SELECT":let{value:a,list:n=[]}=e;z.form[o.val_key]=a,Ae(e,o,z.formArray),je(n,o,z.formArray);break;case"RADIO_BLOCK":case"CHECKBOX_BLOCK":i&&(z.choiceComObj[o.val_key]=t),Ae(e,o,z.formArray);break;case"EVALUATE_RADIO_BLOCK":case"EVALUATE_CHECKBOX_BLOCK":Ae(e,o,z.formArray);break;case"DATE":case"TIME":case"DATETIME":case"SEARCH_CASCADE":z.submitForm[o.val_key]=e}},Ie=(e,o)=>{console.log(o),z.form[o.val_key]=e},Pe=e=>{if(!e||!e.length)return{labelStr:"",labels:[]};const o=e||[],a=[],t=[];return o.forEach((e=>{t.push(e),a.push(e.labelName)})),z.labelSelectedList=o,{labelStr:a.join(","),labels:t}},Ne=()=>{var e;if(!z.formArray.find((e=>O(e.type))))return void qe("确认要提交吗?");let{evaluateResultSetting:o}=z.config;if(!o||!Object.keys(o).length&&!de.value||Se.value)return void qe("确认要结束测评吗?");if("formIframe"==Q.openType&&de.value)return void H("submitNoRequest");let a="确定要提前结束测评吗?";if(fe.value&&(null==(e=ee.value)?void 0:e.getCountdownObj)){const e=ee.value.getCountdownObj(),{setAnswered:o,totalLen:t}=e;o<t?a="存在未作答的题目,确定要提前结束测评吗?":!(null==z?void 0:z.showEvaluateCountdown)&&(a="确认要结束测评吗?")}qe(a)},qe=e=>{Y.warning({title:"温馨提示",content:()=>w("div",{style:{paddingLeft:"30px"}},e),positiveText:"确定",negativeText:"取消",maskClosable:!1,closable:!1,positiveButtonProps:{type:"primary"},onPositiveClick:()=>{Me()},onNegativeClick(){}})},Me=()=>{var e;null==(e=oe.value)||e.validate((e=>{var o;if(e){console.log(e);let a=(null==(o=e[0])?void 0:o[0])||{},t=a.field,i=a.message,n=z.formArray.find((e=>e.databaseTitle===t));return n&&(t=n.title),Z.error(t+i),!1}_e()}))},Be=()=>{H("onCloseSetting")};return E({getScaleData:()=>({...z}),onSubmit:Ne,cancel:Be}),(e,o)=>(n(),s("div",{class:l(["c-scale",{"c-scale-nobtn":r(ge)}])},[u(' <template v-if="state.spinning">\r\n <n-spin :show="state.spinning" description="加载中"></n-spin>\r\n </template> '),z.spinning||z.hasFrontAddress?u("v-if",!0):(n(),s(c,{key:0},[r(ae).noData?(n(),m(x,{key:0,noDataImg:r(ae).noDataImg,noDataTip:r(ae).noDataTip},null,8,["noDataImg","noDataTip"])):(n(),s(c,{key:1},[r(de)&&!r(be)?(n(),m(N,v({key:0},r(Ce),{onWriteGuage:De}),null,16)):(n(),s(c,{key:1},[r(fe)?(n(),m(P,v({key:0,ref_key:"countdownDom",ref:ee},r(we),{onCloseEvaluateCountdown:Oe}),null,16)):u("v-if",!0),p("div",{class:l(["scale-container",{"scale-container-nopadding":r(ue),"scale-container-hasfooter":r(ge)}]),style:d(r(re))},[r(ve)?(n(),m(r(M),{key:0,config:z.config,maxScore:z.maxScore},null,8,["config","maxScore"])):u("v-if",!0),f(r(V),{ref_key:"formRef",ref:oe,model:z.form,rules:z.rules,"require-mark-placement":"left",class:"main"},{default:g((()=>[(n(!0),s(c,null,y(z.formArray,((e,o)=>(n(),s(c,{key:(e.id||e.seq)+o},[r(ce)(e)?(n(),m(r(F),{key:0,path:e.val_key,"show-label":!r(D)(e.type),class:"c-scle-form-item"},{label:g((()=>[p("span",{class:l({"scale-label-required":r(le)(e)}),innerHTML:r(me)(e)},null,10,W),r(le)(e)?(n(),s("span",U,"(必填)")):u("v-if",!0),r(ye)(e)?(n(),s("span",J,k(r(ye)(e)),1)):u("v-if",!0),r(se)(e)?(n(),s("span",{key:2,class:"evalute-tip",onClick:o=>(async e=>{var o;if(z.evatipMap[e.id])return void Le(z.evatipMap[e.id]);let a="getSubjectAnswer";const t=(null==(o=Q.scaleApiConfig)?void 0:o[a])||null;if(!t||"function"!=typeof t)return void Z.error(`${a} Is not a function`);let i=await t(e.id);i&&(z.evatipMap[e.id]||(z.evatipMap[e.id]=i,Le(i)))})(e)},[f(r(I),{"icon-class":"a-xitongtubiaotishi"}),h(" 查看提示 ")],8,X)):u("v-if",!0)])),default:g((()=>[(n(),m(C(e.renderCom),v(r(he)(e,o),{key:(e.id||e.seq)+o,onScaleChange:xe,onOnChange:o=>((e,o)=>{z.form[o.val_key]=Pe(e)})(o,e),onVodFileList:Ie}),null,16,["onOnChange"])),r(ke)(e)?(n(),m(q,{key:0,item:e},null,8,["item"])):u("v-if",!0)])),_:2},1032,["path","show-label"])):u("v-if",!0)],64)))),128))])),_:1},8,["model","rules"])],6),r(ge)?(n(),s("div",G,[u(" 分享的链接 隐藏取消按钮 "),"guage"!==Q.sourceType?(n(),m(r(K),{key:0,onClick:Be},{default:g((()=>[h("取消")])),_:1})):u("v-if",!0),Q.isLock?u("v-if",!0):(n(),m(r(K),{key:1,onClick:Ne,disabled:z.banSubmit,type:"primary"},{default:g((()=>[h("保存")])),_:1},8,["disabled"]))])):u("v-if",!0)],64))],64))],64))],2))}}),[["__file","ScaleView.vue"]]);export{Q as default};
package/es/env.d.ts CHANGED
@@ -1,24 +1,24 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- readonly VITE_APP_TYPE: string;
5
- // 更多环境变量...
6
- }
7
-
8
- interface ImportMeta {
9
- readonly env: ImportMetaEnv;
10
- }
11
-
12
- declare module '*.vue' {
13
- // @ts-ignore
14
- import type { App, defineComponent } from 'vue';
15
- // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
- // // const component: DefineComponent<{}, {}, any>
17
- const component: ReturnType<typeof defineComponent> & {
18
- install(app: App): void;
19
- };
20
- // @ts-ignore
21
- export default component;
22
- }
23
-
24
- declare module '*.js';
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TYPE: string;
5
+ // 更多环境变量...
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv;
10
+ }
11
+
12
+ declare module '*.vue' {
13
+ // @ts-ignore
14
+ import type { App, defineComponent } from 'vue';
15
+ // // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
16
+ // // const component: DefineComponent<{}, {}, any>
17
+ const component: ReturnType<typeof defineComponent> & {
18
+ install(app: App): void;
19
+ };
20
+ // @ts-ignore
21
+ export default component;
22
+ }
23
+
24
+ declare module '*.js';
@@ -27,7 +27,7 @@ export declare enum LOW_CODE_VALUE_RELATION {
27
27
  LESS = "LESS",
28
28
  LESSEQ = "LESSEQ"
29
29
  }
30
- export declare function lowCodeCompare(value: unknown, condition: {
30
+ export declare function isMatchLowCodeCondition(value: unknown, condition: {
31
31
  con: LOW_CODE_VALUE_RELATION & string;
32
32
  value: unknown;
33
33
  }): boolean;
@@ -1 +1 @@
1
- import{useMemoize as t}from"@vueuse/core";import{isArray as e,isString as n,includes as r,isEmpty as o,negate as u,gt as c,gte as i,lt as s,lte as f,isNumber as a,isObject as x,isFunction as E}from"lodash-es";import{getCurrentInstance as l}from"vue";function m(t,n,r="children",o){function u(){throw"silence break traverse"}try{h(t).forEach((t=>{n(t,u,o),h(r).forEach((o=>{e(t[o])&&m(t[o],n,r,t)}))}))}catch(t){if("silence break traverse"===t)return;throw t}}function L(t,e,n=e.name,r){if(!n)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:o={}}=t._context;o[n]||(r?r():t.component(n,e))}function d(t){if(!n(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function h(t){return Array.isArray(t)?t:[t]}function p(){if(window.isSecureContext&&window.crypto)return`key${window.crypto.randomUUID()}`;return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const N=t((function(t){return t?[...t].reduce(((t,e)=>/[a-z]/.test(e)?t+8:/[A-Z]/.test(e)?t+12:/\d/.test(e)?t+9:/\./.test(e)?t+4:/[\u4e00-\u9fa5]/.test(e)?t+15:/-/.test(e)?t+4:/[()]/.test(e)?t+14:/[)(]/.test(e)?t+5:/-/.test(e)?t+10:/%/.test(e)?t+14:/‰/.test(e)?t+16:t+6),0):0})),w=Object.seal(Object.create(null));function S(t,n){return function t(n,r){return x(n)?e(n)?n.map((e=>t(e,r))):Object.entries(n).reduce(((e,[n,o])=>(r.includes(n)||(x(o)&&!E(o)?e[n]=t(o,r):e[n]=o),e)),{}):n}(t,n)}function v(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function y(t,e){if(!t)return t;if(e(t))return t;let n=t.parentElement;for(;n&&!e(n);)n=n.parentElement;return n}function Q(t,e="px"){if(a(t))return`${t}${e}`;if(n(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}function $(t,e){return t.some((t=>e.includes(t)))}const b=t((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function O(t,e){if(!x(t))return t;const n={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(n,e[t]);return n}function U(t){if(!l())throw new Error(t||"can't use this hook out of setup environment")}var C=(t=>(t.EQ="EQ",t.NEQ="NEQ",t.CL="CL",t.NC="NC",t.NULL="NULL",t.NOT_NULL="NOT_NULL",t.BIG="BIG",t.BIGEQ="BIGEQ",t.LESS="LESS",t.LESSEQ="LESSEQ",t))(C||{});const I={EQ:(t,e)=>`${t}`===e,NEQ:(t,e)=>`${t}`!==e,CL:(t,o)=>!(!e(t)&&!n(t))&&r(t,o),NC:(t,o)=>!e(t)&&!n(t)||!r(t,o),NULL:o,NOT_NULL:u(o),BIG:c,BIGEQ:i,LESS:s,LESSEQ:f};function g(t,e){return(I[e.con]||(()=>!1))(t,`${e.value}`)}export{w as DMZ,C as LOW_CODE_VALUE_RELATION,h as arrayed,U as checkInSetupEnv,S as deepOmit,y as findAncestor,d as generateTimeFormat,N as getStringWidth,b as jsonParse,g as lowCodeCompare,L as safeComponentRegister,v as separateMetaModule,O as shallowOmit,$ as targetStringIncludes,m as traverse,p as uuidGenerator,Q as widthAppend};
1
+ import{useMemoize as t}from"@vueuse/core";import{isArray as e,isString as n,includes as r,isEmpty as o,negate as u,gt as c,gte as i,lt as s,lte as f,isNumber as a,isObject as x,isFunction as E}from"lodash-es";import{getCurrentInstance as l}from"vue";function m(t,n,r="children",o){function u(){throw"silence break traverse"}try{h(t).forEach((t=>{n(t,u,o),h(r).forEach((o=>{e(t[o])&&m(t[o],n,r,t)}))}))}catch(t){if("silence break traverse"===t)return;throw t}}function L(t,e,n=e.name,r){if(!n)throw new Error(`[CUI]: invalid component name for ${e}`);const{components:o={}}=t._context;o[n]||(r?r():t.component(n,e))}function d(t){if(!n(t))return;const e=t.match(/[Hms:]+/);return e?e[0]:void 0}function h(t){return Array.isArray(t)?t:[t]}function p(){if(window.isSecureContext&&window.crypto)return`key${window.crypto.randomUUID()}`;return`key${"xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}`}const N=t((function(t){return t?[...t].reduce(((t,e)=>/[a-z]/.test(e)?t+8:/[A-Z]/.test(e)?t+12:/\d/.test(e)?t+9:/\./.test(e)?t+4:/[\u4e00-\u9fa5]/.test(e)?t+15:/-/.test(e)?t+4:/[()]/.test(e)?t+14:/[)(]/.test(e)?t+5:/-/.test(e)?t+10:/%/.test(e)?t+14:/‰/.test(e)?t+16:t+6),0):0})),w=Object.seal(Object.create(null));function S(t,n){return function t(n,r){return x(n)?e(n)?n.map((e=>t(e,r))):Object.entries(n).reduce(((e,[n,o])=>(r.includes(n)||(x(o)&&!E(o)?e[n]=t(o,r):e[n]=o),e)),{}):n}(t,n)}function v(t){return Object.values(t).reduce(((t,e)=>Object.assign(t,e)),{})}function y(t,e){if(!t)return t;if(e(t))return t;let n=t.parentElement;for(;n&&!e(n);)n=n.parentElement;return n}function Q(t,e="px"){if(a(t))return`${t}${e}`;if(n(t))return t.endsWith(e)?t:`${t}${e}`;throw new Error(`invalid width value ${t}, it need to be a string or number!`)}function $(t,e){return t.some((t=>e.includes(t)))}const b=t((t=>{try{return JSON.parse(t)}catch(t){return{}}}),{getKey:t=>t});function O(t,e){if(!x(t))return t;const n={...t};for(let t=0;t<e.length;t++)Reflect.deleteProperty(n,e[t]);return n}function U(t){if(!l())throw new Error(t||"can't use this hook out of setup environment")}var C=(t=>(t.EQ="EQ",t.NEQ="NEQ",t.CL="CL",t.NC="NC",t.NULL="NULL",t.NOT_NULL="NOT_NULL",t.BIG="BIG",t.BIGEQ="BIGEQ",t.LESS="LESS",t.LESSEQ="LESSEQ",t))(C||{});const I={EQ:(t,e)=>`${t}`===e,NEQ:(t,e)=>`${t}`!==e,CL:(t,o)=>!(!e(t)&&!n(t))&&r(t,o),NC:(t,o)=>!e(t)&&!n(t)||!r(t,o),NULL:o,NOT_NULL:u(o),BIG:c,BIGEQ:i,LESS:s,LESSEQ:f};function g(t,e){return(I[e.con]||(()=>!1))(t,`${e.value}`)}export{w as DMZ,C as LOW_CODE_VALUE_RELATION,h as arrayed,U as checkInSetupEnv,S as deepOmit,y as findAncestor,d as generateTimeFormat,N as getStringWidth,g as isMatchLowCodeCondition,b as jsonParse,L as safeComponentRegister,v as separateMetaModule,O as shallowOmit,$ as targetStringIncludes,m as traverse,p as uuidGenerator,Q as widthAppend};