cnhis-design-vue 3.2.3-beta.3 → 3.2.3-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/es/components/callback/src/components/render/popupMaps.d.ts +2 -0
  2. package/es/components/fabric-chart/index.d.ts +123 -22
  3. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +115 -26
  4. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  5. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  6. package/es/components/fabric-chart/src/components/PopupTip.vue.d.ts +79 -19
  7. package/es/components/fabric-chart/src/components/PopupTip.vue2.js +1 -1
  8. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +1 -1
  9. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +1 -1
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  14. package/es/components/fabric-chart/src/interface.d.ts +3 -0
  15. package/es/components/fabric-chart/style/index.css +1 -1
  16. package/es/components/iho-table/index.d.ts +2 -0
  17. package/es/components/iho-table/src/IhoTable.vue.d.ts +2 -0
  18. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  19. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  20. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
  21. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.d.ts +1 -24
  22. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/index.js +1 -1
  23. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useCurrentColumn.js +1 -1
  24. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEditCell.js +1 -1
  25. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useEventConvert.js +1 -1
  26. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/hooks/useTriggerRow.js +1 -1
  27. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/renderer.js +1 -1
  28. package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
  29. package/es/components/iho-table/src/types/index.d.ts +1 -0
  30. package/es/components/iho-table/style/index.css +1 -1
  31. package/es/components/index.css +1 -1
  32. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  33. package/es/shared/package.json.js +1 -1
  34. package/package.json +2 -2
