@ecan-bi/pivot-table 1.0.68 → 1.0.71
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/{DrillModal-d4c40db4.mjs → DrillModal-36f4c56e.mjs} +3 -3
- package/dist/{DrillModal-d4c40db4.mjs.map → DrillModal-36f4c56e.mjs.map} +1 -1
- package/dist/{index-635d9326.mjs → index-d073710e.mjs} +5 -8
- package/dist/{index-635d9326.mjs.map → index-d073710e.mjs.map} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +3 -3
- 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.71 */
|
|
2
2
|
(function(Je,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):(Je=typeof globalThis<"u"?globalThis:Je||self,v(Je["@ecan-bi/pivot-table"]={},Je.Vue,Je.Dayjs,Je.LodashEs,Je.Axios,Je.AntDesignVue,null,null,Je.Echarts,Je.Draggable))})(this,function(Je,v,Fo,Ue,DB,Gi,nX,oX,OB,Hb){"use strict";function zB(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 NB=zB(OB),WB=i=>(i.install=t=>{t.component(i.name,i)},i);function Eb(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 VB=()=>{},jB=Object.assign,$B=Array.isArray,mf=i=>typeof i=="function",GB=i=>typeof i=="symbol";let Lb;const vf=()=>Lb||(Lb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bf(i){const t=i&&i.__v_raw;return t?bf(t):i}function kb(i){return!(!i||i.__v_isRef!==!0)}function Mi(i){return kb(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(GB));const Ur=[];function Cf(i,...t){if(process.env.NODE_ENV==="production")return;const e=Ur.length?Ur[Ur.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=Ur[Ur.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)yf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${jb(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?[]:[`
|
|
@@ -364,11 +364,11 @@
|
|
|
364
364
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mj(i,t){if(i){if(typeof i=="string")return QT(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return QT(i,t)}}function QT(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function vj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function bj(i){if(Array.isArray(i))return i}function tM(i){var t=ZT(i),e=fj(t,2),n=e[0],o=e[1];return Rv.setTwoToneColors({primaryColor:n,secondaryColor:o})}function Cj(){var i=Rv.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var yj=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function _j(i,t){return Aj(i)||xj(i,t)||Sj(i,t)||wj()}function wj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
365
365
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sj(i,t){if(i){if(typeof i=="string")return eM(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eM(i,t)}}function eM(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function xj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function Aj(i){if(Array.isArray(i))return i}function iM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Tv(i,o,e[o])})}return i}function Tv(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function Rj(i,t){if(i==null)return{};var e=Tj(i,t),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function Tj(i,t){if(i==null)return{};var e={},n=Object.keys(i),o,r;for(r=0;r<n.length;r++)o=n[r],!(t.indexOf(o)>=0)&&(e[o]=i[o]);return e}tM("#1890ff");var zl=function(t,e){var n,o=iM({},t,e.attrs),r=o.class,s=o.icon,l=o.spin,a=o.rotate,h=o.tabindex,d=o.twoToneColor,u=o.onClick,c=Rj(o,yj),g=(n={anticon:!0},Tv(n,"anticon-".concat(s.name),!!s.name),Tv(n,r,r),n),f=l===""||l||s.name==="loading"?"anticon-spin":"",p=h;p===void 0&&u&&(p=-1,c.tabindex=p);var m=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,b=ZT(d),C=_j(b,2),_=C[0],w=C[1];return v.createVNode("span",iM({role:"img","aria-label":s.name},c,{onClick:u,class:g}),[v.createVNode(Rv,{class:f,icon:s,primaryColor:_,secondaryColor:w,style:m},null)])};zl.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},zl.displayName="AntdIcon",zl.inheritAttrs=!1,zl.getTwoToneColor=Cj,zl.setTwoToneColor=tM;const fi=zl;var Mj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const Bj=Mj;function nM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Pj(i,o,e[o])})}return i}function Pj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Mv=function(t,e){var n=nM({},t,e.attrs);return v.createVNode(fi,nM({},n,{icon:Bj}),null)};Mv.displayName="ArrowsAltOutlined",Mv.inheritAttrs=!1;const Hj=Mv;var Ej={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"border",theme:"outlined"};const Lj=Ej;function oM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){kj(i,o,e[o])})}return i}function kj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bv=function(t,e){var n=oM({},t,e.attrs);return v.createVNode(fi,oM({},n,{icon:Lj}),null)};Bv.displayName="BorderOutlined",Bv.inheritAttrs=!1;const rM=Bv;var Fj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const Ij=Fj;function sM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Dj(i,o,e[o])})}return i}function Dj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Pv=function(t,e){var n=sM({},t,e.attrs);return v.createVNode(fi,sM({},n,{icon:Ij}),null)};Pv.displayName="CaretDownOutlined",Pv.inheritAttrs=!1;const Oj=Pv;var zj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const Nj=zj;function lM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Wj(i,o,e[o])})}return i}function Wj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Hv=function(t,e){var n=lM({},t,e.attrs);return v.createVNode(fi,lM({},n,{icon:Nj}),null)};Hv.displayName="CaretRightOutlined",Hv.inheritAttrs=!1;const Vj=Hv;var jj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"};const $j=jj;function aM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Gj(i,o,e[o])})}return i}function Gj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ev=function(t,e){var n=aM({},t,e.attrs);return v.createVNode(fi,aM({},n,{icon:$j}),null)};Ev.displayName="ClearOutlined",Ev.inheritAttrs=!1;const Uj=Ev;var Kj={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"};const Yj=Kj;function hM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Xj(i,o,e[o])})}return i}function Xj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Lv=function(t,e){var n=hM({},t,e.attrs);return v.createVNode(fi,hM({},n,{icon:Yj}),null)};Lv.displayName="CloseOutlined",Lv.inheritAttrs=!1;const dM=Lv;var qj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Zj=qj;function uM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Jj(i,o,e[o])})}return i}function Jj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var kv=function(t,e){var n=uM({},t,e.attrs);return v.createVNode(fi,uM({},n,{icon:Zj}),null)};kv.displayName="DatabaseOutlined",kv.inheritAttrs=!1;const Qj=kv;var t$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const e$=t$;function cM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){i$(i,o,e[o])})}return i}function i$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Fv=function(t,e){var n=cM({},t,e.attrs);return v.createVNode(fi,cM({},n,{icon:e$}),null)};Fv.displayName="DeleteOutlined",Fv.inheritAttrs=!1;const gM=Fv;var n$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};const o$=n$;function fM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){r$(i,o,e[o])})}return i}function r$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Iv=function(t,e){var n=fM({},t,e.attrs);return v.createVNode(fi,fM({},n,{icon:o$}),null)};Iv.displayName="FilterOutlined",Iv.inheritAttrs=!1;const pM=Iv;var s$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z"}}]},name:"form",theme:"outlined"};const l$=s$;function mM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){a$(i,o,e[o])})}return i}function a$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Dv=function(t,e){var n=mM({},t,e.attrs);return v.createVNode(fi,mM({},n,{icon:l$}),null)};Dv.displayName="FormOutlined",Dv.inheritAttrs=!1;const vM=Dv;var h$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M878.7 336H145.3c-18.4 0-33.3 14.3-33.3 32v464c0 17.7 14.9 32 33.3 32h733.3c18.4 0 33.3-14.3 33.3-32V368c.1-17.7-14.8-32-33.2-32zM360 792H184V632h176v160zm0-224H184V408h176v160zm240 224H424V632h176v160zm0-224H424V408h176v160zm240 224H664V632h176v160zm0-224H664V408h176v160zm64-408H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"insert-row-above",theme:"outlined"};const d$=h$;function bM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){u$(i,o,e[o])})}return i}function u$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ov=function(t,e){var n=bM({},t,e.attrs);return v.createVNode(fi,bM({},n,{icon:d$}),null)};Ov.displayName="InsertRowAboveOutlined",Ov.inheritAttrs=!1;const c$=Ov;var g$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M248 112h-80c-4.4 0-8 3.6-8 8v784c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V120c0-4.4-3.6-8-8-8zm584 0H368c-17.7 0-32 14.9-32 33.3v733.3c0 18.4 14.3 33.3 32 33.3h464c17.7 0 32-14.9 32-33.3V145.3c0-18.4-14.3-33.3-32-33.3zM568 840H408V664h160v176zm0-240H408V424h160v176zm0-240H408V184h160v176zm224 480H632V664h160v176zm0-240H632V424h160v176zm0-240H632V184h160v176z"}}]},name:"insert-row-left",theme:"outlined"};const f$=g$;function CM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){p$(i,o,e[o])})}return i}function p$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var zv=function(t,e){var n=CM({},t,e.attrs);return v.createVNode(fi,CM({},n,{icon:f$}),null)};zv.displayName="InsertRowLeftOutlined",zv.inheritAttrs=!1;const m$=zv;var v$={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const b$=v$;function yM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){C$(i,o,e[o])})}return i}function C$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Nv=function(t,e){var n=yM({},t,e.attrs);return v.createVNode(fi,yM({},n,{icon:b$}),null)};Nv.displayName="LoadingOutlined",Nv.inheritAttrs=!1;const y$=Nv;var _$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"};const w$=_$;function _M(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){S$(i,o,e[o])})}return i}function S$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Wv=function(t,e){var n=_M({},t,e.attrs);return v.createVNode(fi,_M({},n,{icon:w$}),null)};Wv.displayName="MinusCircleOutlined",Wv.inheritAttrs=!1;const wM=Wv;var x$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const A$=x$;function SM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){R$(i,o,e[o])})}return i}function R$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Vv=function(t,e){var n=SM({},t,e.attrs);return v.createVNode(fi,SM({},n,{icon:A$}),null)};Vv.displayName="MinusSquareOutlined",Vv.inheritAttrs=!1;const T$=Vv;var M$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const B$=M$;function xM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){P$(i,o,e[o])})}return i}function P$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var jv=function(t,e){var n=xM({},t,e.attrs);return v.createVNode(fi,xM({},n,{icon:B$}),null)};jv.displayName="PlusCircleOutlined",jv.inheritAttrs=!1;const AM=jv;var H$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const E$=H$;function RM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){L$(i,o,e[o])})}return i}function L$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var $v=function(t,e){var n=RM({},t,e.attrs);return v.createVNode(fi,RM({},n,{icon:E$}),null)};$v.displayName="SettingOutlined",$v.inheritAttrs=!1;const k$=$v;var F$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M881.7 187.4l-45.1-45.1a8.03 8.03 0 00-11.3 0L667.8 299.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L576.1 439c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 157.6-157.6c3-3 3-8.1-.1-11.2zM439 576.1l-189.2 23.5c-6.6.8-9.3 8.9-4.7 13.5l54.7 54.7-157.5 157.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l157.6-157.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L447.9 585a7.9 7.9 0 00-8.9-8.9z"}}]},name:"shrink",theme:"outlined"};const I$=F$;function TM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){D$(i,o,e[o])})}return i}function D$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Gv=function(t,e){var n=TM({},t,e.attrs);return v.createVNode(fi,TM({},n,{icon:I$}),null)};Gv.displayName="ShrinkOutlined",Gv.inheritAttrs=!1;const O$=Gv;var z$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z"}}]},name:"sliders",theme:"outlined"};const N$=z$;function MM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){W$(i,o,e[o])})}return i}function W$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Uv=function(t,e){var n=MM({},t,e.attrs);return v.createVNode(fi,MM({},n,{icon:N$}),null)};Uv.displayName="SlidersOutlined",Uv.inheritAttrs=!1;const V$=Uv;var j$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 240H144c-17.7 0-32 14.3-32 32v608c0 17.7 14.3 32 32 32h608c17.7 0 32-14.3 32-32V272c0-17.7-14.3-32-32-32zm-40 600H184V312h528v528zm168-728H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h576v576c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM300 550h296v64H300z"}}]},name:"switcher",theme:"outlined"};const $$=j$;function BM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){G$(i,o,e[o])})}return i}function G$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Kv=function(t,e){var n=BM({},t,e.attrs);return v.createVNode(fi,BM({},n,{icon:$$}),null)};Kv.displayName="SwitcherOutlined",Kv.inheritAttrs=!1;const PM=Kv,FX="",U$=v.defineComponent({name:"ConditionalItemConfig",components:{PlusCircleOutlined:AM,FormOutlined:vM,MinusCircleOutlined:wM},props:{config:{type:Array,default(){return[]}}},setup(i,{emit:t}){const e=v.ref("add"),n=v.ref(!1),o=v.ref(-1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light");v.watch(o,()=>{t("change",v.unref(o))});const l=v.ref("");function a(){e.value="add",l.value="",n.value=!0}function h(){if(v.unref(o)===-1){Gi.message.info("请选择要修改的条件项");return}e.value="edit",l.value=i.config[v.unref(o)].name,n.value=!0}function d(){if(v.unref(o)===-1){Gi.message.info("请选择要删除的条件项");return}i.config.splice(v.unref(o),1),o.value=-1}function u(){v.unref(e)==="add"?i.config.push({name:v.unref(l),conditions:[]}):i.config[v.unref(o)].name=v.unref(l),n.value=!1}const c=v.computed(()=>v.unref(s)==="darkBlue"?"#b2c3dd":"");return v.watch(n,g=>{g&&window.modalShow&&window.modalShow(g)}),{theme:s,modalType:e,visible:n,selectedIndex:o,addItem:a,name:l,handleOk:u,editItem:h,deleteItem:d,fontColor:c,getContainer:r}}}),K$={class:"content"},Y$={style:{display:"flex","align-items":"center"}},X$={class:"list"},q$=["onClick"];function Z$(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-input"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-form"),g=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",K$,[v.createElementVNode("div",Y$,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件项配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick"])])]),v.createElementVNode("div",X$,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(f,p)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===p?"active":""]),key:p,onClick:m=>i.selectedIndex=p,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(f.name),15,q$))),128))])]),v.createVNode(g,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=f=>i.visible=f),title:i.modalType==="add"?"添加条件项":"修改条件项","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(c,{name:"conditionItem"},{default:v.withCtx(()=>[v.createVNode(u,{label:"条件项名称"},{default:v.withCtx(()=>[v.createVNode(d,{value:i.name,"onUpdate:value":t[0]||(t[0]=f=>i.name=f)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const J$=Ri(U$,[["render",Z$],["__scopeId","data-v-1b06e44c"]]),IX="",DX="",Q$=v.defineComponent({name:"ConditionalConfig",components:{PlusCircleOutlined:AM,FormOutlined:vM,MinusCircleOutlined:wM},props:{config:{type:Array,default(){return[]}},isSelected:{type:Boolean}},setup(i){const t=v.ref("add"),e=v.ref(!1),n=v.ref(-1),o=v.ref({}),r=v.ref(!1),s=v.ref(),l=v.ref(),a=v.ref(),h=v.ref({}),d=v.inject("theme","light"),u=v.inject("getContainer",()=>{}),c=v.inject("scaleValue",{}),g=v.computed(()=>A=>{const x=`当前值 ${A.operation} ${A.value}`;return A.join?`${A.join} ${x}`:x});v.watch(()=>i.config,()=>{n.value=-1});const f=[{label:"与",value:"and"},{label:"或",value:"or"}],p=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],m={operation:[{required:!0,message:"操作符不能为空"}],value:[{required:!0,message:"值不能为空"}]};function b(){t.value="add",r.value=i.config.length>0,v.unref(r)?o.value={join:"and",operation:"",value:""}:o.value={operation:"",value:""},e.value=!0}function C(){if(v.unref(n)===-1){Gi.message.info("请选择要修改的条件配置");return}t.value="edit",r.value=v.unref(n)!==0,o.value=i.config[v.unref(n)],e.value=!0}function _(){if(v.unref(n)===-1){Gi.message.info("请选择要删除的条件配置");return}i.config.splice(v.unref(n),1),n.value=-1}function w(){v.unref(s).validateFields().then(()=>{v.unref(t)==="add"?i.config.push(v.unref(o)):i.config[v.unref(n)]=v.unref(o),e.value=!1}).catch(()=>{})}const y=v.computed(()=>i.theme==="darkBlue"?"#b2c3dd":""),S=()=>document.getElementsByClassName("update-config-modal")[0]||document.body,R=(A,x="")=>{var T,M,B,P;if(A){let F=(T=v.unref(l))==null?void 0:T.getBoundingClientRect();if(x==="join"&&(F=(M=v.unref(a))==null?void 0:M.getBoundingClientRect()),F){const H=F.left/(((B=v.unref(c))==null?void 0:B.widthScale)||1)+"px",E=(F.top+F.height)/(((P=v.unref(c))==null?void 0:P.heightScale)||1)+"px";setTimeout(()=>{var L,D;const k=document.querySelectorAll(".ant-select-dropdown"),I=Array.from(k).filter(O=>window.getComputedStyle(O).display!=="none");if(I!=null&&I.length){let O="update-config-select-dropdown";x==="join"&&(O="update-config-join-select-dropdown");const W=document.getElementsByClassName("update-config-modal")[0];I[0].classList.remove("update-config-select-dropdown"),I[0].classList.remove("update-config-join-select-dropdown"),I[0].classList.add(O),(L=W==null?void 0:W.style)==null||L.setProperty(`--${x?x+"-":""}drop-down-left`,H),(D=W==null?void 0:W.style)==null||D.setProperty(`--${x?x+"-":""}drop-down-top`,E),h.value={visibility:"visible"}}},200)}}else h.value={}};return v.watch(e,A=>{A&&window.modalShow&&window.modalShow(A)}),{theme:d,modalType:t,visible:e,selectedIndex:n,addItem:b,handleOk:w,editItem:C,deleteItem:_,operateOptions:p,formData:o,joinOptions:f,isShowJoin:r,formRules:m,formRef:s,conditionTitle:g,fontColor:y,dropdownStyle:h,selectRef:l,joinSelectRef:a,getPopupContainer:S,getContainer:u,dropdownVisibleChange:R}}}),tG={class:"content"},eG={style:{display:"flex","align-items":"center"}},iG={class:"list"},nG=["onClick"],oG={ref:"joinSelectRef"},rG={ref:"selectRef"};function sG(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-input"),g=v.resolveComponent("a-form"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",tG,[v.createElementVNode("div",eG,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick","disabled"])])]),v.createElementVNode("div",iG,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(p,m)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===m?"active":""]),key:m,onClick:b=>i.selectedIndex=m,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(i.conditionTitle(p)),15,nG))),128))])]),v.createVNode(f,{wrapClassName:i.theme+" update-config-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=p=>i.visible=p),title:i.modalType==="add"?"添加条件配置":"修改条件配置","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(g,{model:i.formData,rules:i.formRules,ref:"formRef"},{default:v.withCtx(()=>[i.isShowJoin?(v.openBlock(),v.createBlock(u,{key:0,label:"与上一条件关系",name:"join",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",oG,[v.createVNode(d,{options:i.joinOptions,value:i.formData.join,"onUpdate:value":t[0]||(t[0]=p=>i.formData.join=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:t[1]||(t[1]=p=>i.dropdownVisibleChange(p,"join"))},null,8,["options","value","getPopupContainer","dropdownStyle"])],512)]),_:1})):v.createCommentVNode("",!0),v.createVNode(u,{label:"操作符",name:"operation",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",rG,[v.createVNode(d,{options:i.operateOptions,value:i.formData.operation,"onUpdate:value":t[2]||(t[2]=p=>i.formData.operation=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["options","value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),v.createVNode(u,{label:"值",name:"value",required:!0},{default:v.withCtx(()=>[v.createVNode(c,{type:"number",value:i.formData.value,"onUpdate:value":t[3]||(t[3]=p=>i.formData.value=p),style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const lG=Ri(Q$,[["render",sG],["__scopeId","data-v-580c2bff"]]);var ln="top",Gn="bottom",Un="right",an="left",Yv="auto",Vh=[ln,Gn,Un,an],Nl="start",jh="end",aG="clippingParents",HM="viewport",$h="popper",hG="reference",EM=Vh.reduce(function(i,t){return i.concat([t+"-"+Nl,t+"-"+jh])},[]),LM=[].concat(Vh,[Yv]).reduce(function(i,t){return i.concat([t,t+"-"+Nl,t+"-"+jh])},[]),dG="beforeRead",uG="read",cG="afterRead",gG="beforeMain",fG="main",pG="afterMain",mG="beforeWrite",vG="write",bG="afterWrite",CG=[dG,uG,cG,gG,fG,pG,mG,vG,bG];function Bo(i){return i?(i.nodeName||"").toLowerCase():null}function xn(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function Hs(i){var t=xn(i).Element;return i instanceof t||i instanceof Element}function Kn(i){var t=xn(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function Xv(i){if(typeof ShadowRoot>"u")return!1;var t=xn(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function yG(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!Kn(r)||!Bo(r)||(Object.assign(r.style,n),Object.keys(o).forEach(function(s){var l=o[s];l===!1?r.removeAttribute(s):r.setAttribute(s,l===!0?"":l)}))})}function _G(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],r=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:e[n]),l=s.reduce(function(a,h){return a[h]="",a},{});!Kn(o)||!Bo(o)||(Object.assign(o.style,l),Object.keys(r).forEach(function(a){o.removeAttribute(a)}))})}}const wG={name:"applyStyles",enabled:!0,phase:"write",fn:yG,effect:_G,requires:["computeStyles"]};function Po(i){return i.split("-")[0]}var Es=Math.max,Kg=Math.min,Wl=Math.round;function qv(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function kM(){return!/^((?!chrome|android).)*safari/i.test(qv())}function Vl(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var n=i.getBoundingClientRect(),o=1,r=1;t&&Kn(i)&&(o=i.offsetWidth>0&&Wl(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&Wl(n.height)/i.offsetHeight||1);var s=Hs(i)?xn(i):window,l=s.visualViewport,a=!kM()&&e,h=(n.left+(a&&l?l.offsetLeft:0))/o,d=(n.top+(a&&l?l.offsetTop:0))/r,u=n.width/o,c=n.height/r;return{width:u,height:c,top:d,right:h+u,bottom:d+c,left:h,x:h,y:d}}function Zv(i){var t=Vl(i),e=i.offsetWidth,n=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:n}}function FM(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&Xv(e)){var n=t;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function cr(i){return xn(i).getComputedStyle(i)}function SG(i){return["table","td","th"].indexOf(Bo(i))>=0}function Vr(i){return((Hs(i)?i.ownerDocument:i.document)||window.document).documentElement}function Yg(i){return Bo(i)==="html"?i:i.assignedSlot||i.parentNode||(Xv(i)?i.host:null)||Vr(i)}function IM(i){return!Kn(i)||cr(i).position==="fixed"?null:i.offsetParent}function xG(i){var t=/firefox/i.test(qv()),e=/Trident/i.test(qv());if(e&&Kn(i)){var n=cr(i);if(n.position==="fixed")return null}var o=Yg(i);for(Xv(o)&&(o=o.host);Kn(o)&&["html","body"].indexOf(Bo(o))<0;){var r=cr(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function Gh(i){for(var t=xn(i),e=IM(i);e&&SG(e)&&cr(e).position==="static";)e=IM(e);return e&&(Bo(e)==="html"||Bo(e)==="body"&&cr(e).position==="static")?t:e||xG(i)||t}function Jv(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Uh(i,t,e){return Es(i,Kg(t,e))}function AG(i,t,e){var n=Uh(i,t,e);return n>e?e:n}function DM(){return{top:0,right:0,bottom:0,left:0}}function OM(i){return Object.assign({},DM(),i)}function zM(i,t){return t.reduce(function(e,n){return e[n]=i,e},{})}var RG=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,OM(typeof t!="number"?t:zM(t,Vh))};function TG(i){var t,e=i.state,n=i.name,o=i.options,r=e.elements.arrow,s=e.modifiersData.popperOffsets,l=Po(e.placement),a=Jv(l),h=[an,Un].indexOf(l)>=0,d=h?"height":"width";if(!(!r||!s)){var u=RG(o.padding,e),c=Zv(r),g=a==="y"?ln:an,f=a==="y"?Gn:Un,p=e.rects.reference[d]+e.rects.reference[a]-s[a]-e.rects.popper[d],m=s[a]-e.rects.reference[a],b=Gh(r),C=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,_=p/2-m/2,w=u[g],y=C-c[d]-u[f],S=C/2-c[d]/2+_,R=Uh(w,S,y),A=a;e.modifiersData[n]=(t={},t[A]=R,t.centerOffset=R-S,t)}}function MG(i){var t=i.state,e=i.options,n=e.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||FM(t.elements.popper,o)&&(t.elements.arrow=o))}const BG={name:"arrow",enabled:!0,phase:"main",fn:TG,effect:MG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jl(i){return i.split("-")[1]}var PG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function HG(i,t){var e=i.x,n=i.y,o=t.devicePixelRatio||1;return{x:Wl(e*o)/o||0,y:Wl(n*o)/o||0}}function NM(i){var t,e=i.popper,n=i.popperRect,o=i.placement,r=i.variation,s=i.offsets,l=i.position,a=i.gpuAcceleration,h=i.adaptive,d=i.roundOffsets,u=i.isFixed,c=s.x,g=c===void 0?0:c,f=s.y,p=f===void 0?0:f,m=typeof d=="function"?d({x:g,y:p}):{x:g,y:p};g=m.x,p=m.y;var b=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),_=an,w=ln,y=window;if(h){var S=Gh(e),R="clientHeight",A="clientWidth";if(S===xn(e)&&(S=Vr(e),cr(S).position!=="static"&&l==="absolute"&&(R="scrollHeight",A="scrollWidth")),S=S,o===ln||(o===an||o===Un)&&r===jh){w=Gn;var x=u&&S===y&&y.visualViewport?y.visualViewport.height:S[R];p-=x-n.height,p*=a?1:-1}if(o===an||(o===ln||o===Gn)&&r===jh){_=Un;var T=u&&S===y&&y.visualViewport?y.visualViewport.width:S[A];g-=T-n.width,g*=a?1:-1}}var M=Object.assign({position:l},h&&PG),B=d===!0?HG({x:g,y:p},xn(e)):{x:g,y:p};if(g=B.x,p=B.y,a){var P;return Object.assign({},M,(P={},P[w]=C?"0":"",P[_]=b?"0":"",P.transform=(y.devicePixelRatio||1)<=1?"translate("+g+"px, "+p+"px)":"translate3d("+g+"px, "+p+"px, 0)",P))}return Object.assign({},M,(t={},t[w]=C?p+"px":"",t[_]=b?g+"px":"",t.transform="",t))}function EG(i){var t=i.state,e=i.options,n=e.gpuAcceleration,o=n===void 0?!0:n,r=e.adaptive,s=r===void 0?!0:r,l=e.roundOffsets,a=l===void 0?!0:l,h={placement:Po(t.placement),variation:jl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,NM(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,NM(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const LG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:EG,data:{}};var Xg={passive:!0};function kG(i){var t=i.state,e=i.instance,n=i.options,o=n.scroll,r=o===void 0?!0:o,s=n.resize,l=s===void 0?!0:s,a=xn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&h.forEach(function(d){d.addEventListener("scroll",e.update,Xg)}),l&&a.addEventListener("resize",e.update,Xg),function(){r&&h.forEach(function(d){d.removeEventListener("scroll",e.update,Xg)}),l&&a.removeEventListener("resize",e.update,Xg)}}const FG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kG,data:{}};var IG={left:"right",right:"left",bottom:"top",top:"bottom"};function qg(i){return i.replace(/left|right|bottom|top/g,function(t){return IG[t]})}var DG={start:"end",end:"start"};function WM(i){return i.replace(/start|end/g,function(t){return DG[t]})}function Qv(i){var t=xn(i),e=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:e,scrollTop:n}}function tb(i){return Vl(Vr(i)).left+Qv(i).scrollLeft}function OG(i,t){var e=xn(i),n=Vr(i),o=e.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var h=kM();(h||!h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+tb(i),y:a}}function zG(i){var t,e=Vr(i),n=Qv(i),o=(t=i.ownerDocument)==null?void 0:t.body,r=Es(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Es(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-n.scrollLeft+tb(i),a=-n.scrollTop;return cr(o||e).direction==="rtl"&&(l+=Es(e.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}function eb(i){var t=cr(i),e=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+n)}function VM(i){return["html","body","#document"].indexOf(Bo(i))>=0?i.ownerDocument.body:Kn(i)&&eb(i)?i:VM(Yg(i))}function Kh(i,t){var e;t===void 0&&(t=[]);var n=VM(i),o=n===((e=i.ownerDocument)==null?void 0:e.body),r=xn(n),s=o?[r].concat(r.visualViewport||[],eb(n)?n:[]):n,l=t.concat(s);return o?l:l.concat(Kh(Yg(s)))}function ib(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function NG(i,t){var e=Vl(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function jM(i,t,e){return t===HM?ib(OG(i,e)):Hs(t)?NG(t,e):ib(zG(Vr(i)))}function WG(i){var t=Kh(Yg(i)),e=["absolute","fixed"].indexOf(cr(i).position)>=0,n=e&&Kn(i)?Gh(i):i;return Hs(n)?t.filter(function(o){return Hs(o)&&FM(o,n)&&Bo(o)!=="body"}):[]}function VG(i,t,e,n){var o=t==="clippingParents"?WG(i):[].concat(t),r=[].concat(o,[e]),s=r[0],l=r.reduce(function(a,h){var d=jM(i,h,n);return a.top=Es(d.top,a.top),a.right=Kg(d.right,a.right),a.bottom=Kg(d.bottom,a.bottom),a.left=Es(d.left,a.left),a},jM(i,s,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function $M(i){var t=i.reference,e=i.element,n=i.placement,o=n?Po(n):null,r=n?jl(n):null,s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,a;switch(o){case ln:a={x:s,y:t.y-e.height};break;case Gn:a={x:s,y:t.y+t.height};break;case Un:a={x:t.x+t.width,y:l};break;case an:a={x:t.x-e.width,y:l};break;default:a={x:t.x,y:t.y}}var h=o?Jv(o):null;if(h!=null){var d=h==="y"?"height":"width";switch(r){case Nl:a[h]=a[h]-(t[d]/2-e[d]/2);break;case jh:a[h]=a[h]+(t[d]/2-e[d]/2);break}}return a}function Yh(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=n===void 0?i.placement:n,r=e.strategy,s=r===void 0?i.strategy:r,l=e.boundary,a=l===void 0?aG:l,h=e.rootBoundary,d=h===void 0?HM:h,u=e.elementContext,c=u===void 0?$h:u,g=e.altBoundary,f=g===void 0?!1:g,p=e.padding,m=p===void 0?0:p,b=OM(typeof m!="number"?m:zM(m,Vh)),C=c===$h?hG:$h,_=i.rects.popper,w=i.elements[f?C:c],y=VG(Hs(w)?w:w.contextElement||Vr(i.elements.popper),a,d,s),S=Vl(i.elements.reference),R=$M({reference:S,element:_,strategy:"absolute",placement:o}),A=ib(Object.assign({},_,R)),x=c===$h?A:S,T={top:y.top-x.top+b.top,bottom:x.bottom-y.bottom+b.bottom,left:y.left-x.left+b.left,right:x.right-y.right+b.right},M=i.modifiersData.offset;if(c===$h&&M){var B=M[o];Object.keys(T).forEach(function(P){var F=[Un,Gn].indexOf(P)>=0?1:-1,H=[ln,Gn].indexOf(P)>=0?"y":"x";T[P]+=B[H]*F})}return T}function jG(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=e.boundary,r=e.rootBoundary,s=e.padding,l=e.flipVariations,a=e.allowedAutoPlacements,h=a===void 0?LM:a,d=jl(n),u=d?l?EM:EM.filter(function(f){return jl(f)===d}):Vh,c=u.filter(function(f){return h.indexOf(f)>=0});c.length===0&&(c=u);var g=c.reduce(function(f,p){return f[p]=Yh(i,{placement:p,boundary:o,rootBoundary:r,padding:s})[Po(p)],f},{});return Object.keys(g).sort(function(f,p){return g[f]-g[p]})}function $G(i){if(Po(i)===Yv)return[];var t=qg(i);return[WM(i),t,WM(t)]}function GG(i){var t=i.state,e=i.options,n=i.name;if(!t.modifiersData[n]._skip){for(var o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!0:s,a=e.fallbackPlacements,h=e.padding,d=e.boundary,u=e.rootBoundary,c=e.altBoundary,g=e.flipVariations,f=g===void 0?!0:g,p=e.allowedAutoPlacements,m=t.options.placement,b=Po(m),C=b===m,_=a||(C||!f?[qg(m)]:$G(m)),w=[m].concat(_).reduce(function($,U){return $.concat(Po(U)===Yv?jG(t,{placement:U,boundary:d,rootBoundary:u,padding:h,flipVariations:f,allowedAutoPlacements:p}):U)},[]),y=t.rects.reference,S=t.rects.popper,R=new Map,A=!0,x=w[0],T=0;T<w.length;T++){var M=w[T],B=Po(M),P=jl(M)===Nl,F=[ln,Gn].indexOf(B)>=0,H=F?"width":"height",E=Yh(t,{placement:M,boundary:d,rootBoundary:u,altBoundary:c,padding:h}),k=F?P?Un:an:P?Gn:ln;y[H]>S[H]&&(k=qg(k));var I=qg(k),L=[];if(r&&L.push(E[B]<=0),l&&L.push(E[k]<=0,E[I]<=0),L.every(function($){return $})){x=M,A=!1;break}R.set(M,L)}if(A)for(var D=f?3:1,O=function(U){var Y=w.find(function(j){var G=R.get(j);if(G)return G.slice(0,U).every(function(Z){return Z})});if(Y)return x=Y,"break"},W=D;W>0;W--){var N=O(W);if(N==="break")break}t.placement!==x&&(t.modifiersData[n]._skip=!0,t.placement=x,t.reset=!0)}}const UG={name:"flip",enabled:!0,phase:"main",fn:GG,requiresIfExists:["offset"],data:{_skip:!1}};function GM(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function UM(i){return[ln,Un,Gn,an].some(function(t){return i[t]>=0})}function KG(i){var t=i.state,e=i.name,n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=Yh(t,{elementContext:"reference"}),l=Yh(t,{altBoundary:!0}),a=GM(s,n),h=GM(l,o,r),d=UM(a),u=UM(h);t.modifiersData[e]={referenceClippingOffsets:a,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const YG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:KG};function XG(i,t,e){var n=Po(i),o=[an,ln].indexOf(n)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,s=r[0],l=r[1];return s=s||0,l=(l||0)*o,[an,Un].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function qG(i){var t=i.state,e=i.options,n=i.name,o=e.offset,r=o===void 0?[0,0]:o,s=LM.reduce(function(d,u){return d[u]=XG(u,t.rects,r),d},{}),l=s[t.placement],a=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=h),t.modifiersData[n]=s}const ZG={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qG};function JG(i){var t=i.state,e=i.name;t.modifiersData[e]=$M({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const QG={name:"popperOffsets",enabled:!0,phase:"read",fn:JG,data:{}};function tU(i){return i==="x"?"y":"x"}function eU(i){var t=i.state,e=i.options,n=i.name,o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!1:s,a=e.boundary,h=e.rootBoundary,d=e.altBoundary,u=e.padding,c=e.tether,g=c===void 0?!0:c,f=e.tetherOffset,p=f===void 0?0:f,m=Yh(t,{boundary:a,rootBoundary:h,padding:u,altBoundary:d}),b=Po(t.placement),C=jl(t.placement),_=!C,w=Jv(b),y=tU(w),S=t.modifiersData.popperOffsets,R=t.rects.reference,A=t.rects.popper,x=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(S){if(r){var P,F=w==="y"?ln:an,H=w==="y"?Gn:Un,E=w==="y"?"height":"width",k=S[w],I=k+m[F],L=k-m[H],D=g?-A[E]/2:0,O=C===Nl?R[E]:A[E],W=C===Nl?-A[E]:-R[E],N=t.elements.arrow,$=g&&N?Zv(N):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:DM(),Y=U[F],j=U[H],G=Uh(0,R[E],$[E]),Z=_?R[E]/2-D-G-Y-T.mainAxis:O-G-Y-T.mainAxis,et=_?-R[E]/2+D+G+j+T.mainAxis:W+G+j+T.mainAxis,gt=t.elements.arrow&&Gh(t.elements.arrow),vt=gt?w==="y"?gt.clientTop||0:gt.clientLeft||0:0,it=(P=M==null?void 0:M[w])!=null?P:0,nt=k+Z-it-vt,bt=k+et-it,Ct=Uh(g?Kg(I,nt):I,k,g?Es(L,bt):L);S[w]=Ct,B[w]=Ct-k}if(l){var at,rt=w==="x"?ln:an,ct=w==="x"?Gn:Un,ht=S[y],_t=y==="y"?"height":"width",ut=ht+m[rt],It=ht-m[ct],Ut=[ln,an].indexOf(b)!==-1,yt=(at=M==null?void 0:M[y])!=null?at:0,Tt=Ut?ut:ht-R[_t]-A[_t]-yt+T.altAxis,kt=Ut?ht+R[_t]+A[_t]-yt-T.altAxis:It,oe=g&&Ut?AG(Tt,ht,kt):Uh(g?Tt:ut,ht,g?kt:It);S[y]=oe,B[y]=oe-ht}t.modifiersData[n]=B}}const iU={name:"preventOverflow",enabled:!0,phase:"main",fn:eU,requiresIfExists:["offset"]};function nU(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function oU(i){return i===xn(i)||!Kn(i)?Qv(i):nU(i)}function rU(i){var t=i.getBoundingClientRect(),e=Wl(t.width)/i.offsetWidth||1,n=Wl(t.height)/i.offsetHeight||1;return e!==1||n!==1}function sU(i,t,e){e===void 0&&(e=!1);var n=Kn(t),o=Kn(t)&&rU(t),r=Vr(t),s=Vl(i,o,e),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(n||!n&&!e)&&((Bo(t)!=="body"||eb(r))&&(l=oU(t)),Kn(t)?(a=Vl(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):r&&(a.x=tb(r))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function lU(i){var t=new Map,e=new Set,n=[];i.forEach(function(r){t.set(r.name,r)});function o(r){e.add(r.name);var s=[].concat(r.requires||[],r.requiresIfExists||[]);s.forEach(function(l){if(!e.has(l)){var a=t.get(l);a&&o(a)}}),n.push(r)}return i.forEach(function(r){e.has(r.name)||o(r)}),n}function aU(i){var t=lU(i);return CG.reduce(function(e,n){return e.concat(t.filter(function(o){return o.phase===n}))},[])}function hU(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function dU(i){var t=i.reduce(function(e,n){var o=e[n.name];return e[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,e},{});return Object.keys(t).map(function(e){return t[e]})}var KM={placement:"bottom",modifiers:[],strategy:"absolute"};function YM(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function uU(i){i===void 0&&(i={});var t=i,e=t.defaultModifiers,n=e===void 0?[]:e,o=t.defaultOptions,r=o===void 0?KM:o;return function(l,a,h){h===void 0&&(h=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},KM,r),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},u=[],c=!1,g={state:d,setOptions:function(b){var C=typeof b=="function"?b(d.options):b;p(),d.options=Object.assign({},r,d.options,C),d.scrollParents={reference:Hs(l)?Kh(l):l.contextElement?Kh(l.contextElement):[],popper:Kh(a)};var _=aU(dU([].concat(n,d.options.modifiers)));return d.orderedModifiers=_.filter(function(w){return w.enabled}),f(),g.update()},forceUpdate:function(){if(!c){var b=d.elements,C=b.reference,_=b.popper;if(YM(C,_)){d.rects={reference:sU(C,Gh(_),d.options.strategy==="fixed"),popper:Zv(_)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var w=0;w<d.orderedModifiers.length;w++){if(d.reset===!0){d.reset=!1,w=-1;continue}var y=d.orderedModifiers[w],S=y.fn,R=y.options,A=R===void 0?{}:R,x=y.name;typeof S=="function"&&(d=S({state:d,options:A,name:x,instance:g})||d)}}}},update:hU(function(){return new Promise(function(m){g.forceUpdate(),m(d)})}),destroy:function(){p(),c=!0}};if(!YM(l,a))return g;g.setOptions(h).then(function(m){!c&&h.onFirstUpdate&&h.onFirstUpdate(m)});function f(){d.orderedModifiers.forEach(function(m){var b=m.name,C=m.options,_=C===void 0?{}:C,w=m.effect;if(typeof w=="function"){var y=w({state:d,name:b,instance:g,options:_}),S=function(){};u.push(y||S)}})}function p(){u.forEach(function(m){return m()}),u=[]}return g}}var cU=[FG,QG,LG,wG,ZG,UG,iU,BG,YG],gU=uU({defaultModifiers:cU});function nb(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=Array(t);e<t;e++)n[e]=i[e];return n}function XM(i,t){if(i){if(typeof i=="string")return nb(i,t);var e={}.toString.call(i).slice(8,-1);return e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set"?Array.from(i):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nb(i,t):void 0}}function fU(i){return function(t){if(Array.isArray(t))return nb(t)}(i)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(i)||XM(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
366
366
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $l(i){return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(i)}function qM(i,t,e,n,o,r,s){try{var l=i[r](s),a=l.value}catch(h){return void e(h)}l.done?t(a):Promise.resolve(a).then(n,o)}function ZM(i){return function(){var t=this,e=arguments;return new Promise(function(n,o){var r=i.apply(t,e);function s(a){qM(r,n,o,s,l,"next",a)}function l(a){qM(r,n,o,s,l,"throw",a)}s(void 0)})}}var JM={exports:{}},QM={exports:{}};(function(i){function t(e){return i.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i.exports.__esModule=!0,i.exports.default=i.exports,t(e)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(QM),function(i){var t=QM.exports.default;function e(){i.exports=e=function(){return o},i.exports.__esModule=!0,i.exports.default=i.exports;var n,o={},r=Object.prototype,s=r.hasOwnProperty,l=Object.defineProperty||function(L,D,O){L[D]=O.value},a=typeof Symbol=="function"?Symbol:{},h=a.iterator||"@@iterator",d=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(L,D,O){return Object.defineProperty(L,D,{value:O,enumerable:!0,configurable:!0,writable:!0}),L[D]}try{c({},"")}catch{c=function(D,O,W){return D[O]=W}}function g(L,D,O,W){var N=D&&D.prototype instanceof w?D:w,$=Object.create(N.prototype),U=new k(W||[]);return l($,"_invoke",{value:P(L,O,U)}),$}function f(L,D,O){try{return{type:"normal",arg:L.call(D,O)}}catch(W){return{type:"throw",arg:W}}}o.wrap=g;var p="suspendedStart",m="suspendedYield",b="executing",C="completed",_={};function w(){}function y(){}function S(){}var R={};c(R,h,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(I([])));x&&x!==r&&s.call(x,h)&&(R=x);var T=S.prototype=w.prototype=Object.create(R);function M(L){["next","throw","return"].forEach(function(D){c(L,D,function(O){return this._invoke(D,O)})})}function B(L,D){function O(N,$,U,Y){var j=f(L[N],L,$);if(j.type!=="throw"){var G=j.arg,Z=G.value;return Z&&t(Z)=="object"&&s.call(Z,"__await")?D.resolve(Z.__await).then(function(et){O("next",et,U,Y)},function(et){O("throw",et,U,Y)}):D.resolve(Z).then(function(et){G.value=et,U(G)},function(et){return O("throw",et,U,Y)})}Y(j.arg)}var W;l(this,"_invoke",{value:function(N,$){function U(){return new D(function(Y,j){O(N,$,Y,j)})}return W=W?W.then(U,U):U()}})}function P(L,D,O){var W=p;return function(N,$){if(W===b)throw Error("Generator is already running");if(W===C){if(N==="throw")throw $;return{value:n,done:!0}}for(O.method=N,O.arg=$;;){var U=O.delegate;if(U){var Y=F(U,O);if(Y){if(Y===_)continue;return Y}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(W===p)throw W=C,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);W=b;var j=f(L,D,O);if(j.type==="normal"){if(W=O.done?C:m,j.arg===_)continue;return{value:j.arg,done:O.done}}j.type==="throw"&&(W=C,O.method="throw",O.arg=j.arg)}}}function F(L,D){var O=D.method,W=L.iterator[O];if(W===n)return D.delegate=null,O==="throw"&&L.iterator.return&&(D.method="return",D.arg=n,F(L,D),D.method==="throw")||O!=="return"&&(D.method="throw",D.arg=new TypeError("The iterator does not provide a '"+O+"' method")),_;var N=f(W,L.iterator,D.arg);if(N.type==="throw")return D.method="throw",D.arg=N.arg,D.delegate=null,_;var $=N.arg;return $?$.done?(D[L.resultName]=$.value,D.next=L.nextLoc,D.method!=="return"&&(D.method="next",D.arg=n),D.delegate=null,_):$:(D.method="throw",D.arg=new TypeError("iterator result is not an object"),D.delegate=null,_)}function H(L){var D={tryLoc:L[0]};1 in L&&(D.catchLoc=L[1]),2 in L&&(D.finallyLoc=L[2],D.afterLoc=L[3]),this.tryEntries.push(D)}function E(L){var D=L.completion||{};D.type="normal",delete D.arg,L.completion=D}function k(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(H,this),this.reset(!0)}function I(L){if(L||L===""){var D=L[h];if(D)return D.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var O=-1,W=function N(){for(;++O<L.length;)if(s.call(L,O))return N.value=L[O],N.done=!1,N;return N.value=n,N.done=!0,N};return W.next=W}}throw new TypeError(t(L)+" is not iterable")}return y.prototype=S,l(T,"constructor",{value:S,configurable:!0}),l(S,"constructor",{value:y,configurable:!0}),y.displayName=c(S,u,"GeneratorFunction"),o.isGeneratorFunction=function(L){var D=typeof L=="function"&&L.constructor;return!!D&&(D===y||(D.displayName||D.name)==="GeneratorFunction")},o.mark=function(L){return Object.setPrototypeOf?Object.setPrototypeOf(L,S):(L.__proto__=S,c(L,u,"GeneratorFunction")),L.prototype=Object.create(T),L},o.awrap=function(L){return{__await:L}},M(B.prototype),c(B.prototype,d,function(){return this}),o.AsyncIterator=B,o.async=function(L,D,O,W,N){N===void 0&&(N=Promise);var $=new B(g(L,D,O,W),N);return o.isGeneratorFunction(D)?$:$.next().then(function(U){return U.done?U.value:$.next()})},M(T),c(T,u,"Generator"),c(T,h,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),o.keys=function(L){var D=Object(L),O=[];for(var W in D)O.push(W);return O.reverse(),function N(){for(;O.length;){var $=O.pop();if($ in D)return N.value=$,N.done=!1,N}return N.done=!0,N}},o.values=I,k.prototype={constructor:k,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!L)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=n)},stop:function(){this.done=!0;var L=this.tryEntries[0].completion;if(L.type==="throw")throw L.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var D=this;function O(j,G){return $.type="throw",$.arg=L,D.next=j,G&&(D.method="next",D.arg=n),!!G}for(var W=this.tryEntries.length-1;W>=0;--W){var N=this.tryEntries[W],$=N.completion;if(N.tryLoc==="root")return O("end");if(N.tryLoc<=this.prev){var U=s.call(N,"catchLoc"),Y=s.call(N,"finallyLoc");if(U&&Y){if(this.prev<N.catchLoc)return O(N.catchLoc,!0);if(this.prev<N.finallyLoc)return O(N.finallyLoc)}else if(U){if(this.prev<N.catchLoc)return O(N.catchLoc,!0)}else{if(!Y)throw Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return O(N.finallyLoc)}}}},abrupt:function(L,D){for(var O=this.tryEntries.length-1;O>=0;--O){var W=this.tryEntries[O];if(W.tryLoc<=this.prev&&s.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var N=W;break}}N&&(L==="break"||L==="continue")&&N.tryLoc<=D&&D<=N.finallyLoc&&(N=null);var $=N?N.completion:{};return $.type=L,$.arg=D,N?(this.method="next",this.next=N.finallyLoc,_):this.complete($)},complete:function(L,D){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&D&&(this.next=D),_},finish:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.finallyLoc===L)return this.complete(O.completion,O.afterLoc),E(O),_}},catch:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.tryLoc===L){var W=O.completion;if(W.type==="throw"){var N=W.arg;E(O)}return N}}throw Error("illegal catch attempt")},delegateYield:function(L,D,O){return this.delegate={iterator:I(L),resultName:D,nextLoc:O},this.method==="next"&&(this.arg=n),_}},o}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(JM);var Zg=JM.exports(),Jg=Zg;try{regeneratorRuntime=Zg}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Zg:Function("r","regeneratorRuntime = r")(Zg)}function Gl(i,t){return function(e){if(Array.isArray(e))return e}(i)||function(e,n){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r,s,l,a,h=[],d=!0,u=!1;try{if(l=(o=o.call(e)).next,n===0){if(Object(o)!==o)return;d=!1}else for(;!(d=(r=l.call(o)).done)&&(h.push(r.value),h.length!==n);d=!0);}catch(c){u=!0,s=c}finally{try{if(!d&&o.return!=null&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw s}}return h}}(i,t)||XM(i,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
367
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pU(i){var t=function(e,n){if($l(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return $l(t)=="symbol"?t:t+""}function ob(i,t,e){return(t=pU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Qg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Ho(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Ho(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Qg.__scopeId="data-v-24517fec",Qg.__file="src/picker/Saturation.vue";var tf=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),mU={ref:"canvas"};Ho(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",mU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},tf.__scopeId="data-v-78b9f4f0",tf.__file="src/picker/Hue.vue";var ef=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),vU={ref:"canvas"};Ho(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),ef.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",vU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},ef.__scopeId="data-v-24dc9656",ef.__file="src/picker/Alpha.vue";var tB={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},eB={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},bU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function iB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?iB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):iB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Ls=null,nB=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Ls.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=rb(rb(rb({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=Gl(a,2),c=u[0],g=u[1],f=Gl(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Ls)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Ls=gU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Ls&&((a=Ls)===null||a===void 0||a.destroy(),Ls=null)}),{instance:Ls,style:n}},nf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=nB(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return tB[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return eB[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",bU[d])}}}}),CU={class:"format"},yU={key:0,class:"arrow"},_U=["onClick"];Ho(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),nf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",CU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",yU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,_U)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},nf.__scopeId="data-v-5f6e8f5e",nf.__file="src/picker/input-value/FormatValue.vue";var of=v.defineComponent({name:"Input",components:{FormatValue:nf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),wU={class:"input"},SU=[".value"];function oB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Yn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),of.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",wU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,SU)])},of.__scopeId="data-v-2c454c00",of.__file="src/picker/input-value/InputValue.vue";var rB=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},sB={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},rf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(sB[t]||t).concat(sB[e]||e)},lB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(rf(t)).concat(rf(e)).concat(rf(n))},Ul=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Xh=function(i,t,e){i=6*Ul(i,360),t=Ul(t,100),e=Ul(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},aB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=rB(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Xh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(lB(Xh(r,s,l))).concat(rf(255*a))}else switch(t){case"hsl":var f=rB(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Xh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return lB(Xh(r,s,l))}},sf=function(i){var t=i.r,e=i.g,n=i.b;t=Ul(t,255),e=Ul(e,255),n=Ul(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},hB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},dB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},sb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=lf(i,af(i),e),o=fB(n);return o==null?"":aB(o,t,e)}return""},uB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},cB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},gB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},lf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=uB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Yn(Yn({},sf({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=gB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=cB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Yn(Yn({},hB({h,s:d,l:u})),{},{a:+c});default:var g=dB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Yn(Yn({},sf({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Yn(Yn({},sf(uB(i))),{},{a:1});case"hsv":var C=gB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Yn(Yn({},hB(cB(i))),{},{a:1});default:return Yn(Yn({},sf(dB(i))),{},{a:1})}},af=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},fB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},qh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),xU=["draggable"];Ho(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),qh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,xU)},qh.__scopeId="data-v-02da71fd",qh.__file="src/color-item/ColorItem.vue";var hf=v.defineComponent({name:"Colors",components:{ColorItem:qh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return sb(n,"hex",!0)})})}}}),AU={class:"colors"};function pB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Eo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):pB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),hf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",AU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},hf.__scopeId="data-v-0f8b52a8",hf.__file="src/picker/Colors.vue";var df=v.defineComponent({name:"Picker",components:{Colors:hf,Saturation:Qg,Hue:tf,Alpha:ef,InputValue:of},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Eo(Eo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=af(m);return fB(lf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=Gl(p,2),b=m[0],C=m[1],_="";b!=null?(_=aB(Eo({},b),i.format,i.showAlpha),r.value=Eo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Xh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Eo(Eo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Eo(Eo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Eo(Eo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?tB[p]:eB[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=af(m),_=lf(m,C,b),w=function(y){var S=y.h,R=y.s,A=y.v,x=y.a;return!(isNaN(S)||isNaN(R)||isNaN(A)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=af(p);b?function(C,_,w){if(C.length!==0){var y=lf(C,_,w),S=y.h,R=y.s,A=y.v;if(!(isNaN(S)||isNaN(R)||isNaN(A))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:R,v:A,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),RU={class:"picker-inner"},TU={class:"picker-header"};Ho(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",RU,[v.createElementVNode("div",TU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},df.__scopeId="data-v-6ceadec6",df.__file="src/picker/Picker.vue";var uf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Ho(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),uf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},uf.__scopeId="data-v-ceb1719c",uf.__file="src/add-color-item/AddColorItem.vue";var cf=v.defineComponent({name:"ColorPicker",components:{ColorItem:qh,Picker:df,AddColorItem:uf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return sb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return sb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=nB(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(A)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H;return Jg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H,E;return Jg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||$l(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),R=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(R)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(R))})},{immediate:!0}),v.provide("theme",{theme:R});var A=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=fU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:A,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Ho(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),cf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},cf.__scopeId="data-v-3c43ade8",cf.__file="src/ColorPicker.vue";const OX="",MU=v.defineComponent({name:"ColorPick",components:{PickColors:cf},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),BU={class:"color-pick"};function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",BU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const HU=Ri(MU,[["render",PU],["__scopeId","data-v-99378939"]]),EU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function LU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const kU=Ri(EU,[["render",LU]]),zX="",FU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:HU,Radio:kU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),IU={class:"content"},DU={class:"list"};function OU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",IU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",DU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const zU=Ri(FU,[["render",OU],["__scopeId","data-v-b2df2e2d"]]),NU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:J$,ConditionalConfig:lG,PropertyConfig:zU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),WU={style:{display:"flex"}};function VU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",WU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const jU=Ri(NU,[["render",VU]]),NX="",$U=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:pM,MinusSquareOutlined:T$,PivotFilter:DT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=NB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let W=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(W=!1)});const N=Number(D[k]);W&&!isNaN(N)&&(L[O]+=Number(N))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function R(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function A(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,W)=>({value:O,label:I[W]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,W)=>O.label.localeCompare(W.label)):D=L.sort((O,W)=>O.value-W.value):E==="desc"&&(H==="dimension"?D=L.sort((O,W)=>W.label.localeCompare(O.label)):D=L.sort((O,W)=>W.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:R,handleSort:A,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),GU={style:{display:"flex",height:"400px"}},UU={style:{flex:"0 0 200px"}},KU={style:{flex:"0 0 650px",height:"100%"}},YU={key:0,style:{display:"flex","align-items":"center"}},XU={key:0,class:"dimension-item"},qU={key:1,style:{height:"30px"}},ZU={style:{width:"100%",height:"100%"},ref:"echartRef"},JU=["onClick"];function QU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",GU,[v.createElementVNode("div",UU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",KU,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",YU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",XU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",qU)),v.createElementVNode("div",ZU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,JU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const tK=Ri($U,[["render",QU],["__scopeId","data-v-f29855b0"]]),eK=v.defineComponent({components:{PivotChart:tK},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function iK(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const nK=Ri(eK,[["render",iK]]),WX="",oK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ue.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const R=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",A=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",R),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",A),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),rK={ref:"selectRef"};function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",rK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const lK=Ri(oK,[["render",sK]]),aK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function hK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const dK=Ri(aK,[["render",hK]]);let jr=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const VX="",jX="";Fo.locale("zh-cn");const uK=v.defineComponent({name:"PivotDetail",components:{ATable:Gi.Table,BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM},props:{},setup(i,{emit:t,expose:e}){const n=`dtmodal_${jr(6)}`,o=v.ref(!1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light"),l=v.inject("pageId",""),a=v.inject("context",""),h=v.inject("indicatorUrl",""),d=v.inject("indicatorToken",""),u=v.inject("theDateInfo",{}),c=v.ref(!1),g=v.ref(!1),f=v.ref([]),p=v.ref([]),m=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:x=>`共 ${x} 条数据`}),b=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);if(T)if(x)T.addEventListener("mousedown",_);else{const M=T.parentElement;M&&(M.style.left="",M.style.top=""),T.removeEventListener("mousedown",_)}},C=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);T&&(x?T.addEventListener("dblclick",w):T.removeEventListener("dblclick",w))},_=x=>{LC(x,`.${n} .ant-modal-header`)},w=()=>{o.value=!o.value,v.nextTick(()=>{o.value?b(!1):b(!0)})},y=()=>{o.value=!1,C(!1),b(!1)};async function S(x){var I;g.value=!0,c.value=!0;const{args:T={},dimension:M,indicator:B,splitSymbol:P,theFlag:F}=x,{originData:H=[],cellHeaderPaths:{colHeaderPaths:E=[],rowHeaderPaths:k=[]}}=T;if(H!=null&&H.length){const L=H[0],D=E!=null&&E.length?E[E.length-1]:"",O=E.filter(et=>et.dimensionKey).concat(k.filter(et=>et.dimensionKey)).map(et=>et.dimensionKey);if(!(D!=null&&D.indicatorKey)||!O.length)return;const W=B.find(et=>et.label===D.indicatorKey),N={};for(const et of M)if(O.includes(et.label)){const vt=(L[et.label]||"").split(P)||[];N[et.typeGuid]=vt!=null&&vt.length?vt[vt.length-1]:""}const{startTime:$,endTime:U,rangeFormat:Y}=v.unref(u);$&&U&&(N.startTime=Fo($).format(Y),N.endTime=Fo(U).format(Y));const j=await dr.post(`${v.unref(h)}/diagram/obtainDataSetData`,{pageId:v.unref(l),indexCode:(W==null?void 0:W.indexCode)||"",indexName:W.label,theFlag:F,param:N},{headers:{Authentication:v.unref(d),operateContext:v.unref(a)}}),{columns:G=[],data:Z=[]}=((I=j==null?void 0:j.data)==null?void 0:I.data)||{};f.value=G.filter(et=>et).map(et=>({title:et,dataIndex:et})),p.value=Z.map(et=>({...et,uid:jr(6)}))}g.value=!1,v.nextTick(()=>{C(!0),b(!0)})}const R=v.computed(()=>{let x=`detail-modal ${n}`;return o.value&&(x+=" full"),v.unref(s)&&(x+=` ${v.unref(s)}`),x});v.watch(c,x=>{window.modalShow&&window.modalShow(x)});const A=x=>{v.unref(m).current=x.current};return e({showModal:S}),{theme:s,visible:c,loading:g,pagination:m,columns:f,dataSource:p,wrapClassName:R,isIndFullScreen:o,handleTableChange:A,getContainer:r,onDetailCancel:y,toggleFullScreen:w}}}),cK={key:0,class:"spin-container"};function gK(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("a-spin"),d=v.resolveComponent("a-table"),u=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(u,{wrapClassName:i.wrapClassName,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=c=>i.visible=c),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>t[2]||(t[2]=[v.createElementVNode("div",{class:"modal-title"}," 指标明细 ",-1)])),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...c)=>i.toggleFullScreen&&i.toggleFullScreen(...c))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.loading?(v.openBlock(),v.createElementBlock("div",cK,[v.createVNode(h,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(d,{key:1,"row-key":c=>c.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer","onCancel"])}const fK=Ri(uK,[["render",gK],["__scopeId","data-v-698ec4e6"]]),pK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>`,width:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>`},cursor:"pointer",visibleTime:"mouseenter_cell"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},mK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),vK={mounted(i){i.focus()}},bK=v.defineComponent({name:"PivotConfig",directives:{focus:vK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:mK,draggable:Hb,DeleteOutlined:gM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(m$),fields:[]},{title:"列维度",icon:v.createVNode(c$),fields:[]},{title:"指标",icon:v.createVNode(V$),fields:[]}]),h=(R=[],A=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of R)x.positionType==="rows"?v.unref(a)[0].fields.push(Ue.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ue.cloneDeep(x));v.unref(a)[2].fields=Ue.cloneDeep(A),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(R=>({...R,label:R.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(R=>({...R,label:R.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(R,A)=>{const x=A[R.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ue.cloneDeep(v.unref(a))},m=(R,A)=>{v.unref(a)[R].fields.splice(A,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(R,A)=>{i.fullMode&&(b.value=`${R}_${A}`,C.value=Ue.cloneDeep(v.unref(a)[R].fields[A]))},y=()=>{if(v.unref(_)){const R=v.unref(b).split("_");Gi.message.error(v.unref(_)),v.unref(a)[R[0]].fields[R[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=R=>{const A=R.target.value,x=v.unref(d).concat(v.unref(u));A?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===A)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,R=>{window.modalShow&&window.modalShow(R)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),$X="",CK={class:"config-wrap"},yK={class:"area-content"},_K={class:"area-title"},wK={class:"field-item"},SK=["onClick"];function xK(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",CK,[v.createElementVNode("div",yK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",_K,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",wK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,SK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const AK=Ri(bK,[["render",xK],["__scopeId","data-v-b39c2a7b"]]),RK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Vj,CaretDownOutlined:Oj,LoadingOutlined:y$,Draggable:Hb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(R=>{var A;R!=null&&R.isLeaf||(A=R.dataViewColumns)==null||A.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var A;if(v.unref(d))return;d.value=!0;const R={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,R.indexTypeGuid=S.indexTypeGuid,R.isLeaf=S.isLeaf):h&&(R.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await dr.post(`${v.unref(n)}/diagram/sourceList`,R,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((A=v.unref(l))==null?void 0:A.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const R=l.value[S],{children:A=[]}=R;A!=null&&A.length?R.show=!R.show:!R.noData&&R.isLeaf?f(R):R.noData&&(R.show=!R.show)},m=(S,R)=>{t("onDragStart",S,R)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var R;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(R=v.unref(a))==null||R.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:X2,mapScope:Y2,getLoadType:q2,getUseType:Z2,getSourceType:J2}}}),GX="",TK={key:0,class:"no-data"},MK={class:"column-item"},BK=["onClick"],PK={key:3,class:"item-name"},HK={class:"column-item"},EK={key:0},LK={key:1},kK={key:2},FK={key:3},IK=["onClick"],DK={class:"item-name"},OK={class:"column-child-item"},zK={class:"field"},NK={class:"column-child-item-name"};function WK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",TK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",MK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",PK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,BK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",HK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",EK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",LK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",kK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",FK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",DK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,IK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",OK,[v.createElementVNode("span",zK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",NK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const VK=Ri(RK,[["render",WK],["__scopeId","data-v-aabcdc1c"]]),jK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),UX="";function $K(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const GK=Ri(jK,[["render",$K],["__scopeId","data-v-01e4c58d"]]),UK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r}=i;return async(l={},a,h)=>{var f;const d=HC(i,l),{url:u,...c}=d||{};let g=t;if(!g){const{pathname:p}=window==null?void 0:window.location;if(p){const m=p.split("/");m!=null&&m.length&&(g=m[m.length-1])}}if(u&&c){a&&a("tableChange",{type:"11",data:c}),h&&h(c);try{return await dr({url:`${e}${u}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...c,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:g},signal:((f=window.controller)==null?void 0:f.signal)||""})}catch(p){console.error(p)}}}},KK=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await dr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},YK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=HC(i,l);try{const u=await dr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},XK=(i={})=>{const{indicatorUrl:t="",indicatorToken:e="",context:n=""}=i;return async(r={},s)=>{var l,a;try{const h=await dr({url:`${t}${s}`,method:"post",headers:{Authentication:e,operateContext:n},data:r,signal:((l=window.controller)==null?void 0:l.signal)||""});return((a=h==null?void 0:h.data)==null?void 0:a.data)||[]}catch(h){console.error(h)}}},qK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0},defaultFontSize:{type:Number,default:16},theFlag:{type:String,default:""}},lb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},ZK=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],ks=["合计","平均值","计数","最大值","最小值","方差","标准差"],JK=i=>v.defineAsyncComponent({loader:i,delay:200}),KX="",YX="",QK=v.defineComponent({name:"PivotTable",components:{PivotFilter:DT,PivotProperty:D7,ConditionalProperty:jU,ChartModal:nK,PivotAggregate:lK,PivotTop:dK,PivotConfig:AK,IndSourceList:VK,DragArea:GK,PivotDetail:fK,DrillModal:JK(()=>Promise.resolve().then(()=>cY)),SettingOutlined:k$,DatabaseOutlined:Qj,ArrowsAltOutlined:Hj,ShrinkOutlined:O$,FilterOutlined:pM,DeleteOutlined:gM,ClearOutlined:Uj},props:{...qK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),R=v.ref({}),A=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),W=v.ref(0),N=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),Z=v.ref({dateFormat:"YYYY-MM-DD"}),et=v.ref(16);let gt=40;const vt=6,it=10,nt=15,bt=20,Ct=24,at=v.ref([]);let rt=`|${jr(6)}|`;const ct=v.ref();v.provide("splitSymbol",rt),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",Z),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ht=v.ref({}),_t=()=>{const V={borderColor:v.unref(kt).borderColor};ht.value=V},ut=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),It=v.ref(1),Ut=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Ut.value=q,It.value++,v.nextTick(()=>{SB()})}}).observe(document.body);const Tt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&It.value?i.isIframeMode?Ut.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),kt=v.computed(()=>{var J;const V={},{styleConfig:K}=i;let q={};(J=Object.keys(K))!=null&&J.length?q=K:q=v.unref(ut);for(const X in q)V[X]=q[X]||"transparent";return V}),oe=v.ref({}),re=()=>{const V=Zl();V&&(v.unref(oe).width=V.width+2+"px"),v.unref(oe).backgroundColor=EC(v.unref(kt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(dt))});const ye=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),J=+(1/K).toFixed(5),X=+(parseFloat(i.width)*V).toFixed(2),Q=+(parseFloat(i.height)*K).toFixed(2);R.value={transform:`scale(${q}, ${J})`,width:X+"px",height:Q+"px",left:-(X-parseFloat(i.width))/2+"px",top:-(Q-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},et.value=i.defaultFontSize*V,gt=(i.defaultFontSize+30)*K,dt.defaultRowHeight=gt,dt.theme.scrollStyle.width=vt*V,dt.theme.scrollStyle.scrollSliderCornerRadius=it*V,dt.theme.tooltipStyle.fontSize=et.value,j.value=(i.defaultFontSize+10)*V,pK(C7,{sortNotActiveColor:v.unref(kt).sortNotActiveColor,sortActiveColor:v.unref(kt).sortActiveColor,iconSize:nt*V,hoverSize:bt*V,downSize:Ct*V}),v.nextTick(()=>{var tt,ft,Pt,Qt,Ht,Lt,te,Ot,We,Rn,qn,ji;(ft=(tt=v.unref(S))==null?void 0:tt.style)==null||ft.setProperty("--box-tooltip-fontsize",et.value+"px"),(Qt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Qt.setProperty("--box-item-size",j.value+"px"),(Lt=(Ht=v.unref(_))==null?void 0:Ht.style)==null||Lt.setProperty("--menu-item-max-width",200*V+"px"),(Ot=(te=v.unref(_))==null?void 0:te.style)==null||Ot.setProperty("--menu-item-padding",`${i.defaultFontSize/2*V}px ${i.defaultFontSize*V}px`),(Rn=(We=v.unref(_))==null?void 0:We.style)==null||Rn.setProperty("--menu-item-font-size",(i.defaultFontSize>20?i.defaultFontSize-4:i.defaultFontSize)*V+"px"),(ji=(qn=v.unref(_))==null?void 0:qn.style)==null||ji.setProperty("--menu-item-line-height",24*K+"px"),n&&n.updateOption(dt)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{ye()},{deep:!0});const Oe=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=dt.rows)!=null&&V.length)&&!((K=dt.columns)!=null&&K.length)&&!((q=dt.indicators)!=null&&q.length)}),Be=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),Ee=v.computed(()=>{const V={fontSize:et.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),At=v.ref([]),mt=v.ref([]);v.provide("dimensionFieldList",At),v.provide("indicatorFieldList",mt);const Bt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Kt=v.computed(()=>v.unref(At).filter(V=>V.isInnerFilter).concat(v.unref(mt).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var J,X,Q,tt,ft,Pt,Qt,Ht,Lt,te;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=kt.value;V&&((X=(J=v.unref(_))==null?void 0:J.style)==null||X.setProperty("--menu-bg-color",V)),K&&((tt=(Q=v.unref(_))==null?void 0:Q.style)==null||tt.setProperty("--menu-color",K)),q&&((Pt=(ft=v.unref(_))==null?void 0:ft.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((Ht=(Qt=v.unref(_))==null?void 0:Qt.style)==null||Ht.setProperty("--sub-menu-left",F.value)),H.value&&((te=(Lt=v.unref(_))==null?void 0:Lt.style)==null||te.setProperty("--sub-menu-top",H.value))});const qt=v.ref([]),fe=v.ref({}),Yt=v.ref({}),Nt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderBgColor:v.unref(kt).headerBgColor},color(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderColor:v.unref(kt).headerColor},borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},cornerHeaderStyle:{bgColor(){return v.unref(kt).headerBgColor},color:v.unref(kt).headerColor,borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},bodyStyle:{borderColor:v.unref(kt).borderColor,color(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyColor:v.unref(kt).bodyColor},bgColor(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateBgColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyBgColor:v.unref(kt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},rowHeaderStyle:{borderColor:v.unref(kt).borderColor,bgColor(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateBgColor:v.unref(kt).bodyBgColor},color(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateColor:v.unref(kt).bodyColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(kt).borderColor},scrollStyle:{width:vt,scrollSliderCornerRadius:it},tooltipStyle:{fontSize:v.unref(et)}}),dt=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Nt}),Ft=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),$t=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),ae=5,Ti=v.ref({});v.watch(A,V=>{if(V){const K={};v.nextTick(()=>{var X,Q;const q=Zl();let J=0;(X=v.unref(Kt))!=null&&X.length&&(J=(Q=v.unref($))==null?void 0:Q.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+J+v.unref($t)+"px",K.left=q.left+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"),Ti.value=K})}});const Lo=v.ref([]),Xn=v.ref([]),$r=v.ref({}),An=v.ref({}),Fs=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),Xl=v.ref([]),gY=v.computed(()=>{const V=[];for(const Q of v.unref(Lo)){const{data:tt,indicatorKey:ft="",calculateType:Pt=""}=Q||{};V.push({label:tt.indicatorKey,columnName:tt.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:ft})}const K=[],q={};v.unref(Xn).forEach(Q=>{q[Q.key]||(q[Q.key]=[]),q[Q.key].push(Q)});for(const Q in q){const tt=q[Q]||[];tt.forEach((ft,Pt)=>{var Ot;const Qt=v.unref(At).find(We=>We.label===ft.key),Ht=v.unref(mt).find(We=>We.label===ft.key),Lt=Qt||Ht,te={};Pt<tt.length-1&&(te.join="&&"),(Lt==null?void 0:Lt.genericType)==="DATE"&&(te.dateFormat=((Ot=v.unref(Z))==null?void 0:Ot.dateFormat)||"YYYY-MM-DD",Pt===0?te.prop="startTime":Pt===1&&(te.prop="endTime")),Lt&&K.push({fieldName:Lt.name,fieldType:Lt.genericType,fieldValue:Array.isArray(ft.value)?ft.value.join(","):ft.value,hrpIndexCode:Lt.indexCode,hrpIndexCodeNum:Lt.indexCodeNum,id:Lt.id,label:Lt.label,rule:ft.rule,targetSource:"",typeGuid:ft.typeGuid||"",type:ft.type,...te})})}const J=[];if(Object.keys(v.unref($r)))for(const Q in v.unref($r))v.unref($r)[Q]&&J.push({key:Q,num:v.unref($r)[Q],rule:"TOP"});const X=[];if(Object.keys(v.unref(An)))for(const Q in v.unref(An)){const{order:tt,type:ft,columnData:Pt,columnHeader:Qt}=v.unref(An)[Q];if(tt.toLowerCase()==="default-sort")continue;const Ht={label:Q,order:tt.toUpperCase(),type:"COMBINATION",fieldType:ft};ft==="indicators"&&(Ht.columnHeader=Qt,Ht.columnData=Pt,Ht.type="NORMAL"),X.push(Ht)}return{calc:V,filter:K,truncations:J,sorts:X,aggregateMethod:v.unref(P)||{}}}),fY=XK(i),pY=YK(i),mY=UK(i),hb=KK(i),db=v.ref({}),ub=v.ref({}),vY=async()=>{var q;const V=v.unref(mt).filter(J=>J.calcType==="FORMULA");let K;if(V!=null&&V.length&&(K=await fY({indicatorList:v.unref(mt).map(J=>{const X={calcType:J.calcType||"COLUMN",columnName:J.name,label:J.label,location:J.location,show:J.show};return J.indexCode&&(X.hrpIndexCode=J.indexCode),J.indexCodeNum&&(X.hrpIndexCodeNum=J.indexCodeNum),J.formula&&(X.formula=J.formula),X})},"/diagram/obtainIndexDrillDetail")),K!=null&&K.length){const J={};for(const X of K)(q=X.detailList)!=null&&q.length&&(J[X.label]=X.detailList);ub.value=J}};v.watch(()=>mt.value,()=>{vY()},{deep:!0});const gr=async()=>{var Pt,Qt,Ht,Lt,te;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:J=[],columns:X=[]}=dt,Q=(Pt=v.unref(Yl))!=null&&Pt.length?v.unref(Yl):[],tt=(Qt=v.unref(Xl))!=null&&Qt.length?v.unref(Xl):[];if(!(Q!=null&&Q.length))for(const Ot of J)Q.push(Ot.dimensionKey);if(!(tt!=null&&tt.length))for(const Ot of X)tt.push(Ot.dimensionKey);Q!=null&&Q.length||Q.push(...V.filter(Ot=>Ot.position==="rows").map(Ot=>Ot.key)),tt!=null&&tt.length||tt.push(...V.filter(Ot=>Ot.position==="columns").map(Ot=>Ot.key));const ft=[];for(const Ot in v.unref(a))ft.push({type:"dimension",key:Ot,rule:v.unref(a)[Ot]});for(const Ot in v.unref(h))ft.push({type:"indicators",key:Ot,rule:v.unref(h)[Ot]});if(ft!=null&&ft.length&&cb(ft,{isHandle:!1}),q!=null&&q.length)for(const Ot of q)!Q.includes(Ot.name)&&!tt.includes(Ot.name)&&Q.push(Ot.name);db.value={...v.unref(gY),rowDimensionKeys:Q,colDimensionKeys:tt,dimensions:(Ht=v.unref(Fs))!=null&&Ht.length?v.unref(Fs):v.unref(At),indicators:(Lt=v.unref(Kl))!=null&&Lt.length?v.unref(Kl):v.unref(mt)};try{const Ot=await mY({pivotTableCal:v.unref(db)},e,We=>{var Rn;if(v.unref(G)){const{sqlConditions:qn=[],queryColumns:ji=[]}=We,Xe=vB(qn),oi=ji.find($i=>$i.typeGuid==="the_date");if(oi&&(Z.value={dateFormat:oi.dateFormat||"YYYY-MM-DD"}),Xe!=null&&Xe.length)for(const $i of Xe)["startTime","endTime"].includes($i.prop)&&(v.unref(Z)[$i.prop]=$i.fieldValue||"",(Rn=v.unref(Z))!=null&&Rn.rangeFormat||(v.unref(Z).rangeFormat=$i.dateFormat||"YYYY-MM-DD"));G.value=!1}});(te=Ot==null?void 0:Ot.data)!=null&&te.success&&(YY(),ct.value=""),wB(Ot)}catch(Ot){console.error(Ot)}};function vB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...vB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const bY=V=>{v.unref(Lo).find(K=>K.data.indicatorKey===V.data.indicatorKey)||Lo.value.push(V),gr()},CY=V=>{const K=v.unref(Lo).findIndex(q=>q.data.indicatorKey===V);K!==-1&&Lo.value.splice(K,1),gr()},cb=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const J of q){const{key:X="",rule:Q,type:tt=""}=J||{};let ft=Ue.cloneDeep(Q);Array.isArray(Q)||(ft=[Q]);const Pt=v.unref(At).find(Lt=>Lt.label===X),Qt=v.unref(mt).find(Lt=>Lt.label===X),Ht=Pt||Qt;if(Ht){if((Ht==null?void 0:Ht.genericType)==="DATE"&&(ft==null?void 0:ft.length)===1){const Lt=ft[0].value;ft[0].rule="GREATER_EQUAL",ft[1]={rule:"LESS_EQUAL",value:Lt}}for(let Lt=v.unref(Xn).length-1;Lt>=0;Lt--){const te=v.unref(Xn)[Lt];te.key===X&&te.type===tt&&v.unref(Xn).splice(Lt,1)}for(const Lt of ft){const{rule:te,value:Ot}=Lt;X&&te&&Ot&&Xn.value.push({key:X,rule:te,value:Ot,type:tt,typeGuid:Ht.typeGuid})}}}K&&gr()},yY=()=>{$r.value=v.unref(x)||{},gr()},bB=V=>{const{key:K,order:q,type:J,columnData:X=[]}=V;if(J==="indicators"){let Q="";for(const tt in v.unref(An))v.unref(An)[tt].type==="indicators"&&(Q=tt);Q&&delete v.unref(An)[Q]}v.unref(An)[K]={order:q,type:J,columnData:X},gr()},ql=()=>{const V=v.unref(At),K=v.unref(mt),q=V.filter(X=>X.positionType==="rows").map(X=>X.name),J=V.filter(X=>X.positionType==="columns").map(X=>X.name);Fs.value=Ue.cloneDeep(V),Kl.value=Ue.cloneDeep(K),Yl.value=Ue.cloneDeep(q),Xl.value=Ue.cloneDeep(J),gr()};function _Y(V,K=!0,q=-1){if(q>-1)dt.indicators.splice(q,0,...V);else for(const J of V)dt.indicators.push(J);K&&n.updateOption(dt)}function wY({label:V,calcType:K}){const q=[],J=[],X=[],Q=v.unref(ub)[V],tt=v.unref(Yt)[V]||[];for(const ft in lb)tt.indexOf(ft)===-1&&X.push({text:lb[ft],menuKey:ft});return Q!=null&&Q.length&&(J.push({text:"公式:"+Q[0],menuKey:"formula"}),Q.forEach((ft,Pt)=>{const Qt=v.unref(mt).find(Ht=>Ht.label===ft);Pt>0&&!Qt.show&&J.push({text:ft,menuKey:ft})}),q.push({text:"详情",menuKey:"detail",children:J})),[...q,{text:"计算",menuKey:"calculate",children:X},...ZK]}function gf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(at)&&Array.isArray(v.unref(at)))if((q=v.unref(at))!=null&&q.length){const J=v.unref(at).map(X=>({text:X.title||X.label,menuKey:V==="rows"?`${rt}${X.label}`:X.label}));V==="rows"?K=J:K[0].children=J}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function SY(V,K){A.value=!0,v.unref(P)[K]=V||[],hn({type:"9",data:{key:K,types:V}}),gr()}function xY(V,K=!0){var q;for(const J of V){const{key:X,name:Q,type:tt,dimensionKey:ft,width:Pt}=J;let Qt;if(ft)Qt=J;else{const Ht={dimensionKey:X,title:Q,width:Pt?`${Pt}%`:"auto",minWidth:"15%",type:tt};tt==="columns"?Ht.headerStyle={textStick:!0}:tt==="rows"&&(Ht.cornerHeaderIcon="sortNormal"),Qt=Ht}if(Qt&&(Qt.headerStyle={textStick:!0},Qt.headerFormat||(Qt.headerFormat=Ht=>{if(tt==="rows"){const Lt=Ht==null?void 0:Ht.split(rt);return Lt!=null&&Lt.length?Lt[Lt.length-1]:Ht}else return Ht}),dt[tt].push(Qt)),(q=dt[tt])!=null&&q.length)for(const Ht of dt[tt])Ht.cornerDropDownMenu=gf(),tt==="rows"&&(Ht.dropDownMenu=gf("rows"));dt.dataConfig.sortRules.push({sortField:X,sortType:v.unref(r)})}K&&n.updateOption(dt),v.nextTick(()=>{yB()})}function CB(V){const K={},{records:q}=dt;for(const J of q)for(const X of V)Mn(K,X)?K[X].find(Q=>Q.value===J[X])||K[X].push(gb({value:J[X]})):K[X]=gb([{value:J[X]}]);return K}function gb(V){const K=Ue.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const J of K)q(J);else q(K);function q(J){for(const X in J)if(typeof J[X]=="string"){const Q=J[X].split(rt);Q!=null&&Q.length&&(J[X]=Q[Q.length-1])}}return K}function yB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=CB(q)}const _B=v.computed(()=>{var V;return(V=v.unref(At))!=null&&V.length?v.unref(At).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function wB(V){var Ot,We,Rn,qn,ji,Xe,oi,$i;const K=await pY({pivotTableCal:v.unref(db)});at.value=K.filter(Wt=>!v.unref(_B).includes(Wt.label));let q=V;V?Y.value=Ue.cloneDeep(V):q=Ue.cloneDeep(v.unref(Y)),A.value=!0;const{data:J={}}=(q==null?void 0:q.data)||{},{rows:X=[]}=J,Q=[],tt=[];for(const Wt of v.unref(At)){if(!Wt.show)continue;const ie=dt[Wt.positionType].find(Ze=>Ze.dimensionKey===Wt.label);ie?tt.push({...ie,title:Wt.showTitle}):tt.push({key:Wt.label,name:Wt.showTitle,type:Wt.positionType,width:Wt.width})}for(let Wt=0;Wt<v.unref(mt).length;Wt++){const ie=v.unref(mt)[Wt];if(!ie.show)continue;const Ze=wY(ie),Ge=dt.indicators.find(Fi=>Fi.indicatorKey===ie.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:ie.showTitle}:ze={indicatorKey:ie.label,title:ie.showTitle,width:ie!=null&&ie.width?`${ie.width}%`:"auto",minWidth:"15%",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Tn,Jh,Qh)=>{const bb=Qh.getRecordByCell(Tn,Jh)||[];return bb[0]&&isNaN(+bb[0][ie.label])?bb[0][ie.label]:Fi||"-"}),Q.push(ze))}const ft=tt.filter(Wt=>Wt.type==="rows");if(((Ot=dt==null?void 0:dt.rows)==null?void 0:Ot.length)!==ft.length&&typeof((We=v.unref(B))==null?void 0:We.col)=="number"&&(v.unref(B).col+=ft.length-(((Rn=dt==null?void 0:dt.rows)==null?void 0:Rn.length)||0)),dt.indicators=[],dt.rows=[],dt.columns=[],(qn=v.unref(Lo))!=null&&qn.length){for(const Wt of v.unref(Lo))if(!isNaN(+Wt.position)){const ie={...Wt.data,calculateType:Wt.calculateType};["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(ie.calculateType)&&PB(ie,Wt.data.formatConfig),Q.splice(+Wt.position,0,ie)}}const{sortType:Pt,col:Qt,row:Ht}=v.unref(B)||{};for(const Wt of Q)Wt&&(Wt.headerIcon=ie=>{const{col:Ze,row:Ge}=ie;if(Qt===Ze&&Ht===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});_Y(Q,!1),xY(tt,!1);const Lt=[],te=tt.filter(Wt=>Wt.type==="rows").map(Wt=>Wt.key||Wt.dimensionKey);for(const Wt of X)for(const ie in Wt)if(!ks.includes(Wt[ie])){const Ze=te.indexOf(ie);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(Wt[te[ze]]);if(Fi.includes(rt)){const Tn=Fi.split(rt);Tn!=null&&Tn.length&&Ge.push(Tn[Tn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(Wt[ie]=Ge.join(rt))}}for(const Wt of tt){const ie=(Wt==null?void 0:Wt.key)||(Wt==null?void 0:Wt.dimensionKey);if(Wt.type==="columns"&&!v.unref(M)[ie])v.unref(M)[ie]=fb("",ie,X);else if(Wt.type==="rows")if(v.unref(T)[ie]){const{type:Ze}=v.unref(T)[ie]||{};Lt.push(fb(Ze,ie,X))}else if(!v.unref(B)||v.unref(B).sortField===ie||!n)Lt.push(fb("",ie,X));else{const Ze=dt.dataConfig.sortRules.find(Ge=>Ge.sortField===ie);Ze&&Lt.push(Ze)}}if(v.unref(B)&&Lt.push(v.unref(B)),(ji=Object.keys(v.unref(M)))!=null&&ji.length)for(const Wt in v.unref(M))Lt.push(v.unref(M)[Wt]);if(dt.records=X,dt.dataConfig.sortRules=Lt,X!=null&&X.length&&(v.unref(O).records=[]),(Xe=dt.columns)!=null&&Xe.length?dt.columnHeaderTitle=!0:(oi=dt.indicators)!=null&&oi.length?dt.columnHeaderTitle=!1:($i=dt.rows)!=null&&$i.length&&(dt.columnHeaderTitle=!0),n)n.updateOption(dt),v.nextTick(()=>{xB()}),A.value=!1;else{const Wt=document.getElementById(`pivotTableContainer_${i.id}`);n=new LT(Wt,dt),v.nextTick(()=>{xB(),o.value=!0,A.value=!1,i.isIframeMode&&(v.unref(W)&&n.setScrollTop(v.unref(W)),v.unref(N)&&n.setScrollLeft(v.unref(N)))}),FY()}v.nextTick(()=>{const{indexFormatConfig:Wt}=(i==null?void 0:i.defaultConfig)||{};if(Wt){const ie=[];for(const Ze in Wt)Wt[Ze]&&ie.push(Wt[Ze]);BB(ie)}})}const Gr=v.ref({});function SB(){Zl()&&(v.unref(D)?(v.unref(Gr).top=v.unref($t)+"px",v.unref(Gr).left="0"):(v.unref(Gr).top="0",v.unref(Gr).left="0"))}function xB(){var V;if(n&&!((V=dt.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const J of K)q[J]="";v.unref(O).dataConfig={...dt.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...dt,...v.unref(O)})}}function AY(V,K){A.value=!0,hn({type:"3",data:{type:"indicators",key:V,rule:K}}),cb({type:"indicators",key:V,rule:K})}function RY(V,K){A.value=!0,hn({type:"3",data:{type:"dimension",key:V,rule:K}}),cb({type:"dimension",key:V,rule:K})}function TY(V,K){var Q;let q=!1;const J=dt[K].findIndex(tt=>tt.dimensionKey===V),X=dt.dataConfig.sortRules.findIndex(tt=>tt.sortField===V);if(J!==-1){if(dt[K].splice(J,1),i.fullMode||i.allowDrill){const tt=v.unref(At).findIndex(ft=>ft.label===V);tt!==-1&&(v.unref(At)[tt].isInnerFilter?(v.unref(At)[tt].show=!1,q=!0):v.unref(At).splice(tt,1))}else for(const tt of dt[K])tt.cornerDropDownMenu=gf(),K==="rows"&&(tt.dropDownMenu=gf("rows"));(Q=v.unref(B))!=null&&Q.col&&(v.unref(B).col-=1),A.value=!0,hn({type:"7"}),ql()}X!==-1&&(dt.dataConfig.sortRules[X].sortType=r),n.updateOption(dt),v.nextTick(()=>{if(yB(),!q){delete a.value[V];const tt=v.unref(Xn).findIndex(ft=>ft.key===V);tt!==-1&&v.unref(Xn).splice(tt,1)}})}function MY(V){const{indicators:K}=dt,q=K.findIndex(J=>J.indicatorKey===V);if(q!==-1){const J=K[q];if(K.splice(q,1),J.calculateType){const X=J.indicatorKey.split("@"+J.calculateType)[0],Q=v.unref(Yt)[X].indexOf(J.calculateType);Q!==-1&&v.unref(Yt)[X].splice(Q,1);const tt=v.unref(qt).indexOf(J.title);tt!==-1&&v.unref(qt).splice(tt,1),delete v.unref(fe)[J.title]}hn({type:"2",data:J.indicatorKey}),CY(J.indicatorKey)}}function fb(V,K,q){let J=[];const X=new Set;for(const Q of q){const tt=Q[K];tt&&!ks.includes(tt)&&X.add(tt)}return J=Array.from(X),V==="asc"?J=J.sort((Q,tt)=>Q.localeCompare(tt)):V==="desc"&&(J=J.sort((Q,tt)=>tt.localeCompare(Q))),{sortField:K,sortBy:[...J,...ks]}}function AB(V,K,q,J){A.value=!0;let{menu:{dropDownMenuHighlight:X},rows:Q}=dt;J=J+1,X=X.filter(ft=>!(ft.type==="dimension"&&ft.field===K)||ft.type==="indicator"),X.push({col:q,row:J-1,field:K,type:"dimension",menuKey:V}),dt.menu.dropDownMenuHighlight=X;const tt=Q.find(ft=>ft.dimensionKey===K);if(tt){let ft="sortNormal";V==="asc"?ft="sortUp":V==="desc"&&(ft="sortDown"),tt.cornerHeaderIcon=ft}n.updateOption(dt),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},hn({type:"4",data:{key:K,order:V,type:"dimension"}}),bB({key:K,order:V,type:"dimension"})}function RB(V,K,q,J,X){var te;A.value=!0;const{menu:Q}=dt;let tt=Q.dropDownMenuHighlight,ft="";(te=dt.rows)!=null&&te.length&&(ft=dt.rows[dt.rows.length-1].dimensionKey);const Pt=q.filter((Ot,We)=>We<q.length-1),Qt=Pt.map(Ot=>({columnName:Ot.dimensionKey})),Ht=Pt.map(Ot=>Ot.value),Lt=tt.findIndex(Ot=>Ot.field===ft&&Ot.type==="dimension");Lt!==-1&&tt.splice(Lt,1),tt=tt.filter(Ot=>Ot.type==="dimension"),tt.push({col:J,row:X,field:K,type:"indicator",menuKey:V}),dt.menu.dropDownMenuHighlight=tt,n.updateOption(dt),V==="default-sort"?B.value=null:B.value={sortField:ft,sortByIndicator:K,sortType:V.toUpperCase(),query:Ht,col:J,row:X},hn({type:"4",data:{key:K,order:V,type:"indicators"}}),bB({key:K,order:V,type:"indicators",columnData:Ht,columnHeader:Qt})}function TB({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const J=v.unref(At).find(X=>X.label===V);d.value={fieldName:K||(J==null?void 0:J.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),hn({type:"5",data:V})})}function BY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function PY({indicatorKey:V,menuKey:K}){A.value=!0;let q=dt.indicators.length-1;const J=`${V}@${K}`,X=`${V}(${lb[K]}) fx`;v.unref(qt).push(X),v.unref(fe)[X]=J,dt.indicators.forEach((tt,ft)=>{tt.indicatorKey===V&&(q=ft+1)}),v.unref(Yt)[V]||(v.unref(Yt)[V]=[]),v.unref(Yt)[V].push(K);const Q={data:{indicatorKey:J,title:X,width:"auto",minWidth:"15%",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][J])?Ht[0][J]:tt}},position:q,indicatorKey:V,calculateType:K};if(["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(K)){const tt=Zh(V);if(tt>-1){const ft=dt.indicators[tt].formatConfig||{};Q.data.formatConfig={...ft,fieldName:J,indicatorKey:J}}}hn({type:"1",data:{indicatorKey:V,calculateType:K}}),bY(Q)}function HY(){const V=dt.rows[0]?dt.rows[0].cornerDropDownMenu:[],K=dt.columns[0]?dt.columns[0].cornerDropDownMenu:[],q=dt.rows.map(tt=>({...tt,cornerDropDownMenu:K})),J=dt.columns.map(tt=>({...tt,cornerDropDownMenu:V}));dt.columns=q,dt.rows=J;const{type:X,len:Q}=dt.aggregate||{};X&&(dt.records.splice(-Q),dt.aggregate={type:X,len:0}),dt.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},dt.dataConfig.filterRules=[],n.updateOption(dt)}function EY({indicatorKey:V,fieldName:K}){const q=Zh(V);if(q>-1){const J=dt.indicators[q].formatConfig||{};v.unref(g).showModal({...J,indicatorKey:V,fieldName:K})}}function LY(V){const K=Zh(V);if(K>-1){const q=dt.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function Zh(V){return dt.indicators.findIndex(K=>K.indicatorKey===V)}function kY(V){const K=v.unref(At)[0],q=v.unref(At).map(Q=>Q.label),J=CB(q),X={xLabel:K.label,yLabel:V,dimensionData:J,records:gb(dt.records)};v.unref(C).showModal(X)}function FY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?W.value=n.getScrollTop():K==="horizontal"&&(N.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:rt,dimension:v.unref(At),indicator:v.unref(mt),theFlag:i.theFlag})}),n.on("after_render",()=>{_t(),SB(),re(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:J}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:X,indicators:Q}=dt,tt=n.getCellValue(q,J);let ft=v.unref(At).find(te=>te.showTitle===tt);ft||(ft=v.unref(mt).find(te=>te.showTitle===tt));let Pt=ft==null?void 0:ft.label;if(v.unref(qt).includes(tt)&&(Pt=v.unref(fe)[tt]),!Pt)return;const Qt=X.find(te=>te.dimensionKey===Pt),Ht=Q.find(te=>te.indicatorKey===Pt);let Lt="default-sort";if(K==="sortUp"?Lt="desc":K==="sortDown"?Lt="default-sort":(!K||K==="sortNormal")&&(Lt="asc"),Ht){const te=n.getCellHeaderPaths(q,J);RB(Lt,Pt,(te==null?void 0:te.colHeaderPaths)||[],q,J)}else Qt&&AB(Lt,Pt,q,J)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:J}=V,{dimensionKey:X,indicatorKey:Q,value:tt}=K[K.length-1];let ft=V.menuKey,Pt=!1;ft.includes(rt)&&(Pt=!0,ft=ft.replace(rt,"")),l.value=V;const Qt=v.unref(at).find(Ht=>Ht.label===ft);if(Qt){const Ht=v.unref(At).findIndex(Lt=>Lt.label===X);if(Ht!==-1){const Lt={...Qt,show:!0,positionType:"rows",showTitle:Qt.title||Qt.label};Pt?v.unref(y).showModal({drillDimension:Lt,drillFieldData:K,usedDimensionFields:v.unref(_B),tableProps:i,splitSymbol:rt}):(At.value.splice(Ht+1,0,Lt),A.value=!0,ql()),hn({type:"8"})}}else{const Ht=Ue.cloneDeep(v.unref(mt));let Lt=0;const te=Ht.findIndex(We=>We.label===ft),Ot=Ht.findIndex(We=>We.label===Q);if(te!==-1)Ht[te].show=!0,kC(Ht,te,te>Ot?Ot+1:Ot),Lt=1;else if(ft==="formula"){const We=v.unref(ub)[Q]||[];if((We==null?void 0:We.length)>1){const Rn=We.slice(1,We.length);for(const qn of Rn){const ji=Ht.findIndex(Xe=>Xe.label===qn);ji!==-1&&!Ht[ji].show&&(Ht[ji].show=!0,kC(Ht,ji,ji>Ot?Ot+1:Ot),Lt++)}}}Lt&&(mt.value=Ht,A.value=!0,ql())}switch(ft){case"drill":alert("无维度可钻取");break;case"delete":X?TY(X,"rows"):Q&&MY(Q);break;case"asc":case"desc":case"default-sort":X?AB(ft,X,q,J):Q&&RB(ft,Q,K,q,J);break;case"filter":X?TB({dimensionKey:X}):Q&&BY(Q,tt);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":PY({indicatorKey:Q,menuKey:ft});break;case"trans":HY();break;case"property":EY({indicatorKey:Q,fieldName:tt});break;case"conditionalProperty":LY(Q);break;case"aggregate":v.unref(p).showModal(v.unref(P)[X]||[],X);break;case"top":IY(X);break;case"graph":kY(Q);break}})}function IY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function DY(){v.unref(b).showModal(v.unref(At),v.unref(mt))}async function OY(){A.value=!0,await hb("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ht.value={},At.value=[],mt.value=[],qt.value=[],fe.value={},Yt.value={},Ti.value={},Lo.value=[],Xn.value=[],$r.value={},An.value={},Fs.value=[],Kl.value=[],Yl.value=[],Xl.value=[],Y.value={},Gr.value={},W.value=0,N.value=0,dt.records=[],dt.rows=[],dt.columns=[],dt.indicators=[],dt.dataConfig={sortRules:[],filterRules:[]},dt.defaultRowHeight=gt,dt.menu.dropDownMenuHighlight=[],kB(),ye(),gr()}function zY(V=[],K=[]){var Q;const q=V.concat(K).map(tt=>tt.name),J=v.unref(At).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1})),X=v.unref(mt).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1}));At.value=[...V,...J],mt.value=[...K,...X];for(const tt in v.unref(An))if(((Q=v.unref(An)[tt])==null?void 0:Q.type)==="indicators"){delete v.unref(An)[tt];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()):wB()}function NY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),J=v.unref(At).find(Pt=>Pt.name===K),X=v.unref(At).findIndex(Pt=>Pt.name===K),Q=v.unref(mt).find(Pt=>Pt.name===K),tt=v.unref(mt).findIndex(Pt=>Pt.name===K),ft={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(J)if(J.show){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J.positionType=V,J.show=!0,v.unref(At).push(J),v.unref(At).splice(X,1);else v.unref(At).push({...Ue.cloneDeep(v.unref(I)),...ft,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(Q)if(Q.show){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q.show=!0,v.unref(mt).push(Q),v.unref(mt).splice(tt,1);else v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),...ft,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q?(Q.isInnerFilter=!0,Q.timeStamp=new Date().getTime()):v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J?(J.isInnerFilter=!0,J.timeStamp=new Date().getTime()):v.unref(At).push({...Ue.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft})}A.value=!0,I.value=null,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()}const WY=(V=[])=>{let K=!1;for(const q of v.unref(At))if(!V.find(X=>X.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",WY);const MB=()=>{},VY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},RY(K,V)):q==="indicators"&&(h.value[K]=V,AY(K,V))};function BB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:J}=q,X=Zh(J);if(X>-1){const Q=dt.indicators[X];Q.formatConfig=q,PB(Q,q)}}n.updateOption(dt)}function PB(V,K){const{unit:q="",format:J,floatLength:X,position:Q}=K;V.format=(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][V.indicatorKey])?Ht[0][V.indicatorKey]:(J==="integer"?tt=Math.round(Number(tt)):J==="float"&&!isNaN(X)?tt=Number(tt).toFixed(X):J==="percent"&&(X?tt=(Number(tt)*100).toFixed(X)+"%":tt=Number(tt)*100+"%"),Q==="right"?tt+q:q+tt)}}function jY(V,K=[]){const q=Zh(V);if(q>-1){const J=dt.indicators[q];J.conditionalConfig=K;const X=[];K.forEach(Q=>{let tt="";Q.conditions.forEach((ft,Pt)=>{Pt>0&&(tt+=ft.join==="and"?" && ":" || "),tt+=`value${ft.operation}${ft.value}`}),X.push(tt)}),J.style.color=({dataValue:Q})=>{let tt="#333";return K.forEach((ft,Pt)=>{ft.color&&(tt=pb(X[Pt],Q)?ft.color:tt)}),tt},J.style.textAlign=({dataValue:Q})=>{let tt="left";return K.forEach((ft,Pt)=>{ft.align&&(tt=pb(X[Pt],Q)?ft.align:tt)}),tt},J.customRender=({rect:Q,dataValue:tt})=>{let ft=[];return K.forEach((Pt,Qt)=>{if(Pt.icon&&pb(X[Qt],tt)){const Lt=K2(Pt.icon,Pt.iconColor);ft=[{type:"icon",x:Pt.align!=="right"?15:Q.width-25,y:Q.height/2-7,svg:Lt,height:14,width:14}]}}),{elements:ft,renderDefault:!0}},n.updateOption(dt)}}function pb(V,K){V=V||"true";const q=`function (value){
|
|
367
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pU(i){var t=function(e,n){if($l(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return $l(t)=="symbol"?t:t+""}function ob(i,t,e){return(t=pU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Qg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Ho(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Ho(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Qg.__scopeId="data-v-24517fec",Qg.__file="src/picker/Saturation.vue";var tf=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),mU={ref:"canvas"};Ho(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",mU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},tf.__scopeId="data-v-78b9f4f0",tf.__file="src/picker/Hue.vue";var ef=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),vU={ref:"canvas"};Ho(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),ef.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",vU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},ef.__scopeId="data-v-24dc9656",ef.__file="src/picker/Alpha.vue";var tB={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},eB={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},bU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function iB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?iB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):iB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Ls=null,nB=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Ls.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=rb(rb(rb({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=Gl(a,2),c=u[0],g=u[1],f=Gl(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Ls)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Ls=gU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Ls&&((a=Ls)===null||a===void 0||a.destroy(),Ls=null)}),{instance:Ls,style:n}},nf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=nB(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return tB[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return eB[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",bU[d])}}}}),CU={class:"format"},yU={key:0,class:"arrow"},_U=["onClick"];Ho(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),nf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",CU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",yU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,_U)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},nf.__scopeId="data-v-5f6e8f5e",nf.__file="src/picker/input-value/FormatValue.vue";var of=v.defineComponent({name:"Input",components:{FormatValue:nf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),wU={class:"input"},SU=[".value"];function oB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Yn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),of.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",wU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,SU)])},of.__scopeId="data-v-2c454c00",of.__file="src/picker/input-value/InputValue.vue";var rB=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},sB={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},rf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(sB[t]||t).concat(sB[e]||e)},lB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(rf(t)).concat(rf(e)).concat(rf(n))},Ul=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Xh=function(i,t,e){i=6*Ul(i,360),t=Ul(t,100),e=Ul(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},aB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=rB(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Xh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(lB(Xh(r,s,l))).concat(rf(255*a))}else switch(t){case"hsl":var f=rB(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Xh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return lB(Xh(r,s,l))}},sf=function(i){var t=i.r,e=i.g,n=i.b;t=Ul(t,255),e=Ul(e,255),n=Ul(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},hB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},dB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},sb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=lf(i,af(i),e),o=fB(n);return o==null?"":aB(o,t,e)}return""},uB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},cB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},gB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},lf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=uB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Yn(Yn({},sf({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=gB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=cB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Yn(Yn({},hB({h,s:d,l:u})),{},{a:+c});default:var g=dB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Yn(Yn({},sf({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Yn(Yn({},sf(uB(i))),{},{a:1});case"hsv":var C=gB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Yn(Yn({},hB(cB(i))),{},{a:1});default:return Yn(Yn({},sf(dB(i))),{},{a:1})}},af=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},fB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},qh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),xU=["draggable"];Ho(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),qh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,xU)},qh.__scopeId="data-v-02da71fd",qh.__file="src/color-item/ColorItem.vue";var hf=v.defineComponent({name:"Colors",components:{ColorItem:qh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return sb(n,"hex",!0)})})}}}),AU={class:"colors"};function pB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Eo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):pB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),hf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",AU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},hf.__scopeId="data-v-0f8b52a8",hf.__file="src/picker/Colors.vue";var df=v.defineComponent({name:"Picker",components:{Colors:hf,Saturation:Qg,Hue:tf,Alpha:ef,InputValue:of},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Eo(Eo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=af(m);return fB(lf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=Gl(p,2),b=m[0],C=m[1],_="";b!=null?(_=aB(Eo({},b),i.format,i.showAlpha),r.value=Eo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Xh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Eo(Eo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Eo(Eo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Eo(Eo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?tB[p]:eB[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=af(m),_=lf(m,C,b),w=function(y){var S=y.h,R=y.s,A=y.v,x=y.a;return!(isNaN(S)||isNaN(R)||isNaN(A)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=af(p);b?function(C,_,w){if(C.length!==0){var y=lf(C,_,w),S=y.h,R=y.s,A=y.v;if(!(isNaN(S)||isNaN(R)||isNaN(A))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:R,v:A,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),RU={class:"picker-inner"},TU={class:"picker-header"};Ho(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",RU,[v.createElementVNode("div",TU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},df.__scopeId="data-v-6ceadec6",df.__file="src/picker/Picker.vue";var uf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Ho(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),uf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},uf.__scopeId="data-v-ceb1719c",uf.__file="src/add-color-item/AddColorItem.vue";var cf=v.defineComponent({name:"ColorPicker",components:{ColorItem:qh,Picker:df,AddColorItem:uf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return sb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return sb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=nB(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(A)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H;return Jg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H,E;return Jg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||$l(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),R=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(R)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(R))})},{immediate:!0}),v.provide("theme",{theme:R});var A=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=fU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:A,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Ho(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),cf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},cf.__scopeId="data-v-3c43ade8",cf.__file="src/ColorPicker.vue";const OX="",MU=v.defineComponent({name:"ColorPick",components:{PickColors:cf},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),BU={class:"color-pick"};function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",BU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const HU=Ri(MU,[["render",PU],["__scopeId","data-v-99378939"]]),EU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function LU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const kU=Ri(EU,[["render",LU]]),zX="",FU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:HU,Radio:kU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),IU={class:"content"},DU={class:"list"};function OU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",IU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",DU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const zU=Ri(FU,[["render",OU],["__scopeId","data-v-b2df2e2d"]]),NU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:J$,ConditionalConfig:lG,PropertyConfig:zU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),WU={style:{display:"flex"}};function VU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",WU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const jU=Ri(NU,[["render",VU]]),NX="",$U=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:pM,MinusSquareOutlined:T$,PivotFilter:DT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=NB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let W=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(W=!1)});const N=Number(D[k]);W&&!isNaN(N)&&(L[O]+=Number(N))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function R(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function A(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,W)=>({value:O,label:I[W]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,W)=>O.label.localeCompare(W.label)):D=L.sort((O,W)=>O.value-W.value):E==="desc"&&(H==="dimension"?D=L.sort((O,W)=>W.label.localeCompare(O.label)):D=L.sort((O,W)=>W.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:R,handleSort:A,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),GU={style:{display:"flex",height:"400px"}},UU={style:{flex:"0 0 200px"}},KU={style:{flex:"0 0 650px",height:"100%"}},YU={key:0,style:{display:"flex","align-items":"center"}},XU={key:0,class:"dimension-item"},qU={key:1,style:{height:"30px"}},ZU={style:{width:"100%",height:"100%"},ref:"echartRef"},JU=["onClick"];function QU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",GU,[v.createElementVNode("div",UU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",KU,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",YU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",XU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",qU)),v.createElementVNode("div",ZU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,JU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const tK=Ri($U,[["render",QU],["__scopeId","data-v-f29855b0"]]),eK=v.defineComponent({components:{PivotChart:tK},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function iK(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const nK=Ri(eK,[["render",iK]]),WX="",oK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ue.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const R=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",A=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",R),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",A),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),rK={ref:"selectRef"};function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",rK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const lK=Ri(oK,[["render",sK]]),aK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function hK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const dK=Ri(aK,[["render",hK]]);let jr=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const VX="",jX="";Fo.locale("zh-cn");const uK=v.defineComponent({name:"PivotDetail",components:{ATable:Gi.Table,BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM},props:{},setup(i,{emit:t,expose:e}){const n=`dtmodal_${jr(6)}`,o=v.ref(!1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light"),l=v.inject("pageId",""),a=v.inject("context",""),h=v.inject("indicatorUrl",""),d=v.inject("indicatorToken",""),u=v.inject("theDateInfo",{}),c=v.ref(!1),g=v.ref(!1),f=v.ref([]),p=v.ref([]),m=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:x=>`共 ${x} 条数据`}),b=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);if(T)if(x)T.addEventListener("mousedown",_);else{const M=T.parentElement;M&&(M.style.left="",M.style.top=""),T.removeEventListener("mousedown",_)}},C=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);T&&(x?T.addEventListener("dblclick",w):T.removeEventListener("dblclick",w))},_=x=>{LC(x,`.${n} .ant-modal-header`)},w=()=>{o.value=!o.value,v.nextTick(()=>{o.value?b(!1):b(!0)})},y=()=>{o.value=!1,C(!1),b(!1)};async function S(x){var I;g.value=!0,c.value=!0;const{args:T={},dimension:M,indicator:B,splitSymbol:P,theFlag:F}=x,{originData:H=[],cellHeaderPaths:{colHeaderPaths:E=[],rowHeaderPaths:k=[]}}=T;if(H!=null&&H.length){const L=H[0],D=E!=null&&E.length?E[E.length-1]:"",O=E.filter(et=>et.dimensionKey).concat(k.filter(et=>et.dimensionKey)).map(et=>et.dimensionKey);if(!(D!=null&&D.indicatorKey)||!O.length)return;const W=B.find(et=>et.label===D.indicatorKey),N={};for(const et of M)if(O.includes(et.label)){const vt=(L[et.label]||"").split(P)||[];N[et.typeGuid]=vt!=null&&vt.length?vt[vt.length-1]:""}const{startTime:$,endTime:U,rangeFormat:Y}=v.unref(u);$&&U&&(N.startTime=Fo($).format(Y),N.endTime=Fo(U).format(Y));const j=await dr.post(`${v.unref(h)}/diagram/obtainDataSetData`,{pageId:v.unref(l),indexCode:(W==null?void 0:W.indexCode)||"",indexName:W.label,theFlag:F,param:N},{headers:{Authentication:v.unref(d),operateContext:v.unref(a)}}),{columns:G=[],data:Z=[]}=((I=j==null?void 0:j.data)==null?void 0:I.data)||{};f.value=G.filter(et=>et).map(et=>({title:et,dataIndex:et})),p.value=Z.map(et=>({...et,uid:jr(6)}))}g.value=!1,v.nextTick(()=>{C(!0),b(!0)})}const R=v.computed(()=>{let x=`detail-modal ${n}`;return o.value&&(x+=" full"),v.unref(s)&&(x+=` ${v.unref(s)}`),x});v.watch(c,x=>{window.modalShow&&window.modalShow(x)});const A=x=>{v.unref(m).current=x.current};return e({showModal:S}),{theme:s,visible:c,loading:g,pagination:m,columns:f,dataSource:p,wrapClassName:R,isIndFullScreen:o,handleTableChange:A,getContainer:r,onDetailCancel:y,toggleFullScreen:w}}}),cK={key:0,class:"spin-container"};function gK(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("a-spin"),d=v.resolveComponent("a-table"),u=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(u,{wrapClassName:i.wrapClassName,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=c=>i.visible=c),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>t[2]||(t[2]=[v.createElementVNode("div",{class:"modal-title"}," 指标明细 ",-1)])),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...c)=>i.toggleFullScreen&&i.toggleFullScreen(...c))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.loading?(v.openBlock(),v.createElementBlock("div",cK,[v.createVNode(h,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(d,{key:1,"row-key":c=>c.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer","onCancel"])}const fK=Ri(uK,[["render",gK],["__scopeId","data-v-698ec4e6"]]),pK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>`,width:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>`},cursor:"pointer",visibleTime:"mouseenter_cell"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},mK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),vK={mounted(i){i.focus()}},bK=v.defineComponent({name:"PivotConfig",directives:{focus:vK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:mK,draggable:Hb,DeleteOutlined:gM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(m$),fields:[]},{title:"列维度",icon:v.createVNode(c$),fields:[]},{title:"指标",icon:v.createVNode(V$),fields:[]}]),h=(R=[],A=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of R)x.positionType==="rows"?v.unref(a)[0].fields.push(Ue.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ue.cloneDeep(x));v.unref(a)[2].fields=Ue.cloneDeep(A),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(R=>({...R,label:R.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(R=>({...R,label:R.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(R,A)=>{const x=A[R.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ue.cloneDeep(v.unref(a))},m=(R,A)=>{v.unref(a)[R].fields.splice(A,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(R,A)=>{i.fullMode&&(b.value=`${R}_${A}`,C.value=Ue.cloneDeep(v.unref(a)[R].fields[A]))},y=()=>{if(v.unref(_)){const R=v.unref(b).split("_");Gi.message.error(v.unref(_)),v.unref(a)[R[0]].fields[R[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=R=>{const A=R.target.value,x=v.unref(d).concat(v.unref(u));A?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===A)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,R=>{window.modalShow&&window.modalShow(R)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),$X="",CK={class:"config-wrap"},yK={class:"area-content"},_K={class:"area-title"},wK={class:"field-item"},SK=["onClick"];function xK(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",CK,[v.createElementVNode("div",yK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",_K,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",wK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,SK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const AK=Ri(bK,[["render",xK],["__scopeId","data-v-b39c2a7b"]]),RK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Vj,CaretDownOutlined:Oj,LoadingOutlined:y$,Draggable:Hb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(R=>{var A;R!=null&&R.isLeaf||(A=R.dataViewColumns)==null||A.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var A;if(v.unref(d))return;d.value=!0;const R={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,R.indexTypeGuid=S.indexTypeGuid,R.isLeaf=S.isLeaf):h&&(R.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await dr.post(`${v.unref(n)}/diagram/sourceList`,R,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((A=v.unref(l))==null?void 0:A.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const R=l.value[S],{children:A=[]}=R;A!=null&&A.length?R.show=!R.show:!R.noData&&R.isLeaf?f(R):R.noData&&(R.show=!R.show)},m=(S,R)=>{t("onDragStart",S,R)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var R;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(R=v.unref(a))==null||R.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:X2,mapScope:Y2,getLoadType:q2,getUseType:Z2,getSourceType:J2}}}),GX="",TK={key:0,class:"no-data"},MK={class:"column-item"},BK=["onClick"],PK={key:3,class:"item-name"},HK={class:"column-item"},EK={key:0},LK={key:1},kK={key:2},FK={key:3},IK=["onClick"],DK={class:"item-name"},OK={class:"column-child-item"},zK={class:"field"},NK={class:"column-child-item-name"};function WK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",TK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",MK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",PK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,BK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",HK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",EK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",LK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",kK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",FK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",DK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,IK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",OK,[v.createElementVNode("span",zK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",NK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const VK=Ri(RK,[["render",WK],["__scopeId","data-v-aabcdc1c"]]),jK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),UX="";function $K(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const GK=Ri(jK,[["render",$K],["__scopeId","data-v-01e4c58d"]]),UK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r}=i;return async(l={},a,h)=>{var f;const d=HC(i,l),{url:u,...c}=d||{};let g=t;if(!g){const{pathname:p}=window==null?void 0:window.location;if(p){const m=p.split("/");m!=null&&m.length&&(g=m[m.length-1])}}if(u&&c){a&&a("tableChange",{type:"11",data:c}),h&&h(c);try{return await dr({url:`${e}${u}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...c,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:g},signal:((f=window.controller)==null?void 0:f.signal)||""})}catch(p){console.error(p)}}}},KK=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await dr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},YK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=HC(i,l);try{const u=await dr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},XK=(i={})=>{const{indicatorUrl:t="",indicatorToken:e="",context:n=""}=i;return async(r={},s)=>{var l,a;try{const h=await dr({url:`${t}${s}`,method:"post",headers:{Authentication:e,operateContext:n},data:r,signal:((l=window.controller)==null?void 0:l.signal)||""});return((a=h==null?void 0:h.data)==null?void 0:a.data)||[]}catch(h){console.error(h)}}},qK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0},defaultFontSize:{type:Number,default:16},theFlag:{type:String,default:""}},lb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},ZK=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],ks=["合计","平均值","计数","最大值","最小值","方差","标准差"],JK=i=>v.defineAsyncComponent({loader:i,delay:200}),KX="",YX="",QK=v.defineComponent({name:"PivotTable",components:{PivotFilter:DT,PivotProperty:D7,ConditionalProperty:jU,ChartModal:nK,PivotAggregate:lK,PivotTop:dK,PivotConfig:AK,IndSourceList:VK,DragArea:GK,PivotDetail:fK,DrillModal:JK(()=>Promise.resolve().then(()=>cY)),SettingOutlined:k$,DatabaseOutlined:Qj,ArrowsAltOutlined:Hj,ShrinkOutlined:O$,FilterOutlined:pM,DeleteOutlined:gM,ClearOutlined:Uj},props:{...qK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),R=v.ref({}),A=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),W=v.ref(0),N=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),Z=v.ref({dateFormat:"YYYY-MM-DD"}),et=v.ref(16);let gt=40;const vt=6,it=10,nt=15,bt=20,Ct=24,at=v.ref([]);let rt=`|${jr(6)}|`;const ct=v.ref();v.provide("splitSymbol",rt),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",Z),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ht=v.ref({}),_t=()=>{const V={borderColor:v.unref(kt).borderColor};ht.value=V},ut=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),It=v.ref(1),Ut=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Ut.value=q,It.value++,v.nextTick(()=>{SB()})}}).observe(document.body);const Tt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&It.value?i.isIframeMode?Ut.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),kt=v.computed(()=>{var J;const V={},{styleConfig:K}=i;let q={};(J=Object.keys(K))!=null&&J.length?q=K:q=v.unref(ut);for(const X in q)V[X]=q[X]||"transparent";return V}),oe=v.ref({}),re=()=>{const V=Zl();V&&(v.unref(oe).width=V.width+2+"px"),v.unref(oe).backgroundColor=EC(v.unref(kt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(dt))});const ye=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),J=+(1/K).toFixed(5),X=+(parseFloat(i.width)*V).toFixed(2),Q=+(parseFloat(i.height)*K).toFixed(2);R.value={transform:`scale(${q}, ${J})`,width:X+"px",height:Q+"px",left:-(X-parseFloat(i.width))/2+"px",top:-(Q-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},et.value=i.defaultFontSize*V,gt=(i.defaultFontSize+30)*K,dt.defaultRowHeight=gt,dt.theme.scrollStyle.width=vt*V,dt.theme.scrollStyle.scrollSliderCornerRadius=it*V,dt.theme.tooltipStyle.fontSize=et.value,j.value=(i.defaultFontSize+10)*V,pK(C7,{sortNotActiveColor:v.unref(kt).sortNotActiveColor,sortActiveColor:v.unref(kt).sortActiveColor,iconSize:nt*V,hoverSize:bt*V,downSize:Ct*V}),v.nextTick(()=>{var tt,ft,Pt,Qt,Ht,Lt,te,Ot,We,Rn,qn,ji;(ft=(tt=v.unref(S))==null?void 0:tt.style)==null||ft.setProperty("--box-tooltip-fontsize",et.value+"px"),(Qt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Qt.setProperty("--box-item-size",j.value+"px"),(Lt=(Ht=v.unref(_))==null?void 0:Ht.style)==null||Lt.setProperty("--menu-item-max-width",200*V+"px"),(Ot=(te=v.unref(_))==null?void 0:te.style)==null||Ot.setProperty("--menu-item-padding",`${i.defaultFontSize/2*V}px ${i.defaultFontSize*V}px`),(Rn=(We=v.unref(_))==null?void 0:We.style)==null||Rn.setProperty("--menu-item-font-size",(i.defaultFontSize>20?i.defaultFontSize-4:i.defaultFontSize)*V+"px"),(ji=(qn=v.unref(_))==null?void 0:qn.style)==null||ji.setProperty("--menu-item-line-height",24*K+"px"),n&&n.updateOption(dt)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{ye()},{deep:!0});const Oe=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=dt.rows)!=null&&V.length)&&!((K=dt.columns)!=null&&K.length)&&!((q=dt.indicators)!=null&&q.length)}),Be=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),Ee=v.computed(()=>{const V={fontSize:et.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),At=v.ref([]),mt=v.ref([]);v.provide("dimensionFieldList",At),v.provide("indicatorFieldList",mt);const Bt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Kt=v.computed(()=>v.unref(At).filter(V=>V.isInnerFilter).concat(v.unref(mt).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var J,X,Q,tt,ft,Pt,Qt,Ht,Lt,te;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=kt.value;V&&((X=(J=v.unref(_))==null?void 0:J.style)==null||X.setProperty("--menu-bg-color",V)),K&&((tt=(Q=v.unref(_))==null?void 0:Q.style)==null||tt.setProperty("--menu-color",K)),q&&((Pt=(ft=v.unref(_))==null?void 0:ft.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((Ht=(Qt=v.unref(_))==null?void 0:Qt.style)==null||Ht.setProperty("--sub-menu-left",F.value)),H.value&&((te=(Lt=v.unref(_))==null?void 0:Lt.style)==null||te.setProperty("--sub-menu-top",H.value))});const qt=v.ref([]),fe=v.ref({}),Yt=v.ref({}),Nt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderBgColor:v.unref(kt).headerBgColor},color(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderColor:v.unref(kt).headerColor},borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},cornerHeaderStyle:{bgColor(){return v.unref(kt).headerBgColor},color:v.unref(kt).headerColor,borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},bodyStyle:{borderColor:v.unref(kt).borderColor,color(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyColor:v.unref(kt).bodyColor},bgColor(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateBgColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyBgColor:v.unref(kt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},rowHeaderStyle:{borderColor:v.unref(kt).borderColor,bgColor(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateBgColor:v.unref(kt).bodyBgColor},color(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateColor:v.unref(kt).bodyColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(kt).borderColor},scrollStyle:{width:vt,scrollSliderCornerRadius:it},tooltipStyle:{fontSize:v.unref(et)}}),dt=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Nt}),Ft=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),$t=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),ae=5,Ti=v.ref({});v.watch(A,V=>{if(V){const K={};v.nextTick(()=>{var X,Q;const q=Zl();let J=0;(X=v.unref(Kt))!=null&&X.length&&(J=(Q=v.unref($))==null?void 0:Q.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+J+v.unref($t)+"px",K.left=q.left+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"),Ti.value=K})}});const Lo=v.ref([]),Xn=v.ref([]),$r=v.ref({}),An=v.ref({}),Fs=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),Xl=v.ref([]),gY=v.computed(()=>{const V=[];for(const Q of v.unref(Lo)){const{data:tt,indicatorKey:ft="",calculateType:Pt=""}=Q||{};V.push({label:tt.indicatorKey,columnName:tt.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:ft})}const K=[],q={};v.unref(Xn).forEach(Q=>{q[Q.key]||(q[Q.key]=[]),q[Q.key].push(Q)});for(const Q in q){const tt=q[Q]||[];tt.forEach((ft,Pt)=>{var Ot;const Qt=v.unref(At).find(We=>We.label===ft.key),Ht=v.unref(mt).find(We=>We.label===ft.key),Lt=Qt||Ht,te={};Pt<tt.length-1&&(te.join="&&"),(Lt==null?void 0:Lt.genericType)==="DATE"&&(te.dateFormat=((Ot=v.unref(Z))==null?void 0:Ot.dateFormat)||"YYYY-MM-DD",Pt===0?te.prop="startTime":Pt===1&&(te.prop="endTime")),Lt&&K.push({fieldName:Lt.name,fieldType:Lt.genericType,fieldValue:Array.isArray(ft.value)?ft.value.join(","):ft.value,hrpIndexCode:Lt.indexCode,hrpIndexCodeNum:Lt.indexCodeNum,id:Lt.id,label:Lt.label,rule:ft.rule,targetSource:"",typeGuid:ft.typeGuid||"",type:ft.type,...te})})}const J=[];if(Object.keys(v.unref($r)))for(const Q in v.unref($r))v.unref($r)[Q]&&J.push({key:Q,num:v.unref($r)[Q],rule:"TOP"});const X=[];if(Object.keys(v.unref(An)))for(const Q in v.unref(An)){const{order:tt,type:ft,columnData:Pt,columnHeader:Qt}=v.unref(An)[Q];if(tt.toLowerCase()==="default-sort")continue;const Ht={label:Q,order:tt.toUpperCase(),type:"COMBINATION",fieldType:ft};ft==="indicators"&&(Ht.columnHeader=Qt,Ht.columnData=Pt,Ht.type="NORMAL"),X.push(Ht)}return{calc:V,filter:K,truncations:J,sorts:X,aggregateMethod:v.unref(P)||{}}}),fY=XK(i),pY=YK(i),mY=UK(i),hb=KK(i),db=v.ref({}),ub=v.ref({}),vY=async()=>{var q;const V=v.unref(mt).filter(J=>J.calcType==="FORMULA");let K;if(V!=null&&V.length&&(K=await fY({indicatorList:v.unref(mt).map(J=>{const X={calcType:J.calcType||"COLUMN",columnName:J.name,label:J.label,location:J.location,show:J.show};return J.indexCode&&(X.hrpIndexCode=J.indexCode),J.indexCodeNum&&(X.hrpIndexCodeNum=J.indexCodeNum),J.formula&&(X.formula=J.formula),X})},"/diagram/obtainIndexDrillDetail")),K!=null&&K.length){const J={};for(const X of K)(q=X.detailList)!=null&&q.length&&(J[X.label]=X.detailList);ub.value=J}};v.watch(()=>mt.value,()=>{vY()},{deep:!0});const gr=async()=>{var Pt,Qt,Ht,Lt,te;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:J=[],columns:X=[]}=dt,Q=(Pt=v.unref(Yl))!=null&&Pt.length?v.unref(Yl):[],tt=(Qt=v.unref(Xl))!=null&&Qt.length?v.unref(Xl):[];if(!(Q!=null&&Q.length))for(const Ot of J)Q.push(Ot.dimensionKey);if(!(tt!=null&&tt.length))for(const Ot of X)tt.push(Ot.dimensionKey);Q!=null&&Q.length||Q.push(...V.filter(Ot=>Ot.position==="rows").map(Ot=>Ot.key)),tt!=null&&tt.length||tt.push(...V.filter(Ot=>Ot.position==="columns").map(Ot=>Ot.key));const ft=[];for(const Ot in v.unref(a))ft.push({type:"dimension",key:Ot,rule:v.unref(a)[Ot]});for(const Ot in v.unref(h))ft.push({type:"indicators",key:Ot,rule:v.unref(h)[Ot]});if(ft!=null&&ft.length&&cb(ft,{isHandle:!1}),q!=null&&q.length)for(const Ot of q)!Q.includes(Ot.name)&&!tt.includes(Ot.name)&&Q.push(Ot.name);db.value={...v.unref(gY),rowDimensionKeys:Q,colDimensionKeys:tt,dimensions:(Ht=v.unref(Fs))!=null&&Ht.length?v.unref(Fs):v.unref(At),indicators:(Lt=v.unref(Kl))!=null&&Lt.length?v.unref(Kl):v.unref(mt)};try{const Ot=await mY({pivotTableCal:v.unref(db)},e,We=>{var Rn;if(v.unref(G)){const{sqlConditions:qn=[],queryColumns:ji=[]}=We,Xe=vB(qn),oi=ji.find($i=>$i.typeGuid==="the_date");if(oi&&(Z.value={dateFormat:oi.dateFormat||"YYYY-MM-DD"}),Xe!=null&&Xe.length)for(const $i of Xe)["startTime","endTime"].includes($i.prop)&&(v.unref(Z)[$i.prop]=$i.fieldValue||"",(Rn=v.unref(Z))!=null&&Rn.rangeFormat||(v.unref(Z).rangeFormat=$i.dateFormat||"YYYY-MM-DD"));G.value=!1}});(te=Ot==null?void 0:Ot.data)!=null&&te.success&&(YY(),ct.value=""),wB(Ot)}catch(Ot){console.error(Ot)}};function vB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...vB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const bY=V=>{v.unref(Lo).find(K=>K.data.indicatorKey===V.data.indicatorKey)||Lo.value.push(V),gr()},CY=V=>{const K=v.unref(Lo).findIndex(q=>q.data.indicatorKey===V);K!==-1&&Lo.value.splice(K,1),gr()},cb=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const J of q){const{key:X="",rule:Q,type:tt=""}=J||{};let ft=Ue.cloneDeep(Q);Array.isArray(Q)||(ft=[Q]);const Pt=v.unref(At).find(Lt=>Lt.label===X),Qt=v.unref(mt).find(Lt=>Lt.label===X),Ht=Pt||Qt;if(Ht){if((Ht==null?void 0:Ht.genericType)==="DATE"&&(ft==null?void 0:ft.length)===1){const Lt=ft[0].value;ft[0].rule="GREATER_EQUAL",ft[1]={rule:"LESS_EQUAL",value:Lt}}for(let Lt=v.unref(Xn).length-1;Lt>=0;Lt--){const te=v.unref(Xn)[Lt];te.key===X&&te.type===tt&&v.unref(Xn).splice(Lt,1)}for(const Lt of ft){const{rule:te,value:Ot}=Lt;X&&te&&Ot&&Xn.value.push({key:X,rule:te,value:Ot,type:tt,typeGuid:Ht.typeGuid})}}}K&&gr()},yY=()=>{$r.value=v.unref(x)||{},gr()},bB=V=>{const{key:K,order:q,type:J,columnData:X=[]}=V;if(J==="indicators"){let Q="";for(const tt in v.unref(An))v.unref(An)[tt].type==="indicators"&&(Q=tt);Q&&delete v.unref(An)[Q]}v.unref(An)[K]={order:q,type:J,columnData:X},gr()},ql=()=>{const V=v.unref(At),K=v.unref(mt),q=V.filter(X=>X.positionType==="rows").map(X=>X.name),J=V.filter(X=>X.positionType==="columns").map(X=>X.name);Fs.value=Ue.cloneDeep(V),Kl.value=Ue.cloneDeep(K),Yl.value=Ue.cloneDeep(q),Xl.value=Ue.cloneDeep(J),gr()};function _Y(V,K=!0,q=-1){if(q>-1)dt.indicators.splice(q,0,...V);else for(const J of V)dt.indicators.push(J);K&&n.updateOption(dt)}function wY({label:V,calcType:K}){const q=[],J=[],X=[],Q=v.unref(ub)[V],tt=v.unref(Yt)[V]||[];for(const ft in lb)tt.indexOf(ft)===-1&&X.push({text:lb[ft],menuKey:ft});return Q!=null&&Q.length&&(J.push({text:"公式:"+Q[0],menuKey:"formula"}),Q.forEach((ft,Pt)=>{const Qt=v.unref(mt).find(Ht=>Ht.label===ft);Pt>0&&!Qt.show&&J.push({text:ft,menuKey:ft})}),q.push({text:"详情",menuKey:"detail",children:J})),[...q,{text:"计算",menuKey:"calculate",children:X},...ZK]}function gf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(at)&&Array.isArray(v.unref(at)))if((q=v.unref(at))!=null&&q.length){const J=v.unref(at).map(X=>({text:X.title||X.label,menuKey:V==="rows"?`${rt}${X.label}`:X.label}));V==="rows"?K=J:K[0].children=J}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function SY(V,K){A.value=!0,v.unref(P)[K]=V||[],hn({type:"9",data:{key:K,types:V}}),gr()}function xY(V,K=!0){var q;for(const J of V){const{key:X,name:Q,type:tt,dimensionKey:ft,width:Pt}=J;let Qt;if(ft)Qt=J;else{const Ht={dimensionKey:X,title:Q,width:Pt?`${Pt}%`:"auto",type:tt};tt==="columns"?Ht.headerStyle={textStick:!0}:tt==="rows"&&(Ht.cornerHeaderIcon="sortNormal"),Qt=Ht}if(Qt&&(Qt.headerStyle={textStick:!0},Qt.headerFormat||(Qt.headerFormat=Ht=>{if(tt==="rows"){const Lt=Ht==null?void 0:Ht.split(rt);return Lt!=null&&Lt.length?Lt[Lt.length-1]:Ht}else return Ht}),dt[tt].push(Qt)),(q=dt[tt])!=null&&q.length)for(const Ht of dt[tt])Ht.cornerDropDownMenu=gf(),tt==="rows"&&(Ht.dropDownMenu=gf("rows"));dt.dataConfig.sortRules.push({sortField:X,sortType:v.unref(r)})}K&&n.updateOption(dt),v.nextTick(()=>{yB()})}function CB(V){const K={},{records:q}=dt;for(const J of q)for(const X of V)Mn(K,X)?K[X].find(Q=>Q.value===J[X])||K[X].push(gb({value:J[X]})):K[X]=gb([{value:J[X]}]);return K}function gb(V){const K=Ue.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const J of K)q(J);else q(K);function q(J){for(const X in J)if(typeof J[X]=="string"){const Q=J[X].split(rt);Q!=null&&Q.length&&(J[X]=Q[Q.length-1])}}return K}function yB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=CB(q)}const _B=v.computed(()=>{var V;return(V=v.unref(At))!=null&&V.length?v.unref(At).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function wB(V){var Ot,We,Rn,qn,ji,Xe,oi,$i;const K=await pY({pivotTableCal:v.unref(db)});at.value=K.filter(Wt=>!v.unref(_B).includes(Wt.label));let q=V;V?Y.value=Ue.cloneDeep(V):q=Ue.cloneDeep(v.unref(Y)),A.value=!0;const{data:J={}}=(q==null?void 0:q.data)||{},{rows:X=[]}=J,Q=[],tt=[];for(const Wt of v.unref(At)){if(!Wt.show)continue;const ie=dt[Wt.positionType].find(Ze=>Ze.dimensionKey===Wt.label);ie?tt.push({...ie,title:Wt.showTitle}):tt.push({key:Wt.label,name:Wt.showTitle,type:Wt.positionType,width:Wt.width})}for(let Wt=0;Wt<v.unref(mt).length;Wt++){const ie=v.unref(mt)[Wt];if(!ie.show)continue;const Ze=wY(ie),Ge=dt.indicators.find(Fi=>Fi.indicatorKey===ie.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:ie.showTitle}:ze={indicatorKey:ie.label,title:ie.showTitle,width:ie!=null&&ie.width?`${ie.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Tn,Jh,Qh)=>{const bb=Qh.getRecordByCell(Tn,Jh)||[];return bb[0]&&isNaN(+bb[0][ie.label])?bb[0][ie.label]:Fi||"-"}),Q.push(ze))}const ft=tt.filter(Wt=>Wt.type==="rows");if(((Ot=dt==null?void 0:dt.rows)==null?void 0:Ot.length)!==ft.length&&typeof((We=v.unref(B))==null?void 0:We.col)=="number"&&(v.unref(B).col+=ft.length-(((Rn=dt==null?void 0:dt.rows)==null?void 0:Rn.length)||0)),dt.indicators=[],dt.rows=[],dt.columns=[],(qn=v.unref(Lo))!=null&&qn.length){for(const Wt of v.unref(Lo))if(!isNaN(+Wt.position)){const ie={...Wt.data,calculateType:Wt.calculateType};["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(ie.calculateType)&&PB(ie,Wt.data.formatConfig),Q.splice(+Wt.position,0,ie)}}const{sortType:Pt,col:Qt,row:Ht}=v.unref(B)||{};for(const Wt of Q)Wt&&(Wt.headerIcon=ie=>{const{col:Ze,row:Ge}=ie;if(Qt===Ze&&Ht===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});_Y(Q,!1),xY(tt,!1);const Lt=[],te=tt.filter(Wt=>Wt.type==="rows").map(Wt=>Wt.key||Wt.dimensionKey);for(const Wt of X)for(const ie in Wt)if(!ks.includes(Wt[ie])){const Ze=te.indexOf(ie);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(Wt[te[ze]]);if(Fi.includes(rt)){const Tn=Fi.split(rt);Tn!=null&&Tn.length&&Ge.push(Tn[Tn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(Wt[ie]=Ge.join(rt))}}for(const Wt of tt){const ie=(Wt==null?void 0:Wt.key)||(Wt==null?void 0:Wt.dimensionKey);if(Wt.type==="columns"&&!v.unref(M)[ie])v.unref(M)[ie]=fb("",ie,X);else if(Wt.type==="rows")if(v.unref(T)[ie]){const{type:Ze}=v.unref(T)[ie]||{};Lt.push(fb(Ze,ie,X))}else if(!v.unref(B)||v.unref(B).sortField===ie||!n)Lt.push(fb("",ie,X));else{const Ze=dt.dataConfig.sortRules.find(Ge=>Ge.sortField===ie);Ze&&Lt.push(Ze)}}if(v.unref(B)&&Lt.push(v.unref(B)),(ji=Object.keys(v.unref(M)))!=null&&ji.length)for(const Wt in v.unref(M))Lt.push(v.unref(M)[Wt]);if(dt.records=X,dt.dataConfig.sortRules=Lt,X!=null&&X.length&&(v.unref(O).records=[]),(Xe=dt.columns)!=null&&Xe.length?dt.columnHeaderTitle=!0:(oi=dt.indicators)!=null&&oi.length?dt.columnHeaderTitle=!1:($i=dt.rows)!=null&&$i.length&&(dt.columnHeaderTitle=!0),n)n.updateOption(dt),v.nextTick(()=>{xB()}),A.value=!1;else{const Wt=document.getElementById(`pivotTableContainer_${i.id}`);n=new LT(Wt,dt),v.nextTick(()=>{xB(),o.value=!0,A.value=!1,i.isIframeMode&&(v.unref(W)&&n.setScrollTop(v.unref(W)),v.unref(N)&&n.setScrollLeft(v.unref(N)))}),FY()}v.nextTick(()=>{const{indexFormatConfig:Wt}=(i==null?void 0:i.defaultConfig)||{};if(Wt){const ie=[];for(const Ze in Wt)Wt[Ze]&&ie.push(Wt[Ze]);BB(ie)}})}const Gr=v.ref({});function SB(){Zl()&&(v.unref(D)?(v.unref(Gr).top=v.unref($t)+"px",v.unref(Gr).left="0"):(v.unref(Gr).top="0",v.unref(Gr).left="0"))}function xB(){var V;if(n&&!((V=dt.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const J of K)q[J]="";v.unref(O).dataConfig={...dt.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...dt,...v.unref(O)})}}function AY(V,K){A.value=!0,hn({type:"3",data:{type:"indicators",key:V,rule:K}}),cb({type:"indicators",key:V,rule:K})}function RY(V,K){A.value=!0,hn({type:"3",data:{type:"dimension",key:V,rule:K}}),cb({type:"dimension",key:V,rule:K})}function TY(V,K){var Q;let q=!1;const J=dt[K].findIndex(tt=>tt.dimensionKey===V),X=dt.dataConfig.sortRules.findIndex(tt=>tt.sortField===V);if(J!==-1){if(dt[K].splice(J,1),i.fullMode||i.allowDrill){const tt=v.unref(At).findIndex(ft=>ft.label===V);tt!==-1&&(v.unref(At)[tt].isInnerFilter?(v.unref(At)[tt].show=!1,q=!0):v.unref(At).splice(tt,1))}else for(const tt of dt[K])tt.cornerDropDownMenu=gf(),K==="rows"&&(tt.dropDownMenu=gf("rows"));(Q=v.unref(B))!=null&&Q.col&&(v.unref(B).col-=1),A.value=!0,hn({type:"7"}),ql()}X!==-1&&(dt.dataConfig.sortRules[X].sortType=r),n.updateOption(dt),v.nextTick(()=>{if(yB(),!q){delete a.value[V];const tt=v.unref(Xn).findIndex(ft=>ft.key===V);tt!==-1&&v.unref(Xn).splice(tt,1)}})}function MY(V){const{indicators:K}=dt,q=K.findIndex(J=>J.indicatorKey===V);if(q!==-1){const J=K[q];if(K.splice(q,1),J.calculateType){const X=J.indicatorKey.split("@"+J.calculateType)[0],Q=v.unref(Yt)[X].indexOf(J.calculateType);Q!==-1&&v.unref(Yt)[X].splice(Q,1);const tt=v.unref(qt).indexOf(J.title);tt!==-1&&v.unref(qt).splice(tt,1),delete v.unref(fe)[J.title]}hn({type:"2",data:J.indicatorKey}),CY(J.indicatorKey)}}function fb(V,K,q){let J=[];const X=new Set;for(const Q of q){const tt=Q[K];tt&&!ks.includes(tt)&&X.add(tt)}return J=Array.from(X),V==="asc"?J=J.sort((Q,tt)=>Q.localeCompare(tt)):V==="desc"&&(J=J.sort((Q,tt)=>tt.localeCompare(Q))),{sortField:K,sortBy:[...J,...ks]}}function AB(V,K,q,J){A.value=!0;let{menu:{dropDownMenuHighlight:X},rows:Q}=dt;J=J+1,X=X.filter(ft=>!(ft.type==="dimension"&&ft.field===K)||ft.type==="indicator"),X.push({col:q,row:J-1,field:K,type:"dimension",menuKey:V}),dt.menu.dropDownMenuHighlight=X;const tt=Q.find(ft=>ft.dimensionKey===K);if(tt){let ft="sortNormal";V==="asc"?ft="sortUp":V==="desc"&&(ft="sortDown"),tt.cornerHeaderIcon=ft}n.updateOption(dt),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},hn({type:"4",data:{key:K,order:V,type:"dimension"}}),bB({key:K,order:V,type:"dimension"})}function RB(V,K,q,J,X){var te;A.value=!0;const{menu:Q}=dt;let tt=Q.dropDownMenuHighlight,ft="";(te=dt.rows)!=null&&te.length&&(ft=dt.rows[dt.rows.length-1].dimensionKey);const Pt=q.filter((Ot,We)=>We<q.length-1),Qt=Pt.map(Ot=>({columnName:Ot.dimensionKey})),Ht=Pt.map(Ot=>Ot.value),Lt=tt.findIndex(Ot=>Ot.field===ft&&Ot.type==="dimension");Lt!==-1&&tt.splice(Lt,1),tt=tt.filter(Ot=>Ot.type==="dimension"),tt.push({col:J,row:X,field:K,type:"indicator",menuKey:V}),dt.menu.dropDownMenuHighlight=tt,n.updateOption(dt),V==="default-sort"?B.value=null:B.value={sortField:ft,sortByIndicator:K,sortType:V.toUpperCase(),query:Ht,col:J,row:X},hn({type:"4",data:{key:K,order:V,type:"indicators"}}),bB({key:K,order:V,type:"indicators",columnData:Ht,columnHeader:Qt})}function TB({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const J=v.unref(At).find(X=>X.label===V);d.value={fieldName:K||(J==null?void 0:J.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),hn({type:"5",data:V})})}function BY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function PY({indicatorKey:V,menuKey:K}){A.value=!0;let q=dt.indicators.length-1;const J=`${V}@${K}`,X=`${V}(${lb[K]}) fx`;v.unref(qt).push(X),v.unref(fe)[X]=J,dt.indicators.forEach((tt,ft)=>{tt.indicatorKey===V&&(q=ft+1)}),v.unref(Yt)[V]||(v.unref(Yt)[V]=[]),v.unref(Yt)[V].push(K);const Q={data:{indicatorKey:J,title:X,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][J])?Ht[0][J]:tt}},position:q,indicatorKey:V,calculateType:K};if(["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(K)){const tt=Zh(V);if(tt>-1){const ft=dt.indicators[tt].formatConfig||{};Q.data.formatConfig={...ft,fieldName:J,indicatorKey:J}}}hn({type:"1",data:{indicatorKey:V,calculateType:K}}),bY(Q)}function HY(){const V=dt.rows[0]?dt.rows[0].cornerDropDownMenu:[],K=dt.columns[0]?dt.columns[0].cornerDropDownMenu:[],q=dt.rows.map(tt=>({...tt,cornerDropDownMenu:K})),J=dt.columns.map(tt=>({...tt,cornerDropDownMenu:V}));dt.columns=q,dt.rows=J;const{type:X,len:Q}=dt.aggregate||{};X&&(dt.records.splice(-Q),dt.aggregate={type:X,len:0}),dt.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},dt.dataConfig.filterRules=[],n.updateOption(dt)}function EY({indicatorKey:V,fieldName:K}){const q=Zh(V);if(q>-1){const J=dt.indicators[q].formatConfig||{};v.unref(g).showModal({...J,indicatorKey:V,fieldName:K})}}function LY(V){const K=Zh(V);if(K>-1){const q=dt.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function Zh(V){return dt.indicators.findIndex(K=>K.indicatorKey===V)}function kY(V){const K=v.unref(At)[0],q=v.unref(At).map(Q=>Q.label),J=CB(q),X={xLabel:K.label,yLabel:V,dimensionData:J,records:gb(dt.records)};v.unref(C).showModal(X)}function FY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?W.value=n.getScrollTop():K==="horizontal"&&(N.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:rt,dimension:v.unref(At),indicator:v.unref(mt),theFlag:i.theFlag})}),n.on("after_render",()=>{_t(),SB(),re(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:J}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:X,indicators:Q}=dt,tt=n.getCellValue(q,J);let ft=v.unref(At).find(te=>te.showTitle===tt);ft||(ft=v.unref(mt).find(te=>te.showTitle===tt));let Pt=ft==null?void 0:ft.label;if(v.unref(qt).includes(tt)&&(Pt=v.unref(fe)[tt]),!Pt)return;const Qt=X.find(te=>te.dimensionKey===Pt),Ht=Q.find(te=>te.indicatorKey===Pt);let Lt="default-sort";if(K==="sortUp"?Lt="desc":K==="sortDown"?Lt="default-sort":(!K||K==="sortNormal")&&(Lt="asc"),Ht){const te=n.getCellHeaderPaths(q,J);RB(Lt,Pt,(te==null?void 0:te.colHeaderPaths)||[],q,J)}else Qt&&AB(Lt,Pt,q,J)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:J}=V,{dimensionKey:X,indicatorKey:Q,value:tt}=K[K.length-1];let ft=V.menuKey,Pt=!1;ft.includes(rt)&&(Pt=!0,ft=ft.replace(rt,"")),l.value=V;const Qt=v.unref(at).find(Ht=>Ht.label===ft);if(Qt){const Ht=v.unref(At).findIndex(Lt=>Lt.label===X);if(Ht!==-1){const Lt={...Qt,show:!0,positionType:"rows",showTitle:Qt.title||Qt.label};Pt?v.unref(y).showModal({drillDimension:Lt,drillFieldData:K,usedDimensionFields:v.unref(_B),tableProps:i,splitSymbol:rt}):(At.value.splice(Ht+1,0,Lt),A.value=!0,ql()),hn({type:"8"})}}else{const Ht=Ue.cloneDeep(v.unref(mt));let Lt=0;const te=Ht.findIndex(We=>We.label===ft),Ot=Ht.findIndex(We=>We.label===Q);if(te!==-1)Ht[te].show=!0,kC(Ht,te,te>Ot?Ot+1:Ot),Lt=1;else if(ft==="formula"){const We=v.unref(ub)[Q]||[];if((We==null?void 0:We.length)>1){const Rn=We.slice(1,We.length);for(const qn of Rn){const ji=Ht.findIndex(Xe=>Xe.label===qn);ji!==-1&&!Ht[ji].show&&(Ht[ji].show=!0,kC(Ht,ji,ji>Ot?Ot+1:Ot),Lt++)}}}Lt&&(mt.value=Ht,A.value=!0,ql())}switch(ft){case"drill":alert("无维度可钻取");break;case"delete":X?TY(X,"rows"):Q&&MY(Q);break;case"asc":case"desc":case"default-sort":X?AB(ft,X,q,J):Q&&RB(ft,Q,K,q,J);break;case"filter":X?TB({dimensionKey:X}):Q&&BY(Q,tt);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":PY({indicatorKey:Q,menuKey:ft});break;case"trans":HY();break;case"property":EY({indicatorKey:Q,fieldName:tt});break;case"conditionalProperty":LY(Q);break;case"aggregate":v.unref(p).showModal(v.unref(P)[X]||[],X);break;case"top":IY(X);break;case"graph":kY(Q);break}})}function IY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function DY(){v.unref(b).showModal(v.unref(At),v.unref(mt))}async function OY(){A.value=!0,await hb("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ht.value={},At.value=[],mt.value=[],qt.value=[],fe.value={},Yt.value={},Ti.value={},Lo.value=[],Xn.value=[],$r.value={},An.value={},Fs.value=[],Kl.value=[],Yl.value=[],Xl.value=[],Y.value={},Gr.value={},W.value=0,N.value=0,dt.records=[],dt.rows=[],dt.columns=[],dt.indicators=[],dt.dataConfig={sortRules:[],filterRules:[]},dt.defaultRowHeight=gt,dt.menu.dropDownMenuHighlight=[],kB(),ye(),gr()}function zY(V=[],K=[]){var Q;const q=V.concat(K).map(tt=>tt.name),J=v.unref(At).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1})),X=v.unref(mt).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1}));At.value=[...V,...J],mt.value=[...K,...X];for(const tt in v.unref(An))if(((Q=v.unref(An)[tt])==null?void 0:Q.type)==="indicators"){delete v.unref(An)[tt];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()):wB()}function NY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),J=v.unref(At).find(Pt=>Pt.name===K),X=v.unref(At).findIndex(Pt=>Pt.name===K),Q=v.unref(mt).find(Pt=>Pt.name===K),tt=v.unref(mt).findIndex(Pt=>Pt.name===K),ft={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(J)if(J.show){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J.positionType=V,J.show=!0,v.unref(At).push(J),v.unref(At).splice(X,1);else v.unref(At).push({...Ue.cloneDeep(v.unref(I)),...ft,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(Q)if(Q.show){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q.show=!0,v.unref(mt).push(Q),v.unref(mt).splice(tt,1);else v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),...ft,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q?(Q.isInnerFilter=!0,Q.timeStamp=new Date().getTime()):v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J?(J.isInnerFilter=!0,J.timeStamp=new Date().getTime()):v.unref(At).push({...Ue.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft})}A.value=!0,I.value=null,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()}const WY=(V=[])=>{let K=!1;for(const q of v.unref(At))if(!V.find(X=>X.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",WY);const MB=()=>{},VY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},RY(K,V)):q==="indicators"&&(h.value[K]=V,AY(K,V))};function BB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:J}=q,X=Zh(J);if(X>-1){const Q=dt.indicators[X];Q.formatConfig=q,PB(Q,q)}}n.updateOption(dt)}function PB(V,K){const{unit:q="",format:J,floatLength:X,position:Q}=K;V.format=(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][V.indicatorKey])?Ht[0][V.indicatorKey]:(J==="integer"?tt=Math.round(Number(tt)):J==="float"&&!isNaN(X)?tt=Number(tt).toFixed(X):J==="percent"&&(X?tt=(Number(tt)*100).toFixed(X)+"%":tt=Number(tt)*100+"%"),Q==="right"?tt+q:q+tt)}}function jY(V,K=[]){const q=Zh(V);if(q>-1){const J=dt.indicators[q];J.conditionalConfig=K;const X=[];K.forEach(Q=>{let tt="";Q.conditions.forEach((ft,Pt)=>{Pt>0&&(tt+=ft.join==="and"?" && ":" || "),tt+=`value${ft.operation}${ft.value}`}),X.push(tt)}),J.style.color=({dataValue:Q})=>{let tt="#333";return K.forEach((ft,Pt)=>{ft.color&&(tt=pb(X[Pt],Q)?ft.color:tt)}),tt},J.style.textAlign=({dataValue:Q})=>{let tt="left";return K.forEach((ft,Pt)=>{ft.align&&(tt=pb(X[Pt],Q)?ft.align:tt)}),tt},J.customRender=({rect:Q,dataValue:tt})=>{let ft=[];return K.forEach((Pt,Qt)=>{if(Pt.icon&&pb(X[Qt],tt)){const Lt=K2(Pt.icon,Pt.iconColor);ft=[{type:"icon",x:Pt.align!=="right"?15:Q.width-25,y:Q.height/2-7,svg:Lt,height:14,width:14}]}}),{elements:ft,renderDefault:!0}},n.updateOption(dt)}}function pb(V,K){V=V||"true";const q=`function (value){
|
|
368
368
|
if(${V}){
|
|
369
369
|
return true
|
|
370
370
|
}else{
|
|
371
371
|
return false
|
|
372
372
|
}
|
|
373
|
-
}`;return Function(`"use strict";return (${q})`)().call(this,K)}function $Y(V){A.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,hn({type:"6",data:{key:q,value:K}}),yY()}function Zl(){return n==null?void 0:n.getDrawRange()}const ff=v.ref([]),HB=v.ref(""),EB=v.ref(),GY=(V,K)=>{var Ot,We,Rn,qn,ji;const q=K.dataViewColumns[V.oldIndex]||{},{scope:J}=q;let X=!1,Q=!1;["IDX","BUILT_IN_IDX"].includes(J)?X=!0:["DIM","BUILT_IN_DIM"].includes(J)&&(Q=!0);const tt=Zl(),{rows:ft,columns:Pt,indicators:Qt,records:Ht}=dt,{top:Lt,left:te}=tt;if(v.unref(Oe)){let Xe=i.height;i.isIframeMode&&(Xe=document.body.clientHeight+"px");let oi=v.unref(Be).width;oi.includes("calc")&&(oi=v.unref(Tt)-v.unref(E)+"px"),k.value.main={width:oi,height:Xe,top:Lt+v.unref($t)+"px",left:te+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"},k.value.rows={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)-ae*2+"px",top:0,left:0},k.value.columns={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)/3-ae*2+"px",top:0,left:parseFloat(oi)/2+"px"},k.value.indicators={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)*2/3-ae*2+"px",top:parseFloat(Xe)/3+"px",left:parseFloat(oi)/2+"px"}}else{let Xe=50;(Ot=v.unref(Kt))!=null&&Ot.length?Xe=v.unref($).clientHeight:Q&&(U.value=!0,v.unref(oe).height=Xe+"px");let oi=0,$i=1;const Wt=n.getRowHeight(0),ie={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?$i+=Pt.length:ie.columns=[{dimensionKey:jr(6),title:"",width:"100px",type:"columns"}],ft!=null&&ft.length?ft.forEach((Ze,Ge)=>{oi+=n.getColWidth(Ge)}):(oi=100,ie.rows=[{dimensionKey:jr(6),title:"",width:"100px",type:"rows"}]),Qt!=null&&Qt.length||(ie.indicators=[{indicatorKey:jr(6),title:"",width:"20%",format:()=>""}]),(We=Object.keys(ie))!=null&&We.length){const{rows:Ze=[],columns:Ge=[]}=ie;let ze=[];Ht!=null&&Ht.length?ze=Ue.cloneDeep(Ht):(qn=(Rn=v.unref(O))==null?void 0:Rn.records)!=null&&qn.length&&(ze=Ue.cloneDeep((ji=v.unref(O))==null?void 0:ji.records));let Fi=Pt.map(Tn=>Tn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Tn of ze){for(const Qh of Ze)Tn[Qh.dimensionKey]="";let Jh=!1;for(const Qh in Tn)if(Fi.includes(Qh)){Jh=!0;break}Q?Jh||($i=2,Tn[Fi[0]]=""):X&&(Jh||($i=1))}n.updateOption({...dt,...ie,records:ze})}v.nextTick(()=>{var Fi;const Ze=Zl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+Xe+"px",top:Lt+v.unref($t)+"px",left:te+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"},k.value.rows={width:oi-ae*2+"px",height:ze-ae*2+"px",top:Xe+"px",left:0},k.value.columns={width:Ge-oi-ae*2+"px",height:$i*Wt-ae*2+"px",top:Xe+"px",left:oi+"px"},k.value.indicators={width:Ge-oi-ae*2+"px",height:ze-$i*Wt-ae*2+"px",top:$i*Wt+((Fi=v.unref(Kt))!=null&&Fi.length?Xe:0)+"px",left:oi+"px"},k.value.filters={width:Ge-ae*2+"px",height:Xe-ae*2+"px",top:0,left:0}})}I.value=q,X?ff.value=[0,1]:Q&&(ff.value=[2])},UY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...dt,records:v.unref(O).records}):n.updateOption(dt),U.value=!1,v.unref(oe).height="",ff.value=[]},KY=()=>{var V;(V=v.unref(EB))==null||V.handleSearch(v.unref(HB))},LB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:rt,sourceListStyle:ht.value,dimensionFieldList:At.value,indicatorFieldList:mt.value,computedIndKeys:qt.value,computedIndMap:fe.value,computedIndFieldMap:Yt.value,option:dt,loadingRect:Ti.value,calculateList:Lo.value,filterList:Xn.value,topNumMap:$r.value,sortMap:An.value,customDimensions:Fs.value,customIndicators:Kl.value,customRowKeys:Yl.value,customColKeys:Xl.value,cacheResData:Y.value,toolBoxStyle:Gr.value,scrollTop:W.value,scrollLeft:N.value}));let mb=null;v.watch(LB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function hn({type:V,data:K}){ct.value=V,e("tableChange",{type:V,data:K})}function YY(){!i.isAllowSaveConfig||!v.unref(ct)||["5"].includes(v.unref(ct))||(mb&&clearTimeout(mb),mb=setTimeout(()=>{hb("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(LB)})},500))}const vb=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,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,rt=V.splitSymbol,ht.value=V.sourceListStyle,At.value=V.dimensionFieldList,mt.value=V.indicatorFieldList,qt.value=V.computedIndKeys,fe.value=V.computedIndMap,Yt.value=V.computedIndFieldMap,Ti.value=V.loadingRect,Lo.value=V.calculateList,Xn.value=V.filterList,$r.value=V.topNumMap,An.value=V.sortMap,Fs.value=V.customDimensions,Kl.value=V.customIndicators,Yl.value=V.customRowKeys,Xl.value=V.customColKeys,Y.value=V.cacheResData,Gr.value=V.toolBoxStyle,W.value=V.scrollTop,N.value=V.scrollLeft,Object.assign(dt,V.option),dt.theme=Nt};async function XY(V){var K,q,J;if(A.value=!0,V)vb(V);else if(i.isAllowSaveConfig){const X=await hb("get",{keyName:i.relateKeyName||i.keyName}),Q=((q=(K=X==null?void 0:X.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};Q!=null&&Q.data&&!Array.isArray(Q.data)&&((J=Object.keys(Q.data))!=null&&J.length)&&vb(Q.data)}gr()}function qY(){return{dimensions:v.unref(At),indicators:v.unref(mt)}}const ZY=V=>{const{scope:K,name:q,label:J}=V;let X=[];["IDX","BUILT_IN_IDX"].includes(K)?X=v.unref(mt):["DIM","BUILT_IN_DIM"].includes(K)&&(X=v.unref(At));const Q=X.findIndex(tt=>tt.name===q);if(Q!==-1){delete v.unref(a)[X[Q].label];const tt=v.unref(Xn).findIndex(ft=>ft.key===J);tt!==-1&&v.unref(Xn).splice(tt,1),X[Q].show?X[Q].isInnerFilter=!1:X.splice(Q,1)}A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()},JY=V=>{const{scope:K,label:q,showTitle:J}=V,X=eP(K);X==="indicator"||X==="dimension"&&TB({dimensionKey:q,value:J})};t({option:dt,refreshData:XY,reRenderTable:vb,click:MB,getDrawRange:Zl,getSaveData:qY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{kB()},{immediate:!0,deep:!0});function kB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ue.cloneDeep(V),J=Ue.cloneDeep(K);for(const X of q){const Q=i.dimensionList.find(tt=>tt.key===X.name);X.positionType=(Q==null?void 0:Q.position)||"rows",X.width=Q==null?void 0:Q.width,X.showTitle=X.title||X.label}for(const X of J){const Q=i.indicatorList.find(tt=>tt.key===X.name);X.width=Q==null?void 0:Q.width,X.showTitle=X.label}At.value=q,mt.value=J}const QY=()=>{o.value=!1,L.value=!L.value},tX=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},eX=V=>{const K=v.unref(At).find(Q=>Q.label===V),q=v.unref(mt).find(Q=>Q.label===V),J=K||q,X=v.unref(a)[V];return X?J.genericType==="DATE"?Array.isArray(X)?`${X[0].value}~${X[1].value}`:X.value:X.value&&Array.isArray(X.value)?X.value.join("、"):"":""},iX=V=>V.parentNode;return v.onMounted(()=>{ye()}),{showDefaultTableArea:Oe,maskList:ff,styleData:kt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Ti,loading:A,isTableInit:o,toolBoxStyle:Gr,indSourceRef:EB,searchText:HB,dragAreaStyle:k,offsetWidth:Ft,showTreeData:L,dataIconStyle:Ee,largeVisible:D,sourceListStyle:ht,defaultTableStyle:Be,innerFilterStyle:oe,innerFilterFieldList:Kt,innerFilterRef:$,showFilterWrap:U,customDimensions:Fs,indicatorFieldList:mt,dimensionFieldList:At,pivotWrapStyle:R,fontSize:et,click:MB,onFilterChange:VY,pivotDetailRef:w,handleFormat:BB,handleCondition:jY,handleAggregate:SY,handleGetTop:$Y,handleConfig:DY,handleClearFilter:OY,handleGetConfig:zY,onDragStart:GY,onDragEnd:UY,onSearch:KY,handleAddField:NY,toggleShowData:QY,handleEnScale:tX,adjustHSL:EC,handleDelFilterTag:ZY,handleInnerFilter:JY,getFilterValue:eX,getPopupContainer:iX}}}),tY={key:0,class:"design-template"},eY=["id"],iY=["onClick"],nY=["title"],oY=["id"],rY={class:"box-tooltip"},sY={class:"box-tooltip"};function lY(i,t,e,n,o,r){var M,B;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"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),R=v.resolveComponent("pivot-top"),A=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",tY," 透视表格 ")):(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]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[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]=P=>i.searchText=P),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&&((M=i.innerFilterFieldList)!=null&&M.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,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,nY)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",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:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,iY))),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,oY),[[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",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],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,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",rY,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]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",sY,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]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.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)],14,eY),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(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{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"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const ab=WB(Ri(QK,[["render",lY],["__scopeId","data-v-37319db4"]])),mB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:ab},Symbol.toStringTag,{value:"Module"})),aY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(mB).forEach(n=>{const o=mB[n];o.install&&i.use(o)})}},ZX="",JX="",hY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM,EcanPivotTable:ab},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${jr(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",R):P.removeEventListener("dblclick",R))},S=B=>{LC(B,`.${l} .ant-modal-header`)},R=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},A=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ue.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=jr(6),W=[];b.value=[...F,B.label],L.value=L,D.value=D;const N=I.indicators.filter($=>$.show).map($=>$.label);N!=null&&N.length&&(m.title=`下钻:${N.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),W.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],W!=null&&W.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...W),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(N=>N.label===D.label);let W=D.fieldValue;if(W&&typeof W=="string"){const N=W.split(",");(N==null?void 0:N.length)>3&&(W=N.slice(0,3).join(",")+"等")}else W||(W='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${W}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:R,onDetailCancel:A,onPivotTableChange:T,getContainer:a}}}),dY=["title"];function uY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,dY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const cY=Object.freeze(Object.defineProperty({__proto__:null,default:Ri(hY,[["render",uY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=ab,Je.default=aY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
373
|
+
}`;return Function(`"use strict";return (${q})`)().call(this,K)}function $Y(V){A.value=!0;const{value:K,key:q}=V;v.unref(x)[q]=K,hn({type:"6",data:{key:q,value:K}}),yY()}function Zl(){return n==null?void 0:n.getDrawRange()}const ff=v.ref([]),HB=v.ref(""),EB=v.ref(),GY=(V,K)=>{var Ot,We,Rn,qn,ji;const q=K.dataViewColumns[V.oldIndex]||{},{scope:J}=q;let X=!1,Q=!1;["IDX","BUILT_IN_IDX"].includes(J)?X=!0:["DIM","BUILT_IN_DIM"].includes(J)&&(Q=!0);const tt=Zl(),{rows:ft,columns:Pt,indicators:Qt,records:Ht}=dt,{top:Lt,left:te}=tt;if(v.unref(Oe)){let Xe=i.height;i.isIframeMode&&(Xe=document.body.clientHeight+"px");let oi=v.unref(Be).width;oi.includes("calc")&&(oi=v.unref(Tt)-v.unref(E)+"px"),k.value.main={width:oi,height:Xe,top:Lt+v.unref($t)+"px",left:te+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"},k.value.rows={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)-ae*2+"px",top:0,left:0},k.value.columns={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)/3-ae*2+"px",top:0,left:parseFloat(oi)/2+"px"},k.value.indicators={width:parseFloat(oi)/2-ae*2+"px",height:parseFloat(Xe)*2/3-ae*2+"px",top:parseFloat(Xe)/3+"px",left:parseFloat(oi)/2+"px"}}else{let Xe=50;(Ot=v.unref(Kt))!=null&&Ot.length?Xe=v.unref($).clientHeight:Q&&(U.value=!0,v.unref(oe).height=Xe+"px");let oi=0,$i=1;const Wt=n.getRowHeight(0),ie={columnHeaderTitle:!0};if(Pt!=null&&Pt.length?$i+=Pt.length:ie.columns=[{dimensionKey:jr(6),title:"",width:"100px",type:"columns"}],ft!=null&&ft.length?ft.forEach((Ze,Ge)=>{oi+=n.getColWidth(Ge)}):(oi=100,ie.rows=[{dimensionKey:jr(6),title:"",width:"100px",type:"rows"}]),Qt!=null&&Qt.length||(ie.indicators=[{indicatorKey:jr(6),title:"",width:"20%",format:()=>""}]),(We=Object.keys(ie))!=null&&We.length){const{rows:Ze=[],columns:Ge=[]}=ie;let ze=[];Ht!=null&&Ht.length?ze=Ue.cloneDeep(Ht):(qn=(Rn=v.unref(O))==null?void 0:Rn.records)!=null&&qn.length&&(ze=Ue.cloneDeep((ji=v.unref(O))==null?void 0:ji.records));let Fi=Pt.map(Tn=>Tn.dimensionKey);if(!(Fi!=null&&Fi.length)&&(Ge!=null&&Ge.length)&&(Fi=[Ge[0].dimensionKey]),ze!=null&&ze.length)for(const Tn of ze){for(const Qh of Ze)Tn[Qh.dimensionKey]="";let Jh=!1;for(const Qh in Tn)if(Fi.includes(Qh)){Jh=!0;break}Q?Jh||($i=2,Tn[Fi[0]]=""):X&&(Jh||($i=1))}n.updateOption({...dt,...ie,records:ze})}v.nextTick(()=>{var Fi;const Ze=Zl(),Ge=Ze.width,ze=Ze.height;k.value.main={width:Ge+"px",height:ze+Xe+"px",top:Lt+v.unref($t)+"px",left:te+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"},k.value.rows={width:oi-ae*2+"px",height:ze-ae*2+"px",top:Xe+"px",left:0},k.value.columns={width:Ge-oi-ae*2+"px",height:$i*Wt-ae*2+"px",top:Xe+"px",left:oi+"px"},k.value.indicators={width:Ge-oi-ae*2+"px",height:ze-$i*Wt-ae*2+"px",top:$i*Wt+((Fi=v.unref(Kt))!=null&&Fi.length?Xe:0)+"px",left:oi+"px"},k.value.filters={width:Ge-ae*2+"px",height:Xe-ae*2+"px",top:0,left:0}})}I.value=q,X?ff.value=[0,1]:Q&&(ff.value=[2])},UY=()=>{var V;(V=v.unref(O).records)!=null&&V.length?n.updateOption({...dt,records:v.unref(O).records}):n.updateOption(dt),U.value=!1,v.unref(oe).height="",ff.value=[]},KY=()=>{var V;(V=v.unref(EB))==null||V.handleSearch(v.unref(HB))},LB=v.computed(()=>({defaultSortRule:r.value,dimensionData:s.value,currentClickCell:l.value,dimFilterData:a.value,indFilterData:h.value,filterData:d.value,indFilterConfig:c.value,topNumData:x.value,sortData:T.value,colSortData:M.value,indSortData:B.value,aggregateMap:P.value,subMenuLeft:F.value,subMenuTop:H.value,dragAreaStyle:k.value,showTreeData:L.value,largeVisible:D.value,temporaryData:O.value,splitSymbol:rt,sourceListStyle:ht.value,dimensionFieldList:At.value,indicatorFieldList:mt.value,computedIndKeys:qt.value,computedIndMap:fe.value,computedIndFieldMap:Yt.value,option:dt,loadingRect:Ti.value,calculateList:Lo.value,filterList:Xn.value,topNumMap:$r.value,sortMap:An.value,customDimensions:Fs.value,customIndicators:Kl.value,customRowKeys:Yl.value,customColKeys:Xl.value,cacheResData:Y.value,toolBoxStyle:Gr.value,scrollTop:W.value,scrollLeft:N.value}));let mb=null;v.watch(LB,V=>{i.isIframeMode&&window.cacheTableData&&window.cacheTableData(V)},{deep:!0});function hn({type:V,data:K}){ct.value=V,e("tableChange",{type:V,data:K})}function YY(){!i.isAllowSaveConfig||!v.unref(ct)||["5"].includes(v.unref(ct))||(mb&&clearTimeout(mb),mb=setTimeout(()=>{hb("save",{keyName:i.relateKeyName||i.keyName,data:v.unref(LB)})},500))}const vb=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,x.value=V.topNumData,T.value=V.sortData,M.value=V.colSortData,B.value=V.indSortData,P.value=V.aggregateMap,F.value=V.subMenuLeft,H.value=V.subMenuTop,k.value=V.dragAreaStyle,L.value=V.showTreeData,D.value=V.largeVisible,O.value=V.temporaryData,rt=V.splitSymbol,ht.value=V.sourceListStyle,At.value=V.dimensionFieldList,mt.value=V.indicatorFieldList,qt.value=V.computedIndKeys,fe.value=V.computedIndMap,Yt.value=V.computedIndFieldMap,Ti.value=V.loadingRect,Lo.value=V.calculateList,Xn.value=V.filterList,$r.value=V.topNumMap,An.value=V.sortMap,Fs.value=V.customDimensions,Kl.value=V.customIndicators,Yl.value=V.customRowKeys,Xl.value=V.customColKeys,Y.value=V.cacheResData,Gr.value=V.toolBoxStyle,W.value=V.scrollTop,N.value=V.scrollLeft,Object.assign(dt,V.option),dt.theme=Nt};async function XY(V){var K,q,J;if(A.value=!0,V)vb(V);else if(i.isAllowSaveConfig){const X=await hb("get",{keyName:i.relateKeyName||i.keyName}),Q=((q=(K=X==null?void 0:X.data)==null?void 0:K.data)==null?void 0:q.searchMap)||{};Q!=null&&Q.data&&!Array.isArray(Q.data)&&((J=Object.keys(Q.data))!=null&&J.length)&&vb(Q.data)}gr()}function qY(){return{dimensions:v.unref(At),indicators:v.unref(mt)}}const ZY=V=>{const{scope:K,name:q,label:J}=V;let X=[];["IDX","BUILT_IN_IDX"].includes(K)?X=v.unref(mt):["DIM","BUILT_IN_DIM"].includes(K)&&(X=v.unref(At));const Q=X.findIndex(tt=>tt.name===q);if(Q!==-1){delete v.unref(a)[X[Q].label];const tt=v.unref(Xn).findIndex(ft=>ft.key===J);tt!==-1&&v.unref(Xn).splice(tt,1),X[Q].show?X[Q].isInnerFilter=!1:X.splice(Q,1)}A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()},JY=V=>{const{scope:K,label:q,showTitle:J}=V,X=eP(K);X==="indicator"||X==="dimension"&&TB({dimensionKey:q,value:J})};t({option:dt,refreshData:XY,reRenderTable:vb,click:MB,getDrawRange:Zl,getSaveData:qY}),v.watch(()=>[i.graphicConfig,i.dimensionList,i.indicatorList],()=>{kB()},{immediate:!0,deep:!0});function kB(){const{queryColumnList:V=[],indicators:K=[]}=i.graphicConfig,q=Ue.cloneDeep(V),J=Ue.cloneDeep(K);for(const X of q){const Q=i.dimensionList.find(tt=>tt.key===X.name);X.positionType=(Q==null?void 0:Q.position)||"rows",X.showTitle=X.title||X.label,Q&&(X.width=Q.width)}for(const X of J){const Q=i.indicatorList.find(tt=>tt.key===X.name);X.width=Q==null?void 0:Q.width,X.showTitle=X.label}At.value=q,mt.value=J}const QY=()=>{o.value=!1,L.value=!L.value},tX=()=>{o.value=!1,D.value=!D.value,window.enScale&&window.enScale(v.unref(D))},eX=V=>{const K=v.unref(At).find(Q=>Q.label===V),q=v.unref(mt).find(Q=>Q.label===V),J=K||q,X=v.unref(a)[V];return X?J.genericType==="DATE"?Array.isArray(X)?`${X[0].value}~${X[1].value}`:X.value:X.value&&Array.isArray(X.value)?X.value.join("、"):"":""},iX=V=>V.parentNode;return v.onMounted(()=>{ye()}),{showDefaultTableArea:Oe,maskList:ff,styleData:kt,subMenuLeft:F,subMenuTop:H,pivotWrapRef:S,pivotTableRef:_,pivotFilterRef:u,pivotPropertyRef:g,conditionalPropertyRef:f,chartModalRef:C,pivotTopRef:m,pivotConfigRef:b,drillModalRef:y,pivotAggregateRef:p,filterData:d,loadingRect:Ti,loading:A,isTableInit:o,toolBoxStyle:Gr,indSourceRef:EB,searchText:HB,dragAreaStyle:k,offsetWidth:Ft,showTreeData:L,dataIconStyle:Ee,largeVisible:D,sourceListStyle:ht,defaultTableStyle:Be,innerFilterStyle:oe,innerFilterFieldList:Kt,innerFilterRef:$,showFilterWrap:U,customDimensions:Fs,indicatorFieldList:mt,dimensionFieldList:At,pivotWrapStyle:R,fontSize:et,click:MB,onFilterChange:VY,pivotDetailRef:w,handleFormat:BB,handleCondition:jY,handleAggregate:SY,handleGetTop:$Y,handleConfig:DY,handleClearFilter:OY,handleGetConfig:zY,onDragStart:GY,onDragEnd:UY,onSearch:KY,handleAddField:NY,toggleShowData:QY,handleEnScale:tX,adjustHSL:EC,handleDelFilterTag:ZY,handleInnerFilter:JY,getFilterValue:eX,getPopupContainer:iX}}}),tY={key:0,class:"design-template"},eY=["id"],iY=["onClick"],nY=["title"],oY=["id"],rY={class:"box-tooltip"},sY={class:"box-tooltip"};function lY(i,t,e,n,o,r){var M,B;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"),_=v.resolveComponent("pivot-property"),w=v.resolveComponent("conditional-property"),y=v.resolveComponent("chart-modal"),S=v.resolveComponent("pivot-aggregate"),R=v.resolveComponent("pivot-top"),A=v.resolveComponent("pivot-detail"),x=v.resolveComponent("pivot-config"),T=v.resolveComponent("drill-modal");return i.pageMode==="design"?(v.openBlock(),v.createElementBlock("div",tY," 透视表格 ")):(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]]),style:v.normalizeStyle(i.pivotWrapStyle),id:`pivotWrap_${i.id}`,ref:"pivotWrapRef"},[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]=P=>i.searchText=P),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&&((M=i.innerFilterFieldList)!=null&&M.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,P=>(v.openBlock(),v.createElementBlock("div",{key:P.name,class:"filter-tag",style:v.normalizeStyle({backgroundColor:i.adjustHSL(i.styleData.headerBgColor,-4)}),onClick:F=>i.handleInnerFilter(P)},[v.createElementVNode("div",{class:"tag-text",style:v.normalizeStyle({color:i.styleData.headerColor})},v.toDisplayString(P.showTitle),5),i.getFilterValue(P.label)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"filter-value",style:v.normalizeStyle({color:i.adjustHSL(i.styleData.headerColor,8)}),title:i.getFilterValue(P.label)},v.toDisplayString(i.getFilterValue(P.label)),13,nY)):v.createCommentVNode("",!0),v.createElementVNode("span",{class:v.normalizeClass(i.fullMode?"hover-icon-wrap":"")},[v.createVNode(a,{class:"filter-icon",style:v.normalizeStyle({fontSize:i.fontSize+"px",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:i.fontSize+"px",color:i.styleData.headerColor}),onClick:v.withModifiers(F=>i.handleDelFilterTag(P),["stop"])},null,8,["style","onClick"])]),_:2},1024)],2)],12,iY))),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,oY),[[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",style:v.normalizeStyle({scale:i.scaleValue.widthScale})},null,8,["style"])],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,getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",rY,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]=(...P)=>i.toggleShowData&&i.toggleShowData(...P))},[v.createVNode(c,{style:v.normalizeStyle(i.dataIconStyle)},null,8,["style"])],2)]),_:1},8,["getPopupContainer"])):v.createCommentVNode("",!0),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>[v.createElementVNode("span",sY,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]=(...P)=>i.handleEnScale&&i.handleEnScale(...P))},[i.largeVisible?(v.openBlock(),v.createBlock(g,{key:0,style:v.normalizeStyle({fontSize:i.fontSize+"px",color:"#416EFF"})},null,8,["style"])):(v.openBlock(),v.createBlock(f,{key:1,style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"]))],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[6]||(t[6]=[v.createElementVNode("span",{class:"box-tooltip"},"设置",-1)])),default:v.withCtx(()=>[v.createElementVNode("div",{class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[3]||(t[3]=(...P)=>i.handleConfig&&i.handleConfig(...P))},[v.createVNode(p,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)]),_:1},8,["getPopupContainer"]),v.createVNode(d,{getPopupContainer:i.getPopupContainer},{title:v.withCtx(()=>t[7]||(t[7]=[v.createElementVNode("span",{class:"box-tooltip"},"清空状态",-1)])),default:v.withCtx(()=>[i.showClear?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["box-item pivot-config",i.theme]),onClick:t[4]||(t[4]=(...P)=>i.handleClearFilter&&i.handleClearFilter(...P))},[v.createVNode(m,{style:v.normalizeStyle({fontSize:i.fontSize+"px"})},null,8,["style"])],2)):v.createCommentVNode("",!0)]),_:1},8,["getPopupContainer"])],4)):v.createCommentVNode("",!0),(B=i.maskList)!=null&&B.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)],14,eY),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(_,{ref:"pivotPropertyRef",onChange:i.handleFormat},null,8,["onChange"]),v.createVNode(w,{ref:"conditionalPropertyRef",onChange:i.handleCondition},null,8,["onChange"]),v.createVNode(y,{ref:"chartModalRef"},null,512),v.createVNode(S,{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"]),v.createVNode(T,{ref:"drillModalRef",scaleValue:i.scaleValue,isIframeMode:i.isIframeMode},null,8,["scaleValue","isIframeMode"])],8,["to","disabled"]))}const ab=WB(Ri(QK,[["render",lY],["__scopeId","data-v-debfd767"]])),mB=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:ab},Symbol.toStringTag,{value:"Module"})),aY={install:(i,t)=>{const{request:e}=t;i.provide("$request",e),Object.keys(mB).forEach(n=>{const o=mB[n];o.install&&i.use(o)})}},ZX="",JX="",hY=v.defineComponent({name:"DrillModal",props:{scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},isIframeMode:{type:Boolean,default:!1}},components:{BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM,EcanPivotTable:ab},setup(i,{expose:t}){const e={IN:"属于",NOT_IN:"不属于",LIKE:"包含",NOT_LIKE:"不包含","LIKE%":"开头是","%LIKE":"结尾是",EQUAL:"等于",LESS:"小于",LESS_EQUAL:"小于等于",GREATER:"大于",GREATER_EQUAL:"大于等于",NOT_EQUAL:"不等于"},n=.37,o=.6,r=.97,s=.9,l=`dmodal_${jr(6)}`,a=()=>document.querySelector("#ProviderConfig > #container")||document.body,h=v.inject("theme","light"),d=v.ref({}),u=v.ref([]),c=v.inject("indicatorUrl",""),g=v.ref([]),f=v.ref(!1),p=v.ref({}),m=v.reactive({keyName:"",visible:!1,columns:[],title:""}),b=v.ref([]),C=v.ref(),_=v.computed(()=>{let B=`drill-modal ${l}`;return f.value&&(B+=" full"),v.unref(h)&&(B+=` ${v.unref(h)}`),B}),w=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);if(P)if(B)P.addEventListener("mousedown",S);else{const F=P.parentElement;F&&(F.style.left="",F.style.top=""),P.removeEventListener("mousedown",S)}},y=B=>{const P=document.querySelector(`.${l} .ant-modal-header`);P&&(B?P.addEventListener("dblclick",R):P.removeEventListener("dblclick",R))},S=B=>{LC(B,`.${l} .ant-modal-header`)},R=()=>{f.value=!f.value,v.nextTick(()=>{f.value?(v.unref(p).width=parseFloat(v.unref(d).width)*r+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*s+"px",w(!1)):(v.unref(p).width=parseFloat(v.unref(d).width)*n+"px",v.unref(p).height=(i.isIframeMode?parseFloat(v.unref(d).height):window.screen.height)*o+"px",w(!0))})},A=()=>{f.value=!1,y(!1),w(!1)},x=({drillDimension:B,drillFieldData:P,usedDimensionFields:F,tableProps:H,splitSymbol:E})=>{const k=Ue.cloneDeep(H),{graphicConfig:I,allDimensions:L,pageConfig:D}=k,O=jr(6),W=[];b.value=[...F,B.label],L.value=L,D.value=D;const N=I.indicators.filter($=>$.show).map($=>$.label);N!=null&&N.length&&(m.title=`下钻:${N.join("、")}`);for(const $ of P){const U=L.find(G=>[G.title,G.label].includes($.dimensionKey)),Y=$.value.split(E);let j=$.value;Y!=null&&Y.length&&(j=Y[Y.length-1]),W.push({conditionKey:U.label,conditionLabel:U.title||U.label,conditionName:U.name,conditionValueType:U.genericType,indexCode:U.indexCode,typeGuid:U.typeGuid,indexCodeNum:U.indexCodeNum,rule:"EQUAL",dataType:"",customValue:j})}I.queryColumnList=[B],W!=null&&W.length&&(I.controlList||(I.controlList=[]),I.controlList.push(...W),I.controlList=[{join:"&&",conditions:I.controlList}]),p.value={...k,id:O,keyName:`透视表_${O}`,position:"relative",top:0,left:0,width:parseFloat(v.unref(D).width)*n+"px",height:(i.isIframeMode?parseFloat(v.unref(D).height):window.screen.height)*o+"px",graphicConfig:I},m.visible=!0,v.nextTick(()=>{v.unref(C).refreshData(),y(!0),w(!0)})},T=({type:B,data:P})=>{if(B==="11"&&P){const{indicatorList:F=[],queryColumns:H=[]}=P,k=F.concat(H).filter(D=>D.conditions||D.filter),I=M(k,"conditions",!0),L=M(P.sqlConditions,"sqlConditions",!1);g.value=I.concat(L).map(D=>{const O=v.unref(u).find(N=>N.label===D.label);let W=D.fieldValue;if(W&&typeof W=="string"){const N=W.split(",");(N==null?void 0:N.length)>3&&(W=N.slice(0,3).join(",")+"等")}else W||(W='""');return`${(O==null?void 0:O.title)||D.label} ${e[D.rule]} ${W}`})||[]}};function M(B,P,F){const H=[];for(const E of B)E[P]?H.push(...M(E[P],P,F)):E.filter?H.push({...E.filter,label:E.label}):(!F||E.dataType!=="component"&&!(E.fieldValue.startsWith("${")&&E.fieldValue.endsWith("}")))&&H.push(E);return H}return v.watch(m.visible,B=>{window.modalShow&&window.modalShow(B)}),t({showModal:x}),{theme:h,wrapClassName:_,conditionInfo:g,drillInfo:m,pivotTableConfig:p,indicatorUrl:c,isIndFullScreen:f,usedDimensionFields:b,pivotTableRef:C,toggleFullScreen:R,onDetailCancel:A,onPivotTableChange:T,getContainer:a}}}),dY=["title"];function uY(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("ecan-pivot-table"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{"wrap-class-name":i.wrapClassName,visible:i.drillInfo.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.drillInfo.visible=u),width:"60%",footer:null,maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>[v.createElementVNode("div",{class:"modal-title",title:i.conditionInfo.join("、")},v.toDisplayString(i.drillInfo.title)+" "+v.toDisplayString(i.conditionInfo.join("、")),9,dY)]),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...u)=>i.toggleFullScreen&&i.toggleFullScreen(...u))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.drillInfo.visible?(v.openBlock(),v.createElementBlock("div",{key:0,style:v.normalizeStyle({position:"relative",width:i.pivotTableConfig.width,height:i.pivotTableConfig.height})},[v.createVNode(h,v.mergeProps({ref:"pivotTableRef"},i.pivotTableConfig,{theme:i.theme,fullMode:!1,allowDrill:!0,showFullScreen:!1,showClear:!1,isAllowSaveConfig:!1,indicatorUrl:i.indicatorUrl,relateKeyName:i.drillInfo.keyName,usedDimensionFields:i.usedDimensionFields,scaleValue:i.scaleValue,onTableChange:i.onPivotTableChange}),null,16,["theme","indicatorUrl","relateKeyName","usedDimensionFields","scaleValue","onTableChange"])],4)):v.createCommentVNode("",!0)]),_:1},8,["wrap-class-name","visible","getContainer","onCancel"])}const cY=Object.freeze(Object.defineProperty({__proto__:null,default:Ri(hY,[["render",uY],["__scopeId","data-v-412e66d4"]])},Symbol.toStringTag,{value:"Module"}));Je.EcanPivotTable=ab,Je.default=aY,Object.defineProperties(Je,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
374
374
|
//# sourceMappingURL=index.umd.js.map
|