cnhis-design-vue 3.2.12-release.0 → 3.2.13-beta.0
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 +66 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +68 -2
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.d.ts +24 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +48 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/components/ChatPrompt.vue.d.ts +45 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -0
- package/es/components/ai-chat/src/types/index.d.ts +11 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +29 -0
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-table/index.d.ts +29 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +30 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/crossHeaderPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/crossHeaderPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/dynamicFilterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +5 -5
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +15 -0
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/template-render/index.d.ts +60 -0
- package/es/components/template-render/index.js +1 -0
- package/es/components/template-render/src/TemplateRender.vue.d.ts +62 -0
- package/es/components/template-render/src/TemplateRender.vue.js +1 -0
- package/es/components/template-render/src/TemplateRender.vue2.js +1 -0
- package/es/components/template-render/src/components/Box.vue.d.ts +44 -0
- package/es/components/template-render/src/components/Box.vue.js +1 -0
- package/es/components/template-render/src/components/Box.vue2.js +1 -0
- package/es/components/template-render/src/components/Button.vue.d.ts +49 -0
- package/es/components/template-render/src/components/Button.vue.js +1 -0
- package/es/components/template-render/src/components/Button.vue2.js +1 -0
- package/es/components/template-render/src/components/Divider.vue.d.ts +26 -0
- package/es/components/template-render/src/components/Divider.vue.js +1 -0
- package/es/components/template-render/src/components/Divider.vue2.js +1 -0
- package/es/components/template-render/src/components/Field.vue.d.ts +56 -0
- package/es/components/template-render/src/components/Field.vue.js +1 -0
- package/es/components/template-render/src/components/Field.vue2.js +1 -0
- package/es/components/template-render/src/components/FieldGroup.vue.d.ts +50 -0
- package/es/components/template-render/src/components/FieldGroup.vue.js +1 -0
- package/es/components/template-render/src/components/FieldGroup.vue2.js +1 -0
- package/es/components/template-render/src/components/Image.vue.d.ts +52 -0
- package/es/components/template-render/src/components/Image.vue.js +1 -0
- package/es/components/template-render/src/components/Image.vue2.js +1 -0
- package/es/components/template-render/src/components/Label.vue.d.ts +42 -0
- package/es/components/template-render/src/components/Label.vue.js +1 -0
- package/es/components/template-render/src/components/Label.vue2.js +1 -0
- package/es/components/template-render/src/components/Row.vue.d.ts +47 -0
- package/es/components/template-render/src/components/Row.vue.js +1 -0
- package/es/components/template-render/src/components/Row.vue2.js +1 -0
- package/es/components/template-render/src/components/Slot.d.ts +27 -0
- package/es/components/template-render/src/components/Slot.js +1 -0
- package/es/components/template-render/src/components/Text.vue.d.ts +40 -0
- package/es/components/template-render/src/components/Text.vue.js +1 -0
- package/es/components/template-render/src/components/Text.vue2.js +1 -0
- package/es/components/template-render/src/components/index.d.ts +529 -0
- package/es/components/template-render/src/components/index.js +1 -0
- package/es/components/template-render/src/constants/index.d.ts +16 -0
- package/es/components/template-render/src/constants/index.js +1 -0
- package/es/components/template-render/src/hooks/useCommon.d.ts +10 -0
- package/es/components/template-render/src/hooks/useCommon.js +1 -0
- package/es/components/template-render/src/utils/index.d.ts +6 -0
- package/es/components/template-render/src/utils/index.js +1 -0
- package/es/components/template-render/style/index.css +1 -0
- package/es/shared/package.json.js +1 -1
- package/package.json +2 -2
@@ -4238,6 +4238,20 @@ export declare const CallbackMaps: Map<string, {
|
|
4238
4238
|
} | undefined;
|
4239
4239
|
tableRowHeight?: string | number | undefined;
|
4240
4240
|
tableHeaderRowHeight?: string | number | undefined;
|
4241
|
+
crossColumnSetting?: {
|
4242
|
+
columnWidth?: number | undefined;
|
4243
|
+
rowHeight?: number | undefined;
|
4244
|
+
fixedColumnList?: {
|
4245
|
+
setting: {
|
4246
|
+
name: string;
|
4247
|
+
option: {
|
4248
|
+
text: string;
|
4249
|
+
value?: string | undefined;
|
4250
|
+
}[];
|
4251
|
+
};
|
4252
|
+
columnWidth?: number | undefined;
|
4253
|
+
}[] | undefined;
|
4254
|
+
} | undefined;
|
4241
4255
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
4242
4256
|
onScroll?: ((params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void) | undefined;
|
4243
4257
|
onKeydown?: ((params: import("vxe-table").VxeTableDefines.KeydownEventParams) => void) | undefined;
|
@@ -4306,6 +4320,7 @@ export declare const CallbackMaps: Map<string, {
|
|
4306
4320
|
}>;
|
4307
4321
|
updateConfigRefDebounced: () => void;
|
4308
4322
|
updateConfigRef: () => void;
|
4323
|
+
themeOverrides: import("vue").ComputedRef<import("naive-ui").GlobalThemeOverrides>;
|
4309
4324
|
fieldListRef: import("vue").Ref<{
|
4310
4325
|
[x: string]: any;
|
4311
4326
|
property?: string | undefined;
|
@@ -7816,6 +7831,20 @@ export declare const CallbackMaps: Map<string, {
|
|
7816
7831
|
} | undefined;
|
7817
7832
|
tableRowHeight?: string | number | undefined;
|
7818
7833
|
tableHeaderRowHeight?: string | number | undefined;
|
7834
|
+
crossColumnSetting?: {
|
7835
|
+
columnWidth?: number | undefined;
|
7836
|
+
rowHeight?: number | undefined;
|
7837
|
+
fixedColumnList?: {
|
7838
|
+
setting: {
|
7839
|
+
name: string;
|
7840
|
+
option: {
|
7841
|
+
text: string;
|
7842
|
+
value?: string | undefined;
|
7843
|
+
}[];
|
7844
|
+
};
|
7845
|
+
columnWidth?: number | undefined;
|
7846
|
+
}[] | undefined;
|
7847
|
+
} | undefined;
|
7819
7848
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
7820
7849
|
onSettingClick?: (() => void) | undefined;
|
7821
7850
|
onFormClick?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as f,drawScaleNumber as d,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:z,endY:V,startTime:B,leftAddAreaWidth:F,leftScales:R,rightScales:$,yCellHeight:q,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],f=[],{pointAttr:d={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:d={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v=n(c,{left:p,top:r[1],...u,...i}),m=r[1]+v.height/2,y="dystocia"===s?o([p,m+q,m],h,"up"):null;g&&(f.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),v&&(f.push(v),a[s]={obj:v,left:p-r[0]}),y&&(f.push(y),a[s+"Arrow"]={obj:y,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=de(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=de(E,e);S=o?t([...a,...o],{...h}):null}const O={};if("cervix"===g){let e,t;if(y.childbirth){const{type:s="arrow",style:c={}}=m;if("arrow"===s){const t=a[1]+q;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+z/2,a[1]+q/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",fill:c.stroke||c.fill,fontSize:c.fontSize||l.fontSize}),e&&(f.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(f.push(t),Object.assign(O,{childbirthText:{obj:t,left:z/2,top:q/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...d,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{fe(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&fe(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(de(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(f).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function fe(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function de(e,t){if(v(e)&&function(e){const t=B+864e5,o=m(e);return o>=B&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>V?V:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-F-Z-1,left:F}:{width:J-N-($.length?0:1),left:N},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?F:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=f(m,n,u);E.forEach(((e,o)=>{const n=V-o*q*b,i=0===o?V-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(d(String(e),t,L,i)),C.push(...h(t,o,O,A,n,q,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-q/2:q/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:f,style:d={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=q/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?z/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const f="top"===s?W-m:V+m;g.push(r([c+e*z,f],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,f],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=d,o=N+("center"===t?z/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===f?m:oe-m;v.push(r([n+e*z,i],{value:String(p[e]),...l,...d})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-N,e*(J-N)+t];let u=[],f=[];function d([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=V}function p([e,t]){return[N+e,V-t]}return d(l)&&h(l)&&(u=p(l)),d(s)&&h(s)&&(u=p(s)),d(a)&&h(a)&&(f=p(a)),d(c)&&h(c)&&(f=p(c)),[...u,...f]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[X(l.time)-N,V-O(o,a,l.value)],[h,p]=[X(u.time)-N,V-O(o,a,u.value)],g=(p-d)/(h-f),v=d-f*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=V&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),fe(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(V-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,F/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:V,endY:B,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:f={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:f={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-W>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],h,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=fe(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=fe(E,e);S=o?t([...a,...o],{...h}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+V/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:V/2,top:z/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...f,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(fe(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>B&&e.set("top",B),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function fe(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>B?B:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-N-(q.length?0:1),left:N},o=new e.Rect({...U,height:B-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=d(m,n,u);E.forEach(((e,o)=>{const n=B-o*z*b,i=0===o?B-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(f(String(e),t,L,i)),C.push(...h(t,o,O,A,n,z,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:B-ie[0],left:P,top:ie[0]+(B-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:f={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?V/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const d="top"===s?W-m:B+m;g.push(r([c+e*V,d],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=f,o=N+("center"===t?V/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*V,i],{value:String(p[e]),...l,...f})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(B-i-t)/e,B-i],c=[J-N,e*(J-N)+t];let u=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=B}function p([e,t]){return[N+e,B-t]}return f(l)&&h(l)&&(u=p(l)),f(s)&&h(s)&&(u=p(s)),f(a)&&h(a)&&(d=p(a)),f(c)&&h(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[X(l.time)-N,B-O(o,a,l.value)],[h,p]=[X(u.time)-N,B-O(o,a,u.value)],g=(p-f)/(h-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=B&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(B-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),p=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),f=a((()=>{var e;return(null==(e=p.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),w=a((()=>{var e;const{width:a}=d.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),x=a((()=>d.data.grid.mainXCell)),y=a((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(w.value-g.value)/x.value)),b=a((()=>{const e=d.data.padding||[5,5],a=B("top"),t=B("bottom");return[a?0:e[0],t?0:e[1]]})),k=a((()=>{const{height:e}=d.data,a=B();return(e-b.value.reduce(((e,a)=>e+a),0))/(y.value+a)})),C=a((()=>{const e=B("top");return k.value*e+b.value[0]})),j=a((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!C.value)return C.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return A.value-b.value[0]-l*r*k.value})),A=a((()=>{const{height:e}=d.data,a=B("bottom");return e-k.value*a-b.value[1]})),Y=a((()=>u(d.data.xAxis.time.startTime))),S=a((()=>36e5/V.value)),H=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=d.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:g.value,endX:w.value,originY:C.value,endY:A.value,xCellWidth:V.value,yCellHeight:k.value,gridXNumber:x.value,gridYNumber:y.value,xAxis:d.data.xAxis,leftScales:m.value,rightScales:p.value,leftAddAreaWidth:30,rightAddAreaWidth:f.value,startTime:Y.value,timeXCell:S.value,cervixYCell:H.value,FHRYCell:P.value,fetalPresentationYCell:R.value,scaleValues:d.data.scaleValues,event:X.value,originYCervix:j.value,scalebarBorder:!Reflect.has(d.data,"scalebarBorder")||d.data.scalebarBorder,padding:b.value});return t((()=>n.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(n,F,s,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{n as useBirthProcessChart};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as m,getIndex as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as L,PAIN_MENU as k,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,O,$,T,V,P,R,C,A,I){s(E,O);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,$,O),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=O,se=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.get(ue[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),u=n[i],a=o[s],c=n[i-1],d=n[i+1],p=o[s-1],f=o[s+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&r.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);r.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===ue[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&E.value.remove(e.rightLine):e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:b={},limitValueStyle:j={},nonePainPointStyle:w={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:O,textStyle:P}=w,C=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ye(e.time),z=d(s);if(null==(u=e.list)||u.forEach(((u,d)=>{const w=z?S.find((e=>e.key===u.key)):e,F=xe(W(u)?{...u,value:k.fixedValue}:u,s),G=e.list[d+1],N=G?xe(W(G)?{...G,value:k.fixedValue}:G,s):void 0,B=G?z?S.find((e=>e.key===G.key)):e:{},{title:J=""}=w;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,r=l([e[0],o],{value:W(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-q}}(F,u,w),function(e,t,s,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ye(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=s,{value:y}=u,x=T(t.time);let b,j,w,L,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=r([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(y?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,r,l],{...v,...m.line,...n}),j=o((null==(f=null==m?void 0:m.point)?void 0:f.type)||"circle",{left:r,top:l,...m.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(k.type,{left:x,top:e[1]-(y?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(y?-q:0)-5}})}(F,u,w,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...Y),s=Math.min(...Y);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=r([e[0],i[0],i[1]],b,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...j};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<s&&(c=l([e[0],e[1]-q],i),X.push(c))}if(L.show&&+t.value<s){const t=e[1];if(L.text)d=l([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*q;d=r([e[0],t,i],{...L.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:L.text?5:2*q,moveHide:!0}})}(F,u,w,K),function(n,l,r,u,c,d){let f,h;const{pointAttr:g={},lineAttr:m={},title:b="",key:j,type:w="circle"}=c,L=e.list[u+1];let S=x(n),Y=x(l);const M=function(e,t){return"pain"===e&&0==t}(a,e.list[u].value),D=()=>"pulse"==a&&r.pacemakerShow?y.value:W(r)?k.type:M&&"number"===O?0:w,F=e=>e&&p.show&&p.fixed&&ye(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===a&&(n||F(r))&&(l||F(L))){const e=V(a,35);return n||(S=[T(r.time),e]),l||(Y=[T(L.time),e]),!0}return!!n&&!!l})()){h=i([...S,...Y],{...m});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...m});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const _=D(),q=I[u-1],G={origin:{data:W(r)?{...r,value:k.fixedValue}:r,title:b,key:j||"",unit:s.unit,type:a,_type:v(b,a),dataIndex:t,index:u,isOneLine:z},leftLine:q,rightLine:h,otherObj:d,...r.pacemakerShow&&"pulse"==a?y.style:W(r)?k.style:g,lockMovementX:!0,...H(),...M?{selectable:!1,evented:!1,..."number"===O?P:{}}:{}};n&&(q?G.leftLine.set("x2",n[0]):G.leftLine=null,f=o(_,{left:n[0],top:M&&!ne[1]?n[1]-5:n[1],...G}));I.push(h),f&&(j===ue[1]?ce.add(f):W(r)||de.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=R(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),$("change",n),je(n,"change")}}))}(f),C.push(f),pe.add(f))}(F,N,u,d,w,K)})),"pulse"===a){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&f(e.left,1)===f(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(z){const e={};ue.forEach((t=>{e[t]=C.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ae.set(t,i(e[t]))}))}else{const{key:t}=e;ae.set(t,i(C))}}const F=I.filter((e=>e));E.value.add(...F,...C,...X)}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:u}=l||{},a="hover"===t?l.value:R(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(h(u))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),r],A.show=!0}function ye(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ye(e.time))return;const n=T(e.time),o=V(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function je(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;we()}function we(){var e;pe.size&&(null==(e=E.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...pe]))),pe.clear(),Le()}function Le(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),Le((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!O.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...L]),"pain"===o&&(I.list=[...k]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key,isOneLine:i.isOneLine},pointer:n})}}));const i=be(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&$("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,s=m(i,[...L,...k]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),o&&(s.key=t.origin.key);const a={...t.origin,data:s};$("change",a),je(a,"change")}else{const t={data:{time:P(e.pointer.x),value:R(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};$("add",t),je(t)}},setPopup:me,isAddPoint:be,updateData:je,redrawPoints:we,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as m,getIndex as y}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as L,PAIN_MENU as k,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,O,$,T,V,P,R,C,A,I){s(E,O);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,$,O),{createShadowLines:W}=t(),{left:z,xScaleList:F,xCellWidth:_,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie,painSurplusCell:ne,iconsWidth:oe,canvasWidth:le,borderStyle:re}=O,se=new Set,ue=["xinmai","mai"],ae=new Map,ce=new Set,de=new Set,pe=new Set,fe=x(z.yScaleValue),he=new Set;function ve(t){var o;const l=fe.find((e=>e.show&&"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(se.size&&E.value.remove(...se),se.clear(),ae.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ae.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ae)t.push(e[1]),e[0]===ue[0]&&e[1].forEach((e=>{(ae.get(ue[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],r=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),u=n[i],a=o[s],c=n[i-1],d=n[i+1],p=o[s-1],f=o[s+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&r.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);r.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...r.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(r.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(pe).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===ue[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{0==t?e.rightLine&&E.value.remove(e.rightLine):e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...W(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...n,...s}),se.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...s,originX:"center"});e.push(n),se.add(n)}))}E.value.add(...e)}se.add(l),E.value.add(l)}))}}function ge(e,t,s){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:m={},pacemaker:y={},upArrowStyle:b={},limitValueStyle:j={},nonePainPointStyle:w={},belowMinValueStyle:L={},respiratorStyle:k={},dataList:S=[],list:Y=[]}=s,{type:O,textStyle:P}=w,C=[],I=[],X=[];let D=null;const W=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ye(e.time),z=d(s);if(null==(u=e.list)||u.forEach(((u,d)=>{const w=z?S.find((e=>e.key===u.key)):e,F=xe(W(u)?{...u,value:k.fixedValue}:u,s),G=e.list[d+1],N=G?xe(W(G)?{...G,value:k.fixedValue}:G,s):void 0,B=G?z?S.find((e=>e.key===G.key)):e:{},{title:J=""}=w;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!F||!N||f(F[0],1)!==f(N[0],1))F&&D&&(F[0]=D),D=null;else{const e=F[0]-_/2;F[0]=e+_/4,N[0]=D=F[0]+_/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,r=l([e[0],o],{value:W(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(r),{obj:r,top:-q}}(F,u,w),function(e,t,s,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ye(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=s,{value:y}=u,x=T(t.time);let b,j,w,L,S,Y;if(t.noRise&&p.show){const i=M(p,t)?V(a,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||pe.add(w);else if(t.value){w=r([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&he.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(y?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(S=l([x,e[1]-(y?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(S)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,null!=(d=t.physicsReduce)?d:t.drugReduce),r=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+_/2:x;b=i([...e,r,l],{...v,...m.line,...n}),j=o((null==(f=null==m?void 0:m.point)?void 0:f.type)||"circle",{left:r,top:l,...m.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(Y=o(k.type,{left:x,top:e[1]-(y?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(Y))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(y?-q:0)-5},verifiedText:{obj:S,top:(y?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:Y,top:(y?-q:0)-5}})}(F,u,w,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...Y),s=Math.min(...Y);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=r([e[0],i[0],i[1]],b,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...j};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<s&&(c=l([e[0],e[1]-q],i),X.push(c))}if(L.show&&+t.value<s){const t=e[1];if(L.text)d=l([e[0],e[1]+5],{value:L.text.split("").join("\n"),originY:"top",...L.style});else{const i=t+2*q;d=r([e[0],t,i],{...L.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:L.text?5:2*q,moveHide:!0}})}(F,u,w,K),function(n,l,r,u,c,d){let f,h;const{pointAttr:g={},lineAttr:m={},title:b="",key:j,type:w="circle"}=c,L=e.list[u+1];let S=x(n),Y=x(l);const M=function(e,t){return"pain"===e&&0==t}(a,e.list[u].value),D=()=>"pulse"==a&&r.pacemakerShow?y.value:W(r)?k.type:M&&"number"===O?0:w,F=e=>e&&p.show&&p.fixed&&ye(e.time)&&e.noRise&&!e.value&&0!==e.value;if((()=>{if(r.breakpoint)return!1;if("temperature"===a&&(n||F(r))&&(l||F(L))){const e=V(a,35);return n||(S=[T(r.time),e]),l||(Y=[T(L.time),e]),!0}return!!n&&!!l})()){S&&Y&&M&&"icon"===O&&(S[1]=S[1]-1,Y[1]=Y[1]-1),h=i([...S,...Y],{...m});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if(n&&l&&(null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...m});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const _=D(),q=I[u-1],G={origin:{data:W(r)?{...r,value:k.fixedValue}:r,title:b,key:j||"",unit:s.unit,type:a,_type:v(b,a),dataIndex:t,index:u,isOneLine:z},leftLine:q,rightLine:h,otherObj:d,...r.pacemakerShow&&"pulse"==a?y.style:W(r)?k.style:g,lockMovementX:!0,...H(),...M?{selectable:!1,evented:!1,..."number"===O?P:{}}:{}};n&&(q?G.leftLine.set("x2",n[0]):G.leftLine=null,f=o(_,{left:n[0],top:M&&!ne[1]?n[1]-5:n[1],...G}));I.push(h),f&&(j===ue[1]?ce.add(f):W(r)||de.add(f),function(e){Q.hovered&&(e.on("mouseover",(()=>{me(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:r=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),r&&(E.value.remove(i),delete e.otherObj.obj)))})),ve(e)}(e),Q.hovered&&me(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=R(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),$("change",n),je(n,"change")}}))}(f),C.push(f),pe.add(f))}(F,N,u,d,w,K)})),"pulse"===a){let t=null;const i=e=>e.map(((e,i,n)=>{var o,l;const r=n[i+1];if(r&&f(e.left,1)===f(r.left,1)){const i=e.left-_/2;e.set("left",i+_/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+_/2,r.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]}));if(z){const e={};ue.forEach((t=>{e[t]=C.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t})),ae.set(t,i(e[t]))}))}else{const{key:t}=e;ae.set(t,i(C))}}const F=I.filter((e=>e));E.value.add(...F,...C,...X)}function me(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top};let r=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;A.list=[function(){const{drugReduce:s,physicsReduce:u}=l||{},a="hover"===t?l.value:R(o,e.top);if(h(s))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(h(u))return r+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),r],A.show=!0}function ye(e){const[t]=F,i=j(F),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function xe(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ye(e.time))return;const n=T(e.time),o=V(t.type,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function be(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function je(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:r}=e,s=fe.find((e=>e.type===i));if("add"===t){const e=d(s)?s.dataList.find((e=>e.enable)):s.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[n].list[o]=l;we()}function we(){var e;pe.size&&(null==(e=E.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...pe]))),pe.clear(),Le()}function Le(e){ae.clear(),pe.clear(),ce.clear(),he.clear(),de.clear(),fe.forEach((t=>{t.show&&(null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t)&&!e.enable||ge(e,i,t)})))})),ve(),[...pe].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=fe.find((e=>e.show&&"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},S,z.overlap||{}),l=[];ce.size&&[...ce].forEach((e=>{[...de].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...n,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),l.push(o(s,{...i[e],...r}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),pe.add(e)}))}))}()}return function(){const t=new e.Rect({left:oe,top:0,width:le-oe-re.strokeWidth,height:ie-re.strokeWidth,fill:"transparent",...re});E.value.add(t)}(),Le((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!O.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...L]),"pain"===o&&(I.list=[...k]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...pe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key,isOneLine:i.isOneLine},pointer:n})}}));const i=be(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&$("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,isOneLine:o,dataIndex:l,index:r}=t.origin,s=m(i,[...L,...k]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),o&&(s.key=t.origin.key);const a={...t.origin,data:s};$("change",a),je(a,"change")}else{const t={data:{time:P(e.pointer.x),value:R(e.origin.type,e.pointer.y),...e.origin.isOneLine?{key:e.origin.key}:{}},...e.origin};$("add",t),je(t)}},setPopup:me,isAddPoint:be,updateData:je,redrawPoints:we,gridPoints:pe,fixedNoRisePoints:he}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,f=i.width/2,h=i.height/2,d=new e.Text(String(a),{...o,...n,..."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,...t,...c})}function g(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function u(t="circle",i){var n;const r={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...i},o=i.radius?(i.radius||5)+(i.strokeWidth||1):null!=(n=i.width)?n:0;switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...r});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...r});case"image":return new e.Image(i.element,r);case"yemai":{const t=()=>{const t=2*o,n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,o,t,o],n),c=new e.Line([o,0,o,t],n);return new e.Group([r,c])};return new e.Group([g(i),t()],r)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:o-.5,top:o-.5});return new e.Group([g(i),t],r)}case"circleAndText":{const t=new e.Text(String(i.text),{fontFamily:"微软雅黑",fontSize:r.fontSize||12,originX:"center",originY:"center",fill:i.stroke,left:o-.5,top:o-1,fontWeight:i.fontWeight||500,objectCaching:!1});return new e.Group([g(i),t],r)}case"circleAndCircle":return u("koumai",i);default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...r})}}function f(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:g}=r.icon,f=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:u(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:f,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:h,top:f})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,u as drawPoint,l as drawText,f as drawTextAndIconGroup,a as drawTextGroup};
|
1
|
+
import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:o.strokeWidth||1,stroke:o.fill||o.stroke}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,f=i.width/2,h=i.height/2,d=new e.Text(String(a),{...o,...n,..."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,...t,...c})}function g(t){return new e.Circle({objectCaching:!1,strokeWidth:t.strokeWidth||1,stroke:t.stroke||"red",radius:t.radius||5,fill:"#fff"})}function u(t="circle",i){var n;const r={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,scale:1,...i},o=i.radius?(i.radius||5)+(i.strokeWidth||1):null!=(n=i.width)?n:0;switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,...r});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,...r});case"image":return new e.Image(i.element,r);case"yemai":{const t=()=>{const t=2*o,n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,o,t,o],n),c=new e.Line([o,0,o,t],n);return new e.Group([r,c])};return new e.Group([g(i),t()],r)}case"koumai":{const t=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:o-.5,top:o-.5});return new e.Group([g(i),t],r)}case"circleAndText":{const t=new e.Text(String(i.text),{fontFamily:"微软雅黑",fontSize:r.fontSize||12,originX:"center",originY:"center",fill:i.textFill||i.stroke,left:o-.5,top:o-1,fontWeight:i.fontWeight||500,objectCaching:!1});return new e.Group([g(i),t],r)}case"circleAndCircle":return u("koumai",i);default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...r})}}function f(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:g}=r.icon,f=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:u(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:h,originTop:f,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:h,top:f})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,u as drawPoint,l as drawText,f as drawTextAndIconGroup,a as drawTextGroup};
|
@@ -598,7 +598,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
598
598
|
formRef: import("vue").Ref<any>;
|
599
599
|
conditionRef: import("vue").Ref<any>;
|
600
600
|
filterVisible: import("vue").Ref<boolean>;
|
601
|
-
title: import("vue").ComputedRef<"复制" | "
|
601
|
+
title: import("vue").ComputedRef<"复制" | "新增" | "修改" | "过滤条件">;
|
602
602
|
model: {
|
603
603
|
name: string;
|
604
604
|
color: string;
|
@@ -60,7 +60,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
60
60
|
formRef: import("vue").Ref<any>;
|
61
61
|
conditionRef: import("vue").Ref<any>;
|
62
62
|
filterVisible: import("vue").Ref<boolean>;
|
63
|
-
title: import("vue").ComputedRef<"复制" | "
|
63
|
+
title: import("vue").ComputedRef<"复制" | "新增" | "修改" | "过滤条件">;
|
64
64
|
model: {
|
65
65
|
name: string;
|
66
66
|
color: string;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as g,renderList as p,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as E,NUpload as C,NUploadTrigger as
|
1
|
+
import{defineComponent as e,ref as n,computed as t,watch as o,withDirectives as i,openBlock as s,createElementBlock as r,normalizeStyle as a,unref as c,createElementVNode as l,toDisplayString as u,createVNode as f,createCommentVNode as d,withCtx as m,Fragment as g,renderList as p,createBlock as h,createTextVNode as y,mergeProps as v,vShow as w}from"vue";import{NIcon as M,NTooltip as _,NPopover as k,NButton as E,NUpload as C,NUploadTrigger as I}from"naive-ui";import T from"./ChatAdd.vue.js";import{useState as x}from"../hooks/useState.js";import{useSession as b}from"../hooks/useSession.js";import{MESSAGE_TYPE as j,AV_STATUS as z}from"../constants/index.js";import"trtc-sdk-v5";import{simplifyMessage as L,base64ToFile as O}from"../utils/index.js";import{emojis as R}from"../utils/emoji.js";import{uploadFileApi as q}from"../api/index.js";import{CloseCircleOutline as D,CallOutline as A,VideocamOutline as $}from"@vicons/ionicons5";import{xor as H,uniq as J,trim as V,cloneDeep as K}from"lodash-es";import{uuidGenerator as F}from"../../../../shared/utils/index.js";import{useStorage as U}from"@vueuse/core";const G={key:0,class:"reference-content-box"},N={class:"reference-content"},X=["innerHTML"],B={class:"tool-box"},S=l("i",{class:"chat--iconfont chat--icon-face"},null,-1),P=l("span",null,"最近使用",-1),Q={class:"list-box",style:{"margin-bottom":"8px"}},W=["src"],Y=l("span",null,"默认表情",-1),Z={class:"list-box"},ee=["src"],ne=l("i",{class:"chat--iconfont chat--icon-good"},null,-1),te=l("i",{class:"chat--iconfont chat--icon-image"},null,-1),oe=l("i",{class:"chat--iconfont chat--icon-folder"},null,-1),ie={class:"btn-box"},se=l("span",{class:"tip"},"Enter 发送, Ctrl + Enter 换行",-1);var re=e({__name:"ChatFooter",setup(e){const re=n(),{state:ae,sendMessage:ce}=x(),{isGroupChat:le}=b(ae),ue=n(!1),fe=n(""),de=U("commonEmoticons",[]),me=t((()=>({options:ae.currentGroupUser,defaultValue:[ae.userInfo]}))),ge=t((()=>!fe.value.replace(/( |\s|<br>)+/g,"")));function pe(e,n=[]){const t=F(),o=[],i=n.length>0;ae.showVideo||ae.showMultipleVideo||(i?(o.push(...H(n,[ae.userInfo.id])),Object.assign(ae.currentAVMsg,{callMode:"call",checkedIds:o,strRoomId:t,chatMessageType:e}),ae.showMultipleVideo=!0):ce({content:{chatMessageType:e,msg:"",avStatus:z.IN_CALL}}))}function he(e){["Enter"].includes(e.key)&&(e.ctrlKey&&(e.preventDefault(),document.execCommand("InsertLineBreak")),function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),_e()))}function ye(){var e;fe.value=(null==(e=re.value)?void 0:e.innerHTML)||""}function ve(e){var n;de.value.unshift(e),de.value=J(de.value).slice(0,26),null==(n=re.value)||n.focus(),document.execCommand("insertHTML",!1,`<img data-msg=${e} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(e)} />`)}async function we(e){const n=new FormData;return n.append("sender",ae.userInfo.id),n.append("file",e),await q(n)}async function Me(e,n){const{file:t,name:o}=e.file,i=await we(t);if(!i)return console.log("上传失败");ke({chatMessageType:n,msg:n===j.FILE?o:i,url:i})}async function _e(){const{innerHTML:e="",innerText:n="",outerText:t=""}=re.value||{};if(ge.value)return console.log("请输入内容");let o=j.TEXT,i="";if(e){const t=e.match(/<img[^>]*>/gi),s=(t||[]).length;if(n&&0===s)i=n;else if(n||1!==s){if(o=j.BLEND,i=e,null==t?void 0:t.length)for(let e=0;e<s;e++)if(t[e].includes(`data-type="${j.EMOJI}"`)){const n=t[e].match(/data-msg="(.*?)"/);n&&n.length>1&&(i=i.replace(t[e],`[${n[1]}]`))}else{const n=t[e].match(/src\s*=\s*"([^"]*)"/);if(n&&n.length>1){const e=await O(n[1]);if(e){const t=await we(e);i=i.replace(n[1],t||"")}}}}else if(e.includes(j.EMOJI)){o=j.EMOJI;const n=e.match(/data-msg\s*=\s*"([^"]*)"/);n&&(i=n[1])}else{o=j.IMAGE;const n=e.match(/src\s*=\s*"([^"]*)"/);if(n){const e=await O(n[1]);if(e){const n=await we(e);n&&(i=n)}}}}else i=V(n);i&&ke({msg:i,chatMessageType:o,origin:"btn"})}async function ke(e){const{chatMessageType:n=j.TEXT,msg:t,url:o,origin:i=""}=e,s={msg:t,chatMessageType:n};n===j.FILE&&(s.fileUrl=o),"btn"===i&&Ee(),ae.currentReferenceMsg&&([j.TEXT,j.EMOJI,j.BLEND].includes(n)&&(s.referenceContent=K(ae.currentReferenceMsg)),ae.currentReferenceMsg=null),ce({content:s})}function Ee(){re.value.innerHTML="",fe.value=""}return o((()=>[ae.currentReferenceMsg,ae.currentReEditMsg]),(([e,n])=>{var t;if((e||n)&&(null==(t=re.value)||t.focus()),n){const{chatMessageType:e,msg:t}=n.content||{},o=e===j.TEXT?t:`<img data-msg=${t} data-type=${j.EMOJI} class="emoji--min" src=${R.findEmoji(t)} />`;document.execCommand("insertHTML",!1,o),ae.currentReEditMsg=null}})),o((()=>ae.id),(e=>{e&&Ee()})),(e,n)=>i((s(),r("section",{class:"chat-footer",style:a({cursor:c(ae).id?"default":"not-allowed"})},[c(ae).currentReferenceMsg?(s(),r("div",G,[l("div",N,[l("span",null,u(c(ae).currentReferenceMsg.senderName)+":",1),l("pre",{innerHTML:c(L)(c(ae).currentReferenceMsg.content)},null,8,X)]),f(c(M),{component:c(D),onClick:n[0]||(n[0]=()=>c(ae).currentReferenceMsg=null)},null,8,["component"])])):d("v-if",!0),l("div",B,[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(k),{"content-class":"emoji-content",class:"emoji-wrapper",show:ue.value,"onUpdate:show":n[1]||(n[1]=e=>ue.value=e),placement:"top",trigger:"click","show-arrow":!1,"display-directive":"show",delay:0},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[S])),_:1})])),default:m((()=>[c(de).length>0?(s(),r(g,{key:0},[P,l("div",Q,[(s(!0),r(g,null,p(c(de),(e=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:c(R).findEmoji(e)},null,8,W)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])],64)):d("v-if",!0),Y,l("div",Z,[(s(!0),r(g,null,p(c(R).default,(([e,n])=>(s(),h(c(_),{key:e,"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:()=>ve(e)},{icon:m((()=>[l("img",{src:n},null,8,ee)])),_:2},1032,["onClick"])])),default:m((()=>[y(" "+u(e),1)])),_:2},1024)))),128))])])),_:1},8,["show"])])),default:m((()=>[y(" 表情 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[2]||(n[2]=()=>ke({chatMessageType:c(j).EMOJI,msg:0}))},{icon:m((()=>[ne])),_:1})])),default:m((()=>[y(" 点赞 ")])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"image/*",onChange:n[3]||(n[3]=e=>Me(e,c(j).IMAGE))},{default:m((()=>[f(c(I),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[te])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传图片 ")])),_:2},1024)])),_:1})])),_:1}),f(c(C),{abstract:"",multiple:"",accept:"video/*,.pdf,.doc.docx,,.zip,.xlsx,.txt",onChange:n[4]||(n[4]=e=>Me(e,c(j).FILE))},{default:m((()=>[f(c(I),{abstract:""},{default:m((({handleClick:e})=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:e},{icon:m((()=>[oe])),_:2},1032,["onClick"])])),default:m((()=>[y(" 上传文件 ")])),_:2},1024)])),_:1})])),_:1}),c(ae).userInfo.sdkAppID?(s(),r(g,{key:0},[c(le)?(s(),r(g,{key:0},[f(T,v(c(me),{onComfirm:n[5]||(n[5]=e=>pe(c(j).AUDIO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1})])),_:1},16),f(T,v(c(me),{onComfirm:n[6]||(n[6]=e=>pe(c(j).VIDEO,e))}),{trigger:m((()=>[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny"},{icon:m((()=>[f(c(M),{size:"20",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频会议 ")])),_:1})])),_:1},16)],64)):(s(),r(g,{key:1},[f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[7]||(n[7]=()=>pe(c(j).AUDIO))},{icon:m((()=>[f(c(M),{size:"18",component:c(A)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 语音通话 ")])),_:1}),f(c(_),{"show-arrow":!1},{trigger:m((()=>[f(c(E),{quaternary:"",size:"tiny",onClick:n[8]||(n[8]=()=>pe(c(j).VIDEO))},{icon:m((()=>[f(c(M),{size:"20",component:c($)},null,8,["component"])])),_:1})])),default:m((()=>[y(" 视频通话 ")])),_:1})],64))],64)):d("v-if",!0)]),i(l("div",{ref_key:"inputRef",ref:re,class:"input-box",contenteditable:"",onKeydown:he,onInput:ye},null,544),[[w,c(ae).id]]),l("div",ie,[se,f(c(E),{type:"primary",round:"",disabled:c(ge),onClick:_e},{default:m((()=>[y("发送")])),_:1},8,["disabled"])])],4)),[[w,c(ae).id]])}});export{re as default};
|
@@ -3238,6 +3238,20 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
3238
3238
|
} | undefined;
|
3239
3239
|
tableRowHeight?: string | number | undefined;
|
3240
3240
|
tableHeaderRowHeight?: string | number | undefined;
|
3241
|
+
crossColumnSetting?: {
|
3242
|
+
columnWidth?: number | undefined;
|
3243
|
+
rowHeight?: number | undefined;
|
3244
|
+
fixedColumnList?: {
|
3245
|
+
setting: {
|
3246
|
+
name: string;
|
3247
|
+
option: {
|
3248
|
+
text: string;
|
3249
|
+
value?: string | undefined;
|
3250
|
+
}[];
|
3251
|
+
};
|
3252
|
+
columnWidth?: number | undefined;
|
3253
|
+
}[] | undefined;
|
3254
|
+
} | undefined;
|
3241
3255
|
onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
3242
3256
|
onScroll?: ((params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void) | undefined;
|
3243
3257
|
onKeydown?: ((params: import("vxe-table").VxeTableDefines.KeydownEventParams) => void) | undefined;
|
@@ -3306,6 +3320,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
3306
3320
|
}>;
|
3307
3321
|
updateConfigRefDebounced: () => void;
|
3308
3322
|
updateConfigRef: () => void;
|
3323
|
+
themeOverrides: import("vue").ComputedRef<import("naive-ui").GlobalThemeOverrides>;
|
3309
3324
|
fieldListRef: import("vue").Ref<{
|
3310
3325
|
[x: string]: any;
|
3311
3326
|
property?: string | undefined;
|
@@ -6816,6 +6831,20 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
6816
6831
|
} | undefined;
|
6817
6832
|
tableRowHeight?: string | number | undefined;
|
6818
6833
|
tableHeaderRowHeight?: string | number | undefined;
|
6834
|
+
crossColumnSetting?: {
|
6835
|
+
columnWidth?: number | undefined;
|
6836
|
+
rowHeight?: number | undefined;
|
6837
|
+
fixedColumnList?: {
|
6838
|
+
setting: {
|
6839
|
+
name: string;
|
6840
|
+
option: {
|
6841
|
+
text: string;
|
6842
|
+
value?: string | undefined;
|
6843
|
+
}[];
|
6844
|
+
};
|
6845
|
+
columnWidth?: number | undefined;
|
6846
|
+
}[] | undefined;
|
6847
|
+
} | undefined;
|
6819
6848
|
onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
6820
6849
|
onSettingClick?: (() => void) | undefined;
|
6821
6850
|
onFormClick?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FormRequestDefine, useVersion } from '../../../shared/hooks';
|
2
2
|
import { AnyFn, AnyObject } from '../../../shared/types';
|
3
|
+
import { GlobalThemeOverrides } from 'naive-ui';
|
3
4
|
import { PropType } from 'vue';
|
4
5
|
import { VxeTableInstance } from 'vxe-table';
|
5
6
|
import { AnnotationItem } from '../../../components/annotation-edit/src/type';
|
@@ -3239,6 +3240,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
3239
3240
|
} | undefined;
|
3240
3241
|
tableRowHeight?: string | number | undefined;
|
3241
3242
|
tableHeaderRowHeight?: string | number | undefined;
|
3243
|
+
crossColumnSetting?: {
|
3244
|
+
columnWidth?: number | undefined;
|
3245
|
+
rowHeight?: number | undefined;
|
3246
|
+
fixedColumnList?: {
|
3247
|
+
setting: {
|
3248
|
+
name: string;
|
3249
|
+
option: {
|
3250
|
+
text: string;
|
3251
|
+
value?: string | undefined;
|
3252
|
+
}[];
|
3253
|
+
};
|
3254
|
+
columnWidth?: number | undefined;
|
3255
|
+
}[] | undefined;
|
3256
|
+
} | undefined;
|
3242
3257
|
onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
3243
3258
|
onScroll?: ((params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void) | undefined;
|
3244
3259
|
onKeydown?: ((params: import("vxe-table").VxeTableDefines.KeydownEventParams) => void) | undefined;
|
@@ -3307,6 +3322,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
3307
3322
|
}>;
|
3308
3323
|
updateConfigRefDebounced: () => void;
|
3309
3324
|
updateConfigRef: () => void;
|
3325
|
+
themeOverrides: import("vue").ComputedRef<GlobalThemeOverrides>;
|
3310
3326
|
fieldListRef: import("vue").Ref<{
|
3311
3327
|
[x: string]: any;
|
3312
3328
|
property?: string | undefined;
|
@@ -6817,6 +6833,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
6817
6833
|
} | undefined;
|
6818
6834
|
tableRowHeight?: string | number | undefined;
|
6819
6835
|
tableHeaderRowHeight?: string | number | undefined;
|
6836
|
+
crossColumnSetting?: {
|
6837
|
+
columnWidth?: number | undefined;
|
6838
|
+
rowHeight?: number | undefined;
|
6839
|
+
fixedColumnList?: {
|
6840
|
+
setting: {
|
6841
|
+
name: string;
|
6842
|
+
option: {
|
6843
|
+
text: string;
|
6844
|
+
value?: string | undefined;
|
6845
|
+
}[];
|
6846
|
+
};
|
6847
|
+
columnWidth?: number | undefined;
|
6848
|
+
}[] | undefined;
|
6849
|
+
} | undefined;
|
6820
6850
|
onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
6821
6851
|
onSettingClick?: (() => void) | undefined;
|
6822
6852
|
onFormClick?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,ref as t,provide as o,computed as a,toRaw as l,watch as n,resolveComponent as r,openBlock as
|
1
|
+
import{defineComponent as e,ref as t,provide as o,computed as a,toRaw as l,watch as n,resolveComponent as r,openBlock as i,createElementBlock as s,mergeProps as u,unref as d,createBlock as c,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as v,createVNode as h,withCtx as p,createSlots as g,renderList as b,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as C,nextTick as D}from"vue";import{useTheme as $,createOpacityColor as j}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as w}from"@vueuse/core";import"date-fns";import{isString as T,isEqualWith as I,isFunction as R,pick as S}from"lodash-es";import{useFormAsyncQueue as q,presetRequestHandler as H}from"../../../shared/hooks/useFormRequest/index.js";import{hex2rgba as L,widthAppend as P,uuidGenerator as _}from"../../../shared/utils/index.js";import{promiseTimeout as A}from"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as B}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import"../../../shared/hooks/useScrollLoading.js";import{VxeTableEventNameList as M,InjectionIhoTableXeInstance as O,InjectionIhoTableLoading as E,InjectionIhoTableEmits as W,InjectionTableAsyncQueue as N,InjectionIhoTableAnnotation as V,InjectionIhoTableUUID as z,InjectionIhoTableInstance as G,InjectionIhoTableConfig as J,InjectionIhoTableFieldList as K,InjectionIhoTableHandler as Q,InjectionIhoTableGlobProps as U}from"./constants/index.js";import{createTableHooks as X,applyTableConfigHooks as Y,applyTableFieldHooks as Z,createTableEventHandlers as ee,createDomInsertComponent as te,createDataTransfer as oe}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as ae}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as le}from"./utils/index.js";const ne=["id"];var re=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3},developMode:{type:Boolean,default:!1}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...M],setup(e,{expose:M,emit:re}){var ie,se;const ue=e,de=t();o(O,de);const ce=t(!1),fe=a((()=>{var e;return(null==(e=ue.tableConfig)?void 0:e.loading)||ce.value}));o(E,ce);const me=$({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}),ve=a((()=>{var e,t,o;const a={...me.value};return a["--c-primary-color-opacity3"]=j(...L(a["--c-primary-color"]+""),.3),a["--c-scrollbar-width"]=P(null!=(o=null==(t=null==(e=de.value)?void 0:e.reactData)?void 0:t.scrollbarWidth)?o:0),a})),he=a((()=>{var e,t;const o=null!=(t=null==(e=ue.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":T(o)&&(o.includes("calc")||o.endsWith("%"))?o:P(o)}})),pe=ae(),ge=function(e,...t){re(e,...t);const o=d(Ce)[le(e)];R(o)&&o(...t),pe.trigger(e,...t)};o(W,ge);const be=q(a((()=>ue.requestInstance)),a((()=>!!ue.uniqueCacheData))).create(ue.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>H(t)});o(N,be);const xe=X();o(V,a((()=>ue.annotation)));const ye=_();o(z,ye);const ke=t();o(G,ke);const Ce=t({uuid:null!=(se=null==(ie=ue.tableConfig)?void 0:ie.uuid)?se:ye});o(J,Ce);const De=w($e,10);function $e(){var e,t;Ce.value=Y(xe,{...ue.tableConfig,uuid:null!=(t=null==(e=ue.tableConfig)?void 0:e.uuid)?t:ye},{$table:ke,emits:ge,globProps:ue,loading:ce,$xeTable:de})}const je=a((()=>{if(!Ce.value.tableRowHeight)return{};const e=P(Ce.value.rowConfig.height);return{Input:{heightLarge:e,heightMedium:e,heightSmall:e,heightTiny:e},InternalSelection:{heightLarge:e,heightMedium:e,heightSmall:e,heightTiny:e}}})),we=t([]);o(K,we);const Te=w(Ie,10);function Ie(){const e=Z(xe,ue.fieldList,Ce.value,{$table:ke,emits:ge,loading:ce,globProps:ue,$xeTable:de});I(e,l(we.value),((e,t)=>{if(R(e)&&R(t))return e.toString()===t.toString()}))||(we.value=e)}const Re=oe(xe,Ce,ke);let Se=null;function qe(e){Se=e}async function He(){await D(),null==Se||Se(),Se=null}const Le=t([]);async function Pe(){var e,t;const o=await Re(ue.tableData),a=null==(e=ke.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=ke.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return void He()}Le.value=o,null==(t=ke.value)||t.recalculate(!0),He()}const _e={updateTableDataRef:w(Pe,10),updateConfigRef:De,updateFieldListRef:Te};o(Q,_e),o(U,ue);const Ae=ee({hooks:xe,config:Ce,$table:ke,context:_e,emits:ge,globProps:ue,loading:ce,$xeTable:de}),Be=a((()=>({...Ce.value,...Ae})));let Fe=!1,Me=!1,Oe=!1;const Ee=w((()=>{Fe&&$e(),Me&&Ie(),Oe&&Pe(),Fe=!1,Me=!1,Oe=!1}),10);n((()=>ue.tableConfig),(()=>{Fe=!0,Me=!0,Oe=!0,Ee()}),{deep:!0}),n((()=>ue.fieldList),(()=>{Me=!0,Oe=!0,Ee()}),{deep:!0}),n([()=>[...ue.tableData],()=>{var e;return null==(e=ue.tableData)?void 0:e.length}],(()=>{Oe=!0,Ee()})),n([()=>ue.tableData,()=>{var e;return null==(e=ue.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=Ce.value.treeConfig)?void 0:e.expandAll)&&(await A(11),null==(t=ke.value)||t.setAllTreeExpand(!0))})),$e(),Ie(),Pe();const{header:We,footer:Ne}=te(xe);function Ve(e){return S(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return M({$table:ke,async loadData(e){var t;null==(t=ke.value)||t.loadData(await Re(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),tableDataResolved:()=>new Promise(qe),reload(){var e,t;null==(e=ke.value)||e.loadColumn([]),null==(t=ke.value)||t.loadData([]),$e(),Ie(),Pe()},verticalTable:{update:()=>{}},...xe.exposeHooks.expose.call({},Ce,{$table:ke,emits:ge,globProps:ue,loading:ce,$xeTable:de,..._e})}),xe.setupHooks.setup.call(Ce,we,{$table:ke,emits:ge,globProps:ue,loading:ce,$xeTable:de}),(e,t)=>{const o=r("vxe-grid");return i(),s("section",u({class:"iho-table",id:d(ye),style:d(ve)},d(F)()),[(i(),c(f(d(We)))),m("section",{style:v(d(he))},[h(d(B),{abstract:"",namespace:"vxe-table--ignore-clear","theme-overrides":d(je)},{default:p((()=>[h(o,u({ref_key:"$table",ref:ke},d(Be),{columns:we.value,data:Le.value,loading:d(fe)}),g({_:2},[b(e.$slots,((t,o)=>({name:o,fn:p((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(C(Ve(t))))]))})))]),1040,["columns","data","loading"])])),_:3},8,["theme-overrides"])],4),(i(),c(f(d(Ne))))],16,ne)}}});export{re as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function crossHeaderPlugin(): import("../../../../components/iho-table").TablePlugin;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{isEmpty as t,isObject as e,range as n,isArray as o}from"lodash-es";import{onBeforeUnmount as i}from"vue";import"../../index.js";import{useUUIDMap as r}from"../utils/index.js";import{defineTablePlugin as s}from"../hooks/useTablePlugin.js";function u(){const u="crossHeaderPlugin";return s({name:u,apply(s){const{getItemFromUUID:l,removeItemFromUUID:a,setItemFromUUID:d}=r((()=>[])),m=new WeakMap;s.fieldHooks.fieldList.tap(u,((n,i)=>{if(!i.uuid||!i.crossColumnSetting)return n;const{fixedColumnList:r,columnWidth:s,rowHeight:u}=i.crossColumnSetting;if(t(r))return n;const l=r.reduce(((t,n)=>(n&&e(n.setting)&&t.push({title:n.setting.name,field:n.setting.name,option:n.setting.option,fixed:"left",width:s||80,slots:{default({row:t,column:e}){var n;return t[e.field]||(null==(n=m.get(t))?void 0:n[e.field])||""}}}),t)),[]);if(0===l.length)return n;const a=function(t){const e=[];function n(i,r){var s;i!==t.length?o(null==(s=t[i])?void 0:s.option)&&t[i].option.forEach((e=>{n(i+1,{...r,[t[i].field]:e.text})})):e.push(r)}return n(0,{}),e}(l);d(i.uuid,a);const f=i.spanMethod;return i.spanMethod=t=>{const{column:e,rowIndex:n,columnIndex:o}=t,i={rowspan:1,colspan:1};return o<l.length?i.rowspan=function(t,e,n){var o;const i=t[n];if(i[e]&&(null==(o=t[n-1])?void 0:o[e])===i[e])return 0;let r=1;for(let o=n+1;o<t.length&&t[o][e]===i[e];o++)r++;return r}(a,e.field,n):f&&Object.assign(i,f(t)),i},u&&(i.rowConfig.height=u),[...l,...n]})),s.dataHooks.dataList.tap(u,((t,{uuid:e})=>{if(!e)return t;const o=l(e);return o?n(Math.max(t.length,o.length)).map((e=>(t[e]&&m.set(t[e],o[e]),t[e]||o[e]||{}))):t})),s.setupHooks.setup.tap(u,(t=>{i((()=>{t.value.uuid&&a(t.value.uuid)}))}))}})}export{u as crossHeaderPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as e}from"vue";import{isObject as
|
1
|
+
import{createVNode as e}from"vue";import{isObject as i}from"@vue/shared";import"../../../index.js";import{getLowCodeFieldFromField as o,IhoTableRenderHelper as n,createIhoTableFilterMethod as r}from"../../utils/index.js";import l from"./dynamicFilter.vue.js";import t from"./treeFilter.vue.js";import{defineTablePlugin as f}from"../../hooks/useTablePlugin.js";function d(){const d="dynamicFilterRenderPlugin";return f({name:d,vxe(i){i.renderer.mixin({[d]:{showFilterFooter:!1,renderFilter(i,n){var r,f,d;const u=o(n.column);return(null==(d=null==(f=null==(r=null==u?void 0:u.optionInfo)?void 0:r.dynamicOptionInfo)?void 0:f.treeInfo)?void 0:d.enable)?e(t,{payload:n,key:n.column.field},null):e(l,{payload:n,key:n.column.field},null)}}})},apply(e){e.fieldHooks.field.tap(d,((e,o,l,{$table:t})=>{var f,u;const a=null==(f=e.editRender)?void 0:f.props;if(!i(a))return e;if(!n.hasDynamicFilter(a))return e;if(e.filterRender={name:d},e.filters=[],!e.filterMethod){const i=null==(u=l.treeConfig)?void 0:u.children;e.filterMethod=r(i)}return l.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...l.filterConfig},e}))}})}export{d as dynamicFilterRenderPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as e}from"vue";import{jsonParse as i,arrayed as l}from"../../../../../shared/utils/index.js";import{isObject as r}from"@vue/shared";import{promiseTimeout as t}from"@vueuse/shared";import{isArray as o,isString as n,first as d,findLastIndex as u}from"lodash-es";import"../../../index.js";import{useUUIDMap as s,IhoTableRenderHelper as a,isCompatibleColumn as f,createIhoTableFilterMethod as c}from"../../utils/index.js";import p from"./filter.vue.js";import{defineTablePlugin as v}from"../../hooks/useTablePlugin.js";function m(){const m="filterRenderPlugin";return v({name:m,vxe(i){i.renderer.mixin({[m]:{showFilterFooter:!1,renderFilter:(i,l)=>e(p,{payload:l,key:l.column.field},null)}})},apply(e){const{getItemFromUUID:p,setItemFromUUID:v,removeItemFromUUID:g}=s((()=>[]),!1);e.fieldHooks.field.tap(m,((e,l,t,{$table:u})=>{var s,p,v,h,g,b,
|
1
|
+
import{createVNode as e}from"vue";import{jsonParse as i,arrayed as l}from"../../../../../shared/utils/index.js";import{isObject as r}from"@vue/shared";import{promiseTimeout as t}from"@vueuse/shared";import{isArray as o,isString as n,first as d,findLastIndex as u}from"lodash-es";import"../../../index.js";import{useUUIDMap as s,IhoTableRenderHelper as a,isCompatibleColumn as f,createIhoTableFilterMethod as c}from"../../utils/index.js";import p from"./filter.vue.js";import{defineTablePlugin as v}from"../../hooks/useTablePlugin.js";function m(){const m="filterRenderPlugin";return v({name:m,vxe(i){i.renderer.mixin({[m]:{showFilterFooter:!1,renderFilter:(i,l)=>e(p,{payload:l,key:l.column.field},null)}})},apply(e){const{getItemFromUUID:p,setItemFromUUID:v,removeItemFromUUID:g}=s((()=>[]),!1);e.fieldHooks.field.tap(m,((e,l,t,{$table:u})=>{var s,p,v,h,g,b,k,y;const F=null==(s=e.editRender)?void 0:s.props;if(!r(F))return e;if(!a.hasOptionFilter(F))return e;e.editRender={...e.editRender,props:{...null==(p=e.editRender)?void 0:p.props,sortable:e.sortable}},e.filterRender={name:m};const x=null==(v=u.value)?void 0:v.getColumnByField(e.field),R={};let C;if(x&&o(x.filters)&&x.filters.forEach((e=>{e&&(R[`${e.label}_${e.value}`]=e.checked)})),f(F))C=null!=(h=F.options)?h:[];else{C=null!=(k=null==(b=null==(g=(r(F.fieldSetting)?F.fieldSetting:n(F.fieldSetting)?i(F.fieldSetting||""):{}).mapping)?void 0:g.mappingFiled)?void 0:b.reduce(((e,i)=>{var l;const t=d(i.value);return r(t)&&e.push({label:i.key||t.key,value:t.value,data:null!=(l=t.keyword)?l:t.value}),e}),[]))?k:[]}if(e.filters=C.reduce(((e,i)=>(r(i)&&e.push({...i,checked:!!R[`${i.label}_${i.value}`]}),e)),[]),!e.filterMethod){const i=null==(y=t.treeConfig)?void 0:y.children;e.filterMethod=c(i)}return t.filterConfig={iconMatch:"iho-table--iconfont iho-table-icon-filter",iconNone:"iho-table--iconfont iho-table-icon-filter",...t.filterConfig},e})),e.fieldHooks.fieldList.tap(m,((e,i)=>i.uuid?(v(i.uuid,e),e):e)),e.fieldHooks.fieldEnd.tapPromise(m,(async(e,{$table:i})=>{var l;if(i.value&&e.uuid)try{const r=p(e.uuid);if(null==(l=e.sortConfig)?void 0:l.multiple){const e=r.reduce(((e,l)=>{var r;const t=null==(r=l.editRender)?void 0:r.props;if(!l.sortable)return e;if(t&&h(t.isOrder)){const r=i.value.getColumnByField(l.field);e.push({field:l.field,order:(null==r?void 0:r.order)?r.order:t.isOrder})}return e}),[]);if(!e.length)return;await t(200),await i.value.sort(e)}else u(r,(e=>{var l;const r=null==(l=e.editRender)?void 0:l.props;if(r&&h(r.isOrder))return e&&i.value.sort(e.field,r.isOrder),!0}))}finally{g(e.uuid)}})),e.exposeHooks.expose.tap(m,((e,i,{$table:r})=>(Object.assign(e,{setSort(e,i){r.value&&r.value.sort(e,i)},setFilter(e,i){if(!r.value)return;const t=r.value.getColumnByField(e);if(!t||!o(t.filters))return;const n=l(i);t.filters.forEach((e=>{e.checked=n.includes(e.value)})),r.value.updateData()}}),e)))}})}function h(e){return["asc","desc",null].includes(e)}export{m as filterRenderPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./
|
1
|
+
import*as e from"./anchorPlugin/index.js";import*as r from"./bindEventSettingPlugin.js";import*as i from"./colorAndIconPlugin.js";import*as n from"./copyPastePlugin.js";import*as s from"./crossHeaderPlugin.js";import*as t from"./defaultConfigPlugin.js";import*as l from"./defaultValuePlugin.js";import*as d from"./dragScrollPlugin.js";import*as g from"./dynamicFilterRenderPlugin/index.js";import*as o from"./filterDaterangeRenderPlugin/index.js";import*as u from"./filterRenderPlugin/index.js";import*as a from"./filterTextPlugin/index.js";import*as P from"./filterVisibleEventPlugin.js";import*as m from"./forceArrowKeyPlugin.js";import*as f from"./headerPlugin/index.js";import*as p from"./highLightSetPlugin.js";import*as x from"./keyboardEventPlugin.js";import*as j from"./lowCodeFieldAdaptorPlugin.js";import*as c from"./maxCheckSizePlugin.js";import*as R from"./operationalFormPlugin.js";import*as b from"./pagerScrollPlugin/index.js";import*as w from"./rendererPlugins/editableWidgets/dateRendererPlugin/index.js";import*as h from"./rendererPlugins/editableWidgets/inputRendererPlugin.js";import*as W from"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js";import*as S from"./rendererPlugins/editableWidgets/numberRendererPlugin.js";import*as v from"./rendererPlugins/editableWidgets/radioRendererPlugin.js";import*as k from"./rendererPlugins/editableWidgets/selectRendererPlugin/index.js";import*as y from"./rendererPlugins/editableWidgets/separateRendererPlugin/index.js";import*as C from"./rendererPlugins/editableWidgets/switchRendererPlugin.js";import*as F from"./rendererPlugins/editableWidgets/timeRendererPlugin/index.js";import*as A from"./rendererPlugins/widgets/checkRendererPlugin.js";import*as E from"./rendererPlugins/widgets/colorRendererPlugin.js";import*as T from"./rendererPlugins/widgets/defaultRendererPlugin.js";import*as D from"./rendererPlugins/widgets/htmlRendererPlugin.js";import*as H from"./rendererPlugins/widgets/labelRendererPlugin.js";import*as V from"./rendererPlugins/widgets/pictureRendererPlugin.js";import*as q from"./rendererPlugins/widgets/seqRendererPlugin.js";import*as z from"./rowClickPlugin.js";import*as G from"./rowDragPlugin.js";import*as I from"./rowGroupSettingPlugin/index.js";import*as K from"./stickyFixedPlugin.js";import*as L from"./varialbleHeightPlugin.js";import*as O from"./verticalTablePlugin/index.js";import*as B from"./virtualTreePlugin.js";import*as J from"./wordbookSettingPlugin.js";import{separateMetaModule as M}from"../../../../shared/utils/index.js";var N=M(Object.assign({"./anchorPlugin/index.tsx":e,"./bindEventSettingPlugin.ts":r,"./colorAndIconPlugin.ts":i,"./copyPastePlugin.ts":n,"./crossHeaderPlugin.ts":s,"./defaultConfigPlugin.ts":t,"./defaultValuePlugin.ts":l,"./dragScrollPlugin.ts":d,"./dynamicFilterRenderPlugin/index.tsx":g,"./filterDaterangeRenderPlugin/index.tsx":o,"./filterRenderPlugin/index.tsx":u,"./filterTextPlugin/index.tsx":a,"./filterVisibleEventPlugin.ts":P,"./forceArrowKeyPlugin.ts":m,"./headerPlugin/index.tsx":f,"./highLightSetPlugin.tsx":p,"./keyboardEventPlugin.ts":x,"./lowCodeFieldAdaptorPlugin.tsx":j,"./maxCheckSizePlugin.ts":c,"./operationalFormPlugin.ts":R,"./pagerScrollPlugin/index.ts":b,"./rendererPlugins/editableWidgets/dateRendererPlugin/index.tsx":w,"./rendererPlugins/editableWidgets/inputRendererPlugin.tsx":h,"./rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.tsx":W,"./rendererPlugins/editableWidgets/numberRendererPlugin.tsx":S,"./rendererPlugins/editableWidgets/radioRendererPlugin.tsx":v,"./rendererPlugins/editableWidgets/selectRendererPlugin/index.tsx":k,"./rendererPlugins/editableWidgets/separateRendererPlugin/index.tsx":y,"./rendererPlugins/editableWidgets/switchRendererPlugin.tsx":C,"./rendererPlugins/editableWidgets/timeRendererPlugin/index.tsx":F,"./rendererPlugins/widgets/checkRendererPlugin.tsx":A,"./rendererPlugins/widgets/colorRendererPlugin.tsx":E,"./rendererPlugins/widgets/defaultRendererPlugin.tsx":T,"./rendererPlugins/widgets/htmlRendererPlugin.tsx":D,"./rendererPlugins/widgets/labelRendererPlugin.tsx":H,"./rendererPlugins/widgets/pictureRendererPlugin.tsx":V,"./rendererPlugins/widgets/seqRendererPlugin.tsx":q,"./rowClickPlugin.ts":z,"./rowDragPlugin.ts":G,"./rowGroupSettingPlugin/index.ts":I,"./stickyFixedPlugin.tsx":K,"./varialbleHeightPlugin.tsx":L,"./verticalTablePlugin/index.ts":O,"./virtualTreePlugin.ts":B,"./wordbookSettingPlugin.ts":J}));export{N as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,useAttrs as t,inject as l,ref as a,computed as
|
1
|
+
import{defineComponent as e,useAttrs as t,inject as l,ref as a,computed as o,reactive as r,watch as u,nextTick as n,onBeforeUnmount as i,openBlock as m,createBlock as d,unref as v,withCtx as c,createVNode as s,mergeProps as f,isRef as p,createElementBlock as h,Fragment as b,renderList as y,createTextVNode as g,toDisplayString as w,createCommentVNode as k}from"vue";import{noop as _}from"lodash-es";import{NPopover as V,NInput as F,NSpace as S,NScrollbar as $,NButton as H}from"naive-ui";import{useIhoTableFormEvent as x}from"../../../../utils/index.js";import D from"../../../../../../time-picker/index.js";import{parse as C,isValid as O,format as j,getHours as E,getMinutes as A,getSeconds as I}from"date-fns";var P=e({__name:"editTime",props:{formattedValue:{type:String},column:{type:Object},row:{type:Object},rowIndex:{type:Number},shortcutOptions:{type:Array,default:()=>[]},ignoreGlobEmit:{type:Boolean,default:!1}},emits:["update:formattedValue","click"],setup(e,{emit:P}){const R=e,U=t(),{emitFormChangeWithParams:q=_}=R.ignoreGlobEmit?{}:x({...R,$table:l("$xetable")}),G=a(null),M=a(!1),N=a(),W=a();let z=R.formattedValue;const B=o((()=>W.value&&X(W.value)?{style:"text-decoration: line-through"}:{})),K=o({get(){if(!W.value)return null;const e=C(W.value,L.valueFormat,new Date);return O(e)?j(e,L.valueFormat):R.formattedValue?ee(R.formattedValue):null},set(e){Q(e)}}),{placeholder:T="请选择",valueFormat:J="HH:mm"}=U,L=r({...U,placeholder:T,valueFormat:J,format:J});function Q(e){if(W.value=e||"",e&&X(e))return;R.formattedValue!==e&&(z=e)}function X(e){var t,l,a;const o=C(e,L.format,new Date),r=E(o),u=A(o),n=I(o),i=null==(t=L.isHourDisabled)?void 0:t.call(L,r),m=null==(l=L.isMinuteDisabled)?void 0:l.call(L,u,r),d=null==(a=L.isSecondDisabled)?void 0:a.call(L,n,u,r);return i||m||d}function Y(){[L.valueFormat.replace(/[^\w]/g,""),L.valueFormat].some((e=>{const t=C(W.value,e,new Date);if(!W.value||O(t)){return Q(W.value?j(t,L.valueFormat):null),!0}return!1}))}function Z(e){var t;const{key:l}=e;"Enter"===l&&(null==(t=G.value)||t.blur(),M.value=!1)}function ee(e){var t;const l=L.valueFormat.match(/\W/)[0]||":",a=e.split(l).map(Number),o=`${a[0].toString().padStart(2,"0")}${l}${a[1].toString().padStart(2,"0")}`;return"HH:mm"===L.valueFormat?o:"HH:mm:ss"===L.valueFormat?`${o}${l}${(null!=(t=a[2])?t:0).toString().padStart(2,"0")}`:e}function te(){z&&X(z)||R.formattedValue!==z&&(P("update:formattedValue",z),q({oldValue:R.formattedValue}))}return u((()=>R.formattedValue),(e=>{z=e,e&&(W.value=ee(e))}),{immediate:!0}),u((()=>M.value),(async e=>{var t,l,a,o,r;e?(z=K.value,await n(),null==(r=null==(o=null==(a=null==(l=null==(t=N.value)?void 0:t.$timePicker)?void 0:l.panelInstRef)?void 0:a.$el)?void 0:o.querySelectorAll(".n-time-picker-col"))||r.forEach((e=>{var t,l;return null==(l=null==(t=null==e?void 0:e.querySelector)?void 0:t.call(e,".n-time-picker-col__item--active"))?void 0:l.scrollIntoView()}))):te()})),i((()=>{te()})),(t,l)=>(m(),d(v(V),{show:M.value,"onUpdate:show":l[3]||(l[3]=e=>M.value=e),trigger:"click",showArrow:!1,placement:"bottom-start",style:{padding:"0"}},{trigger:c((()=>[s(v(F),{ref_key:"formRef",ref:G,clearable:"",placeholder:v(T),value:W.value,"onUpdate:value":l[0]||(l[0]=e=>W.value=e),valueModifiers:{trim:!0},"input-props":v(B),onChange:Y,onKeydown:Z},null,8,["placeholder","value","input-props"])])),default:c((()=>[s(v(S),null,{default:c((()=>[s(v(D),f({ref_key:"timePickerRef",ref:N,show:""},v(L),{class:"iho-table__time-picker",to:!1,"formatted-value":v(K),"onUpdate:formatted-value":l[1]||(l[1]=e=>p(K)?K.value=e:null),onConfirm:l[2]||(l[2]=()=>M.value=!1)}),null,16,["formatted-value"]),s(v($),{class:"iho-table__scrollbar"},{default:c((()=>[e.shortcutOptions.length?(m(),d(v(S),{key:0,vertical:"",wrap:!1},{default:c((()=>[(m(!0),h(b,null,y(e.shortcutOptions,(e=>(m(),d(v(H),{size:"tiny",key:e,disabled:X(e),onClick:t=>function(e){Q(ee(e)),M.value=!1}(e)},{default:c((()=>[g(w(e),1)])),_:2},1032,["disabled","onClick"])))),128))])),_:1})):k("v-if",!0)])),_:1})])),_:1})])),_:1},8,["show"]))}});export{P as default};
|
package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{createVNode as n}from"vue";import"../../../../index.js";import{WIDGET_TYPE as e}from"../../../constants/index.js";import{parseMergeField as r,getTitle as t,isRichContent as o,parseRichContent as i}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function c(){return l({name:"defaultRendererPlugin",vxe(o){o.renderer.add(e.DEFAULT,{renderCell(e,{row:o,column:i}){const l=r(o,i);return n("span",{title:String(t(i,l)),class:"iho-table__colorAndIcon"},[c(l,i)])}}),o.renderer.add(e.STATUS,o.renderer.get(e.DEFAULT))}});function c(e,r){if(!o(e))return e;const l=i(e);return[n("span",{title:t(r,l.change_text)
|
1
|
+
import{createVNode as n}from"vue";import"../../../../index.js";import{WIDGET_TYPE as e}from"../../../constants/index.js";import{parseMergeField as r,getTitle as t,isRichContent as o,parseRichContent as i}from"../../../utils/index.js";import{defineTablePlugin as l}from"../../../hooks/useTablePlugin.js";function c(){return l({name:"defaultRendererPlugin",vxe(o){o.renderer.add(e.DEFAULT,{renderCell(e,{row:o,column:i}){const l=r(o,i);return n("span",{title:String(t(i,l)),class:"iho-table__colorAndIcon"},[c(l,i)])}}),o.renderer.add(e.STATUS,o.renderer.get(e.DEFAULT))}});function c(e,r){if(!o(e))return e;const l=i(e),c=l.background||l.icon;return[n("span",{title:t(r,l.change_text)},[function(e){if(!e)return null;if(e.match(/#[\da-f]{6}|[\da-f]{3}/i))return n("i",{class:"icon-dot",style:{"--table-icon-color":e,"--table-icon-shadow":e}},null);return n("i",{class:l.icon},null)}(l.icon),n("i",{style:{color:c,fontWeight:"bold"}},[l.change_text])])]}}export{c as defaultRendererPlugin};
|
@@ -1 +1 @@
|
|
1
|
-
import{pick as e}from"lodash-es";import{onBeforeUnmount as r,unref as o}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as t}from"../../constants/index.js";import{createVerticalTableHooks as l,usePresetVerticalPlugins as i}from"./src/hooks/index.js";import{useUUIDMap as n}from"../../utils/index.js";import{VERTICAL_CELL_TYPE as a}from"./src/constants.js";import{createCellRender as s,createHeaderCellRender as d}from"./src/renderer.js";import{isVerticalTable as u,getSpanInfo as c}from"./src/utils.js";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function f(){const f="verticalTablePlugin",{getItemFromUUID:p,removeItemFromUUID:g}=n((()=>({})));return m({name:f,vxe(e){e.renderer.add(a,{renderCell:s(e,p,"default"),renderEdit:s(e,p,"edit"),renderHeader:d(e,p)})},apply(n){const a=l();i(a,n,p),n.configHooks.config.tap({name:f,stage:t},(r=>{if(!r.uuid||!u(r))return r;const o=p(r.uuid);function t(e){var r;return e.row||null==e.$rowIndex||(e.row=null==(r=o.fixedLeftVerticalData)?void 0:r[e.$rowIndex]),a.cellStyle.call({},e,o)}function l(e){return a.cellClassName.call({},e,o)}o.originalTableConfig=r;const i={...e(r,["uuid","border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig","selectType","editConfig"]),vertical:!0,cellClassName:l,headerCellClassName:l,cellStyle:t,headerCellStyle:t,headerRowStyle:e=>a.headerRowStyle.call({background:"white"},e,o),spanMethod:c};return a.config.call(i,o)})),n.setupHooks.setup.tap(f,(e=>{r((()=>g(o(e).uuid)))})),n.fieldHooks.field.tap({name:f,before:"lowCodeFieldAdaptorPlugin"},((e,r,o)=>(o.uuid&&u(o)&&(e.variableHeight=!1),e)))}})}export{f as verticalTablePlugin};
|
1
|
+
import{pick as e}from"lodash-es";import{onBeforeUnmount as r,unref as o}from"vue";import"../../../index.js";import{LOWEST_PRIORITY as t}from"../../constants/index.js";import{createVerticalTableHooks as l,usePresetVerticalPlugins as i}from"./src/hooks/index.js";import{useUUIDMap as n}from"../../utils/index.js";import{VERTICAL_CELL_TYPE as a}from"./src/constants.js";import{createCellRender as s,createHeaderCellRender as d}from"./src/renderer.js";import{isVerticalTable as u,getSpanInfo as c}from"./src/utils.js";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function f(){const f="verticalTablePlugin",{getItemFromUUID:p,removeItemFromUUID:g}=n((()=>({})));return m({name:f,vxe(e){e.renderer.add(a,{renderCell:s(e,p,"default"),renderEdit:s(e,p,"edit"),renderHeader:d(e,p)})},apply(n){const a=l();i(a,n,p),n.configHooks.config.tap({name:f,stage:t},(r=>{if(!r.uuid||!u(r))return r;const o=p(r.uuid);function t(e){var r;return e.row||null==e.$rowIndex||(e.row=null==(r=o.fixedLeftVerticalData)?void 0:r[e.$rowIndex]),a.cellStyle.call({},e,o)}function l(e){return a.cellClassName.call({},e,o)}o.originalTableConfig=r;const i={...e(r,["uuid","border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig","selectType","editConfig"]),vertical:!0,cellClassName:l,headerCellClassName:l,cellStyle:t,headerCellStyle:t,headerRowStyle:e=>a.headerRowStyle.call({background:"white"},e,o),spanMethod:e=>c(e,r.spanMethod,o)};return a.config.call(i,o)})),n.setupHooks.setup.tap(f,(e=>{r((()=>g(o(e).uuid)))})),n.fieldHooks.field.tap({name:f,before:"lowCodeFieldAdaptorPlugin"},((e,r,o)=>(o.uuid&&u(o)&&(e.variableHeight=!1),e)))}})}export{f as verticalTablePlugin};
|