@@ -1 +1 @@
1
- import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P){const{computedX:w,computedY:b,getXValue:A,getYValue:I}=r(k),{xCellWidth:C,pointSelectionStyle:K,originX:j,endX:E,originY:X,endY:V,event:T,scaleValues:M,xAxis:S,startTime:Y,timeXCell:$,itemList:F,dialog:O}=k,D=new Map,_=new Set,z=p(M);let N=[],G=null;const J=new Set;l(h,k);const{getEqualXTypes:q,handleAddPrevent:R,setPrevAndNextPoint:W,getPointEventProps:B}=s(h,x,k),{pause:H,resume:Q}=y((()=>{!function(){if(!J.size)return;for(const e of J)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function U(){z.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([j,r,E,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});T.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{L.point={...e||{x:a.left,y:a.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),a.on("mouseout",(()=>{L.show=!1}))),h.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ne(t,n,e))}))}))}function Z(e=[]){if(!(null==G?void 0:G.areaPos))return[];const{startPos:t,endPos:n}=G.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:ue()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ee(e){O.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),te()},onNegativeClick:()=>te(),onClose:()=>te()})}function te(){G&&h.value.remove(G),G=null}function ne(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];D.set(e.key,[]),function(e,t){J.size&&[...J].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&J.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,g,y=u;l.key&&(y=s.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:K="circle"}=y,j=ce(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(g=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:w,key:u.key,selfKey:b,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:g,...k,...B()};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(g),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){T.hovered&&(e.on("mouseover",(()=>{se(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{fe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),T.hovered&&se(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/C);if(a>l+C){if(0===N.length){oe(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+C*c;if(N.every((e=>e.left!==u))){const t=A(u),n=I(f.type,s);N.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),oe(e,[...e.prevPointer,u,s])}if(N.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+C*l,r=N.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=N.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=N[l-1]||{left:n,top:i},f=~~((r.left-(t-C))/C),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:A(t),value:I(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},N.splice(l,0,a),oe(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=D.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=C/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?ie(e,"#999"):ie(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(N.length>0&&i<N[N.length-1].left){for(const e of _)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(N=N.filter((e=>e.left<=i)),0===N.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of _)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(N.length>0){const t=m(N);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:I(t,e.top)}};if(h.value.discardActiveObject(),N.length>0){const l=z.find((e=>e.type===t));let r=-1;const a=N.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void re({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...m(a),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),le({...o,data:a,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),le(o,"change")}}))}(p),null==(d=D.get(u.key))||d.push(p))}(ce(l,n),l,c,e)})),Promise.all(D.get(e.key)).then((t=>{const n=f.filter((e=>e));W(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||J.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ie(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function oe(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,_.add(l),h.value.add(r,l)}))}function le(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=z.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}re({dataIndex:s,scaleValue:f})}function re(e){var t,n,i;if(_.size&&(null==(t=h.value)||t.remove(...ae([..._]))),_.clear(),N=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ae(D.get(o.key))),D.delete(o.key),ne(o,t,i)}else D.size&&(null==(i=h.value)||i.remove(...ae(ue()))),D.clear(),U()}function ae(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function se(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;L.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:I(i,e.top)}`;L.list=[`${n} ${r}${l||""}`,`时间 ${A(e.left).slice(-5)}`],L.show=!0}function fe(e){e.setCoords();const t=6e4/$,n=e.prevPoint?e.prevPoint.left+t:j,i=E;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ce(e,t){if(u(e)&&function(e){const t=Date.parse(m(S.list)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=w(e.time),i=b(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function ue(){return g(Array.from(D.values()))}return e((()=>{H()})),U(),function(){if(!T.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=E&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);ue().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),F.forEach((n=>{q(ue(),t,"key",2*C).includes(n.linkKey||n.key)||P.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===P.list.length&&(P.show=!1,R("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Z();t.length>0?ee((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return le(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):a.emit(G)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;G&&h.value.remove(G),G=new t.Rect({...n,fill:"#CAF982",opacity:.4,...K,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),G.areaPos={startPos:i,endPos:o.pointer},h.value.add(G)}))}(),{redrawPoints:re,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),le(n,"remove")):(Object.assign(n,{data:{time:A(e.pointer.x),value:I(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),le({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:fe,setPopup:se,updateData:le,getGridPoints:ue,getContainPoints:Z,showDialog:ee,removeCurrentSelection:te}}export{h as useCenter};
1
+ import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as s}from"../useEvent.js";import{useCommon as a}from"../useCommon.js";import{getPointRange as f,getIndex as u,isEffectiveNode as c,getTime as p}from"../../utils/index.js";import{cloneDeep as d,last as m,omit as v,flatten as g}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as y}from"@vueuse/core";function h(h,k,x,L,P,w){const{computedX:b,computedY:A,getXValue:I,getYValue:C}=r(k),{xCellWidth:K,pointSelectionStyle:E,originX:j,endX:T,originY:X,endY:V,event:Y,scaleValues:M,xAxis:S,startTime:D,timeXCell:O,itemList:$,dialog:F,topGridOriginY:_,topGridEndY:z}=k,G=new Map,N=new Set,J=d(M);let q=[],R=null;const W=new Set;l(h,k);const{getEqualXTypes:B,handleAddPrevent:H,setPrevAndNextPoint:Q,getPointEventProps:U}=a(h,x,k),{pause:Z,resume:ee}=y((()=>{!function(){if(!W.size)return;for(const e of W)e.set("opacity",1===e.opacity?.5:1);h.value.renderAll()}()}),800);function te(){J.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function s({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=A(t.type,t.range,n),s=i([j,r,T,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});Y.hovered&&o&&(s.on("mousemove",(({pointer:e})=>{L.point={...e||{x:s.left,y:s.top}},L.list=[`${o} ${n}${t.unit||""}`],L.show=!0})),s.on("mouseout",(()=>{L.show=!1}))),h.value.add(s)}s(n),s(o),s(l),s(r)}(t,e),le(t,n,e))}))}))}function ne(e=[]){if(!(null==R?void 0:R.areaPos))return[];const{startPos:t,endPos:n}=R.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:me()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function ie(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),oe()},onNegativeClick:()=>oe(),onClose:()=>oe()})}function oe(){R&&h.value.remove(R),R=null}function le(e,t,n){var l;const{type:r,unit:s,dataList:a=[]}=n,f=[];G.set(e.key,[]),function(e,t){W.size&&[...W].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&W.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,u)=>{!function(e,l,u,c){var p;let d,g,y=c;l.key&&(y=a.find((e=>e.key===l.key)));const{pointAttr:k={},lineAttr:P={},title:w="",key:b,type:A="circle"}=y,E=de(c.list[u+1],n);e&&E&&!l.breakpoint&&e[0]!==E[0]&&(g=i([...e,...E],P));const j=f[u-1],T={origin:{data:l,title:w,key:c.key,selfKey:b,unit:s,type:r,dataIndex:t,index:u,lineAttr:P},__type:"main",leftLine:j,rightLine:g,...k,...U()};e&&(j||(T.leftLine=null),d=o(A,{left:e[0],top:e[1],...T}));f.push(g),d&&(d.originLeft=d.left,d.originTop=d.top,function(e){Y.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{L.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{pe(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),Y.hovered&&ce(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:s,top:a,origin:f}=e,u=~~((s-l)/K);if(s>l+K){if(0===q.length){se(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const c=l+K*u;if(q.every((e=>e.left!==c))){const t=I(c),n=C(f.type,a);q.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:c,top:a}),se(e,[...e.prevPointer,c,a])}if(q.length<u&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+K*l,r=q.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=q.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=q[l-1]||{left:n,top:i},f=~~((r.left-(t-K))/K),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:I(t),value:C(o.type,s.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},q.splice(l,0,s),se(e,[a.left,a.top,s.left,s.top])}}l++}}(e,u),e.nextPoint){const t=G.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=K/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<s?re(e,"#999"):re(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(q.length>0&&i<q[q.length-1].left){for(const e of N)e.left>i&&(e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e));if(q=q.filter((e=>e.left<=i)),0===q.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of N)e.leftLine&&h.value.remove(e.leftLine),h.value.remove(e)}if(q.length>0){const t=m(q);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(L.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:I(e.left),value:C(t,e.top)}};if(h.value.discardActiveObject(),q.length>0){const l=J.find((e=>e.type===t));let r=-1;const s=q.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void fe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=s.findIndex((e=>e.time===n.time));o>-1?s[o].value=n.value:s.push({...m(s),time:n.time,value:n.value})}const a=l.dataList.findIndex((e=>e.key===n));x("add",{...v(o,["index","selfKey","lineAttr"]),dataIndex:a,key:n,data:s}),ae({...o,data:s,coincideIndex:r})}else x("change",{...v(o,["selfKey","lineAttr"]),key:n}),ae(o,"change")}}))}(d),null==(p=G.get(c.key))||p.push(d))}(de(l,n),l,u,e)})),Promise.all(G.get(e.key)).then((t=>{const n=f.filter((e=>e));Q(t),h.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||W.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function re(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function se(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,N.add(l),h.value.add(r,l)}))}function ae(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:s}=e;let{dataIndex:a}=e;const f=J.find((e=>e.type===r)),c=f.dataList.find(((e,t)=>(a=t,e.key===l)));switch(t){case"remove":c.list.splice(o,n),c.list[o-1]&&(c.list[o-1].breakpoint=!0);break;case"change":c.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=u(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,s>-1?s-t+1:0,...n);break}}fe({dataIndex:a,scaleValue:f})}function fe(e){var t,n,i;if(N.size&&(null==(t=h.value)||t.remove(...ue([...N]))),N.clear(),q=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=h.value)||n.remove(...ue(G.get(o.key))),G.delete(o.key),le(o,t,i)}else G.size&&(null==(i=h.value)||i.remove(...ue(me()))),G.clear(),te()}function ue(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function ce(e,t="moving"){const{title:n,type:i,data:o,unit:l,selfKey:r}=e.origin;L.point={x:e.left,y:e.top};const s=I(e.left),a=`${"hover"===t?o.value:C(i,e.top)}`;L.list=[`${n} ${a}${l||""}`,`时间 ${s.slice(-5)}`],L.sourceData=[{type:i,title:n,unit:l,key:r,time:s,value:a}],L.isTarget=!0,L.show=!0}function pe(e){e.setCoords();const t=6e4/O,n=e.prevPoint?e.prevPoint.left+t:j,i=T;e.top<X&&e.set("top",X),e.top>V&&e.set("top",V),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function de(e,t){if(c(e)&&function(e){const t=Date.parse(m(S.list)),n=p(e);return n>=D&&n<=t}(e.time)){const n=b(e.time),i=A(t.type,t.range,e.value);return[n,i<X?X:i>V?V:i]}}function me(){return g(Array.from(G.values()))}return e((()=>{Z()})),te(),function(){if(!Y.evented)return;let e=!1,i={x:0,y:0};h.value.on("mouse:up",(t=>{if(3===t.button&&function(e){L.show=!1;const{x:t=0,y:n=0}=e.pointer||{};if(t>=j&&t<=T&&n>=X&&n<=V)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);me().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&P.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===P.list.length&&(P.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{B(me(),t,"key",2*K).includes(n.linkKey||n.key)||P.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===P.list.length&&(P.show=!1,H("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(P,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=ne();t.length>0?ie((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ae(n[0],"remove",n.length),n.map((e=>({...v(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);x("remove",e)})):s.emit(R)}})),h.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),h.value.on("mouse:move",(o=>{if(function(e){if(!w||P.show)return;const{target:t,pointer:n}=e,{x:i=0,y:o=0}=n;L.movable=!1,(i<j||i>T)&&(L.show=!1);if(!t&&i>=j&&i<=T){const e=o>=X&&o<=V,l=o>=_&&o<=z;if(e||l){const l=I(i);L.sourceData=e?J.map((e=>{const{type:t,title:n,unit:i}=e;return{type:t,title:n,unit:i,time:l,value:C(t,o)}})):[{type:"tree",time:l}],L.isTarget=!!t,L.point=n,L.movable=!0}else L.show=!1}}(o),!e)return;const{x:l,y:r}=i,{x:s,y:a}=o.pointer;R&&h.value.remove(R),R=new t.Rect({...n,fill:"#CAF982",opacity:.4,...E,left:l,top:r,width:s-l,height:a-r,objectCaching:!0}),R.areaPos={startPos:i,endPos:o.pointer},h.value.add(R)}))}(),{redrawPoints:fe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(x("remove",n),ae(n,"remove")):(Object.assign(n,{data:{time:I(e.pointer.x),value:C(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),x("add",n),ae({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:pe,setPopup:ce,updateData:ae,getGridPoints:me,getContainPoints:ne,showDialog:ie,removeCurrentSelection:oe}}export{h as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,g,m,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(c,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:I,topGridYCellHeight:T}=u,H=new Map,W=l(E);function Y(){var o;if(!(null==(o=null==W?void 0:W.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=W;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:u={},data:f}=o;let h=null;f.forEach(((o,f)=>{const{time:g,value:m}=o,p=k(g);if(!$(p))return;const v=e(s,{...d,left:p,top:a}),x=p+v.width/2+2,y=i([x,a],{value:m,...u,originX:"left"}),X=new t.Group([v,y],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});Object.assign(X,{originLeft:p,iconHalfWidth:v.width/2,origin:{type:"other",key:n,dataIndex:r,index:f,data:o,title:l},limitX:{x1:C,x2:A-X.width}}),h&&(X.limitX.x1=h.left,h.limitX.x2=X.left,X.prevPoint=h,h.nextPoint=X),h=X,B(X),H.get(n).push(X),c.value.add(X)})),a+=j}))}function V(){var t;if(!(null==(t=null==W?void 0:W.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=W;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,d=k(s);if(!n||!$(d))return;const{lineHeight:c=j}=a;let u=L+r+c/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:d,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=c,B(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),g=d>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,g&&t.set("originX","right")}))})),c.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=W[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":Y();break;case"vertical":V();break;case"mark":q()}}function q(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});c.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),d=o.height;a+d<=l&&a>=M?(o.set("top",a+d/2),a+=d):(i||(a=M,i=!0),o.set("top",a-d/2),a-=d),s.push(o),B(o),c.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function B(t){if(I.hovered&&(t.on("mouseover",(()=>{D(t)})),t.on("mouseout",(()=>{h.show=!1}))),!I.evented)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(m(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),I.hovered&&D(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(g.point={x:t.left,y:t.top},g.show=!0,g.target=t,g.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function D(t){h.point={x:t.left,y:"mark"===t.origin.key?t.top:t.top+T/2};const e=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left;h.list=[`时间 ${y(e).slice(-5)}`],"mark"===t.origin.key&&h.list.unshift(t.origin.data.name+" "),h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==W?void 0:W.horizontal)?void 0:t.length))return;const{horizontal:i}=W,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),b(d)?D(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(d))if(X(H.get("horizontal"),d.left,"key",z).includes(d.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),Y(),V(),q(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return W.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{c as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as c}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function d(d,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:P,isGridLimit:b,getPointEventProps:w}=r(d,f,u),{other:E,yCellHeight:j,xCellWidth:z,endX:A,originX:C,originY:L,endY:M,markHeight:S,event:T,topGridYCellHeight:I}=u,H=new Map,Y=l(E);function W(){var o;if(!(null==(o=null==Y?void 0:Y.horizontal)?void 0:o.length))return;const n="horizontal";H.set(n,[]);const{horizontal:r}=Y;let a=L+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:d={},data:u}=o;let f=null;u.forEach(((o,u)=>{const{time:h,value:m}=o,g=k(h);if(!$(g))return;const p=e(s,{...c,left:g,top:a}),v=g+p.width/2+2,x=i([v,a],{value:m,...d,originX:"left"}),y=new t.Group([p,x],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer",...w()});Object.assign(y,{originLeft:g,iconHalfWidth:p.width/2,origin:{type:"other",key:n,dataIndex:r,index:u,data:o,title:l},limitX:{x1:C,x2:A-y.width}}),f&&(y.limitX.x1=f.left,f.limitX.x2=y.left,y.prevPoint=f,f.nextPoint=y),f=y,q(y),H.get(n).push(y)})),a+=j})),d.value.add(...H.get(n))}function V(){var t;if(!(null==(t=null==Y?void 0:Y.vertical)?void 0:t.length))return;const i="vertical";H.set(i,[]);const{vertical:o}=Y;o.forEach(((t,o)=>{const{show:n=!0,marginTop:r=0,textStyle:a={},data:l,time:s}=t,c=k(s);if(!n||!$(c))return;const{lineHeight:d=j}=a;let u=L+r+d/2;l.forEach(((t,n)=>{const r=e(String(t),{...a,lockMovementY:!0,left:c,originX:"left",top:u,origin:{type:"other",key:i,dataIndex:o,index:n,data:{value:t}},...w()});u+=d,q(r),H.get(i).push(r)}));const f=H.get(i).filter((t=>t.origin.dataIndex===o)),h=Math.max(...f.map((t=>t.width))),m=c>A-h;f.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=h,m&&t.set("originX","right")}))})),d.value.add(...H.get(i))}function G(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=Y[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}O(t)}function O(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...H.get(i)),H.delete(i),i){case"horizontal":W();break;case"vertical":V();break;case"mark":D()}}function D(){if(!(null==E?void 0:E.mark)||!S)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=E.mark,a=i([C-5,M+S/2],{value:t,...o,originX:"right"});d.value.add(a);const l=M+S,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!$(r))return;let a=M;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),c=o.height;a+c<=l&&a>=M?(o.set("top",a+c/2),a+=c):(i||(a=M,i=!0),o.set("top",a-c/2),a-=c),s.push(o),q(o),d.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:A};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(T.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),t.lockMovementX&&t.lockMovementY)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<L&&t.set("top",L);const e=M+S-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>A?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),T.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=c.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){const{key:e,data:i={}}=t.origin||{};let o=i.value;h.point={x:t.left,y:"mark"===e?t.top:t.top+I/2};const n=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left,r=y(n);h.list=[`时间 ${r.slice(-5)}`],"mark"===e&&(o=i.name,h.list.unshift(o+" ")),h.sourceData=[{type:"other",key:e,time:r,value:o}],h.isTarget=!0,h.show=!0}function $(t){return t>=C&&t<=A}return function(){var t;if(!(null==(t=null==Y?void 0:Y.horizontal)?void 0:t.length))return;const{horizontal:i}=Y,o=C-5;let n=L+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),b(c)?B(c):h.show=!1})),c.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&b(c))if(X(H.get("horizontal"),c.left,"key",z).includes(c.origin.key))P("repeat"),console.log("重复节点");else{const t={data:{time:y(c.left),value:c.origin.defaultAddValue},...c.origin};f("add",t),G(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),d.value.add(s),n+=j}))}(),W(),V(),D(),n.on((()=>{const t="horizontal",e=p(H.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return Y.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);O({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&G(o,i)}}}export{d as useOther};
@@ -2,7 +2,7 @@ import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
- export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
+ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
6
6
  propItems: any;
7
7
  redrawPoints: Ref<any>;
8
8
  select: Ref<any>;
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as f}from"./useCenter.js";import{useOther as g}from"./useOther.js";function y(y,w,x,b,j,C){const Y=l(),H=e(),S=e(),D=e(),A=t((()=>w.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=w.data.left.width)?e:0})),T=t((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=w.data;return e.mainYCell*e.subYCell})),G=t((()=>{const{treeData:e=[],show:t=!0}=w.data.top;return t?s(e):0})),V=t((()=>w.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=w.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(w.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const{show:e=!0}=w.data.top;if(!e)return[];const t=d(w.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=w.data.top.tree;return function e(t,n=0){t.forEach((t=>{var l;const o={top:a*i+P.value,left:n*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=s(t.children);o.height=r*i,e(t.children,n+1)}else o.width=M.value-o.left;Object.assign(t,o)}))}(t),t}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=w.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=w.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(w.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=w.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...o,...w.data.borderStyle},pointSelectionStyle:w.data.pointSelectionStyle||{},grid:w.data.grid,top:w.data.top,left:w.data.left,other:w.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:w.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return w.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=w.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n(),v(y,$,x,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=f(y,$,x,j,C);h(y,$,x,j,a,r,i,l);const{clickMenu:d}=g(y,$,x,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l,watch as o}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as s}from"date-fns";import{getChildrenSize as d}from"../../utils/index.js";import{cloneDeep as c,range as p,flatten as m}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as v}from"../../constants/index.js";import"@vueuse/core";import{useTop as h}from"./useTop.js";import{useLeft as f}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as y}from"./useOther.js";function w(w,x,b,j,C,Y,H){const S=n(),T=e(),D=e(),A=e();let M=null;const X=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),G=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),V=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),k=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),P=t((()=>{const{treeData:e=[],show:t=!0}=x.data.top;return t?d(e):0})),L=t((()=>x.data.top.tree.cellHeight)),N=t((()=>L.value*P.value)),O=t((()=>ie(ae("drug")||"top"))),E=t((()=>O.value+N.value)),W=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||s(new Date,"yyyy-MM-dd HH:mm:ss"))})),I=t((()=>{const e=c(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=p(V.value/t+1).map((r=>0===r?e.startTime:s(new Date(W.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:G.value}})),q=function(){const{show:e=!0}=x.data.top;if(!e)return[];const t=c(x.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=x.data.top.tree;return function e(t,l=0){t.forEach((t=>{var o;const n={top:a*i+O.value,left:l*r,width:r,height:i};if(a++,null==(o=t.children)?void 0:o.length){a--;const r=d(t.children);n.height=r*i,e(t.children,l+1)}else n.width=G.value-n.left;Object.assign(t,n)}))}(t),t}(),z=t((()=>ie(ae("xAxis")||"center"))),B=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),F=t((()=>ie(ae("intraoperatively")||"bottom"))),J=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),K=t((()=>F.value+(x.data.height-N.value-I.value.height-J.value))),Q=t((()=>(B.value-G.value)/V.value)),R=t((()=>(K.value-F.value)/k.value)),U=t((()=>I.value.spaceTimeStamp/Q.value)),Z=t((()=>{const{scaleValues:e}=x.data;return m(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),$=t((()=>le("pulse"))),_=t((()=>le("temperature"))),ee=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),te=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...u,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(P),topGridYCellHeight:r(L),topGridOriginY:r(O),topGridEndY:r(E),treeData:q,xAxis:r(I),originYXAxis:r(z),startTime:r(W),timeXCell:r(U),gridXNumber:r(V),gridYNumber:r(k),xCellWidth:r(Q),yCellHeight:r(R),originX:r(G),endX:r(B),originY:r(F),endY:r(K),markHeight:r(J),itemList:r(Z),scaleValues:x.data.scaleValues,pulseYCell:r($),temperatureYCell:r(_),event:r(ee),dialog:S});function ae(e){let t="";return Object.entries(X.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function re(e){const t=X.value[e],a=I.value.height;switch(t){case"drug":return N.value;case"xAxis":return a;default:return x.data.height-N.value-a}}function ie(e){switch(e){case"top":return 0;case"center":return re("top");default:return re("top")+re("center")}}function le(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return R.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),h(w,te,b,C);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:o,getContainPoints:n,showDialog:u,removeCurrentSelection:s}=g(w,te,b,C,Y,H);f(w,te,b,C,a,r,i,o);const{clickMenu:d}=y(w,te,b,C,Y,a,n,u,s);D.value=e,A.value=e=>{const{item:a}=e;a.type&&v.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),H&&o((()=>null==C?void 0:C.point),(()=>{C.movable?(C.show=!0,M&&clearTimeout(M),M=setTimeout((()=>{C.show=!1,C.movable=!1}),3e3)):M&&clearTimeout(M)}),{deep:!0}),{propItems:te,redrawPoints:D,select:T,clickMenu:A}}export{w as useSurgicalAnesthesiaChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{W(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&W(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function W(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=E(n,e,i);n&&(n.set(c),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:f};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,f],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.sourceData=[{type:"tree",startTime:r,endTime:s,value:l.value}],m.isTarget=!0,m.show=!0}s(f,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a,style:c,marginBottom:u}=S;if(!l)return;const d=[],m=X+(u?l-u:l/2),h=u?"bottom":"center";r.forEach(((t,i)=>{const n=s+i*L*a;d.push(e([n,m],{value:t.slice(11,16),originY:h,...c}))}));const v=d.length>0?new t.Group([...d],{...i,objectCaching:!1}):null;v&&f.value.add(v);const p=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});f.value.add(p);const{show:g=!0}=C;if(!g)return;const y=e([x+(w-x)/2,m],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});f.value.add(y)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=c(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!f});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&f.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&f.value.add(a),z.size&&f.value.add(...z)}()}export{f as useTop};
@@ -170,6 +170,9 @@ export declare type IPointTipProps = {
170
170
  show: boolean;
171
171
  point: ICoordinateValue;
172
172
  list: Array<string>;
173
+ movable: boolean;
174
+ sourceData: AnyObject[];
175
+ isTarget: boolean;
173
176
  };
174
177
  export declare type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
175
178
  list: Array<any>;
@@ -1 +1 @@
1
- .c-fabric-chart{position:relative;user-select:none}.c-fabric-chart-popup-menu,.c-fabric-chart-popup-tip{display:flex;flex-flow:column nowrap;font-size:12px;margin:0;padding:8px 12px;position:absolute;z-index:1001}.c-fabric-chart-popup-menu>li,.c-fabric-chart-popup-tip>li{list-style:none}.c-fabric-chart-popup-tip{background:rgba(0,0,0,.7);border-radius:4px}.c-fabric-chart-popup-tip>li{color:#fff}.c-fabric-chart-popup-menu{background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);padding:8px 5px!important;z-index:1001}.c-fabric-chart-popup-menu>li{background:#fff;cursor:pointer;padding:5px}.c-fabric-chart-popup-menu>li:hover{background:#f0f7ff}.c-fabric-chart-popup-menu>li.no-click{cursor:default}.c-fabric-chart-popup-menu>li.no-click:hover{background:#fff}
1
+ .c-fabric-chart{position:relative;user-select:none}.c-fabric-chart-popup{font-size:12px;margin:0;position:absolute;z-index:1001}.c-fabric-chart-popup li{list-style:none}.c-fabric-chart-popup__tip{color:#000}.c-fabric-chart-popup__tip .default-box{background:rgba(0,0,0,.7);border-radius:4px;display:flex;flex-flow:column nowrap;margin:0;padding:8px 12px}.c-fabric-chart-popup__tip .default-box>li{color:#fff}.c-fabric-chart-popup__menu{background:#fff;border:1px solid #e2e6ed;border-radius:2px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);display:flex;flex-flow:column nowrap;padding:8px 5px!important}.c-fabric-chart-popup__menu>li{background:#fff;cursor:pointer;padding:5px}.c-fabric-chart-popup__menu>li:hover{background:#f0f7ff}.c-fabric-chart-popup__menu>li.no-click{cursor:default}.c-fabric-chart-popup__menu>li.no-click:hover{background:#fff}
@@ -3212,6 +3212,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
3212
3212
  enable?: boolean | undefined;
3213
3213
  headerWidth?: number | "auto" | ((level: number) => number) | undefined;
3214
3214
  bodyWidth?: number | ((index: number) => number) | undefined;
3215
+ bodyMinWidth?: number | ((index: number) => number) | undefined;
3215
3216
  } | undefined;
3216
3217
  onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
3217
3218
  onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
@@ -6776,6 +6777,7 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
6776
6777
  enable?: boolean | undefined;
6777
6778
  headerWidth?: number | "auto" | ((level: number) => number) | undefined;
6778
6779
  bodyWidth?: number | ((index: number) => number) | undefined;
6780
+ bodyMinWidth?: number | ((index: number) => number) | undefined;
6779
6781
  } | undefined;
6780
6782
  onFormChange?: ((payload_0: import("../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
6781
6783
  onSettingClick?: (() => void) | undefined;
@@ -3213,6 +3213,7 @@ declare const _default: import("vue").DefineComponent<{
3213
3213
  enable?: boolean | undefined;
3214
3214
  headerWidth?: number | "auto" | ((level: number) => number) | undefined;
3215
3215
  bodyWidth?: number | ((index: number) => number) | undefined;
3216
+ bodyMinWidth?: number | ((index: number) => number) | undefined;
3216
3217
  } | undefined;
3217
3218
  onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
3218
3219
  onCopy?: ((params: import("vxe-table").VxeTableDefines.CopyEventParams) => void) | undefined;
@@ -6777,6 +6778,7 @@ declare const _default: import("vue").DefineComponent<{
6777
6778
  enable?: boolean | undefined;
6778
6779
  headerWidth?: number | "auto" | ((level: number) => number) | undefined;
6779
6780
  bodyWidth?: number | ((index: number) => number) | undefined;
6781
+ bodyMinWidth?: number | ((index: number) => number) | undefined;
6780
6782
  } | undefined;
6781
6783
  onFormChange?: ((payload_0: import("../../../components/iho-table/src/types").IhoTableFormChangePayload) => void) | undefined;
6782
6784
  onSettingClick?: (() => void) | undefined;
@@ -1 +1 @@
1
- import{arrayed as o}from"../../../../../shared/utils/index.js";import{cloneDeep as e,isArray as r}from"lodash-es";import{unref as t,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i}from"../../utils/index.js";import{useConfigHooks as a}from"./useConfigHooks.js";import{useDataHooks as f}from"./useDataHooks.js";import{useDomInsertHooks as l}from"./useDomInsertHooks.js";import{useEventHooks as c}from"./useEventHooks.js";import{useExposeHooks as u}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as m}from"./useSetupHooks.js";const p=(()=>{let o=null;return()=>o||(o=Object.freeze({configHooks:a().create(),fieldHooks:d().create(),eventHooks:c().create(),dataHooks:f().create(),setupHooks:m().create(),domInsertHooks:l().create(),exposeHooks:u().create()}))})();function k(o,r,t){const s=o.configHooks.config.call(e(r),t);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((e=>{s[e]=o.configHooks[e].call(s[e],s,t)})),s}function H(t,s,n,i){t.fieldHooks.fieldStart.promise(n,i);let a=function e(s){return s.reduce(((s,a,f)=>{const l=[],c=[];let u=!1;return a=t.fieldHooks.field.call(a,{index:f,remove(){u=!0},insertAfter(e){c.push(...o(e))},insertBefore(e){l.push(...o(e))}},n,i),s.push(...l),u||(s.push(a),r(a.children)&&(a.children=e(a.children))),s.push(...c),s}),[])}(e(s));return a=t.fieldHooks.fieldList.call(a,n,i),t.fieldHooks.fieldEnd.promise(n,i),a}function g({hooks:o,config:e,$table:r,emits:s,context:a,globProps:f}){return n.reduce(((n,l)=>(n[l]=n=>function(n,l){var c;const u=i(n);if(!(l=o.eventHooks.beforeEvent.call(l,t(e),{$table:t(r),emits:s,globProps:f,...a},u)))return;Reflect.get(l,"eventName")?s(l.eventName,l):s(u,l);null==(c=o.eventHooks[n])||c.promise(l,t(e),{$table:t(r),globProps:f,emits:s,...a})}(l,n),n)),{})}function h(e,r,s){return async n=>{e.dataHooks.dataStart.promise(t(r));let i=await n.reduce((async(n,i,a)=>{const f=[],l=[];let c=!1;await e.dataHooks.data.promise(i,t(r),{index:a,$table:s,insertBefore(e){f.push(...o(e))},insertAfter(e){l.push(...o(e))},remove(){c=!0}});const u=await n;return u.push(...f),!c&&u.push(i),u.push(...l),u}),Promise.resolve([]));return i=e.dataHooks.dataList.call(i,t(r)),e.dataHooks.dataEnd.promise(t(r)),i}}function C(o){return{header:s({name:"IhoTableHeader",render:()=>o.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>o.domInsertHooks.footer.call([])})}}export{k as applyTableConfigHooks,H as applyTableFieldHooks,h as createDataTransfer,C as createDomInsertComponent,g as createTableEventHandlers,p as createTableHooks};
1
+ import{arrayed as e}from"../../../../../shared/utils/index.js";import{cloneDeep as o,isArray as t}from"lodash-es";import{unref as r,defineComponent as s}from"vue";import{VxeEventListenerNameList as n}from"../../constants/index.js";import{eventListener2EventName as i,eventName2EventListener as a}from"../../utils/index.js";import{useConfigHooks as f}from"./useConfigHooks.js";import{useDataHooks as l}from"./useDataHooks.js";import{useDomInsertHooks as c}from"./useDomInsertHooks.js";import{useEventHooks as u}from"./useEventHooks.js";import{useExposeHooks as m}from"./useExposeHooks.js";import{useFieldHooks as d}from"./useFieldHooks.js";import{useSetupHooks as p}from"./useSetupHooks.js";const k=(()=>{let e=null;return()=>e||(e=Object.freeze({configHooks:f().create(),fieldHooks:d().create(),eventHooks:u().create(),dataHooks:l().create(),setupHooks:p().create(),domInsertHooks:c().create(),exposeHooks:m().create()}))})();function H(e,t,r){const s=e.configHooks.config.call(o(t),r);return["rowConfig","editConfig","columnConfig","resizableConfig","seqConfig","sortConfig","filterConfig","radioConfig","checkboxConfig","expandConfig","treeConfig","mouseConfig","menuConfig","keyboardConfig","scrollY","scrollX","editRules"].forEach((o=>{s[o]=e.configHooks[o].call(s[o],s,r)})),s}function g(r,s,n,i){r.fieldHooks.fieldStart.promise(n,i);let a=function o(s){return s.reduce(((s,a,f)=>{const l=[],c=[];let u=!1;return a=r.fieldHooks.field.call(a,{index:f,remove(){u=!0},insertAfter(o){c.push(...e(o))},insertBefore(o){l.push(...e(o))}},n,i),s.push(...l),u||(s.push(a),t(a.children)&&(a.children=o(a.children))),s.push(...c),s}),[])}(o(s));return a=r.fieldHooks.fieldList.call(a,n,i),r.fieldHooks.fieldEnd.promise(n,i),a}function h({hooks:e,config:o,$table:t,emits:s,context:f,globProps:l}){return n.reduce(((n,c)=>(n[c]=n=>function(n,c){var u;const m=i(n);if(!(c=e.eventHooks.beforeEvent.call(c,r(o),{$table:r(t),emits:s,globProps:l,...f},m)))return;Reflect.get(c,"eventName")?(s(c.eventName,c),n=a(c.eventName)):s(m,c);null==(u=e.eventHooks[n])||u.promise(c,r(o),{$table:r(t),globProps:l,emits:s,...f})}(c,n),n)),{})}function C(o,t,s){return async n=>{o.dataHooks.dataStart.promise(r(t));let i=await n.reduce((async(n,i,a)=>{const f=[],l=[];let c=!1;await o.dataHooks.data.promise(i,r(t),{index:a,$table:s,insertBefore(o){f.push(...e(o))},insertAfter(o){l.push(...e(o))},remove(){c=!0}});const u=await n;return u.push(...f),!c&&u.push(i),u.push(...l),u}),Promise.resolve([]));return i=o.dataHooks.dataList.call(i,r(t)),o.dataHooks.dataEnd.promise(r(t)),i}}function b(e){return{header:s({name:"IhoTableHeader",render:()=>e.domInsertHooks.header.call([])}),footer:s({name:"IhoTableFooter",render:()=>e.domInsertHooks.footer.call([])})}}export{H as applyTableConfigHooks,g as applyTableFieldHooks,C as createDataTransfer,b as createDomInsertComponent,h as createTableEventHandlers,k as createTableHooks};
@@ -1 +1 @@
1
- import{reactive as e,inject as o,createVNode as n,mergeProps as t,onBeforeUnmount as l}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as s}from"../../../../constants/index.js";import{useAutoFocus as u}from"../hooks/useAutoFocus.js";import{getTitle as d,IhoTableRenderHelper as a,IhoTableUtils as c}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as f,isConnectField as m,getArray as v}from"./selectUtils.js";import{getSelectOptions as w,selectOptionsMap as g}from"../hooks/useSelectOption.js";import{cloneDeep as h,isFunction as y,isEqual as b}from"lodash-es";import{defineTablePlugin as C}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",E=e(new Map);function k(e){return!0===e||"1"===e}return C({name:x,vxe(e){e.renderer.add(r.SELECT,{renderCell({props:e},{row:t,column:l,$table:r}){var u;const a=o(s),c=w(a,l.field,t,r),p=f(t,e,c),m=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(u=e.componentProps)?void 0:u.indexedText));return[n("span",{title:d(l,m),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",n("br",null,null)]),e)),[]):m])]},renderEdit:a.createRenderEdit((({fieldItem:e,emitFormClick:l,row:i,column:r,$rowIndex:u,$table:d})=>{var a,c,f,m;const v=o(s),g=w(v,r.field,i,d),h=k(null!=(c=null==(a=e.componentProps)?void 0:a.allowModify)?c:e.allowModify),y=k(null!=(m=null==(f=e.componentProps)?void 0:f.allowCreate)?m:e.allowCreate)||h;return[n(p,t({queryOptions:e.queryOptions},e.componentProps,{options:g,column:r,row:i,"row-index":u,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:h,allowCreate:y,onClick:l}),null)]}))})},apply(e){async function o(e,o={}){var n,t,l;const i=null==(n=e.editRender)?void 0:n.props;if(!i)return[];let r=v(i.options)||v(null==(t=i.componentProps)?void 0:t.options)||[];if(i.queryOptions)try{const n={column:e,isFullData:!0,...o};r=await(null==(l=i.queryOptions)?void 0:l.call(i,n))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function n(e){return e&&c.getCellType(e)===r.SELECT}u(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(x,((e,{uuid:t})=>{if(t){g.get(t)||g.set(t,{}),E.set(t,h(e));const l=g.get(t);e.forEach((async t=>{var i;const r=null==(i=t.editRender)?void 0:i.props;if(t.field&&r&&n(r)&&!m(e,t.field)){if(y(r.queryOptions)&&l[t.field])return;l[t.field]=[],l[t.field]=await o(t)}}))}return e})),e.dataHooks.data.tap(x,((e,{uuid:t},l)=>{if(!t)return;const i=E.get(t);if(!i||!i.length)return;const r=g.get(t);i.forEach((async t=>{var l;const s=null==(l=t.editRender)?void 0:l.props;if(t.field&&s&&n(s)&&(null==s?void 0:s.connectField)){const n=s.connectField.split(","),l=e[s.columnName];n.forEach((async n=>{const u=null==i?void 0:i.find((e=>e.field===n));if(!u)return;const d=l?`${n}__${s.columnName}-${l}`:n;r[d]||(r[d]=[],r[d]=await o(u,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(x,(e=>{l((()=>{var o;const n=null==(o=e.value)?void 0:o.uuid;n&&(g.delete(n),E.delete(n))}))})),e.eventHooks.onCellDblclick.tap(x,(({$table:e},o,{emits:t})=>{var l;const{column:i,row:r}=e.reactData.editStore.actived;if(!i||!r)return;const s=null==(l=i.editRender)?void 0:l.props,{cellDblclickSelectable:u=!1,multiple:d=!1,valueField:a="value"}=s.componentProps||{};if(!u||!n(s))return;const c=o.uuid&&w(o.uuid,i.field,r,e);if(1!==(null==c?void 0:c.length))return;const p=d?[c[0][a]]:c[0][a],f=r[i.field];e.clearEdit(),b(p,f)||(r[i.field]=p,t("formChange",{column:i,row:r,oldValue:f,value:p,index:e.getRowIndex(r),$table:e,option:c[0]}))}))}})}export{x as selectRendererPlugin};
1
+ import{reactive as e,inject as o,createVNode as l,mergeProps as t,onBeforeUnmount as n}from"vue";import{arrayed as i}from"../../../../../../../shared/utils/index.js";import"../../../../../index.js";import{EDITABLE_WIDGET_TYPE as r,InjectionIhoTableUUID as u}from"../../../../constants/index.js";import{useAutoFocus as s}from"../hooks/useAutoFocus.js";import{getTitle as d,IhoTableRenderHelper as c,IhoTableUtils as a}from"../../../../utils/index.js";import p from"./editSelect.js";import{getDefaultValue as f,isConnectField as m,getArray as v}from"./selectUtils.js";import{getSelectOptions as w,selectOptionsMap as C}from"../hooks/useSelectOption.js";import{cloneDeep as g,isFunction as h,isEqual as y}from"lodash-es";import{defineTablePlugin as b}from"../../../../hooks/useTablePlugin.js";function x(){const x="selectRendererPlugin",E=e(new Map);function k(e){return!0===e||"1"===e}return b({name:x,vxe(e){e.renderer.add(r.SELECT,{renderCell({props:e},{row:t,column:n,$table:r}){var s;const c=o(u),a=w(c,n.field,t,r),p=f(t,e,a),m=i(p).join(","),v=e&&(k(e.variableHeight)||(null==(s=e.componentProps)?void 0:s.indexedText));return[l("span",{title:d(n,m),class:"iho-table__colorAndIcon"},[v?i(p).reduce(((e,o)=>(null!=o&&e.push([o,";",l("br",null,null)]),e)),[]):m])]},renderEdit:c.createRenderEdit((({fieldItem:e,emitFormClick:n,row:i,column:r,$rowIndex:s,$table:d})=>{var c,a,f,m;const v=o(u),C=w(v,r.field,i,d),g=k(null!=(a=null==(c=e.componentProps)?void 0:c.allowModify)?a:e.allowModify),h=k(null!=(m=null==(f=e.componentProps)?void 0:f.allowCreate)?m:e.allowCreate)||g;return[l(p,t({queryOptions:e.queryOptions},e.componentProps,{options:C,column:r,row:i,"row-index":s,value:i[r.field],"onUpdate:value":e=>i[r.field]=e,allowModify:g,allowCreate:h,onClick:n}),null)]}))})},apply(e){async function o(e,o={}){var l,t,n;const i=null==(l=e.editRender)?void 0:l.props;if(!i)return[];let r=v(i.options)||v(null==(t=i.componentProps)?void 0:t.options)||[];if(i.queryOptions)try{const l={column:e,isFullData:!0,...o};r=await(null==(n=i.queryOptions)?void 0:n.call(i,l))}catch(e){console.log(`获取${i.field}_options错误`)}return r}function l(e){return e&&a.getCellType(e)===r.SELECT}s(e).bindAutoFocusConfig(x,r.SELECT,".n-base-selection-input,.n-base-selection-tags"),e.fieldHooks.fieldList.tap(x,((e,{uuid:t})=>{if(t){C.get(t)||C.set(t,{}),E.set(t,g(e));const n=C.get(t);e.forEach((async t=>{var i;const r=null==(i=t.editRender)?void 0:i.props;if(t.field&&r&&l(r)&&!m(e,t.field)){if(h(r.queryOptions)&&n[t.field])return;n[t.field]=[],n[t.field]=await o(t)}}))}return e})),e.dataHooks.data.tap(x,((e,{uuid:t},n)=>{if(!t)return;const i=E.get(t);if(!i||!i.length)return;const r=C.get(t);i.forEach((async t=>{var n;const u=null==(n=t.editRender)?void 0:n.props;if(t.field&&u&&l(u)&&(null==u?void 0:u.connectField)){const l=u.connectField.split(","),n=e[u.columnName];l.forEach((async l=>{const s=null==i?void 0:i.find((e=>e.field===l));if(!s)return;const d=n?`${l}__${u.columnName}-${n}`:l;r[d]||(r[d]=[],r[d]=await o(s,{row:e,connectColumn:t}))}))}}))})),e.setupHooks.setup.tap(x,(e=>{n((()=>{var o;const l=null==(o=e.value)?void 0:o.uuid;l&&(C.delete(l),E.delete(l))}))})),e.eventHooks.onCellDblclick.tap(x,((e,o,{emits:t})=>{var n,i,r;const{$table:u,row:s,column:d}=e,c=Reflect.get(e,"verticalState");let{column:a,row:p}=u.reactData.editStore.actived;if(!(a&&p||(c&&(a=null==(n=c.editCell)?void 0:n.column,p=null==(i=c.editCell)?void 0:i.row),a&&p)))return;c&&(a=d,p=s);const f=null==(r=a.editRender)?void 0:r.props,{cellDblclickSelectable:m=!1,multiple:v=!1,valueField:C="value"}=f.componentProps||{};if(!m||!l(f))return;const g=o.uuid&&w(o.uuid,a.field,p,u);if(1!==(null==g?void 0:g.length))return;const h=v?[g[0][C]]:g[0][C],b=p[a.field];u.clearEdit(),y(h,b)||(p[a.field]=h,t("formChange",{column:a,row:p,oldValue:b,value:h,index:u.getRowIndex(p),$table:u,option:g[0]}),c&&(c.editCell=null))}))}})}export{x as selectRendererPlugin};
@@ -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 l}from"../../constants/index.js";import{createVerticalTableHooks as t,usePresetVerticalPlugins as n}from"./src/hooks/index.js";import{useUUIDMap as i}from"../../utils/index.js";import{VERTICAL_CELL_TYPE as s}from"./src/constants.js";import{createCellRender as a,createHeaderCellRender as c}from"./src/renderer.js";import{isVerticalTable as d,getSpanInfo as u}from"./src/utils.js";import{defineTablePlugin as m}from"../../hooks/useTablePlugin.js";function f(){const f="verticalTablePlugin",{getItemFromUUID:p,removeItemFromUUID:C}=i((()=>({})));return m({name:f,vxe(e){e.renderer.add(s,{renderCell:a(e,p,"default"),renderEdit:a(e,p,"edit"),renderHeader:c(e,p)})},apply(i){const s=t();n(s,i,p),i.configHooks.config.tap({name:f,stage:l},(r=>{if(!r.uuid||!d(r))return r;const o=p(r.uuid);function l(e){s.onCellClick.call(e,o)}function t(e){var r;return e.row||null==e.$rowIndex||(e.row=null==(r=o.fixedLeftVerticalData)?void 0:r[e.$rowIndex]),s.cellStyle.call({},e,o)}function n(e){return s.cellClassName.call({},e,o)}o.originalTableConfig=r;const i={...e(r,["uuid","border","height","verticalConfig","showSeq","size","rowGroupSetting","keyboardConfig","selectType","editConfig"]),cellClassName:n,headerCellClassName:n,cellStyle:t,headerCellStyle:t,headerRowStyle:e=>s.headerRowStyle.call({background:"white"},e,o),spanMethod:u,onCellClick:l,onHeaderCellClick:l};return s.config.call(i,o)})),i.setupHooks.setup.tap(f,(e=>{r((()=>C(o(e).uuid)))}))}})}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 s}from"./src/constants.js";import{createCellRender as a,createHeaderCellRender as d}from"./src/renderer.js";import{isVerticalTable as c,getSpanInfo as m}from"./src/utils.js";import{defineTablePlugin as u}from"../../hooks/useTablePlugin.js";function f(){const f="verticalTablePlugin",{getItemFromUUID:p,removeItemFromUUID:g}=n((()=>({})));return u({name:f,vxe(e){e.renderer.add(s,{renderCell:a(e,p,"default"),renderEdit:a(e,p,"edit"),renderHeader:d(e,p)})},apply(n){const s=l();i(s,n,p),n.configHooks.config.tap({name:f,stage:t},(r=>{if(!r.uuid||!c(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]),s.cellStyle.call({},e,o)}function l(e){return s.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=>s.headerRowStyle.call({background:"white"},e,o),spanMethod:m};return s.config.call(i,o)})),n.setupHooks.setup.tap(f,(e=>{r((()=>g(o(e).uuid)))}))}})}export{f as verticalTablePlugin};
@@ -1,5 +1,5 @@
1
1
  import { AnyObject } from '../../../../../../../shared/types';
2
- import { SyncHook, SyncWaterfallHook } from '../../../../../../../shared/utils/tapable';
2
+ import { SyncWaterfallHook } from '../../../../../../../shared/utils/tapable';
3
3
  import { CSSProperties } from 'vue';
4
4
  import { VxeTableDefines } from 'vxe-table';
5
5
  import { VxeColumnPropTypes } from 'vxe-table/types/column';
@@ -7,29 +7,6 @@ import { VxeTableConstructor, VxeTablePrivateMethods } from 'vxe-table/types/tab
7
7
  import { IhoTableConfig, TableHooks } from '../../../../../../../components/iho-table';
8
8
  import { IhoTableVerticalState } from '../types';
9
9
  export declare const createVerticalTableHooks: () => {
10
- onCellClick: SyncHook<[{
11
- $rowIndex: number;
12
- row?: AnyObject | undefined;
13
- $columnIndex: number;
14
- column: VxeTableDefines.ColumnInfo;
15
- }, Partial<{
16
- originalTableConfig: IhoTableConfig;
17
- originalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
18
- originalData: AnyObject[];
19
- verticalFieldList: import("../../../../../../../components/iho-table").IhoTableFieldItem[];
20
- fullVerticalOriginData: AnyObject[];
21
- verticalData: AnyObject[];
22
- fixedLeftVerticalData: AnyObject[];
23
- headerDepth: number;
24
- currentRow: AnyObject | null;
25
- editCell: {
26
- row: AnyObject;
27
- column: import("../../../../../../../components/iho-table").IhoTableFieldItem;
28
- } | null;
29
- editStateEvent: (event: MouseEvent) => void;
30
- hoveringRow: AnyObject | null;
31
- hoveringFieldKey: string | null;
32
- }>], void, import("../../../../../../../shared/utils/tapable").UnsetAdditionalOptions>;
33
10
  cellStyle: SyncWaterfallHook<[CSSProperties, {
34
11
  column: VxeTableDefines.ColumnInfo;
35
12
  row?: AnyObject | undefined;
@@ -1 +1 @@
1
- import e from"../../../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../../../shared/utils/tapable/SyncBailHook.js";import o from"../../../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useExpose as s}from"./useExpose.js";import{useColumn2Data as a}from"./useColumn2Data.js";import{useCurrentColumn as t}from"./useCurrentColumn.js";import{useData2Column as r}from"./useData2Column.js";import{useEditCell as l}from"./useEditCell.js";import{useEventConvert as i}from"./useEventConvert.js";import{useHeaderCSS as p}from"./useHeaderCSS.js";import{useHoverColumn as m}from"./useHoverColumn.js";import{useTriggerRow as n}from"./useTriggerRow.js";const u=()=>({onCellClick:new e(["payload","verticalState"]),cellStyle:new o(["styles","payload","verticalState"]),cellClassName:new o(["classes","payload","verticalState"]),config:new o(["config","verticalState"]),headerRowStyle:new o(["styles","payload","verticalState"])}),c=(e,o,u)=>{t(e,o,u),l(e,o,u),m(e,o,u),p(e),n(e),i(e,o,u),r(e,o,u),a(e,o,u),s(e,o)};export{u as createVerticalTableHooks,c as usePresetVerticalPlugins};
1
+ import"../../../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../../../shared/utils/tapable/SyncBailHook.js";import e from"../../../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{useExpose as o}from"./useExpose.js";import{useColumn2Data as s}from"./useColumn2Data.js";import{useCurrentColumn as t}from"./useCurrentColumn.js";import{useData2Column as a}from"./useData2Column.js";import{useEditCell as r}from"./useEditCell.js";import{useEventConvert as l}from"./useEventConvert.js";import{useHeaderCSS as i}from"./useHeaderCSS.js";import{useHoverColumn as p}from"./useHoverColumn.js";import{useTriggerRow as m}from"./useTriggerRow.js";const n=()=>({cellStyle:new e(["styles","payload","verticalState"]),cellClassName:new e(["classes","payload","verticalState"]),config:new e(["config","verticalState"]),headerRowStyle:new e(["styles","payload","verticalState"])}),u=(e,n,u)=>{t(e,n,u),r(e,n,u),p(e,n,u),i(e),m(e,n,u),l(e,n,u),a(e,n,u),s(e,n,u),o(e,n)};export{n as createVerticalTableHooks,u as usePresetVerticalPlugins};
@@ -1 +1 @@
1
- import{unref as r}from"vue";import{isVerticalHeader as e,createVerticalStateHandler as o}from"../utils.js";const n=(n,t,l)=>{n.onCellClick.tap("useCurrentColumn",(({row:r},e)=>{if(!r)return;const n=o(e);n.getTableConfig("rowConfig.isCurrent")&&(e.currentRow=!1!==n.getTableConfig("rowConfig.clickToCancel")&&e.currentRow===r?null:r)})),n.cellStyle.tap("useCurrentColumn",((r,{column:n},t)=>{if(e(n.field))return r;const l=o(t);if(!l.getTableConfig("rowConfig.isCurrent"))return r;return l.getOriginDataByColumn(n)!==t.currentRow?r:Object.assign(r,{backgroundColor:"var(--c-primary-color-opacity2)"})})),t.exposeHooks.expose.tap("VerticalTable-useCurrentColumn",((e,o)=>Object.assign(e,{verticalTable:{...e.verticalTable,getCurrentRow:()=>{var e;const n=null==(e=r(o))?void 0:e.uuid;return n?l(n).currentRow:null}}})))};export{n as useCurrentColumn};
1
+ import{unref as r}from"vue";import{isVerticalTable as e,isVerticalHeader as o,createVerticalStateHandler as n}from"../utils.js";const t=(t,u,l)=>{u.eventHooks.onCellClick.tap("useCurrentColumn",(({row:r},o)=>{const{uuid:t}=o;if(!t||!e(o))return;const u=l(t);if(!u||!r)return;const i=n(u);i.getTableConfig("rowConfig.isCurrent")&&(u.currentRow=!1!==i.getTableConfig("rowConfig.clickToCancel")&&u.currentRow===r?null:r)})),t.cellStyle.tap("useCurrentColumn",((r,{column:e},t)=>{if(o(e.field))return r;const u=n(t);if(!u.getTableConfig("rowConfig.isCurrent"))return r;return u.getOriginDataByColumn(e)!==t.currentRow?r:Object.assign(r,{backgroundColor:"var(--c-primary-color-opacity2)"})})),u.exposeHooks.expose.tap("VerticalTable-useCurrentColumn",((e,o)=>Object.assign(e,{verticalTable:{...e.verticalTable,getCurrentRow:()=>{var e;const n=null==(e=r(o))?void 0:e.uuid;return n?l(n).currentRow:null}}})))};export{t as useCurrentColumn};
@@ -1 +1 @@
1
- import{findAncestor as t}from"../../../../../../../shared/utils/index.js";import{onBeforeUnmount as e,unref as i}from"vue";import{WIDGET_TYPE as n}from"../../../../constants/index.js";import{isVerticalHeader as l}from"../utils.js";const o=["RADIO","SWITCH"],d=(d,r,u)=>{d.onCellClick.tap("useEditCell",(({column:t,row:e,$columnIndex:i},n)=>{var l,o;n.editCell=e&&i<=(null!=(o=null==(l=n.fixedLeftVerticalData)?void 0:l.length)?o:0)?{row:e,column:t}:null})),d.config.tap("useEditCell",((e,i)=>(e.uuid&&(i.editStateEvent&&window.removeEventListener("click",i.editStateEvent,{capture:!0}),i.editStateEvent=n=>{t(n.target,(t=>t.getAttribute("uuid")===e.uuid||t.classList.contains("vxe-table--ignore-clear")))||(i.editCell=null)},window.addEventListener("click",i.editStateEvent,{capture:!0})),e.editConfig={...e.editConfig,showIcon:!1,beforeEditMethod({row:t,column:e}){var i;const{originalField:d={}}=t;if(l(e.field))return!1;const{editRender:{name:r=n.DEFAULT}={}}=d;return!Object.values(n).concat(o).includes(r)&&(!(null==(i=d.slots)?void 0:i.default)||!!d.slots.edit)}},e))),r.setupHooks.setup.tap("Vertical-UseEditCell",(t=>{e((()=>{const{uuid:e}=i(t)||{};if(!e)return;const n=u(e);n.editStateEvent&&window.removeEventListener("click",n.editStateEvent,{capture:!0})}))}))};export{d as useEditCell};
1
+ import{findAncestor as e}from"../../../../../../../shared/utils/index.js";import{onBeforeUnmount as t,unref as i}from"vue";import{WIDGET_TYPE as n}from"../../../../constants/index.js";import{isVerticalTable as o,isVerticalHeader as l}from"../utils.js";const d=["RADIO","SWITCH"],r=(r,u,s)=>{u.eventHooks.onCellClick.tap("useEditCell",(({column:e,row:t,$columnIndex:i},n)=>{var l,d;const{uuid:r}=n;if(!r||!o(n))return;const u=s(r);u&&e.editRender&&(u.editCell=t&&i<=(null!=(d=null==(l=u.fixedLeftVerticalData)?void 0:l.length)?d:0)?{row:t,column:e}:null)})),r.config.tap("useEditCell",((t,i)=>(t.uuid&&(i.editStateEvent&&window.removeEventListener("click",i.editStateEvent,{capture:!0}),i.editStateEvent=n=>{e(n.target,(e=>e.getAttribute("uuid")===t.uuid||e.classList.contains("vxe-table--ignore-clear")))||(i.editCell=null)},window.addEventListener("click",i.editStateEvent,{capture:!0})),t.editConfig={...t.editConfig,showIcon:!1,beforeEditMethod({row:e,column:t}){var i;const{originalField:o={}}=e;if(l(t.field))return!1;const{editRender:{name:r=n.DEFAULT}={}}=o;return!Object.values(n).concat(d).includes(r)&&(!(null==(i=o.slots)?void 0:i.default)||!!o.slots.edit)}},t))),u.setupHooks.setup.tap("Vertical-UseEditCell",(e=>{t((()=>{const{uuid:t}=i(e)||{};if(!t)return;const n=s(t);n.editStateEvent&&window.removeEventListener("click",n.editStateEvent,{capture:!0})}))}))};export{r as useEditCell};
@@ -1 +1 @@
1
- import{isObject as e}from"lodash-es";import{unref as l}from"vue";import{isVerticalTable as o,isVerticalHeader as n,getHeaderDepthByField as r,getOriginFieldFromRowData as t,getOriginRowFromRowData as d}from"../utils.js";const c=(c,i,a)=>{i.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((c,i,u,m)=>{var x,v;if(!e(c))return c;const I=null==(x=l(i))?void 0:x.uuid;if(!I||!o(i))return c;const f=c,{$table:s,$event:h,cell:p}=f;let{$columnIndex:w,$rowIndex:$,column:C,columnIndex:y,row:b,rowIndex:k,type:_,_rowIndex:g,_columnIndex:E}=f;if(C&&(_=n(C.field)?"header":"body","headerCellClick"===m&&"body"===_?m="cellClick":"cellClick"===m&&"header"===_&&(m="headerCellClick"),b)){const e=r(C.field);C=t(b),b="header"===_?void 0:d(b,e),E=y=w="header"===f.type?$||0:((null==(v=a(I).fixedLeftVerticalData)?void 0:v.length)||0)+($||0),g=k=$="header"===_?-1:e}return{_originalPayload:f,$table:s,$event:h,cell:p,type:_,row:b,column:C,rowIndex:k,columnIndex:y,$rowIndex:$,$columnIndex:w,_rowIndex:g,_columnIndex:E,eventName:m}}))};export{c as useEventConvert};
1
+ import{isObject as e}from"lodash-es";import{unref as l}from"vue";import{isVerticalTable as o,isVerticalHeader as n,getHeaderDepthByField as r,getOriginFieldFromRowData as d,getOriginRowFromRowData as t}from"../utils.js";const c=(c,i,a)=>{i.eventHooks.beforeEvent.tap("Vertical--useEventConvert",((c,i,u,m)=>{var x,v;if(!e(c))return c;const h=null==(x=l(i))?void 0:x.uuid;if(!h||!o(i))return c;const I=c,{$table:f,$event:b,cell:s}=I;let{$columnIndex:k,$rowIndex:C,column:p,columnIndex:w,row:$,rowIndex:y,type:D,_rowIndex:_,_columnIndex:g}=I;if(p&&(D=n(p.field)?"header":"body","headerCellClick"===m&&"body"===D?m="cellClick":"cellClick"===m&&"header"===D&&(m="headerCellClick"),"headerCellDblclick"===m&&"body"===D?m="cellDblclick":"cellDblclick"===m&&"header"===D&&(m="headerCellDblclick"),$)){const e=r(p.field);p=d($),$="header"===D?void 0:t($,e),g=w=k="header"===I.type?C||0:((null==(v=a(h).fixedLeftVerticalData)?void 0:v.length)||0)+(C||0),_=y=C="header"===D?-1:e}return{_originalPayload:I,$table:f,$event:b,cell:s,type:D,row:$,column:p,rowIndex:y,columnIndex:w,$rowIndex:C,$columnIndex:k,_rowIndex:_,_columnIndex:g,eventName:m,verticalState:a(h)}}))};export{c as useEventConvert};
@@ -1 +1 @@
1
- import{createVerticalStateHandler as o}from"../utils.js";const e=e=>{e.onCellClick.tap("useTriggerRow",(({row:e},r)=>{if(!e)return;const i=o(r);if("row"===i.getTableConfig("checkboxConfig.trigger")){const o=i.getTableConfig("checkboxConfig.checkField")||"checked";e[o]=!e[o]}"row"===i.getTableConfig("radioConfig.trigger")&&(r.currentRow=e)}))};export{e as useTriggerRow};
1
+ import{isVerticalTable as e,createVerticalStateHandler as o}from"../utils.js";const r=(r,i,t)=>{i.eventHooks.onCellClick.tap("useTriggerRow",((r,i,{emits:c})=>{var n,g;const{uuid:l}=i;if(!l||!e(i))return;const{row:f}=r,s=t(l);if(!s||!f)return;const a=o(s);if("row"===a.getTableConfig("checkboxConfig.trigger")){const e=a.getTableConfig("checkboxConfig.checkField")||"checked";f[e]=!f[e],c("checkboxChange",{...r,checked:f[e],records:null!=(g=null==(n=s.originalData)?void 0:n.filter((o=>o[e])))?g:[]})}"row"===a.getTableConfig("radioConfig.trigger")&&(s.currentRow=f)}))};export{r as useTriggerRow};
@@ -1 +1 @@
1
- import{inject as e,createVNode as l,toRaw as n,computed as r,withModifiers as i}from"vue";import{property as o,isFunction as t,isEmpty as d,identity as u}from"lodash-es";import{NPopover as c,NCheckbox as a,NRadio as s}from"naive-ui";import{InjectionIhoTableUUID as f,WIDGET_TYPE as v}from"../../../constants/index.js";import{IhoTableRenderHelper as x}from"../../../utils/index.js";import{isVerticalHeader as m,getHeaderDepthByField as p,getOriginBasePayload as h,getOriginRowFromRowData as w}from"./utils.js";const k={seq:e=>e.rowIndex+1,checkbox:e=>l(a,{checked:e.row.checked,"onUpdate:checked":l=>e.row.checked=l,onClick:i(u,["stop"])},null),radio(e,n){const o=r({get:()=>e.row===n.currentRow,set(){n.currentRow=e.row}});return l(s,{checked:o.value,"onUpdate:checked":e=>o.value=e,onClick:i(u,["stop"])},null)}};function g(n,i,u){return(s,w)=>{var g,b;const I=e(f),C=i(I),{row:D,column:H}=w;if(m(H.field)){const e=o("originalField")(D);if("checkbox"===e.type)return function(e){var n,i;const o=r({get(){var l,n;return!d(e.originalData)&&null!=(n=null==(l=e.originalData)?void 0:l.every((e=>e.checked)))&&n},set(l){var n;null==(n=e.originalData)||n.forEach((e=>e.checked=l))}}),t=r((()=>{var l,n;return null!=(n=null==(l=e.originalData)?void 0:l.some((e=>e.checked)))&&n}));return l(a,{checked:o.value,"onUpdate:checked":e=>o.value=e,indeterminate:!o.value&&t.value,disabled:null==(i=null==(n=e.originalTableConfig)?void 0:n.checkboxConfig)?void 0:i.disableHeader},null)}(C);const n=D[H.field.replaceAll("_parent","")];return x.hasTitlePrefix(e)&&p(H.field)===C.headerDepth?[l(c,null,{trigger:()=>l("i",{class:"vxe-cell-help-icon vxe-icon-question-circle-fill"},null),default:()=>e.titlePrefix.useHTML?l("div",{innerHTML:e.titlePrefix.useHTML},null):l("div",null,[e.titlePrefix.content])}),n]:n}const y={$table:w.$table,columnIndex:w.rowIndex,$columnIndex:w.rowIndex,isHidden:w.isHidden,rowid:w.rowid,...h(D,H)};if(!y.row)return null;const{originalField:{editRender:T={},slots:$={}}={}}=D;if(t($[u]))return $[u](y);if($.default&&!$.edit)return $.default(y);if(k[y.type])return k[y.type](y,C);const L=T.name||v.DEFAULT,F=n.renderer.get(L);return F?"default"===u?null==(g=F.renderCell)?void 0:g.call(F,T,y):null==(b=F.renderEdit)?void 0:b.call(F,T,y):{}}}function b(l,r){return(i,t)=>{var d,u,c;const a=e(f),s=r(a),v=null==(d=s.fixedLeftVerticalData)?void 0:d[t.$rowIndex];if(!v)return null;const x=o("originalField")(v),m=w(v,p(t.column.field)),h=n(null==(u=s.editCell)?void 0:u.row)===n(m)&&n(null==(c=s.editCell)?void 0:c.column)===n(x);return g(l,r,h?"edit":"default")(null,{...t,row:v,rowIndex:t.$rowIndex,rowid:t.$rowIndex+"",fixed:t.column.fixed,isHidden:!t.column.visible,type:t.column.type})}}export{k as VerticalRenderMap,g as createCellRender,b as createHeaderCellRender};
1
+ import{inject as e,createVNode as l,toRaw as n,computed as r,withModifiers as i}from"vue";import{property as o,isFunction as t,isEmpty as d,identity as c}from"lodash-es";import{NPopover as u,NCheckbox as a,NRadio as s}from"naive-ui";import{InjectionIhoTableUUID as f,WIDGET_TYPE as v,InjectionIhoTableEmits as h}from"../../../constants/index.js";import{IhoTableRenderHelper as x}from"../../../utils/index.js";import{isVerticalHeader as k,getHeaderDepthByField as m,getOriginBasePayload as w,getOriginRowFromRowData as p}from"./utils.js";const g={seq:e=>e.rowIndex+1,checkbox(n,o){const t=e(h),d=r({get:()=>n.row.checked,set(){var e,l;n.row.checked=!n.row.checked,null==t||t("checkboxChange",{...n,checked:n.row.checked,records:null!=(l=null==(e=o.originalData)?void 0:e.filter((e=>e.checked)))?l:[]})}});return l(a,{checked:d.value,"onUpdate:checked":e=>d.value=e,onClick:i(c,["stop"])},null)},radio(e,n){const o=r({get:()=>e.row===n.currentRow,set(){n.currentRow=e.row}});return l(s,{checked:o.value,"onUpdate:checked":e=>o.value=e,onClick:i(c,["stop"])},null)}};function b(n,i,c){return(s,p)=>{var b,D;const I=e(f),C=i(I),{row:$,column:H}=p;if(k(H.field)){const n=o("originalField")($);if("checkbox"===n.type)return function(n,i){var o,t;const c=e(h),u=r({get(){var e,l;return!d(i.originalData)&&null!=(l=null==(e=i.originalData)?void 0:e.every((e=>e.checked)))&&l},set(e){var l,r,o;null==(l=i.originalData)||l.forEach((l=>l.checked=e)),null==c||c("checkboxAll",{$table:n.$table,checked:u.value,records:null!=(o=null==(r=i.originalData)?void 0:r.filter((e=>e.checked)))?o:[]})}}),s=r((()=>{var e,l;return null!=(l=null==(e=i.originalData)?void 0:e.some((e=>e.checked)))&&l}));return l(a,{checked:u.value,"onUpdate:checked":e=>u.value=e,indeterminate:!u.value&&s.value,disabled:null==(t=null==(o=i.originalTableConfig)?void 0:o.checkboxConfig)?void 0:t.disableHeader},null)}(p,C);const i=$[H.field.replaceAll("_parent","")];return x.hasTitlePrefix(n)&&m(H.field)===C.headerDepth?[l(u,null,{trigger:()=>l("i",{class:"vxe-cell-help-icon vxe-icon-question-circle-fill"},null),default:()=>n.titlePrefix.useHTML?l("div",{innerHTML:n.titlePrefix.useHTML},null):l("div",null,[n.titlePrefix.content])}),i]:i}const y={$table:p.$table,columnIndex:p.rowIndex,$columnIndex:p.rowIndex,isHidden:p.isHidden,rowid:p.rowid,...w($,H)};if(!y.row)return null;const{originalField:{editRender:T={},slots:L={}}={}}=$;if(t(L[c]))return L[c](y);if(L.default&&!L.edit)return L.default(y);if(g[y.type])return g[y.type](y,C);const F=T.name||v.DEFAULT,P=n.renderer.get(F);return P?"default"===c?null==(b=P.renderCell)?void 0:b.call(P,T,y):null==(D=P.renderEdit)?void 0:D.call(P,T,y):{}}}function D(l,r){return(i,t)=>{var d,c,u;const a=e(f),s=r(a),v=null==(d=s.fixedLeftVerticalData)?void 0:d[t.$rowIndex];if(!v)return null;const h=o("originalField")(v),x=p(v,m(t.column.field)),k=n(null==(c=s.editCell)?void 0:c.row)===n(x)&&n(null==(u=s.editCell)?void 0:u.column)===n(h);return b(l,r,k?"edit":"default")(null,{...t,row:v,rowIndex:t.$rowIndex,rowid:t.$rowIndex+"",fixed:t.column.fixed,isHidden:!t.column.visible,type:t.column.type})}}export{g as VerticalRenderMap,b as createCellRender,D as createHeaderCellRender};
@@ -1 +1 @@
1
- import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,range as l,property as u}from"lodash-es";import{IhoTableRenderHelper as c}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as f}from"./constants.js";function d(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function s(e){return!!r(e)&&e.startsWith("header_")}function p(e){return!!r(e)&&e.startsWith("body_")}function h(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function _(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void l(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const t=r[n-1];t&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===t[n]&&r&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function g({row:e,column:n}){var t,r;return s(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const m=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function $(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(c.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function b(e,n,t){const r=T(t);let u=r.getTableConfig("verticalConfig.headerWidth");u="auto"===u?$:i(u)?o(u):a(u)?u:$;let c=r.getTableConfig("verticalConfig.bodyWidth");return c=i(c)?o(c):a(c)?c:o(120),[...l(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:u(e,t.originalFieldList),fixed:"left",editRender:{name:f,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:c(n),editRender:{name:f,props:{},enable:!0,autofocus:m}})))]}function y(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function w(e){return u("originalField")(e)}function x(e,n){return u(`originalData.${n}`)(e)}function v(e,n){const t=h(n.field),r=w(e);return{row:x(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function C(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function T(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[h(n.field)]},getTableConfig:n=>u(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(s(r))return e[r];if(p(r)){const t=h(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!s(r)){const t=h(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}m.toString=()=>"input,.n-input__input-el";export{_ as bindHeaderInfoAndFlatten,D as createDataProxy,b as createVerticalFieldList,T as createVerticalStateHandler,C as findFixedLeftFields,h as getHeaderDepthByField,v as getOriginBasePayload,w as getOriginFieldFromRowData,x as getOriginRowFromRowData,g as getSpanInfo,y as getVerticalInfoFromEvent,p as isVerticalBody,s as isVerticalHeader,d as isVerticalTable};
1
+ import{traverse as e,findAncestor as n,getStringWidth as t}from"../../../../../../shared/utils/index.js";import{isString as r,isNumber as i,constant as o,isFunction as a,noop as l,range as u,property as c}from"lodash-es";import{IhoTableRenderHelper as f}from"../../../utils/index.js";import{VERTICAL_CELL_TYPE as d}from"./constants.js";function s(e){var n;return!!(null==(n=e.verticalConfig)?void 0:n.enable)}function p(e){return!!r(e)&&e.startsWith("header_")}function h(e){return!!r(e)&&e.startsWith("body_")}function g(e){var n;return r(e)?+(null!=(n=e.split("_")[1])?n:-1):-1}function _(n,t){const r=[];return e(n,((e,n,o)=>{e.parent=o,e.children||(!function(e,n){let t=e,r=n;if(!e.parent)return e[`header_${n}`]=e.title,void u(n+1).forEach((t=>{e[`header_${t}_colspan`]=t===n?n+1:0,e[`header_${t}_rowspan`]=t===n?1:0}));for(;t;)e[`header_${r}`]=t.title,e[`header_${r}_rowspan`]=i(t),e[`header_${r}_colspan`]=1,r--,t=t.parent}(e,t),r.push(e))})),r.forEach(((e,n)=>{const t=r[n-1];t&&Object.entries(e).forEach((([n,r])=>{n.match(/^header_(\d+)$/)&&r===t[n]&&r&&(e[`${n}_colspan`]=0,e[`${n}_rowspan`]=0)}))})),r;function i(n){if(!n.children)return 1;let t=0;return e(n.children,(e=>{e.children||t++})),t}}function m({row:e,column:n}){var t,r;return p(n.field)?{rowspan:null!=(t=e[n.field+"_rowspan"])?t:1,colspan:null!=(r=e[n.field+"_colspan"])?r:1}:{colspan:1,rowspan:1}}const b=({cell:e}={})=>{const n=e&&e.querySelector("input,.n-input__input-el");return n&&n.click(),n};function $(n,r){let i=120;return e(r,((e,r,o,a)=>{a===n&&(i=Math.max(i,t(e.title||"")+20+(f.hasTitlePrefix(e)?20:0)))})),Math.ceil(i)}function y(e,n,t){const r=W(t);let c=r.getTableConfig("verticalConfig.headerWidth");c="auto"===c?$:i(c)?o(c):a(c)?c:$;let f=r.getTableConfig("verticalConfig.bodyWidth");f=i(f)?o(f):a(f)?f:l;let s=r.getTableConfig("verticalConfig.bodyMinWidth");return s=i(s)?o(s):a(s)?s:o(120),[...u(n+1).map((e=>({field:`header_${e}`,title:`header_${e}`,width:c(e,t.originalFieldList),fixed:"left",editRender:{name:d,props:{},enable:!1}}))),...e.map(((e,n)=>({field:`body_${n}`,title:`body_${n}`,minWidth:s(n),width:f(n),editRender:{name:d,props:{},enable:!0,autofocus:b}})))]}function w(e){const t=n(e.target,(e=>"TD"===e.tagName||"TH"===e.tagName));if(!t)return;const r=t.className.match(/(body|header)_(\d+)/);if(!r)return;const[i,o,a]=r;return{fieldKey:i,type:o,sequence:+a}}function x(e){return c("originalField")(e)}function v(e,n){return c(`originalData.${n}`)(e)}function C(e,n){const t=g(n.field),r=x(e);return{row:v(e,t),rowIndex:t,$rowIndex:t,column:r,fixed:r.fixed,type:r.type}}function T(n){const t=[];return e(n,(e=>{"left"===e.fixed&&t.push(e)})),t}function W(e){return{getOriginDataByColumn(n){const{originalData:t=[]}=e;return t[g(n.field)]},getTableConfig:n=>c(n)(e.originalTableConfig)}}function D(e,n){return new Proxy({},{get(t,r){var i;if("originalField"===r)return e;if("originalData"===r)return a(n)?n():n;if(p(r))return e[r];if(h(r)){const t=g(r);return"seq"===e.type?t+1:null==(i=n[t])?void 0:i[e.field]}return t[r]},set(t,r,i){if(!p(r)){const t=g(r);t>=0&&n[t]&&(n[t][e.field]=i)}return!0}})}b.toString=()=>"input,.n-input__input-el";export{_ as bindHeaderInfoAndFlatten,D as createDataProxy,y as createVerticalFieldList,W as createVerticalStateHandler,T as findFixedLeftFields,g as getHeaderDepthByField,C as getOriginBasePayload,x as getOriginFieldFromRowData,v as getOriginRowFromRowData,m as getSpanInfo,w as getVerticalInfoFromEvent,h as isVerticalBody,p as isVerticalHeader,s as isVerticalTable};
@@ -87,6 +87,7 @@ export declare type IhoTableConfig = VxeTableProps & Partial<{
87
87
  enable?: boolean;
88
88
  headerWidth?: number | 'auto' | ((level: number) => number);
89
89
  bodyWidth?: number | ((index: number) => number);
90
+ bodyMinWidth?: number | ((index: number) => number);
90
91
  };
91
92
  [K: string]: unknown;
92
93
  }> &
@@ -1 +1 @@
1
- .iho-table{height:100%}.iho-table .vxe-header--column{font-weight:400;text-shadow:0 0 1px}.iho-table .vxe-body--column.col--drag{cursor:move}.iho-table .vxe-table.size--mini{font-size:14px}.iho-table .vxe-table.size--mini .vxe-body--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-footer--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-header--column:not(.col--ellipsis){padding:4px 0}.iho-table .vxe-table.size--mini .vxe-sort--asc-btn{top:-2px}.iho-table .vxe-table.size--mini .vxe-sort--desc-btn{bottom:0}.iho-table__headerWrapper{display:inline-flex;flex-wrap:nowrap}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table .vxe-table--header-wrapper,.iho-table .vxe-table.vxe-table--render-default{color:#212121}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .vxe-table--empty-content{height:100%;width:100%}.iho-table .vxe-table--empty-content>div,.iho-table .vxe-tree-cell{height:100%}.iho-table .vxe-table--header{background-color:#f2f2f2}.iho-table .vxe-table--header .checkbox-cell--disable{border:2px solid #c0c4cc;border-radius:50%;box-sizing:border-box;cursor:not-allowed;display:inline-block;height:18px;left:-2px;position:relative;top:3px;width:18px}.iho-table .vxe-table--header .checkbox-cell--disable:before{background-color:#c0c4cc;content:"";height:16px;left:50%;position:absolute;top:-2px;transform:translate(-60%) rotate(-45deg);width:2px}.iho-table .vxe-footer--row .vxe-footer--column>.vxe-cell .vxe-cell--item{height:30px;line-height:30px}.iho-table .vxe-table--render-default .vxe-body--column.col--selected{box-shadow:inset 0 0 0 2px var(--c-primary-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--hover,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--stripe{background-color:var(--c-hover-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--stripe{background-color:var(--c-stripe-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--radio{background-color:var(--c-primary-color-opacity2);text-shadow:0 0 1px}.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--radio{background-color:var(--c-primary-color-opacity3);text-shadow:0 0 1px}.iho-table .vxe-body--expanded-column,.iho-table .vxe-table--border-line{border-color:var(--c-border-color)!important}.iho-table .vxe-table--footer-wrapper{border-top-color:var(--c-border-color)!important}.iho-table .border--default .vxe-body--column,.iho-table .border--default .vxe-footer--column,.iho-table .border--default .vxe-header--column,.iho-table .border--inner .vxe-body--column,.iho-table .border--inner .vxe-footer--column,.iho-table .border--inner .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--full .vxe-body--column,.iho-table .border--full .vxe-footer--column,.iho-table .border--full .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color)),linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--default .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--full .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--inner .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--outer .vxe-header--row:last-child .vxe-header--gutter{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .vxe-table--header-border-line{border-bottom-color:var(--c-border-color)!important}.iho-table .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .is--filter-active .vxe-cell--filter .vxe-filter--btn{color:var(--c-primary-color)}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterIcon.is-active{color:var(--c-primary-color)}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;margin:8px 12px;width:240px}.iho-table__filterCheckAllWrapper{display:flex;justify-content:space-between}.iho-table__filterCheckAllWrapper>div{flex:1}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:var(--c-primary-color)}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05);overflow-x:hidden}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;padding:0 8px}.iho-table__filterListItem:hover{background:var(--c-primary-color-opacity2)}.iho-table__filterListItem .n-checkbox,.iho-table__filterListItem .n-radio{width:100%}.iho-table__filterListItem>*{padding:5px 0}.iho-table__filterListItemContent{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:190px}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table__time-picker{position:unset}.iho-table__time-picker .n-input{display:none}.iho-table__time-picker .v-binder-follower-container{height:auto;position:unset}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content{position:unset;transform:none!important}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content .n-time-picker-panel{box-shadow:none}.iho-table__scrollbar{margin:8px 8px 8px 0;max-height:255px}.iho-table .variable-height .vxe-cell,.iho-table .variable-height .vxe-cell--tree-node,.iho-table .variable-height .vxe-tree-cell{line-height:1.3;max-height:fit-content!important;white-space:break-spaces!important}.iho-table__selectMenu .n-scrollbar-rail__scrollbar{display:none!important}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar,.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{display:unset!important;height:6px;width:6px}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.iho-table__selectMenu .v-vl-items{min-width:100%;width:max-content}.iho-table__selectOption .n-base-select-option__content{overflow:visible!important;text-overflow:unset!important;word-break:keep-all!important}.iho-table__selectOptionWrapper{align-items:center;display:flex}.iho-table .is--checked.vxe-checkbox,.iho-table .is--checked.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--checked.vxe-custom--option,.iho-table .is--checked.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--checked.vxe-export--panel-column-option,.iho-table .is--checked.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--checked.vxe-table--filter-option,.iho-table .is--checked.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-checkbox,.iho-table .is--indeterminate.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-custom--option,.iho-table .is--indeterminate.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-export--panel-column-option,.iho-table .is--indeterminate.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-table--filter-option,.iho-table .is--indeterminate.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-custom--option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-export--panel-column-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table .vxe-sort--asc-btn.sort--active,.iho-table .vxe-table .vxe-sort--desc-btn.sort--active,.iho-table .vxe-table--filter-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .vxe-cell--checkbox:not(.is--disabled):hover .vxe-checkbox--icon{color:var(--c-primary-color)}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}@font-face{font-family:iho-table-iconfont;src:url(iconfont.ttf) format("truetype")}.iho-table .iho-table--iconfont{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-table-iconfont!important;font-size:15px;font-style:normal}.iho-table .iho-table-icon-filter{display:inline-block;font-size:17px;transform:translateY(-1px);vertical-align:middle}.iho-table .iho-table-icon-filter:before{content:"\c2001"}.iho-table .iho-table-icon-date-filter{display:inline-block;transform:translateY(-1px)}.iho-table .iho-table-icon-date-filter:before{content:"\c2002"}.iho-table .row--custom{background-color:var(--row-background-color)}.iho-table__colorAndIcon{background-color:var(--color-and-icon-background-color-type);color:var(--color-and-icon-color-type)}.iho-table__htmlRender *{display:inline!important}.iho-table__ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ .iho-table{height:100%}.iho-table .vxe-header--column{font-weight:400;text-shadow:0 0 1px}.iho-table .vxe-body--column.col--drag{cursor:move}.iho-table .vxe-table.size--mini{font-size:14px}.iho-table .vxe-table.size--mini .vxe-body--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-footer--column:not(.col--ellipsis),.iho-table .vxe-table.size--mini .vxe-header--column:not(.col--ellipsis){padding:4px 0}.iho-table .vxe-table.size--mini .vxe-sort--asc-btn{top:-2px}.iho-table .vxe-table.size--mini .vxe-sort--desc-btn{bottom:0}.iho-table__headerWrapper{display:inline-flex;flex-wrap:nowrap}.iho-table__boldCell{font-weight:700}.iho-table .vxe-table .vxe-table--header-wrapper,.iho-table .vxe-table.vxe-table--render-default{color:#212121}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar{background-color:transparent;height:10px;width:10px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:#b2b2b2;border:3px dashed transparent;border-radius:5px}.iho-table .vxe-table--body-wrapper::-webkit-scrollbar-thumb:hover,.iho-table .vxe-table--footer-wrapper.body--wrapper::-webkit-scrollbar-thumb:hover{background:#b2b2b2}.iho-table .vxe-table--empty-content{height:100%;width:100%}.iho-table .vxe-table--empty-content>div,.iho-table .vxe-tree-cell{height:100%}.iho-table .vxe-table--header{background-color:#f2f2f2}.iho-table .vxe-table--header .checkbox-cell--disable{border:2px solid #c0c4cc;border-radius:50%;box-sizing:border-box;cursor:not-allowed;display:inline-block;height:18px;left:-2px;position:relative;top:3px;width:18px}.iho-table .vxe-table--header .checkbox-cell--disable:before{background-color:#c0c4cc;content:"";height:16px;left:50%;position:absolute;top:-2px;transform:translate(-60%) rotate(-45deg);width:2px}.iho-table .vxe-footer--row .vxe-footer--column>.vxe-cell .vxe-cell--item{height:30px;line-height:30px}.iho-table .vxe-table--render-default .vxe-body--column.col--selected{box-shadow:inset 0 0 0 2px var(--c-primary-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--hover,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--stripe{background-color:var(--c-hover-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--stripe{background-color:var(--c-stripe-color)}.iho-table .vxe-table--render-default .vxe-body--row.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--radio{background-color:var(--c-primary-color-opacity2);text-shadow:0 0 1px}.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--checked,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--current,.iho-table .vxe-table--render-default .vxe-body--row.row--hover.row--radio{background-color:var(--c-primary-color-opacity3);text-shadow:0 0 1px}.iho-table .vxe-body--expanded-column,.iho-table .vxe-table--border-line{border-color:var(--c-border-color)!important}.iho-table .vxe-table--footer-wrapper{border-top-color:var(--c-border-color)!important}.iho-table .border--default .vxe-body--column,.iho-table .border--default .vxe-footer--column,.iho-table .border--default .vxe-header--column,.iho-table .border--inner .vxe-body--column,.iho-table .border--inner .vxe-footer--column,.iho-table .border--inner .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--full .vxe-body--column,.iho-table .border--full .vxe-footer--column,.iho-table .border--full .vxe-header--column{background-image:linear-gradient(var(--c-border-color),var(--c-border-color)),linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .border--default .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--full .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--inner .vxe-header--row:last-child .vxe-header--gutter,.iho-table .border--outer .vxe-header--row:last-child .vxe-header--gutter{background-image:linear-gradient(var(--c-border-color),var(--c-border-color))!important}.iho-table .vxe-table--header-border-line{border-bottom-color:var(--c-border-color)!important}.iho-table .vxe-table--fixed-left-wrapper.scrolling--middle{box-shadow:7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .vxe-table--fixed-right-wrapper.scrolling--middle{box-shadow:-7px 0 8px -3px rgba(0,0,0,.15)!important}.iho-table .icon-dot{background:var(--table-icon-color);box-shadow:0 2px 4px 0 var(--table-icon-shadow)}.iho-table .icon-dot,.iho-table .icon-dot-red{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-red{background:red;box-shadow:0 2px 4px 0 rgba(255,0,0,.5)}.iho-table .icon-dot-blue{background:blue;box-shadow:0 2px 4px 0 rgba(0,0,255,.5)}.iho-table .icon-dot-blue,.iho-table .icon-dot-green{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-green{background:green;box-shadow:0 2px 4px 0 rgba(0,128,0,.5)}.iho-table .icon-dot-gray{background:gray;box-shadow:0 2px 4px 0 hsla(0,0%,50%,.5)}.iho-table .icon-dot-gray,.iho-table .icon-dot-yellow{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-yellow{background:#ff0;box-shadow:0 2px 4px 0 rgba(255,255,0,.5)}.iho-table .icon-dot-resolved{background:#36be8c;box-shadow:0 2px 4px 0 rgba(54,190,140,.5)}.iho-table .icon-dot-huifu,.iho-table .icon-dot-resolved{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-huifu{background:#42d0f6;box-shadow:0 2px 4px 0 rgba(66,208,246,.5)}.iho-table .icon-dot-close{background:#718391;box-shadow:0 2px 4px 0 rgba(113,131,145,.5)}.iho-table .icon-dot-audit,.iho-table .icon-dot-close{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-audit{background:#f4ba32;box-shadow:0 2px 4px 0 rgba(244,186,50,.5)}.iho-table .icon-dot-design{background:#927ce1;box-shadow:0 2px 4px 0 rgba(146,124,225,.5)}.iho-table .icon-dot-design,.iho-table .icon-dot-develop{border-radius:50%;display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .icon-dot-develop{background:#4eb0ef;box-shadow:0 2px 4px 0 rgba(78,176,239,.5)}.iho-table .icon-dot-develop-complete{background:#6381f9;border-radius:50%;box-shadow:0 2px 4px 0 rgba(99,129,249,.5);display:inline-block;height:8px;margin-right:6px;width:8px}.iho-table .is--filter-active .vxe-cell--filter .vxe-filter--btn{color:var(--c-primary-color)}.iho-table__filterIcon{cursor:pointer;padding:0 4px}.iho-table__filterIcon:hover{opacity:.7}.iho-table__filterIcon.is-active{color:var(--c-primary-color)}.iho-table__filterWrapper{display:flex;flex-direction:column;gap:8px;margin:8px 12px;width:240px}.iho-table__filterCheckAllWrapper{display:flex;justify-content:space-between}.iho-table__filterCheckAllWrapper>div{flex:1}.iho-table__filterButton{align-items:center;border-radius:4px;cursor:pointer;display:flex;height:30px;padding:0 8px}.iho-table__filterButton--active{color:var(--c-primary-color)}.iho-table__filterButton:hover{background:rgba(0,0,0,.05)}.iho-table__filterListWrapper{border:1px solid rgba(0,0,0,.05);overflow-x:hidden}.iho-table__filterListItem{align-items:center;border-radius:4px;display:flex;padding:0 8px}.iho-table__filterListItem:hover{background:var(--c-primary-color-opacity2)}.iho-table__filterListItem .n-checkbox,.iho-table__filterListItem .n-radio{width:100%}.iho-table__filterListItem>*{padding:5px 0}.iho-table__filterListItemContent{overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:190px}.iho-table__filterFooter{display:flex;justify-content:space-between}.iho-table__time-picker{position:unset}.iho-table__time-picker .n-input{display:none}.iho-table__time-picker .v-binder-follower-container{height:auto;position:unset}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content{position:unset;transform:none!important}.iho-table__time-picker .v-binder-follower-container .v-binder-follower-content .n-time-picker-panel{box-shadow:none}.iho-table__scrollbar{margin:8px 8px 8px 0;max-height:255px}.iho-table .variable-height .vxe-cell,.iho-table .variable-height .vxe-cell--tree-node,.iho-table .variable-height .vxe-tree-cell{line-height:1.3;max-height:fit-content!important;white-space:break-spaces!important}.iho-table__selectMenu .n-scrollbar-rail__scrollbar{display:none!important}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar,.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{display:unset!important;height:6px;width:6px}.iho-table__selectMenu .n-virtual-list::-webkit-scrollbar-thumb{background:#bfbfbf;border-radius:4px}.iho-table__selectMenu .v-vl-items{min-width:100%;width:max-content}.iho-table__selectOption .n-base-select-option__content{overflow:visible!important;text-overflow:unset!important;word-break:keep-all!important}.iho-table__selectOptionWrapper{align-items:center;display:flex}.iho-table .is--checked.vxe-checkbox,.iho-table .is--checked.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--checked.vxe-custom--option,.iho-table .is--checked.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--checked.vxe-export--panel-column-option,.iho-table .is--checked.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--checked.vxe-table--filter-option,.iho-table .is--checked.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-checkbox,.iho-table .is--indeterminate.vxe-checkbox .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-custom--option,.iho-table .is--indeterminate.vxe-custom--option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-export--panel-column-option,.iho-table .is--indeterminate.vxe-export--panel-column-option .vxe-checkbox--icon,.iho-table .is--indeterminate.vxe-table--filter-option,.iho-table .is--indeterminate.vxe-table--filter-option .vxe-checkbox--icon,.iho-table .vxe-checkbox:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-custom--option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-export--panel-column-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table .vxe-sort--asc-btn.sort--active,.iho-table .vxe-table .vxe-sort--desc-btn.sort--active,.iho-table .vxe-table--filter-option:not(.is--disabled):hover .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--checked.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox,.iho-table .vxe-table--render-default .is--indeterminate.vxe-cell--checkbox .vxe-checkbox--icon,.iho-table .vxe-table--render-default .vxe-cell--checkbox:not(.is--disabled):hover .vxe-checkbox--icon{color:var(--c-primary-color)}.iho-table .vxe-header--column [annotation-hover-show=true]{visibility:hidden}.iho-table .vxe-header--column:hover [annotation-hover-show=true]{visibility:visible}@font-face{font-family:iho-table-iconfont;src:url(iconfont.ttf) format("truetype")}.iho-table .iho-table--iconfont{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:iho-table-iconfont!important;font-size:15px;font-style:normal}.iho-table .iho-table-icon-filter{display:inline-block;font-size:17px;transform:translateY(-1px);vertical-align:middle}.iho-table .iho-table-icon-filter:before{content:"\c2001"}.iho-table .iho-table-icon-date-filter{display:inline-block;transform:translateY(-1px)}.iho-table .iho-table-icon-date-filter:before{content:"\c2002"}.iho-table .row--custom{background-color:var(--row-background-color)}.iho-table__colorAndIcon{background-color:var(--color-and-icon-background-color-type);color:var(--color-and-icon-color-type)}.iho-table__htmlRender *{display:inline!important}.iho-table__ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.iho-table .vxe-grid[vertical] .vxe-table--header-wrapper.body--wrapper{background:transparent}