cnhis-design-vue 3.2.5-beta.37 → 3.2.5-beta.39

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.
@@ -6162,6 +6162,9 @@ export declare const CallbackMaps: Map<string, {
6162
6162
  updateFieldListRefDebounced: () => void;
6163
6163
  updateFieldListRef: () => void;
6164
6164
  dataTransfer: (data: import("../../../..").AnyObject[]) => Promise<import("../../../..").AnyObject[]>;
6165
+ tableDataResolved: null;
6166
+ setTableDataResolved: (resolve: import("../../../..").AnyFn<any[], any>) => void;
6167
+ resolveTableData: () => Promise<void>;
6165
6168
  tableDataRef: import("vue").Ref<import("../../../..").AnyObject[]>;
6166
6169
  updateTableDataRefDebounced: () => Promise<void>;
6167
6170
  updateTableDataRef: () => Promise<void>;
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawText as i,defaultRectStyle as n,drawTextGroup as o,drawLine as r,drawPoint as l}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as c}from"../useScaleColumn.js";import"vue";import{getScaleNumberList as f}from"../../utils/index.js";import{isArray as u,cloneDeep as d}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function m(m,h,p,g,v){const{computedX:x,getXValue:L}=a(h),{originX:X,endX:C,xCellWidth:w,originYXAxis:y,top:Y,canvasWidth:S,borderStyle:j,treeData:b,xAxis:G,topGridYNumber:k,topGridOriginY:E,topGridYCellHeight:I,topGridEndY:M,event:z}=h,A=new Set;function $(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:r}=Y.dataStyle||{},{startLine:s,endLine:a}=e;n=l(o,{fontSize:12,...r,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=V(n,e,i);n&&(n.set(c),n.origin={data:t},N(n),s&&(s.text=n),a&&(a.text=n))}return n}function V(t,e,i){const n=t.width+1,{startLine:o,centerLine:r,endLine:l}=e,s={top:i,originX:"center",originY:"center"};return r&&n<=r.width?s.left=r.x1+r.width/2:l&&n<=l.limitX.x2-l.left?(s.originX="left",s.left=l.left+1):o&&!l&&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)):r?(s.originY="top",s.left=r.x1+r.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 D(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<X||s>C)return;const{lineStyle:u}=Y.dataStyle||{};let d;const m={left:s,top:f};d=i?l("circle",{fill:u.stroke,...m}):n?l(">",{fill:u.stroke,...m,fontSize:18}):r([s,a,s,f],u);const h=new t.Rect({width:w,height:I,fill:"transparent",left:s-w/2,top:a}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,N(p),p}function N(t){z.hovered&&(t.on("mouseover",(()=>{T(t,"hover")})),t.on("mouseout",(()=>{g.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=V(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),z.hovered&&T(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};p("change",e)}})))}function T(t,e="moving"){var i,n,o;const{data:r}=t.origin;g.point={x:t.left,y:t.top};let[l="",s=""]=r.time||[];if("moving"===e){const e=L(t.left);t.isLeft?l=e:s=e,r.time=[l,s],t.text&&(t.text.origin.data.time=[l,s])}g.list=[`开始时间 ${l}`,`结束时间 ${s}`,`流速 ${(null==(i=r.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=r.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=r.value)?void 0:o.total)||""}`],g.sourceData=[{type:"tree",startTime:l,endTime:s,value:r.value}],g.isTarget=!0,g.show=!0}s(m,{...h,gridYNumber:k,originY:E,yCellHeight:I,endY:M}),function(){const{height:o,list:r,left:l,spaceValue:s,style:a,marginBottom:c}=G;if(!o)return;const f=[],u=y+(c?o-c:o/2),d=c?"bottom":"center";r.forEach(((t,e)=>{const n=l+e*w*s;f.push(i([n,u],{value:t.slice(11,16),originY:d,...a}))}));const h=f.length>0?new t.Group([...f],{...e,objectCaching:!1}):null;h&&m.value.add(h);const p=new t.Rect({width:S,height:o,left:0,top:y,...n,originX:"left",originY:"top",...j});m.value.add(p);const{show:g=!0}=Y}(),function(){var i;const n=(null==(i=null==Y?void 0:Y.tree)?void 0:i.textStyle)||{},l=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:a,left:c,top:f,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=Y.dataStyle||{},i=t.top,n=i+I,o=n-I/2,l={y1:i,y2:n,halfY:o};let s=null;const a=d(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&x(u),h=d&&x(d),p=D({...l,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),g=D({...l,x:h},{isCustomIcon:!1,isContinue:!!f});let v;if((p||m<X)&&(g||h>C)){v=r([p?m:X,o,g?h:C,o],e)}const L={startLine:p,centerLine:v,endLine:g};let w,y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:r}=e,{startLine:l,endLine:s}=t||{};if(n){n.origin=i;const t={x1:X,x2:r?r.left:C};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):l&&(t.x1=l.left,l.limitX.x2=n.left,n.prevLine=l,l.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(r){r.origin=i;const t={x1:n?n.left:X,x2:C};r.limitX=t,o&&(r.centerLine=o)}n&&r&&(n.nearLine=r,r.nearLine=n)}(s,L,Object.assign({},a,{data:t,index:i})),s&&(w=$(n[i-1],s,o)),i===n.length-1&&(y=$(t,L,o)),s=L,v&&A.add(v),p&&A.add(p),g&&A.add(g),w&&A.add(w),y&&A.add(y)}))}(e)),l.push(o({width:s,height:a,...j},m,{left:c,top:f},!0))}))}(b);const s=l.length>0?new t.Group([...l],{...e,objectCaching:!1}):null;s&&m.value.add(s),A.size&&m.value.add(...A)}(),function(){const{show:i=!0,range:n,spaceValue:o=.5,spaceGridNumber:r=1,style:l,margin:s=5}=(null==Y?void 0:Y.scaleValue)||{};if(!i||!u(n))return;const a=f(n,o),d=[];if(a.forEach(((t,e)=>{if(0===e||e===a.length-1)return;const i=M-e*I*r;Math.abs(i-E)<1||d.push(c(String(t),{style:l,position:"right"},C+s,i))})),!d.length)return;const h=new t.Group(d,{objectCaching:!1,...e});m.value.add(h)}()}export{m as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawText as i,defaultRectStyle as n,drawTextGroup as o,drawLine as r,drawPoint as l}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as c}from"../useScaleColumn.js";import"vue";import{getScaleNumberList as f}from"../../utils/index.js";import{isArray as u,cloneDeep as d}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function m(m,h,p,g,v){const{computedX:x,getXValue:L}=a(h),{originX:X,endX:C,xCellWidth:w,originYXAxis:y,top:Y,canvasWidth:S,borderStyle:j,treeData:b,xAxis:G,topGridYNumber:k,topGridOriginY:E,topGridYCellHeight:I,topGridEndY:M,event:z}=h,A=new Set;function $(t,e,i){let n;const{content:o}=t.value||{},{startLine:r,endLine:s,centerLine:a}=e;if(o&&(r||a||s)){const{textStyle:a}=Y.dataStyle||{};n=l(o,{fontSize:12,...a,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const c=V(n,e,i);n&&(n.set(c),n.origin={data:t},N(n),r&&(r.text=n),s&&(s.text=n))}return n}function V(t,e,i){const n=t.width+1,{startLine:o,centerLine:r,endLine:l}=e,s={top:i,originX:"center",originY:"center"};return r&&n<=r.width?s.left=r.x1+r.width/2:l&&n<=l.limitX.x2-l.left?(s.originX="left",s.left=l.left+1):o&&!l&&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)):r?(s.originY="top",s.left=r.x1+r.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 D(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:c,halfY:f}=e;if(!s||s<X||s>C)return;const{lineStyle:u}=Y.dataStyle||{};let d;const m={left:s,top:f};d=i?l("circle",{fill:u.stroke,...m}):n?l(">",{fill:u.stroke,...m,fontSize:18}):r([s,a,s,f],u);const h=new t.Rect({width:w,height:I,fill:"transparent",left:s-w/2,top:a}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,N(p),p}function N(t){z.hovered&&(t.on("mouseover",(()=>{T(t,"hover")})),t.on("mouseout",(()=>{g.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=V(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),z.hovered&&T(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};p("change",e)}})))}function T(t,e="moving"){var i,n,o;const{data:r}=t.origin;g.point={x:t.left,y:t.top};let[l="",s=""]=r.time||[];if("moving"===e){const e=L(t.left);t.isLeft?l=e:s=e,r.time=[l,s],t.text&&(t.text.origin.data.time=[l,s])}g.list=[`开始时间 ${l}`,`结束时间 ${s}`,`流速 ${(null==(i=r.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=r.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=r.value)?void 0:o.total)||""}`],g.sourceData=[{type:"tree",startTime:l,endTime:s,value:r.value}],g.isTarget=!0,g.show=!0}s(m,{...h,gridYNumber:k,originY:E,yCellHeight:I,endY:M}),function(){const{height:o,list:r,left:l,spaceValue:s,style:a,marginBottom:c}=G;if(!o)return;const f=[],u=y+(c?o-c:o/2),d=c?"bottom":"center";r.forEach(((t,e)=>{const n=l+e*w*s;f.push(i([n,u],{value:t.slice(11,16),originY:d,...a}))}));const h=f.length>0?new t.Group([...f],{...e,objectCaching:!1}):null;h&&m.value.add(h);const p=new t.Rect({width:S,height:o,left:0,top:y,...n,originX:"left",originY:"top",...j});m.value.add(p);const{show:g=!0}=Y}(),function(){var i;const n=(null==(i=null==Y?void 0:Y.tree)?void 0:i.textStyle)||{},l=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:a,left:c,top:f,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=Y.dataStyle||{},i=t.top,n=i+I,o=n-I/2,l={y1:i,y2:n,halfY:o};let s=null;const a=d(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:c,continue:f}=t,[u,d]=c,m=u&&x(u),h=d&&x(d),p=D({...l,x:m},{isCustomIcon:!h&&!f,isContinue:!1,isLeft:!0}),g=D({...l,x:h},{isCustomIcon:!1,isContinue:!!f});let v;if((p||m<X)&&(g||h>C)){v=r([p?m:X,o,g?h:C,o],e)}const L={startLine:p,centerLine:v,endLine:g};let w,y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:r}=e,{startLine:l,endLine:s}=t||{};if(n){n.origin=i;const t={x1:X,x2:r?r.left:C};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):l&&(t.x1=l.left,l.limitX.x2=n.left,n.prevLine=l,l.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(r){r.origin=i;const t={x1:n?n.left:X,x2:C};r.limitX=t,o&&(r.centerLine=o)}n&&r&&(n.nearLine=r,r.nearLine=n)}(s,L,Object.assign({},a,{data:t,index:i})),s&&(w=$(n[i-1],s,o)),i===n.length-1&&(y=$(t,L,o)),s=L,v&&A.add(v),p&&A.add(p),g&&A.add(g),w&&A.add(w),y&&A.add(y)}))}(e)),l.push(o({width:s,height:a,...j},m,{left:c,top:f},!0))}))}(b);const s=l.length>0?new t.Group([...l],{...e,objectCaching:!1}):null;s&&m.value.add(s),A.size&&m.value.add(...A)}(),function(){const{show:i=!0,range:n,spaceValue:o=.5,spaceGridNumber:r=1,style:l,margin:s=5}=(null==Y?void 0:Y.scaleValue)||{};if(!i||!u(n))return;const a=f(n,o),d=[];if(a.forEach(((t,e)=>{if(0===e||e===a.length-1)return;const i=M-e*I*r;Math.abs(i-E)<1||d.push(c(String(t),{style:l,position:"right"},C+s,i))})),!d.length)return;const h=new t.Group(d,{objectCaching:!1,...e});m.value.add(h)}()}export{m as useTop};
@@ -475,9 +475,9 @@ declare const _default: import("vue").DefineComponent<{
475
475
  hide: boolean;
476
476
  }>;
