cnhis-design-vue 3.2.9-beta.23 → 3.2.9-beta.27

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 (97) hide show
  1. package/README.md +87 -87
  2. package/es/components/button-print/index.d.ts +30 -0
  3. package/es/components/button-print/src/ButtonPrint.vue.d.ts +30 -0
  4. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  5. package/es/components/button-print/src/components/NewPrintComponent.vue.d.ts +9 -0
  6. package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
  7. package/es/components/button-print/src/components/OldPrintComponent.vue.d.ts +9 -0
  8. package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
  9. package/es/components/button-print/src/utils/print.d.ts +2 -2
  10. package/es/components/button-print/src/utils/print.js +1 -1
  11. package/es/components/classification/index.d.ts +87 -0
  12. package/es/components/classification/src/components/search-filter/index.vue.d.ts +87 -0
  13. package/es/components/classification/src/components/set-classification/index.vue.d.ts +87 -0
  14. package/es/components/classification/src/index.vue.d.ts +87 -0
  15. package/es/components/date-picker/index.d.ts +29 -0
  16. package/es/components/date-picker/src/DatePicker.vue.d.ts +30 -1
  17. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  20. package/es/components/field-set/index.d.ts +7 -1
  21. package/es/components/field-set/src/FieldColor.vue.d.ts +62 -4
  22. package/es/components/field-set/src/FieldColor.vue2.js +1 -1
  23. package/es/components/field-set/src/FieldFilter.vue.d.ts +4 -4
  24. package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
  25. package/es/components/field-set/src/FieldSet.vue.d.ts +8 -6
  26. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  27. package/es/components/field-set/src/Index.vue.d.ts +7 -1
  28. package/es/components/field-set/src/Index.vue2.js +1 -1
  29. package/es/components/field-set/src/TableStyle.vue2.js +1 -1
  30. package/es/components/field-set/src/components/condition.vue.d.ts +29 -0
  31. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +58 -0
  32. package/es/components/field-set/src/components/edit-filter.vue.d.ts +29 -0
  33. package/es/components/field-set/src/components/table-row.vue.d.ts +4 -4
  34. package/es/components/field-set/src/utils/index.js +1 -1
  35. package/es/components/field-set/style/index.css +1 -1
  36. package/es/components/iho-chat/index.d.ts +29 -0
  37. package/es/components/iho-chat/src/Index.vue.d.ts +29 -0
  38. package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +29 -0
  39. package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +29 -0
  40. package/es/components/iho-chat/src/hooks/useSession.js +1 -1
  41. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +29 -0
  42. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +29 -0
  43. package/es/components/index.css +1 -1
  44. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  45. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +29 -0
  46. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +29 -0
  47. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +29 -0
  48. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +29 -0
  49. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +58 -0
  50. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +29 -0
  51. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +29 -0
  52. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +58 -0
  53. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +58 -0
  54. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +29 -0
  55. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +29 -0
  56. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +29 -0
  57. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +29 -0
  58. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +116 -0
  59. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +116 -0
  60. package/es/components/vod-chunk-upload/src/chunk-upload-new.vue2.js +1 -1
  61. package/es/shared/assets/img/ai__avatar.png.js +1 -1
  62. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  63. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  64. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  65. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  66. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  67. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  68. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  69. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  70. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  71. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  72. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  73. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  74. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  75. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  76. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  77. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  78. package/es/shared/assets/img/failure.png.js +1 -1
  79. package/es/shared/assets/img/no-permission.png.js +1 -1
  80. package/es/shared/assets/img/nodata.png.js +1 -1
  81. package/es/shared/assets/img/notfound.png.js +1 -1
  82. package/es/shared/assets/img/qr.png.js +1 -1
  83. package/es/shared/assets/img/success.png.js +1 -1
  84. package/es/shared/assets/img/table_style_2.png.js +1 -1
  85. package/es/shared/assets/img/video.png.js +1 -1
  86. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  87. package/es/shared/assets/img/xb_big.png.js +1 -1
  88. package/es/shared/assets/img/xb_small.png.js +1 -1
  89. package/es/shared/package.json.js +1 -1
  90. package/package.json +2 -2
  91. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  92. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  93. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  94. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  95. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  96. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  97. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -835,6 +835,14 @@ declare const _default: import("vue").DefineComponent<{
835
835
  type: PropType<string | false | HTMLElement>;
836
836
  default: string;
837
837
  };
