@ecan-bi/pivot-table 1.0.48 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @ecan-bi/pivot-table@1.0.
|
|
1
|
+
/*! @ecan-bi/pivot-table@1.0.50 */
|
|
2
2
|
(function(Ye,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue"),require("dayjs"),require("lodash-es"),require("axios"),require("ant-design-vue"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("echarts"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","axios","ant-design-vue","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","echarts","vuedraggable"],v):(Ye=typeof globalThis<"u"?globalThis:Ye||self,v(Ye["@ecan-bi/pivot-table"]={},Ye.Vue,Ye.Dayjs,Ye.LodashEs,Ye.Axios,Ye.AntDesignVue,null,null,Ye.Echarts,Ye.Draggable))})(this,function(Ye,v,Mo,Xe,aB,Vi,QK,tY,hB,ub){"use strict";function dB(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const uB=dB(hB),cB=i=>(i.install=t=>{t.component(i.name,i)},i);function cb(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e}const gB=()=>{},fB=Object.assign,pB=Array.isArray,lf=i=>typeof i=="function",mB=i=>typeof i=="symbol";let gb;const af=()=>gb||(gb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function hf(i){const t=i&&i.__v_raw;return t?hf(t):i}function fb(i){return!(!i||i.__v_isRef!==!0)}function ji(i){return fb(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(mB));const Ir=[];function df(i,...t){if(process.env.NODE_ENV==="production")return;const e=Ir.length?Ir[Ir.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=Ir[Ir.length-1];if(!r)return[];const s=[];for(;r;){const l=s[0];l&&l.vnode===r?l.recurseCount++:s.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return s}();if(n)uf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${Sb(e,r.type)}>`).join(`
|
|
3
3
|
`),o]);else{const r=[`[Vue warn]: ${i}`,...t];o.length&&r.push(`
|
|
4
4
|
`,...function(s){const l=[];return s.forEach((a,h)=>{l.push(...h===0?[]:[`
|
|
@@ -370,5 +370,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
370
370
|
}else{
|
|
371
371
|
return false
|
|
372
372
|
}
|
|
373
|
-
}`;return Function(`"use strict";return (${X})`)().call(this,K)}function NK(V){y.value=!0;const{value:K,key:X}=V;v.unref(_)[X]=K,mK(),e("tableChange",{type:"6",data:{key:X,value:K}})}function Nl(){return n==null?void 0:n.getDrawRange()}const rf=v.ref([]),nB=v.ref(""),oB=v.ref(),VK=(V,K)=>{var Ke,ln,Rs,Ts,Ro;const X=K.dataViewColumns[V.oldIndex]||{},{scope:Q}=X;let et=!1,it=!1;["IDX","BUILT_IN_IDX"].includes(Q)?et=!0:["DIM","BUILT_IN_DIM"].includes(Q)&&(it=!0);const Z=Nl(),{rows:pt,columns:St,indicators:Jt,records:Ut}=lt,{top:Wt,left:Et}=Z;if(v.unref(dt)){let ui=i.height;i.isIframeMode&&(ui=document.body.clientHeight+"px");let ze=v.unref(ht).width;ze.includes("calc")&&(ze=v.unref(Ct)-v.unref(H)+"px"),F.value.main={width:ze,height:ui,top:Wt+v.unref(Ae)+"px",left:Et+v.unref(pe)+v.unref(Ae)+j+"px"},F.value.rows={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)-ne*2+"px",top:0,left:0},F.value.columns={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)/3-ne*2+"px",top:0,left:parseFloat(ze)/2+"px"},F.value.indicators={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)*2/3-ne*2+"px",top:parseFloat(ui)/3+"px",left:parseFloat(ze)/2+"px"}}else{let ui=50;(Ke=v.unref(mt))!=null&&Ke.length?ui=v.unref(O).clientHeight:it&&(N.value=!0,v.unref(at).height=ui+"px");let ze=0,jt=1;const be=n.getRowHeight(0),hi={columnHeaderTitle:!0};if(St!=null&&St.length?jt+=St.length:hi.columns=[{dimensionKey:Nh(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ci,je)=>{ze+=n.getColWidth(je)}):(ze=100,hi.rows=[{dimensionKey:Nh(6),title:"",width:"100px",type:"rows"}]),Jt!=null&&Jt.length||(hi.indicators=[{indicatorKey:Nh(6),title:"",width:"20%",format:()=>""}]),(ln=Object.keys(hi))!=null&&ln.length){const{rows:Ci=[],columns:je=[]}=hi;let yi=[];Ut!=null&&Ut.length?yi=Xe.cloneDeep(Ut):(Ts=(Rs=v.unref(I))==null?void 0:Rs.records)!=null&&Ts.length&&(yi=Xe.cloneDeep((Ro=v.unref(I))==null?void 0:Ro.records));let ki=St.map(Ms=>Ms.dimensionKey);if(!(ki!=null&&ki.length)&&(je!=null&&je.length)&&(ki=[je[0].dimensionKey]),yi!=null&&yi.length)for(const Ms of yi){for(const Bs of Ci)Ms[Bs.dimensionKey]="";let jh=!1;for(const Bs in Ms)if(ki.includes(Bs)){jh=!0;break}it?jh||(jt=2,Ms[ki[0]]=""):et&&(jh||(jt=1))}n.updateOption({...lt,...hi,records:yi})}v.nextTick(()=>{var ki;const Ci=Nl(),je=Ci.width,yi=Ci.height;F.value.main={width:je+"px",height:yi+ui+"px",top:Wt+v.unref(Ae)+"px",left:Et+v.unref(pe)+v.unref(Ae)+j+"px"},F.value.rows={width:ze-ne*2+"px",height:yi-ne*2+"px",top:ui+"px",left:0},F.value.columns={width:je-ze-ne*2+"px",height:jt*be-ne*2+"px",top:ui+"px",left:ze+"px"},F.value.indicators={width:je-ze-ne*2+"px",height:yi-jt*be-ne*2+"px",top:jt*be+((ki=v.unref(mt))!=null&&ki.length?ui:0)+"px",left:ze+"px"},F.value.filters={width:je-ne*2+"px",height:ui-ne*2+"px",top:0,left:0}})}P.value=X,et?rf.value=[0,1]:it&&(rf.value=[2])},jK=()=>{var V;(V=v.unref(I).records)!=null&&V.length?n.updateOption({...lt,records:v.unref(I).records}):n.updateOption(lt),N.value=!1,v.unref(at).height="",rf.value=[]},$K=()=>{var V;(V=v.unref(oB))==null||V.handleSearch(v.unref(nB))},GK=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:_.value,sortData:R.value,colSortData:A.value,indSortData:x.value,aggregateMap:T.value,subMenuLeft:M.value,subMenuTop:B.value,dragAreaStyle:F.value,showTreeData:E.value,largeVisible:L.value,temporaryData:I.value,splitSymbol:$,sourceListStyle:tt.value,dimensionFieldList:q.value,indicatorFieldList:xt.value,computedIndKeys:Rt.value,computedIndMap:ie.value,computedIndFieldMap:Zt.value,option:lt,loadingRect:we.value,calculateList:Yt.value,filterList:yt.value,topNumMap:Bt.value,sortMap:It.value,customDimensions:te.value,customIndicators:me.value,customRowKeys:Gt.value,customColKeys:Ft.value,cacheResData:W.value,toolBoxStyle:As.value,scrollTop:k.value,scrollLeft:D.value}));v.watch(GK,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});const rB=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,_.value=V.topNumData,R.value=V.sortData,A.value=V.colSortData,x.value=V.indSortData,T.value=V.aggregateMap,M.value=V.subMenuLeft,B.value=V.subMenuTop,F.value=V.dragAreaStyle,E.value=V.showTreeData,L.value=V.largeVisible,I.value=V.temporaryData,$=V.splitSymbol,tt.value=V.sourceListStyle,q.value=V.dimensionFieldList,xt.value=V.indicatorFieldList,Rt.value=V.computedIndKeys,ie.value=V.computedIndMap,Zt.value=V.computedIndFieldMap,we.value=V.loadingRect,Yt.value=V.calculateList,yt.value=V.filterList,Bt.value=V.topNumMap,It.value=V.sortMap,te.value=V.customDimensions,me.value=V.customIndicators,Gt.value=V.customRowKeys,Ft.value=V.customColKeys,W.value=V.cacheResData,As.value=V.toolBoxStyle,k.value=V.scrollTop,D.value=V.scrollLeft,Object.assign(lt,V.option)};async function UK(V){var Q,et;y.value=!0,V&&rB(V);const K=await Pe("get",{keyName:i.relateKeyName||i.keyName}),X=((et=(Q=K==null?void 0:K.data)==null?void 0:Q.data)==null?void 0:et.searchMap)||{};if(X!=null&&X.data){v.unref(a)||(a.value={}),v.unref(h)||(h.value={});const it=[];for(const Z of X.data)Z.type==="dimension"?a.value[Z.key]=Z.data:Z.type==="indicators"&&(h.value[Z.key]=Z.data),it.push({type:Z.type,key:Z.key,rule:Z.data});it!=null&&it.length&&nf(it,{isHandle:!1})}rr()}function KK(){return{dimensions:v.unref(q),indicators:v.unref(xt)}}const YK=V=>{const{scope:K,name:X,label:Q}=V;let et=[];["IDX","BUILT_IN_IDX"].includes(K)?et=v.unref(xt):["DIM","BUILT_IN_DIM"].includes(K)&&(et=v.unref(q));const it=et.findIndex(Z=>Z.name===X);if(it!==-1){delete v.unref(a)[et[it].label];const Z=v.unref(yt).findIndex(pt=>pt.key===Q);Z!==-1&&v.unref(yt).splice(Z,1),et[it].show?et[it].isInnerFilter=!1:et.splice(it,1)}y.value=!0,Vh(),e("tableChange",{type:"10",data:{dimensions:v.unref(q),indicators:v.unref(xt)}})},XK=V=>{const{scope:K,label:X,showTitle:Q}=V,et=RP(K);et==="indicator"||et==="dimension"&&eB({dimensionKey:X,value:Q})};t({option:lt,refreshData:UK,reRenderTable:rB,click:iB,getDrawRange:Nl,getSaveData:KK}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],([V,K,X])=>{const{queryColumnList:Q=[],indicators:et=[]}=V,it=Xe.cloneDeep(Q),Z=Xe.cloneDeep(et);for(const pt of it){const St=K.find(Jt=>Jt.key===pt.name);pt.positionType=(St==null?void 0:St.position)||"rows",pt.width=St==null?void 0:St.width,pt.showTitle=pt.label}for(const pt of Z){const St=X.find(Jt=>Jt.key===pt.name);pt.width=St==null?void 0:St.width,pt.showTitle=pt.label}q.value=it,xt.value=Z},{immediate:!0,deep:!0});const qK=()=>{o.value=!1,E.value=!E.value},ZK=()=>{o.value=!1,L.value=!L.value,window.enScale&&window.enScale(v.unref(L))},JK=V=>{const K=v.unref(q).find(it=>it.label===V),X=v.unref(xt).find(it=>it.label===V),Q=K||X,et=v.unref(a)[V];return et?Q.genericType==="DATE"?Array.isArray(et)?`${et[0].value}~${et[1].value}`:et.value:et.value&&Array.isArray(et.value)?et.value.join("、"):"":""};return v.onMounted(()=>{}),{showDefaultTableArea:dt,maskList:rf,styleData:ct,subMenuLeft:M,subMenuTop:B,pivotTableRef:w,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,pivotAggregateRef:p,filterData:d,loadingRect:we,loading:y,isTableInit:o,toolBoxStyle:As,indSourceRef:oB,searchText:nB,dragAreaStyle:F,offsetWidth:pe,showTreeData:E,dataIconStyle:wt,largeVisible:L,sourceListStyle:tt,defaultTableStyle:ht,innerFilterStyle:at,innerFilterFieldList:mt,innerFilterRef:O,showFilterWrap:N,customDimensions:te,indicatorFieldList:xt,dimensionFieldList:q,click:iB,onFilterChange:OK,pivotDetailRef:S,handleFormat:zK,handleCondition:WK,handleAggregate:CK,handleGetTop:NK,handleConfig:kK,handleClearFilter:LK,handleGetConfig:FK,onDragStart:VK,onDragEnd:jK,onSearch:$K,handleAddField:IK,toggleShowData:qK,handleEnScale:ZK,adjustHSL:cC,handleDelFilterTag:YK,handleInnerFilter:XK,getFilterValue:JK}}}),OY="",zY="",lK={key:0,class:"design-template"},aK=["id"],hK=["onClick"],dK=["title"],uK=["id"];function cK(i,t,e,n,o,r){var T,M;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),w=v.resolveComponent("pivot-property"),S=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),_=v.resolveComponent("pivot-aggregate"),R=v.resolveComponent("pivot-top"),A=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",lK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),id:`pivotWrap_${i.id}`},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=B=>i.searchText=B),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((T=i.innerFilterFieldList)!=null&&T.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,B=>(v.openBlock(),v.createElementBlock("div",{key:B.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:H=>i.handleInnerFilter(B)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(B.showTitle),5),i.getFilterValue(B.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(B.label)},v.toDisplayString(i.getFilterValue(B.label)),13,dK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:"14px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:"14px",color:i.styleData.headerColor}),onClick:v.withModifiers(H=>i.handleDelFilterTag(B),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,hK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,uK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large"})],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0},{title:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...B)=>i.toggleShowData&&i.toggleShowData(...B))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1})):v.createCommentVNode("",!0),v.createVNode(d,null,{title:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...B)=>i.handleEnScale&&i.handleEnScale(...B))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:{"font-size":"14px",color:"#416EFF"}})):(v.openBlock(),v.createBlock(f,{key:1,style:{"font-size":"14px"}}))],2)):v.createCommentVNode("",!0)]),_:1}),v.createVNode(d,null,{title:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("设置")])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...B)=>i.handleConfig&&i.handleConfig(...B))},[v.createVNode(p,{style:{"font-size":"14px"}})],2)]),_:1}),v.createVNode(d,null,{title:v.withCtx(()=>t[7]||(t[7]=[v.createTextVNode("清空筛选条件")])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...B)=>i.handleClearFilter&&i.handleClearFilter(...B))},[v.createVNode(m,{style:{"font-size":"14px"}})],2)]),_:1})],4)):v.createCommentVNode("",!0),(M=i.maskList)!=null&&M.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],10,aK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(w,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(S,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(_,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"])],8,["to","disabled"]))}const jM=cB(Hi(sK,[["render",cK],["__scopeId","data-v-a54be82b"]])),$M=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:jM},Symbol.toStringTag,{value:"Module"})),gK={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys($M).forEach(n=>{const o=$M[n];o.install&&i.use(o)})}};Ye.EcanPivotTable=jM,Ye.default=gK,Object.defineProperties(Ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
373
|
+
}`;return Function(`"use strict";return (${X})`)().call(this,K)}function NK(V){y.value=!0;const{value:K,key:X}=V;v.unref(_)[X]=K,mK(),e("tableChange",{type:"6",data:{key:X,value:K}})}function Nl(){return n==null?void 0:n.getDrawRange()}const rf=v.ref([]),nB=v.ref(""),oB=v.ref(),VK=(V,K)=>{var Ke,ln,Rs,Ts,Ro;const X=K.dataViewColumns[V.oldIndex]||{},{scope:Q}=X;let et=!1,it=!1;["IDX","BUILT_IN_IDX"].includes(Q)?et=!0:["DIM","BUILT_IN_DIM"].includes(Q)&&(it=!0);const Z=Nl(),{rows:pt,columns:St,indicators:Jt,records:Ut}=lt,{top:Wt,left:Et}=Z;if(v.unref(dt)){let ui=i.height;i.isIframeMode&&(ui=document.body.clientHeight+"px");let ze=v.unref(ht).width;ze.includes("calc")&&(ze=v.unref(Ct)-v.unref(H)+"px"),F.value.main={width:ze,height:ui,top:Wt+v.unref(Ae)+"px",left:Et+v.unref(pe)+v.unref(Ae)+j+"px"},F.value.rows={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)-ne*2+"px",top:0,left:0},F.value.columns={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)/3-ne*2+"px",top:0,left:parseFloat(ze)/2+"px"},F.value.indicators={width:parseFloat(ze)/2-ne*2+"px",height:parseFloat(ui)*2/3-ne*2+"px",top:parseFloat(ui)/3+"px",left:parseFloat(ze)/2+"px"}}else{let ui=50;(Ke=v.unref(mt))!=null&&Ke.length?ui=v.unref(O).clientHeight:it&&(N.value=!0,v.unref(at).height=ui+"px");let ze=0,jt=1;const be=n.getRowHeight(0),hi={columnHeaderTitle:!0};if(St!=null&&St.length?jt+=St.length:hi.columns=[{dimensionKey:Nh(6),title:"",width:"100px",type:"columns"}],pt!=null&&pt.length?pt.forEach((Ci,je)=>{ze+=n.getColWidth(je)}):(ze=100,hi.rows=[{dimensionKey:Nh(6),title:"",width:"100px",type:"rows"}]),Jt!=null&&Jt.length||(hi.indicators=[{indicatorKey:Nh(6),title:"",width:"20%",format:()=>""}]),(ln=Object.keys(hi))!=null&&ln.length){const{rows:Ci=[],columns:je=[]}=hi;let yi=[];Ut!=null&&Ut.length?yi=Xe.cloneDeep(Ut):(Ts=(Rs=v.unref(I))==null?void 0:Rs.records)!=null&&Ts.length&&(yi=Xe.cloneDeep((Ro=v.unref(I))==null?void 0:Ro.records));let ki=St.map(Ms=>Ms.dimensionKey);if(!(ki!=null&&ki.length)&&(je!=null&&je.length)&&(ki=[je[0].dimensionKey]),yi!=null&&yi.length)for(const Ms of yi){for(const Bs of Ci)Ms[Bs.dimensionKey]="";let jh=!1;for(const Bs in Ms)if(ki.includes(Bs)){jh=!0;break}it?jh||(jt=2,Ms[ki[0]]=""):et&&(jh||(jt=1))}n.updateOption({...lt,...hi,records:yi})}v.nextTick(()=>{var ki;const Ci=Nl(),je=Ci.width,yi=Ci.height;F.value.main={width:je+"px",height:yi+ui+"px",top:Wt+v.unref(Ae)+"px",left:Et+v.unref(pe)+v.unref(Ae)+j+"px"},F.value.rows={width:ze-ne*2+"px",height:yi-ne*2+"px",top:ui+"px",left:0},F.value.columns={width:je-ze-ne*2+"px",height:jt*be-ne*2+"px",top:ui+"px",left:ze+"px"},F.value.indicators={width:je-ze-ne*2+"px",height:yi-jt*be-ne*2+"px",top:jt*be+((ki=v.unref(mt))!=null&&ki.length?ui:0)+"px",left:ze+"px"},F.value.filters={width:je-ne*2+"px",height:ui-ne*2+"px",top:0,left:0}})}P.value=X,et?rf.value=[0,1]:it&&(rf.value=[2])},jK=()=>{var V;(V=v.unref(I).records)!=null&&V.length?n.updateOption({...lt,records:v.unref(I).records}):n.updateOption(lt),N.value=!1,v.unref(at).height="",rf.value=[]},$K=()=>{var V;(V=v.unref(oB))==null||V.handleSearch(v.unref(nB))},GK=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:_.value,sortData:R.value,colSortData:A.value,indSortData:x.value,aggregateMap:T.value,subMenuLeft:M.value,subMenuTop:B.value,dragAreaStyle:F.value,showTreeData:E.value,largeVisible:L.value,temporaryData:I.value,splitSymbol:$,sourceListStyle:tt.value,dimensionFieldList:q.value,indicatorFieldList:xt.value,computedIndKeys:Rt.value,computedIndMap:ie.value,computedIndFieldMap:Zt.value,option:lt,loadingRect:we.value,calculateList:Yt.value,filterList:yt.value,topNumMap:Bt.value,sortMap:It.value,customDimensions:te.value,customIndicators:me.value,customRowKeys:Gt.value,customColKeys:Ft.value,cacheResData:W.value,toolBoxStyle:As.value,scrollTop:k.value,scrollLeft:D.value}));v.watch(GK,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});const rB=V=>{r.value=V.defaultSortRule,s.value=V.dimensionData,l.value=V.currentClickCell,a.value=V.dimFilterData,h.value=V.indFilterData,d.value=V.filterData,c.value=V.indFilterConfig,_.value=V.topNumData,R.value=V.sortData,A.value=V.colSortData,x.value=V.indSortData,T.value=V.aggregateMap,M.value=V.subMenuLeft,B.value=V.subMenuTop,F.value=V.dragAreaStyle,E.value=V.showTreeData,L.value=V.largeVisible,I.value=V.temporaryData,$=V.splitSymbol,tt.value=V.sourceListStyle,q.value=V.dimensionFieldList,xt.value=V.indicatorFieldList,Rt.value=V.computedIndKeys,ie.value=V.computedIndMap,Zt.value=V.computedIndFieldMap,we.value=V.loadingRect,Yt.value=V.calculateList,yt.value=V.filterList,Bt.value=V.topNumMap,It.value=V.sortMap,te.value=V.customDimensions,me.value=V.customIndicators,Gt.value=V.customRowKeys,Ft.value=V.customColKeys,W.value=V.cacheResData,As.value=V.toolBoxStyle,k.value=V.scrollTop,D.value=V.scrollLeft,Object.assign(lt,V.option)};async function UK(V){var Q,et;y.value=!0,V&&rB(V);const K=await Pe("get",{keyName:i.relateKeyName||i.keyName}),X=((et=(Q=K==null?void 0:K.data)==null?void 0:Q.data)==null?void 0:et.searchMap)||{};if(X!=null&&X.data){v.unref(a)||(a.value={}),v.unref(h)||(h.value={});const it=[];for(const Z of X.data)Z.type==="dimension"?a.value[Z.key]=Z.data:Z.type==="indicators"&&(h.value[Z.key]=Z.data),it.push({type:Z.type,key:Z.key,rule:Z.data});it!=null&&it.length&&nf(it,{isHandle:!1})}rr()}function KK(){return{dimensions:v.unref(q),indicators:v.unref(xt)}}const YK=V=>{const{scope:K,name:X,label:Q}=V;let et=[];["IDX","BUILT_IN_IDX"].includes(K)?et=v.unref(xt):["DIM","BUILT_IN_DIM"].includes(K)&&(et=v.unref(q));const it=et.findIndex(Z=>Z.name===X);if(it!==-1){delete v.unref(a)[et[it].label];const Z=v.unref(yt).findIndex(pt=>pt.key===Q);Z!==-1&&v.unref(yt).splice(Z,1),et[it].show?et[it].isInnerFilter=!1:et.splice(it,1)}y.value=!0,Vh(),e("tableChange",{type:"10",data:{dimensions:v.unref(q),indicators:v.unref(xt)}})},XK=V=>{const{scope:K,label:X,showTitle:Q}=V,et=RP(K);et==="indicator"||et==="dimension"&&eB({dimensionKey:X,value:Q})};t({option:lt,refreshData:UK,reRenderTable:rB,click:iB,getDrawRange:Nl,getSaveData:KK}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],([V,K,X])=>{const{queryColumnList:Q=[],indicators:et=[]}=V,it=Xe.cloneDeep(Q),Z=Xe.cloneDeep(et);for(const pt of it){const St=K.find(Jt=>Jt.key===pt.name);pt.positionType=(St==null?void 0:St.position)||"rows",pt.width=St==null?void 0:St.width,pt.showTitle=pt.label}for(const pt of Z){const St=X.find(Jt=>Jt.key===pt.name);pt.width=St==null?void 0:St.width,pt.showTitle=pt.label}q.value=it,xt.value=Z},{immediate:!0,deep:!0});const qK=()=>{o.value=!1,E.value=!E.value},ZK=()=>{o.value=!1,L.value=!L.value,window.enScale&&window.enScale(v.unref(L))},JK=V=>{const K=v.unref(q).find(it=>it.label===V),X=v.unref(xt).find(it=>it.label===V),Q=K||X,et=v.unref(a)[V];return et?Q.genericType==="DATE"?Array.isArray(et)?`${et[0].value}~${et[1].value}`:et.value:et.value&&Array.isArray(et.value)?et.value.join("、"):"":""};return v.onMounted(()=>{}),{showDefaultTableArea:dt,maskList:rf,styleData:ct,subMenuLeft:M,subMenuTop:B,pivotTableRef:w,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,pivotAggregateRef:p,filterData:d,loadingRect:we,loading:y,isTableInit:o,toolBoxStyle:As,indSourceRef:oB,searchText:nB,dragAreaStyle:F,offsetWidth:pe,showTreeData:E,dataIconStyle:wt,largeVisible:L,sourceListStyle:tt,defaultTableStyle:ht,innerFilterStyle:at,innerFilterFieldList:mt,innerFilterRef:O,showFilterWrap:N,customDimensions:te,indicatorFieldList:xt,dimensionFieldList:q,click:iB,onFilterChange:OK,pivotDetailRef:S,handleFormat:zK,handleCondition:WK,handleAggregate:CK,handleGetTop:NK,handleConfig:kK,handleClearFilter:LK,handleGetConfig:FK,onDragStart:VK,onDragEnd:jK,onSearch:$K,handleAddField:IK,toggleShowData:qK,handleEnScale:ZK,adjustHSL:cC,handleDelFilterTag:YK,handleInnerFilter:XK,getFilterValue:JK}}}),OY="",zY="",lK={key:0,class:"design-template"},aK=["id"],hK=["onClick"],dK=["title"],uK=["id"];function cK(i,t,e,n,o,r){var T,M;const s=v.resolveComponent("a-input-search"),l=v.resolveComponent("ind-source-list"),a=v.resolveComponent("filter-outlined"),h=v.resolveComponent("delete-outlined"),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("a-spin"),c=v.resolveComponent("database-outlined"),g=v.resolveComponent("shrink-outlined"),f=v.resolveComponent("arrows-alt-outlined"),p=v.resolveComponent("setting-outlined"),m=v.resolveComponent("clear-outlined"),b=v.resolveComponent("drag-area"),C=v.resolveComponent("pivot-filter"),w=v.resolveComponent("pivot-property"),S=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),_=v.resolveComponent("pivot-aggregate"),R=v.resolveComponent("pivot-top"),A=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",lK," 透视表格 ")):(v.openBlock(),v.createBlock(v.Teleport,{key:1,to:i.enlargeContainer,disabled:!i.largeVisible},[v.createElementVNode("div",{class:v.normalizeClass(["pivot-wrap",[i.largeVisible?"large":"",i.theme]]),id:`pivotWrap_${i.id}`},[i.fullMode?v.withDirectives((v.openBlock(),v.createElementBlock("div",{key:0,class:"data-source-list",style:v.normalizeStyle(i.sourceListStyle)},[v.createVNode(s,{value:i.searchText,"onUpdate:value":t[0]||(t[0]=B=>i.searchText=B),placeholder:"请输入关键字",onSearch:i.onSearch},null,8,["value","onSearch"]),v.createVNode(l,{ref:"indSourceRef",hasChildren:!0,isSub:!1,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd,config:i.graphicConfig},null,8,["onOnDragStart","onOnDragEnd","config"])],4)),[[v.vShow,i.showTreeData]]):v.createCommentVNode("",!0),v.createElementVNode("div",{style:v.normalizeStyle({width:i.offsetWidth?`calc(100% - ${i.offsetWidth}px)`:"100%"})},[i.isTableInit&&(!i.showDefaultTableArea&&((T=i.innerFilterFieldList)!=null&&T.length)||i.showFilterWrap)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"inner-filter-wrap",style:v.normalizeStyle(i.innerFilterStyle),ref:"innerFilterRef"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.innerFilterFieldList,B=>(v.openBlock(),v.createElementBlock("div",{key:B.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:H=>i.handleInnerFilter(B)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(B.showTitle),5),i.getFilterValue(B.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(B.label)},v.toDisplayString(i.getFilterValue(B.label)),13,dK)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:"14px",color:i.styleData.headerColor})},null,8,["style"]),v.createVNode(d,{placement:"bottom"},{title:v.withCtx(()=>t[5]||(t[5]=[v.createElementVNode("span",null,"删除",-1)])),default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon",style:v.normalizeStyle({fontSize:"14px",color:i.styleData.headerColor}),onClick:v.withModifiers(H=>i.handleDelFilterTag(B),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,hK))),128))],4)):v.createCommentVNode("",!0),i.isTableInit&&i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:1,class:"empty-table",style:v.normalizeStyle(i.defaultTableStyle)}," 拖拽左侧数据源到此处 ",4)):v.createCommentVNode("",!0),v.withDirectives(v.createElementVNode("div",{class:"table-instance",style:{width:"100%"},id:i.pageMode!=="design"?`pivotTableContainer_${i.id}`:"",ref:"pivotTableRef"},null,8,uK),[[v.vShow,!i.showDefaultTableArea]])],4),i.loading?(v.openBlock(),v.createElementBlock("div",{key:1,class:"pivot-loading",style:v.normalizeStyle(i.loadingRect)},[v.createVNode(u,{size:"large"})],4)):v.createCommentVNode("",!0),i.pageMode!=="design"&&!i.graphicConfig.preview&&i.isTableInit&&!i.maskList.length&&!i.showDefaultTableArea?(v.openBlock(),v.createElementBlock("div",{key:2,class:"tool-box",style:v.normalizeStyle(i.toolBoxStyle)},[i.fullMode?(v.openBlock(),v.createBlock(d,{key:0},{title:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.showTreeData?"隐藏数据源":"显示数据源"),1)]),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-data",i.theme]),onClick:t[1]||(t[1]=(...B)=>i.toggleShowData&&i.toggleShowData(...B))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1})):v.createCommentVNode("",!0),v.createVNode(d,null,{title:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(i.largeVisible?"缩小":"放大"),1)]),default:v.withCtx(()=>[i.showFullScreen?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-large",i.theme]),onClick:t[2]||(t[2]=(...B)=>i.handleEnScale&&i.handleEnScale(...B))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:{"font-size":"14px",color:"#416EFF"}})):(v.openBlock(),v.createBlock(f,{key:1,style:{"font-size":"14px"}}))],2)):v.createCommentVNode("",!0)]),_:1}),v.createVNode(d,null,{title:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("设置")])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...B)=>i.handleConfig&&i.handleConfig(...B))},[v.createVNode(p,{style:{"font-size":"14px"}})],2)]),_:1}),v.createVNode(d,null,{title:v.withCtx(()=>t[7]||(t[7]=[v.createTextVNode("清空筛选条件")])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...B)=>i.handleClearFilter&&i.handleClearFilter(...B))},[v.createVNode(m,{style:{"font-size":"14px"}})],2)]),_:1})],4)):v.createCommentVNode("",!0),(M=i.maskList)!=null&&M.length?(v.openBlock(),v.createBlock(b,{key:3,style:v.normalizeStyle(i.dragAreaStyle),maskList:i.maskList,onAdd:i.handleAddField},null,8,["style","maskList","onAdd"])):v.createCommentVNode("",!0)],10,aK),v.createVNode(C,{ref:"pivotFilterRef",data:i.filterData,customDimensions:i.customDimensions,dimensions:i.dimensionFieldList,indicators:i.indicatorFieldList,onChange:i.onFilterChange},null,8,["data","customDimensions","dimensions","indicators","onChange"]),v.createVNode(w,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(S,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(_,{ref:"pivotAggregateRef",onConfirm:i.handleAggregate},null,8,["onConfirm"]),v.createVNode(R,{ref:"pivotTopRef",onConfirm:i.handleGetTop},null,8,["onConfirm"]),v.createVNode(A,{ref:"pivotDetailRef"},null,512),v.createVNode(x,{ref:"pivotConfigRef",fullMode:i.fullMode,onConfirm:i.handleGetConfig},null,8,["fullMode","onConfirm"])],8,["to","disabled"]))}const jM=cB(Hi(sK,[["render",cK],["__scopeId","data-v-29abcaa3"]])),$M=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:jM},Symbol.toStringTag,{value:"Module"})),gK={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys($M).forEach(n=>{const o=$M[n];o.install&&i.use(o)})}};Ye.EcanPivotTable=jM,Ye.default=gK,Object.defineProperties(Ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
374
374
|
//# sourceMappingURL=index.umd.js.map
|