cnhis-design-vue 3.1.57-release.2 → 3.1.57-release.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/calendar/index.d.ts +276 -0
- package/es/components/calendar/index.js +1 -0
- package/es/components/calendar/src/Calendar.vue.d.ts +265 -0
- package/es/components/calendar/src/Calendar.vue.js +1 -0
- package/es/components/calendar/src/Calendar.vue2.js +1 -0
- package/es/components/calendar/src/types/index.d.ts +6 -0
- package/es/components/calendar/src/types/index.js +1 -0
- package/es/components/calendar/style/index.css +1 -0
- package/es/components/callback/src/components/render/popupMaps.d.ts +216 -216
- package/es/components/classification/index.d.ts +3 -3
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -3
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -3
- package/es/components/classification/src/index.vue.d.ts +3 -3
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue.d.ts +1 -1
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/fabric-chart/index.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
- package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +2 -0
- package/es/components/field-set/src/FieldColor.vue.d.ts +3 -3
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/Row.vue.d.ts +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +2 -2
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +1 -1
- package/es/components/form-config/index.d.ts +7 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +7 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
- package/es/components/form-render/src/components/renderer/combination/combination.d.ts +12 -0
- package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.d.ts +1 -1
- package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.d.ts +12 -0
- package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/guide/src/renderer.d.ts +2 -2
- package/es/components/iho-table/index.d.ts +216 -216
- package/es/components/iho-table/src/IhoTable.vue.d.ts +216 -216
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +3 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
- package/es/components/iho-table/src/types/index.d.ts +1 -0
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +2 -2
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +2 -2
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -4
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
- package/es/shared/package.json.js +1 -1
- package/package.json +74 -68
|
@@ -860,7 +860,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
860
860
|
focus: () => any;
|
|
861
861
|
blur: () => any;
|
|
862
862
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
863
|
-
onUpdateShow: (show: boolean) => void
|
|
863
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
864
864
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
865
865
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
866
866
|
NDatePicker: any;
|
|
@@ -1501,7 +1501,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1501
1501
|
focus: () => any;
|
|
1502
1502
|
blur: () => any;
|
|
1503
1503
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1504
|
-
onUpdateShow: (show: boolean) => void
|
|
1504
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1505
1505
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1506
1506
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1507
1507
|
NDatePicker: any;
|
|
@@ -1948,7 +1948,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1948
1948
|
focus: () => any;
|
|
1949
1949
|
blur: () => any;
|
|
1950
1950
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1951
|
-
onUpdateShow: (show: boolean) => void
|
|
1951
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1952
1952
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1953
1953
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1954
1954
|
NDatePicker: any;
|
|
@@ -49,7 +49,7 @@ declare const DatePicker: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
49
49
|
focus: () => any;
|
|
50
50
|
blur: () => any;
|
|
51
51
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
52
|
-
onUpdateShow: (show: boolean) => void
|
|
52
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
53
53
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
54
54
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
55
55
|
NDatePicker: any;
|
|
@@ -51,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
focus: () => any;
|
|
52
52
|
blur: () => any;
|
|
53
53
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
54
|
-
onUpdateShow: (show: boolean) => void
|
|
54
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
55
55
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
56
56
|
isAllowedInvalidValue: (value: FormattedValue | null | undefined) => boolean | "" | undefined;
|
|
57
57
|
NDatePicker: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,useAttrs as
|
|
1
|
+
import{defineComponent as e,useAttrs as a,ref as t,computed as l,watch as n,openBlock as o,createBlock as u,unref as r,isRef as i,createSlots as d,renderList as s,withCtx as p,renderSlot as m,nextTick as v}from"vue";import{NDatePicker as f}from"naive-ui";import"../../../shared/utils/index.js";import{isString as c,isArray as y}from"lodash-es";import{useDateTime as h}from"../../../shared/hooks/useDateTime.js";import"@vue/shared";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{format as g}from"date-fns";var w=e({__name:"DatePicker",props:{updateUnchangedValue:{type:Boolean},onConfirm:{type:Function},formattedValue:{type:[String,Array]},placeholder:{type:String},allowedInvalidValue:{type:String}},emits:["update:formatted-value"],setup(e,{expose:w,emit:V}){const I=e,R=a(),k=t(null),D=t(null),C=t(),M=l({get:()=>x(I.formattedValue)?null:I.formattedValue,set(e){V("update:formatted-value",e,c(e)?Date.parse(e):y(e)?[Date.parse(e[0]),Date.parse(e[1])]:null)}}),S=l((()=>{const e=Reflect.get(R,"type")||"";return["datetime","datetimerange"].includes(e)})),E=l((()=>{if(Reflect.get(R,"format"))return R.format;const e=R.type||"";return S.value?"yyyy-MM-dd HH:mm:ss":"month"===e?"yyyy-MM":"year"===e?"yyyy":"yyyy-MM-dd"})),P=l((()=>S.value?E.value.split(" "):"")),{focus:U,blur:$,handleConfirm:_}=h(k,{formatRef:E,attrs:R,emit:V,allowedInvalidValue:I.allowedInvalidValue});async function b(e){e&&S.value&&(await v(),async function e(a=0){var t;a>2||(D.value=null==(t=k.value)?void 0:t.panelInstRef,D.value?h(D,{formatRef:P,attrs:R,isPanel:!0}):(await v(),e(++a)))}())}async function j(...e){var a,t,l,n,o,u;const r=Reflect.get(R,"type")||"",i=null==(n=null==(l=null==(t=null==(a=k.value)?void 0:a.inputInstRef)?void 0:t.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(r.includes("range")?null==(o=I.onConfirm)||o.call(I,...e):(await v(),i.focus(),_(i),i.blur(),null==(u=I.onConfirm)||u.call(I,Date.parse(i.value),i.value)),!(null==i?void 0:i.value)||!I.updateUnchangedValue||r.includes("range"))return;const d=i.value;i.value=g(new Date,E.value),i.dispatchEvent(new InputEvent("input")),i.value=d,i.dispatchEvent(new InputEvent("input"))}function x(e){return I.allowedInvalidValue&&I.allowedInvalidValue===e}return n((()=>I.formattedValue),(e=>{C.value=x(e)?e:I.placeholder?I.placeholder:"选择日期时间"}),{immediate:!0}),w({$datePicker:k,focus:U,blur:$}),(e,a)=>(o(),u(r(f),{ref_key:"datePickerRef",ref:k,"onUpdate:show":b,onConfirm:j,placeholder:C.value,"formatted-value":r(M),"onUpdate:formatted-value":a[0]||(a[0]=e=>i(M)?M.value=e:null)},d({_:2},[s(e.$slots,((a,t)=>({name:t,fn:p((()=>[m(e.$slots,t)]))})))]),1032,["placeholder","formatted-value"]))}});export{w as default};
|
|
@@ -31,8 +31,9 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
31
31
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
32
32
|
"onAdd:prevent"?: ((...args: any[]) => any) | undefined;
|
|
33
33
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
onEventClick?: ((...args: any[]) => any) | undefined;
|
|
34
35
|
}>>;
|
|
35
|
-
emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid", ...args: any[]) => void;
|
|
36
|
+
emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
|
|
36
37
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
|
37
38
|
canvas: import("vue").Ref<any>;
|
|
38
39
|
pointTipProps: {
|
|
@@ -165,7 +166,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
165
166
|
show: boolean;
|
|
166
167
|
list: unknown[];
|
|
167
168
|
}>;
|
|
168
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
169
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
169
170
|
type: {
|
|
170
171
|
type: import("vue").PropType<import("./src/interface").IType>;
|
|
171
172
|
default: string;
|
|
@@ -184,6 +185,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
184
185
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
185
186
|
"onAdd:prevent"?: ((...args: any[]) => any) | undefined;
|
|
186
187
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
|
188
|
+
onEventClick?: ((...args: any[]) => any) | undefined;
|
|
187
189
|
}, {
|
|
188
190
|
type: import("./src/interface").IType;
|
|
189
191
|
}>>;
|
|
@@ -33,8 +33,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
33
33
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
34
34
|
"onAdd:prevent"?: ((...args: any[]) => any) | undefined;
|
|
35
35
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
onEventClick?: ((...args: any[]) => any) | undefined;
|
|
36
37
|
}>>;
|
|
37
|
-
emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid", ...args: any[]) => void;
|
|
38
|
+
emits: (event: "add" | "change" | "remove" | "select" | "add:prevent" | "click:grid" | "eventClick", ...args: any[]) => void;
|
|
38
39
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
|
39
40
|
canvas: import("vue").Ref<any>;
|
|
40
41
|
pointTipProps: {
|
|
@@ -167,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
167
168
|
show: boolean;
|
|
168
169
|
list: unknown[];
|
|
169
170
|
}>;
|
|
170
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
171
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("add" | "change" | "remove" | "select" | "add:prevent" | "click:grid" | "eventClick")[], "remove" | "add" | "change" | "select" | "add:prevent" | "click:grid" | "eventClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
171
172
|
type: {
|
|
172
173
|
type: PropType<IType>;
|
|
173
174
|
default: string;
|
|
@@ -186,6 +187,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
186
187
|
onRemove?: ((...args: any[]) => any) | undefined;
|
|
187
188
|
"onAdd:prevent"?: ((...args: any[]) => any) | undefined;
|
|
188
189
|
"onClick:grid"?: ((...args: any[]) => any) | undefined;
|
|
190
|
+
onEventClick?: ((...args: any[]) => any) | undefined;
|
|
189
191
|
}, {
|
|
190
192
|
type: IType;
|
|
191
193
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,d({propItems:n(S)},M),null,16,["propItems"]),h(n(g),d({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
|
|
1
|
+
import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,d({propItems:n(S)},M),null,16,["propItems"]),h(n(g),d({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:m,computedY:c}=s(d),{borderStyle:h,originX:f,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,rowIdx:s}=r.origin,l=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const s=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+l||o===a.MAXLINENUMBER-1?[{x:m(e.length+1),y:c(-+r)+n}]:[];return e.concat(s)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):R.add(f),arguments.length)return;const g=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"bottom"});R.add(g)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:b*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,unref as r,watch as
|
|
1
|
+
import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as d}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const N=e(),f=e(),b=e(),M=e(),L=t((()=>v.data.width)),y=t((()=>v.data.height)),S=t((()=>(L.value-0)/C.value)),w=t((()=>(y.value-0)/E.value)),C=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data.length/t.hz;return Math.ceil(a/t.mainXCellValue)})),E=t((()=>{const{config:e,grid:t,dataList:a}=v.data;if(t.gridYNumber)return t.gridYNumber;const r=a.length;return Math.ceil(x.value*r*2/e.mainYCellValue)})),x=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),j=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=v.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{rowNumber:e}=R.value,{dataList:t}=v.data,a=t.length;return Math.round(E.value/(e+(a===o.MAXLINENUMBER?1:0)))})),X=t((()=>{const{dataList:e,width:t,config:a,grid:r}=v.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+w.value*Math.ceil(I.value/2),rowIdx:a}}}))})),U=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...l,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:L.value,originY:0,endY:y.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:X.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return u((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(m,U),{updatePolyline:u}=d(m,U,t);f.value=e,b.value=a,M.value=r,N.value=u}()}),{immediate:!0}),{propItems:U,updatePolyline:N,useMeasureRuler:f,useCaliper:b,useCaliperRuler:M,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as b}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as x,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,C,P,A){r(L,S);const{getEqualXTypes:I,handleAddPrevent:R}=y(L,Y,S),{createShadowLines:T}=t(),{left:V,xScaleList:X,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(V.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,V.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:b={},nonePainPointStyle:x={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=x,I=[],R=[],T=[];null==(u=e.list)||u.forEach(((u,x)=>{const V=a(c)?w.find((e=>e.key===u.key)):e,X=ce(u,r),F={};F.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-D}}(X,u,V),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let b,x,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}T.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==N?void 0:N.hypothermyViewCustom)?e[0]+z/2:e[0];b=i([...e,s,l],{...y,...g.line,...n}),x=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:s,top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),b&&T.push(b),x&&T.push(x)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:x,type:"reduce"}})}(X,u,V,F),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),T.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),T.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),T.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;p=s([e[0],t,i],{...j.style})}T.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:p,top:j.text?5:2*D,moveHide:!0}})}(X,u,V,F),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:b="circle"}=a,x=e.list[s+1],j=ce(x,r),w=ae(c,e.list[s].value),k=j&&ae(c,x.value);if(n&&j&&!l.breakpoint&&(!w&&!k||A)&&n[0]!==j[0]){f=i([...n,...j],{...v});const{obj:e}=(null==u?void 0:u.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==N?void 0:N.hypothermyViewCustom)){const t=i([e.left,e.top,...j],{...v});T.unshift(t),Object.assign(u,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:b,M=R[s-1],V={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:w?e-5:e,...V})}else n&&(V.leftLine=null,p=o(E,{left:n[0],top:w?n[1]-5:n[1],...V}));R.push(f),p&&(g.includes("脉搏")?te.add(p):ie.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(p),I.push(p),ne.add(p))}(X,u,x,V,F)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{L.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(!f(e)||!function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time))return;const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return K&&l<h(K)?(R("exceedMin"),!1):!(l>o)||(R("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;fe()}function fe(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{var t;if(3===e.button){if(!S.event.evented)return;const{x:i=0,y:n=0}=e.pointer||{};if(i>=F&&i<=H&&n>=_&&n<=W){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...j]),A.target=e.target;else{A.target=null,A.list=["新增节点"],q.forEach((t=>{if(!I([...ne],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?J:B;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:C?C(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&R("repeat"))}}}if(1===e.button){const{x:t=0,y:i=0}=e.pointer||{};t>=F&&t<=H&&i>0&&i<Q&&Y("click:grid",{x:t,y:i,time:$(t)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ue,isAddPoint:pe,updateData:de,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
|
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as d,setOtherType as p,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as x}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as b,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,C,P,A){r(L,S);const{getEqualXTypes:I,handleAddPrevent:R}=y(L,Y,S),{createShadowLines:T}=t(),{left:V,xScaleList:X,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(V.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,V.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=b,I=[],R=[],T=[];null==(u=e.list)||u.forEach(((u,b)=>{const V=a(c)?w.find((e=>e.key===u.key)):e,X=ce(u,r),F={};F.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-D}}(X,u,V),function(e,t,r,a){var u,p;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}T.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(L));if(d(t.physicsReduce)||d(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==N?void 0:N.hypothermyViewCustom)?e[0]+z/2:e[0];x=i([...e,s,l],{...y,...g.line,...n}),b=o((null==(p=null==g?void 0:g.point)?void 0:p.type)||"circle",{left:s,top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),x&&T.push(x),b&&T.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:b,type:"reduce"}})}(X,u,V,F),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),T.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),T.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),T.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)d=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;d=s([e[0],t,i],{...j.style})}T.push(d)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:d,top:j.text?5:2*D,moveHide:!0}})}(X,u,V,F),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ce(b,r),w=ae(c,e.list[s].value),k=j&&ae(c,b.value);if(n&&j&&!l.breakpoint&&(!w&&!k||A)&&n[0]!==j[0]){f=i([...n,...j],{...v});const{obj:e}=(null==u?void 0:u.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==N?void 0:N.hypothermyViewCustom)){const t=i([e.left,e.top,...j],{...v});T.unshift(t),Object.assign(u,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:x,M=R[s-1],V={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:p(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};if(M){const e=M.get("y2");d=o(E,{left:M.get("x2"),top:w?e-5:e,...V})}else n&&(V.leftLine=null,d=o(E,{left:n[0],top:w?n[1]-5:n[1],...V}));R.push(f),d&&(g.includes("脉搏")?te.add(d):ie.add(d),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),pe(n,"change")}}))}(d),I.push(d),ne.add(d))}(X,u,b,V,F)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{L.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(o,e.top);if(d(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(d(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(!f(e)||!function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time))return;const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function de(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return K&&l<h(K)?(R("exceedMin"),!1):!(l>o)||(R("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;fe()}function fe(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!S.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=F&&e<=H&&t>=_&&t<=W){A.point={x:e,y:t},A.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...b]),"pain"===o&&(A.list=[...j]),A.target=i;else{A.target=null,A.list=["新增节点"],q.forEach((i=>{if(!I([...ne],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?J:B;t>=e.originY&&t<=e.endY&&A.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:u(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=de(e);i&&1!==A.list.length||(A.show=!1,1===A.list.length&&i&&R("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=F&&e<=H&&t>0&&t<Q&&Y("click:grid",{x:e,y:t,time:$(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...b,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),pe(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),pe(t)}},setPopup:ue,isAddPoint:de,updateData:pe,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { fabric } from '../../../../../shared/utils/fabricjs';
|
|
3
3
|
import { IPropItems } from '../../../../../components/fabric-chart/src/interface';
|
|
4
|
-
export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: IPropItems, computedX: Function): void;
|
|
4
|
+
export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, computedX: Function): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function i(i,n,o){const{other:r,vitalSignsOriginY:
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function i(i,n,o,l){const{other:r,vitalSignsOriginY:s,xCellWidth:h,yCellHeight:a,endX:u}=n;let c=0;function f(n,l,s){const u=[];String(n.value).split("").forEach(((i,o)=>{const l=new t.Text(i,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...n.style||{}});c=(a-(l.height||0))/2,u.push(l)}));const f=new t.Rect({left:0,top:0,width:h,height:a*u.length,fill:"transparent",originX:"center",...e}),{eventHighlight:g=!1}=r||{},p={originX:"center",left:l,top:s+c,baseTop:(n.baseTop||0)*a,trueLeft:l,trueHeight:u.length*a,objectCaching:!1,hoverCursor:"pointer",highlightObject:f,originData:n,selectable:!1,evented:g},v=new t.Group([f,...u],p);return function(t){const{highlightColor:e="#ffff00"}=r||{};t.on("mouseover",(()=>{t.highlightObject.set("fill",e),i.value.requestRenderAll()})),t.on("mouseout",(()=>{t.highlightObject.set("fill","transparent"),i.value.requestRenderAll()})),t.on("mousedown",(function(){o("eventClick",t.originData)}))}(v),i.value.add(v),v}!function(){if(!(null==r?void 0:r.list))return!1;const t=[],e=[];r.list.forEach(((t,i)=>{const n=0===i?"vertical":t.align||"vertical",o=l(t.time,!0);if(o>u)return;const r=e.find((t=>t.left==o));if(r)r[n].push(t);else{const i={left:o,vertical:[],horizontal:[]};i[n].push(t),e.push(i)}})),e.forEach((e=>{let i=s.originY,n=e.left;e.vertical.forEach(((o,l)=>{var r,u;const c=(o.baseTop||0)*a,g=(null==(r=t.at(-1))?void 0:r.left)||0;0===l&&e.left<=g&&(n=g+h);if(t.filter((t=>t.trueLeft===n)).length){const e=String(o.value).length*a,l=(null==(u=t.at(-1))?void 0:u.trueHeight)||0;i+=l,i+e+c>s.endY&&(i=s.originY,n+=h)}i+=c,String(o.value).length&&t.push(f(o,n,i))})),e.horizontal.forEach(((i,o)=>{var l;const r=s.originY+(i.baseTop||0)*a,u=(null==(l=t.at(-1))?void 0:l.left)||0;e.left<=u&&(n=u+h),String(i.value).length&&t.push(f(i,n,r))}))}))}()}export{i as useOther};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as d,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),X=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+H.value[0]+H.value[2]})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>W.value-H.value[2]*T.value)),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+B.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>G.value-H.value[2]*A.value)),q=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+L.value+I.value})),z=t((()=>q.value+H.value[0]*A.value)),T=t((()=>(W.value-k.value)/N.value)),A=t((()=>(G.value-q.value)/O.value)),B=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),E=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-T.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=T.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+T.value/2,scaleCell:(l-a)/T.value}}))));return s(o)})),F=t((()=>re("breathe"))),J=t((()=>re("pulse"))),K=t((()=>re("temperature"))),Q=t((()=>re("pain"))),U=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=t((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))))})),_=t((()=>{var e,t;const{left:a}=S.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),ee=t((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),te=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.endY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.originY=R.value-ee.value),t})),ae=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.originY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.endY=R.value-ee.value),t})),le=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ue=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:le.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:te.value,vitalSignsOriginY:ae.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:B.value,originX:k.value,originY:q.value,originYLimit:z.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:H.value});function re(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?A.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:oe,getXValue:se,getYValue:de}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,ie,b,ne,oe,se,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=h(y,ie,b,e,Y,ne,oe,se,de,t,a,i);p(y,ie,n),m(y,ie),f(y,ie,ne);const{select:o}=r(y,ie,b);D.value=o}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
|
|
1
|
+
import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as d,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),X=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+H.value[0]+H.value[2]})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>W.value-H.value[2]*T.value)),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+B.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>G.value-H.value[2]*A.value)),q=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+L.value+I.value})),z=t((()=>q.value+H.value[0]*A.value)),T=t((()=>(W.value-k.value)/N.value)),A=t((()=>(G.value-q.value)/O.value)),B=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),E=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-T.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=T.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+T.value/2,scaleCell:(l-a)/T.value}}))));return s(o)})),F=t((()=>re("breathe"))),J=t((()=>re("pulse"))),K=t((()=>re("temperature"))),Q=t((()=>re("pain"))),U=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=t((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))))})),_=t((()=>{var e,t;const{left:a}=S.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),ee=t((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),te=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.endY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.originY=R.value-ee.value),t})),ae=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.originY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.endY=R.value-ee.value),t})),le=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ue=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:le.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:te.value,vitalSignsOriginY:ae.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:B.value,originX:k.value,originY:q.value,originYLimit:z.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:H.value});function re(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?A.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:oe,getXValue:se,getYValue:de}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,ie,b,ne,oe,se,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=h(y,ie,b,e,Y,ne,oe,se,de,t,a,i);p(y,ie,n),m(y,ie),f(y,ie,b,ne);const{select:o}=r(y,ie,b);D.value=o}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
|
|
@@ -456,9 +456,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
456
456
|
requiredDisable: boolean;
|
|
457
457
|
hide: boolean;
|
|
458
458
|
}>;
|
|
459
|
+
isHighlightRow: boolean;
|
|
459
460
|
idx: number;
|
|
460
461
|
isHighlight: boolean;
|
|
461
|
-
isHighlightRow: boolean;
|
|
462
462
|
}>;
|
|
463
463
|
EditDialog: import("vue").DefineComponent<{
|
|
464
464
|
visible: {
|
|
@@ -1313,7 +1313,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1313
1313
|
focus: () => any;
|
|
1314
1314
|
blur: () => any;
|
|
1315
1315
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1316
|
-
onUpdateShow: (show: boolean) => void
|
|
1316
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1317
1317
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1318
1318
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1319
1319
|
NDatePicker: any;
|
|
@@ -1580,7 +1580,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1580
1580
|
focus: () => any;
|
|
1581
1581
|
blur: () => any;
|
|
1582
1582
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1583
|
-
onUpdateShow: (show: boolean) => void
|
|
1583
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1584
1584
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1585
1585
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1586
1586
|
NDatePicker: any;
|
|
@@ -574,9 +574,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
574
574
|
requiredDisable: boolean;
|
|
575
575
|
hide: boolean;
|
|
576
576
|
}>;
|
|
577
|
+
isHighlightRow: boolean;
|
|
577
578
|
idx: number;
|
|
578
579
|
isHighlight: boolean;
|
|
579
|
-
isHighlightRow: boolean;
|
|
580
580
|
}>;
|
|
581
581
|
isArray: {
|
|
582
582
|
(value?: any): value is any[];
|
|
@@ -281,8 +281,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
281
281
|
requiredDisable: boolean;
|
|
282
282
|
hide: boolean;
|
|
283
283
|
}>;
|
|
284
|
+
isHighlightRow: boolean;
|
|
284
285
|
idx: number;
|
|
285
286
|
isHighlight: boolean;
|
|
286
|
-
isHighlightRow: boolean;
|
|
287
287
|
}>;
|
|
288
288
|
export default _default;
|
|
@@ -136,7 +136,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
136
136
|
focus: () => any;
|
|
137
137
|
blur: () => any;
|
|
138
138
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
139
|
-
onUpdateShow: (show: boolean) => void
|
|
139
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
140
140
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
141
141
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
142
142
|
NDatePicker: any;
|
|
@@ -854,7 +854,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
854
854
|
focus: () => any;
|
|
855
855
|
blur: () => any;
|
|
856
856
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
857
|
-
onUpdateShow: (show: boolean) => void
|
|
857
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
858
858
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
859
859
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
860
860
|
NDatePicker: any;
|
|
@@ -1121,7 +1121,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1121
1121
|
focus: () => any;
|
|
1122
1122
|
blur: () => any;
|
|
1123
1123
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
1124
|
-
onUpdateShow: (show: boolean) => void
|
|
1124
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
1125
1125
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
1126
1126
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
1127
1127
|
NDatePicker: any;
|
|
@@ -234,7 +234,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
234
234
|
focus: () => any;
|
|
235
235
|
blur: () => any;
|
|
236
236
|
handleConfirm: (target: HTMLInputElement) => void;
|
|
237
|
-
onUpdateShow: (show: boolean) => void
|
|
237
|
+
onUpdateShow: (show: boolean) => Promise<void>;
|
|
238
238
|
onConfirm: (...args: any[]) => Promise<void>;
|
|
239
239
|
isAllowedInvalidValue: (value: (string | [string, string]) | null | undefined) => boolean | "" | undefined;
|
|
240
240
|
NDatePicker: any;
|
|
@@ -422,6 +422,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
422
422
|
lazyRequest?: boolean | undefined;
|
|
423
423
|
requestCache?: boolean | undefined;
|
|
424
424
|
maxGroupNum?: number | undefined;
|
|
425
|
+
minGroupNum?: number | undefined;
|
|
425
426
|
jsonCombination?: boolean | undefined;
|
|
426
427
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
427
428
|
children?: any[] | undefined;
|
|
@@ -2172,6 +2173,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2172
2173
|
lazyRequest?: boolean | undefined;
|
|
2173
2174
|
requestCache?: boolean | undefined;
|
|
2174
2175
|
maxGroupNum?: number | undefined;
|
|
2176
|
+
minGroupNum?: number | undefined;
|
|
2175
2177
|
jsonCombination?: boolean | undefined;
|
|
2176
2178
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
2177
2179
|
children?: any[] | undefined;
|
|
@@ -3970,6 +3972,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
3970
3972
|
lazyRequest?: boolean | undefined;
|
|
3971
3973
|
requestCache?: boolean | undefined;
|
|
3972
3974
|
maxGroupNum?: number | undefined;
|
|
3975
|
+
minGroupNum?: number | undefined;
|
|
3973
3976
|
jsonCombination?: boolean | undefined;
|
|
3974
3977
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
3975
3978
|
children?: any[] | undefined;
|
|
@@ -5720,6 +5723,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
5720
5723
|
lazyRequest?: boolean | undefined;
|
|
5721
5724
|
requestCache?: boolean | undefined;
|
|
5722
5725
|
maxGroupNum?: number | undefined;
|
|
5726
|
+
minGroupNum?: number | undefined;
|
|
5723
5727
|
jsonCombination?: boolean | undefined;
|
|
5724
5728
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
5725
5729
|
children?: any[] | undefined;
|
|
@@ -8733,6 +8737,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
8733
8737
|
lazyRequest?: boolean | undefined;
|
|
8734
8738
|
requestCache?: boolean | undefined;
|
|
8735
8739
|
maxGroupNum?: number | undefined;
|
|
8740
|
+
minGroupNum?: number | undefined;
|
|
8736
8741
|
jsonCombination?: boolean | undefined;
|
|
8737
8742
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
8738
8743
|
children?: any[] | undefined;
|
|
@@ -10494,6 +10499,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
10494
10499
|
lazyRequest?: boolean | undefined;
|
|
10495
10500
|
requestCache?: boolean | undefined;
|
|
10496
10501
|
maxGroupNum?: number | undefined;
|
|
10502
|
+
minGroupNum?: number | undefined;
|
|
10497
10503
|
jsonCombination?: boolean | undefined;
|
|
10498
10504
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
10499
10505
|
children?: any[] | undefined;
|
|
@@ -12228,6 +12234,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
12228
12234
|
lazyRequest?: boolean | undefined;
|
|
12229
12235
|
requestCache?: boolean | undefined;
|
|
12230
12236
|
maxGroupNum?: number | undefined;
|
|
12237
|
+
minGroupNum?: number | undefined;
|
|
12231
12238
|
jsonCombination?: boolean | undefined;
|
|
12232
12239
|
combinationItemDeletable?: boolean | import("..").CombinationItemDeletableFn | undefined;
|
|
12233
12240
|
children?: any[] | undefined;
|
|
@@ -425,6 +425,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
425
425
|
lazyRequest?: boolean | undefined;
|
|
426
426
|
requestCache?: boolean | undefined;
|
|
427
427
|
maxGroupNum?: number | undefined;
|
|
428
|
+
minGroupNum?: number | undefined;
|
|
428
429
|
jsonCombination?: boolean | undefined;
|
|
429
430
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
430
431
|
children?: any[] | undefined;
|
|
@@ -2175,6 +2176,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2175
2176
|
lazyRequest?: boolean | undefined;
|
|
2176
2177
|
requestCache?: boolean | undefined;
|
|
2177
2178
|
maxGroupNum?: number | undefined;
|
|
2179
|
+
minGroupNum?: number | undefined;
|
|
2178
2180
|
jsonCombination?: boolean | undefined;
|
|
2179
2181
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
2180
2182
|
children?: any[] | undefined;
|
|
@@ -3973,6 +3975,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3973
3975
|
lazyRequest?: boolean | undefined;
|
|
3974
3976
|
requestCache?: boolean | undefined;
|
|
3975
3977
|
maxGroupNum?: number | undefined;
|
|
3978
|
+
minGroupNum?: number | undefined;
|
|
3976
3979
|
jsonCombination?: boolean | undefined;
|
|
3977
3980
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
3978
3981
|
children?: any[] | undefined;
|
|
@@ -5723,6 +5726,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5723
5726
|
lazyRequest?: boolean | undefined;
|
|
5724
5727
|
requestCache?: boolean | undefined;
|
|
5725
5728
|
maxGroupNum?: number | undefined;
|
|
5729
|
+
minGroupNum?: number | undefined;
|
|
5726
5730
|
jsonCombination?: boolean | undefined;
|
|
5727
5731
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
5728
5732
|
children?: any[] | undefined;
|
|
@@ -8736,6 +8740,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8736
8740
|
lazyRequest?: boolean | undefined;
|
|
8737
8741
|
requestCache?: boolean | undefined;
|
|
8738
8742
|
maxGroupNum?: number | undefined;
|
|
8743
|
+
minGroupNum?: number | undefined;
|
|
8739
8744
|
jsonCombination?: boolean | undefined;
|
|
8740
8745
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
8741
8746
|
children?: any[] | undefined;
|
|
@@ -10497,6 +10502,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10497
10502
|
lazyRequest?: boolean | undefined;
|
|
10498
10503
|
requestCache?: boolean | undefined;
|
|
10499
10504
|
maxGroupNum?: number | undefined;
|
|
10505
|
+
minGroupNum?: number | undefined;
|
|
10500
10506
|
jsonCombination?: boolean | undefined;
|
|
10501
10507
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
10502
10508
|
children?: any[] | undefined;
|
|
@@ -12231,6 +12237,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12231
12237
|
lazyRequest?: boolean | undefined;
|
|
12232
12238
|
requestCache?: boolean | undefined;
|
|
12233
12239
|
maxGroupNum?: number | undefined;
|
|
12240
|
+
minGroupNum?: number | undefined;
|
|
12234
12241
|
jsonCombination?: boolean | undefined;
|
|
12235
12242
|
combinationItemDeletable?: boolean | import("../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
12236
12243
|
children?: any[] | undefined;
|
|
@@ -378,6 +378,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
378
378
|
lazyRequest?: boolean | undefined;
|
|
379
379
|
requestCache?: boolean | undefined;
|
|
380
380
|
maxGroupNum?: number | undefined;
|
|
381
|
+
minGroupNum?: number | undefined;
|
|
381
382
|
jsonCombination?: boolean | undefined;
|
|
382
383
|
combinationItemDeletable?: boolean | import("../../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
383
384
|
children?: any[] | undefined;
|
|
@@ -2139,6 +2140,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2139
2140
|
lazyRequest?: boolean | undefined;
|
|
2140
2141
|
requestCache?: boolean | undefined;
|
|
2141
2142
|
maxGroupNum?: number | undefined;
|
|
2143
|
+
minGroupNum?: number | undefined;
|
|
2142
2144
|
jsonCombination?: boolean | undefined;
|
|
2143
2145
|
combinationItemDeletable?: boolean | import("../../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
2144
2146
|
children?: any[] | undefined;
|
|
@@ -3873,6 +3875,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3873
3875
|
lazyRequest?: boolean | undefined;
|
|
3874
3876
|
requestCache?: boolean | undefined;
|
|
3875
3877
|
maxGroupNum?: number | undefined;
|
|
3878
|
+
minGroupNum?: number | undefined;
|
|
3876
3879
|
jsonCombination?: boolean | undefined;
|
|
3877
3880
|
combinationItemDeletable?: boolean | import("../../../../components/form-render").CombinationItemDeletableFn | undefined;
|
|
3878
3881
|
children?: any[] | undefined;
|
|
@@ -11,6 +11,10 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
11
11
|
maxGroupNum: {
|
|
12
12
|
type: NumberConstructor;
|
|
13
13
|
};
|
|
14
|
+
minGroupNum: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
14
18
|
disabled: {
|
|
15
19
|
type: BooleanConstructor;
|
|
16
20
|
};
|
|
@@ -22,6 +26,7 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
22
26
|
type: PropType<boolean | CombinationItemDeletableFn>;
|
|
23
27
|
default: boolean;
|
|
24
28
|
};
|
|
29
|
+
showLabel: BooleanConstructor;
|
|
25
30
|
onInput: {};
|
|
26
31
|
onBlur: {};
|
|
27
32
|
onChange: {};
|
|
@@ -36,6 +41,10 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
36
41
|
maxGroupNum: {
|
|
37
42
|
type: NumberConstructor;
|
|
38
43
|
};
|
|
44
|
+
minGroupNum: {
|
|
45
|
+
type: NumberConstructor;
|
|
46
|
+
default: number;
|
|
47
|
+
};
|
|
39
48
|
disabled: {
|
|
40
49
|
type: BooleanConstructor;
|
|
41
50
|
};
|
|
@@ -47,6 +56,7 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
47
56
|
type: PropType<boolean | CombinationItemDeletableFn>;
|
|
48
57
|
default: boolean;
|
|
49
58
|
};
|
|
59
|
+
showLabel: BooleanConstructor;
|
|
50
60
|
onInput: {};
|
|
51
61
|
onBlur: {};
|
|
52
62
|
onChange: {};
|
|
@@ -54,7 +64,9 @@ export declare const COMBINATION: import("vue").DefineComponent<{
|
|
|
54
64
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
55
65
|
}, {
|
|
56
66
|
disabled: boolean;
|
|
67
|
+
showLabel: boolean;
|
|
57
68
|
title: string;
|
|
69
|
+
minGroupNum: number;
|
|
58
70
|
combinationItemDeletable: boolean | CombinationItemDeletableFn;
|
|
59
71
|
properties: FieldItem[];
|
|
60
72
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as e,inject as o,createVNode as r}from"vue";import{isObjectField as t}from"@formily/core";import{connect as i,RecursionField as n}from"@formily/vue";import{range as m}from"lodash-es";import"../../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as s}from"../../../constants/index.js";import"../../../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"date-fns";import{createObjSchema as
|
|
1
|
+
import{defineComponent as e,inject as o,createVNode as r}from"vue";import{isObjectField as t}from"@formily/core";import{connect as i,RecursionField as n}from"@formily/vue";import{range as m}from"lodash-es";import"../../../../index.js";import{InjectionBusinessCollector as a,InjectionFormGlobalProps as s}from"../../../constants/index.js";import"../../../../../../shared/utils/index.js";import"@formily/path";import"@vicons/ionicons5";import"@vue/shared";import"@vueuse/core";import"naive-ui";import"date-fns";import{createObjSchema as u}from"../../../utils/schema.js";import{useCombination as l}from"./hooks/useCombination.js";import{useFormField as p}from"../../../hooks/useFormField.js";import{useFieldListAdaptor as c}from"../../../hooks/useFieldListAdaptor.js";const f=i(e({name:"FormCombination",props:{title:{type:String,default:""},value:{type:Array},maxGroupNum:{type:Number},minGroupNum:{type:Number,default:1},disabled:{type:Boolean},properties:{type:Array,default:()=>[]},combinationItemDeletable:{type:[Boolean,Function],default:!0},showLabel:Boolean,onInput:{},onBlur:{},onChange:{}},emits:["update:value"],setup(e){const{field:i,fieldKey:f}=p(),{currentGroupNum:d,renderRemoveBtn:v,renderHeader:y}=l(e);function h(){d.value++}const b=o(a),C=o(s),{schemaAdaptor:j}=c(b,C.lifeCycle);return()=>r("section",{class:"form-render__combination"},[y({onClick:h}),m(d.value).map(((o,m)=>r("section",{class:"form-render__combinationContent"},[r(n,{schema:u(j(e.properties)),name:m},null),v({onClick:()=>async function(o){if(d.value>e.minGroupNum)d.value--,await i.value.remove(o);else{const e=i.value.query(`${f.value}.${o}`).take();if(!e||!t(e))return;await e.reset()}}(m),class:"form-render__combinationClose"},m)])))])}}));export{f as COMBINATION};
|