cnhis-design-vue 3.2.15-beta.8 → 3.2.15-release.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ai-chat/index.d.ts +9 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +9 -0
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/branch-notice/index.d.ts +32 -3
- package/es/components/branch-notice/src/BranchNotice.vue.d.ts +9 -3
- package/es/components/branch-notice/src/BranchNotice.vue2.js +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/components/OldPrintComponent.vue2.js +1 -1
- package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
- package/es/components/classification/index.d.ts +30 -0
- package/es/components/classification/src/components/search-filter/index.vue.d.ts +30 -0
- package/es/components/classification/src/components/set-classification/index.vue.d.ts +30 -0
- package/es/components/classification/src/index.vue.d.ts +30 -0
- package/es/components/classification/src/index.vue2.js +1 -1
- package/es/components/date-picker/index.d.ts +10 -0
- package/es/components/date-picker/src/DatePicker.vue.d.ts +10 -0
- package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
- package/es/components/expand-field/index.d.ts +1 -1
- package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +1 -1
- package/es/components/expand-field/src/components/PersonModal.vue.d.ts +1 -1
- package/es/components/expand-field/src/components/form.vue.d.ts +1 -1
- package/es/components/expand-field/src/index.vue.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCommon.d.ts +1 -2
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +21 -1
- package/es/components/field-set/src/FieldFilter.vue.d.ts +3 -2
- package/es/components/field-set/src/FieldFilter.vue2.js +1 -1
- package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
- package/es/components/field-set/src/components/condition.vue.d.ts +10 -0
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +20 -0
- package/es/components/field-set/src/components/edit-filter.vue.d.ts +10 -0
- package/es/components/field-set/src/components/table-row.vue.d.ts +1 -1
- package/es/components/field-set/src/components/table-row.vue2.js +1 -1
- package/es/components/field-set/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +1021 -1
- package/es/components/form-config/src/FormConfig.vue.d.ts +1021 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +0 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue2.js +1 -1
- package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +1019 -0
- package/es/components/form-config/src/components/FormConfigEventSetting.vue2.js +1 -1
- package/es/components/form-config/src/constants/index.js +1 -1
- package/es/components/form-config/style/index.css +1 -1
- package/es/components/form-render/src/components/renderer/select.d.ts +6 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -1
- package/es/components/form-render/src/hooks/useLowCodeReactions.js +1 -1
- package/es/components/iho-chat/index.d.ts +300 -79
- package/es/components/iho-chat/src/Index.vue.d.ts +300 -79
- package/es/components/iho-chat/src/Index.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatAdd.vue.d.ts +33 -9
- package/es/components/iho-chat/src/components/ChatAdd.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatFile.vue.d.ts +33 -10
- package/es/components/iho-chat/src/components/ChatFooter.vue.d.ts +33 -10
- package/es/components/iho-chat/src/components/ChatHeader.vue.d.ts +109 -33
- package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +33 -11
- package/es/components/iho-chat/src/components/ChatRecord.vue.d.ts +10 -1
- package/es/components/iho-chat/src/components/ChatSearch.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/ChatSet.vue.d.ts +33 -11
- package/es/components/iho-chat/src/components/MultipleVideo.vue.d.ts +34 -10
- package/es/components/iho-chat/src/components/MultipleVideo.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue.d.ts +0 -1
- package/es/components/iho-chat/src/components/SiderList.vue.d.ts +15 -1
- package/es/components/iho-chat/src/components/SiderList.vue2.js +1 -1
- package/es/components/iho-chat/src/components/Video.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/Video.vue2.js +1 -1
- package/es/components/iho-chat/src/hooks/useData.d.ts +4 -2
- package/es/components/iho-chat/src/hooks/useData.js +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.d.ts +1 -1
- package/es/components/iho-chat/src/hooks/useVideo.js +1 -1
- package/es/components/iho-chat/src/types/index.d.ts +13 -2
- package/es/components/iho-chat/style/iconfont.ttf +0 -0
- package/es/components/iho-chat/style/index.css +1 -1
- package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +10 -0
- 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 +10 -0
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/select-person/index.d.ts +1 -1
- package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -1
- package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
- package/es/components/select-person/src/index.vue.d.ts +1 -1
- package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +10 -0
- package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +20 -0
- package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +20 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +20 -0
- package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +10 -0
- package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +40 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +40 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/types/business.d.ts +4 -0
- package/package.json +2 -2
@@ -1 +1 @@
|
|
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
|
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 p,withCtx as c,renderSlot as y,nextTick as f}from"vue";import{promiseTimeout as v}from"@vueuse/shared";import{NDatePicker as m}from"naive-ui";import"../../../shared/utils/index.js";import{useDateTime as h,handleInputEvent as g}from"../../../shared/hooks/useDateTime.js";import{isArray as D,isEqual as w,isString as k,isFunction as V,isNumber as S}from"lodash-es";import"@vue/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"../../../shared/hooks/useScrollLoading.js";import{subYears as b,addYears as _,isWithinInterval as A,format as I,sub as M,startOfDay as R,endOfDay as C}from"date-fns";var $=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"},isDateDisabled:{type:Function}},emits:["update:formatted-value"],setup(e,{expose:$,emit:j}){const F=e,P=t(),U=a(null),q=a(null),x=a();let E="";const H=l({get:()=>W(F.formattedValue)?null:F.formattedValue,set(e){D(e)&&D(E)&&w(E,e)||E===e||(j("update:formatted-value",e,k(e)?Date.parse(e):D(e)?[Date.parse(e[0]),Date.parse(e[1])]:null),E=e)}}),L=l((()=>F.type.includes("datetime"))),B=l((()=>Reflect.get(P,"format")?P.format:L.value?"yyyy-MM-dd HH:mm:ss":"month"===F.type?"yyyy-MM":"year"===F.type?"yyyy":"yyyy-MM-dd")),Y=l((()=>L.value?B.value.split(" "):"")),O=l((()=>{const e=e=>{const t=new Date(e),a=new Date,l=b(a,150),n=_(a,150);return!A(t,{start:l,end:n})};return V(F.isDateDisabled)?(t,...a)=>{var l;return(null==(l=F.isDateDisabled)?void 0:l.call(F,t,...a))||e(t)}:e})),{focus:T,blur:z,handleConfirm:G}=h(U,{formatRef:B,attrs:{...P,type:F.type},emit:j,allowedInvalidValue:F.allowedInvalidValue});async function J(e){!async function(e){var t;if(!e||!F.holidays.length)return;await v(0);const a=null==(t=U.value)?void 0:t.panelInstRef;if(!a)return;const l=a.$el;if(!l)return;N(),"daterange"===F.type?K.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"===F.type&&K.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,D(e)&&Array.from(l.querySelectorAll(t)).forEach(((t,l)=>{const{ts:n}=e[l]||{};if(!S(n))return;const o=new Date(n);F.holidays.some((e=>e.getDate()===o.getDate()&&e.getMonth()===o.getMonth()&&e.getFullYear()===o.getFullYear()))&&(f((()=>t.classList.add("c-date-picker__holiday"))),a.push(t))}))}),{immediate:!0,deep:!0});return()=>{n(),a.length=0}}}(e),e&&L.value&&(await f(),async function e(t=0){var a;t>2||(q.value=null==(a=U.value)?void 0:a.panelInstRef,q.value?h(q,{formatRef:Y,attrs:{...P,type:F.type},isPanel:!0}):(await f(),e(++t)))}())}const K=[];function N(){K.forEach((e=>e())),K.length=0}async function Q(...e){var t,a,l,n,o,r;const u=null==(n=null==(l=null==(a=null==(t=U.value)?void 0:t.inputInstRef)?void 0:a.$el)?void 0:l.querySelector)?void 0:n.call(l,"input");if(F.type.includes("range")?null==(o=F.onConfirm)||o.call(F,...e):(await f(),u.focus(),G(u),u.blur(),null==(r=F.onConfirm)||r.call(F,Date.parse(u.value),u.value)),!(null==u?void 0:u.value)||!F.updateUnchangedValue||F.type.includes("range"))return;const s=u.value;g(u,I(new Date,B.value)),g(u,s)}function W(e){return F.allowedInvalidValue&&F.allowedInvalidValue===e}return n(N),o((()=>F.formattedValue),(e=>{x.value=W(e)?e:F.placeholder?F.placeholder:"选择日期时间",W(e)||(E=e)}),{immediate:!0}),$({$datePicker:U,focus:T,blur:z,setShortcutValue:async function(e){if(!F.type||!F.type.includes("range")||!U.value)return;const t=U.value.$el.querySelectorAll(".n-input__input-el");let a,l;const n=new Date;if("week"===e){const e=M(n,{weeks:1});a=I(R(e),B.value)}else{const e=M(n,{months:1});a=I(R(e),B.value)}l=I(C(n),B.value),g(t[0],a),await f(),g(t[1],l)}}),(t,a)=>(r(),u(s(m),{ref_key:"datePickerRef",ref:U,"onUpdate:show":J,onConfirm:Q,placeholder:x.value,to:e.to,type:e.type,"formatted-value":s(H),"onUpdate:formatted-value":a[0]||(a[0]=e=>d(H)?H.value=e:null),"is-date-disabled":s(O)},i({_:2},[p(t.$slots,((e,a)=>({name:a,fn:c((()=>[y(t.$slots,a)]))})))]),1032,["placeholder","to","type","formatted-value","is-date-disabled"]))}});export{$ as default};
|
@@ -1204,7 +1204,6 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1204
1204
|
key: string | number;
|
1205
1205
|
}[]>;
|
1206
1206
|
isSearch: import("vue").Ref<boolean>;
|
1207
|
-
tempData: import("naive-ui").TreeOption[];
|
1208
1207
|
allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
|
1209
1208
|
isRemote: import("vue").ComputedRef<boolean>;
|
1210
1209
|
checkStrategyResult: import("vue").ComputedRef<any>;
|
@@ -1268,6 +1267,7 @@ declare const ExpandField: SFCWithInstall<import("vue").DefineComponent<{
|
|
1268
1267
|
notifyCheck: (keys: (string | number)[]) => void;
|
1269
1268
|
notifySearchClear: () => void;
|
1270
1269
|
getCheckWithLevel: () => any;
|
1270
|
+
resetParams: () => void;
|
1271
1271
|
NButton: any;
|
1272
1272
|
NInput: any;
|
1273
1273
|
NInputGroup: any;
|
@@ -878,7 +878,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
878
878
|
key: string | number;
|
879
879
|
}[]>;
|
880
880
|
isSearch: import("vue").Ref<boolean>;
|
881
|
-
tempData: import("naive-ui").TreeOption[];
|
882
881
|
allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
|
883
882
|
isRemote: import("vue").ComputedRef<boolean>;
|
884
883
|
checkStrategyResult: import("vue").ComputedRef<any>;
|
@@ -942,6 +941,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
942
941
|
notifyCheck: (keys: (string | number)[]) => void;
|
943
942
|
notifySearchClear: () => void;
|
944
943
|
getCheckWithLevel: () => any;
|
944
|
+
resetParams: () => void;
|
945
945
|
NButton: any;
|
946
946
|
NInput: any;
|
947
947
|
NInputGroup: any;
|
@@ -837,7 +837,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
837
837
|
key: string | number;
|
838
838
|
}[]>;
|
839
839
|
isSearch: import("vue").Ref<boolean>;
|
840
|
-
tempData: import("naive-ui").TreeOption[];
|
841
840
|
allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
|
842
841
|
isRemote: import("vue").ComputedRef<boolean>;
|
843
842
|
checkStrategyResult: import("vue").ComputedRef<any>;
|
@@ -901,6 +900,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
901
900
|
notifyCheck: (keys: (string | number)[]) => void;
|
902
901
|
notifySearchClear: () => void;
|
903
902
|
getCheckWithLevel: () => any;
|
903
|
+
resetParams: () => void;
|
904
904
|
NButton: any;
|
905
905
|
NInput: any;
|
906
906
|
NInputGroup: any;
|
@@ -1148,7 +1148,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
1148
1148
|
key: string | number;
|
1149
1149
|
}[]>;
|
1150
1150
|
isSearch: import("vue").Ref<boolean>;
|
1151
|
-
tempData: import("naive-ui").TreeOption[];
|
1152
1151
|
allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
|
1153
1152
|
isRemote: import("vue").ComputedRef<boolean>;
|
1154
1153
|
checkStrategyResult: import("vue").ComputedRef<any>;
|
@@ -1212,6 +1211,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1212
1211
|
notifyCheck: (keys: (string | number)[]) => void;
|
1213
1212
|
notifySearchClear: () => void;
|
1214
1213
|
getCheckWithLevel: () => any;
|
1214
|
+
resetParams: () => void;
|
1215
1215
|
NButton: any;
|
1216
1216
|
NInput: any;
|
1217
1217
|
NInputGroup: any;
|
@@ -1206,7 +1206,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
1206
1206
|
key: string | number;
|
1207
1207
|
}[]>;
|
1208
1208
|
isSearch: import("vue").Ref<boolean>;
|
1209
|
-
tempData: import("naive-ui").TreeOption[];
|
1210
1209
|
allCheckedTreeKeys: import("vue").Ref<(string | number)[]>;
|
1211
1210
|
isRemote: import("vue").ComputedRef<boolean>;
|
1212
1211
|
checkStrategyResult: import("vue").ComputedRef<any>;
|
@@ -1270,6 +1269,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1270
1269
|
notifyCheck: (keys: (string | number)[]) => void;
|
1271
1270
|
notifySearchClear: () => void;
|
1272
1271
|
getCheckWithLevel: () => any;
|
1272
|
+
resetParams: () => void;
|
1273
1273
|
NButton: any;
|
1274
1274
|
NInput: any;
|
1275
1275
|
NInputGroup: any;
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import"../useShadow.js";import{useCommon as a}from"../useCommon.js";import"vue";import{nearlyEqual as s,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as d,filter as p,last as m,omit as g,flatten as v}from"lodash-es";import"date-fns";import{OTHER_MENU as y}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"./useOther.js";import"../../../../../shared/utils/index.js";import{useIntervalFn as h}from"@vueuse/core";function x(x,k,L,w,P,b){const{computedX:A,computedY:C,getXValue:j,getYValue:I}=l(k),{xCellWidth:M,pointSelectionStyle:E,originX:K,endX:X,originY:V,endY:Y,event:T,scaleValues:O,xAxis:S,startTime:D,timeXCell:F,itemList:$,dialog:z,topGridOriginY:B,topGridEndY:G,extraMenuConfig:N}=k,_=new Map,J=new Set;let q=d(O),R=[],W=null;const H=new Set;o(x,k);const{getEqualXTypes:Q,handleAddPrevent:U,setPrevAndNextPoint:Z,getPointEventProps:ee}=a(x,L,k),{pause:te,resume:ne}=h((()=>{!function(){if(!H.size)return;for(const e of H)e.set("opacity",1===e.opacity?.5:1);x.value.renderAll()}()}),800);function ie(){q.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=C(t.type,t.range,i),a=n([K,r,X,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{w.point={...e||{x:a.left,y:a.top}},w.list=[`${o} ${i}${t.unit||""}`],w.show=!0})),a.on("mouseout",(()=>{w.show=!1}))),x.value.add(a)}a(i),a(o),a(l),a(r)}(t,e),ae(t,i,e))}))}))}function oe(e=[]){if(!(null==W?void 0:W.areaPos))return[];const{startPos:t,endPos:n}=W.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ve()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function le(e){var t,n,i,o;z.warning({maskClosable:!1,closeOnEsc:!1,title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.228"))||"警告",content:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.229"))||"确认删除当前选中的节点?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{e(),re()},onNegativeClick:()=>re(),onClose:()=>re()})}function re(){W&&x.value.remove(W),W=null}function ae(e,t,o){var l;const{type:r,unit:a,dataList:f=[]}=o,u=[];_.set(e.key,[]),function(e,t){H.size&&[...H].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&H.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,d){var p;let v,y,h=d;l.key&&(h=f.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:b="",key:A,type:C="circle"}=h,E=ge(d.list[c+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(y=n([...e,...E],P));const K=u[c-1],X={origin:{data:l,title:b,key:d.key,selfKey:A,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:K,rightLine:y,...k,...ee()};e&&(K||(X.leftLine=null),v=i(C,{left:e[0],top:e[1],...X}));u.push(y),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){T.hovered&&(e.on("mouseover",(()=>{pe(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{me(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&pe(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:f,origin:u}=e,c=~~(Math.abs(a-l)/M),d=a>l;if(Math.abs(a-l)>M){if(0===R.length){let a=e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r];d||(a=e.rightLine?[e.rightLine.x2,e.rightLine.y2]:[l,r]),fe(e,[...a,l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const p=M*c,m=d?l+p:l-p;if(R.every((e=>!s(e.left,m)))){const t=j(m),n=I(u.type,f);R.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:m,top:f}),fe(e,[...e.prevPointer,m,f],d)}if(R.length<c&&function(e,t,n=!0){const{originLeft:i,originTop:o,origin:l}=e;let r=1;for(;r<=t;){const t=M*r,a=n?i+t:i-t,s=R.some((e=>Math.abs(e.left-a)<=1));if(!s){let t=0;const r=R.find(((e,i)=>n?(e.left>a&&(t=i),e.left>a):(e.left<a&&(t=i),e.left<a)));if(r){const s=JSON.parse(JSON.stringify(r)),f=R[t-1]||{left:i,top:o},u=~~(Math.abs(r.left-(n?a-M:a+M))/M),c=(r.top-f.top)/u;s.top=f.top+c,s.left=a,s.data={time:j(a),value:I(l.type,s.top),...l.selfKey!==l.key?{key:l.selfKey}:{}},R.splice(t,0,s),fe(e,[f.left,f.top,s.left,s.top],n)}}r++}}(e,c,d),d&&e.nextPoint||!d&&e.prevPoint){const t=_.get(u.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=M/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{s(e.left,l)||u.index===e.origin.index||(d&&e.left>l&&e.left<a||!d&&e.left<l&&e.left>a?se(e,"#999"):se(e,e.origin.lineAttr.stroke))}))}}!function(e,t=!0){var n,i,o,l;const{left:r,originLeft:a}=e;if((null==R?void 0:R.length)>0){for(const e of J)(t&&(e.left>r||e.left<a)||!t&&(e.left<r||e.left>a))&&(e.left<r||e.left>a)&&(e.leftLine&&x.value.remove(e.leftLine),e.rightLine&&x.value.remove(e.rightLine),x.value.remove(e));if(R=R.filter((e=>t&&e.left<=r&&e.left>a||!t&&e.left>=r&&e.left<a)),0===R.length){null==(i=null==(n=e.leftLine)?void 0:n.set)||i.call(n,e.prevPoint.origin.lineAttr),null==(l=null==(o=e.rightLine)?void 0:o.set)||l.call(o,e.origin.lineAttr);for(const e of J)e.leftLine&&x.value.remove(e.leftLine),x.value.remove(e)}if(R.length>0){const t=m(R);e.prevPointer=[t.left,t.top]}}}(e,d)}(e)})),e.on("mouseup",(t=>{if(w.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:j(e.left),value:I(t,e.top)}};if(x.value.discardActiveObject(),R.length>0){const l=q.find((e=>e.type===t));let r=-1;const a=m(R).left>e.originLeft,s=R.map((e=>e.data));if(a&&e.nextPoint||!a){if(2.5!==e.scaleX)return void ce({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1&&s.splice(o,1),a||(s.reverse(),r=e.origin.index)}const f=l.dataList.findIndex((e=>e.key===n));L("add",{...g(o,["index","selfKey","lineAttr"]),dataIndex:f,key:n,data:s}),ue({...o,data:s,coincideIndex:r})}else L("change",{...g(o,["selfKey","lineAttr"]),key:n}),ue(o,"change")}}))}(v),null==(p=_.get(d.key))||p.push(v))}(ge(l,o),l,c,e)})),Promise.all(_.get(e.key)).then((t=>{const n=u.filter((e=>e));Z(t),x.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||H.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function se(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&![t,"transparent"].includes(e.rightLine.stroke)&&e.rightLine.set("stroke",t)}function fe(e,t,i=!0){const[o,,l,r]=t;e.clone((a=>{a.set({left:l,top:r,scaleX:1,scaleY:1}),e.prevPointer=[l,r];const f=n(t,e.leftLine&&s(o,e.leftLine.x1)?e.prevPoint.origin.lineAttr:e.origin.lineAttr);i?a.leftLine=f:a.rightLine=f,J.add(a),x.value.add(f,a)}))}function ue(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a,linkKey:s}=e;let{dataIndex:u}=e;const c=q.find((e=>e.type===r)),d=c.dataList.find(((e,t)=>{u=t;const n=s||l;return e.key===n}));switch(t){case"remove":d.list.splice(o,n),d.list[o-1]&&(d.list[o-1].breakpoint=!0);break;case"change":d.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,d.list,!0),n=Array.isArray(i)?i:[i];d.list.splice(t,a>-1?a-t:0,...n);break}}ce({dataIndex:u,scaleValue:c})}function ce(e){var t,n,i;if(J.size&&(null==(t=x.value)||t.remove(...de([...J]))),J.clear(),R=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=x.value)||n.remove(...de(_.get(o.key))),_.delete(o.key),ae(o,t,i)}else q=d(O),_.size&&(null==(i=x.value)||i.remove(...de(ve()))),_.clear(),ie()}function de(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)})),t}function pe(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;w.point={x:e.left,y:e.top};const a=j(e.left),s=`${"hover"===t?o.value:I(i,e.top)}`;w.list=[`${n} ${s}${l||""}`,`时间 ${a.slice(-5)}`],w.sourceData=[{type:i,title:n,unit:l,key:r,time:a,value:s}],w.isTarget=!0,w.show=!0}function me(e,t=X){e.setCoords();const n=K;e.top<V&&e.set("top",V),e.top>Y&&e.set("top",Y),e.left<n&&e.set("left",n),e.left>t&&e.set("left",t)}function ge(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=c(e);return n>=D&&n<=t}(e.time)){const n=A(e.time),i=C(t.type,t.range,e.value);return[n,i<V?V:i>Y?Y:i]}}function ve(){return v(Array.from(_.values()))}return ie(),function(){if(!T.evented)return;let n=!1,i={x:0,y:0};x.value.on("mouse:up",(e=>{if(3===e.button&&function(e){w.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=X&&n>=V&&n<=Y)if(e.target){if("main"!==e.target.__type)return;const t=e.target;i({x:t.left,y:t.top},e.target,[]),P.list=p(y,(e=>"edit"!==e.type)).map((e=>({...e,renderItem:()=>e.label,type:e.key||e.type,pointer:{x:t.left,y:t.top},..."add"===e.type?{}:{origin:{...t.origin}}})))}else{i(e.pointer,null,[]);const{menuList:t=[]}=N;P.list=p(y,(e=>"add"===e.type)).concat(t).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,pointer:e.pointer})))}function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=oe();e.length>0?le((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ue(n[0],"remove",n.length),n.map((e=>({...g(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);L("remove",t)})):r.emit(W)}})),x.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),x.value.on("mouse:move",(o=>{if(function(e){if(!b||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;w.movable=!1,(i<K||i>X)&&(w.show=!1);if(!t&&i>=K&&i<=X){const e=o>=V&&o<=Y,l=o>=B&&o<=G;if(e||l){const l=j(i);w.sourceData=e?q.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],w.isTarget=!!t,w.point=n,w.movable=!0}else w.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;W&&x.value.remove(W),W=new e.Rect({...t,fill:"#CAF982",opacity:.4,...E,left:l>a?a:l,top:r>s?s:r,width:Math.abs(a-l),height:Math.abs(s-r),objectCaching:!0}),W.areaPos={startPos:i,endPos:o.pointer},x.value.add(W)}))}(),{redrawPoints:ce,clickMenu:function({item:e,target:t}){var n;const{type:i,origin:o,pointer:l}=e,r={...o};o||Object.assign(r,{data:{time:j(l.x)},type:null}),p(y,(e=>"edit"!==e.type)).map((e=>e.type)).includes(i)?("remove"===i&&ue(r,"remove"),L(i,r)):null==(n=N.click)||n.call(N,i,r)},moveLimit:me,setPopup:pe,updateData:ue,getGridPoints:ve,getContainPoints:oe,showDialog:le,removeCurrentSelection:re,pauseFlickerPoint:te}}export{x as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as t,drawLine as n,drawPoint as i}from"../useDraw.js";import{useGrid as o}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import{bus as r}from"../useEvent.js";import"../useShadow.js";import{useCommon as a}from"../useCommon.js";import"vue";import{nearlyEqual as s,getIndex as f,isEffectiveNode as u,getTime as c}from"../../utils/index.js";import{cloneDeep as d,filter as p,last as m,omit as g,flatten as v}from"lodash-es";import"date-fns";import{OTHER_MENU as y}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"./useOther.js";import"../../../../../shared/utils/index.js";import{useIntervalFn as h}from"@vueuse/core";function x(x,k,L,w,b,P){const{computedX:A,computedY:C,getXValue:j,getYValue:I}=l(k),{xCellWidth:M,pointSelectionStyle:E,originX:K,endX:X,originY:V,endY:Y,event:T,scaleValues:O,xAxis:S,startTime:D,timeXCell:F,itemList:$,dialog:z,topGridOriginY:B,topGridEndY:G,extraMenuConfig:N,grid:_}=k,J=new Map,q=new Set;let R=d(O),W=[],H=null;const Q=new Set;o(x,k);const{getEqualXTypes:U,handleAddPrevent:Z,setPrevAndNextPoint:ee,getPointEventProps:te}=a(x,L,k),{pause:ne,resume:ie}=h((()=>{!function(){if(!Q.size)return;for(const e of Q)e.set("opacity",1===e.opacity?.5:1);x.value.renderAll()}()}),800);function oe(){R.forEach((e=>{const{range:t=[],spaceValue:i}=e;i&&(t[0]||t[1])&&e.dataList.forEach(((t,i)=>{t.show&&(!function(e,t){const{max:i={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:i,name:o,lineStyle:l}){if(!e||!i)return;const r=C(t.type,t.range,i),a=n([K,r,X,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{w.point={...e||{x:a.left,y:a.top}},w.list=[`${o} ${i}${t.unit||""}`],w.show=!0})),a.on("mouseout",(()=>{w.show=!1}))),x.value.add(a)}a(i),a(o),a(l),a(r)}(t,e),se(t,i,e))}))}))}function le(e=[]){if(!(null==H?void 0:H.areaPos))return[];const{startPos:t,endPos:n}=H.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ye()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function re(e){var t,n,i,o;z.warning({maskClosable:!1,closeOnEsc:!1,title:(null==(t=window.getLanguageByCode)?void 0:t.call(window,"10010.1.228"))||"警告",content:(null==(n=window.getLanguageByCode)?void 0:n.call(window,"10010.1.229"))||"确认删除当前选中的节点?",positiveText:(null==(i=window.getLanguageByCode)?void 0:i.call(window,"10010.1.27"))||"确定",negativeText:(null==(o=window.getLanguageByCode)?void 0:o.call(window,"10010.1.28"))||"取消",onPositiveClick:()=>{e(),ae()},onNegativeClick:()=>ae(),onClose:()=>ae()})}function ae(){H&&x.value.remove(H),H=null}function se(e,t,o){var l;const{type:r,unit:a,dataList:f=[]}=o,u=[];J.set(e.key,[]),function(e,t){Q.size&&[...Q].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&Q.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,d){var p;let v,y,h=d;l.key&&(h=f.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:b={},title:P="",key:A,type:C="circle"}=h,E=ve(d.list[c+1],o);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(!_.breakpoint||_.breakpoint&&E[0]-e[0]<=M)&&(y=n([...e,...E],b));const K=u[c-1],X={origin:{data:l,title:P,key:d.key,selfKey:A,unit:a,type:r,dataIndex:t,index:c,lineAttr:b},__type:"main",leftLine:K,rightLine:y,...k,...te()};e&&(K||(X.leftLine=null),v=i(C,{left:e[0],top:e[1],...X}));u.push(y),v&&(v.originLeft=v.left,v.originTop=v.top,function(e){T.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{w.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ge(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&me(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:f,origin:u}=e,c=~~(Math.abs(a-l)/M),d=a>l;if(Math.abs(a-l)>M){if(0===W.length){let a=e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r];d||(a=e.rightLine?[e.rightLine.x2,e.rightLine.y2]:[l,r]),ue(e,[...a,l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const p=M*c,m=d?l+p:l-p;if(W.every((e=>!s(e.left,m)))){const t=j(m),n=I(u.type,f);W.push({data:{time:t,value:n,...u.selfKey!==u.key?{key:u.selfKey}:{}},left:m,top:f}),ue(e,[...e.prevPointer,m,f],d)}if(W.length<c&&function(e,t,n=!0){const{originLeft:i,originTop:o,origin:l}=e;let r=1;for(;r<=t;){const t=M*r,a=n?i+t:i-t,s=W.some((e=>Math.abs(e.left-a)<=1));if(!s){let t=0;const r=W.find(((e,i)=>n?(e.left>a&&(t=i),e.left>a):(e.left<a&&(t=i),e.left<a)));if(r){const s=JSON.parse(JSON.stringify(r)),f=W[t-1]||{left:i,top:o},u=~~(Math.abs(r.left-(n?a-M:a+M))/M),c=(r.top-f.top)/u;s.top=f.top+c,s.left=a,s.data={time:j(a),value:I(l.type,s.top),...l.selfKey!==l.key?{key:l.selfKey}:{}},W.splice(t,0,s),ue(e,[f.left,f.top,s.left,s.top],n)}}r++}}(e,c,d),d&&e.nextPoint||!d&&e.prevPoint){const t=J.get(u.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=M/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{s(e.left,l)||u.index===e.origin.index||(d&&e.left>l&&e.left<a||!d&&e.left<l&&e.left>a?fe(e,"#999"):fe(e,e.origin.lineAttr.stroke))}))}}!function(e,t=!0){var n,i,o,l;const{left:r,originLeft:a}=e;if((null==W?void 0:W.length)>0){for(const e of q)(t&&(e.left>r||e.left<a)||!t&&(e.left<r||e.left>a))&&(e.left<r||e.left>a)&&(e.leftLine&&x.value.remove(e.leftLine),e.rightLine&&x.value.remove(e.rightLine),x.value.remove(e));if(W=W.filter((e=>t&&e.left<=r&&e.left>a||!t&&e.left>=r&&e.left<a)),0===W.length){null==(i=null==(n=e.leftLine)?void 0:n.set)||i.call(n,e.prevPoint.origin.lineAttr),null==(l=null==(o=e.rightLine)?void 0:o.set)||l.call(o,e.origin.lineAttr);for(const e of q)e.leftLine&&x.value.remove(e.leftLine),x.value.remove(e)}if(W.length>0){const t=m(W);e.prevPointer=[t.left,t.top]}}}(e,d)}(e)})),e.on("mouseup",(t=>{if(w.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:j(e.left),value:I(t,e.top)}};if(x.value.discardActiveObject(),W.length>0){const l=R.find((e=>e.type===t));let r=-1;const a=m(W).left>e.originLeft,s=W.map((e=>e.data));if(a&&e.nextPoint||!a){if(2.5!==e.scaleX)return void de({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1&&s.splice(o,1),a||(s.reverse(),r=e.origin.index)}const f=l.dataList.findIndex((e=>e.key===n));L("add",{...g(o,["index","selfKey","lineAttr"]),dataIndex:f,key:n,data:s}),ce({...o,data:s,coincideIndex:r})}else L("change",{...g(o,["selfKey","lineAttr"]),key:n}),ce(o,"change")}}))}(v),null==(p=J.get(d.key))||p.push(v))}(ve(l,o),l,c,e)})),Promise.all(J.get(e.key)).then((t=>{const n=u.filter((e=>e));ee(t),x.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||Q.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function fe(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&![t,"transparent"].includes(e.rightLine.stroke)&&e.rightLine.set("stroke",t)}function ue(e,t,i=!0){const[o,,l,r]=t;e.clone((a=>{a.set({left:l,top:r,scaleX:1,scaleY:1}),e.prevPointer=[l,r];const f=n(t,e.leftLine&&s(o,e.leftLine.x1)?e.prevPoint.origin.lineAttr:e.origin.lineAttr);i?a.leftLine=f:a.rightLine=f,q.add(a),x.value.add(f,a)}))}function ce(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a,linkKey:s}=e;let{dataIndex:u}=e;const c=R.find((e=>e.type===r)),d=c.dataList.find(((e,t)=>{u=t;const n=s||l;return e.key===n}));switch(t){case"remove":d.list.splice(o,n),d.list[o-1]&&(d.list[o-1].breakpoint=!0);break;case"change":d.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=f(e,d.list,!0),n=Array.isArray(i)?i:[i];d.list.splice(t,a>-1?a-t:0,...n);break}}de({dataIndex:u,scaleValue:c})}function de(e){var t,n,i;if(q.size&&(null==(t=x.value)||t.remove(...pe([...q]))),q.clear(),W=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=x.value)||n.remove(...pe(J.get(o.key))),J.delete(o.key),se(o,t,i)}else R=d(O),J.size&&(null==(i=x.value)||i.remove(...pe(ye()))),J.clear(),oe()}function pe(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)})),t}function me(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;w.point={x:e.left,y:e.top};const a=j(e.left),s=`${"hover"===t?o.value:I(i,e.top)}`;w.list=[`${n} ${s}${l||""}`,`时间 ${a.slice(-5)}`],w.sourceData=[{type:i,title:n,unit:l,key:r,time:a,value:s}],w.isTarget=!0,w.show=!0}function ge(e,t=X){e.setCoords();const n=K;e.top<V&&e.set("top",V),e.top>Y&&e.set("top",Y),e.left<n&&e.set("left",n),e.left>t&&e.set("left",t)}function ve(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=c(e);return n>=D&&n<=t}(e.time)){const n=A(e.time),i=C(t.type,t.range,e.value);return[n,i<V?V:i>Y?Y:i]}}function ye(){return v(Array.from(J.values()))}return oe(),function(){if(!T.evented)return;let n=!1,i={x:0,y:0};x.value.on("mouse:up",(e=>{if(3===e.button&&function(e){w.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=X&&n>=V&&n<=Y)if(e.target){if("main"!==e.target.__type)return;const t=e.target;i({x:t.left,y:t.top},e.target,[]),b.list=p(y,(e=>"edit"!==e.type)).map((e=>({...e,renderItem:()=>e.label,type:e.key||e.type,pointer:{x:t.left,y:t.top},..."add"===e.type?{}:{origin:{...t.origin}}})))}else{i(e.pointer,null,[]);const{menuList:t=[]}=N;b.list=p(y,(e=>"add"===e.type)).concat(t).map((t=>({...t,renderItem:()=>t.label,type:t.key||t.type,pointer:e.pointer})))}function i(e,t,n){Object.assign(b,{point:e,show:!0,target:t,list:n})}}(e),1===e.button&&n){n=!1;const e=le();e.length>0?re((()=>{const t=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ce(n[0],"remove",n.length),n.map((e=>({...g(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(e);L("remove",t)})):r.emit(H)}})),x.value.on("mouse:down",(e=>{1!==e.button||e.target||(n=!0,i=e.pointer)})),x.value.on("mouse:move",(o=>{if(function(e){if(!P||b.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;w.movable=!1,(i<K||i>X)&&(w.show=!1);if(!t&&i>=K&&i<=X){const e=o>=V&&o<=Y,l=o>=B&&o<=G;if(e||l){const l=j(i);w.sourceData=e?R.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:I(t,o)}})):[{type:"tree",time:l}],w.isTarget=!!t,w.point=n,w.movable=!0}else w.show=!1}}(o),!n)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;H&&x.value.remove(H),H=new e.Rect({...t,fill:"#CAF982",opacity:.4,...E,left:l>a?a:l,top:r>s?s:r,width:Math.abs(a-l),height:Math.abs(s-r),objectCaching:!0}),H.areaPos={startPos:i,endPos:o.pointer},x.value.add(H)}))}(),{redrawPoints:de,clickMenu:function({item:e,target:t}){var n;const{type:i,origin:o,pointer:l}=e,r={...o};o||Object.assign(r,{data:{time:j(l.x)},type:null}),p(y,(e=>"edit"!==e.type)).map((e=>e.type)).includes(i)?("remove"===i&&ce(r,"remove"),L(i,r)):null==(n=N.click)||n.call(N,i,r)},moveLimit:ge,setPopup:me,updateData:ce,getGridPoints:ye,getContainPoints:le,showDialog:re,removeCurrentSelection:ae,pauseFlickerPoint:ne}}export{x as useCenter};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o,drawLine as i,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as u,cloneDeep as d,omit as f,flatten as h}from"lodash-es";import{format as m}from"date-fns";import{OTHER_MENU as p}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const g=u(p,(t=>"add"!==t.type));function x(u,p,x,v,y,k,C,w,X){const{computedX:A,getXValue:b}=r(p),{getEqualXTypes:P,handleAddPrevent:E,isGridLimit:j,getPointEventProps:S}=s(u,x,p),{createShadowLines:L}=l(),{canvasWidth:M,other:z,yCellHeight:H,xCellWidth:T,endX:I,originX:W,originY:Y,endY:B,markHeight:O,event:D,topGridYCellHeight:V,extracorporealCirculationHeight:G}=p,$=new Map,K=d(z);function _(){var i;if(!(null==(i=null==K?void 0:K.horizontal)?void 0:i.length))return;const n="horizontal";$.set(n,[]);const{horizontal:r}=K;let a=Y+H/2;r.forEach(((i,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:d,showIcon:f=!0}=i;let h=null;d.forEach(((i,d)=>{const{time:m,value:p}=i,g=A(m);if(!Z(g))return;const x=[],v=f&&e(s,{...c,left:g,top:a});v&&x.push(v);const y=f?g+v.width/2+2:g,k=o([y,a],{value:p,...u,originX:"left"});x.push(k);const C=new t.Group(x,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...S()});Object.assign(C,{originLeft:g,iconHalfWidth:v?v.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:d,data:i,title:l},limitX:{x1:W,x2:I-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,Q(C),$.get(n).push(C)})),a+=H})),u.value.add(...$.get(n))}function q(){var t;if(!(null==(t=null==K?void 0:K.vertical)?void 0:t.length))return;const o="vertical";$.set(o,[]);const{vertical:i}=K;i.forEach(((t,i)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!Z(c))return;const{lineHeight:u=H}=a;let d=Y+r+u/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:d,origin:{type:"other",key:o,dataIndex:i,index:n,data:{value:t}},...S()});d+=u,Q(r),$.get(o).push(r)}));const f=$.get(o).filter((t=>t.origin.dataIndex===i)),h=Math.max(...f.map((t=>t.width))),m=c>I-h;f.forEach(((t,e,o)=>{t.siblingPoints=o.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),u.value.add(...$.get(o))}function F(t,e="add"){const{dataIndex:o,data:i,index:n,key:r,dataKey:a}=t,l=K[r],s=["mark"].includes(r)||"extracorporealCirculation"===r?l.dataList[o]:l[o];switch(e){case"remove":s.data.splice(n,1);break;case"change":"extracorporealCirculation"===r?s[a]=i:s.data[n]=i;break;default:{const t=Array.isArray(i)?i[0].time:i.time,e=c(t,s.data),o=Array.isArray(i)?i:[i];s.data.splice(e,0,...o);break}}J(t)}function J(t){var e;const{key:o}=t;switch(null==(e=u.value)||e.remove(...$.get(o)),$.delete(o),o){case"horizontal":_();break;case"vertical":q();break;case"mark":N();break;case"extracorporealCirculation":et()}}function N(){if(!(null==z?void 0:z.mark)||!O)return;const{title:t,titleStyle:i,pointAttr:n,dataList:r}=z.mark,a=o([W-5,B+O/2],{value:t,...i,originX:"right"});u.value.add(a);const l=B+O+G,s=G+B,c=[];r.forEach((t=>{const{time:o,list:i=[]}=t,r=A(o);if(!Z(r))return;let a=s;i.forEach((t=>{const{style:o}=t;let i=!1;const d=e((null==o?void 0:o.type)||"circleAndText",{...(null==o?void 0:o.pointAttr)||n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),f=d.height;a+f<=l&&a>=s?(d.set("top",a+f/2),a+=f):(i||(a=B,i=!0),d.set("top",a-f/2),a-=f),c.push(d),Q(d),u.value.add(d)}))})),function(t){const e=t=>{var e,o;return null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart},o=t.find((t=>e(t))),i=t.find((t=>!e(t)&&t.left>o.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:W,x2:I};e(t)?(r.x2=i.left,t.otherPoints=n):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(c)}function Q(t){if(D.hovered&&(t.on("mouseover",(()=>{R(t)})),t.on("mouseout",(()=>{v.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,o=["mark","horizontal"].includes(e),i=["mark","vertical"].includes(e),n="extracorporealCirculation"===e;t.on("moving",(()=>{o?function(t){const e=t.origin.key,o="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(o?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(o?-1:0));if("mark"===e){t.top<Y&&t.set("top",Y);const e=B+O-t.height/2;t.top>e&&t.set("top",e)}o&&(t.originLeft=t.left+t.iconHalfWidth)}(t):n?function(t){t.setCoords();const{left:e,limitX:o}=t,i=m(new Date,"yyyy-MM-dd HH:mm"),n=A(i);o.isCurrentTime&&o.x2<n&&n>0&&n<M&&(o.x2=n);e<o.x1&&t.set({x1:o.x1,x2:o.x1});e>o.x2&&t.set({x1:o.x2,x2:o.x2});U(t,"left"),U(t,"right")}(t):(k(t),function(t){const e=t.left+t.maxTextWidth>I?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((o=>o.setCoords().set({originX:e,left:t.left})))}(t)),D.hovered&&R(t)})),t.on("mouseup",(r=>{var a;if(v.show=!1,1===r.button){o&&function(t){var e,o;if("mark"===t.origin.key){if((null==(o=null==(e=t.origin)?void 0:e.data)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),o=Math.min(...e);t.startPoint.limitX.x2=o}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=b(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...i?{time:e}:{data:{...t.origin.data,time:e}}};u.value.discardActiveObject(),x("change",r),n&&F(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(y.point={x:t.left,y:t.top},y.show=!0,y.target=t,y.list=g.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function R(t){v.isTarget=!0,v.show=!0;const{key:e,data:o={}}=t.origin||{};let i=o.value;const n="extracorporealCirculation"===e||"mark"===e;v.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=b(r);v.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(i=o.name),v.list.unshift(i+" ")),v.sourceData=[{type:"other",key:e,time:a,value:i}]}function U(t,e){const{shadowObjs:o,params:i}=t[`${e}ShadowBox`]||{};if(!o||!i)return;o.forEach((t=>u.value.remove(t)));i["left"===e?1:0]=t.left;const n=tt(...i);t[`${e}ShadowBox`]={shadowObjs:n,params:i}}function Z(t){return t>=W&&t<=I}function tt(...e){const[o,i,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),d=[[o,B],[i,B],[i,r],[o,r]],h=new t.Polygon(d.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),m=[];return["slash"].includes(l)&&m.push(...L(d,s.angle,s.space,c)),u.value.add(h,...m),$.get("extracorporealCirculation").push(h,...m),[h,...m]}function et(){if(!G)return;const{dataList:e,ascendAortaStyle:o,extracorporealCirculationStyle:i}=K.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";$.set(n,[]);const r=B+G;let a,l;function s(t){return t&&t>W&&t<M}function c(t){return void 0===t||""===t}e.forEach(((d,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:o,openAscendAorta:i,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),o&&(a=A(o.time)),i&&(l=A(i.time)),n&&(s=A(n.time)),[r,a,l,s]}(d);if(-1===h.findIndex((t=>t>0&&t<M)))return;let p;h.forEach(((g,x)=>{if(c(g))return;const v=h[x+1],y=h[x-1];if(s(g)||s(v)){const k=s(g)?g:W,C=s(v)?v:c(v)?null:I,w=s(y)?y:W,X={};if(x<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(x)?i:o],X.shadowObjs=tt(...X.params)),s(g)){const o=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(x),i=m(new Date,"yyyy-MM-dd HH:mm"),c=A(i),v=g<c&&s(c)?c:g,y=function(e,o){const i=new t.Line(e,{...o,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return Q(i),u.value.add(i),$.get("extracorporealCirculation").push(i),i}([g,B,g,r],{origin:{dataIndex:f,dataKey:o,key:n,data:d[o],type:"other"},limitX:{x1:0===x?null!=a?a:W:w,x2:C||v,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(x)?{leftShadowBox:p}:{},...[0,1,2].includes(x)?{rightShadowBox:X}:{}});x===h.length-1&&(a=g,l=y),0===x&&l&&(l.limitX.x2=k)}p=X}}))}))}return function(){if(!(null==z?void 0:z.longLine)||!z.longLine.time)return;const{time:t,style:e}=z.longLine,o=A(t),n=i([o,0,o,B],e);u.value.add(n)}(),function(){var t;if(!(null==(t=null==K?void 0:K.horizontal)?void 0:t.length))return;const{horizontal:o}=K,i=W-5;let n=Y+H/2;o.forEach(((t,o)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:i,top:n,origin:{defaultAddValue:l,dataIndex:o,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:i,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),j(c)?R(c):v.show=!1})),c.on("mouseup:before",(t=>{if(v.show=!1,0===t.e.button&&j(c))if(P($.get("horizontal"),c.left,"key",T).includes(c.origin.key))E("repeat"),console.log("重复节点");else{const t={data:{time:b(c.left),value:c.origin.defaultAddValue},...c.origin};x("add",f(t,["isMenu"])),F(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),u.value.add(s),n+=H}))}(),_(),q(),N(),et(),a.on((()=>{const t="horizontal",e=C($.get(t));e.length>0?w((()=>{const o=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:o}=e.origin;return t[o]=t[o]?t[o].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const o=e[t];return K.horizontal[t].data.splice(o[0].index,o.length),o})))}(e);J({key:t}),x("remove",o)})):X()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o,_type:i}=t,n={...e.origin,type:i};x(o,n),"remove"===o&&F(n,o)}}}export{x as useOther};
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i,drawLine as o,defaultLineStyle as n}from"../useDraw.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useShadow as l}from"../useShadow.js";import{useCommon as s}from"../useCommon.js";import"vue";import{getIndex as c}from"../../utils/index.js";import{filter as d,cloneDeep as u,omit as f,flatten as h,isNumber as g,pick as m}from"lodash-es";import{format as p}from"date-fns";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"./useTop.js";import"@vueuse/core";import"../../../../../shared/utils/index.js";const x=d(v,(t=>"add"!==t.type));function y(d,v,y,k,C,w,X,b,E){const{computedX:A,getXValue:L}=r(v),{getEqualXTypes:j,handleAddPrevent:P,isGridLimit:S,getPointEventProps:z}=s(d,y,v),{createShadowLines:I}=l(),{canvasWidth:M,other:T,yCellHeight:H,xCellWidth:O,endX:$,originX:B,originY:W,endY:Y,markHeight:D,event:_,topGridYCellHeight:V,extracorporealCirculationHeight:G}=v,K=new Map,R=u(T);let q=[],F=null;function J(){var o;if(!(null==(o=null==R?void 0:R.horizontal)?void 0:o.length))return;const n="horizontal";K.set(n,[]);const{horizontal:r}=R;let a=W+H/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u,showIcon:f=!0}=o;let h=null;u.forEach(((o,u)=>{const{time:g,value:m}=o,p=A(g);if(!ot(p))return;const v=[],x=f&&e(s,{...c,left:p,top:a});x&&v.push(x);const y=f?p+x.width/2+2:p,k=i([y,a],{value:m,...d,originX:"left"});v.push(k);const C=new t.Group(v,{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...z()});Object.assign(C,{originLeft:p,iconHalfWidth:x?x.width/2:0,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:B,x2:$-C.width}}),h&&(C.limitX.x1=h.left,h.limitX.x2=C.left,C.prevPoint=h,h.nextPoint=C),h=C,tt(C),K.get(n).push(C)})),a+=H})),d.value.add(...K.get(n))}function N(){var t;if(!(null==(t=null==R?void 0:R.vertical)?void 0:t.length))return;const i="vertical";K.set(i,[]);const{vertical:o}=R;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=A(s);if(!n||!ot(c))return;const{lineHeight:d=H}=a;let u=W+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...z()});u+=d,tt(r),K.get(i).push(r)}));const f=K.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=c>$-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),d.value.add(...K.get(i))}function Q(t,e="add"){const{dataIndex:i,data:o,index:n,key:r,dataKey:a,time:l}=t,s=R[r],d=["mark","extracorporealCirculation"].includes(r)?s.dataList[i]:s[i];switch(e){case"remove":d.data.splice(n,1);break;case"change":if("mark"===r){d.list.splice(n,1);const t=s.dataList.find((t=>t.time===l));t?t.list.push(o):(s.dataList.push({time:l,list:[o]}),s.dataList.sort(((t,e)=>Date.parse(t.time)-Date.parse(e.time))))}else"extracorporealCirculation"===r?d[a]=o:d.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=c(t,d.data),i=Array.isArray(o)?o:[o];d.data.splice(e,0,...i);break}}U(t)}function U(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...K.get(i)),K.delete(i),i){case"horizontal":J();break;case"vertical":N();break;case"mark":Z();break;case"extracorporealCirculation":rt()}}function Z(){if(!D)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=R.mark||{};if(!(null==r?void 0:r.length))return;const a="mark";K.set(a,[]);const l=i([B-5,Y+D/2],{value:t,...o,originX:"right"});d.value.add(l);const s=Y+D+G,c=Y+G;let u=0;const f={};r.forEach(((t,i)=>{const{time:o,list:r=[]}=t,l=A(o);if(!ot(l))return;let h=c+1;r.forEach(((t,o)=>{var r;const{style:g}=t,m=e((null==g?void 0:g.type)||"circleAndText",{...(null==g?void 0:g.pointAttr)||n,text:t.text,left:l,top:c+10,origin:{data:t,key:"mark",type:"other",dataIndex:i,index:o}}),p=m.height;u&&l-u<=O&&(null==(r=f[`x_${u}`])||r.forEach((([t,e])=>{h+p>=s&&(h=Y-1),t<e&&h>=t&&h<e&&(h=e),t>e&&h>e&&h<=t&&(h=e)})));const{topObj:v,startTop:x,oldStartTop:y}=function(t,e){const i={};let o;if(t>Y){const r=t+e;i.y2=t+e/2,r>=s?n(Y-1):(o=t,t=r)}else n(t);function n(n){o=n,i.y2=n-e/2;t=n-e}return{topObj:i,startTop:t,oldStartTop:o}}(h,p);h=x,f[`x_${l}`]||(f[`x_${l}`]=[]),f[`x_${l}`].push([y,h]),m.set("top",v.y2),K.get(a).push(m),tt(m),d.value.add(m)})),u=l})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:B,x2:$};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(K.get(a))}function tt(t){if(_.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{k.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e),n=["mark","extracorporealCirculation"].includes(e),r="extracorporealCirculation"===e;t.on("moving",(()=>{t.moving=!0,i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<W&&t.set("top",W);const e=Y+G+D-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):r?function(t){t.setCoords();const{left:e,limitX:i}=t,o=p(new Date,"yyyy-MM-dd HH:mm"),n=A(o);i.isCurrentTime&&i.x2<n&&n>0&&n<M&&(i.x2=n);e<i.x1&&t.set({x1:i.x1,x2:i.x1});e>i.x2&&t.set({x1:i.x2,x2:i.x2});it(t,"left"),it(t,"right")}(t):(w(t),function(t){const e=t.left+t.maxTextWidth>$?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),_.hovered&&et(t)})),t.on("mouseup",(r=>{var a;if(k.show=!1,1===r.button){if(!t.moving)return;t.moving=!1,i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=L(null!=(a=t.originLeft)?a:t.left),r={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),y("change",r),n&&Q(r,"change")}3===r.button&&["horizontal","vertical"].includes(e)&&(C.point={x:t.left,y:t.top},C.show=!0,C.target=t,C.list=x.map((t=>({...t,renderItem:()=>t.label,_type:"other"}))))}))}function et(t){k.isTarget=!0,k.show=!0;const{key:e,data:i={}}=t.origin||{};let o=i.value;const n="extracorporealCirculation"===e||"mark"===e;k.point={x:t.left,y:n?t.top:t.top+V/2};const r=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,a=L(r);k.list=[`时间 ${a.slice(-5)}`],n&&("mark"===e&&(o=i.name),k.list.unshift(o+" ")),k.sourceData=[{type:"other",key:e,time:a,value:o}]}function it(t,e){const{shadowObjs:i,params:o}=t[`${e}ShadowBox`]||{};if(!i||!o)return;i.forEach((t=>d.value.remove(t)));o["left"===e?1:0]=t.left;const n=nt(...o);t[`${e}ShadowBox`]={shadowObjs:n,params:o}}function ot(t){return t>=B&&t<=$}function nt(...e){const[i,o,r,a]=e,{mode:l,style:s}=a,c=f(s,["angle","space"]),u=[[i,Y],[o,Y],[o,r],[i,r]],h=new t.Polygon(u.map((t=>({x:t[0],y:t[1]}))),{...n,...c,stroke:"transparent",..."slash"===l?{fill:"transparent"}:{}}),g=[];return["slash"].includes(l)&&g.push(...I(u,s.angle,s.space,c)),d.value.add(h,...g),K.get("extracorporealCirculation").push(h,...g),[h,...g]}function rt(){if(!G)return;const{dataList:e,ascendAortaStyle:i,extracorporealCirculationStyle:o}=R.extracorporealCirculation||{};if(!(null==e?void 0:e.length))return;const n="extracorporealCirculation";K.set(n,[]);const r=Y+G;let a,l;function s(t){return t&&t>B&&t<M}function c(t){return void 0===t||""===t}e.forEach(((u,f)=>{const h=function(t){const{extracorporealCirculationStart:e,closeAscendAorta:i,openAscendAorta:o,extracorporealCirculationEnd:n}=t;let r,a,l,s;return e&&(r=A(e.time)),i&&(a=A(i.time)),o&&(l=A(o.time)),n&&(s=A(n.time)),[r,a,l,s]}(u);if(-1===h.findIndex((t=>t>0&&t<M)))return;let g;h.forEach(((m,v)=>{if(c(m))return;const x=h[v+1],y=h[v-1];if(s(m)||s(x)){const k=s(m)?m:B,C=s(x)?x:c(x)?null:$,w=s(y)?y:B,X={};if(v<h.length-1&&C&&(X.params=[k,C,r,[0,2].includes(v)?o:i],X.shadowObjs=nt(...X.params)),s(m)){const i=function(t){switch(t){case 0:return"extracorporealCirculationStart";case 1:return"closeAscendAorta";case 2:return"openAscendAorta";case 3:return"extracorporealCirculationEnd"}}(v),o=p(new Date,"yyyy-MM-dd HH:mm"),c=A(o),x=m<c&&s(c)?c:m,y=function(e,i){const o=new t.Line(e,{...i,stroke:"transparent",strokeWidth:5,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",lockMovementY:!0,originX:"center"});return tt(o),d.value.add(o),K.get("extracorporealCirculation").push(o),o}([m,Y,m,r],{origin:{dataIndex:f,dataKey:i,key:n,data:u[i],type:"other"},limitX:{x1:0===v?null!=a?a:B:w,x2:C||x,isCurrentTime:!C&&f===e.length-1},...[1,2,3].includes(v)?{leftShadowBox:g}:{},...[0,1,2].includes(v)?{rightShadowBox:X}:{}});v===h.length-1&&(a=m,l=y),0===v&&l&&(l.limitX.x2=k)}g=X}}))}))}function at(t){const{code:e}=t;F&&(e.includes("Enter")||e.includes("Esc"))&&(e.includes("Esc")&&(F.text=""),F.exitEditing(),d.value.discardActiveObject(F))}return function(){if(!(null==T?void 0:T.longLine)||!T.longLine.time)return;const{time:t,style:e}=T.longLine,i=A(t),n=o([i,0,i,Y],e);d.value.add(n)}(),function(){var t;if(!(null==(t=null==R?void 0:R.horizontal)?void 0:t.length))return;q=[];const{horizontal:i}=R,o=B-5;let n=W+H/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l,data:s=[]}=t,c=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var u;q.push({type:"other",title:r,key:"horizontal",dataIndex:i,dataList:s.map((t=>A(t.time))),y1:n-c.height/2,y2:n+c.height/2}),(u=c).on("moving",(()=>{u.set("originX","center"),S(u)?et(u):k.show=!1})),u.on("mouseup:before",(t=>{if(k.show=!1,0===t.e.button&&S(u))if(j(K.get("horizontal"),u.left,"key",O).includes(u.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:L(u.left),value:u.origin.defaultAddValue},...u.origin};y("add",f(t,["isMenu"])),Q(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),d.value.add(c),n+=H}))}(),J(),N(),Z(),rt(),a.on((()=>{const t="horizontal",e=X(K.get(t));e.length>0?b((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return h(Object.keys(e).map((t=>{const i=e[t];return R.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);U({key:t}),y("remove",i)})):E()})),_.evented&&(window.addEventListener("keydown",at,!0),d.value.on("mouse:up",(e=>{var i,o,n,r;if(1===e.button){const{target:a,pointer:l={}}=e,{x:s=0,y:c=0}=l;if(!S({left:s,top:c}))return;if(!(null==q?void 0:q.length)||F)return;if(a&&"horizontal"!==(null==(i=a.origin)?void 0:i.key))return;let u="";if(a){if(a.moving)return;u=null==(r=null==(n=null==(o=a.origin)?void 0:o.data)?void 0:n.value)?void 0:r.toString()}const f=q.find((({y1:t,y2:e})=>c>=t&&c<=e));g(null==f?void 0:f.dataIndex)&&(F=new t.Textbox(u,{left:s,top:c,width:100,height:100,fontSize:18,objectCaching:!1,hasControls:!1,borderColor:"#000",editingBorderColor:"#000",backgroundColor:"#fff",fontFamily:"微软雅黑"}),F.otherListPointHeightRangeItem={...f,left:s,target:a},d.value.add(F),d.value.setActiveObject(F),F.enterEditing(),u&&F.setSelectionEnd(u.length))}})),d.value.on("selection:cleared",(({deselected:t})=>{var e;if(null==t?void 0:t.find((t=>t.otherListPointHeightRangeItem))){let{text:t}=F;const{otherListPointHeightRangeItem:i}=F;if(t=t.replace(/^\s+|\s+$/g,""),d.value.remove(F),F=null,!t)return;const{left:o,target:n}=i;if(n){if(t==(null==(e=n.origin)?void 0:e.data.value))return;const i={...n.origin,data:{...n.origin.data,value:t}};y("change",i),Q(i,"change")}else{const e={...m(i,["title","type","key","dataIndex"]),data:{time:L(o),value:t}};y("add",e),Q(e)}}}))),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i,_type:o}=t,n={...e.origin,type:o};y(i,n),"remove"===i&&Q(n,i)},handleKeydown:at}}export{y as useOther};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as n,watch as l,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as m}from"../../utils/index.js";import{cloneDeep as p,range as h,flatten as v}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as
|
1
|
+
import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as n,watch as l,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as m}from"../../utils/index.js";import{cloneDeep as p,range as h,flatten as v,isFunction as g}from"lodash-es";import"../useEvent.js";import"../useShadow.js";import"../useCommon.js";import"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as w}from"./useLeft.js";import{useCenter as x}from"./useCenter.js";import{useOther as y}from"./useOther.js";import{uuidGenerator as b}from"../../../../../shared/utils/index.js";function C(C,j,Y,k,H,M,T){var D;let P=null;const S=s(),L=e({redrawPoints:null,clickMenu:null,redrawLinePoints:null}),A=t();let X=null;const G=m((null==(D=j.data.top)?void 0:D.treeData)||[]),N=a((()=>j.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),V=a((()=>{var e;return null!=(e=j.data.left.width)?e:0})),E=a((()=>{const{grid:e}=j.data;return e.mainXCell*e.subXCell})),O=a((()=>{const{grid:e}=j.data;return e.mainYCell*e.subYCell})),W=a((()=>{const{show:e=!0,tree:t={}}=j.data.top;if(!e)return 0;const{rowNumber:a=G}=t;return G<a?a:G})),I=a((()=>j.data.top.tree.cellHeight)),F=a((()=>I.value*W.value)),K=a((()=>de(ue("drug")||"top"))),_=a((()=>K.value+F.value)),q=a((()=>{var e;return Date.parse((null==(e=j.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),z=a((()=>{const e=p(j.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=h(E.value/t+1).map((r=>0===r?e.startTime:c(new Date(q.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:V.value}})),B=ce(),J=a((()=>de(ue("xAxis")||"center"))),Q=a((()=>{var e;const{width:t,right:a}=j.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),R=a((()=>de(ue("intraoperatively")||"bottom"))),U=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.extracorporealCirculation)||{};return t&&a?a:0})),Z=a((()=>{var e;const{show:t,height:a}=(null==(e=j.data.other)?void 0:e.mark)||{};return t&&a?a:0})),$=a((()=>R.value+(j.data.height-F.value-z.value.height-Z.value-U.value))),ee=a((()=>(Q.value-V.value)/E.value)),te=a((()=>($.value-R.value)/O.value)),ae=a((()=>z.value.spaceTimeStamp/ee.value)),re=a((()=>{const{scaleValues:e}=j.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ie=a((()=>me("pulse"))),oe=a((()=>me("temperature"))),ne=a((()=>{var e;return(null==(e=j.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),le=e({canvasWidth:j.data.width,canvasHeight:j.data.height,borderStyle:{...d,...j.data.borderStyle},pointSelectionStyle:j.data.pointSelectionStyle||{},grid:j.data.grid,top:j.data.top,left:j.data.left,other:j.data.other,topGridYNumber:r(W),topGridYCellHeight:r(I),topGridOriginY:r(K),topGridEndY:r(_),treeData:B,getTreeData:ce,xAxis:r(z),originYXAxis:r(J),startTime:r(q),timeXCell:r(ae),gridXNumber:r(E),gridYNumber:r(O),xCellWidth:r(ee),yCellHeight:r(te),originX:r(V),endX:r(Q),originY:r(R),endY:r($),markHeight:r(Z),extracorporealCirculationHeight:r(U),itemList:r(re),scaleValues:j.data.scaleValues,pulseYCell:r(ie),temperatureYCell:r(oe),event:r(ne),dialog:S,extraMenuConfig:j.data.extraMenuConfig||{}});function ue(e){let t="";return Object.entries(N.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function se(e){const t=N.value[e],a=z.value.height;switch(t){case"drug":return F.value;case"xAxis":return a;default:return j.data.height-F.value-a}}function de(e){switch(e){case"top":return 0;case"center":return se("top");default:return se("top")+se("center")}}function ce(){const{show:e=!0,tree:t={}}=j.data.top;if(!e)return[];const a=p(j.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=j.data.top.tree,{rowNumber:n=G}=t;return G<n&&a.push(...h(n-G).map((()=>({})))),function e(t,a=0){t.forEach((t=>{var n;const l={top:r*o+K.value,left:a*i,width:i,height:o,uuid:b()};if(r++,null==(n=t.children)?void 0:n.length){r--;const i=m(t.children);l.height=i*o,e(t.children,a+1)}else l.width=V.value-l.left;Object.assign(t,l)}))}(a),a}function me(e){const{scaleValues:t}=j.data,a=t.find((t=>t.type===e));return te.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o();const{redrawLinePoints:e,clickMenu:t}=f(C,le,Y,H,M),{redrawPoints:a,clickMenu:r,moveLimit:i,setPopup:n,updateData:l,getGridPoints:u,getContainPoints:s,showDialog:d,removeCurrentSelection:c,pauseFlickerPoint:m}=x(C,le,Y,H,M,T);A.value=m,w(C,le,Y,H,i,n,l,u);const{clickMenu:p,handleKeydown:h}=y(C,le,Y,H,M,i,s,d,c);P=h,L.redrawPoints=a,L.redrawLinePoints=e,L.clickMenu=e=>{const{item:a}=e;switch(a._type){case"tree":t(e);break;case"other":p(e);break;default:r(e)}}})),n((()=>{A.value(),g(P)&&window.removeEventListener("keydown",P,!0)})),T&&l((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,X&&clearTimeout(X),X=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):X&&clearTimeout(X)}),{deep:!0}),{propItems:le,...u(L)}}export{C as useSurgicalAnesthesiaChart};
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { Ref } from 'vue';
|
2
2
|
import { fabric } from '../../../../shared/utils/fabricjs';
|
3
|
-
import { IObject } from '../interface';
|
4
3
|
import { AnyObject } from '../../../../shared/types';
|
5
4
|
export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
|
6
5
|
getEqualXTypes: (points: any[], pointX: number, field: string, range?: any) => string[];
|
7
6
|
handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
|
8
|
-
isGridLimit: (point:
|
7
|
+
isGridLimit: (point: any) => boolean;
|
9
8
|
setPrevAndNextPoint: (pointList: any[]) => void;
|
10
9
|
getPointEventProps: () => any;
|
11
10
|
};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{omit as t}from"lodash-es";const n={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...n},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...n},o={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...n},c={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...n};function l(t,n){return new e.Line(t,{...i,...n})}function s([t,n],r){return new e.Text(String(r.value),{...c,left:t,top:n,...r})}function a([t,r,i],o,c="down"){const a=l([t,r,t,i],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=s([t+.5,"up"===c?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===c?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...n,originX:"center",originY:"top",objectCaching:!1})}function g(t,r,i,l=!1){const s=new e.Rect({...o,...t,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=r,f=t.width/2,h=t.height/2,d=new e.Text(String(a),{...c,...r,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...n,...i})}function u(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function f(n="circle",r){var i;const o={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...r},c=r.radius?(r.radius||5)+(r.strokeWidth||1):null!=(i=r.width)?i:0;switch(n){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...o});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...o});case"image":return new e.Image(r.element,o);case"yemai":{const t=()=>{const t=2*c,n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,c,t,c],n),o=new e.Line([c,0,c,t],n);return new e.Group([i,o])};return new e.Group([u(r),t()],o)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:c-.5,top:c-.5});return new e.Group([u(r),t],o)}case"circleAndText":{const t=new e.Text(String(r.text),{fontFamily:"微软雅黑",fontSize:o.fontSize||12,originX:"center",originY:"center",fill:r.textFill||r.stroke,left:c-.5,top:c-1,fontWeight:r.fontWeight||500,objectCaching:!1});return new e.Group([u(r),t],o)}case"circleAndCircle":return f("koumai",r);case"cg":{const{left:t,radius:n,top:i,stroke:c="#000"}=r,l=new e.Line([0,n,2*n,n],{stroke:c,objectCaching:!1}),s=n+1,a=Math.round(n/2),g=new e.Polyline([{x:s,y:a},{x:2*n,y:n},{x:s,y:n+a}],{stroke:c,fill:"transparent",objectCaching:!1});return new e.Group([u(r),l,g],{...o,left:Math.round(t),top:Math.round(i)})}case"qgcg":{const{radius:t,stroke:n="#000"}=r,i=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),i],o)}case"zrhz":{const{radius:t,stroke:n="#000"}=r,i=t/3*2,c=new e.Circle({objectCaching:!1,radius:i,fill:"#fff",left:t-i,top:t-i,stroke:n}),l=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),c,l],o)}case"plus":{const n=t(o,["big","small"]),{big:i,small:c}=r,l=f(i.type,{fill:"#fff",...n,...i.style}),s=f(c.type,{...n,...c.style});return new e.Group([l,s],n)}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(n),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...o})}}function h(t,r,i,o="horizontal"){const c=new e.Text(String(t),{...n,objectCaching:!1,...r.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...i.text}),{top:l,topY:s,left:a,leftX:g}=i.icon,u=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:f(r.type,{...r.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:u,...i.icon,origin:{title:r.title,unit:r.unit,type:r.bigType,dataIndex:r.dataIndex,key:r.key,isMenu:!0,...i.icon.origin},left:h,top:u})}}export{r as defaultBorderStyle,i as defaultLineStyle,o as defaultRectStyle,n as defaultStyle,c as defaultTextStyle,a as drawArrow,l as drawLine,f as drawPoint,s as drawText,h as drawTextAndIconGroup,g as drawTextGroup};
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{omit as t}from"lodash-es";const n={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,strokeUniform:!0,...n},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...n},o={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...n},c={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...n};function l(t,n){return new e.Line(t,{...i,...n})}function s([t,n],r){return new e.Text(String(r.value),{...c,left:t,top:n,...r})}function a([t,r,i],o,c="down"){const a=l([t,r,t,i],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=s([t+.5,"up"===c?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===c?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...n,originX:"center",originY:"top",objectCaching:!1})}function g(t,r,i,l=!1){const s=new e.Rect({...o,...t,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=r,f=t.width/2,h=t.height/2,d=new e.Text(String(a),{...c,...r,..."left"==g||"right"==g?{originX:g,left:"left"==g?-f:f}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...n,...i})}function u(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function f(n="circle",r){var i;const o={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...r},c=r.radius?(r.radius||5)+(r.strokeWidth||1):null!=(i=r.width)?i:0;switch(n){case"rect":return new e.Rect({width:10,height:10,strokeWidth:1,fill:"#fff",...o});case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...o});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...o});case"image":return new e.Image(r.element,o);case"yemai":{const t=()=>{const t=2*c,n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,c,t,c],n),o=new e.Line([c,0,c,t],n);return new e.Group([i,o])};return new e.Group([u(r),t()],o)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:c-.5,top:c-.5});return new e.Group([u(r),t],o)}case"circleAndText":{const t=new e.Text(String(r.text),{fontFamily:"微软雅黑",fontSize:o.fontSize||12,originX:"center",originY:"center",fill:r.textFill||r.stroke,left:c-.5,top:c-1,fontWeight:r.fontWeight||500,objectCaching:!1});return new e.Group([u(r),t],o)}case"circleAndCircle":return f("koumai",r);case"cg":{const{left:t,radius:n,top:i,stroke:c="#000"}=r,l=new e.Line([0,n,2*n,n],{stroke:c,objectCaching:!1}),s=n+1,a=Math.round(n/2),g=new e.Polyline([{x:s,y:a},{x:2*n,y:n},{x:s,y:n+a}],{stroke:c,fill:"transparent",objectCaching:!1});return new e.Group([u(r),l,g],{...o,left:Math.round(t),top:Math.round(i)})}case"qgcg":{const{radius:t,stroke:n="#000"}=r,i=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),i],o)}case"zrhz":{const{radius:t,stroke:n="#000"}=r,i=t/3*2,c=new e.Circle({objectCaching:!1,radius:i,fill:"#fff",left:t-i,top:t-i,stroke:n}),l=new e.Line([0,t,4*t,t],{stroke:n,objectCaching:!1,left:-t});return new e.Group([u(r),c,l],o)}case"jxtq":{const{width:n=14,height:i=8}=r;return new e.Polyline([{x:0,y:i},{x:n/5,y:0},{x:n/5*2,y:i},{x:n/5*3,y:0},{x:n/5*4,y:i},{x:n/5*5,y:0}],{fill:"transparent",...t(o,["width","height"])})}case"plus":{const n=t(o,["big","small"]),{big:i,small:c}=r,l=f(i.type,{fill:"#fff",...n,...i.style}),s=f(c.type,{...n,...c.style});return new e.Group([l,s],n)}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(n),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...o})}}function h(t,r,i,o="horizontal"){const c=new e.Text(String(t),{...n,objectCaching:!1,...r.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...i.text}),{top:l,topY:s,left:a,leftX:g}=i.icon,u=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,h=null!=a?a:g+c.width+5;return{text:c,icon:f(r.type,{...r.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:u,...i.icon,origin:{title:r.title,unit:r.unit,type:r.bigType,dataIndex:r.dataIndex,key:r.key,isMenu:!0,...i.icon.origin},left:h,top:u})}}export{r as defaultBorderStyle,i as defaultLineStyle,o as defaultRectStyle,n as defaultStyle,c as defaultTextStyle,a as drawArrow,l as drawLine,f as drawPoint,s as drawText,h as drawTextAndIconGroup,g as drawTextGroup};
|
@@ -532,9 +532,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
532
532
|
}>;
|
533
533
|
developMode: boolean;
|
534
534
|
draggable: boolean;
|
535
|
-
isHighlightRow: boolean;
|
536
535
|
idx: number;
|
537
536
|
isHighlight: boolean;
|
537
|
+
isHighlightRow: boolean;
|
538
538
|
isFieldSet: boolean;
|
539
539
|
fieldDescribeMode: "column" | "tooltip";
|
540
540
|
hideExpressionOption: AnyObject[];
|
@@ -817,6 +817,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
817
817
|
type: StringConstructor;
|
818
818
|
default: string;
|
819
819
|
};
|
820
|
+
isDateDisabled: {
|
821
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
822
|
+
};
|
820
823
|
}, {
|
821
824
|
attrs: {
|
822
825
|
[x: string]: unknown;
|
@@ -849,6 +852,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
849
852
|
type: StringConstructor;
|
850
853
|
default: string;
|
851
854
|
};
|
855
|
+
isDateDisabled: {
|
856
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
857
|
+
};
|
852
858
|
}>> & {
|
853
859
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
854
860
|
}>>;
|
@@ -861,6 +867,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
861
867
|
isDateTime: import("vue").ComputedRef<boolean>;
|
862
868
|
formatRef: import("vue").ComputedRef<string>;
|
863
869
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
870
|
+
_isDateDisabled: import("vue").ComputedRef<(current: number, ...arg: any[]) => boolean>;
|
864
871
|
focus: () => any;
|
865
872
|
blur: () => any;
|
866
873
|
handleConfirm: (target: HTMLInputElement) => void;
|
@@ -900,6 +907,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
900
907
|
type: StringConstructor;
|
901
908
|
default: string;
|
902
909
|
};
|
910
|
+
isDateDisabled: {
|
911
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
912
|
+
};
|
903
913
|
}>> & {
|
904
914
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
905
915
|
}, {
|
@@ -1134,6 +1144,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1134
1144
|
type: StringConstructor;
|
1135
1145
|
default: string;
|
1136
1146
|
};
|
1147
|
+
isDateDisabled: {
|
1148
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
1149
|
+
};
|
1137
1150
|
}, {
|
1138
1151
|
attrs: {
|
1139
1152
|
[x: string]: unknown;
|
@@ -1166,6 +1179,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1166
1179
|
type: StringConstructor;
|
1167
1180
|
default: string;
|
1168
1181
|
};
|
1182
|
+
isDateDisabled: {
|
1183
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
1184
|
+
};
|
1169
1185
|
}>> & {
|
1170
1186
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
1171
1187
|
}>>;
|
@@ -1178,6 +1194,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
1178
1194
|
isDateTime: import("vue").ComputedRef<boolean>;
|
1179
1195
|
formatRef: import("vue").ComputedRef<string>;
|
1180
1196
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
1197
|
+
_isDateDisabled: import("vue").ComputedRef<(current: number, ...arg: any[]) => boolean>;
|
1181
1198
|
focus: () => any;
|
1182
1199
|
blur: () => any;
|
1183
1200
|
handleConfirm: (target: HTMLInputElement) => void;
|
@@ -1217,6 +1234,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
1217
1234
|
type: StringConstructor;
|
1218
1235
|
default: string;
|
1219
1236
|
};
|
1237
|
+
isDateDisabled: {
|
1238
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
1239
|
+
};
|
1220
1240
|
}>> & {
|
1221
1241
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
1222
1242
|
}, {
|
@@ -102,7 +102,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
102
102
|
getType: (field: string) => "text" | "checkbox" | "input" | "select" | "inputNumber";
|
103
103
|
initColumns: () => void;
|
104
104
|
isNoAllCheck: (field: string) => boolean;
|
105
|
-
|
105
|
+
isSelectMultiple: (item: AnyObject) => any;
|
106
|
+
isSelect: (item: AnyObject) => any;
|
106
107
|
NButton: any;
|
107
108
|
NCheckbox: any;
|
108
109
|
NPopconfirm: any;
|
@@ -560,9 +561,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
560
561
|
}>;
|
561
562
|
developMode: boolean;
|
562
563
|
draggable: boolean;
|
563
|
-
isHighlightRow: boolean;
|
564
564
|
idx: number;
|
565
565
|
isHighlight: boolean;
|
566
|
+
isHighlightRow: boolean;
|
566
567
|
isFieldSet: boolean;
|
567
568
|
fieldDescribeMode: "column" | "tooltip";
|
568
569
|
hideExpressionOption: AnyObject[];
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as l,reactive as t,watch as a,openBlock as i,createElementBlock as u,createElementVNode as n,Fragment as d,renderList as o,normalizeStyle as r,unref as s,createBlock as c,withCtx as f,createTextVNode as p,toDisplayString as m,createCommentVNode as v,createVNode as h,mergeProps as
|
1
|
+
import{defineComponent as e,ref as l,reactive as t,watch as a,openBlock as i,createElementBlock as u,createElementVNode as n,Fragment as d,renderList as o,normalizeStyle as r,unref as s,createBlock as c,withCtx as f,createTextVNode as p,toDisplayString as m,createCommentVNode as v,createVNode as h,mergeProps as y,renderSlot as g}from"vue";import{NCheckbox as w,NPopconfirm as k,NButton as _}from"naive-ui";import b from"../../../shared/components/VueDraggable/src/vuedraggable.js";import V from"./components/table-row.vue.js";import{isPlainObject as x,omit as C,cloneDeep as L}from"lodash-es";import{isShowExplicitRequired as T,setStyle as S}from"./utils/index.js";import{COLUMNLIST_MAP as F,WIDGET_TYPE as E,SELECT_TYPE as A}from"./constants/filter.js";const R={class:"main-wrapper"},j={class:"main-wrapper__table"},B={class:"main-wrapper__table-header"},N={class:"main-wrapper__table-body",ref:"tableBodyRef"},U=["tabindex"],q={key:0,class:"main-wrapper__table-footer"};var D=e({__name:"FieldFilter",props:{footerFlag:{type:Boolean,default:!0},defaultList:{type:Array,default:()=>[]},showFilterColumnNames:{type:Array,default:()=>[]}},emits:["save","close","reset"],setup(e,{expose:D,emit:H}){const I=e,M=l([]),O=l([]),P=t({columns:M,data:O,onUpdateChecked:function({checked:e,column:l}){const t=!e||J(l.field);l.checkedAll=!t}}),X=()=>{H("save")},$=()=>{H("close")};function z(){O.value=L(I.defaultList),G(),H("reset")}function G(){M.value=Object.entries(F).map((([e,l])=>{var t;const a=function(e){return e?["isShowSearch","filterExplicit","explicitRequired"].includes(e)?"checkbox":["optionType","defaultValue"].includes(e)?"select":["customTitle"].includes(e)?"input":["width"].includes(e)?"inputNumber":"text":"text"}(e),i={isShow:!(null==(t=I.showFilterColumnNames)?void 0:t.length)||I.showFilterColumnNames.includes(e),title:l,type:a,field:e};return"checkbox"===a&&Object.assign(i,{checkedAll:!J(e),disabledAll:!1,isHeadCheckHide:["filterExplicit","explicitRequired"].includes(e)}),i}))}function J(e){return O.value.some((l=>("explicitRequired"!==e||T(l))&&!l[e]))}function K(e){const{dataType:l,optionInfo:t={},optionType:a}=e;return l&&[E.NUMBER,E.TEXT].includes(l)&&Reflect.has(t,"manualMapping")&&a===A.SELECT_MULTIPLE}function Q(e){const{optionInfo:l={},type:t}=e;return t===E.SELECT&&!Object.keys(l.dynamicOptionInfo||{}).length||K(e)&&l.manualMapping}return a([()=>I.defaultList,()=>{var e;return null==(e=I.showFilterColumnNames)?void 0:e.length}],(([e,l])=>{e.length>0&&(O.value=e.map((e=>{var l,t,a,i,u;const n={...e,_defaultValue:null,hasTransformDefaultValue:!1,_classifyStr:null==(l=e.defaultValue)?void 0:l.classifyStr},{defaultValue:d}=e;if(T(e))if(x(d)){n.hasTransformDefaultValue=!0;const l=K(e);Q(e)?n._defaultValue=l?null!=(t=null==d?void 0:d.valueList)?t:[]:null!=(i=null==(a=null==d?void 0:d.valueList)?void 0:a[0])?i:null:n._defaultValue=l?(null==d?void 0:d.unit)?[null==d?void 0:d.unit]:[]:null!=(u=null==d?void 0:d.unit)?u:null}else n._defaultValue=d;return n}))),G()}),{immediate:!0,deep:!0}),D({getTableFields:()=>O.value.map((e=>{const l={...e},{hasTransformDefaultValue:t,_defaultValue:a,_classifyStr:i}=e;if(l.defaultValue=a,t){l.defaultValue={};const t=K(e);Q(e)?l.defaultValue.valueList=t?a:a?[a]:[]:t?a&&(l.defaultValue.unit=a[0]):l.defaultValue.unit=a}return i&&(x(l.defaultValue)?l.defaultValue.classifyStr=i:l.defaultValue={classifyStr:i}),C(l,["_defaultValue","hasTransformDefaultValue","_classifyStr"])}))}),(l,t)=>(i(),u("div",R,[n("div",j,[n("div",B,[(i(!0),u(d,null,o(M.value,((e,l)=>(i(),u(d,{key:l},[e.isShow?(i(),u("span",{key:0,class:"table-cell",style:r(s(S)(e,l))},[n("span",null,["checkbox"!==e.type||e.isHeadCheckHide?(i(),u(d,{key:1},[p(m(e.title),1)],64)):(i(),c(s(w),{key:0,checked:e.checkedAll,"onUpdate:checked":[l=>e.checkedAll=l,l=>{return t=l,a=e.field,void O.value.forEach((e=>{("explicitRequired"!==a||"explicitRequired"===a&&T(e))&&(e[a]=t)}));var t,a}],disabled:e.disabledAll},{default:f((()=>[p(m(e.title),1)])),_:2},1032,["checked","onUpdate:checked","disabled"]))])],4)):v("v-if",!0)],64)))),128))]),n("div",N,[h(s(b),{modelValue:O.value,"onUpdate:modelValue":t[0]||(t[0]=e=>O.value=e),animation:"150","item-key":"id",draggable:".item"},{item:f((({element:e,index:l})=>[e.hide?v("v-if",!0):(i(),u("div",{key:0,class:"item",tabindex:l},[h(V,y(P,{element:e,idx:l+1}),null,16,["element","idx"])],8,U))])),_:1},8,["modelValue"])],512)]),e.footerFlag?(i(),u("div",q,[v(" 底部按钮插槽 "),g(l.$slots,"fieldFilterFooter",{},(()=>[h(s(k),{onPositiveClick:z},{trigger:f((()=>[h(s(_),{style:{"margin-right":"8px"}},{default:f((()=>{var e;return[p((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.242"))||"恢复默认设置")]})),_:1})])),default:f((()=>{var e;return[p((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.243"))||"确认要恢复系统默认设置吗?")]})),_:1}),h(s(_),{style:{"margin-right":"8px"},onClick:$},{default:f((()=>{var e;return[p((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.28"))||"取消")]})),_:1}),h(s(_),{type:"primary",onClick:X},{default:f((()=>{var e;return[p((null==(e=window.getLanguageByCode)?void 0:e.call(window,"10010.1.244"))||"保存")]})),_:1})]))])):v("v-if",!0)]))}});export{D as default};
|
@@ -720,9 +720,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
720
720
|
}>;
|
721
721
|
developMode: boolean;
|
722
722
|
draggable: boolean;
|
723
|
-
isHighlightRow: boolean;
|
724
723
|
idx: number;
|
725
724
|
isHighlight: boolean;
|
725
|
+
isHighlightRow: boolean;
|
726
726
|
isFieldSet: boolean;
|
727
727
|
fieldDescribeMode: "column" | "tooltip";
|
728
728
|
hideExpressionOption: AnyObject[];
|
@@ -123,6 +123,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
123
123
|
type: StringConstructor;
|
124
124
|
default: string;
|
125
125
|
};
|
126
|
+
isDateDisabled: {
|
127
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
128
|
+
};
|
126
129
|
}, {
|
127
130
|
attrs: {
|
128
131
|
[x: string]: unknown;
|
@@ -155,6 +158,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
155
158
|
type: StringConstructor;
|
156
159
|
default: string;
|
157
160
|
};
|
161
|
+
isDateDisabled: {
|
162
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
163
|
+
};
|
158
164
|
}>> & {
|
159
165
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
160
166
|
}>>;
|
@@ -167,6 +173,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
167
173
|
isDateTime: import("vue").ComputedRef<boolean>;
|
168
174
|
formatRef: import("vue").ComputedRef<string>;
|
169
175
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
176
|
+
_isDateDisabled: import("vue").ComputedRef<(current: number, ...arg: any[]) => boolean>;
|
170
177
|
focus: () => any;
|
171
178
|
blur: () => any;
|
172
179
|
handleConfirm: (target: HTMLInputElement) => void;
|
@@ -206,6 +213,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
206
213
|
type: StringConstructor;
|
207
214
|
default: string;
|
208
215
|
};
|
216
|
+
isDateDisabled: {
|
217
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
218
|
+
};
|
209
219
|
}>> & {
|
210
220
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
211
221
|
}, {
|
@@ -279,6 +279,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
279
279
|
type: StringConstructor;
|
280
280
|
default: string;
|
281
281
|
};
|
282
|
+
isDateDisabled: {
|
283
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
284
|
+
};
|
282
285
|
}, {
|
283
286
|
attrs: {
|
284
287
|
[x: string]: unknown;
|
@@ -311,6 +314,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
311
314
|
type: StringConstructor;
|
312
315
|
default: string;
|
313
316
|
};
|
317
|
+
isDateDisabled: {
|
318
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
319
|
+
};
|
314
320
|
}>> & {
|
315
321
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
316
322
|
}>>;
|
@@ -323,6 +329,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
323
329
|
isDateTime: import("vue").ComputedRef<boolean>;
|
324
330
|
formatRef: import("vue").ComputedRef<string>;
|
325
331
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
332
|
+
_isDateDisabled: import("vue").ComputedRef<(current: number, ...arg: any[]) => boolean>;
|
326
333
|
focus: () => any;
|
327
334
|
blur: () => any;
|
328
335
|
handleConfirm: (target: HTMLInputElement) => void;
|
@@ -362,6 +369,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
362
369
|
type: StringConstructor;
|
363
370
|
default: string;
|
364
371
|
};
|
372
|
+
isDateDisabled: {
|
373
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
374
|
+
};
|
365
375
|
}>> & {
|
366
376
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
367
377
|
}, {
|
@@ -596,6 +606,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
596
606
|
type: StringConstructor;
|
597
607
|
default: string;
|
598
608
|
};
|
609
|
+
isDateDisabled: {
|
610
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
611
|
+
};
|
599
612
|
}, {
|
600
613
|
attrs: {
|
601
614
|
[x: string]: unknown;
|
@@ -628,6 +641,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
628
641
|
type: StringConstructor;
|
629
642
|
default: string;
|
630
643
|
};
|
644
|
+
isDateDisabled: {
|
645
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
646
|
+
};
|
631
647
|
}>> & {
|
632
648
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
633
649
|
}>>;
|
@@ -640,6 +656,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
640
656
|
isDateTime: import("vue").ComputedRef<boolean>;
|
641
657
|
formatRef: import("vue").ComputedRef<string>;
|
642
658
|
panelFormatRef: import("vue").ComputedRef<string | [string, string]>;
|
659
|
+
_isDateDisabled: import("vue").ComputedRef<(current: number, ...arg: any[]) => boolean>;
|
643
660
|
focus: () => any;
|
644
661
|
blur: () => any;
|
645
662
|
handleConfirm: (target: HTMLInputElement) => void;
|
@@ -679,6 +696,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
679
696
|
type: StringConstructor;
|
680
697
|
default: string;
|
681
698
|
};
|
699
|
+
isDateDisabled: {
|
700
|
+
type: PropType<(current: number, ...arg: any[]) => boolean>;
|
701
|
+
};
|
682
702
|
}>> & {
|
683
703
|
"onUpdate:formatted-value"?: ((...args: any[]) => any) | undefined;
|
684
704
|
}, {
|