838
+ holidays: {
839
+ type: PropType<Date[]>;
840
+ default: () => never[];
841
+ };
842
+ type: {
843
+ type: StringConstructor;
844
+ default: string;
845
+ };
838
846
  }, {
839
847
  attrs: {
840
848
  [x: string]: unknown;
@@ -859,6 +867,14 @@ declare const _default: import("vue").DefineComponent<{
859
867
  type: PropType<string | false | HTMLElement>;
860
868
  default: string;
861
869
  };
870
+ holidays: {
871
+ type: PropType<Date[]>;
872
+ default: () => never[];
873
+ };
874
+ type: {
875
+ type: StringConstructor;
876
+ default: string;
877
+ };
862
878
  }>> & {
863
879
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
864
880
  }>>;
@@ -875,6 +891,9 @@ declare const _default: import("vue").DefineComponent<{
875
891
  blur: () => any;
876
892
  handleConfirm: (target: HTMLInputElement) => void;
877
893
  onUpdateShow: (show: boolean) => Promise<void>;
894
+ watchers: import("../../../shared/types").AnyFn[];
895
+ stopWatcher: () => void;
896
+ setHoliday: (show: boolean) => Promise<void>;
878
897
  onConfirm: (...args: any[]) => Promise<void>;
879
898
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
880
899
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -899,11 +918,21 @@ declare const _default: import("vue").DefineComponent<{
899
918
  type: PropType<string | false | HTMLElement>;
900
919
  default: string;
901
920
  };
921
+ holidays: {
922
+ type: PropType<Date[]>;
923
+ default: () => never[];
924
+ };
925
+ type: {
926
+ type: StringConstructor;
927
+ default: string;
928
+ };
902
929
  }>> & {
903
930
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
904
931
  }, {
932
+ type: string;
905
933
  updateUnchangedValue: boolean;
906
934
  to: string | false | HTMLElement;
935
+ holidays: Date[];
907
936
  }>>;
908
937
  NSelect: any;
909
938
  WidgetValEnums: {
@@ -1497,6 +1526,14 @@ declare const _default: import("vue").DefineComponent<{
1497
1526
  type: PropType<string | false | HTMLElement>;
1498
1527
  default: string;
1499
1528
  };
1529
+ holidays: {
1530
+ type: PropType<Date[]>;
1531
+ default: () => never[];
1532
+ };
1533
+ type: {
1534
+ type: StringConstructor;
1535
+ default: string;
1536
+ };
1500
1537
  }, {
1501
1538
  attrs: {
1502
1539
  [x: string]: unknown;
@@ -1521,6 +1558,14 @@ declare const _default: import("vue").DefineComponent<{
1521
1558
  type: PropType<string | false | HTMLElement>;
1522
1559
  default: string;
1523
1560
  };
1561
+ holidays: {
1562
+ type: PropType<Date[]>;
1563
+ default: () => never[];
1564
+ };
1565
+ type: {
1566
+ type: StringConstructor;
1567
+ default: string;
1568
+ };
1524
1569
  }>> & {
1525
1570
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1526
1571
  }>>;
@@ -1537,6 +1582,9 @@ declare const _default: import("vue").DefineComponent<{
1537
1582
  blur: () => any;
1538
1583
  handleConfirm: (target: HTMLInputElement) => void;
1539
1584
  onUpdateShow: (show: boolean) => Promise<void>;
1585
+ watchers: import("../../../shared/types").AnyFn[];
1586
+ stopWatcher: () => void;
1587
+ setHoliday: (show: boolean) => Promise<void>;
1540
1588
  onConfirm: (...args: any[]) => Promise<void>;
1541
1589
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
1542
1590
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -1561,11 +1609,21 @@ declare const _default: import("vue").DefineComponent<{
1561
1609
  type: PropType<string | false | HTMLElement>;
1562
1610
  default: string;
1563
1611
  };
1612
+ holidays: {
1613
+ type: PropType<Date[]>;
1614
+ default: () => never[];
1615
+ };
1616
+ type: {
1617
+ type: StringConstructor;
1618
+ default: string;
1619
+ };
1564
1620
  }>> & {
1565
1621
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1566
1622
  }, {
1623
+ type: string;
1567
1624
  updateUnchangedValue: boolean;
1568
1625
  to: string | false | HTMLElement;
1626
+ holidays: Date[];
1569
1627
  }>>;
1570
1628
  WidgetValEnums: {
1571
1629
  CUSTOM: string;
@@ -1960,6 +2018,14 @@ declare const _default: import("vue").DefineComponent<{
1960
2018
  type: PropType<string | false | HTMLElement>;
1961
2019
  default: string;
1962
2020
  };
2021
+ holidays: {
2022
+ type: PropType<Date[]>;
2023
+ default: () => never[];
2024
+ };
2025
+ type: {
2026
+ type: StringConstructor;
2027
+ default: string;
2028
+ };
1963
2029
  }, {
1964
2030
  attrs: {
1965
2031
  [x: string]: unknown;
@@ -1984,6 +2050,14 @@ declare const _default: import("vue").DefineComponent<{
1984
2050
  type: PropType<string | false | HTMLElement>;
1985
2051
  default: string;
1986
2052
  };
2053
+ holidays: {
2054
+ type: PropType<Date[]>;
2055
+ default: () => never[];
2056
+ };
2057
+ type: {
2058
+ type: StringConstructor;
2059
+ default: string;
2060
+ };
1987
2061
  }>> & {
1988
2062
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1989
2063
  }>>;
@@ -2000,6 +2074,9 @@ declare const _default: import("vue").DefineComponent<{
2000
2074
  blur: () => any;
2001
2075
  handleConfirm: (target: HTMLInputElement) => void;
2002
2076
  onUpdateShow: (show: boolean) => Promise<void>;
2077
+ watchers: import("../../../shared/types").AnyFn[];
2078
+ stopWatcher: () => void;
2079
+ setHoliday: (show: boolean) => Promise<void>;
2003
2080
  onConfirm: (...args: any[]) => Promise<void>;
2004
2081
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
2005
2082
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -2024,11 +2101,21 @@ declare const _default: import("vue").DefineComponent<{
2024
2101
  type: PropType<string | false | HTMLElement>;
2025
2102
  default: string;
2026
2103
  };
2104
+ holidays: {
2105
+ type: PropType<Date[]>;
2106
+ default: () => never[];
2107
+ };
2108
+ type: {
2109
+ type: StringConstructor;
2110
+ default: string;
2111
+ };
2027
2112
  }>> & {
2028
2113
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
2029
2114
  }, {
2115
+ type: string;
2030
2116
  updateUnchangedValue: boolean;
2031
2117
  to: string | false | HTMLElement;
2118
+ holidays: Date[];
2032
2119
  }>>;
2033
2120
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2034
2121
  componentCfg: {
@@ -19,6 +19,14 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
19
19
  type: import("vue").PropType<string | false | HTMLElement>;
20
20
  default: string;
21
21
  };
22
+ holidays: {
23
+ type: import("vue").PropType<Date[]>;
24
+ default: () => never[];
25
+ };
26
+ type: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
22
30
  }, {
23
31
  attrs: {
24
32
  [x: string]: unknown;
@@ -43,6 +51,14 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
43
51
  type: import("vue").PropType<string | false | HTMLElement>;
44
52
  default: string;
45
53
  };
54
+ holidays: {
55
+ type: import("vue").PropType<Date[]>;
56
+ default: () => never[];
57
+ };
58
+ type: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
46
62
  }>> & {
47
63
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
48
64
  }>>;
@@ -59,6 +75,9 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
59
75
  blur: () => any;
60
76
  handleConfirm: (target: HTMLInputElement) => void;
61
77
  onUpdateShow: (show: boolean) => Promise<void>;
78
+ watchers: import("../../shared/types").AnyFn[];
79
+ stopWatcher: () => void;
80
+ setHoliday: (show: boolean) => Promise<void>;
62
81
  onConfirm: (...args: any[]) => Promise<void>;
63
82
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
64
83
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -83,10 +102,20 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
83
102
  type: import("vue").PropType<string | false | HTMLElement>;
84
103
  default: string;
85
104
  };
105
+ holidays: {
106
+ type: import("vue").PropType<Date[]>;
107
+ default: () => never[];
108
+ };
109
+ type: {
110
+ type: StringConstructor;
111
+ default: string;
112
+ };
86
113
  }>> & {
87
114
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
88
115
  }, {
116
+ type: string;
89
117
  updateUnchangedValue: boolean;
90
118
  to: string | false | HTMLElement;
119
+ holidays: Date[];
91
120
  }>>;
92
121
  export default DatePicker;
@@ -1,5 +1,5 @@
1
1
  import { PropType } from 'vue';