477
477
  draggable: boolean;
478
- isHighlightRow: boolean;
479
478
  idx: number;
480
479
  isHighlight: boolean;
480
+ isHighlightRow: boolean;
481
481
  isFieldSet: boolean;
482
482
  fieldDescribeMode: "column" | "tooltip";
483
483
  }>;
@@ -496,9 +496,9 @@ declare const _default: import("vue").DefineComponent<{
496
496
  hide: boolean;
497
497
  }>;
498
498
  draggable: boolean;
499
- isHighlightRow: boolean;
500
499
  idx: number;
501
500
  isHighlight: boolean;
501
+ isHighlightRow: boolean;
502
502
  isFieldSet: boolean;
503
503
  fieldDescribeMode: "column" | "tooltip";
504
504
  }>;
@@ -613,9 +613,9 @@ declare const _default: import("vue").DefineComponent<{
613
613
  hide: boolean;
614
614
  }>;
615
615
  draggable: boolean;
616
- isHighlightRow: boolean;
617
616
  idx: number;
618
617
  isHighlight: boolean;
618
+ isHighlightRow: boolean;
619
619
  isFieldSet: boolean;
620
620
  fieldDescribeMode: "column" | "tooltip";
621
621
  }>;
@@ -317,9 +317,9 @@ declare const _default: import("vue").DefineComponent<{
317
317
  hide: boolean;
318
318
  }>;