2
- import { AnyObject } from '../../../shared/types';
2
+ import { AnyFn, AnyObject } from '../../../shared/types';
3
3
  type FormattedValue = string | [string, string];
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  updateUnchangedValue: {
@@ -21,6 +21,14 @@ declare const _default: import("vue").DefineComponent<{
21
21
  type: PropType<string | false | HTMLElement>;
22
22
  default: string;
23
23
  };
24
+ holidays: {
25
+ type: PropType<Date[]>;
26
+ default: () => never[];
27
+ };
28
+ type: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
24
32
  }, {
25
33
  attrs: {
26
34
  [x: string]: unknown;
@@ -45,6 +53,14 @@ declare const _default: import("vue").DefineComponent<{
45
53
  type: PropType<string | false | HTMLElement>;
46
54
  default: string;
47
55
  };
56
+ holidays: {
57
+ type: PropType<Date[]>;
58
+ default: () => never[];
59
+ };
60
+ type: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
48
64
  }>> & {
49
65
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
50
66
  }>>;
@@ -61,6 +77,9 @@ declare const _default: import("vue").DefineComponent<{
61
77
  blur: () => any;
62
78
  handleConfirm: (target: HTMLInputElement) => void;
63
79
  onUpdateShow: (show: boolean) => Promise<void>;
80
+ watchers: AnyFn[];
81
+ stopWatcher: () => void;
82
+ setHoliday: (show: boolean) => Promise<void>;
64
83
  onConfirm: (...args: any[]) => Promise<void>;
65
84
  isAllowedInvalidValue: (value: FormattedValue | null | undefined) => boolean | "" | undefined;
66
85
  setShortcutValue: (type: 'week' | 'month') => Promise<void>;
@@ -85,10 +104,20 @@ declare const _default: import("vue").DefineComponent<{
85
104
  type: PropType<string | false | HTMLElement>;
86
105
  default: string;
87
106
  };
107
+ holidays: {
108
+ type: PropType<Date[]>;
109
+ default: () => never[];
110
+ };
111
+ type: {
112
+ type: StringConstructor;
113
+ default: string;
114
+ };
88
115
  }>> & {
89
116
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
90
117
  }, {
118
+ type: string;
91
119
  updateUnchangedValue: boolean;
92
120
  to: string | false | HTMLElement;
121
+ holidays: Date[];
93
122
  }>;
94
123
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,useAttrs as t,ref as a,computed as l,watch as o,openBlock as n,createBlock as u,unref as r,isRef as i,createSlots as s,renderList as d,withCtx as c,renderSlot as f,nextTick as m}from"vue";import{NDatePicker as p}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as y}from"../../../shared/hooks/useDateTime.js";import{isArray as h,isEqual as g,isString as w}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as k,startOfDay as R,endOfDay as S}from"date-fns";var D=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"}},emits:["update:formatted-value"],setup(e,{expose:D,emit:I}){const C=e,M=t(),_=a(null),b=a(null),j=a();let $="";const P=l({get:()=>O(C.formattedValue)?null:C.formattedValue,set(e){h(e)&&h($)&&g($,e)||$===e||(I("update:formatted-value",e,w(e)?Date.parse(e):h(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),$=e)}}),U=l((()=>{const e=Reflect.get(M,"type")||"";return["datetime","datetimerange"].includes(e)})),x=l((()=>{if(Reflect.get(M,"format"))return M.format;const e=M.type||"";return U.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),H=l((()=>U.value?x.value.split(" "):"")),{focus:q,blur:A,handleConfirm:B}=v(_,{formatRef:x,attrs:M,emit:I,allowedInvalidValue:C.allowedInvalidValue});async function F(e){e&&U.value&&(await m(),async function e(t=0){var a;t>2||(b.value=null==(a=_.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:H,attrs:M,isPanel:!0}):(await m(),e(++t)))}())}async function L(...e){var t,a,l,o,n,u;const r=Reflect.get(M,"type")||"",i=null==(o=null==(l=null==(a=null==(t=_.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:o.call(l,"input");if(r.includes("range")?null==(n=C.onConfirm)||n.call(C,...e):(await m(),i.focus(),B(i),i.blur(),null==(u=C.onConfirm)||u.call(C,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!C.updateUnchangedValue||r.includes("range"))return;const s=i.value;y(i,V(new Date,x.value)),y(i,s)}function O(e){return C.allowedInvalidValue&&C.allowedInvalidValue===e}return o((()=>C.formattedValue),(e=>{j.value=O(e)?e:C.placeholder?C.placeholder:"选择日期时间",O(e)||($=e)}),{immediate:!0}),D({$datePicker:_,focus:q,blur:A,setShortcutValue:async function(e){const t=Reflect.get(M,"type")||"";if(!t||!t.includes("range")||!_.value)return;const a=_.value.$el.querySelectorAll(".n-input__input-el");let l,o;const n=new Date;if("week"===e){const e=k(n,{weeks:1});l=V(R(e),x.value)}else{const e=k(n,{months:1});l=V(R(e),x.value)}o=V(S(n),x.value),y(a[0],l),await m(),y(a[1],o)}}),(t,a)=>(n(),u(r(p),{ref_key:"datePickerRef",ref:_,"onUpdate:show":F,onConfirm:L,placeholder:j.value,to:e.to,"formatted-value":r(P),"onUpdate:formatted-value":a[0]||(a[0]=e=>i(P)?P.value=e:null)},s({_:2},[d(t.$slots,((e,a)=>({name:a,fn:c((()=>[f(t.$slots,a)]))})))]),1032,["placeholder","to","formatted-value"]))}});export{D as default};
1
+ import{defineComponent as e,useAttrs as t,ref as a,computed as l,onBeforeUnmount as n,watch as o,openBlock as r,createBlock as u,unref as s,isRef as d,createSlots as i,renderList as c,withCtx as p,renderSlot as f,nextTick as y}from"vue";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as v,handleInputEvent as h}from"../../../shared/hooks/useDateTime.js";import{isArray as g,isEqual as w,isString as D,isNumber as k}from"lodash-es";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{format as V,sub as S,startOfDay as R,endOfDay as _}from"date-fns";var A=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String},to:{type:[Object,String,Boolean],default:"body"},holidays:{type:Array,default:()=>[]},type:{type:String,default:"date"}},emits:["update:formatted-value"],setup(e,{expose:A,emit:I}){const M=e,C=t(),$=a(null),b=a(null),j=a();let P="";const U=l({get:()=>z(M.formattedValue)?null:M.formattedValue,set(e){g(e)&&g(P)&&w(P,e)||P===e||(I("update:formatted-value",e,D(e)?Date.parse(e):g(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),P=e)}}),q=l((()=>{const e=Reflect.get(C,"type")||"";return["datetime","datetimerange"].includes(e)})),x=l((()=>{if(Reflect.get(C,"format"))return C.format;const e=C.type||"";return q.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),E=l((()=>q.value?x.value.split(" "):"")),{focus:F,blur:H,handleConfirm:L}=v($,{formatRef:x,attrs:C,emit:I,allowedInvalidValue:M.allowedInvalidValue});async function B(e){!async function(e){var t;if(!e||!M.holidays.length)return;await y();const a=null==(t=$.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;O(),"daterange"===M.type?Y.push(n((()=>a.startDateArray),".n-date-panel-calendar--start .n-date-panel-dates>div"),n((()=>a.endDateArray),".n-date-panel-calendar--end .n-date-panel-dates>div")):"date"===M.type&&Y.push(n((()=>a.dateArray),".n-date-panel-calendar .n-date-panel-dates>div"));function n(e,t){const a=[],n=o(e,(e=>{a.forEach((e=>e.classList.remove("c-date-picker__holiday"))),a.length=0,g(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!k(n))return;const o=new Date(n);M.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(y((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&q.value&&(await y(),async function e(t=0){var a;t>2||(b.value=null==(a=$.value)?void 0:a.panelInstRef,b.value?v(b,{formatRef:E,attrs:C,isPanel:!0}):(await y(),e(++t)))}())}const Y=[];function O(){Y.forEach((e=>e())),Y.length=0}async function T(...e){var t,a,l,n,o,r;const u=Reflect.get(C,"type")||"",s=null==(n=null==(l=null==(a=null==(t=$.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(u.includes("range")?null==(o=M.onConfirm)||o.call(M,...e):(await y(),s.focus(),L(s),s.blur(),null==(r=M.onConfirm)||r.call(M,Date.parse(s.value),s.value)),!(null==s?void 0:s.value)||!M.updateUnchangedValue||u.includes("range"))return;const d=s.value;h(s,V(new Date,x.value)),h(s,d)}function z(e){return M.allowedInvalidValue&&M.allowedInvalidValue===e}return n(O),o((()=>M.formattedValue),(e=>{j.value=z(e)?e:M.placeholder?M.placeholder:"选择日期时间",z(e)||(P=e)}),{immediate:!0}),A({$datePicker:$,focus:F,blur:H,setShortcutValue:async function(e){const t=Reflect.get(C,"type")||"";if(!t||!t.includes("range")||!$.value)return;const a=$.value.$el.querySelectorAll(".n-input__input-el");let l,n;const o=new Date;if("week"===e){const e=S(o,{weeks:1});l=V(R(e),x.value)}else{const e=S(o,{months:1});l=V(R(e),x.value)}n=V(_(o),x.value),h(a[0],l),await y(),h(a[1],n)}}),(t,a)=>(r(),u(s(m),{ref_key:"datePickerRef",ref:$,"onUpdate:show":B,onConfirm:T,placeholder:j.value,to:e.to,type:e.type,"formatted-value":s(U),"onUpdate:formatted-value":a[0]||(a[0]=e=>d(U)?U.value=e:null)},i({_:2},[c(t.$slots,((e,a)=>({name:a,fn:p((()=>[f(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value"]))}});export{A as default};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function d(d,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=p(d,f,g),{originY:L,endY:E,originX:M,endX:G,xCellWidth:k,yCellHeight:I,left:O,vitalSignsOriginY:W,painOriginY:A,painHeight:H,iconsWidth:R,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let p=R,g=M;"right"===r&&(p=G,g=G+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=H&&"right"!==r?o.length-1:o.length,v=(g-p)/m,y=v+(g-p)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:u,position:c,showMaxMinNumber:p,style:g,title:f}=n,m=A.originY-F[0]*I,v=l({width:M-R,height:H+(F[0]+F[1])*I,...P},{value:`${f}`,...i,...g||{}},{left:R,top:m}),y=t([R,m,M,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,R,M-R),l=o.length;o.forEach(((o,a)=>{let c=A.endY-a*I*s;if(0===a&&0===F[1]&&(c=E-5),u&&(!(0===a||a===l-1)||p||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}d.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?p:y+p+(s-1)*v,S="right"===r?0:W.originY,b="right"===r?q:W.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:G=[],showdetailedScale:k,showRange:O=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=k&&!G.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):k&&(null==G?void 0:G.length)?G:j,[s=l[0],r=u(l)]=O;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=W.endY-u*I*(k?C/2:C),p=[s,r].includes(n);if(N&&(!p||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=W.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,I,W.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=W.originY+I;0!==B&&z[0]>1&&(J=L+I*z[0]/2),_&&g.push(new e.Text(String(_),{...i,left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&d.value.add(w),w&&w.sendToBack()}R&&function(){const e=JSON.parse(JSON.stringify(_));let t=E;const i=R-O.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=M&&e.left<=G){e.setCoords();const t="pain"===e.origin.type?A:W;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),d.value.add(l,u)}))}();const Q=O.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&O.yScaleValue[B].show){const e=O.yScaleValue[B];0===B&&O.yScaleValue.length>1&&Q.unshift(e),B==O.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),{drawScaleValue:K}}export{d as useLeft};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function d(d,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=p(d,f,g),{originY:L,endY:E,originX:M,endX:G,xCellWidth:k,yCellHeight:I,left:O,vitalSignsOriginY:W,painOriginY:A,painHeight:H,iconsWidth:R,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let p=R,g=M;"right"===r&&(p=G,g=G+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=H&&"right"!==r?o.length-1:o.length,v=(g-p)/m,y=v+(g-p)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:u,position:c,showMaxMinNumber:p,style:g,title:f}=n,m=A.originY-F[0]*I,v=l({width:M-R,height:H+(F[0]+F[1])*I,...P},{value:`${f}`,...i,...g||{}},{left:R,top:m}),y=t([R,m,M,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,R,M-R),l=o.length;o.forEach(((o,a)=>{let c=A.endY-a*I*s;if(0===a&&0===F[1]&&(c=E-5),u&&(!(0===a||a===l-1)||p||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}d.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?p:y+p+(s-1)*v,S="right"===r?0:W.originY,b="right"===r?q:W.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:G=[],showdetailedScale:k,showRange:O=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=k&&!G.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):k&&(null==G?void 0:G.length)?G:j,[s=l[0],r=u(l)]=O;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=W.endY-u*I*(k?C/2:C),p=[s,r].includes(n);if(N&&(!p||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=W.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,I,W.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=W.originY+2;0!==B&&z[0]>0&&(J=L+2),_&&g.push(new e.Text(String(_),{...i,originY:"top",left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&d.value.add(w),w&&w.sendToBack()}R&&function(){const e=JSON.parse(JSON.stringify(_));let t=E;const i=R-O.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=M&&e.left<=G){e.setCoords();const t="pain"===e.origin.type?A:W;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),d.value.add(l,u)}))}();const Q=O.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&O.yScaleValue[B].show){const e=O.yScaleValue[B];0===B&&O.yScaleValue.length>1&&Q.unshift(e),B==O.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),{drawScaleValue:K}}export{d as useLeft};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t}from"../useDraw.js";import"date-fns";import{cloneDeep as i,last as l}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,o,r,u,a,s){const{left:h,other:f,vitalSignsOriginY:c,xCellWidth:g,yCellHeight:v,endX:p}=o;let d=0;function m(i,l,o,u=!1){const a=[],s=u&&i.fixed&&i.fixedValue?i.fixedValue:i.value;String(s).split("").forEach(((l,n)=>{const o=new e.Text(l,{left:0,top:v*n,originX:"center",...t,objectCaching:!1,...i.style||{}});d=(v-(o.height||0))/2,a.push(o)}));const h=new e.Rect({left:0,top:0,width:g,height:v*a.length,fill:"transparent",originX:"center",...t}),{eventHighlight:c=!1}=f||{},p={originX:"center",left:l,top:o+d,baseTop:(i.baseTop||0)*v,trueLeft:l,trueHeight:a.length*v,objectCaching:!1,hoverCursor:"pointer",highlightObject:h,originData:i,selectable:!1,evented:c},m=new e.Group([h,...a],p);return function(e){const{highlightColor:t="#ffff00"}=f||{};e.on("mouseover",(()=>{e.highlightObject.set("fill",t),n.value.requestRenderAll()})),e.on("mouseout",(()=>{e.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),e.on("mousedown",(function(){r("eventClick",e.originData)}))}(m),n.value.add(m),m}!function(){var e,t;if(!(null==f?void 0:f.list))return!1;const n=[],o=[];i(f.list).forEach(((e,t)=>{e.value=e.value||"";const i=0===t?"vertical":e.align||"vertical",l=u(e.time,!0);if(l>p)return;const n=o.find((e=>e.left==l));if(n)n[i].push(e);else{const t={left:l,vertical:[],horizontal:[]};t[i].push(e),o.push(t)}}));const r=null==(t=null==(e=h.yScaleValue)?void 0:e.find((e=>"temperature"===e.type)))?void 0:t.list,d=(null==r?void 0:r.length)?a("temperature",35):0;o.forEach((e=>{let t=c.originY,i=e.left,o=0,r=d,u=i;function a(e,t){var o,a;if((e=>e.fixed&&d&&(e.fixedValue||e.value))(e)){const h=[...s].find((e=>Math.abs(e.left-i)<1));h&&(t||Math.abs(i-u)>1)&&(r=h.top+h.height),u=i,n.push(m(e,i,r,!0)),r+=null!=(a=null==(o=l(n))?void 0:o.trueHeight)?a:0}}e.vertical.forEach(((r,u)=>{var s,h,f;const p=(r.baseTop||0)*v,d=(null==(s=l(n))?void 0:s.left)||0;0===u&&e.left<=d&&(i=d+g);if(n.filter((e=>e.trueLeft===i)).length){const e=String(r.value).length;t+=o,t+e*v+p>c.endY&&(t=c.originY,i+=g)}t+=p,String(r.value).length&&(n.push(m(r,i,t)),o=null!=(f=null==(h=l(n))?void 0:h.trueHeight)?f:0),a(r,0===u)})),e.horizontal.forEach(((t,o)=>{var r,u;const s=c.originY+(t.baseTop||0)*v,h=(null==(r=l(n))?void 0:r.left)||0;e.left<=h&&(i=h+g),String(t.value).length&&n.push(m(t,i,s)),a(t,0===(null==(u=e.vertical)?void 0:u.length)&&0===o)}))}))}()}export{n as useOther};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t}from"../useDraw.js";import"date-fns";import{cloneDeep as i,last as l}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function n(n,o,r,u,a,s){const{left:h,other:f,vitalSignsOriginY:c,xCellWidth:g,yCellHeight:v,endX:d}=o,p=(()=>{const e=Math.min(...((null==f?void 0:f.list)||[]).map((e=>{var t,i;return null!=(i=null==(t=e.style)?void 0:t.fontSize)?i:12})));return v<11?e:v})();let m=0;function b(i,l,o,u=!1){const a=[],s=u&&i.fixed&&i.fixedValue?i.fixedValue:i.value;String(s).split("").forEach(((l,n)=>{const o=new e.Text(l,{left:0,top:p*n,originX:"center",...t,objectCaching:!1,...i.style||{}});m=(p-(o.height||0))/2,a.push(o)}));const h=new e.Rect({left:0,top:0,width:g,height:p*a.length,fill:"transparent",originX:"center",...t}),{eventHighlight:c=!1}=f||{},d={originX:"center",left:l,top:o+m,baseTop:(i.baseTop||0)*v,trueLeft:l,trueHeight:a.length*p,objectCaching:!1,hoverCursor:"pointer",highlightObject:h,originData:i,selectable:!1,evented:c},b=new e.Group([h,...a],d);return function(e){const{highlightColor:t="#ffff00"}=f||{};e.on("mouseover",(()=>{e.highlightObject.set("fill",t),n.value.requestRenderAll()})),e.on("mouseout",(()=>{e.highlightObject.set("fill","transparent"),n.value.requestRenderAll()})),e.on("mousedown",(function(){r("eventClick",e.originData)}))}(b),n.value.add(b),b}!function(){var e,t;if(!(null==f?void 0:f.list))return!1;const n=[],o=[];i(f.list).forEach(((e,t)=>{e.value=e.value||"";const i=0===t?"vertical":e.align||"vertical",l=u(e.time,!0);if(l>d)return;const n=o.find((e=>e.left==l));if(n)n[i].push(e);else{const t={left:l,vertical:[],horizontal:[]};t[i].push(e),o.push(t)}}));const r=null==(t=null==(e=h.yScaleValue)?void 0:e.find((e=>"temperature"===e.type)))?void 0:t.list,m=(null==r?void 0:r.length)?a("temperature",35):0;o.forEach((e=>{let t=c.originY,i=e.left,o=0,r=m,u=i;function a(e,t){var o,a;if((e=>e.fixed&&m&&(e.fixedValue||e.value))(e)){const h=[...s].find((e=>Math.abs(e.left-i)<1));h&&(t||Math.abs(i-u)>1)&&(r=h.top+h.height),u=i,n.push(b(e,i,r,!0)),r+=null!=(a=null==(o=l(n))?void 0:o.trueHeight)?a:0}}e.vertical.forEach(((r,u)=>{var s,h,f;const d=(r.baseTop||0)*v,m=(null==(s=l(n))?void 0:s.left)||0;0===u&&e.left<=m&&(i=m+g);if(n.filter((e=>e.trueLeft===i)).length){const e=String(r.value).length;t+=o,t+e*p+d>c.endY&&(t=c.originY,i+=g)}t+=d,String(r.value).length&&(n.push(b(r,i,t)),o=null!=(f=null==(h=l(n))?void 0:h.trueHeight)?f:0),a(r,0===u)})),e.horizontal.forEach(((t,o)=>{var r,u;const s=c.originY+(t.baseTop||0)*v,h=(null==(r=l(n))?void 0:r.left)||0;e.left<=h&&(i=h+g),String(t.value).length&&n.push(b(t,i,s)),a(t,0===(null==(u=e.vertical)?void 0:u.length)&&0===o)}))}))}()}export{n as useOther};
@@ -63,8 +63,14 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
63
63
  }>>;
64
64
  emit: (event: "save", ...args: any[]) => void;
65
65
  setRefs: import("../../shared/types").AnyObject;
66
+ fieldSetRef: import("vue").Ref<any>;
66
67
  primaryColor: import("vue").Ref<string>;
67
- rowHeight: import("vue").ComputedRef<"52px" | "auto">;
68
+ fieldSetHeight: import("vue").Ref<number>;
69
+ style: import("vue").ComputedRef<{
70
+ '--row-height': string;
71
+ '--primary-color': string;
72
+ '--main-height': string;
73
+ }>;
68
74
  tabList: import("vue").ComputedRef<{
69
75
  name: import("./src/types").FieldSetTab;
70
76
  tab: string;
@@ -525,12 +525,12 @@ declare const _default: import("vue").DefineComponent<{
525
525
  }>;
526
526
  developMode: boolean;
527
527
  draggable: boolean;
528
- isHighlightRow: boolean;
529
- idx: number;
530
- isHighlight: boolean;
531
- isFieldSet: boolean;
532
528
  fieldDescribeMode: "column" | "tooltip";
529
+ isFieldSet: boolean;
533
530
  hideExpressionOption: AnyObject[];
531
+ idx: number;
532
+ isHighlight: boolean;
533
+ isHighlightRow: boolean;
534
534
  }>;
535
535
  EditDialog: import("vue").DefineComponent<{
536
536
  visible: {
@@ -777,6 +777,14 @@ declare const _default: import("vue").DefineComponent<{
777
777
  type: PropType<string | false | HTMLElement>;
778
778
  default: string;
779
779
  };
780
+ holidays: {
781
+ type: PropType<Date[]>;
782
+ default: () => never[];
783
+ };
784
+ type: {
785
+ type: StringConstructor;
786
+ default: string;
787
+ };
780
788
  }, {
781
789
  attrs: {
782
790
  [x: string]: unknown;
@@ -801,6 +809,14 @@ declare const _default: import("vue").DefineComponent<{
801
809
  type: PropType<string | false | HTMLElement>;
802
810
  default: string;
803
811
  };
812
+ holidays: {
813
+ type: PropType<Date[]>;
814
+ default: () => never[];
815
+ };
816
+ type: {
817
+ type: StringConstructor;
818
+ default: string;
819
+ };
804
820
  }>> & {
805
821
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
806
822
  }>>;
@@ -817,6 +833,9 @@ declare const _default: import("vue").DefineComponent<{
817
833
  blur: () => any;
818
834
  handleConfirm: (target: HTMLInputElement) => void;
819
835
  onUpdateShow: (show: boolean) => Promise<void>;
836
+ watchers: import("../../../shared/types").AnyFn[];
837
+ stopWatcher: () => void;
838
+ setHoliday: (show: boolean) => Promise<void>;
820
839
  onConfirm: (...args: any[]) => Promise<void>;
821
840
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
822
841
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -841,11 +860,21 @@ declare const _default: import("vue").DefineComponent<{
841
860
  type: PropType<string | false | HTMLElement>;
842
861
  default: string;
843
862
  };
863
+ holidays: {
864
+ type: PropType<Date[]>;
865
+ default: () => never[];
866
+ };
867
+ type: {
868
+ type: StringConstructor;
869
+ default: string;
870
+ };
844
871
  }>> & {
845
872
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
846
873
  }, {
874
+ type: string;
847
875
  updateUnchangedValue: boolean;
848
876
  to: string | false | HTMLElement;
877
+ holidays: Date[];
849
878
  }>>;
850
879
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
851
880
  data: {
@@ -1059,6 +1088,14 @@ declare const _default: import("vue").DefineComponent<{
1059
1088
  type: PropType<string | false | HTMLElement>;
1060
1089
  default: string;
1061
1090
  };
1091
+ holidays: {
1092
+ type: PropType<Date[]>;
1093
+ default: () => never[];
1094
+ };
1095
+ type: {
1096
+ type: StringConstructor;
1097
+ default: string;
1098
+ };
1062
1099
  }, {
1063
1100
  attrs: {
1064
1101
  [x: string]: unknown;
@@ -1083,6 +1120,14 @@ declare const _default: import("vue").DefineComponent<{
1083
1120
  type: PropType<string | false | HTMLElement>;
1084
1121
  default: string;
1085
1122
  };
1123
+ holidays: {
1124
+ type: PropType<Date[]>;
1125
+ default: () => never[];
1126
+ };
1127
+ type: {
1128
+ type: StringConstructor;
1129
+ default: string;
1130
+ };
1086
1131
  }>> & {
1087
1132
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1088
1133
  }>>;
@@ -1099,6 +1144,9 @@ declare const _default: import("vue").DefineComponent<{
1099
1144
  blur: () => any;
1100
1145
  handleConfirm: (target: HTMLInputElement) => void;
1101
1146
  onUpdateShow: (show: boolean) => Promise<void>;
1147
+ watchers: import("../../../shared/types").AnyFn[];
1148
+ stopWatcher: () => void;
1149
+ setHoliday: (show: boolean) => Promise<void>;
1102
1150
  onConfirm: (...args: any[]) => Promise<void>;
1103
1151
  isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
1104
1152
  setShortcutValue: (type: "month" | "week") => Promise<void>;
@@ -1123,11 +1171,21 @@ declare const _default: import("vue").DefineComponent<{
1123
1171
  type: PropType<string | false | HTMLElement>;
1124
1172
  default: string;
1125
1173
  };
1174
+ holidays: {
1175
+ type: PropType<Date[]>;
1176
+ default: () => never[];
1177
+ };
1178
+ type: {
1179
+ type: StringConstructor;
1180
+ default: string;
1181
+ };
1126
1182
  }>> & {
1127
1183
  "onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
1128
1184
  }, {
1185
+ type: string;
1129
1186
  updateUnchangedValue: boolean;
1130
1187
  to: string | false | HTMLElement;
1188
+ holidays: Date[];
1131
1189
  }>>;
1132
1190
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
1133
1191
  data: {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as o,createElementVNode as a,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as f,createVNode as c,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/table-row.vue.js";import k from"./components/edit-dialog.vue.js";import{cloneDeep as _,omit as w}from"lodash-es";import{setColorInfo as C,setStyle as F}from"./utils/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import{format as A}from"date-fns";const D={class:"main-wrapper"},S={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},B=["tabindex"],E={key:0,class:"main-wrapper__table-footer"};var L=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:L,emit:M}){const R=e,U=l(!1),Y=l(null),H=l([]),I=l([{title:"名称",type:"text",field:"name"},{title:"字段",type:"text",field:"title"},{title:"创建时间",type:"text",field:"createDate"},{title:"效果",type:"text",field:"result"},{title:"颜色",type:"color",field:"color"},{title:"颜色应用于",type:"select",checkedAll:!1,disabledAll:!1,field:"colorScope"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"status"},{title:"操作",type:"custom",field:"opt"}]),N=t({columns:I,data:H,onEdit:function(e){Y.value=_(e),U.value=!0},isHighlightRow:!R.isFieldColor});function T(){M("save")}function $(){M("close")}function q(){Y.value=null,U.value=!0}function z(e){if(C(e),Y.value){const l=H.value.findIndex((l=>l.uuid===e.uuid));H.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");H.value.push({...e,createDate:l,uuid:j()})}}return I.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&R.isFieldColor||"title"===e.field&&!R.isFieldColor)}(e)})),H.value=R.defaultList.concat(H.value),H.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),L({getTableFields:function(){return H.value.map((e=>{const l=_(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),o("div",D,[a("div",S,[(i(!0),o(s,null,r(I.value,((e,l)=>(i(),o(s,{key:l},[e.isShow?(i(),o("span",{key:0,class:"table-cell",style:u(d(F)(e,l))},n(e.title),5)):f("v-if",!0)],64)))),128))]),a("div",V,[c(d(x),{modelValue:H.value,"onUpdate:modelValue":t[0]||(t[0]=e=>H.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?f("v-if",!0):(i(),o("div",{key:0,class:"item",tabindex:l},[c(g,m(N,{element:e,index:l}),null,16,["element","index"])],8,B))])),_:1},8,["modelValue"])],512),e.footerFlag?(i(),o("div",E,[f(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[c(d(h),{style:{"margin-right":"8px"},onClick:$},{default:p((()=>[y("取消")])),_:1}),c(d(h),{style:{"margin-right":"8px"},onClick:q},{default:p((()=>[y("新增")])),_:1}),c(d(h),{type:"primary",onClick:T},{default:p((()=>[y("保存")])),_:1})]))])):f("v-if",!0),U.value?(i(),b(k,{key:1,visible:U.value,"onUpdate:visible":t[1]||(t[1]=e=>U.value=e),"is-field-color":e.isFieldColor,row:Y.value,onConfirm:z},null,8,["visible","is-field-color","row"])):f("v-if",!0)]))}});export{L as default};
1
+ import{defineComponent as e,ref as l,reactive as t,openBlock as i,createElementBlock as a,createElementVNode as o,Fragment as s,renderList as r,normalizeStyle as u,unref as d,toDisplayString as n,createCommentVNode as c,createVNode as f,withCtx as p,mergeProps as m,renderSlot as v,createTextVNode as y,createBlock as b}from"vue";import{NButton as h}from"naive-ui";import x from"../../../shared/components/VueDraggable/src/vuedraggable.js";import g from"./components/table-row.vue.js";import _ from"./components/edit-dialog.vue.js";import{cloneDeep as k,omit as w}from"lodash-es";import{setColorInfo as C,setStyle as F}from"./utils/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import{format as A}from"date-fns";const D={class:"main-wrapper"},S={class:"main-wrapper__table"},V={class:"main-wrapper__table-header"},B={class:"main-wrapper__table-body",ref:"tableBodyRef"},E=["tabindex"],L={key:0,class:"main-wrapper__table-footer"};var M=e({__name:"FieldColor",props:{footerFlag:{type:Boolean,default:!0},isFieldColor:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close"],setup(e,{expose:M,emit:R}){const U=e,Y=l(!1),H=l(null),I=l([]),N=l([{title:"名称",type:"text",field:"name"},{title:"字段",type:"text",field:"title"},{title:"创建时间",type:"text",field:"createDate"},{title:"效果",type:"text",field:"result"},{title:"颜色",type:"color",field:"color"},{title:"颜色应用于",type:"select",checkedAll:!1,disabledAll:!1,field:"colorScope"},{title:"显示",type:"checkbox",checkedAll:!1,disabledAll:!1,field:"status"},{title:"操作",type:"custom",field:"opt"}]),T=t({columns:N,data:I,onEdit:function(e){H.value=k(e),Y.value=!0},isHighlightRow:!U.isFieldColor});function $(){R("save")}function q(){R("close")}function z(){H.value=null,Y.value=!0}function G(e){if(C(e),H.value){const l=I.value.findIndex((l=>l.uuid===e.uuid));I.value.splice(l,1,e)}else{const l=A(new Date,"yyyy-MM-dd");I.value.push({...e,createDate:l,uuid:j()})}}return N.value.forEach((e=>{e.isShow=function(e){return!("result"===e.field&&U.isFieldColor||"title"===e.field&&!U.isFieldColor)}(e)})),I.value=U.defaultList.concat(I.value),I.value.forEach((e=>{e.uuid=j(),e.status="Y"===e.status,C(e)})),M({getTableFields:function(){return I.value.map((e=>{const l=k(e);return l.status=l.status?"Y":"N",w(l,["uuid","style","result"])}))}}),(l,t)=>(i(),a("div",D,[o("div",S,[o("div",V,[(i(!0),a(s,null,r(N.value,((e,l)=>(i(),a(s,{key:l},[e.isShow?(i(),a("span",{key:0,class:"table-cell",style:u(d(F)(e,l))},[o("span",null,n(e.title),1)],4)):c("v-if",!0)],64)))),128))]),o("div",B,[f(d(x),{modelValue:I.value,"onUpdate:modelValue":t[0]||(t[0]=e=>I.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:l})=>[e.hide?c("v-if",!0):(i(),a("div",{key:0,class:"item",tabindex:l},[f(g,m(T,{element:e,index:l}),null,16,["element","index"])],8,E))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(i(),a("div",L,[c(" 底部按钮插槽 "),v(l.$slots,"colorSetFooter",{},(()=>[f(d(h),{style:{"margin-right":"8px"},onClick:q},{default:p((()=>[y("取消")])),_:1}),f(d(h),{style:{"margin-right":"8px"},onClick:z},{default:p((()=>[y("新增")])),_:1}),f(d(h),{type:"primary",onClick:$},{default:p((()=>[y("保存")])),_:1})]))])):c("v-if",!0),Y.value?(i(),b(_,{key:1,visible:Y.value,"onUpdate:visible":t[1]||(t[1]=e=>Y.value=e),"is-field-color":e.isFieldColor,row:H.value,onConfirm:G},null,8,["visible","is-field-color","row"])):c("v-if",!0)]))}});export{M as default};
@@ -547,12 +547,12 @@ declare const _default: import("vue").DefineComponent<{
547
547
  }>;
548
548
  developMode: boolean;
549
549
  draggable: boolean;
550
- isHighlightRow: boolean;
551
- idx: number;
552
- isHighlight: boolean;
553
- isFieldSet: boolean;
554
550
  fieldDescribeMode: "column" | "tooltip";
551
+ isFieldSet: boolean;
555
552
  hideExpressionOption: AnyObject[];
553
+ idx: number;
554
+ isHighlight: boolean;
555
+ isHighlightRow: boolean;
556
556
  }>;
557
557
  setStyle: typeof setStyle;
558
558
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,reactive as i,watch as l,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as c,renderList as o,normalizeStyle as s,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/table-row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as j}from"./utils/index.js";import{COLUMNLIST_MAP as C}from"./constants/filter.js";const R={class:"main-wrapper"},q={class:"main-wrapper__table-header"},V={class:"main-wrapper__table-body",ref:"tableBodyRef"},H=["tabindex"],S={key:0,class:"main-wrapper__table-footer"};var U=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:U,emit:E}){const L=e,B=t([]),O=t([]),T=i({columns:B,data:O,onUpdateChecked:function({checked:e,column:t}){const i=!e||z(t.field);t.checkedAll=!i}}),D=()=>{E("save")},N=()=>{E("close")};function P(){O.value=A(L.defaultList),$(),E("reset")}function $(){B.value=Object.entries(C).map((([e,t])=>{const i=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),l={isShow:!0,title:t,type:i,field:e};return"checkbox"===i&&Object.assign(l,{checkedAll:!z(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),l}))}function z(e){return O.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return l((()=>L.defaultList),(e=>{e.length>0&&(O.value=A(e),$())}),{immediate:!0,deep:!0}),U({getTableFields:()=>O.value}),(t,i)=>(a(),d("div",R,[r("div",q,[(a(!0),d(c,null,o(B.value,((e,t)=>(a(),d(c,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:s(n(j)(e,t))},["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(c,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return i=t,l=e.field,void O.value.forEach((e=>{("explicitRequired"!==l||"explicitRequired"===l&&F(e))&&(e[l]=i)}));var i,l}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))],4)):h("v-if",!0)],64)))),128))]),r("div",V,[v(n(_),{modelValue:O.value,"onUpdate:modelValue":i[0]||(i[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(T,{element:e,idx:t+1}),null,16,["element","idx"])],8,H))])),_:1},8,["modelValue"])],512),e.footerFlag?(a(),d("div",S,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:P},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:N},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:D},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{U as default};
1
+ import{defineComponent as e,ref as t,reactive as l,watch as i,openBlock as a,createElementBlock as d,createElementVNode as r,Fragment as s,renderList as c,normalizeStyle as o,unref as n,createBlock as u,withCtx as p,createTextVNode as m,toDisplayString as f,createCommentVNode as h,createVNode as v,mergeProps as k,renderSlot as b}from"vue";import{NCheckbox as x,NPopconfirm as y,NButton as g}from"naive-ui";import _ from"../../../shared/components/VueDraggable/src/vuedraggable.js";import w from"./components/table-row.vue.js";import{cloneDeep as A}from"lodash-es";import{isShowExplicitRequired as F,setStyle as j}from"./utils/index.js";import{COLUMNLIST_MAP as C}from"./constants/filter.js";const R={class:"main-wrapper"},q={class:"main-wrapper__table"},V={class:"main-wrapper__table-header"},H={class:"main-wrapper__table-body",ref:"tableBodyRef"},S=["tabindex"],U={key:0,class:"main-wrapper__table-footer"};var E=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:E,emit:L}){const B=e,O=t([]),T=t([]),D=l({columns:O,data:T,onUpdateChecked:function({checked:e,column:t}){const l=!e||G(t.field);t.checkedAll=!l}}),N=()=>{L("save")},P=()=>{L("close")};function $(){T.value=A(B.defaultList),z(),L("reset")}function z(){O.value=Object.entries(C).map((([e,t])=>{const l=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),i={isShow:!0,title:t,type:l,field:e};return"checkbox"===l&&Object.assign(i,{checkedAll:!G(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),i}))}function G(e){return T.value.some((t=>("explicitRequired"!==e||F(t))&&!t[e]))}return i((()=>B.defaultList),(e=>{e.length>0&&(T.value=A(e),z())}),{immediate:!0,deep:!0}),E({getTableFields:()=>T.value}),(t,l)=>(a(),d("div",R,[r("div",q,[r("div",V,[(a(!0),d(s,null,c(O.value,((e,t)=>(a(),d(s,{key:t},[e.isShow?(a(),d("span",{key:0,class:"table-cell",style:o(n(j)(e,t))},[r("span",null,["checkbox"!==e.type||e.isHeadCheckHide?(a(),d(s,{key:1},[m(f(e.title),1)],64)):(a(),u(n(x),{key:0,checked:e.checkedAll,"onUpdate:checked":[t=>e.checkedAll=t,t=>{return l=t,i=e.field,void T.value.forEach((e=>{("explicitRequired"!==i||"explicitRequired"===i&&F(e))&&(e[i]=l)}));var l,i}],disabled:e.disabledAll},{default:p((()=>[m(f(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))])],4)):h("v-if",!0)],64)))),128))]),r("div",H,[v(n(_),{modelValue:T.value,"onUpdate:modelValue":l[0]||(l[0]=e=>T.value=e),animation:"150","item-key":"id",draggable:".item"},{item:p((({element:e,index:t})=>[e.hide?h("v-if",!0):(a(),d("div",{key:0,class:"item",tabindex:t},[v(w,k(D,{element:e,idx:t+1}),null,16,["element","idx"])],8,S))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(a(),d("div",U,[h(" 底部按钮插槽 "),b(t.$slots,"fieldFilterFooter",{},(()=>[v(n(y),{onPositiveClick:$},{trigger:p((()=>[v(n(g),{style:{"margin-right":"8px"}},{default:p((()=>[m("恢复默认设置")])),_:1})])),default:p((()=>[m(" 确认要恢复系统默认设置吗? ")])),_:1}),v(n(g),{style:{"margin-right":"8px"},onClick:P},{default:p((()=>[m("取消")])),_:1}),v(n(g),{type:"primary",onClick:N},{default:p((()=>[m("保存")])),_:1})]))])):h("v-if",!0)]))}});export{E as default};