319
319
  draggable: boolean;
320
- isHighlightRow: boolean;
321
320
  idx: number;
322
321
  isHighlight: boolean;
322
+ isHighlightRow: boolean;
323
323
  isFieldSet: boolean;
324
324
  fieldDescribeMode: "column" | "tooltip";
325
325
  }>;
@@ -5121,6 +5121,9 @@ declare const IhoTable: SFCWithInstall<import("vue").DefineComponent<{
5121
5121
  updateFieldListRefDebounced: () => void;
5122
5122
  updateFieldListRef: () => void;
5123
5123
  dataTransfer: (data: import("../../shared/types").AnyObject[]) => Promise<import("../../shared/types").AnyObject[]>;
5124
+ tableDataResolved: null;
5125
+ setTableDataResolved: (resolve: import("../../shared/types").AnyFn<any[], any>) => void;
5126
+ resolveTableData: () => Promise<void>;
5124
5127
  tableDataRef: import("vue").Ref<import("../../shared/types").AnyObject[]>;
5125
5128
  updateTableDataRefDebounced: () => Promise<void>;
5126
5129
  updateTableDataRef: () => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { FormRequestDefine, useVersion } from '../../../shared/hooks';
2
- import { AnyObject } from '../../../shared/types';
2
+ import { AnyFn, AnyObject } from '../../../shared/types';
3
3
  import { PropType } from 'vue';
4
4
  import { VxeTableInstance } from 'vxe-table';
5
5
  import { AnnotationItem } from '../../../components/annotation-edit/src/type';
@@ -5122,6 +5122,9 @@ declare const _default: import("vue").DefineComponent<{
5122
5122
  updateFieldListRefDebounced: () => void;
5123
5123
  updateFieldListRef: () => void;
5124
5124
  dataTransfer: (data: AnyObject[]) => Promise<AnyObject[]>;
5125
+ tableDataResolved: null;
5126
+ setTableDataResolved: (resolve: AnyFn) => void;
5127
+ resolveTableData: () => Promise<void>;
5125
5128
  tableDataRef: import("vue").Ref<AnyObject[]>;
5126
5129
  updateTableDataRefDebounced: () => Promise<void>;
5127
5130
  updateTableDataRef: () => Promise<void>;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,provide as o,computed as a,toRaw as l,watch as n,resolveComponent as r,openBlock as s,createElementBlock as i,mergeProps as u,unref as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as p,createVNode as v,withCtx as b,createSlots as g,renderList as h,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as D}from"vue";import{useTheme as $,createOpacityColor as C}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as j}from"@vueuse/core";import"date-fns";import{isString as T,isEqualWith as w,isFunction as I,pick as q}from"lodash-es";import{useFormAsyncQueue as R,presetRequestHandler as H}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{hex2rgba as P,widthAppend as A,uuidGenerator as L}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as S}from"naive-ui";import{useVersion as F}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as O,InjectionIhoTableXeInstance as B,InjectionIhoTableLoading as E,InjectionIhoTableEmits as W,InjectionTableAsyncQueue as N,InjectionIhoTableAnnotation as V,InjectionIhoTableUUID as z,InjectionIhoTableInstance as G,InjectionIhoTableConfig as J,InjectionIhoTableFieldList as K,InjectionIhoTableHandler as M,InjectionIhoTableGlobProps as Q}from"./constants/index.js";import{createTableHooks as U,applyTableConfigHooks as X,applyTableFieldHooks as Y,createTableEventHandlers as Z,createDomInsertComponent as ee,createDataTransfer as te}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as oe}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as ae}from"./utils/index.js";const le=["id"];var ne=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...O],setup(e,{expose:O,emit:ne}){var re,se;const ie=e,ue=t();o(B,ue);const ce=t(!1);o(E,ce);const de=$({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}),fe=a((()=>{var e,t,o;const a={...de.value};return a["--c-primary-color-opacity3"]=C(...P(a["--c-primary-color"]+""),.3),a["--c-scrollbar-width"]=A(null!=(o=null==(t=null==(e=ue.value)?void 0:e.reactData)?void 0:t.scrollbarWidth)?o:0),a})),me=a((()=>{var e,t;const o=null!=(t=null==(e=ie.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":T(o)&&(o.includes("calc")||o.endsWith("%"))?o:A(o)}})),pe=oe(),ve=function(e,...t){ne(e,...t);const o=c(ye)[ae(e)];I(o)&&o(...t),pe.trigger(e,...t)};o(W,ve);const be=R(a((()=>ie.requestInstance)),a((()=>!!ie.uniqueCacheData))).create(ie.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>H(t)});o(N,be);const ge=U();o(V,a((()=>ie.annotation)));const he=L();o(z,he);const xe=t();o(G,xe);const ye=t({uuid:null!=(se=null==(re=ie.tableConfig)?void 0:re.uuid)?se:he});o(J,ye);const ke=j(De,10);function De(){var e,t;ye.value=X(ge,{...ie.tableConfig,uuid:null!=(t=null==(e=ie.tableConfig)?void 0:e.uuid)?t:he},{$table:xe,emits:ve,globProps:ie,loading:ce,$xeTable:ue})}const $e=t([]);o(K,$e);const Ce=j(je,10);function je(){const e=Y(ge,ie.fieldList,ye.value,{$table:xe,emits:ve,loading:ce,globProps:ie,$xeTable:ue});w(e,l($e.value),((e,t)=>{if(I(e)&&I(t))return e.toString()===t.toString()}))||($e.value=e)}const Te=te(ge,ye,xe),we=t([]);async function Ie(){var e,t;const o=await Te(ie.tableData),a=null==(e=xe.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=xe.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}we.value=o,null==(t=xe.value)||t.recalculate(!0)}const qe={updateTableDataRef:j(Ie,10),updateConfigRef:ke,updateFieldListRef:Ce};o(M,qe),o(Q,ie);const Re=Z({hooks:ge,config:ye,$table:xe,context:qe,emits:ve,globProps:ie,loading:ce,$xeTable:ue}),He=a((()=>({...ye.value,...Re})));let _e=!1,Pe=!1,Ae=!1;const Le=j((()=>{_e&&De(),Pe&&je(),Ae&&Ie(),_e=!1,Pe=!1,Ae=!1}),10);n((()=>ie.tableConfig),(()=>{_e=!0,Pe=!0,Ae=!0,Le()}),{deep:!0}),n((()=>ie.fieldList),(()=>{Pe=!0,Ae=!0,Le()}),{deep:!0}),n([()=>[...ie.tableData],()=>{var e;return null==(e=ie.tableData)?void 0:e.length}],(()=>{Ae=!0,Le()})),n([()=>ie.tableData,()=>{var e;return null==(e=ie.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=ye.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=xe.value)||t.setAllTreeExpand(!0))})),De(),je(),Ie();const{header:Se,footer:Fe}=ee(ge);function Oe(e){return q(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return O({$table:xe,async loadData(e){var t;null==(t=xe.value)||t.loadData(await Te(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),reload(){var e,t;null==(e=xe.value)||e.loadColumn([]),null==(t=xe.value)||t.loadData([]),De(),je(),Ie()},verticalTable:{update:()=>{}},...ge.exposeHooks.expose.call({},ye,{$table:xe,emits:ve,globProps:ie,loading:ce,$xeTable:ue,...qe})}),ge.setupHooks.setup.call(ye,$e,{$table:xe,emits:ve,globProps:ie,loading:ce,$xeTable:ue}),(e,t)=>{const o=r("vxe-grid");return s(),i("section",u({class:"iho-table",id:c(he),style:c(fe)},c(F)()),[(s(),d(f(c(Se)))),m("section",{style:p(c(me))},[v(c(S),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[v(o,u({ref_key:"$table",ref:xe},c(He),{columns:$e.value,data:we.value,loading:ce.value}),g({_:2},[h(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(D(Oe(t))))]))})))]),1040,["columns","data","loading"])])),_:3})],4),(s(),d(f(c(Fe))))],16,le)}}});export{ne as default};
1
+ import{defineComponent as e,ref as t,provide as o,computed as a,toRaw as l,watch as n,resolveComponent as r,openBlock as s,createElementBlock as i,mergeProps as u,unref as c,createBlock as d,resolveDynamicComponent as f,createElementVNode as m,normalizeStyle as v,createVNode as p,withCtx as b,createSlots as g,renderList as h,createCommentVNode as x,renderSlot as y,normalizeProps as k,guardReactiveProps as D,nextTick as $}from"vue";import{useTheme as C,createOpacityColor as j}from"../../../shared/hooks/useTheme.js";import{useDebounceFn as w}from"@vueuse/core";import"date-fns";import{isString as T,isEqualWith as I,isFunction as R,pick as q}from"lodash-es";import{useFormAsyncQueue as H,presetRequestHandler as P}from"../../../shared/hooks/useFormRequest/index.js";import{promiseTimeout as _}from"@vueuse/shared";import{hex2rgba as A,widthAppend as L,uuidGenerator as S}from"../../../shared/utils/index.js";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{NConfigProvider as F}from"naive-ui";import{useVersion as O}from"../../../shared/hooks/useVersion.js";import{VxeTableEventNameList as B,InjectionIhoTableXeInstance as E,InjectionIhoTableLoading as W,InjectionIhoTableEmits as N,InjectionTableAsyncQueue as V,InjectionIhoTableAnnotation as z,InjectionIhoTableUUID as G,InjectionIhoTableInstance as J,InjectionIhoTableConfig as K,InjectionIhoTableFieldList as M,InjectionIhoTableHandler as Q,InjectionIhoTableGlobProps as U}from"./constants/index.js";import{createTableHooks as X,applyTableConfigHooks as Y,applyTableFieldHooks as Z,createTableEventHandlers as ee,createDomInsertComponent as te,createDataTransfer as oe}from"./hooks/tapHooks/index.js";import{provideIhoTableEventListener as ae}from"./hooks/tapHooks/useEventHooks.js";import{eventName2EventListener as le}from"./utils/index.js";const ne=["id"];var re=e({__name:"IhoTable",props:{tableConfig:{type:Object,default:()=>({})},fieldList:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},annotation:{type:Object},requestInstance:{type:Object},uniqueCacheData:{type:Boolean,default:!1},parallelism:{type:Number,default:3}},emits:["formChange","settingClick","formClick","keyboard","rowDrag",...B],setup(e,{expose:B,emit:re}){var se,ie;const ue=e,ce=t();o(E,ce);const de=t(!1);o(W,de);const fe=C({"--c-border-color":"#d0d0d0","--c-head-bg-color":"#f2f2f2","--c-hover-color":"#e6e6e6","--c-stripe-color":"#f6f6f6"}),me=a((()=>{var e,t,o;const a={...fe.value};return a["--c-primary-color-opacity3"]=j(...A(a["--c-primary-color"]+""),.3),a["--c-scrollbar-width"]=L(null!=(o=null==(t=null==(e=ce.value)?void 0:e.reactData)?void 0:t.scrollbarWidth)?o:0),a})),ve=a((()=>{var e,t;const o=null!=(t=null==(e=ue.tableConfig)?void 0:e.height)?t:"100%";return{height:"auto"===o?"100%":T(o)&&(o.includes("calc")||o.endsWith("%"))?o:L(o)}})),pe=ae(),be=function(e,...t){re(e,...t);const o=c(ke)[le(e)];R(o)&&o(...t),pe.trigger(e,...t)};o(N,be);const ge=H(a((()=>ue.requestInstance)),a((()=>!!ue.uniqueCacheData))).create(ue.parallelism,{beforeRequest:(e,t)=>t,afterRequest:(e,t)=>P(t)});o(V,ge);const he=X();o(z,a((()=>ue.annotation)));const xe=S();o(G,xe);const ye=t();o(J,ye);const ke=t({uuid:null!=(ie=null==(se=ue.tableConfig)?void 0:se.uuid)?ie:xe});o(K,ke);const De=w($e,10);function $e(){var e,t;ke.value=Y(he,{...ue.tableConfig,uuid:null!=(t=null==(e=ue.tableConfig)?void 0:e.uuid)?t:xe},{$table:ye,emits:be,globProps:ue,loading:de,$xeTable:ce})}const Ce=t([]);o(M,Ce);const je=w(we,10);function we(){const e=Z(he,ue.fieldList,ke.value,{$table:ye,emits:be,loading:de,globProps:ue,$xeTable:ce});I(e,l(Ce.value),((e,t)=>{if(R(e)&&R(t))return e.toString()===t.toString()}))||(Ce.value=e)}const Te=oe(he,ke,ye);let Ie=null;function Re(e){Ie=e}const qe=t([]);async function He(){var e,t;const o=await Te(ue.tableData),a=null==(e=ye.value)?void 0:e.getTableData().fullData;if(a){let e=0;if(!(a.some((t=>{var a;if(!(null==(a=ye.value)?void 0:a.isInsertByRow(t))){if(t!==o[e])return!0;e++}}))||e!==o.length))return}qe.value=o,null==(t=ye.value)||t.recalculate(!0),async function(){await $(),null==Ie||Ie(),Ie=null}()}const Pe={updateTableDataRef:w(He,10),updateConfigRef:De,updateFieldListRef:je};o(Q,Pe),o(U,ue);const _e=ee({hooks:he,config:ke,$table:ye,context:Pe,emits:be,globProps:ue,loading:de,$xeTable:ce}),Ae=a((()=>({...ke.value,..._e})));let Le=!1,Se=!1,Fe=!1;const Oe=w((()=>{Le&&$e(),Se&&we(),Fe&&He(),Le=!1,Se=!1,Fe=!1}),10);n((()=>ue.tableConfig),(()=>{Le=!0,Se=!0,Fe=!0,Oe()}),{deep:!0}),n((()=>ue.fieldList),(()=>{Se=!0,Fe=!0,Oe()}),{deep:!0}),n([()=>[...ue.tableData],()=>{var e;return null==(e=ue.tableData)?void 0:e.length}],(()=>{Fe=!0,Oe()})),n([()=>ue.tableData,()=>{var e;return null==(e=ue.tableData)?void 0:e.length}],(async()=>{var e,t;(null==(e=ke.value.treeConfig)?void 0:e.expandAll)&&(await _(11),null==(t=ye.value)||t.setAllTreeExpand(!0))})),$e(),we(),He();const{header:Be,footer:Ee}=te(he);function We(e){return q(e,["row","rowIndex","$rowIndex","column","columnIndex","$columnIndex","_columnIndex","checked","disabled","indeterminate"])}return B({$table:ye,async loadData(e){var t;null==(t=ye.value)||t.loadData(await Te(e))},setSort:(e,t)=>({field:e,value:t}),setFilter:(e,t)=>({field:e,value:t}),tableDataResolved:()=>new Promise(Re),reload(){var e,t;null==(e=ye.value)||e.loadColumn([]),null==(t=ye.value)||t.loadData([]),$e(),we(),He()},verticalTable:{update:()=>{}},...he.exposeHooks.expose.call({},ke,{$table:ye,emits:be,globProps:ue,loading:de,$xeTable:ce,...Pe})}),he.setupHooks.setup.call(ke,Ce,{$table:ye,emits:be,globProps:ue,loading:de,$xeTable:ce}),(e,t)=>{const o=r("vxe-grid");return s(),i("section",u({class:"iho-table",id:c(xe),style:c(me)},c(O)()),[(s(),d(f(c(Be)))),m("section",{style:v(c(ve))},[p(c(F),{abstract:"",namespace:"vxe-table--ignore-clear"},{default:b((()=>[p(o,u({ref_key:"$table",ref:ye},c(Ae),{columns:Ce.value,data:qe.value,loading:de.value}),g({_:2},[h(e.$slots,((t,o)=>({name:o,fn:b((t=>[x(" 实际上所有的vxe-grid插槽都支持 "),y(e.$slots,o,k(D(We(t))))]))})))]),1040,["columns","data","loading"])])),_:3})],4),(s(),d(f(c(Ee))))],16,ne)}}});export{re as default};
@@ -255,6 +255,7 @@ export declare type IhoTableExpose = {
255
255
  verticalTable: {
256
256
  update: () => void;
257
257
  };
258
+ tableDataResolved(): Promise<void>;
258
259
  };
259
260
  export declare type IhoTableSeparateInfo = {
260
261
  index: number;
@@ -1 +1 @@
1
- var e="@cnhis-design-vue/shared",i="3.2.5-beta.37",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.37",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
1
+ var e="@cnhis-design-vue/shared",i="3.2.5-beta.39",s="index.ts",n={"naive-ui":"^2.30.0",vue:"^3.2.0"},a={"@vicons/ionicons5":"^0.12.0","lodash-es":"^4.17.21",moment:"^2.29.1","video.js":"^7.19.2","videojs-contrib-hls":"^5.15.0",viewerjs:"^1.10.5","xe-utils":"^3.5.4"},d={name:e,version:"3.2.5-beta.39",private:!0,main:"index.ts",peerDependencies:n,dependencies:a};export{d as default,a as dependencies,s as main,e as name,n as peerDependencies,i as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "3.2.5-beta.37",
3
+ "version": "3.2.5-beta.39",
4
4
  "license": "ISC",
5
5
  "module": "./es/components/index.js",
6
6
  "main": "./es/components/index.js",
@@ -71,5 +71,5 @@
71
71
  "iOS 7",
72
72
  "last 3 iOS versions"
73
73
  ],
74
- "gitHead": "9449e230a5c793941407e2b6bce7d3394535f661"
74
+ "gitHead": "b5c4b4081c0f9e8851e572b4624db892eeaab332"
75
75
  }