st-comp 0.0.115 → 0.0.116
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/auto-imports.d.ts +1 -0
- package/components.d.ts +1 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +11 -11
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +1070 -272
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +13 -13
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +30 -30
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/Table.cjs +1 -1
- package/es/Table.js +31 -31
- package/es/User.cjs +1 -1
- package/es/User.js +84 -84
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1116 -936
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +56 -56
- package/es/base-ec05f348.cjs +9 -0
- package/es/{base-a3fcf99a.js → base-f7877059.js} +345 -328
- package/es/{castArray-0e8e51f9.js → castArray-18f43497.js} +1 -1
- package/es/{castArray-e6cd255c.cjs → castArray-a45823fe.cjs} +1 -1
- package/es/{config-provider-e4ebacca.js → config-provider-6479d795.js} +6 -6
- package/es/{config-provider-957c280a.cjs → config-provider-7cdfca4d.cjs} +1 -1
- package/es/{debounce-7f3a3471.js → debounce-2336e546.js} +14 -14
- package/es/{debounce-3ad03224.cjs → debounce-b2ff12bd.cjs} +1 -1
- package/es/{dropdown-c505d260.js → dropdown-46daf582.js} +4 -4
- package/es/{dropdown-e73864c0.cjs → dropdown-9a974876.cjs} +1 -1
- package/es/{el-button-e389429d.cjs → el-button-196807af.cjs} +1 -1
- package/es/{el-button-fe99fee6.js → el-button-802f579a.js} +6 -6
- package/es/{el-empty-848e4e08.cjs → el-empty-19ea04f4.cjs} +1 -1
- package/es/{el-empty-a338aa98.js → el-empty-3c5ec277.js} +5 -5
- package/es/el-form-item-84099d46.js +1599 -0
- package/es/el-form-item-c39f717e.cjs +12 -0
- package/es/{el-input-65ed0dba.cjs → el-input-6c6f5bda.cjs} +1 -1
- package/es/{el-input-35c8ebc3.js → el-input-fac5b401.js} +39 -39
- package/es/{el-overlay-851ea246.js → el-overlay-69e9ae49.js} +105 -101
- package/es/el-overlay-891dcc40.cjs +1 -0
- package/es/{el-popover-246eb710.js → el-popover-694ded47.js} +22 -22
- package/es/{el-popover-b0deb095.cjs → el-popover-8735b1fa.cjs} +1 -1
- package/es/{el-popper-e052fb84.js → el-popper-6126b1f6.js} +91 -91
- package/es/{el-popper-4da22fdc.cjs → el-popper-f62316cd.cjs} +1 -1
- package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
- package/es/el-scrollbar-e0493906.js +201 -0
- package/es/el-select-513126a5.js +1128 -0
- package/es/el-select-928f8c19.cjs +1 -0
- package/es/{el-table-column-661deade.js → el-table-column-3c920bdd.js} +69 -69
- package/es/{el-table-column-d636a7d6.cjs → el-table-column-dd8b62aa.cjs} +1 -1
- package/es/{el-tag-a45bdd1e.cjs → el-tag-3b03d13e.cjs} +1 -1
- package/es/{el-tag-7601f7e6.js → el-tag-5becabc9.js} +74 -74
- package/es/index-048dca7e.js +303 -0
- package/es/{index-28cd5fde.js → index-35117549.js} +25 -25
- package/es/{index-fc652f21.js → index-57f8f7b9.js} +15 -1
- package/es/index-7e40be25.js +167 -0
- package/es/index-80a2b137.cjs +1 -0
- package/es/{index-35665af5.cjs → index-8a0b1c53.cjs} +1 -1
- package/es/{index-25aca205.cjs → index-dc273ea2.cjs} +1 -1
- package/es/index-e1e83173.cjs +1 -0
- package/es/{raf-a97e05a3.js → raf-07da7cdf.js} +1 -1
- package/es/{raf-da075499.cjs → raf-8fc301fd.cjs} +1 -1
- package/es/{refs-f0ee592c.js → refs-1b1fe6ca.js} +1 -1
- package/es/{refs-34a69f8c.cjs → refs-d00b710b.cjs} +1 -1
- package/es/{scroll-1e0c8fab.js → scroll-3b521d81.js} +1 -1
- package/es/{scroll-c7ef9180.cjs → scroll-41224831.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-96d2ea48.cjs → use-form-common-props-1b84d8f4.cjs} +1 -1
- package/es/{use-form-common-props-d0739feb.js → use-form-common-props-f3a520d0.js} +53 -53
- package/es/{vnode-8f40662d.js → vnode-25d7c2f5.js} +1 -1
- package/es/{vnode-562e063c.cjs → vnode-7fbc61e1.cjs} +1 -1
- package/es/{zh-cn-0ab4aa73.js → zh-cn-74781bbd.js} +2 -2
- package/es/{zh-cn-bf58db71.cjs → zh-cn-ab9a583d.cjs} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +192 -192
- package/lib/{index-a981dd97.js → index-c6ba3bcd.js} +30058 -29227
- package/lib/{python-72fd599d.js → python-49e22e65.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/FactorWarning/index.vue +296 -97
- package/packages/FactorWarning/tools.js +10 -0
- package/src/pages/FactorWarning/index.vue +69 -25
- package/es/base-adc4e34e.cjs +0 -9
- package/es/el-overlay-84e3cb6c.cjs +0 -1
- package/es/el-radio-button-12b07ac2.js +0 -1782
- package/es/el-radio-button-5259a46b.cjs +0 -12
- package/es/el-scrollbar-8cb3663b.cjs +0 -1
- package/es/el-scrollbar-c23060d5.js +0 -193
- package/es/el-select-4987a187.cjs +0 -1
- package/es/el-select-d1a33fbe.js +0 -1233
- package/es/index-4090cb2c.cjs +0 -1
- package/es/index-af687c16.js +0 -302
- package/es/index-b4bbc58d.js +0 -59
- package/es/index-f14354e6.cjs +0 -1
package/es/Kline.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const v=require("./base-adc4e34e.cjs");require("./el-tooltip-0ea8fbf8.cjs");const je=require("./el-popper-4da22fdc.cjs"),e=require("vue"),he=require("echarts"),Z=require("./_plugin-vue_export-helper-f246444f.cjs"),ee=require("./index-25aca205.cjs"),pe=require("./index.esm-94a95a2a.cjs"),ve=require("./el-scrollbar-8cb3663b.cjs"),W=require("./use-form-common-props-96d2ea48.cjs"),R=require("./index-f14354e6.cjs"),xe=require("./index-eea0bcb3.cjs"),Ye=require("./el-tag-a45bdd1e.cjs"),Ae=require("./typescript-b63f8e83.cjs"),Ce=require("./vnode-562e063c.cjs"),de=require("./el-select-4987a187.cjs");require("./castArray-e6cd255c.cjs");require("./index-4090cb2c.cjs");require("./event-61f49698.cjs");require("./scroll-c7ef9180.cjs");require("./debounce-3ad03224.cjs");function we(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const X=we(he),be=e.defineComponent({name:"ElCollapseTransition"}),ke=e.defineComponent({...be,setup(t){const o=v.useNamespace("collapse-transition"),a=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},i={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){a(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){a(n)},leaveCancelled(n){a(n)}};return(n,s)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(o).b()},e.toHandlers(i)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}});var Oe=v._export_sfc(ke,[["__file","collapse-transition.vue"]]);const Ee=v.withInstall(Oe);let Se=class{constructor(o,a){this.parent=o,this.domNode=a,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(o){o===this.subMenuItems.length?o=0:o<0&&(o=this.subMenuItems.length-1),this.subMenuItems[o].focus(),this.subIndex=o}addListeners(){const o=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,a=>{a.addEventListener("keydown",i=>{let n=!1;switch(i.code){case R.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),n=!0;break}case R.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),n=!0;break}case R.EVENT_CODE.tab:{R.triggerEvent(o,"mouseleave");break}case R.EVENT_CODE.enter:case R.EVENT_CODE.numpadEnter:case R.EVENT_CODE.space:{n=!0,i.currentTarget.click();break}}return n&&(i.preventDefault(),i.stopPropagation()),!1})})}},_e=class{constructor(o,a){this.domNode=o,this.submenu=null,this.submenu=null,this.init(a)}init(o){this.domNode.setAttribute("tabindex","0");const a=this.domNode.querySelector(`.${o}-menu`);a&&(this.submenu=new Se(this,a)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",o=>{let a=!1;switch(o.code){case R.EVENT_CODE.down:{R.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),a=!0;break}case R.EVENT_CODE.up:{R.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),a=!0;break}case R.EVENT_CODE.tab:{R.triggerEvent(o.currentTarget,"mouseleave");break}case R.EVENT_CODE.enter:case R.EVENT_CODE.numpadEnter:case R.EVENT_CODE.space:{a=!0,o.currentTarget.click();break}}a&&o.preventDefault()})}},Fe=class{constructor(o,a){this.domNode=o,this.init(a)}init(o){const a=this.domNode.childNodes;Array.from(a).forEach(i=>{i.nodeType===1&&new _e(i,o)})}};const Qe=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=v.useNamespace("menu");return{listeners:{onBeforeEnter:a=>a.style.opacity="0.2",onEnter(a,i){v.addClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity="1",i()},onAfterEnter(a){v.removeClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity=""},onBeforeLeave(a){a.dataset||(a.dataset={}),v.hasClass(a,t.m("collapse"))?(v.removeClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),v.addClass(a,t.m("collapse"))):(v.addClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),v.removeClass(a,t.m("collapse"))),a.style.width=`${a.scrollWidth}px`,a.style.overflow="hidden"},onLeave(a){v.addClass(a,"horizontal-collapse-transition"),a.style.width=`${a.dataset.scrollWidth}px`}}}}});function Be(t,o,a,i,n,s){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var Pe=v._export_sfc(Qe,[["render",Be],["__file","menu-collapse-transition.vue"]]);function fe(t,o){const a=e.computed(()=>{let n=t.parent;const s=[o.value];for(;n.type.name!=="ElMenu";)n.props.index&&s.unshift(n.props.index),n=n.parent;return s});return{parentMenu:e.computed(()=>{let n=t.parent;for(;n&&!["ElMenu","ElSubMenu"].includes(n.type.name);)n=n.parent;return n}),indexPath:a}}function Ve(t){return e.computed(()=>{const a=t.backgroundColor;return a?new xe.TinyColor(a).shade(20).toString():""})}const Te=(t,o)=>{const a=v.useNamespace("menu");return e.computed(()=>a.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":Ve(t).value||"","active-color":t.activeTextColor||"",level:`${o}`}))},Re=v.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:W.iconPropType},expandOpenIcon:{type:W.iconPropType},collapseCloseIcon:{type:W.iconPropType},collapseOpenIcon:{type:W.iconPropType}}),te="ElSubMenu";var ue=e.defineComponent({name:te,props:Re,setup(t,{slots:o,expose:a}){const i=e.getCurrentInstance(),{indexPath:n,parentMenu:s}=fe(i,e.computed(()=>t.index)),M=v.useNamespace("menu"),u=v.useNamespace("sub-menu"),l=e.inject("rootMenu");l||v.throwError(te,"can not inject root menu");const r=e.inject(`subMenu:${s.value.uid}`);r||v.throwError(te,"can not inject sub menu");const d=e.ref({}),f=e.ref({});let N;const g=e.ref(!1),D=e.ref(),y=e.ref(null),x=e.computed(()=>A.value==="horizontal"&&k.value?"bottom-start":"right-start"),b=e.computed(()=>A.value==="horizontal"&&k.value||A.value==="vertical"&&!l.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?m.value?t.expandOpenIcon:t.expandCloseIcon:W.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?m.value?t.collapseOpenIcon:t.collapseCloseIcon:W.arrow_right_default),k=e.computed(()=>r.level===0),_=e.computed(()=>{const L=t.teleported;return L===void 0?k.value:L}),p=e.computed(()=>l.props.collapse?`${M.namespace.value}-zoom-in-left`:`${M.namespace.value}-zoom-in-top`),T=e.computed(()=>A.value==="horizontal"&&k.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),m=e.computed(()=>l.openedMenus.includes(t.index)),Y=e.computed(()=>{let L=!1;return Object.values(d.value).forEach(w=>{w.active&&(L=!0)}),Object.values(f.value).forEach(w=>{w.active&&(L=!0)}),L}),A=e.computed(()=>l.props.mode),E=e.reactive({index:t.index,indexPath:n,active:Y}),F=Te(l.props,r.level+1),U=e.computed(()=>{var L;return(L=t.popperOffset)!=null?L:l.props.popperOffset}),Q=e.computed(()=>{var L;return(L=t.popperClass)!=null?L:l.props.popperClass}),$=e.computed(()=>{var L;return(L=t.showTimeout)!=null?L:l.props.showTimeout}),I=e.computed(()=>{var L;return(L=t.hideTimeout)!=null?L:l.props.hideTimeout}),j=()=>{var L,w,O;return(O=(w=(L=y.value)==null?void 0:L.popperRef)==null?void 0:w.popperInstanceRef)==null?void 0:O.destroy()},z=L=>{L||j()},c=()=>{l.props.menuTrigger==="hover"&&l.props.mode==="horizontal"||l.props.collapse&&l.props.mode==="vertical"||t.disabled||l.handleSubMenuClick({index:t.index,indexPath:n.value,active:Y.value})},h=(L,w=$.value)=>{var O;if(L.type!=="focus"){if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"||t.disabled){r.mouseInChild.value=!0;return}r.mouseInChild.value=!0,N==null||N(),{stop:N}=v.useTimeoutFn(()=>{l.openMenu(t.index,n.value)},w),_.value&&((O=s.value.vnode.el)==null||O.dispatchEvent(new MouseEvent("mouseenter")))}},C=(L=!1)=>{var w;if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"){r.mouseInChild.value=!1;return}N==null||N(),r.mouseInChild.value=!1,{stop:N}=v.useTimeoutFn(()=>!g.value&&l.closeMenu(t.index,n.value),I.value),_.value&&L&&((w=r.handleMouseleave)==null||w.call(r,!0))};e.watch(()=>l.props.collapse,L=>z(!!L));{const L=O=>{f.value[O.index]=O},w=O=>{delete f.value[O.index]};e.provide(`subMenu:${i.uid}`,{addSubMenu:L,removeSubMenu:w,handleMouseleave:C,mouseInChild:g,level:r.level+1})}return a({opened:m}),e.onMounted(()=>{l.addSubMenu(E),r.addSubMenu(E)}),e.onBeforeUnmount(()=>{r.removeSubMenu(E),l.removeSubMenu(E)}),()=>{var L;const w=[(L=o.title)==null?void 0:L.call(o),e.h(W.ElIcon,{class:u.e("icon-arrow"),style:{transform:m.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&l.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>v.isString(b.value)?e.h(i.appContext.components[b.value]):e.h(b.value)})],O=l.isMenuPopup?e.h(je.ElTooltip,{ref:y,visible:m.value,effect:"light",pure:!0,offset:U.value,showArrow:!1,persistent:!0,popperClass:Q.value,placement:x.value,teleported:_.value,fallbackPlacements:T.value,transition:p.value,gpuAcceleration:!1},{content:()=>{var S;return e.h("div",{class:[M.m(A.value),M.m("popup-container"),Q.value],onMouseenter:V=>h(V,100),onMouseleave:()=>C(!0),onFocus:V=>h(V,100)},[e.h("ul",{class:[M.b(),M.m("popup"),M.m(`popup-${x.value}`)],style:F.value},[(S=o.default)==null?void 0:S.call(o)])])},default:()=>e.h("div",{class:u.e("title"),onClick:c},w)}):e.h(e.Fragment,{},[e.h("div",{class:u.e("title"),ref:D,onClick:c},w),e.h(Ee,{},{default:()=>{var S;return e.withDirectives(e.h("ul",{role:"menu",class:[M.b(),M.m("inline")],style:F.value},[(S=o.default)==null?void 0:S.call(o)]),[[e.vShow,m.value]])}})]);return e.h("li",{class:[u.b(),u.is("active",Y.value),u.is("opened",m.value),u.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:m.value,onMouseenter:h,onMouseleave:()=>C(),onFocus:h},[O])}}});const Ue=v.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:v.definePropType(Array),default:()=>Ae.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:W.iconPropType,default:()=>W.more_default},popperEffect:{type:v.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),ne=t=>v.isArray(t)&&t.every(o=>v.isString(o)),$e={close:(t,o)=>v.isString(t)&&ne(o),open:(t,o)=>v.isString(t)&&ne(o),select:(t,o,a,i)=>v.isString(t)&&ne(o)&&v.isObject(a)&&(i===void 0||i instanceof Promise)};var We=e.defineComponent({name:"ElMenu",props:Ue,emits:$e,setup(t,{emit:o,slots:a,expose:i}){const n=e.getCurrentInstance(),s=n.appContext.config.globalProperties.$router,M=e.ref(),u=v.useNamespace("menu"),l=v.useNamespace("sub-menu"),r=e.ref(-1),d=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),f=e.ref(t.defaultActive),N=e.ref({}),g=e.ref({}),D=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),y=()=>{const j=f.value&&N.value[f.value];if(!j||t.mode==="horizontal"||t.collapse)return;j.indexPath.forEach(c=>{const h=g.value[c];h&&x(c,h.indexPath)})},x=(j,z)=>{d.value.includes(j)||(t.uniqueOpened&&(d.value=d.value.filter(c=>z.includes(c))),d.value.push(j),o("open",j,z))},b=j=>{const z=d.value.indexOf(j);z!==-1&&d.value.splice(z,1)},k=(j,z)=>{b(j),o("close",j,z)},_=({index:j,indexPath:z})=>{d.value.includes(j)?k(j,z):x(j,z)},p=j=>{(t.mode==="horizontal"||t.collapse)&&(d.value=[]);const{index:z,indexPath:c}=j;if(!(v.isNil(z)||v.isNil(c)))if(t.router&&s){const h=j.route||z,C=s.push(h).then(L=>(L||(f.value=z),L));o("select",z,c,{index:z,indexPath:c,route:h},C)}else f.value=z,o("select",z,c,{index:z,indexPath:c})},T=j=>{const z=N.value,c=z[j]||f.value&&z[f.value]||z[t.defaultActive];c?f.value=c.index:f.value=j},m=j=>{const z=getComputedStyle(j),c=Number.parseInt(z.marginLeft,10),h=Number.parseInt(z.marginRight,10);return j.offsetWidth+c+h||0},Y=()=>{var j,z;if(!M.value)return-1;const c=Array.from((z=(j=M.value)==null?void 0:j.childNodes)!=null?z:[]).filter(B=>B.nodeName!=="#text"||B.nodeValue),h=64,C=getComputedStyle(M.value),L=Number.parseInt(C.paddingLeft,10),w=Number.parseInt(C.paddingRight,10),O=M.value.clientWidth-L-w;let S=0,V=0;return c.forEach((B,G)=>{B.nodeName!=="#comment"&&(S+=m(B),S<=O-h&&(V=G+1))}),V===c.length?-1:V},A=j=>g.value[j].indexPath,E=(j,z=33.34)=>{let c;return()=>{c&&clearTimeout(c),c=setTimeout(()=>{j()},z)}};let F=!0;const U=()=>{if(r.value===Y())return;const j=()=>{r.value=-1,e.nextTick(()=>{r.value=Y()})};F?j():E(j)(),F=!1};e.watch(()=>t.defaultActive,j=>{N.value[j]||(f.value=""),T(j)}),e.watch(()=>t.collapse,j=>{j&&(d.value=[])}),e.watch(N.value,y);let Q;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?Q=ve.useResizeObserver(M,U).stop:Q==null||Q()});const $=e.ref(!1);{const j=C=>{g.value[C.index]=C},z=C=>{delete g.value[C.index]},c=C=>{N.value[C.index]=C},h=C=>{delete N.value[C.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:d,items:N,subMenus:g,activeIndex:f,isMenuPopup:D,addMenuItem:c,removeMenuItem:h,addSubMenu:j,removeSubMenu:z,openMenu:x,closeMenu:k,handleMenuItemClick:p,handleSubMenuClick:_})),e.provide(`subMenu:${n.uid}`,{addSubMenu:j,removeSubMenu:z,mouseInChild:$,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new Fe(n.vnode.el,u.namespace.value)}),i({open:z=>{const{indexPath:c}=g.value[z];c.forEach(h=>x(h,c))},close:b,handleResize:U});const I=Te(t,0);return()=>{var j,z;let c=(z=(j=a.default)==null?void 0:j.call(a))!=null?z:[];const h=[];if(t.mode==="horizontal"&&M.value){const w=Ce.flattedChildren(c),O=r.value===-1?w:w.slice(0,r.value),S=r.value===-1?[]:w.slice(r.value);S!=null&&S.length&&t.ellipsis&&(c=O,h.push(e.h(ue,{index:"sub-menu-more",class:l.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(W.ElIcon,{class:l.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>S})))}const C=t.closeOnClickOutside?[[Ye.ClickOutside,()=>{d.value.length&&($.value||(d.value.forEach(w=>o("close",w,A(w))),d.value=[]))}]]:[],L=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:M,style:I.value,class:{[u.b()]:!0,[u.m(t.mode)]:!0,[u.m("collapse")]:t.collapse}},[...c,...h]),C);return t.collapseTransition&&t.mode==="vertical"?e.h(Pe,()=>L):L}}});const Ze=v.buildProps({index:{type:v.definePropType([String,null]),default:null},route:{type:v.definePropType([String,Object])},disabled:Boolean}),Ge={click:t=>v.isString(t.index)&&v.isArray(t.indexPath)},oe="ElMenuItem",He=e.defineComponent({name:oe,components:{ElTooltip:je.ElTooltip},props:Ze,emits:Ge,setup(t,{emit:o}){const a=e.getCurrentInstance(),i=e.inject("rootMenu"),n=v.useNamespace("menu"),s=v.useNamespace("menu-item");i||v.throwError(oe,"can not inject root menu");const{parentMenu:M,indexPath:u}=fe(a,e.toRef(t,"index")),l=e.inject(`subMenu:${M.value.uid}`);l||v.throwError(oe,"can not inject sub menu");const r=e.computed(()=>t.index===i.activeIndex),d=e.reactive({index:t.index,indexPath:u,active:r}),f=()=>{t.disabled||(i.handleMenuItemClick({index:t.index,indexPath:u.value,route:t.route}),o("click",d))};return e.onMounted(()=>{l.addSubMenu(d),i.addMenuItem(d)}),e.onBeforeUnmount(()=>{l.removeSubMenu(d),i.removeMenuItem(d)}),{parentMenu:M,rootMenu:i,active:r,nsMenu:n,nsMenuItem:s,handleClick:f}}});function qe(t,o,a,i,n,s){const M=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(M,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var me=v._export_sfc(He,[["render",qe],["__file","menu-item.vue"]]);const Je={title:String},Xe="ElMenuItemGroup",Ke=e.defineComponent({name:Xe,props:Je,setup(){return{ns:v.useNamespace("menu-item-group")}}});function et(t,o,a,i,n,s){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var Ie=v._export_sfc(Ke,[["render",et],["__file","menu-item-group.vue"]]);const tt=v.withInstall(We,{MenuItem:me,MenuItemGroup:Ie,SubMenu:ue}),nt=v.withNoopInstall(me);v.withNoopInstall(Ie);v.withNoopInstall(ue);const ot={class:"st-kline-tips"},at={class:"st-kline-tips-row"},it=e.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,i=>(e.openBlock(),e.createElementBlock("div",{class:"st-kline-tips-row-item",style:e.normalizeStyle({color:i.color})},e.toDisplayString(i.label)+" "+e.toDisplayString(i.value),5))),256))])]))}});const ae=Z._export_sfc(it,[["__scopeId","data-v-78aed210"]]),lt=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(t,{emit:o}){const a=o,i=e.ref(),n=e.ref(),s=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{s.value.display="none",a("closeContextMenuCallBack"),document.removeEventListener("click",M)},u=l=>{if(l.preventDefault(),l.stopPropagation(),s.value.display==="block"){const{offsetX:r,offsetY:d}=l,{offsetWidth:f,offsetHeight:N}=n.value;if(r<=f&&d<=N)return}i.value.click(),s.value={display:"block",top:`${l.offsetY}px`,left:`${l.offsetX}px`},e.nextTick(()=>{const{bottom:r,height:d,right:f,width:N}=n.value.getBoundingClientRect();r>window.innerHeight?s.value={display:"block",top:`${l.offsetY-d}px`,left:`${l.offsetX}px`}:f>window.innerWidth&&(s.value={display:"block",top:`${l.offsetY}px`,left:`${l.offsetX-N}px`})}),document.addEventListener("click",M)};return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:i,class:"contextmenu",onContextmenu:u,onMouseleave:M},[e.renderSlot(l.$slots,"default",{},void 0,!0),s.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:n,class:"contextmenu-popover",style:e.normalizeStyle(s.value)},[e.renderSlot(l.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const st=Z._export_sfc(lt,[["__scopeId","data-v-249fd104"]]);let Ne=!1,ye=!0,ze=[];const ge=t=>{const o=[],a=[],i=[],n=[],s=[],M=[];return t.forEach((u,l)=>{o.push(u[0]),a.push(u[1]),i.push(u[4]),n.push(u[2]),s.push(u[3]),M.push([u[1],u[4],u[3],u[2],Number(u[6]),l===0?u[4]:t[l-1][4]])}),{time:o,open:a,close:i,high:n,low:s,kLineData:M}},rt=async()=>{if(!Ne)Ne=!0,await pe.init("./talib.wasm"),ye=!1,ze.forEach(t=>{t()});else if(ye)return new Promise(t=>{ze.push(t)})},J=(t,o)=>t.length>o?t.slice(t.length-o):t,ct=(t,o,a)=>t.calculationFn?t.calculationFn(pe.talib,o,a):new Array(o.time.length).fill(null),ut=async(t,o,a)=>{const i=ge(t);let n=[];return n=ge(n),await rt(),{originData:J(t,a),kLine:J(i.kLineData,a),time:J(i.time,a),indicator:o.config.reduce((s,M)=>(s.push({key:M.key,color:M.color,data:J(ct(M,i,n),a)}),s),[])}},ie="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjM4NzI1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2MjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTE5OC4wMTYgMTA5LjczODY2N0E3Ny44NjY2NjcgNzcuODY2NjY3IDAgMCAwIDE3MC42NjY2NjcgMTY3LjY4bDAuNTEyIDQxOC45NDRjMCAyMi44NjkzMzMgNi40IDQ4IDE5LjAyOTMzMyA3NS4zMDY2NjcgMT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AzNi42OTMzMzMtMTIuOGwyMTEuMTE0NjY3LTE4OC4xNmMxMy4zNTQ2NjctMTEuOTQ2NjY3IDI1LjMwMTMzMy0yOC44NDI2NjcgMzUuNjI2NjY2LTUxLjA3MiAxMC4xMTItMjEuNzYgMTQuNzYyNjY3LTQwLjUzMzMzMyAxNC41MDY2NjctNTcuMDAyNjY3TDgxMC42NjY2NjcgMTY3LjIxMDY2N2MwLTkuODk4NjY3LTMuNTg0LTE3LjYyMTMzMy0xMi41MDEzMzQtMjUuNkE1NC42OTg2NjcgNTQuNjk4NjY3IDAgMCAwIDc2MS42IDEyOGwtNDk5LjYyNjY2NyAwLjQ2OTMzM2E1MS4zMjggNTEuMzI4IDAgMCAwLTM1Ljc1NDY2NiAxMy4yNjkzMzQgMzYuNTY1MzMzIDM2LjU2NTMzMyAwIDAgMC0xMi41MDEzMzQgMjEuNTA0bC0wLjQyNjY2NiA0LjY5MzMzM3oiIGZpbGw9IiNBRTQ0RkYiIHAtaWQ9IjMwODAiPjwvcGF0aD48cGF0aCBkPSJNNDc1LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",H=(t,o)=>{const{type:a="log",color:i="black"}=o??{};localStorage.getItem("st-kline-console-show")==="true"&&console[a](`%c${t}`,`color:${i}`)},P=t=>t||t===0?Math.round(t*1e3)/1e3:null,Mt=t=>t>=1e12?`${(t/1e12).toFixed(2)}万亿`:t>=1e8?`${(t/1e8).toFixed(2)}亿`:t>=1e4?`${(t/1e4).toFixed(2)}万`:t.toFixed(2),dt=t=>{const{y:o,text:a,info:i,gridLeft:n,gridRight:s,echartsWidth:M,echartsInstance:u}=t,{config:l,event:r}=i;let d=0;return{type:"group",draggable:l.draggable?"vertical":!1,children:[{type:"line",info:i,shape:{x1:n,y1:o,x2:M-s,y2:o},style:{stroke:l.lineColor,lineWidth:1,lineDash:[8,4]},z:10},{type:"group",x:M,y:o-5,children:[{type:"text",left:-1*s,info:i,style:{fill:l.textColor,text:a,stroke:"#000",lineWidth:1,opacity:1},z:10}]}],onmouseover:f=>{r.onmouseover instanceof Function&&r.onmouseover(f,i)},onmouseout:f=>{r.onmouseout instanceof Function&&r.onmouseout(f,i)},ondragstart:f=>{r.ondragstart instanceof Function&&l.draggable&&(d=f.offsetY,r.ondragstart(f,i))},ondragend:f=>{if(r.ondragend instanceof Function&&l.draggable){const g=f.offsetY-d;if(g===0)return;const D=u.convertFromPixel({yAxisIndex:0},o+g);r.ondragend(f,i,D)}}}},Nt=t=>{const{y:o,text:a,info:i,gridLeft:n,gridRight:s,echartsWidth:M,echartsInstance:u}=t,{config:l,event:r}=i;let d=0;const f=g=>{let D=null;g.target.type==="line"?D=g.target.parent:g.target.type==="tspan"&&(D=g.target.parent.parent.parent),D.children()[1].children()[0].animate("style",!1).when(200,{opacity:1}).start()},N=g=>{let D=null;g.target.type==="line"?D=g.target.parent:g.target.type==="tspan"&&(D=g.target.parent.parent.parent),D.children()[1].children()[0].animate("style",!1).when(200,{opacity:0}).start()};return{type:"group",draggable:l.draggable?"vertical":!1,children:[{type:"line",info:i,shape:{x1:n,y1:o,x2:M-s,y2:o},style:{stroke:l.lineColor,lineWidth:1},z:10},{type:"group",x:M/2,y:o-5,children:[{type:"text",left:"center",info:i,style:{fill:l.textColor,text:a,stroke:"#000",lineWidth:1,opacity:0},z:10}]}],onmouseover:g=>{r.onmouseover instanceof Function?r.onmouseover(g,i):f(g)},onmouseout:g=>{r.onmouseout instanceof Function?r.onmouseout(g,i):N(g)},ondragstart:g=>{r.ondragstart instanceof Function&&l.draggable&&(d=g.offsetY,r.ondragstart(g,i))},ondragend:g=>{if(r.ondragend instanceof Function&&l.draggable){const y=g.offsetY-d;if(y===0)return;const x=u.convertFromPixel({yAxisIndex:0},o+y);r.ondragend(g,i,x)}}}},yt=t=>{const{y:o,text:a,profitY:i,profitText:n,lossY:s,lossText:M,info:u,gridLeft:l,gridRight:r,echartsWidth:d,echartsInstance:f}=t,{config:N,event:g}=u;let D=0,y=null,x=null;const b=(p,T)=>{var m,Y,A,E;(m=p.children()[2])==null||m.animate("style",!1).when(200,{opacity:~~T}).start(),(Y=p.children()[3].children()[0])==null||Y.animate("style",!1).when(200,{opacity:~~T}).start(),(A=p.children()[4])==null||A.animate("style",!1).when(200,{opacity:~~T}).start(),(E=p.children()[5].children()[0])==null||E.animate("style",!1).when(200,{opacity:~~T}).start()},k=p=>{let T=null;p.target.type==="line"?T=p.target.parent:p.target.type==="tspan"&&(T=p.target.parent.parent.parent),y=m=>{m.preventDefault(),(m.code==="AltLeft"||m.code==="AltRight")&&b(T,!0)},x=m=>{(m.code==="AltLeft"||m.code==="AltRight")&&b(T,!1)},window.addEventListener("keydown",y),window.addEventListener("keyup",x)},_=p=>{let T=null;p.target.type==="line"?T=p.target.parent:p.target.type==="tspan"&&(T=p.target.parent.parent.parent),b(T,!1),window.removeEventListener("keydown",y),window.removeEventListener("keyup",x)};return{type:"group",draggable:N.draggable?"vertical":!1,children:[{type:"line",info:u,shape:{x1:l,y1:o,x2:d-r,y2:o},style:{stroke:N.lineColor,lineWidth:1},z:10},{type:"group",x:d/2,y:o-5,children:[{type:"text",left:"center",info:u,style:{fill:N.textColor,text:a,stroke:"#000",lineWidth:1,opacity:1},z:10}]},{type:"line",info:u,shape:{x1:l,y1:i,x2:d-r,y2:i},style:{stroke:N.profitLineColor,lineWidth:1,lineDash:[8,4],opacity:0},z:10},{type:"group",x:d/2,y:i-5,children:[{type:"text",left:"center",info:u,style:{fill:N.profitTextColor,text:n,stroke:"#000",lineWidth:1,opacity:0},z:10}]},{type:"line",info:u,shape:{x1:l,y1:s,x2:d-r,y2:s},style:{stroke:N.lossLineColor,lineWidth:1,lineDash:[8,4],opacity:0},z:10},{type:"group",x:d/2,y:s-5,children:[{type:"text",left:"center",info:u,style:{fill:N.lossTextColor,text:M,stroke:"#000",lineWidth:1,opacity:0},z:10}]}],onmouseover:p=>{g.onmouseover instanceof Function?g.onmouseover(p,u):k(p)},onmouseout:p=>{g.onmouseout instanceof Function?g.onmouseout(p,u):_(p)},ondragstart:p=>{g.ondragstart instanceof Function&&N.draggable&&(D=p.offsetY,g.ondragstart(p,u))},ondragend:p=>{if(g.ondragend instanceof Function&&N.draggable){const m=p.offsetY-D;if(m===0)return;const Y=f.convertFromPixel({yAxisIndex:0},o+m);g.ondragend(p,u,Y)}}}},K=(t,o)=>{const{direction:a="",tradeAction:i="",tradeType:n=""}=t;if(o==="sellBuy"){const s=n??a+i;return new Map([["开多","买"],["平多","卖"],["开空","卖"],["平空","买"]]).get(s)}else if(o==="openClose")return n??a+i},zt=(t,o)=>t.reduce((a,i)=>{var d;const n=K(i,"sellBuy"),s=t.filter(f=>f.time===i.time);let M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href;s.length>1?[...new Set(s.map(N=>K(N,"sellBuy")))].length>1?M="image://"+new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjI4MjAyIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjMwNzgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWln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YgMTQuNzYyNjY3LTQwLjUzMzMzMyAxNC41MDY2NjctNTcuMDAyNjY3TDgxMC42NjY2NjcgMTY3LjIxMDY2N2MwLTkuODk4NjY3LTMuNTg0LTE3LjYyMTMzMy0xMi41MDEzMzQtMjUuNkE1NC42OTg2NjcgNTQuNjk4NjY3IDAgMCAwIDc2MS42IDEyOGwtNDk5LjYyNjY2NyAwLjQ2OTMzM2E1MS4zMjggNTEuMzI4IDAgMCAwLTM1Ljc1NDY2NiAxMy4yNjkzMzQgMzYuNTY1MzMzIDM2LjU2NTMzMyAwIDAgMC0xMi41MDEzMzQgMjEuNTA0bC0wLjQyNjY2NiA0LjY5MzMzM3oiIGZpbGw9IiNBRTQ0RkYiIHAtaWQ9IjMwODAiPjwvcGF0aD48cGF0aCBkPSJNNDc1LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",self.location).href:M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href:M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href;const l=(o.find(f=>f[0]===i.time)??[])[2],r=((d=i==null?void 0:i.markLineTarget)==null?void 0:d.map(f=>{const N=i.time,g=l+"",D=f.time,y=o.find(b=>b[0]===f.time),x=y?y[3]:null;return[{coord:[N,g],lineStyle:f.lineStyle},{coord:[D,x]}]}))??null;return a.push({symbol:M,symbolSize:25,animation:!1,coord:[i.time+"",l],symbolRotate:0,symbolOffset:[0,"-7"],markLineTarget:r}),a},[]),gt=(t,o)=>t.reduce((a,i,n)=>{var f;const s=K(i,"openClose"),M=s==="开多"||s==="开空"?"top":"bottom",u=o.find(N=>N[0]===i.time)??[],l=M==="top"?u[2]:u[3];let r=7;r+=t.slice(0,n).filter(N=>{const g=K(N,"openClose");return(g==="开多"||g==="开空"?"top":"bottom")===M&&N.time===i.time}).length*7;const d=((f=i==null?void 0:i.markLineTarget)==null?void 0:f.map(N=>{const g=i.time,D=l+"",y=N.time,x=o.find(b=>b[0]===N.time)[3];return[{coord:[g,D],lineStyle:N.lineStyle},{coord:[y,x]}]}))??null;return a.push({symbol:"triangle",symbolSize:[10,12],animation:!1,coord:[i.time+"",l],symbolRotate:M==="top"?180:0,symbolOffset:[0,`${M==="top"?r*-1:r}`],itemStyle:{color:M==="top"?"#FF0000":"#389e0d"},label:{show:!0,position:M,color:"#fff",formatter:`${s} ${M==="top"?"+":"-"} ${i.amount}手 ${i.part?`(${i.part}份)`:""}`},markLineTarget:d}),a},[]),jt=(t,o)=>t.reduce((a,i)=>{const{key:n,data:s}=i;if(s===null||s.length===0)return a;const u=new Map([["sellBuy",()=>zt(s,o)],["openClose",()=>gt(s,o)],["signal",()=>{}]]).get(n);return u instanceof Function&&a.push(...u()),a},[]),re=async(t,o,a,i,n,s)=>{const{totalBarCount:M,defaultShowBarCount:u,maxValueSpan:l,gridLeft:r,gridTop:d,gridRight:f,gridBottom:N,zoomLock:g}=i,{time:D,kLine:y,originData:x,indicator:b}=await ut(t,a,M),k=b.map(T=>{const{key:m,data:Y,color:A}=T;return{name:m,type:"line",silent:!0,symbol:"none",data:Y,lineStyle:{width:1},itemStyle:{color:A}}}),_=jt(o,x);let p=[];return _.forEach(T=>{T.markLineTarget&&(p=[...p,...T.markLineTarget])}),{animation:!1,dataset:{id:"data",source:{klineData:y,indicatorData:b}},grid:{left:`${r}px`,top:`${d}px`,right:`${f}px`,bottom:`${N}px`},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{formatter:T=>{const{axisDimension:m,value:Y}=T;return m==="x"?Y:String(P(Y))}}},formatter:T=>{let m=null,Y="";return T.forEach(A=>{A.seriesName==="资产持仓净值"&&A.data!==null&&(Y+=`<div>资产持仓净值: ${A.data}</div>`),A.componentSubType==="candlestick"&&o.forEach(E=>{const{key:F,data:U}=E;if(F==="sellBuy"){const Q=U.filter(j=>j.time===A.axisValue);let $=0,I=0;Q.forEach(j=>{j.tradeType==="开多"||j.tradeType==="平空"?$+=j.amount:I+=j.amount}),$&&(Y+=`<div>买: ${$}</div>`),I&&(Y+=`<div>卖: ${I}</div>`)}F==="openClose"&&U.forEach(Q=>{Q.time===A.axisValue&&(Y+=Q.tooltip)})}),Y&&(m=`<div><span style="font-weight: bold;">${A.axisValue}</span>${Y}</div>`)}),m}},xAxis:{type:"category",data:D,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},axisLabel:{show:!0,formatter:T=>T}},yAxis:[{index:0,splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:T=>{const{min:m,max:Y}=T,A=Math.abs((Y-m)/10);return m-A},max:T=>{const{min:m,max:Y}=T,A=Math.abs((Y-m)/10);return Y+A},axisLine:{show:!0},axisLabel:{formatter:T=>P(T),showMaxLabel:!1}},{show:!1,min:"dataMin"}],dataZoom:[{type:"inside",xAxisIndex:[0,0],zoomLock:g,maxValueSpan:l,start:y.length>=u?(y.length-u)/y.length*100:0,end:99.99}],series:[{name:"k线",type:"candlestick",data:y,markPoint:{data:_},markLine:{position:"middle",textStyle:{color:"blue",fontSize:15},animation:!1,data:p,lineStyle:{width:3,type:"solid"},symbol:["none","none"]},itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1},z:1},...k,{name:"资产持仓净值",type:"line",data:n??[],symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:"#666"}},{name:"二腿相关度",type:"line",data:s??[],symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:"#FFF"},lineStyle:{width:2},label:{show:!0,position:"top",formatter:T=>`相关度: ${T.data[1]}`,textStyle:{color:"#FFF",fontSize:14}}}],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:1},brushStyle:{color:"rgba(120,140,180,0)",borderColor:"rgba(255,255,255,0.4)"}}}},pt=(t,o,a)=>{var f;const{gridLeft:i,gridRight:n,gridBottom:s,warningConfig:M,positionConfig:u,conditionConfig:l,isOpenDS:r}=o;let d=[];if((f=a==null?void 0:a.getModel())!=null&&f.getComponent){const[N,g]=a.getModel().getComponent("yAxis").axis.scale._extent;let D=[],y={},x=[],b={},k=[],_={};if(t.forEach(({key:p,data:T,...m})=>{p==="warning"?(D=T,y=m):p==="position"?(x=T,b=m):p==="condition"&&(k=T,_=m)}),D.length>0&&(d=D.reduce((p,T)=>{const{value:m,text:Y,info:A,config:E}=T;if(m>g||m<N)return p;const F={y:a.convertToPixel({yAxisIndex:0},m),text:Y,info:{info:A,config:{...M,...E},event:{...y}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,dt(F)]},d)),x.length>0&&(d=x.reduce((p,T)=>{const{value:m,text:Y,info:A,config:E}=T;if(m>g||m<N)return p;const F={y:a.convertToPixel({yAxisIndex:0},m),text:Y,info:{info:A,config:{...u,...E},event:{...b}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,Nt(F)]},d)),k.length>0&&(d=k.reduce((p,T)=>{const{value:m,text:Y,profitValue:A,profitText:E,lossValue:F,lossText:U,info:Q,config:$}=T;if(m>g||m<N)return p;const I={y:a.convertToPixel({yAxisIndex:0},m),text:Y,profitY:a.convertToPixel({yAxisIndex:0},A),profitText:E,lossY:a.convertToPixel({yAxisIndex:0},F),lossText:U,info:{info:Q,config:{...l,...$},event:{..._}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,yt(I)]},d)),r){const p=a.getOption(),T=p.dataset[0].source.klineData.slice(p.dataZoom[0].startValue,p.dataZoom[0].endValue+1),m={};T.forEach(I=>{m[I[1]]?m[I[1]]+=1:m[I[1]]=1});const Y=T[T.length-1][1],A=T.reduce((I,j)=>I+j[1],0)/T.length,E=Y-A,F=Tt(T,1,50),U=mt(T),Q=U?E/U:0,$=ft(T,1,Y);d=[...d,{type:"group",draggable:!1,children:Object.keys(m).map(I=>({type:"line",shape:{x1:a.getWidth()-n-100*m[I],y1:a.convertToPixel({yAxisIndex:0},I),x2:a.getWidth()-n,y2:a.convertToPixel({yAxisIndex:0},I)},style:{stroke:"rgb(124,124,124)",lineWidth:1},z:10}))},{type:"text",x:i+6,y:a.getHeight()-s-20,style:{fill:"#FFF",text:`均值: ${P(A)} 距均值: ${P(E)} 中值: ${P(F)} 标准差: ${P(U)} 距均值/标准差: ${P(Q)} 百分位: ${P($)}%`,lineWidth:1,opacity:1},z:10}]}}return{elements:d}},ft=(t,o,a)=>{const{round:i,add:n,subtract:s,multiply:M,divide:u}=ee.x,l=t.map(d=>d[o]).sort((d,f)=>d-f);let r=0;for(let d=0;d<l.length;d++)if(l[d]===a){r=d;break}else if(l[d]>=a){r=n(d,u(s(l[d+1],l[d]),l[d]));break}return i(u(M(r,100),t.length+1))},Tt=(t,o,a)=>{const{round:i,add:n,subtract:s,multiply:M,divide:u}=ee.x,l=t.map(N=>N[o]).sort((N,g)=>N-g),r=M(t.length+1,u(a,100)),d=Math.floor(r),f=s(r,d);return i(f===0?l[r]:n(l[d],M(s(l[d>=t.length-1?d:d+1],l[d]),f)))};function mt(t){const o=t.map(M=>M[1]),a=o.length;let i=0,n=0;for(const M of o)i+=M;const s=i/a;for(const M of o)n+=Math.pow(M-s,2);return Math.sqrt(n/a)}const It={class:"st-kline"},Dt={class:"st-kline-header"},Lt=300,ht=e.defineComponent({__name:"index",props:{indicator:{type:Object,default:()=>({})},klineData:{type:Array,default:()=>[]},markData:{type:Array,default:()=>[]},lineData:{type:Array,default:()=>[]},netPositionData:{type:Array,default:()=>[]},relevanceData:{type:Array,default:()=>[]},priceTrendData:{type:Array,default:()=>[]},priceTrendPercentData:{type:Array,default:()=>[]},brushRange:{type:Array,default:()=>[]},defaultMenuData:{type:Array,default:()=>[]},isSelect:{type:Boolean,default:()=>!1},config:{type:Object,default:()=>({})}},setup(t){const o=t,a={totalBarCount:2e3,defaultShowBarCount:200,preBarCount:800,maxValueSpan:1e4,gridLeft:60,gridTop:0,gridRight:60,gridBottom:30,warningConfig:{draggable:!1,lineColor:"#fff",textColor:"#fff"},positionConfig:{draggable:!1,lineColor:"#e45d07",textColor:"#fff"},conditionConfig:{draggable:!1,lineColor:"#fff",textColor:"#fff",profitLineColor:"#b71e44",profitTextColor:"#fff",lossLineColor:"#749b66",lossTextColor:"#fff"},tipsConfig:{open:!0,heigh:!0,low:!0,close:!0,business:!0,riseAndFall:!0},dynamicLoadConfig:{historyVisible:!1,historyLoadCallBack:()=>{},futureVisible:!1,futureLoadCallBack:()=>{}},zoomLock:!1,isOpenDS:!1},i=e.computed(()=>({...a,...o.config})),n=e.ref(null),s=e.ref(-1),M=e.computed(()=>{var I,j;if(n.value&&((j=(I=n.value.dataset[0])==null?void 0:I.source)!=null&&j.klineData[s.value])){const z=n.value.dataset[0].source.klineData[s.value],c=[],{open:h,heigh:C,low:L,close:w,business:O,riseAndFall:S}=i.value.tipsConfig;if(h&&c.push({label:"开",value:P(z[0]),color:"rgb(153, 153, 153)"}),C&&c.push({label:"高",value:P(z[3]),color:"rgb(153, 153, 153)"}),L&&c.push({label:"低",value:P(z[2]),color:"rgb(153, 153, 153)"}),w&&c.push({label:"收",value:P(z[1]),color:"rgb(153, 153, 153)"}),O&&c.push({label:"额",value:Mt(z[4]),color:"rgb(153, 153, 153)"}),S){let V=((z[1]-z[5])/z[1]*100).toFixed(2),B=+V==0?"white":+V>0?"red":"#00ff00";c.push({label:"涨跌",value:`${V}%`,color:B})}return c}return[]}),u=e.computed(()=>{var I,j;return n.value&&((j=(I=n.value.dataset[0])==null?void 0:I.source)!=null&&j.indicatorData)?n.value.dataset[0].source.indicatorData.reduce((z,c)=>(c.data[s.value]&&z.push({label:c.key,value:P(c.data[s.value]),color:c.color}),z),[]):[]}),l=e.computed(()=>{const I=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"];if(o.priceTrendData.length>0){const j=[];return o.priceTrendData.forEach((z,c)=>{var C;(z.data[s.value]?P(z.data[s.value][1]):null)!==null&&j.push({label:z.name,value:P((C=z.data[s.value])==null?void 0:C[1]),color:I[c]})}),j}if(o.priceTrendPercentData.length>0){const j=[];return y.getOption().series.filter(c=>c.name.includes("二腿价格走势百分比图")).forEach((c,h)=>{var L;(c.data[s.value]?P(c.data[s.value][1]):null)!==null&&j.push({label:c.name.split("-")[1],value:`${P((L=c.data[s.value])==null?void 0:L[1])}%`,color:I[h]})}),j}return[]});e.watch(()=>[o.klineData,o.indicator,o.markData,o.netPositionData,o.relevanceData],()=>{r()},{deep:!0}),e.watch(()=>o.lineData,async()=>{H("st-kline组件消息:props.lineData监控,额外画线数据发生改变,重绘->line",{color:"red"}),r("line")},{deep:!0}),e.watch(()=>o.brushRange,async()=>{H("st-kline组件消息:props.brushRange监控,区域刷选数据发生改变,重绘->brush",{color:"red"}),r("brush")},{deep:!0}),e.watch(()=>o.priceTrendData,async()=>{r("priceTrend")},{deep:!0}),e.watch(()=>o.priceTrendPercentData,async()=>{r("priceTrendPercent")},{deep:!0});const r=async I=>{const z=new Map([["kline",async()=>{const c=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData),{graphic:h}=y.getOption()??{graphic:[]};n.value={...c,graphic:h},y.setOption(n.value,!0),H("st-kline组件消息:K线绘制完毕-draw",{color:"green"})}],["line",()=>{const c=y.getOption(),h=pt(o.lineData,i.value,y);n.value={...c,graphic:h},y.setOption(n.value,{replaceMerge:["graphic"]}),H("st-kline组件消息:额外画线绘制完毕-draw",{color:"green"})}],["brush",()=>{const{brushRange:c}=o;c instanceof Array&&c.length>0&&(y.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[c[0]+"",c[1]+""],xAxisIndex:0}]}),H("st-kline组件消息:区域刷选绘制完毕-draw",{color:"green"}))}],[void 0,async()=>{await r("kline"),await r("line"),await r("priceTrend"),await r("priceTrendPercent"),await r("brush")}],["history",async()=>{const c=y.getOption(),h=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData),C=h.dataset.source.klineData.length-c.dataset[0].source.klineData.length;y.setOption({...h,dataZoom:[{type:"inside",xAxisIndex:[0,0],zoomLock:i.value.zoomLock,maxValueSpan:i.value.maxValueSpan,startValue:c.dataZoom[0].startValue+C,endValue:c.dataZoom[0].endValue+C}]},!0),await r("priceTrend")}],["future",async()=>{const c=y.getOption(),h=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData);h.dataZoom[0].start=(o.klineData.length-c.dataZoom[0].endValue+c.dataZoom[0].startValue)/o.klineData.length*100,y.setOption(h,!0),await r("priceTrend")}],["priceTrend",()=>{if(o.priceTrendData.length===0)return;const c=y.getOption(),h=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"],C=o.priceTrendData.reduce((L,w,O)=>{const{name:S,data:V}=w,B={name:`二腿价格走势图-${S}`,type:"line",data:V,symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:h[O]},lineStyle:{type:"dashed",width:1}};return L.push(B),L},[]);n.value={...c,series:[...c.series,...C]},y.setOption(n.value,{replaceMerge:["series"]})}],["priceTrendPercent",async()=>{if(o.priceTrendPercentData.length===0)return;const c=y.getOption(),h=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"],C=c.dataZoom[0].startValue,L=o.priceTrendPercentData.reduce((w,O,S)=>{const{name:V,data:B}=O,G=B.length>i.value.totalBarCount?B.slice(B.length-i.value.totalBarCount):B,q=G[C][1],De=G.map(Me=>[Me[0],(Me[1]-q)/q*100]),Le={name:`二腿价格走势百分比图-${V}`,type:"line",data:De,symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:h[S]},lineStyle:{type:"dashed",width:1}};return w.push(Le),w},[]);c.series=[...c.series.filter(w=>!w.name.includes("二腿价格走势百分比图")),...L],y.setOption(c,!0)}]]).get(I);z instanceof Function&&await z()},d=e.ref(!1),f=e.ref([]),N=I=>{const{callBack:j}=I;j instanceof Function&&j(y,d)},g=()=>{f.value=o.defaultMenuData},D=e.ref();let y,x;const b=(I,j)=>{var z,c;if(I)s.value=typeof((z=I==null?void 0:I.batch[0])==null?void 0:z.dataIndex)=="number"?(c=I==null?void 0:I.batch[0])==null?void 0:c.dataIndex:-1;else{const h=j.getOption();h.dataZoom instanceof Array&&(s.value=h.dataZoom[0].endValue)}};let k=null,_=!1,p=e.ref(!1),T=!1,m=e.ref(!1);const Y=async I=>{const j=I.batch?I.batch[0].start*i.value.totalBarCount:I.startValue;i.value.dynamicLoadConfig.historyVisible&&j<=100&&!_&&!p.value&&(_=!0,await i.value.dynamicLoadConfig.historyLoadCallBack(p),await r("history"),_=!1);const z=I.batch?I.batch[0].end===100:I.endValue>=o.klineData.length-i.value.preBarCount-1,c=I.actionIsWheel;i.value.dynamicLoadConfig.futureVisible&&z&&!T&&!m.value&&!c&&(T=!0,await i.value.dynamicLoadConfig.futureLoadCallBack(m),await r("future"),T=!1),clearTimeout(k),k=setTimeout(()=>{r("line"),r("priceTrendPercent"),clearTimeout(k),k=null},Lt)};let A=null;const E=I=>{A=setTimeout(()=>{var j;if(I.componentType==="graphic"){const{oncontextmenu:z}=((j=I.info)==null?void 0:j.event)??{};z instanceof Function&&z(I,I.info,f)}clearTimeout(A),A=null})},F=()=>{y.on("highlight",I=>{b(I,y)}),y.on("globalout",()=>{b(null,y)}),y.on("contextmenu",I=>{E(I)}),y.on("datazoom",I=>{Y(I)})},U=()=>{y.off("highlight"),y.off("globalout"),y.off("contextmenu"),y.off("datazoom")},Q=I=>{if(!y||!(I.ctrlKey||o.isSelect))return;const j=y.getOption();let{startValue:z,endValue:c,start:h,end:C}=j.dataZoom[0];const L=()=>{z!==0&&(z=z-1,c=c-1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan}))},w=()=>{if(i.value.dynamicLoadConfig.futureVisible&&!T&&!m.value)z=z+1,c=c+1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan});else{if(c===j.xAxis[0].data.length-1)return;z=z+1,c=c+1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan})}},O=()=>{if(c-z<5)return;const G=Math.floor((s.value-z)/2)+1,q=Math.floor((c-s.value)/2)+1;z=z+G,c=c-q,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,actionIsWheel:!0,maxValueSpan:i.value.maxValueSpan})},S=()=>{h=h-(C-h)/4,y.dispatchAction({type:"dataZoom",start:h,end:C,actionIsWheel:!0,maxValueSpan:i.value.maxValueSpan})},B=new Map([["ArrowLeft",L],["ArrowRight",w],["ArrowUp",O],["ArrowDown",S]]).get(I.code);B instanceof Function&&B()},$=async()=>{let I=!0;y=X.init(D.value),await r(),f.value=o.defaultMenuData,s.value=y.getOption().dataZoom[0].endValue??-1,F(),x=new ResizeObserver(()=>{if(I){I=null;return}y.resize(),r("line")}),x.observe(D.value),window.addEventListener("keydown",Q)};return e.onMounted(()=>{$()}),e.onUnmounted(()=>{U(),window.removeEventListener("keydown",Q),y.dispose(),x.disconnect(),x=null}),(I,j)=>{const z=nt,c=tt;return e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Dt,[e.createVNode(ae,{data:M.value},null,8,["data"]),e.createVNode(ae,{data:u.value},null,8,["data"]),e.createVNode(ae,{data:l.value},null,8,["data"])]),e.createVNode(st,{class:"st-kline-body",onCloseContextMenuCallBack:g},{popover:e.withCtx(()=>[e.createVNode(c,{class:"menu"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,h=>(e.openBlock(),e.createBlock(z,{key:h.label,index:h.label,class:"menuItem",onClick:C=>N(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"echartsRef",ref:D,class:e.normalizeClass(d.value?"st-kline-chart cursorPen":"st-kline-chart")},null,2)]),_:1})])}}});const vt=Z._export_sfc(ht,[["__scopeId","data-v-7f014d0e"]]),xt={class:"kline-tips"},Yt=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"kline-tips-item",style:e.normalizeStyle({color:i.color})},e.toDisplayString(i.label)+" "+e.toDisplayString(i.value),5))),128))]))}});const ce=Z._export_sfc(Yt,[["__scopeId","data-v-dc7d381b"]]);const At={class:"klineSub"},Ct={class:"klineSub-tips"},wt={key:0,class:"klineSub-tips-select"},bt={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(t,{expose:o,emit:a}){const{round:i}=ee.x;let n,s;const M=a,u=t,l=e.ref(),r=e.computed({get(){return u.modelValue},set(N){M("update:modelValue",N)}}),d=e.computed(()=>{var D;const{data:N,activeIndex:g}=u;return((D=N==null?void 0:N.subIndicator)==null?void 0:D.map(y=>({label:y.key,color:y.color,value:y.data[g]||"-"})))||[]});e.onMounted(()=>{n=X.init(l.value);let N=!0;s=new ResizeObserver(()=>{if(N){N=null;return}n.resize()}),s.observe(l.value)}),e.onUnmounted(()=>{n.dispose(),s.disconnect(),s=null});const f=(N,g)=>{const D=N[g],y=g===0?N[g]:N[g-1];return D[0]===D[1]?D[0]>=y[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:D[1]>D[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return o({connect:N=>{X.connect([N,n])},draw:(N,g)=>{e.nextTick(()=>{const{startValue:D,endValue:y,maxValueSpan:x}=N,{leftYAxisRange:b,rightYAxisRange:k}=u.data.subIndicator[0],_=u.data.subIndicator.map(p=>{if(p.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:p.data.map((T,m)=>p.seriesColor==="kline"?{value:T,itemStyle:f(u.data.data,m)}:p.seriesColor==="value"?{value:T,itemStyle:{color:T>=0?"#FF0000":"#00FFFF"}}:{value:T,itemStyle:{color:p.seriesColor}})};if(p.series==="line")return{xAxisIndex:0,yAxisIndex:p.yAxis==="right"?2:1,name:p.key,type:"line",silent:!0,symbol:"none",data:p.data,lineStyle:{width:1},itemStyle:{color:p.color}}});n.setOption({animation:!1,grid:{left:`${g.gridLeft}px`,top:"10px",right:`${g.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:D,endValue:y,maxValueSpan:x}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:p=>{const{axisDimension:T,value:m}=p;if(T==="x")return m;if(p.axisIndex===1)return String(i(m))}}},formatter:()=>""},xAxis:{type:"category",data:u.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:p=>p}},yAxis:[{position:"right"},{position:"left",min:b==="cover"?p=>p.min:null,max:b==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:k==="cover"?p=>p.min:null,max:k==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:_},!0)})}}),(N,g)=>{const D=de.ElOption,y=de.ElSelect;return e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Ct,[d.value.length?(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(y,{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=x=>r.value=x),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subIndicatorList,x=>(e.openBlock(),e.createBlock(D,{key:x.value,label:x.label,value:x.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(ce,{data:d.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:l},null,512)])}}},kt=Z._export_sfc(bt,[["__scopeId","data-v-aba58678"]]);const Ot={class:"kline-tips"},Et={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(t){const{round:o,formatValue:a}=ee.x,i=t,n=e.computed(()=>{const{data:M,activeIndex:u}=i;if(M.data&&M.data[u]){const l=M.data[u],r=[{label:"开",value:o(l[0])},{label:"高",value:o(l[3])},{label:"低",value:o(l[2])},{label:"收",value:o(l[1])}];l[4]!==null&&r.push({label:"额",value:a(l[4])});let d;return l[6]>0?d="red":l[6]<0&&(d="green"),r.push({label:"涨跌",value:`${o(l[6])}%`,color:d}),r}return[]}),s=e.computed(()=>{var l;const{data:M,activeIndex:u}=i;return((l=M==null?void 0:M.mainIndicator)==null?void 0:l.map(r=>({label:r.key,value:o(r.data[u]),color:r.color})))||[]});return(M,u)=>(e.openBlock(),e.createElementBlock("div",Ot,[e.createVNode(ce,{data:n.value},null,8,["data"]),e.createVNode(ce,{data:s.value},null,8,["data"])]))}},St=Z._export_sfc(Et,[["__scopeId","data-v-a12855fe"]]),_t={__name:"index",setup(t,{expose:o}){return o({handleKeyDown:(a,i)=>{let{startValue:n,endValue:s,maxIndex:M}=i;if(a.code==="ArrowLeft"){if(n===0)return;n=n-1,s=s-1}else if(a.code==="ArrowRight"){if(s===M)return;n=n+1,s=s+1}else if(a.code==="ArrowUp"){if(s-n<5)return;const u=Math.floor((s-n)/2)+1;n=n+u,s-n<5&&(n=s-4)}else if(a.code==="ArrowDown"){const u=Math.min(500,s-n);n=n-u-1}return{startValue:n,endValue:s}},mergeData:(a,i)=>({time:[...a.time,...i.time.slice(1)],data:[...a.data,...i.data.slice(1)],mainIndicator:a.mainIndicator.map((n,s)=>({...n,data:[...n.data,...i.mainIndicator[s].data.slice(1)]})),subIndicator:a.subIndicator.map((n,s)=>({...n,data:[...n.data,...i.subIndicator[s].data.slice(1)]}))}),getDataZoomInfoByTime:a=>{const{showStartTime:i,showEndTime:n,maxShowDays:s}=a;let M=-1,u=-1,l={};return a.time.forEach((r,d)=>{const f=r.split(" ")[0];l[f]=l[f]||0,l[f]+=1,M===-1&&new Date(r)>=new Date(i)&&(M=d),u===-1&&new Date(r)>=new Date(n)&&(u=d)}),u=u===-1?a.time.length-1:u,{startValue:M,endValue:u,maxValueSpan:Math.max(...Object.values(l))*s}}}),(a,i)=>null}};const Ft={__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(t,{expose:o,emit:a}){let i,n,s=null;const M=a,u=t,l=e.ref();e.watch(()=>u.data,()=>{f()},{deep:!0}),e.onMounted(()=>{i=X.init(l.value),r(),f();let N=!0;n=new ResizeObserver(()=>{if(N){N=null;return}i.resize()}),n.observe(l.value)}),e.onUnmounted(()=>{i.off("datazoom"),i.dispose(),n.disconnect(),n=null});const r=()=>{i.on("datazoom",N=>{N.dataZoomId&&(clearTimeout(s),s=setTimeout(()=>{const{data:g}=u,{start:D,end:y}=N,x=Math.floor(D*g.length/100),b=y===100?g.length-1:Math.floor(y*g.length/100);d(x,b),clearTimeout(s)},100))})},d=(N,g)=>{const D=u.data;if(D.length===0)return;const y=D[N][0].split(" ")[0],x=D[g][0].split(" ")[0];M("change",{startTime:`${y} 00:00:00`,endTime:`${x} 24:00:00`})},f=()=>{const{data:N}=u;if(N.length===0)return;const g=N.map(y=>y[0].split(" ")[0]),D=N.map(y=>y[1]);i.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:g,show:!1},yAxis:{type:"value"},series:[{data:D,type:"line"}]},!0)};return o({resetSlide:(N,g,D)=>{let y=-1,x=-1;u.data.forEach((b,k)=>{y===-1&&b[0]===N?y=k:y===-1&&new Date(b[0])>new Date(N)&&(y=k-1),(x===-1&&b[0]===g||x===-1&&new Date(b[0])>new Date(g))&&(x=k)}),x=x===-1?u.data.length-1:x,i.setOption({dataZoom:[{show:!0,startValue:y,endValue:x,maxValueSpan:D,textStyle:{color:"#ccc"}},{type:"inside",startValue:y,endValue:x,maxValueSpan:D}]})},resize:()=>{i==null||i.resize()}}),(N,g)=>(e.openBlock(),e.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:l},null,512))}},Qt=Z._export_sfc(Ft,[["__scopeId","data-v-7a2f3dd0"]]),Bt={install(t){t.component("st-kline",vt),t.component("st-kline-sub-new",kt),t.component("st-kline-tips-new",St),t.component("st-kline-slide-new",Qt),t.component("st-kline-utils-new",_t)}};module.exports=Bt;
|
|
1
|
+
"use strict";const v=require("./base-ec05f348.cjs");require("./el-tooltip-0ea8fbf8.cjs");const je=require("./el-popper-f62316cd.cjs"),e=require("vue"),he=require("echarts"),Z=require("./_plugin-vue_export-helper-f246444f.cjs"),ee=require("./index-dc273ea2.cjs"),pe=require("./index.esm-94a95a2a.cjs"),ve=require("./el-scrollbar-d1c3e7f7.cjs"),W=require("./use-form-common-props-1b84d8f4.cjs"),R=require("./index-e1e83173.cjs"),xe=require("./index-eea0bcb3.cjs"),Ye=require("./el-tag-3b03d13e.cjs"),Ae=require("./typescript-b63f8e83.cjs"),Ce=require("./vnode-7fbc61e1.cjs"),de=require("./el-select-928f8c19.cjs");require("./index-80a2b137.cjs");require("./castArray-a45823fe.cjs");require("./event-61f49698.cjs");require("./scroll-41224831.cjs");require("./debounce-b2ff12bd.cjs");function we(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const X=we(he),be=e.defineComponent({name:"ElCollapseTransition"}),ke=e.defineComponent({...be,setup(t){const o=v.useNamespace("collapse-transition"),a=n=>{n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom},i={beforeEnter(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.style.height&&(n.dataset.elExistsHeight=n.style.height),n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0},enter(n){requestAnimationFrame(()=>{n.dataset.oldOverflow=n.style.overflow,n.dataset.elExistsHeight?n.style.maxHeight=n.dataset.elExistsHeight:n.scrollHeight!==0?n.style.maxHeight=`${n.scrollHeight}px`:n.style.maxHeight=0,n.style.paddingTop=n.dataset.oldPaddingTop,n.style.paddingBottom=n.dataset.oldPaddingBottom,n.style.overflow="hidden"})},afterEnter(n){n.style.maxHeight="",n.style.overflow=n.dataset.oldOverflow},enterCancelled(n){a(n)},beforeLeave(n){n.dataset||(n.dataset={}),n.dataset.oldPaddingTop=n.style.paddingTop,n.dataset.oldPaddingBottom=n.style.paddingBottom,n.dataset.oldOverflow=n.style.overflow,n.style.maxHeight=`${n.scrollHeight}px`,n.style.overflow="hidden"},leave(n){n.scrollHeight!==0&&(n.style.maxHeight=0,n.style.paddingTop=0,n.style.paddingBottom=0)},afterLeave(n){a(n)},leaveCancelled(n){a(n)}};return(n,s)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(o).b()},e.toHandlers(i)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16,["name"]))}});var Oe=v._export_sfc(ke,[["__file","collapse-transition.vue"]]);const Ee=v.withInstall(Oe);let Se=class{constructor(o,a){this.parent=o,this.domNode=a,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(o){o===this.subMenuItems.length?o=0:o<0&&(o=this.subMenuItems.length-1),this.subMenuItems[o].focus(),this.subIndex=o}addListeners(){const o=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,a=>{a.addEventListener("keydown",i=>{let n=!1;switch(i.code){case R.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),n=!0;break}case R.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),n=!0;break}case R.EVENT_CODE.tab:{R.triggerEvent(o,"mouseleave");break}case R.EVENT_CODE.enter:case R.EVENT_CODE.numpadEnter:case R.EVENT_CODE.space:{n=!0,i.currentTarget.click();break}}return n&&(i.preventDefault(),i.stopPropagation()),!1})})}},_e=class{constructor(o,a){this.domNode=o,this.submenu=null,this.submenu=null,this.init(a)}init(o){this.domNode.setAttribute("tabindex","0");const a=this.domNode.querySelector(`.${o}-menu`);a&&(this.submenu=new Se(this,a)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",o=>{let a=!1;switch(o.code){case R.EVENT_CODE.down:{R.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),a=!0;break}case R.EVENT_CODE.up:{R.triggerEvent(o.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),a=!0;break}case R.EVENT_CODE.tab:{R.triggerEvent(o.currentTarget,"mouseleave");break}case R.EVENT_CODE.enter:case R.EVENT_CODE.numpadEnter:case R.EVENT_CODE.space:{a=!0,o.currentTarget.click();break}}a&&o.preventDefault()})}},Fe=class{constructor(o,a){this.domNode=o,this.init(a)}init(o){const a=this.domNode.childNodes;Array.from(a).forEach(i=>{i.nodeType===1&&new _e(i,o)})}};const Qe=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=v.useNamespace("menu");return{listeners:{onBeforeEnter:a=>a.style.opacity="0.2",onEnter(a,i){v.addClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity="1",i()},onAfterEnter(a){v.removeClass(a,`${t.namespace.value}-opacity-transition`),a.style.opacity=""},onBeforeLeave(a){a.dataset||(a.dataset={}),v.hasClass(a,t.m("collapse"))?(v.removeClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),v.addClass(a,t.m("collapse"))):(v.addClass(a,t.m("collapse")),a.dataset.oldOverflow=a.style.overflow,a.dataset.scrollWidth=a.clientWidth.toString(),v.removeClass(a,t.m("collapse"))),a.style.width=`${a.scrollWidth}px`,a.style.overflow="hidden"},onLeave(a){v.addClass(a,"horizontal-collapse-transition"),a.style.width=`${a.dataset.scrollWidth}px`}}}}});function Be(t,o,a,i,n,s){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var Pe=v._export_sfc(Qe,[["render",Be],["__file","menu-collapse-transition.vue"]]);function fe(t,o){const a=e.computed(()=>{let n=t.parent;const s=[o.value];for(;n.type.name!=="ElMenu";)n.props.index&&s.unshift(n.props.index),n=n.parent;return s});return{parentMenu:e.computed(()=>{let n=t.parent;for(;n&&!["ElMenu","ElSubMenu"].includes(n.type.name);)n=n.parent;return n}),indexPath:a}}function Ve(t){return e.computed(()=>{const a=t.backgroundColor;return a?new xe.TinyColor(a).shade(20).toString():""})}const Te=(t,o)=>{const a=v.useNamespace("menu");return e.computed(()=>a.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":Ve(t).value||"","active-color":t.activeTextColor||"",level:`${o}`}))},Re=v.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:W.iconPropType},expandOpenIcon:{type:W.iconPropType},collapseCloseIcon:{type:W.iconPropType},collapseOpenIcon:{type:W.iconPropType}}),te="ElSubMenu";var ue=e.defineComponent({name:te,props:Re,setup(t,{slots:o,expose:a}){const i=e.getCurrentInstance(),{indexPath:n,parentMenu:s}=fe(i,e.computed(()=>t.index)),M=v.useNamespace("menu"),u=v.useNamespace("sub-menu"),l=e.inject("rootMenu");l||v.throwError(te,"can not inject root menu");const r=e.inject(`subMenu:${s.value.uid}`);r||v.throwError(te,"can not inject sub menu");const d=e.ref({}),f=e.ref({});let N;const g=e.ref(!1),D=e.ref(),y=e.ref(null),x=e.computed(()=>A.value==="horizontal"&&k.value?"bottom-start":"right-start"),b=e.computed(()=>A.value==="horizontal"&&k.value||A.value==="vertical"&&!l.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?m.value?t.expandOpenIcon:t.expandCloseIcon:W.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?m.value?t.collapseOpenIcon:t.collapseCloseIcon:W.arrow_right_default),k=e.computed(()=>r.level===0),_=e.computed(()=>{const L=t.teleported;return L===void 0?k.value:L}),p=e.computed(()=>l.props.collapse?`${M.namespace.value}-zoom-in-left`:`${M.namespace.value}-zoom-in-top`),T=e.computed(()=>A.value==="horizontal"&&k.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),m=e.computed(()=>l.openedMenus.includes(t.index)),Y=e.computed(()=>{let L=!1;return Object.values(d.value).forEach(w=>{w.active&&(L=!0)}),Object.values(f.value).forEach(w=>{w.active&&(L=!0)}),L}),A=e.computed(()=>l.props.mode),E=e.reactive({index:t.index,indexPath:n,active:Y}),F=Te(l.props,r.level+1),U=e.computed(()=>{var L;return(L=t.popperOffset)!=null?L:l.props.popperOffset}),Q=e.computed(()=>{var L;return(L=t.popperClass)!=null?L:l.props.popperClass}),$=e.computed(()=>{var L;return(L=t.showTimeout)!=null?L:l.props.showTimeout}),I=e.computed(()=>{var L;return(L=t.hideTimeout)!=null?L:l.props.hideTimeout}),j=()=>{var L,w,O;return(O=(w=(L=y.value)==null?void 0:L.popperRef)==null?void 0:w.popperInstanceRef)==null?void 0:O.destroy()},z=L=>{L||j()},c=()=>{l.props.menuTrigger==="hover"&&l.props.mode==="horizontal"||l.props.collapse&&l.props.mode==="vertical"||t.disabled||l.handleSubMenuClick({index:t.index,indexPath:n.value,active:Y.value})},h=(L,w=$.value)=>{var O;if(L.type!=="focus"){if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"||t.disabled){r.mouseInChild.value=!0;return}r.mouseInChild.value=!0,N==null||N(),{stop:N}=v.useTimeoutFn(()=>{l.openMenu(t.index,n.value)},w),_.value&&((O=s.value.vnode.el)==null||O.dispatchEvent(new MouseEvent("mouseenter")))}},C=(L=!1)=>{var w;if(l.props.menuTrigger==="click"&&l.props.mode==="horizontal"||!l.props.collapse&&l.props.mode==="vertical"){r.mouseInChild.value=!1;return}N==null||N(),r.mouseInChild.value=!1,{stop:N}=v.useTimeoutFn(()=>!g.value&&l.closeMenu(t.index,n.value),I.value),_.value&&L&&((w=r.handleMouseleave)==null||w.call(r,!0))};e.watch(()=>l.props.collapse,L=>z(!!L));{const L=O=>{f.value[O.index]=O},w=O=>{delete f.value[O.index]};e.provide(`subMenu:${i.uid}`,{addSubMenu:L,removeSubMenu:w,handleMouseleave:C,mouseInChild:g,level:r.level+1})}return a({opened:m}),e.onMounted(()=>{l.addSubMenu(E),r.addSubMenu(E)}),e.onBeforeUnmount(()=>{r.removeSubMenu(E),l.removeSubMenu(E)}),()=>{var L;const w=[(L=o.title)==null?void 0:L.call(o),e.h(W.ElIcon,{class:u.e("icon-arrow"),style:{transform:m.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&l.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>v.isString(b.value)?e.h(i.appContext.components[b.value]):e.h(b.value)})],O=l.isMenuPopup?e.h(je.ElTooltip,{ref:y,visible:m.value,effect:"light",pure:!0,offset:U.value,showArrow:!1,persistent:!0,popperClass:Q.value,placement:x.value,teleported:_.value,fallbackPlacements:T.value,transition:p.value,gpuAcceleration:!1},{content:()=>{var S;return e.h("div",{class:[M.m(A.value),M.m("popup-container"),Q.value],onMouseenter:V=>h(V,100),onMouseleave:()=>C(!0),onFocus:V=>h(V,100)},[e.h("ul",{class:[M.b(),M.m("popup"),M.m(`popup-${x.value}`)],style:F.value},[(S=o.default)==null?void 0:S.call(o)])])},default:()=>e.h("div",{class:u.e("title"),onClick:c},w)}):e.h(e.Fragment,{},[e.h("div",{class:u.e("title"),ref:D,onClick:c},w),e.h(Ee,{},{default:()=>{var S;return e.withDirectives(e.h("ul",{role:"menu",class:[M.b(),M.m("inline")],style:F.value},[(S=o.default)==null?void 0:S.call(o)]),[[e.vShow,m.value]])}})]);return e.h("li",{class:[u.b(),u.is("active",Y.value),u.is("opened",m.value),u.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:m.value,onMouseenter:h,onMouseleave:()=>C(),onFocus:h},[O])}}});const Ue=v.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:v.definePropType(Array),default:()=>Ae.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:W.iconPropType,default:()=>W.more_default},popperEffect:{type:v.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),ne=t=>v.isArray(t)&&t.every(o=>v.isString(o)),$e={close:(t,o)=>v.isString(t)&&ne(o),open:(t,o)=>v.isString(t)&&ne(o),select:(t,o,a,i)=>v.isString(t)&&ne(o)&&v.isObject(a)&&(i===void 0||i instanceof Promise)};var We=e.defineComponent({name:"ElMenu",props:Ue,emits:$e,setup(t,{emit:o,slots:a,expose:i}){const n=e.getCurrentInstance(),s=n.appContext.config.globalProperties.$router,M=e.ref(),u=v.useNamespace("menu"),l=v.useNamespace("sub-menu"),r=e.ref(-1),d=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),f=e.ref(t.defaultActive),N=e.ref({}),g=e.ref({}),D=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),y=()=>{const j=f.value&&N.value[f.value];if(!j||t.mode==="horizontal"||t.collapse)return;j.indexPath.forEach(c=>{const h=g.value[c];h&&x(c,h.indexPath)})},x=(j,z)=>{d.value.includes(j)||(t.uniqueOpened&&(d.value=d.value.filter(c=>z.includes(c))),d.value.push(j),o("open",j,z))},b=j=>{const z=d.value.indexOf(j);z!==-1&&d.value.splice(z,1)},k=(j,z)=>{b(j),o("close",j,z)},_=({index:j,indexPath:z})=>{d.value.includes(j)?k(j,z):x(j,z)},p=j=>{(t.mode==="horizontal"||t.collapse)&&(d.value=[]);const{index:z,indexPath:c}=j;if(!(v.isNil(z)||v.isNil(c)))if(t.router&&s){const h=j.route||z,C=s.push(h).then(L=>(L||(f.value=z),L));o("select",z,c,{index:z,indexPath:c,route:h},C)}else f.value=z,o("select",z,c,{index:z,indexPath:c})},T=j=>{const z=N.value,c=z[j]||f.value&&z[f.value]||z[t.defaultActive];c?f.value=c.index:f.value=j},m=j=>{const z=getComputedStyle(j),c=Number.parseInt(z.marginLeft,10),h=Number.parseInt(z.marginRight,10);return j.offsetWidth+c+h||0},Y=()=>{var j,z;if(!M.value)return-1;const c=Array.from((z=(j=M.value)==null?void 0:j.childNodes)!=null?z:[]).filter(B=>B.nodeName!=="#text"||B.nodeValue),h=64,C=getComputedStyle(M.value),L=Number.parseInt(C.paddingLeft,10),w=Number.parseInt(C.paddingRight,10),O=M.value.clientWidth-L-w;let S=0,V=0;return c.forEach((B,G)=>{B.nodeName!=="#comment"&&(S+=m(B),S<=O-h&&(V=G+1))}),V===c.length?-1:V},A=j=>g.value[j].indexPath,E=(j,z=33.34)=>{let c;return()=>{c&&clearTimeout(c),c=setTimeout(()=>{j()},z)}};let F=!0;const U=()=>{if(r.value===Y())return;const j=()=>{r.value=-1,e.nextTick(()=>{r.value=Y()})};F?j():E(j)(),F=!1};e.watch(()=>t.defaultActive,j=>{N.value[j]||(f.value=""),T(j)}),e.watch(()=>t.collapse,j=>{j&&(d.value=[])}),e.watch(N.value,y);let Q;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?Q=ve.useResizeObserver(M,U).stop:Q==null||Q()});const $=e.ref(!1);{const j=C=>{g.value[C.index]=C},z=C=>{delete g.value[C.index]},c=C=>{N.value[C.index]=C},h=C=>{delete N.value[C.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:d,items:N,subMenus:g,activeIndex:f,isMenuPopup:D,addMenuItem:c,removeMenuItem:h,addSubMenu:j,removeSubMenu:z,openMenu:x,closeMenu:k,handleMenuItemClick:p,handleSubMenuClick:_})),e.provide(`subMenu:${n.uid}`,{addSubMenu:j,removeSubMenu:z,mouseInChild:$,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new Fe(n.vnode.el,u.namespace.value)}),i({open:z=>{const{indexPath:c}=g.value[z];c.forEach(h=>x(h,c))},close:b,handleResize:U});const I=Te(t,0);return()=>{var j,z;let c=(z=(j=a.default)==null?void 0:j.call(a))!=null?z:[];const h=[];if(t.mode==="horizontal"&&M.value){const w=Ce.flattedChildren(c),O=r.value===-1?w:w.slice(0,r.value),S=r.value===-1?[]:w.slice(r.value);S!=null&&S.length&&t.ellipsis&&(c=O,h.push(e.h(ue,{index:"sub-menu-more",class:l.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(W.ElIcon,{class:l.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>S})))}const C=t.closeOnClickOutside?[[Ye.ClickOutside,()=>{d.value.length&&($.value||(d.value.forEach(w=>o("close",w,A(w))),d.value=[]))}]]:[],L=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:M,style:I.value,class:{[u.b()]:!0,[u.m(t.mode)]:!0,[u.m("collapse")]:t.collapse}},[...c,...h]),C);return t.collapseTransition&&t.mode==="vertical"?e.h(Pe,()=>L):L}}});const Ze=v.buildProps({index:{type:v.definePropType([String,null]),default:null},route:{type:v.definePropType([String,Object])},disabled:Boolean}),Ge={click:t=>v.isString(t.index)&&v.isArray(t.indexPath)},oe="ElMenuItem",He=e.defineComponent({name:oe,components:{ElTooltip:je.ElTooltip},props:Ze,emits:Ge,setup(t,{emit:o}){const a=e.getCurrentInstance(),i=e.inject("rootMenu"),n=v.useNamespace("menu"),s=v.useNamespace("menu-item");i||v.throwError(oe,"can not inject root menu");const{parentMenu:M,indexPath:u}=fe(a,e.toRef(t,"index")),l=e.inject(`subMenu:${M.value.uid}`);l||v.throwError(oe,"can not inject sub menu");const r=e.computed(()=>t.index===i.activeIndex),d=e.reactive({index:t.index,indexPath:u,active:r}),f=()=>{t.disabled||(i.handleMenuItemClick({index:t.index,indexPath:u.value,route:t.route}),o("click",d))};return e.onMounted(()=>{l.addSubMenu(d),i.addMenuItem(d)}),e.onBeforeUnmount(()=>{l.removeSubMenu(d),i.removeMenuItem(d)}),{parentMenu:M,rootMenu:i,active:r,nsMenu:n,nsMenuItem:s,handleClick:f}}});function qe(t,o,a,i,n,s){const M=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(M,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var me=v._export_sfc(He,[["render",qe],["__file","menu-item.vue"]]);const Je={title:String},Xe="ElMenuItemGroup",Ke=e.defineComponent({name:Xe,props:Je,setup(){return{ns:v.useNamespace("menu-item-group")}}});function et(t,o,a,i,n,s){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var Ie=v._export_sfc(Ke,[["render",et],["__file","menu-item-group.vue"]]);const tt=v.withInstall(We,{MenuItem:me,MenuItemGroup:Ie,SubMenu:ue}),nt=v.withNoopInstall(me);v.withNoopInstall(Ie);v.withNoopInstall(ue);const ot={class:"st-kline-tips"},at={class:"st-kline-tips-row"},it=e.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,i=>(e.openBlock(),e.createElementBlock("div",{class:"st-kline-tips-row-item",style:e.normalizeStyle({color:i.color})},e.toDisplayString(i.label)+" "+e.toDisplayString(i.value),5))),256))])]))}});const ae=Z._export_sfc(it,[["__scopeId","data-v-78aed210"]]),lt=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(t,{emit:o}){const a=o,i=e.ref(),n=e.ref(),s=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{s.value.display="none",a("closeContextMenuCallBack"),document.removeEventListener("click",M)},u=l=>{if(l.preventDefault(),l.stopPropagation(),s.value.display==="block"){const{offsetX:r,offsetY:d}=l,{offsetWidth:f,offsetHeight:N}=n.value;if(r<=f&&d<=N)return}i.value.click(),s.value={display:"block",top:`${l.offsetY}px`,left:`${l.offsetX}px`},e.nextTick(()=>{const{bottom:r,height:d,right:f,width:N}=n.value.getBoundingClientRect();r>window.innerHeight?s.value={display:"block",top:`${l.offsetY-d}px`,left:`${l.offsetX}px`}:f>window.innerWidth&&(s.value={display:"block",top:`${l.offsetY}px`,left:`${l.offsetX-N}px`})}),document.addEventListener("click",M)};return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:i,class:"contextmenu",onContextmenu:u,onMouseleave:M},[e.renderSlot(l.$slots,"default",{},void 0,!0),s.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:n,class:"contextmenu-popover",style:e.normalizeStyle(s.value)},[e.renderSlot(l.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const st=Z._export_sfc(lt,[["__scopeId","data-v-249fd104"]]);let Ne=!1,ye=!0,ze=[];const ge=t=>{const o=[],a=[],i=[],n=[],s=[],M=[];return t.forEach((u,l)=>{o.push(u[0]),a.push(u[1]),i.push(u[4]),n.push(u[2]),s.push(u[3]),M.push([u[1],u[4],u[3],u[2],Number(u[6]),l===0?u[4]:t[l-1][4]])}),{time:o,open:a,close:i,high:n,low:s,kLineData:M}},rt=async()=>{if(!Ne)Ne=!0,await pe.init("./talib.wasm"),ye=!1,ze.forEach(t=>{t()});else if(ye)return new Promise(t=>{ze.push(t)})},J=(t,o)=>t.length>o?t.slice(t.length-o):t,ct=(t,o,a)=>t.calculationFn?t.calculationFn(pe.talib,o,a):new Array(o.time.length).fill(null),ut=async(t,o,a)=>{const i=ge(t);let n=[];return n=ge(n),await rt(),{originData:J(t,a),kLine:J(i.kLineData,a),time:J(i.time,a),indicator:o.config.reduce((s,M)=>(s.push({key:M.key,color:M.color,data:J(ct(M,i,n),a)}),s),[])}},ie="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjM4NzI1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2MjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTE5OC4wMTYgMTA5LjczODY2N0E3Ny44NjY2NjcgNzcuODY2NjY3IDAgMCAwIDE3MC42NjY2NjcgMTY3LjY4bDAuNTEyIDQxOC45NDRjMCAyMi44NjkzMzMgNi40IDQ4IDE5LjAyOTMzMyA3NS4zMDY2NjcgMTIuNjcyIDI3LjIyMTMzMyAyNy45ODkzMzMgNDguOTM4NjY3IDQ1Ljk1MiA2NC45Mzg2NjZsMjExLjE1NzMzMyAxODguMjAyNjY3YzE3LjA2NjY2NyAxNS40ODggNDAuNTc2IDIzLjk3ODY2NyA2NC45Mzg2NjcgMjMuNTk0NjY3IDI1LjY4NTMzMy0wLjA4NTMzMyA0Ny4zNi03LjkzNiA2NC45ODEzMzMtMjMuNTk0NjY3bDIxMS4yLTE4OC4yMDI2NjdjMTcuOTItMTYgMzMuMTk0NjY3LTM3LjYzMiA0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jY3IDAgMCAwIDc2MS42IDEyOGwtNDk5LjYyNjY2NyAwLjQ2OTMzM2E1MS4zMjggNTEuMzI4IDAgMCAwLTM1Ljc1NDY2NiAxMy4yNjkzMzQgMzYuNTY1MzMzIDM2LjU2NTMzMyAwIDAgMC0xMi41MDEzMzQgMjEuNTA0bC0wLjQyNjY2NiA0LjY5MzMzM3oiIGZpbGw9IiNBRTQ0RkYiIHAtaWQ9IjMwODAiPjwvcGF0aD48cGF0aCBkPSJNNDc1LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",H=(t,o)=>{const{type:a="log",color:i="black"}=o??{};localStorage.getItem("st-kline-console-show")==="true"&&console[a](`%c${t}`,`color:${i}`)},P=t=>t||t===0?Math.round(t*1e3)/1e3:null,Mt=t=>t>=1e12?`${(t/1e12).toFixed(2)}万亿`:t>=1e8?`${(t/1e8).toFixed(2)}亿`:t>=1e4?`${(t/1e4).toFixed(2)}万`:t.toFixed(2),dt=t=>{const{y:o,text:a,info:i,gridLeft:n,gridRight:s,echartsWidth:M,echartsInstance:u}=t,{config:l,event:r}=i;let d=0;return{type:"group",draggable:l.draggable?"vertical":!1,children:[{type:"line",info:i,shape:{x1:n,y1:o,x2:M-s,y2:o},style:{stroke:l.lineColor,lineWidth:1,lineDash:[8,4]},z:10},{type:"group",x:M,y:o-5,children:[{type:"text",left:-1*s,info:i,style:{fill:l.textColor,text:a,stroke:"#000",lineWidth:1,opacity:1},z:10}]}],onmouseover:f=>{r.onmouseover instanceof Function&&r.onmouseover(f,i)},onmouseout:f=>{r.onmouseout instanceof Function&&r.onmouseout(f,i)},ondragstart:f=>{r.ondragstart instanceof Function&&l.draggable&&(d=f.offsetY,r.ondragstart(f,i))},ondragend:f=>{if(r.ondragend instanceof Function&&l.draggable){const g=f.offsetY-d;if(g===0)return;const D=u.convertFromPixel({yAxisIndex:0},o+g);r.ondragend(f,i,D)}}}},Nt=t=>{const{y:o,text:a,info:i,gridLeft:n,gridRight:s,echartsWidth:M,echartsInstance:u}=t,{config:l,event:r}=i;let d=0;const f=g=>{let D=null;g.target.type==="line"?D=g.target.parent:g.target.type==="tspan"&&(D=g.target.parent.parent.parent),D.children()[1].children()[0].animate("style",!1).when(200,{opacity:1}).start()},N=g=>{let D=null;g.target.type==="line"?D=g.target.parent:g.target.type==="tspan"&&(D=g.target.parent.parent.parent),D.children()[1].children()[0].animate("style",!1).when(200,{opacity:0}).start()};return{type:"group",draggable:l.draggable?"vertical":!1,children:[{type:"line",info:i,shape:{x1:n,y1:o,x2:M-s,y2:o},style:{stroke:l.lineColor,lineWidth:1},z:10},{type:"group",x:M/2,y:o-5,children:[{type:"text",left:"center",info:i,style:{fill:l.textColor,text:a,stroke:"#000",lineWidth:1,opacity:0},z:10}]}],onmouseover:g=>{r.onmouseover instanceof Function?r.onmouseover(g,i):f(g)},onmouseout:g=>{r.onmouseout instanceof Function?r.onmouseout(g,i):N(g)},ondragstart:g=>{r.ondragstart instanceof Function&&l.draggable&&(d=g.offsetY,r.ondragstart(g,i))},ondragend:g=>{if(r.ondragend instanceof Function&&l.draggable){const y=g.offsetY-d;if(y===0)return;const x=u.convertFromPixel({yAxisIndex:0},o+y);r.ondragend(g,i,x)}}}},yt=t=>{const{y:o,text:a,profitY:i,profitText:n,lossY:s,lossText:M,info:u,gridLeft:l,gridRight:r,echartsWidth:d,echartsInstance:f}=t,{config:N,event:g}=u;let D=0,y=null,x=null;const b=(p,T)=>{var m,Y,A,E;(m=p.children()[2])==null||m.animate("style",!1).when(200,{opacity:~~T}).start(),(Y=p.children()[3].children()[0])==null||Y.animate("style",!1).when(200,{opacity:~~T}).start(),(A=p.children()[4])==null||A.animate("style",!1).when(200,{opacity:~~T}).start(),(E=p.children()[5].children()[0])==null||E.animate("style",!1).when(200,{opacity:~~T}).start()},k=p=>{let T=null;p.target.type==="line"?T=p.target.parent:p.target.type==="tspan"&&(T=p.target.parent.parent.parent),y=m=>{m.preventDefault(),(m.code==="AltLeft"||m.code==="AltRight")&&b(T,!0)},x=m=>{(m.code==="AltLeft"||m.code==="AltRight")&&b(T,!1)},window.addEventListener("keydown",y),window.addEventListener("keyup",x)},_=p=>{let T=null;p.target.type==="line"?T=p.target.parent:p.target.type==="tspan"&&(T=p.target.parent.parent.parent),b(T,!1),window.removeEventListener("keydown",y),window.removeEventListener("keyup",x)};return{type:"group",draggable:N.draggable?"vertical":!1,children:[{type:"line",info:u,shape:{x1:l,y1:o,x2:d-r,y2:o},style:{stroke:N.lineColor,lineWidth:1},z:10},{type:"group",x:d/2,y:o-5,children:[{type:"text",left:"center",info:u,style:{fill:N.textColor,text:a,stroke:"#000",lineWidth:1,opacity:1},z:10}]},{type:"line",info:u,shape:{x1:l,y1:i,x2:d-r,y2:i},style:{stroke:N.profitLineColor,lineWidth:1,lineDash:[8,4],opacity:0},z:10},{type:"group",x:d/2,y:i-5,children:[{type:"text",left:"center",info:u,style:{fill:N.profitTextColor,text:n,stroke:"#000",lineWidth:1,opacity:0},z:10}]},{type:"line",info:u,shape:{x1:l,y1:s,x2:d-r,y2:s},style:{stroke:N.lossLineColor,lineWidth:1,lineDash:[8,4],opacity:0},z:10},{type:"group",x:d/2,y:s-5,children:[{type:"text",left:"center",info:u,style:{fill:N.lossTextColor,text:M,stroke:"#000",lineWidth:1,opacity:0},z:10}]}],onmouseover:p=>{g.onmouseover instanceof Function?g.onmouseover(p,u):k(p)},onmouseout:p=>{g.onmouseout instanceof Function?g.onmouseout(p,u):_(p)},ondragstart:p=>{g.ondragstart instanceof Function&&N.draggable&&(D=p.offsetY,g.ondragstart(p,u))},ondragend:p=>{if(g.ondragend instanceof Function&&N.draggable){const m=p.offsetY-D;if(m===0)return;const Y=f.convertFromPixel({yAxisIndex:0},o+m);g.ondragend(p,u,Y)}}}},K=(t,o)=>{const{direction:a="",tradeAction:i="",tradeType:n=""}=t;if(o==="sellBuy"){const s=n??a+i;return new Map([["开多","买"],["平多","卖"],["开空","卖"],["平空","买"]]).get(s)}else if(o==="openClose")return n??a+i},zt=(t,o)=>t.reduce((a,i)=>{var d;const n=K(i,"sellBuy"),s=t.filter(f=>f.time===i.time);let M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href;s.length>1?[...new Set(s.map(N=>K(N,"sellBuy")))].length>1?M="image://"+new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjI4MjAyIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjMwNzgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTE5OC4wMTYgMTA5LjczODY2N0E3Ny44NjY2NjcgNzcuODY2NjY3IDAgMCAwIDE3MC42NjY2NjcgMTY3LjY4bDAuNTEyIDQxOC45NDRjMCAyMi44NjkzMzMgNi40IDQ4IDE5LjAyOTMzMyA3NS4zMDY2NjcgMTIuNjcyIDI3LjIyMTMzMyAyNy45ODkzMzMgNDguOTM4NjY3IDQ1Ljk1MiA2NC45Mzg2NjZsMjExLjE1NzMzMyAxODguMjAyNjY3YzE3LjA2NjY2NyAxNS40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wIDAgMC0xMi41MDEzMzQgMjEuNTA0bC0wLjQyNjY2NiA0LjY5MzMzM3oiIGZpbGw9IiNBRTQ0RkYiIHAtaWQ9IjMwODAiPjwvcGF0aD48cGF0aCBkPSJNNDc1LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",self.location).href:M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href:M="image://"+new URL(Object.assign({"./images/buy.svg":ie,"./images/sell.svg":le,"./images/t.svg":se})[`./images/${n==="买"?"buy":"sell"}.svg`],self.location).href;const l=(o.find(f=>f[0]===i.time)??[])[2],r=((d=i==null?void 0:i.markLineTarget)==null?void 0:d.map(f=>{const N=i.time,g=l+"",D=f.time,y=o.find(b=>b[0]===f.time),x=y?y[3]:null;return[{coord:[N,g],lineStyle:f.lineStyle},{coord:[D,x]}]}))??null;return a.push({symbol:M,symbolSize:25,animation:!1,coord:[i.time+"",l],symbolRotate:0,symbolOffset:[0,"-7"],markLineTarget:r}),a},[]),gt=(t,o)=>t.reduce((a,i,n)=>{var f;const s=K(i,"openClose"),M=s==="开多"||s==="开空"?"top":"bottom",u=o.find(N=>N[0]===i.time)??[],l=M==="top"?u[2]:u[3];let r=7;r+=t.slice(0,n).filter(N=>{const g=K(N,"openClose");return(g==="开多"||g==="开空"?"top":"bottom")===M&&N.time===i.time}).length*7;const d=((f=i==null?void 0:i.markLineTarget)==null?void 0:f.map(N=>{const g=i.time,D=l+"",y=N.time,x=o.find(b=>b[0]===N.time)[3];return[{coord:[g,D],lineStyle:N.lineStyle},{coord:[y,x]}]}))??null;return a.push({symbol:"triangle",symbolSize:[10,12],animation:!1,coord:[i.time+"",l],symbolRotate:M==="top"?180:0,symbolOffset:[0,`${M==="top"?r*-1:r}`],itemStyle:{color:M==="top"?"#FF0000":"#389e0d"},label:{show:!0,position:M,color:"#fff",formatter:`${s} ${M==="top"?"+":"-"} ${i.amount}手 ${i.part?`(${i.part}份)`:""}`},markLineTarget:d}),a},[]),jt=(t,o)=>t.reduce((a,i)=>{const{key:n,data:s}=i;if(s===null||s.length===0)return a;const u=new Map([["sellBuy",()=>zt(s,o)],["openClose",()=>gt(s,o)],["signal",()=>{}]]).get(n);return u instanceof Function&&a.push(...u()),a},[]),re=async(t,o,a,i,n,s)=>{const{totalBarCount:M,defaultShowBarCount:u,maxValueSpan:l,gridLeft:r,gridTop:d,gridRight:f,gridBottom:N,zoomLock:g}=i,{time:D,kLine:y,originData:x,indicator:b}=await ut(t,a,M),k=b.map(T=>{const{key:m,data:Y,color:A}=T;return{name:m,type:"line",silent:!0,symbol:"none",data:Y,lineStyle:{width:1},itemStyle:{color:A}}}),_=jt(o,x);let p=[];return _.forEach(T=>{T.markLineTarget&&(p=[...p,...T.markLineTarget])}),{animation:!1,dataset:{id:"data",source:{klineData:y,indicatorData:b}},grid:{left:`${r}px`,top:`${d}px`,right:`${f}px`,bottom:`${N}px`},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{formatter:T=>{const{axisDimension:m,value:Y}=T;return m==="x"?Y:String(P(Y))}}},formatter:T=>{let m=null,Y="";return T.forEach(A=>{A.seriesName==="资产持仓净值"&&A.data!==null&&(Y+=`<div>资产持仓净值: ${A.data}</div>`),A.componentSubType==="candlestick"&&o.forEach(E=>{const{key:F,data:U}=E;if(F==="sellBuy"){const Q=U.filter(j=>j.time===A.axisValue);let $=0,I=0;Q.forEach(j=>{j.tradeType==="开多"||j.tradeType==="平空"?$+=j.amount:I+=j.amount}),$&&(Y+=`<div>买: ${$}</div>`),I&&(Y+=`<div>卖: ${I}</div>`)}F==="openClose"&&U.forEach(Q=>{Q.time===A.axisValue&&(Y+=Q.tooltip)})}),Y&&(m=`<div><span style="font-weight: bold;">${A.axisValue}</span>${Y}</div>`)}),m}},xAxis:{type:"category",data:D,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},axisLabel:{show:!0,formatter:T=>T}},yAxis:[{index:0,splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:T=>{const{min:m,max:Y}=T,A=Math.abs((Y-m)/10);return m-A},max:T=>{const{min:m,max:Y}=T,A=Math.abs((Y-m)/10);return Y+A},axisLine:{show:!0},axisLabel:{formatter:T=>P(T),showMaxLabel:!1}},{show:!1,min:"dataMin"}],dataZoom:[{type:"inside",xAxisIndex:[0,0],zoomLock:g,maxValueSpan:l,start:y.length>=u?(y.length-u)/y.length*100:0,end:99.99}],series:[{name:"k线",type:"candlestick",data:y,markPoint:{data:_},markLine:{position:"middle",textStyle:{color:"blue",fontSize:15},animation:!1,data:p,lineStyle:{width:3,type:"solid"},symbol:["none","none"]},itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1},z:1},...k,{name:"资产持仓净值",type:"line",data:n??[],symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:"#666"}},{name:"二腿相关度",type:"line",data:s??[],symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:"#FFF"},lineStyle:{width:2},label:{show:!0,position:"top",formatter:T=>`相关度: ${T.data[1]}`,textStyle:{color:"#FFF",fontSize:14}}}],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:1},brushStyle:{color:"rgba(120,140,180,0)",borderColor:"rgba(255,255,255,0.4)"}}}},pt=(t,o,a)=>{var f;const{gridLeft:i,gridRight:n,gridBottom:s,warningConfig:M,positionConfig:u,conditionConfig:l,isOpenDS:r}=o;let d=[];if((f=a==null?void 0:a.getModel())!=null&&f.getComponent){const[N,g]=a.getModel().getComponent("yAxis").axis.scale._extent;let D=[],y={},x=[],b={},k=[],_={};if(t.forEach(({key:p,data:T,...m})=>{p==="warning"?(D=T,y=m):p==="position"?(x=T,b=m):p==="condition"&&(k=T,_=m)}),D.length>0&&(d=D.reduce((p,T)=>{const{value:m,text:Y,info:A,config:E}=T;if(m>g||m<N)return p;const F={y:a.convertToPixel({yAxisIndex:0},m),text:Y,info:{info:A,config:{...M,...E},event:{...y}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,dt(F)]},d)),x.length>0&&(d=x.reduce((p,T)=>{const{value:m,text:Y,info:A,config:E}=T;if(m>g||m<N)return p;const F={y:a.convertToPixel({yAxisIndex:0},m),text:Y,info:{info:A,config:{...u,...E},event:{...b}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,Nt(F)]},d)),k.length>0&&(d=k.reduce((p,T)=>{const{value:m,text:Y,profitValue:A,profitText:E,lossValue:F,lossText:U,info:Q,config:$}=T;if(m>g||m<N)return p;const I={y:a.convertToPixel({yAxisIndex:0},m),text:Y,profitY:a.convertToPixel({yAxisIndex:0},A),profitText:E,lossY:a.convertToPixel({yAxisIndex:0},F),lossText:U,info:{info:Q,config:{...l,...$},event:{..._}},gridLeft:i,gridRight:n,echartsWidth:a.getWidth(),echartsInstance:a};return[...p,yt(I)]},d)),r){const p=a.getOption(),T=p.dataset[0].source.klineData.slice(p.dataZoom[0].startValue,p.dataZoom[0].endValue+1),m={};T.forEach(I=>{m[I[1]]?m[I[1]]+=1:m[I[1]]=1});const Y=T[T.length-1][1],A=T.reduce((I,j)=>I+j[1],0)/T.length,E=Y-A,F=Tt(T,1,50),U=mt(T),Q=U?E/U:0,$=ft(T,1,Y);d=[...d,{type:"group",draggable:!1,children:Object.keys(m).map(I=>({type:"line",shape:{x1:a.getWidth()-n-100*m[I],y1:a.convertToPixel({yAxisIndex:0},I),x2:a.getWidth()-n,y2:a.convertToPixel({yAxisIndex:0},I)},style:{stroke:"rgb(124,124,124)",lineWidth:1},z:10}))},{type:"text",x:i+6,y:a.getHeight()-s-20,style:{fill:"#FFF",text:`均值: ${P(A)} 距均值: ${P(E)} 中值: ${P(F)} 标准差: ${P(U)} 距均值/标准差: ${P(Q)} 百分位: ${P($)}%`,lineWidth:1,opacity:1},z:10}]}}return{elements:d}},ft=(t,o,a)=>{const{round:i,add:n,subtract:s,multiply:M,divide:u}=ee.x,l=t.map(d=>d[o]).sort((d,f)=>d-f);let r=0;for(let d=0;d<l.length;d++)if(l[d]===a){r=d;break}else if(l[d]>=a){r=n(d,u(s(l[d+1],l[d]),l[d]));break}return i(u(M(r,100),t.length+1))},Tt=(t,o,a)=>{const{round:i,add:n,subtract:s,multiply:M,divide:u}=ee.x,l=t.map(N=>N[o]).sort((N,g)=>N-g),r=M(t.length+1,u(a,100)),d=Math.floor(r),f=s(r,d);return i(f===0?l[r]:n(l[d],M(s(l[d>=t.length-1?d:d+1],l[d]),f)))};function mt(t){const o=t.map(M=>M[1]),a=o.length;let i=0,n=0;for(const M of o)i+=M;const s=i/a;for(const M of o)n+=Math.pow(M-s,2);return Math.sqrt(n/a)}const It={class:"st-kline"},Dt={class:"st-kline-header"},Lt=300,ht=e.defineComponent({__name:"index",props:{indicator:{type:Object,default:()=>({})},klineData:{type:Array,default:()=>[]},markData:{type:Array,default:()=>[]},lineData:{type:Array,default:()=>[]},netPositionData:{type:Array,default:()=>[]},relevanceData:{type:Array,default:()=>[]},priceTrendData:{type:Array,default:()=>[]},priceTrendPercentData:{type:Array,default:()=>[]},brushRange:{type:Array,default:()=>[]},defaultMenuData:{type:Array,default:()=>[]},isSelect:{type:Boolean,default:()=>!1},config:{type:Object,default:()=>({})}},setup(t){const o=t,a={totalBarCount:2e3,defaultShowBarCount:200,preBarCount:800,maxValueSpan:1e4,gridLeft:60,gridTop:0,gridRight:60,gridBottom:30,warningConfig:{draggable:!1,lineColor:"#fff",textColor:"#fff"},positionConfig:{draggable:!1,lineColor:"#e45d07",textColor:"#fff"},conditionConfig:{draggable:!1,lineColor:"#fff",textColor:"#fff",profitLineColor:"#b71e44",profitTextColor:"#fff",lossLineColor:"#749b66",lossTextColor:"#fff"},tipsConfig:{open:!0,heigh:!0,low:!0,close:!0,business:!0,riseAndFall:!0},dynamicLoadConfig:{historyVisible:!1,historyLoadCallBack:()=>{},futureVisible:!1,futureLoadCallBack:()=>{}},zoomLock:!1,isOpenDS:!1},i=e.computed(()=>({...a,...o.config})),n=e.ref(null),s=e.ref(-1),M=e.computed(()=>{var I,j;if(n.value&&((j=(I=n.value.dataset[0])==null?void 0:I.source)!=null&&j.klineData[s.value])){const z=n.value.dataset[0].source.klineData[s.value],c=[],{open:h,heigh:C,low:L,close:w,business:O,riseAndFall:S}=i.value.tipsConfig;if(h&&c.push({label:"开",value:P(z[0]),color:"rgb(153, 153, 153)"}),C&&c.push({label:"高",value:P(z[3]),color:"rgb(153, 153, 153)"}),L&&c.push({label:"低",value:P(z[2]),color:"rgb(153, 153, 153)"}),w&&c.push({label:"收",value:P(z[1]),color:"rgb(153, 153, 153)"}),O&&c.push({label:"额",value:Mt(z[4]),color:"rgb(153, 153, 153)"}),S){let V=((z[1]-z[5])/z[1]*100).toFixed(2),B=+V==0?"white":+V>0?"red":"#00ff00";c.push({label:"涨跌",value:`${V}%`,color:B})}return c}return[]}),u=e.computed(()=>{var I,j;return n.value&&((j=(I=n.value.dataset[0])==null?void 0:I.source)!=null&&j.indicatorData)?n.value.dataset[0].source.indicatorData.reduce((z,c)=>(c.data[s.value]&&z.push({label:c.key,value:P(c.data[s.value]),color:c.color}),z),[]):[]}),l=e.computed(()=>{const I=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"];if(o.priceTrendData.length>0){const j=[];return o.priceTrendData.forEach((z,c)=>{var C;(z.data[s.value]?P(z.data[s.value][1]):null)!==null&&j.push({label:z.name,value:P((C=z.data[s.value])==null?void 0:C[1]),color:I[c]})}),j}if(o.priceTrendPercentData.length>0){const j=[];return y.getOption().series.filter(c=>c.name.includes("二腿价格走势百分比图")).forEach((c,h)=>{var L;(c.data[s.value]?P(c.data[s.value][1]):null)!==null&&j.push({label:c.name.split("-")[1],value:`${P((L=c.data[s.value])==null?void 0:L[1])}%`,color:I[h]})}),j}return[]});e.watch(()=>[o.klineData,o.indicator,o.markData,o.netPositionData,o.relevanceData],()=>{r()},{deep:!0}),e.watch(()=>o.lineData,async()=>{H("st-kline组件消息:props.lineData监控,额外画线数据发生改变,重绘->line",{color:"red"}),r("line")},{deep:!0}),e.watch(()=>o.brushRange,async()=>{H("st-kline组件消息:props.brushRange监控,区域刷选数据发生改变,重绘->brush",{color:"red"}),r("brush")},{deep:!0}),e.watch(()=>o.priceTrendData,async()=>{r("priceTrend")},{deep:!0}),e.watch(()=>o.priceTrendPercentData,async()=>{r("priceTrendPercent")},{deep:!0});const r=async I=>{const z=new Map([["kline",async()=>{const c=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData),{graphic:h}=y.getOption()??{graphic:[]};n.value={...c,graphic:h},y.setOption(n.value,!0),H("st-kline组件消息:K线绘制完毕-draw",{color:"green"})}],["line",()=>{const c=y.getOption(),h=pt(o.lineData,i.value,y);n.value={...c,graphic:h},y.setOption(n.value,{replaceMerge:["graphic"]}),H("st-kline组件消息:额外画线绘制完毕-draw",{color:"green"})}],["brush",()=>{const{brushRange:c}=o;c instanceof Array&&c.length>0&&(y.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[c[0]+"",c[1]+""],xAxisIndex:0}]}),H("st-kline组件消息:区域刷选绘制完毕-draw",{color:"green"}))}],[void 0,async()=>{await r("kline"),await r("line"),await r("priceTrend"),await r("priceTrendPercent"),await r("brush")}],["history",async()=>{const c=y.getOption(),h=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData),C=h.dataset.source.klineData.length-c.dataset[0].source.klineData.length;y.setOption({...h,dataZoom:[{type:"inside",xAxisIndex:[0,0],zoomLock:i.value.zoomLock,maxValueSpan:i.value.maxValueSpan,startValue:c.dataZoom[0].startValue+C,endValue:c.dataZoom[0].endValue+C}]},!0),await r("priceTrend")}],["future",async()=>{const c=y.getOption(),h=await re(o.klineData,o.markData,o.indicator,i.value,o.netPositionData,o.relevanceData);h.dataZoom[0].start=(o.klineData.length-c.dataZoom[0].endValue+c.dataZoom[0].startValue)/o.klineData.length*100,y.setOption(h,!0),await r("priceTrend")}],["priceTrend",()=>{if(o.priceTrendData.length===0)return;const c=y.getOption(),h=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"],C=o.priceTrendData.reduce((L,w,O)=>{const{name:S,data:V}=w,B={name:`二腿价格走势图-${S}`,type:"line",data:V,symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:h[O]},lineStyle:{type:"dashed",width:1}};return L.push(B),L},[]);n.value={...c,series:[...c.series,...C]},y.setOption(n.value,{replaceMerge:["series"]})}],["priceTrendPercent",async()=>{if(o.priceTrendPercentData.length===0)return;const c=y.getOption(),h=["#FFFFFF","#FFDD00","#FF00FF","#00FF00","#FF6000","#1677FF","#7C3CC9","#FF0000","#FB9A0E","#00B7FF"],C=c.dataZoom[0].startValue,L=o.priceTrendPercentData.reduce((w,O,S)=>{const{name:V,data:B}=O,G=B.length>i.value.totalBarCount?B.slice(B.length-i.value.totalBarCount):B,q=G[C][1],De=G.map(Me=>[Me[0],(Me[1]-q)/q*100]),Le={name:`二腿价格走势百分比图-${V}`,type:"line",data:De,symbol:"none",yAxisIndex:1,connectNulls:!0,itemStyle:{color:h[S]},lineStyle:{type:"dashed",width:1}};return w.push(Le),w},[]);c.series=[...c.series.filter(w=>!w.name.includes("二腿价格走势百分比图")),...L],y.setOption(c,!0)}]]).get(I);z instanceof Function&&await z()},d=e.ref(!1),f=e.ref([]),N=I=>{const{callBack:j}=I;j instanceof Function&&j(y,d)},g=()=>{f.value=o.defaultMenuData},D=e.ref();let y,x;const b=(I,j)=>{var z,c;if(I)s.value=typeof((z=I==null?void 0:I.batch[0])==null?void 0:z.dataIndex)=="number"?(c=I==null?void 0:I.batch[0])==null?void 0:c.dataIndex:-1;else{const h=j.getOption();h.dataZoom instanceof Array&&(s.value=h.dataZoom[0].endValue)}};let k=null,_=!1,p=e.ref(!1),T=!1,m=e.ref(!1);const Y=async I=>{const j=I.batch?I.batch[0].start*i.value.totalBarCount:I.startValue;i.value.dynamicLoadConfig.historyVisible&&j<=100&&!_&&!p.value&&(_=!0,await i.value.dynamicLoadConfig.historyLoadCallBack(p),await r("history"),_=!1);const z=I.batch?I.batch[0].end===100:I.endValue>=o.klineData.length-i.value.preBarCount-1,c=I.actionIsWheel;i.value.dynamicLoadConfig.futureVisible&&z&&!T&&!m.value&&!c&&(T=!0,await i.value.dynamicLoadConfig.futureLoadCallBack(m),await r("future"),T=!1),clearTimeout(k),k=setTimeout(()=>{r("line"),r("priceTrendPercent"),clearTimeout(k),k=null},Lt)};let A=null;const E=I=>{A=setTimeout(()=>{var j;if(I.componentType==="graphic"){const{oncontextmenu:z}=((j=I.info)==null?void 0:j.event)??{};z instanceof Function&&z(I,I.info,f)}clearTimeout(A),A=null})},F=()=>{y.on("highlight",I=>{b(I,y)}),y.on("globalout",()=>{b(null,y)}),y.on("contextmenu",I=>{E(I)}),y.on("datazoom",I=>{Y(I)})},U=()=>{y.off("highlight"),y.off("globalout"),y.off("contextmenu"),y.off("datazoom")},Q=I=>{if(!y||!(I.ctrlKey||o.isSelect))return;const j=y.getOption();let{startValue:z,endValue:c,start:h,end:C}=j.dataZoom[0];const L=()=>{z!==0&&(z=z-1,c=c-1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan}))},w=()=>{if(i.value.dynamicLoadConfig.futureVisible&&!T&&!m.value)z=z+1,c=c+1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan});else{if(c===j.xAxis[0].data.length-1)return;z=z+1,c=c+1,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,maxValueSpan:i.value.maxValueSpan})}},O=()=>{if(c-z<5)return;const G=Math.floor((s.value-z)/2)+1,q=Math.floor((c-s.value)/2)+1;z=z+G,c=c-q,y.dispatchAction({type:"dataZoom",startValue:z,endValue:c,actionIsWheel:!0,maxValueSpan:i.value.maxValueSpan})},S=()=>{h=h-(C-h)/4,y.dispatchAction({type:"dataZoom",start:h,end:C,actionIsWheel:!0,maxValueSpan:i.value.maxValueSpan})},B=new Map([["ArrowLeft",L],["ArrowRight",w],["ArrowUp",O],["ArrowDown",S]]).get(I.code);B instanceof Function&&B()},$=async()=>{let I=!0;y=X.init(D.value),await r(),f.value=o.defaultMenuData,s.value=y.getOption().dataZoom[0].endValue??-1,F(),x=new ResizeObserver(()=>{if(I){I=null;return}y.resize(),r("line")}),x.observe(D.value),window.addEventListener("keydown",Q)};return e.onMounted(()=>{$()}),e.onUnmounted(()=>{U(),window.removeEventListener("keydown",Q),y.dispose(),x.disconnect(),x=null}),(I,j)=>{const z=nt,c=tt;return e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Dt,[e.createVNode(ae,{data:M.value},null,8,["data"]),e.createVNode(ae,{data:u.value},null,8,["data"]),e.createVNode(ae,{data:l.value},null,8,["data"])]),e.createVNode(st,{class:"st-kline-body",onCloseContextMenuCallBack:g},{popover:e.withCtx(()=>[e.createVNode(c,{class:"menu"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,h=>(e.openBlock(),e.createBlock(z,{key:h.label,index:h.label,class:"menuItem",onClick:C=>N(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"echartsRef",ref:D,class:e.normalizeClass(d.value?"st-kline-chart cursorPen":"st-kline-chart")},null,2)]),_:1})])}}});const vt=Z._export_sfc(ht,[["__scopeId","data-v-7f014d0e"]]),xt={class:"kline-tips"},Yt=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(t){return(o,a)=>(e.openBlock(),e.createElementBlock("div",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"kline-tips-item",style:e.normalizeStyle({color:i.color})},e.toDisplayString(i.label)+" "+e.toDisplayString(i.value),5))),128))]))}});const ce=Z._export_sfc(Yt,[["__scopeId","data-v-dc7d381b"]]);const At={class:"klineSub"},Ct={class:"klineSub-tips"},wt={key:0,class:"klineSub-tips-select"},bt={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(t,{expose:o,emit:a}){const{round:i}=ee.x;let n,s;const M=a,u=t,l=e.ref(),r=e.computed({get(){return u.modelValue},set(N){M("update:modelValue",N)}}),d=e.computed(()=>{var D;const{data:N,activeIndex:g}=u;return((D=N==null?void 0:N.subIndicator)==null?void 0:D.map(y=>({label:y.key,color:y.color,value:y.data[g]||"-"})))||[]});e.onMounted(()=>{n=X.init(l.value);let N=!0;s=new ResizeObserver(()=>{if(N){N=null;return}n.resize()}),s.observe(l.value)}),e.onUnmounted(()=>{n.dispose(),s.disconnect(),s=null});const f=(N,g)=>{const D=N[g],y=g===0?N[g]:N[g-1];return D[0]===D[1]?D[0]>=y[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:D[1]>D[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return o({connect:N=>{X.connect([N,n])},draw:(N,g)=>{e.nextTick(()=>{const{startValue:D,endValue:y,maxValueSpan:x}=N,{leftYAxisRange:b,rightYAxisRange:k}=u.data.subIndicator[0],_=u.data.subIndicator.map(p=>{if(p.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:p.data.map((T,m)=>p.seriesColor==="kline"?{value:T,itemStyle:f(u.data.data,m)}:p.seriesColor==="value"?{value:T,itemStyle:{color:T>=0?"#FF0000":"#00FFFF"}}:{value:T,itemStyle:{color:p.seriesColor}})};if(p.series==="line")return{xAxisIndex:0,yAxisIndex:p.yAxis==="right"?2:1,name:p.key,type:"line",silent:!0,symbol:"none",data:p.data,lineStyle:{width:1},itemStyle:{color:p.color}}});n.setOption({animation:!1,grid:{left:`${g.gridLeft}px`,top:"10px",right:`${g.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:D,endValue:y,maxValueSpan:x}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:p=>{const{axisDimension:T,value:m}=p;if(T==="x")return m;if(p.axisIndex===1)return String(i(m))}}},formatter:()=>""},xAxis:{type:"category",data:u.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:p=>p}},yAxis:[{position:"right"},{position:"left",min:b==="cover"?p=>p.min:null,max:b==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:k==="cover"?p=>p.min:null,max:k==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:_},!0)})}}),(N,g)=>{const D=de.ElOption,y=de.ElSelect;return e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Ct,[d.value.length?(e.openBlock(),e.createElementBlock("div",wt,[e.createVNode(y,{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=x=>r.value=x),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subIndicatorList,x=>(e.openBlock(),e.createBlock(D,{key:x.value,label:x.label,value:x.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(ce,{data:d.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:l},null,512)])}}},kt=Z._export_sfc(bt,[["__scopeId","data-v-aba58678"]]);const Ot={class:"kline-tips"},Et={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(t){const{round:o,formatValue:a}=ee.x,i=t,n=e.computed(()=>{const{data:M,activeIndex:u}=i;if(M.data&&M.data[u]){const l=M.data[u],r=[{label:"开",value:o(l[0])},{label:"高",value:o(l[3])},{label:"低",value:o(l[2])},{label:"收",value:o(l[1])}];l[4]!==null&&r.push({label:"额",value:a(l[4])});let d;return l[6]>0?d="red":l[6]<0&&(d="green"),r.push({label:"涨跌",value:`${o(l[6])}%`,color:d}),r}return[]}),s=e.computed(()=>{var l;const{data:M,activeIndex:u}=i;return((l=M==null?void 0:M.mainIndicator)==null?void 0:l.map(r=>({label:r.key,value:o(r.data[u]),color:r.color})))||[]});return(M,u)=>(e.openBlock(),e.createElementBlock("div",Ot,[e.createVNode(ce,{data:n.value},null,8,["data"]),e.createVNode(ce,{data:s.value},null,8,["data"])]))}},St=Z._export_sfc(Et,[["__scopeId","data-v-a12855fe"]]),_t={__name:"index",setup(t,{expose:o}){return o({handleKeyDown:(a,i)=>{let{startValue:n,endValue:s,maxIndex:M}=i;if(a.code==="ArrowLeft"){if(n===0)return;n=n-1,s=s-1}else if(a.code==="ArrowRight"){if(s===M)return;n=n+1,s=s+1}else if(a.code==="ArrowUp"){if(s-n<5)return;const u=Math.floor((s-n)/2)+1;n=n+u,s-n<5&&(n=s-4)}else if(a.code==="ArrowDown"){const u=Math.min(500,s-n);n=n-u-1}return{startValue:n,endValue:s}},mergeData:(a,i)=>({time:[...a.time,...i.time.slice(1)],data:[...a.data,...i.data.slice(1)],mainIndicator:a.mainIndicator.map((n,s)=>({...n,data:[...n.data,...i.mainIndicator[s].data.slice(1)]})),subIndicator:a.subIndicator.map((n,s)=>({...n,data:[...n.data,...i.subIndicator[s].data.slice(1)]}))}),getDataZoomInfoByTime:a=>{const{showStartTime:i,showEndTime:n,maxShowDays:s}=a;let M=-1,u=-1,l={};return a.time.forEach((r,d)=>{const f=r.split(" ")[0];l[f]=l[f]||0,l[f]+=1,M===-1&&new Date(r)>=new Date(i)&&(M=d),u===-1&&new Date(r)>=new Date(n)&&(u=d)}),u=u===-1?a.time.length-1:u,{startValue:M,endValue:u,maxValueSpan:Math.max(...Object.values(l))*s}}}),(a,i)=>null}};const Ft={__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(t,{expose:o,emit:a}){let i,n,s=null;const M=a,u=t,l=e.ref();e.watch(()=>u.data,()=>{f()},{deep:!0}),e.onMounted(()=>{i=X.init(l.value),r(),f();let N=!0;n=new ResizeObserver(()=>{if(N){N=null;return}i.resize()}),n.observe(l.value)}),e.onUnmounted(()=>{i.off("datazoom"),i.dispose(),n.disconnect(),n=null});const r=()=>{i.on("datazoom",N=>{N.dataZoomId&&(clearTimeout(s),s=setTimeout(()=>{const{data:g}=u,{start:D,end:y}=N,x=Math.floor(D*g.length/100),b=y===100?g.length-1:Math.floor(y*g.length/100);d(x,b),clearTimeout(s)},100))})},d=(N,g)=>{const D=u.data;if(D.length===0)return;const y=D[N][0].split(" ")[0],x=D[g][0].split(" ")[0];M("change",{startTime:`${y} 00:00:00`,endTime:`${x} 24:00:00`})},f=()=>{const{data:N}=u;if(N.length===0)return;const g=N.map(y=>y[0].split(" ")[0]),D=N.map(y=>y[1]);i.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:g,show:!1},yAxis:{type:"value"},series:[{data:D,type:"line"}]},!0)};return o({resetSlide:(N,g,D)=>{let y=-1,x=-1;u.data.forEach((b,k)=>{y===-1&&b[0]===N?y=k:y===-1&&new Date(b[0])>new Date(N)&&(y=k-1),(x===-1&&b[0]===g||x===-1&&new Date(b[0])>new Date(g))&&(x=k)}),x=x===-1?u.data.length-1:x,i.setOption({dataZoom:[{show:!0,startValue:y,endValue:x,maxValueSpan:D,textStyle:{color:"#ccc"}},{type:"inside",startValue:y,endValue:x,maxValueSpan:D}]})},resize:()=>{i==null||i.resize()}}),(N,g)=>(e.openBlock(),e.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:l},null,512))}},Qt=Z._export_sfc(Ft,[["__scopeId","data-v-7a2f3dd0"]]),Bt={install(t){t.component("st-kline",vt),t.component("st-kline-sub-new",kt),t.component("st-kline-tips-new",St),t.component("st-kline-slide-new",Qt),t.component("st-kline-utils-new",_t)}};module.exports=Bt;
|
package/es/Kline.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { u as q, _ as Ie, w as Je,
|
|
1
|
+
import { u as q, _ as Ie, w as Je, n as Ne, r as Le, o as dt, b as Ee, t as je, i as ie, p as $e, d as ge, g as Nt, q as Ve, s as Xe, v as Se } from "./base-f7877059.js";
|
|
2
2
|
import "./el-tooltip-4ed993c7.js";
|
|
3
|
-
import { E as qe } from "./el-popper-
|
|
3
|
+
import { E as qe } from "./el-popper-6126b1f6.js";
|
|
4
4
|
import { defineComponent as H, openBlock as E, createBlock as ce, Transition as Ke, mergeProps as et, unref as zt, toHandlers as yt, withCtx as ee, renderSlot as X, computed as w, getCurrentInstance as _e, inject as pe, ref as k, reactive as Fe, watch as J, provide as Oe, onMounted as se, onBeforeUnmount as tt, h as U, Fragment as ne, withDirectives as nt, vShow as jt, watchEffect as gt, nextTick as Qe, toRef as pt, resolveComponent as ft, createElementBlock as Q, normalizeClass as Me, createElementVNode as te, createTextVNode as ot, toDisplayString as le, renderList as me, normalizeStyle as Pe, createCommentVNode as at, onUnmounted as Be, createVNode as K } from "vue";
|
|
5
5
|
import * as fe from "echarts";
|
|
6
6
|
import { _ as oe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
|
-
import { x as De } from "./index-
|
|
7
|
+
import { x as De } from "./index-57f8f7b9.js";
|
|
8
8
|
import { i as Tt, t as It } from "./index.esm-8d9a2abe.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { E as G, t as ye } from "./index-
|
|
9
|
+
import { a as mt } from "./el-scrollbar-e0493906.js";
|
|
10
|
+
import { g as Dt, h as Lt, E as it, j as ue, m as vt } from "./use-form-common-props-f3a520d0.js";
|
|
11
|
+
import { E as G, t as ye } from "./index-048dca7e.js";
|
|
12
12
|
import { T as ht } from "./index-657047bb.js";
|
|
13
|
-
import { C as xt } from "./el-tag-
|
|
13
|
+
import { C as xt } from "./el-tag-5becabc9.js";
|
|
14
14
|
import { m as Yt } from "./typescript-7ae59c4c.js";
|
|
15
|
-
import { f as At } from "./vnode-
|
|
16
|
-
import { E as Ct, a as bt } from "./el-select-
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
15
|
+
import { f as At } from "./vnode-25d7c2f5.js";
|
|
16
|
+
import { E as Ct, a as bt } from "./el-select-513126a5.js";
|
|
17
|
+
import "./index-7e40be25.js";
|
|
18
|
+
import "./castArray-18f43497.js";
|
|
19
19
|
import "./event-09e37cc8.js";
|
|
20
|
-
import "./scroll-
|
|
21
|
-
import "./debounce-
|
|
20
|
+
import "./scroll-3b521d81.js";
|
|
21
|
+
import "./debounce-2336e546.js";
|
|
22
22
|
const wt = H({
|
|
23
23
|
name: "ElCollapseTransition"
|
|
24
24
|
}), Ot = /* @__PURE__ */ H({
|
package/es/KlineNew.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),B=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-25aca205.cjs");require("./base-adc4e34e.cjs");require("./el-tag-a45bdd1e.cjs");const R=require("./el-select-4987a187.cjs");require("./el-scrollbar-8cb3663b.cjs");require("./el-popper-4da22fdc.cjs");const N=require("echarts");require("./use-form-common-props-96d2ea48.cjs");require("./castArray-e6cd255c.cjs");require("./index-4090cb2c.cjs");require("./index-f14354e6.cjs");require("./event-61f49698.cjs");require("./scroll-c7ef9180.cjs");require("./debounce-3ad03224.cjs");function $(_){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(_){for(const A in _)if(A!=="default"){const h=Object.getOwnPropertyDescriptor(_,A);Object.defineProperty(v,A,h.get?h:{enumerable:!0,get:()=>_[A]})}}return v.default=_,Object.freeze(v)}const E=$(N),M=t.defineComponent({__name:"index",setup(_,{expose:v}){let A=!1,h=!0,y=[];const S=(f,u)=>f.length>u?f.slice(f.length-u):f;return v({initTalib:async()=>{if(!A)A=!0,await B.init("./talib.wasm"),h=!1,y.forEach(f=>{f()});else if(h)return new Promise(f=>{y.push(f)})},handleKeyDown:(f,u)=>{let{startValue:o,endValue:d,maxIndex:m}=u;if(f.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(f.code==="ArrowRight"){if(d===m)return;o=o+1,d=d+1}else if(f.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(f.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:f=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:m}=f;let p=-1,e=-1,i={};return d.forEach((a,l)=>{const r=a.split(" ")[0];i[r]=i[r]||0,i[r]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=l),new Date(a)<=new Date(o)&&(e=l)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*m}},formatDataBySlide:f=>{const{originDrawData:u,addData:o,startTime:d,endTime:m}=f,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:l,timeRange:r}=f,{loadAddCount:D,preLoadCount:F}=l;let x=[],b=[],V=[],w=[];d&&m?(x=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(m)),w=[...o]):m?(x=[...o.filter((s,n)=>n>=o.length-D&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1])),...u.originData],w=[...o,...u.originData]):d&&(x=[...u.originData,...o.filter((s,n)=>n>=F&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1]))],w=x),x.forEach((s,n)=>{b.push([s[1],s[4],s[3],s[2],n===0?0:x[n-1][4],s[6]]),V.push(s[0])});let c=[],g=[];const I={time:[],open:[],close:[],high:[],low:[],originData:w};let C=null,T=null;return w.forEach((s,n)=>{I.time.push(s[0]),I.open.push(s[1]),I.close.push(s[4]),I.high.push(s[2]),I.low.push(s[3]),s[0]===x[0][0]&&(C=n),s[0]===x[x.length-1][0]&&(T=n+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:n}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:n?n(B.talib,I,k).slice(C,T):[]}}),g=a.find(({value:s})=>s===i).config.reduce((s,n)=>{const{source:k,calculationFn:q}=n;return k==="calculation"?[...s,{...n,data:q?q(B.talib,I).slice(C,T):[]}]:s},[]),{originData:x,candlestickData:b,mainIndicatorData:c,subIndicatorData:g,xAxisData:V,startTime:x[0][0],endTime:x[x.length-1][0],length:x.length}},formatDataByCount:f=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:m,subIndicator:p,subIndicatorList:e,config:i}=f;let a={};const{addCount:l,preLoadCount:r}=i,D=[],F=[],x=[],b=[],V=[];let w=[],c=[];const g=o.filter((n,k)=>(D.push(n[0]),F.push(n[1]),x.push(n[4]),b.push(n[2]),V.push(n[3]),w.push(n[0]),c.push([n[1],n[4],n[3],n[2],k===0?0:o[k-1][4],n[6]]),o.length>=l+r-1?k>=r:!0));w=S(w,g.length),c=S(c,g.length);const I={time:D,open:F,close:x,high:b,low:V,originData:o},T=m.find(n=>n.value===d).config.map(n=>({...n,data:S(n.calculationFn?n.calculationFn(B.talib,I,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,q)=>q.source==="calculation"?[...k,{...q,data:S(q.calculationFn?q.calculationFn(B.talib,I):[],w.length)}]:k,[])),u.length?a={originData:[...g,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((n,k)=>({...n,data:[...T[k].data,...n.data]})),subIndicatorData:u.subIndicatorData.map((n,k)=>({...n,data:[...s[k].data,...n.data]}))}:a={originData:g,xAxisData:w,candlestickData:c,mainIndicatorData:T,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(f,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(_){return(v,A)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.data,(h,y)=>(t.openBlock(),t.createElementBlock("div",{key:y,class:"kline-tips-item",style:t.normalizeStyle({color:h.color})},t.toDisplayString(h.label)+" "+t.toDisplayString(h.value),5))),128))]))}});const O=L._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0}},setup(_){const{round:v,multiply:A,divide:h,subtract:y,formatValue:S}=z.x,f=_,u=t.computed(()=>{const{drawData:d,activeIndex:m}=f;if(d.candlestickData&&d.candlestickData[m]){const p=d.candlestickData[m],e=[{label:"开",value:v(p[0])},{label:"高",value:v(p[3])},{label:"低",value:v(p[2])},{label:"收",value:v(p[1])}];p[5]!==void 0&&e.push({label:"额",value:S(p[5])});const i=v(A(h(y(p[1],p[4]),Math.abs(p[4])),100));let a;return i>0?a="red":i<0&&(a="green"),e.push({label:"涨跌",value:`${i}%`,color:a}),e}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:m}=f;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:v(e.data[m]),color:e.color})))||[]});return(d,m)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=L._export_sfc(U,[["__scopeId","data-v-a1302914"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(_,{expose:v,emit:A}){const{round:h}=z.x;let y,S;const f=A,u=_,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){f("update:modelValue",e)}}),m=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(l=>l.value===d.value);return e.originData&&e.originData[i]?a.config.map(l=>{var D,F;let r="-";return l.source==="origin"?r=e.originData[i][l.dataIndex]||"-":l.source==="calculation"&&(r=(((F=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===l.key))==null?void 0:F.data)||[])[i]),{label:l.key,color:l.color,value:r==="-"?r:h(r)}}):[]});t.onMounted(()=>{y=E.init(o.value);let e=!0;S=new ResizeObserver(()=>{if(e){e=null;return}y.resize()}),S.observe(o.value)}),t.onUnmounted(()=>{y.dispose(),S.disconnect(),S=null});const p=(e,i)=>{const a=e[i],l=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=l[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return v({connect:e=>{E.connect([e,y])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:l}=e,{xAxisData:r,subIndicatorData:D,candlestickData:F,originData:x}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),V=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=x.map(g=>g[b.dataIndex]):c=((w=D==null?void 0:D.find(g=>g.key===b.dataIndex))==null?void 0:w.data)||[],V.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((g,I)=>b.color==="kline"?{value:g,itemStyle:p(F,I)}:b.color==="value"?{value:g,itemStyle:{color:g>=0?"#FF0000":"#00FFFF"}}:{value:g,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let g=[];c.source==="origin"?g=x.map(I=>I[c.dataIndex]):c.source==="calculation"&&(g=c.data),V.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:g,lineStyle:{width:1},itemStyle:{color:c.color}})}}),y.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:l}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:g,value:I}=c;if(g==="x")return I;if(c.axisIndex===1)return String(h(I))}}},formatter:()=>""},xAxis:{type:"category",data:r,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:V},!0)})}}),(e,i)=>{const a=R.ElOption,l=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[m.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(l,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=r=>d.value=r),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.subIndicatorList,r=>(t.openBlock(),t.createBlock(a,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:m.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=L._export_sfc(J,[["__scopeId","data-v-0a2f256e"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(_,{expose:v,emit:A}){let h,y,S=null;const f=A,u=_,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{h=E.init(o.value),d(),p();let e=!0;y=new ResizeObserver(()=>{if(e){e=null;return}h.resize()}),y.observe(o.value)}),t.onUnmounted(()=>{h.off("datazoom"),h.dispose(),y.disconnect(),y=null});const d=()=>{h.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(S),S=setTimeout(()=>{const{data:i}=u,{start:a,end:l}=e,r=Math.floor(a*i.length/100),D=l===100?i.length-1:Math.floor(l*i.length/100);m(r,D),clearTimeout(S)},100))})},m=(e,i)=>{const a=u.data;if(a.length===0)return;const l=a[e][0].split(" ")[0],r=a[i][0].split(" ")[0];f("change",{startTime:`${l} 00:00:00`,endTime:`${r} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(l=>l[0].split(" ")[0]),a=e.map(l=>l[1]);h.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return v({resetSlide:(e,i,a)=>{let l=-1,r=-1;u.data.forEach((D,F)=>{l===-1&&D[0]===e?l=F:l===-1&&new Date(D[0])>new Date(e)&&(l=F-1),(r===-1&&D[0]===i||r===-1&&new Date(D[0])>new Date(i))&&(r=F)}),r=r===-1?u.data.length-1:r,h.setOption({dataZoom:[{show:!0,startValue:l,endValue:r,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:l,endValue:r,maxValueSpan:a}]})},resize:()=>{h==null||h.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=L._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(_){_.component("st-klineUtils",M),_.component("st-klineSub",Q),_.component("st-klineTips",Z),_.component("st-klineSlide",X)}};module.exports=ee;
|
|
1
|
+
"use strict";const t=require("vue"),B=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-dc273ea2.cjs");require("./base-ec05f348.cjs");require("./el-tag-3b03d13e.cjs");const R=require("./el-select-928f8c19.cjs");require("./el-scrollbar-d1c3e7f7.cjs");require("./el-popper-f62316cd.cjs");const N=require("echarts");require("./use-form-common-props-1b84d8f4.cjs");require("./index-80a2b137.cjs");require("./castArray-a45823fe.cjs");require("./index-e1e83173.cjs");require("./event-61f49698.cjs");require("./scroll-41224831.cjs");require("./debounce-b2ff12bd.cjs");function $(_){const v=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(_){for(const A in _)if(A!=="default"){const h=Object.getOwnPropertyDescriptor(_,A);Object.defineProperty(v,A,h.get?h:{enumerable:!0,get:()=>_[A]})}}return v.default=_,Object.freeze(v)}const E=$(N),M=t.defineComponent({__name:"index",setup(_,{expose:v}){let A=!1,h=!0,y=[];const S=(f,u)=>f.length>u?f.slice(f.length-u):f;return v({initTalib:async()=>{if(!A)A=!0,await B.init("./talib.wasm"),h=!1,y.forEach(f=>{f()});else if(h)return new Promise(f=>{y.push(f)})},handleKeyDown:(f,u)=>{let{startValue:o,endValue:d,maxIndex:m}=u;if(f.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(f.code==="ArrowRight"){if(d===m)return;o=o+1,d=d+1}else if(f.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(f.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:f=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:m}=f;let p=-1,e=-1,i={};return d.forEach((a,l)=>{const r=a.split(" ")[0];i[r]=i[r]||0,i[r]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=l),new Date(a)<=new Date(o)&&(e=l)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*m}},formatDataBySlide:f=>{const{originDrawData:u,addData:o,startTime:d,endTime:m}=f,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:l,timeRange:r}=f,{loadAddCount:D,preLoadCount:F}=l;let x=[],b=[],V=[],w=[];d&&m?(x=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(m)),w=[...o]):m?(x=[...o.filter((s,n)=>n>=o.length-D&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1])),...u.originData],w=[...o,...u.originData]):d&&(x=[...u.originData,...o.filter((s,n)=>n>=F&&new Date(r[0])<=new Date(s[0])&&new Date(s[0])<=new Date(r[1]))],w=x),x.forEach((s,n)=>{b.push([s[1],s[4],s[3],s[2],n===0?0:x[n-1][4],s[6]]),V.push(s[0])});let c=[],g=[];const I={time:[],open:[],close:[],high:[],low:[],originData:w};let C=null,T=null;return w.forEach((s,n)=>{I.time.push(s[0]),I.open.push(s[1]),I.close.push(s[4]),I.high.push(s[2]),I.low.push(s[3]),s[0]===x[0][0]&&(C=n),s[0]===x[x.length-1][0]&&(T=n+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:n}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:n?n(B.talib,I,k).slice(C,T):[]}}),g=a.find(({value:s})=>s===i).config.reduce((s,n)=>{const{source:k,calculationFn:q}=n;return k==="calculation"?[...s,{...n,data:q?q(B.talib,I).slice(C,T):[]}]:s},[]),{originData:x,candlestickData:b,mainIndicatorData:c,subIndicatorData:g,xAxisData:V,startTime:x[0][0],endTime:x[x.length-1][0],length:x.length}},formatDataByCount:f=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:m,subIndicator:p,subIndicatorList:e,config:i}=f;let a={};const{addCount:l,preLoadCount:r}=i,D=[],F=[],x=[],b=[],V=[];let w=[],c=[];const g=o.filter((n,k)=>(D.push(n[0]),F.push(n[1]),x.push(n[4]),b.push(n[2]),V.push(n[3]),w.push(n[0]),c.push([n[1],n[4],n[3],n[2],k===0?0:o[k-1][4],n[6]]),o.length>=l+r-1?k>=r:!0));w=S(w,g.length),c=S(c,g.length);const I={time:D,open:F,close:x,high:b,low:V,originData:o},T=m.find(n=>n.value===d).config.map(n=>({...n,data:S(n.calculationFn?n.calculationFn(B.talib,I,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,q)=>q.source==="calculation"?[...k,{...q,data:S(q.calculationFn?q.calculationFn(B.talib,I):[],w.length)}]:k,[])),u.length?a={originData:[...g,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((n,k)=>({...n,data:[...T[k].data,...n.data]})),subIndicatorData:u.subIndicatorData.map((n,k)=>({...n,data:[...s[k].data,...n.data]}))}:a={originData:g,xAxisData:w,candlestickData:c,mainIndicatorData:T,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(f,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(_){return(v,A)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.data,(h,y)=>(t.openBlock(),t.createElementBlock("div",{key:y,class:"kline-tips-item",style:t.normalizeStyle({color:h.color})},t.toDisplayString(h.label)+" "+t.toDisplayString(h.value),5))),128))]))}});const O=L._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0}},setup(_){const{round:v,multiply:A,divide:h,subtract:y,formatValue:S}=z.x,f=_,u=t.computed(()=>{const{drawData:d,activeIndex:m}=f;if(d.candlestickData&&d.candlestickData[m]){const p=d.candlestickData[m],e=[{label:"开",value:v(p[0])},{label:"高",value:v(p[3])},{label:"低",value:v(p[2])},{label:"收",value:v(p[1])}];p[5]!==void 0&&e.push({label:"额",value:S(p[5])});const i=v(A(h(y(p[1],p[4]),Math.abs(p[4])),100));let a;return i>0?a="red":i<0&&(a="green"),e.push({label:"涨跌",value:`${i}%`,color:a}),e}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:m}=f;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:v(e.data[m]),color:e.color})))||[]});return(d,m)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=L._export_sfc(U,[["__scopeId","data-v-a1302914"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(_,{expose:v,emit:A}){const{round:h}=z.x;let y,S;const f=A,u=_,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){f("update:modelValue",e)}}),m=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(l=>l.value===d.value);return e.originData&&e.originData[i]?a.config.map(l=>{var D,F;let r="-";return l.source==="origin"?r=e.originData[i][l.dataIndex]||"-":l.source==="calculation"&&(r=(((F=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===l.key))==null?void 0:F.data)||[])[i]),{label:l.key,color:l.color,value:r==="-"?r:h(r)}}):[]});t.onMounted(()=>{y=E.init(o.value);let e=!0;S=new ResizeObserver(()=>{if(e){e=null;return}y.resize()}),S.observe(o.value)}),t.onUnmounted(()=>{y.dispose(),S.disconnect(),S=null});const p=(e,i)=>{const a=e[i],l=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=l[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return v({connect:e=>{E.connect([e,y])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:l}=e,{xAxisData:r,subIndicatorData:D,candlestickData:F,originData:x}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),V=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=x.map(g=>g[b.dataIndex]):c=((w=D==null?void 0:D.find(g=>g.key===b.dataIndex))==null?void 0:w.data)||[],V.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((g,I)=>b.color==="kline"?{value:g,itemStyle:p(F,I)}:b.color==="value"?{value:g,itemStyle:{color:g>=0?"#FF0000":"#00FFFF"}}:{value:g,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let g=[];c.source==="origin"?g=x.map(I=>I[c.dataIndex]):c.source==="calculation"&&(g=c.data),V.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:g,lineStyle:{width:1},itemStyle:{color:c.color}})}}),y.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:l}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:g,value:I}=c;if(g==="x")return I;if(c.axisIndex===1)return String(h(I))}}},formatter:()=>""},xAxis:{type:"category",data:r,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:V},!0)})}}),(e,i)=>{const a=R.ElOption,l=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[m.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(l,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=r=>d.value=r),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.subIndicatorList,r=>(t.openBlock(),t.createBlock(a,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:m.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=L._export_sfc(J,[["__scopeId","data-v-0a2f256e"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(_,{expose:v,emit:A}){let h,y,S=null;const f=A,u=_,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{h=E.init(o.value),d(),p();let e=!0;y=new ResizeObserver(()=>{if(e){e=null;return}h.resize()}),y.observe(o.value)}),t.onUnmounted(()=>{h.off("datazoom"),h.dispose(),y.disconnect(),y=null});const d=()=>{h.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(S),S=setTimeout(()=>{const{data:i}=u,{start:a,end:l}=e,r=Math.floor(a*i.length/100),D=l===100?i.length-1:Math.floor(l*i.length/100);m(r,D),clearTimeout(S)},100))})},m=(e,i)=>{const a=u.data;if(a.length===0)return;const l=a[e][0].split(" ")[0],r=a[i][0].split(" ")[0];f("change",{startTime:`${l} 00:00:00`,endTime:`${r} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(l=>l[0].split(" ")[0]),a=e.map(l=>l[1]);h.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return v({resetSlide:(e,i,a)=>{let l=-1,r=-1;u.data.forEach((D,F)=>{l===-1&&D[0]===e?l=F:l===-1&&new Date(D[0])>new Date(e)&&(l=F-1),(r===-1&&D[0]===i||r===-1&&new Date(D[0])>new Date(i))&&(r=F)}),r=r===-1?u.data.length-1:r,h.setOption({dataZoom:[{show:!0,startValue:l,endValue:r,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:l,endValue:r,maxValueSpan:a}]})},resize:()=>{h==null||h.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=L._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(_){_.component("st-klineUtils",M),_.component("st-klineSub",Q),_.component("st-klineTips",Z),_.component("st-klineSlide",X)}};module.exports=ee;
|
package/es/KlineNew.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { defineComponent as R, openBlock as T, createElementBlock as L, Fragment as K, renderList as Z, normalizeStyle as H, toDisplayString as N, computed as $, createVNode as O, ref as j, onMounted as U, onUnmounted as Y, nextTick as J, createElementVNode as P, withCtx as Q, createBlock as W, createCommentVNode as X, watch as ee } from "vue";
|
|
2
2
|
import { i as te, t as z } from "./index.esm-8d9a2abe.js";
|
|
3
3
|
import { _ as q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
|
-
import { x as G } from "./index-
|
|
5
|
-
import "./base-
|
|
6
|
-
import "./el-tag-
|
|
7
|
-
import { E as ae, a as ne } from "./el-select-
|
|
8
|
-
import "./el-scrollbar-
|
|
9
|
-
import "./el-popper-
|
|
4
|
+
import { x as G } from "./index-57f8f7b9.js";
|
|
5
|
+
import "./base-f7877059.js";
|
|
6
|
+
import "./el-tag-5becabc9.js";
|
|
7
|
+
import { E as ae, a as ne } from "./el-select-513126a5.js";
|
|
8
|
+
import "./el-scrollbar-e0493906.js";
|
|
9
|
+
import "./el-popper-6126b1f6.js";
|
|
10
10
|
import * as B from "echarts";
|
|
11
|
-
import "./use-form-common-props-
|
|
12
|
-
import "./
|
|
13
|
-
import "./
|
|
14
|
-
import "./index-
|
|
11
|
+
import "./use-form-common-props-f3a520d0.js";
|
|
12
|
+
import "./index-7e40be25.js";
|
|
13
|
+
import "./castArray-18f43497.js";
|
|
14
|
+
import "./index-048dca7e.js";
|
|
15
15
|
import "./event-09e37cc8.js";
|
|
16
|
-
import "./scroll-
|
|
17
|
-
import "./debounce-
|
|
16
|
+
import "./scroll-3b521d81.js";
|
|
17
|
+
import "./debounce-2336e546.js";
|
|
18
18
|
const oe = /* @__PURE__ */ R({
|
|
19
19
|
__name: "index",
|
|
20
20
|
setup(w, { expose: A }) {
|
package/es/Pagination.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./base-adc4e34e.cjs"),D=require("./zh-cn-bf58db71.cjs"),j=require("./el-tag-a45bdd1e.cjs"),I=require("./el-select-4987a187.cjs");require("./el-scrollbar-8cb3663b.cjs");require("./el-popper-4da22fdc.cjs");const A=require("./el-input-65ed0dba.cjs"),e=require("vue"),b=require("./use-form-common-props-96d2ea48.cjs"),V=require("./typescript-b63f8e83.cjs"),U=require("./index-35665af5.cjs"),K=require("./_plugin-vue_export-helper-f246444f.cjs");require("./config-provider-957c280a.cjs");require("./castArray-e6cd255c.cjs");require("./index-4090cb2c.cjs");require("./index-f14354e6.cjs");require("./event-61f49698.cjs");require("./scroll-c7ef9180.cjs");require("./debounce-3ad03224.cjs");const F=Symbol("elPaginationKey"),O=l.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:b.iconPropType}}),W={click:a=>a instanceof MouseEvent},H=e.defineComponent({name:"ElPaginationPrev"}),J=e.defineComponent({...H,props:O,emits:W,setup(a){const u=a,{t}=l.useLocale(),s=e.computed(()=>u.disabled||u.currentPage<=1);return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-prev",disabled:e.unref(s),"aria-label":i.prevText||e.unref(t)("el.pagination.prev"),"aria-disabled":e.unref(s),onClick:g=>i.$emit("click",g)},[i.prevText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(i.prevText),1)):(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var R=l._export_sfc(J,[["__file","prev.vue"]]);const G=l.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:b.iconPropType}}),Q=e.defineComponent({name:"ElPaginationNext"}),X=e.defineComponent({...Q,props:G,emits:["click"],setup(a){const u=a,{t}=l.useLocale(),s=e.computed(()=>u.disabled||u.currentPage===u.pageCount||u.pageCount===0);return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-next",disabled:e.unref(s),"aria-label":i.nextText||e.unref(t)("el.pagination.next"),"aria-disabled":e.unref(s),onClick:g=>i.$emit("click",g)},[i.nextText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(i.nextText),1)):(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var Y=l._export_sfc(X,[["__file","next.vue"]]);const $=()=>e.inject(F,{}),Z=l.buildProps({pageSize:{type:Number,required:!0},pageSizes:{type:l.definePropType(Array),default:()=>V.mutable([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:b.componentSizes},appendSizeTo:String}),ee=e.defineComponent({name:"ElPaginationSizes"}),ae=e.defineComponent({...ee,props:Z,emits:["page-size-change"],setup(a,{emit:u}){const t=a,{t:s}=l.useLocale(),i=l.useNamespace("pagination"),d=$(),g=e.ref(t.pageSize);e.watch(()=>t.pageSizes,(p,C)=>{if(!j.isEqual(p,C)&&l.isArray(p)){const c=p.includes(t.pageSize)?t.pageSize:t.pageSizes[0];u("page-size-change",c)}}),e.watch(()=>t.pageSize,p=>{g.value=p});const m=e.computed(()=>t.pageSizes);function v(p){var C;p!==g.value&&(g.value=p,(C=d.handleSizeChange)==null||C.call(d,Number(p)))}return(p,C)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(i).e("sizes"))},[e.createVNode(e.unref(I.ElSelect),{"model-value":g.value,disabled:p.disabled,"popper-class":p.popperClass,size:p.size,teleported:p.teleported,"validate-event":!1,"append-to":p.appendSizeTo,onChange:v},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),c=>(e.openBlock(),e.createBlock(e.unref(I.ElOption),{key:c,value:c,label:c+e.unref(s)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var ne=l._export_sfc(ae,[["__file","sizes.vue"]]);const te=l.buildProps({size:{type:String,values:b.componentSizes}}),re=e.defineComponent({name:"ElPaginationJumper"}),oe=e.defineComponent({...re,props:te,setup(a){const{t:u}=l.useLocale(),t=l.useNamespace("pagination"),{pageCount:s,disabled:i,currentPage:d,changeEvent:g}=$(),m=e.ref(),v=e.computed(()=>{var c;return(c=m.value)!=null?c:d==null?void 0:d.value});function p(c){m.value=c?+c:""}function C(c){c=Math.trunc(+c),g==null||g(c),m.value=void 0}return(c,x)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(t).e("jump")),disabled:e.unref(i)},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(t).e("goto")])},e.toDisplayString(e.unref(u)("el.pagination.goto")),3),e.createVNode(e.unref(A.ElInput),{size:c.size,class:e.normalizeClass([e.unref(t).e("editor"),e.unref(t).is("in-pagination")]),min:1,max:e.unref(s),disabled:e.unref(i),"model-value":e.unref(v),"validate-event":!1,"aria-label":e.unref(u)("el.pagination.page"),type:"number","onUpdate:modelValue":p,onChange:C},null,8,["size","class","max","disabled","model-value","aria-label"]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(t).e("classifier")])},e.toDisplayString(e.unref(u)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var le=l._export_sfc(oe,[["__file","jumper.vue"]]);const ie=l.buildProps({total:{type:Number,default:1e3}}),ue=e.defineComponent({name:"ElPaginationTotal"}),se=e.defineComponent({...ue,props:ie,setup(a){const{t:u}=l.useLocale(),t=l.useNamespace("pagination"),{disabled:s}=$();return(i,d)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(t).e("total")),disabled:e.unref(s)},e.toDisplayString(e.unref(u)("el.pagination.total",{total:i.total})),11,["disabled"]))}});var ce=l._export_sfc(se,[["__file","total.vue"]]);const pe=l.buildProps({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),de=e.defineComponent({name:"ElPaginationPager"}),ge=e.defineComponent({...de,props:pe,emits:["change"],setup(a,{emit:u}){const t=a,s=l.useNamespace("pager"),i=l.useNamespace("icon"),{t:d}=l.useLocale(),g=e.ref(!1),m=e.ref(!1),v=e.ref(!1),p=e.ref(!1),C=e.ref(!1),c=e.ref(!1),x=e.computed(()=>{const o=t.pagerCount,n=(o-1)/2,r=Number(t.currentPage),P=Number(t.pageCount);let h=!1,S=!1;P>o&&(r>o-n&&(h=!0),r<P-n&&(S=!0));const B=[];if(h&&!S){const k=P-(o-2);for(let y=k;y<P;y++)B.push(y)}else if(!h&&S)for(let k=2;k<o;k++)B.push(k);else if(h&&S){const k=Math.floor(o/2)-1;for(let y=r-k;y<=r+k;y++)B.push(y)}else for(let k=2;k<P;k++)B.push(k);return B}),N=e.computed(()=>["more","btn-quickprev",i.b(),s.is("disabled",t.disabled)]),_=e.computed(()=>["more","btn-quicknext",i.b(),s.is("disabled",t.disabled)]),f=e.computed(()=>t.disabled?-1:0);e.watchEffect(()=>{const o=(t.pagerCount-1)/2;g.value=!1,m.value=!1,t.pageCount>t.pagerCount&&(t.currentPage>t.pagerCount-o&&(g.value=!0),t.currentPage<t.pageCount-o&&(m.value=!0))});function E(o=!1){t.disabled||(o?v.value=!0:p.value=!0)}function q(o=!1){o?C.value=!0:c.value=!0}function M(o){const n=o.target;if(n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("number")){const r=Number(n.textContent);r!==t.currentPage&&u("change",r)}else n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("more")&&w(o)}function w(o){const n=o.target;if(n.tagName.toLowerCase()==="ul"||t.disabled)return;let r=Number(n.textContent);const P=t.pageCount,h=t.currentPage,S=t.pagerCount-2;n.className.includes("more")&&(n.className.includes("quickprev")?r=h-S:n.className.includes("quicknext")&&(r=h+S)),Number.isNaN(+r)||(r<1&&(r=1),r>P&&(r=P)),r!==h&&u("change",r)}return(o,n)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(s).b()),onClick:w,onKeyup:e.withKeys(M,["enter"])},[o.pageCount>0?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===1),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===1,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:1}),tabindex:e.unref(f)}," 1 ",10,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0),g.value?(e.openBlock(),e.createElementBlock("li",{key:1,class:e.normalizeClass(e.unref(N)),tabindex:e.unref(f),"aria-label":e.unref(d)("el.pagination.prevPages",{pager:o.pagerCount-2}),onMouseenter:r=>E(!0),onMouseleave:r=>v.value=!1,onFocus:r=>q(!0),onBlur:r=>C.value=!1},[(v.value||C.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(b.d_arrow_left_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(b.more_filled_default),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),r=>(e.openBlock(),e.createElementBlock("li",{key:r,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===r),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===r,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:r}),tabindex:e.unref(f)},e.toDisplayString(r),11,["aria-current","aria-label","tabindex"]))),128)),m.value?(e.openBlock(),e.createElementBlock("li",{key:2,class:e.normalizeClass(e.unref(_)),tabindex:e.unref(f),"aria-label":e.unref(d)("el.pagination.nextPages",{pager:o.pagerCount-2}),onMouseenter:r=>E(),onMouseleave:r=>p.value=!1,onFocus:r=>q(),onBlur:r=>c.value=!1},[(p.value||c.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(b.d_arrow_right_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(b.more_filled_default),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):e.createCommentVNode("v-if",!0),o.pageCount>1?(e.openBlock(),e.createElementBlock("li",{key:3,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===o.pageCount),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===o.pageCount,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:o.pageCount}),tabindex:e.unref(f)},e.toDisplayString(o.pageCount),11,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0)],42,["onKeyup"]))}});var fe=l._export_sfc(ge,[["__file","pager.vue"]]);const z=a=>typeof a!="number",me=l.buildProps({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:a=>l.isNumber(a)&&Math.trunc(a)===a&&a>4&&a<22&&a%2===1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:l.definePropType(Array),default:()=>V.mutable([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:b.iconPropType,default:()=>b.arrow_left_default},nextText:{type:String,default:""},nextIcon:{type:b.iconPropType,default:()=>b.arrow_right_default},teleported:{type:Boolean,default:!0},small:Boolean,size:b.useSizeProp,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),be={"update:current-page":a=>l.isNumber(a),"update:page-size":a=>l.isNumber(a),"size-change":a=>l.isNumber(a),change:(a,u)=>l.isNumber(a)&&l.isNumber(u),"current-change":a=>l.isNumber(a),"prev-click":a=>l.isNumber(a),"next-click":a=>l.isNumber(a)},L="ElPagination";var ve=e.defineComponent({name:L,props:me,emits:be,setup(a,{emit:u,slots:t}){const{t:s}=l.useLocale(),i=l.useNamespace("pagination"),d=e.getCurrentInstance().vnode.props||{},g=b.useGlobalSize(),m=e.computed(()=>{var n;return a.small?"small":(n=a.size)!=null?n:g.value});U.useDeprecated({from:"small",replacement:"size",version:"3.0.0",scope:"el-pagination",ref:"https://element-plus.org/zh-CN/component/pagination.html"},e.computed(()=>!!a.small));const v="onUpdate:currentPage"in d||"onUpdate:current-page"in d||"onCurrentChange"in d,p="onUpdate:pageSize"in d||"onUpdate:page-size"in d||"onSizeChange"in d,C=e.computed(()=>{if(z(a.total)&&z(a.pageCount)||!z(a.currentPage)&&!v)return!1;if(a.layout.includes("sizes")){if(z(a.pageCount)){if(!z(a.total)&&!z(a.pageSize)&&!p)return!1}else if(!p)return!1}return!0}),c=e.ref(z(a.defaultPageSize)?10:a.defaultPageSize),x=e.ref(z(a.defaultCurrentPage)?1:a.defaultCurrentPage),N=e.computed({get(){return z(a.pageSize)?c.value:a.pageSize},set(n){z(a.pageSize)&&(c.value=n),p&&(u("update:page-size",n),u("size-change",n))}}),_=e.computed(()=>{let n=0;return z(a.pageCount)?z(a.total)||(n=Math.max(1,Math.ceil(a.total/N.value))):n=a.pageCount,n}),f=e.computed({get(){return z(a.currentPage)?x.value:a.currentPage},set(n){let r=n;n<1?r=1:n>_.value&&(r=_.value),z(a.currentPage)&&(x.value=r),v&&(u("update:current-page",r),u("current-change",r))}});e.watch(_,n=>{f.value>n&&(f.value=n)}),e.watch([f,N],n=>{u("change",...n)},{flush:"post"});function E(n){f.value=n}function q(n){N.value=n;const r=_.value;f.value>r&&(f.value=r)}function M(){a.disabled||(f.value-=1,u("prev-click",f.value))}function w(){a.disabled||(f.value+=1,u("next-click",f.value))}function o(n,r){n&&(n.props||(n.props={}),n.props.class=[n.props.class,r].join(" "))}return e.provide(F,{pageCount:_,disabled:e.computed(()=>a.disabled),currentPage:f,changeEvent:E,handleSizeChange:q}),()=>{var n,r;if(!C.value)return l.debugWarn(L,s("el.pagination.deprecationWarning")),null;if(!a.layout||a.hideOnSinglePage&&_.value<=1)return null;const P=[],h=[],S=e.h("div",{class:i.e("rightwrapper")},h),B={prev:e.h(R,{disabled:a.disabled,currentPage:f.value,prevText:a.prevText,prevIcon:a.prevIcon,onClick:M}),jumper:e.h(le,{size:m.value}),pager:e.h(fe,{currentPage:f.value,pageCount:_.value,pagerCount:a.pagerCount,onChange:E,disabled:a.disabled}),next:e.h(Y,{disabled:a.disabled,currentPage:f.value,pageCount:_.value,nextText:a.nextText,nextIcon:a.nextIcon,onClick:w}),sizes:e.h(ne,{pageSize:N.value,pageSizes:a.pageSizes,popperClass:a.popperClass,disabled:a.disabled,teleported:a.teleported,size:m.value,appendSizeTo:a.appendSizeTo}),slot:(r=(n=t==null?void 0:t.default)==null?void 0:n.call(t))!=null?r:null,total:e.h(ce,{total:z(a.total)?0:a.total})},k=a.layout.split(",").map(T=>T.trim());let y=!1;return k.forEach(T=>{if(T==="->"){y=!0;return}y?h.push(B[T]):P.push(B[T])}),o(P[0],i.is("first")),o(P[P.length-1],i.is("last")),y&&h.length>0&&(o(h[0],i.is("first")),o(h[h.length-1],i.is("last")),P.push(S)),e.h("div",{class:[i.b(),i.is("background",a.background),i.m(m.value)]},P)}}});const Ce=l.withInstall(ve);const Pe=e.defineComponent({__name:"index",props:{pageData:{type:Object,default:()=>({pageNum:1,pageSize:10})},total:{type:Number,default:0},pageSizes:{type:Array,default:()=>[10,20,30,50]},background:{type:Boolean,default:!0},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"}},emits:["update:pageData","change"],setup(a,{emit:u}){const t=u,s=a,i=e.computed({get(){return s.pageData.pageNum},set(m){t("update:pageData",{...s.pageData,pageNum:m})}}),d=e.computed({get(){return s.pageData.pageSize},set(m){t("update:pageData",{...s.pageData,pageSize:m})}}),g=()=>{t("change",s.pageData)};return(m,v)=>{const p=Ce,C=D.ElConfigProvider;return e.openBlock(),e.createBlock(C,{locale:e.unref(D.zhCn)},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(p,e.mergeProps({class:"st-pagination",currentPage:i.value,"onUpdate:currentPage":v[0]||(v[0]=c=>i.value=c),"page-size":d.value,"onUpdate:pageSize":v[1]||(v[1]=c=>d.value=c),total:a.total,background:a.background,"page-sizes":a.pageSizes,layout:a.layout},m.$attrs,{onSizeChange:g,onCurrentChange:g}),null,16,["currentPage","page-size","total","background","page-sizes","layout"]),[[e.vShow,a.total]])]),_:1},8,["locale"])}}});const he=K._export_sfc(Pe,[["__scopeId","data-v-61b7745b"]]),ze={install(a){a.component("st-pagination",he)}};module.exports=ze;
|
|
1
|
+
"use strict";const l=require("./base-ec05f348.cjs"),D=require("./zh-cn-ab9a583d.cjs"),j=require("./el-tag-3b03d13e.cjs"),I=require("./el-select-928f8c19.cjs");require("./el-scrollbar-d1c3e7f7.cjs");require("./el-popper-f62316cd.cjs");const A=require("./el-input-6c6f5bda.cjs"),e=require("vue"),b=require("./use-form-common-props-1b84d8f4.cjs"),V=require("./typescript-b63f8e83.cjs"),U=require("./index-8a0b1c53.cjs"),K=require("./_plugin-vue_export-helper-f246444f.cjs");require("./config-provider-7cdfca4d.cjs");require("./index-80a2b137.cjs");require("./castArray-a45823fe.cjs");require("./index-e1e83173.cjs");require("./event-61f49698.cjs");require("./scroll-41224831.cjs");require("./debounce-b2ff12bd.cjs");const F=Symbol("elPaginationKey"),O=l.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:b.iconPropType}}),W={click:a=>a instanceof MouseEvent},H=e.defineComponent({name:"ElPaginationPrev"}),J=e.defineComponent({...H,props:O,emits:W,setup(a){const u=a,{t}=l.useLocale(),s=e.computed(()=>u.disabled||u.currentPage<=1);return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-prev",disabled:e.unref(s),"aria-label":i.prevText||e.unref(t)("el.pagination.prev"),"aria-disabled":e.unref(s),onClick:g=>i.$emit("click",g)},[i.prevText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(i.prevText),1)):(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var R=l._export_sfc(J,[["__file","prev.vue"]]);const G=l.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:b.iconPropType}}),Q=e.defineComponent({name:"ElPaginationNext"}),X=e.defineComponent({...Q,props:G,emits:["click"],setup(a){const u=a,{t}=l.useLocale(),s=e.computed(()=>u.disabled||u.currentPage===u.pageCount||u.pageCount===0);return(i,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-next",disabled:e.unref(s),"aria-label":i.nextText||e.unref(t)("el.pagination.next"),"aria-disabled":e.unref(s),onClick:g=>i.$emit("click",g)},[i.nextText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(i.nextText),1)):(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var Y=l._export_sfc(X,[["__file","next.vue"]]);const $=()=>e.inject(F,{}),Z=l.buildProps({pageSize:{type:Number,required:!0},pageSizes:{type:l.definePropType(Array),default:()=>V.mutable([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:b.componentSizes},appendSizeTo:String}),ee=e.defineComponent({name:"ElPaginationSizes"}),ae=e.defineComponent({...ee,props:Z,emits:["page-size-change"],setup(a,{emit:u}){const t=a,{t:s}=l.useLocale(),i=l.useNamespace("pagination"),d=$(),g=e.ref(t.pageSize);e.watch(()=>t.pageSizes,(p,C)=>{if(!j.isEqual(p,C)&&l.isArray(p)){const c=p.includes(t.pageSize)?t.pageSize:t.pageSizes[0];u("page-size-change",c)}}),e.watch(()=>t.pageSize,p=>{g.value=p});const m=e.computed(()=>t.pageSizes);function v(p){var C;p!==g.value&&(g.value=p,(C=d.handleSizeChange)==null||C.call(d,Number(p)))}return(p,C)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(i).e("sizes"))},[e.createVNode(e.unref(I.ElSelect),{"model-value":g.value,disabled:p.disabled,"popper-class":p.popperClass,size:p.size,teleported:p.teleported,"validate-event":!1,"append-to":p.appendSizeTo,onChange:v},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),c=>(e.openBlock(),e.createBlock(e.unref(I.ElOption),{key:c,value:c,label:c+e.unref(s)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var ne=l._export_sfc(ae,[["__file","sizes.vue"]]);const te=l.buildProps({size:{type:String,values:b.componentSizes}}),re=e.defineComponent({name:"ElPaginationJumper"}),oe=e.defineComponent({...re,props:te,setup(a){const{t:u}=l.useLocale(),t=l.useNamespace("pagination"),{pageCount:s,disabled:i,currentPage:d,changeEvent:g}=$(),m=e.ref(),v=e.computed(()=>{var c;return(c=m.value)!=null?c:d==null?void 0:d.value});function p(c){m.value=c?+c:""}function C(c){c=Math.trunc(+c),g==null||g(c),m.value=void 0}return(c,x)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(t).e("jump")),disabled:e.unref(i)},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(t).e("goto")])},e.toDisplayString(e.unref(u)("el.pagination.goto")),3),e.createVNode(e.unref(A.ElInput),{size:c.size,class:e.normalizeClass([e.unref(t).e("editor"),e.unref(t).is("in-pagination")]),min:1,max:e.unref(s),disabled:e.unref(i),"model-value":e.unref(v),"validate-event":!1,"aria-label":e.unref(u)("el.pagination.page"),type:"number","onUpdate:modelValue":p,onChange:C},null,8,["size","class","max","disabled","model-value","aria-label"]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(t).e("classifier")])},e.toDisplayString(e.unref(u)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var le=l._export_sfc(oe,[["__file","jumper.vue"]]);const ie=l.buildProps({total:{type:Number,default:1e3}}),ue=e.defineComponent({name:"ElPaginationTotal"}),se=e.defineComponent({...ue,props:ie,setup(a){const{t:u}=l.useLocale(),t=l.useNamespace("pagination"),{disabled:s}=$();return(i,d)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(t).e("total")),disabled:e.unref(s)},e.toDisplayString(e.unref(u)("el.pagination.total",{total:i.total})),11,["disabled"]))}});var ce=l._export_sfc(se,[["__file","total.vue"]]);const pe=l.buildProps({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),de=e.defineComponent({name:"ElPaginationPager"}),ge=e.defineComponent({...de,props:pe,emits:["change"],setup(a,{emit:u}){const t=a,s=l.useNamespace("pager"),i=l.useNamespace("icon"),{t:d}=l.useLocale(),g=e.ref(!1),m=e.ref(!1),v=e.ref(!1),p=e.ref(!1),C=e.ref(!1),c=e.ref(!1),x=e.computed(()=>{const o=t.pagerCount,n=(o-1)/2,r=Number(t.currentPage),P=Number(t.pageCount);let h=!1,S=!1;P>o&&(r>o-n&&(h=!0),r<P-n&&(S=!0));const B=[];if(h&&!S){const k=P-(o-2);for(let y=k;y<P;y++)B.push(y)}else if(!h&&S)for(let k=2;k<o;k++)B.push(k);else if(h&&S){const k=Math.floor(o/2)-1;for(let y=r-k;y<=r+k;y++)B.push(y)}else for(let k=2;k<P;k++)B.push(k);return B}),N=e.computed(()=>["more","btn-quickprev",i.b(),s.is("disabled",t.disabled)]),_=e.computed(()=>["more","btn-quicknext",i.b(),s.is("disabled",t.disabled)]),f=e.computed(()=>t.disabled?-1:0);e.watchEffect(()=>{const o=(t.pagerCount-1)/2;g.value=!1,m.value=!1,t.pageCount>t.pagerCount&&(t.currentPage>t.pagerCount-o&&(g.value=!0),t.currentPage<t.pageCount-o&&(m.value=!0))});function E(o=!1){t.disabled||(o?v.value=!0:p.value=!0)}function q(o=!1){o?C.value=!0:c.value=!0}function M(o){const n=o.target;if(n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("number")){const r=Number(n.textContent);r!==t.currentPage&&u("change",r)}else n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("more")&&w(o)}function w(o){const n=o.target;if(n.tagName.toLowerCase()==="ul"||t.disabled)return;let r=Number(n.textContent);const P=t.pageCount,h=t.currentPage,S=t.pagerCount-2;n.className.includes("more")&&(n.className.includes("quickprev")?r=h-S:n.className.includes("quicknext")&&(r=h+S)),Number.isNaN(+r)||(r<1&&(r=1),r>P&&(r=P)),r!==h&&u("change",r)}return(o,n)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(s).b()),onClick:w,onKeyup:e.withKeys(M,["enter"])},[o.pageCount>0?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===1),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===1,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:1}),tabindex:e.unref(f)}," 1 ",10,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0),g.value?(e.openBlock(),e.createElementBlock("li",{key:1,class:e.normalizeClass(e.unref(N)),tabindex:e.unref(f),"aria-label":e.unref(d)("el.pagination.prevPages",{pager:o.pagerCount-2}),onMouseenter:r=>E(!0),onMouseleave:r=>v.value=!1,onFocus:r=>q(!0),onBlur:r=>C.value=!1},[(v.value||C.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(b.d_arrow_left_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(b.more_filled_default),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):e.createCommentVNode("v-if",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),r=>(e.openBlock(),e.createElementBlock("li",{key:r,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===r),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===r,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:r}),tabindex:e.unref(f)},e.toDisplayString(r),11,["aria-current","aria-label","tabindex"]))),128)),m.value?(e.openBlock(),e.createElementBlock("li",{key:2,class:e.normalizeClass(e.unref(_)),tabindex:e.unref(f),"aria-label":e.unref(d)("el.pagination.nextPages",{pager:o.pagerCount-2}),onMouseenter:r=>E(),onMouseleave:r=>p.value=!1,onFocus:r=>q(),onBlur:r=>c.value=!1},[(p.value||c.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(b.d_arrow_right_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(b.more_filled_default),{key:1}))],42,["tabindex","aria-label","onMouseenter","onMouseleave","onFocus","onBlur"])):e.createCommentVNode("v-if",!0),o.pageCount>1?(e.openBlock(),e.createElementBlock("li",{key:3,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===o.pageCount),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===o.pageCount,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:o.pageCount}),tabindex:e.unref(f)},e.toDisplayString(o.pageCount),11,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0)],42,["onKeyup"]))}});var fe=l._export_sfc(ge,[["__file","pager.vue"]]);const z=a=>typeof a!="number",me=l.buildProps({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:a=>l.isNumber(a)&&Math.trunc(a)===a&&a>4&&a<22&&a%2===1,default:7},currentPage:Number,defaultCurrentPage:Number,layout:{type:String,default:["prev","pager","next","jumper","->","total"].join(", ")},pageSizes:{type:l.definePropType(Array),default:()=>V.mutable([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:b.iconPropType,default:()=>b.arrow_left_default},nextText:{type:String,default:""},nextIcon:{type:b.iconPropType,default:()=>b.arrow_right_default},teleported:{type:Boolean,default:!0},small:Boolean,size:b.useSizeProp,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),be={"update:current-page":a=>l.isNumber(a),"update:page-size":a=>l.isNumber(a),"size-change":a=>l.isNumber(a),change:(a,u)=>l.isNumber(a)&&l.isNumber(u),"current-change":a=>l.isNumber(a),"prev-click":a=>l.isNumber(a),"next-click":a=>l.isNumber(a)},L="ElPagination";var ve=e.defineComponent({name:L,props:me,emits:be,setup(a,{emit:u,slots:t}){const{t:s}=l.useLocale(),i=l.useNamespace("pagination"),d=e.getCurrentInstance().vnode.props||{},g=b.useGlobalSize(),m=e.computed(()=>{var n;return a.small?"small":(n=a.size)!=null?n:g.value});U.useDeprecated({from:"small",replacement:"size",version:"3.0.0",scope:"el-pagination",ref:"https://element-plus.org/zh-CN/component/pagination.html"},e.computed(()=>!!a.small));const v="onUpdate:currentPage"in d||"onUpdate:current-page"in d||"onCurrentChange"in d,p="onUpdate:pageSize"in d||"onUpdate:page-size"in d||"onSizeChange"in d,C=e.computed(()=>{if(z(a.total)&&z(a.pageCount)||!z(a.currentPage)&&!v)return!1;if(a.layout.includes("sizes")){if(z(a.pageCount)){if(!z(a.total)&&!z(a.pageSize)&&!p)return!1}else if(!p)return!1}return!0}),c=e.ref(z(a.defaultPageSize)?10:a.defaultPageSize),x=e.ref(z(a.defaultCurrentPage)?1:a.defaultCurrentPage),N=e.computed({get(){return z(a.pageSize)?c.value:a.pageSize},set(n){z(a.pageSize)&&(c.value=n),p&&(u("update:page-size",n),u("size-change",n))}}),_=e.computed(()=>{let n=0;return z(a.pageCount)?z(a.total)||(n=Math.max(1,Math.ceil(a.total/N.value))):n=a.pageCount,n}),f=e.computed({get(){return z(a.currentPage)?x.value:a.currentPage},set(n){let r=n;n<1?r=1:n>_.value&&(r=_.value),z(a.currentPage)&&(x.value=r),v&&(u("update:current-page",r),u("current-change",r))}});e.watch(_,n=>{f.value>n&&(f.value=n)}),e.watch([f,N],n=>{u("change",...n)},{flush:"post"});function E(n){f.value=n}function q(n){N.value=n;const r=_.value;f.value>r&&(f.value=r)}function M(){a.disabled||(f.value-=1,u("prev-click",f.value))}function w(){a.disabled||(f.value+=1,u("next-click",f.value))}function o(n,r){n&&(n.props||(n.props={}),n.props.class=[n.props.class,r].join(" "))}return e.provide(F,{pageCount:_,disabled:e.computed(()=>a.disabled),currentPage:f,changeEvent:E,handleSizeChange:q}),()=>{var n,r;if(!C.value)return l.debugWarn(L,s("el.pagination.deprecationWarning")),null;if(!a.layout||a.hideOnSinglePage&&_.value<=1)return null;const P=[],h=[],S=e.h("div",{class:i.e("rightwrapper")},h),B={prev:e.h(R,{disabled:a.disabled,currentPage:f.value,prevText:a.prevText,prevIcon:a.prevIcon,onClick:M}),jumper:e.h(le,{size:m.value}),pager:e.h(fe,{currentPage:f.value,pageCount:_.value,pagerCount:a.pagerCount,onChange:E,disabled:a.disabled}),next:e.h(Y,{disabled:a.disabled,currentPage:f.value,pageCount:_.value,nextText:a.nextText,nextIcon:a.nextIcon,onClick:w}),sizes:e.h(ne,{pageSize:N.value,pageSizes:a.pageSizes,popperClass:a.popperClass,disabled:a.disabled,teleported:a.teleported,size:m.value,appendSizeTo:a.appendSizeTo}),slot:(r=(n=t==null?void 0:t.default)==null?void 0:n.call(t))!=null?r:null,total:e.h(ce,{total:z(a.total)?0:a.total})},k=a.layout.split(",").map(T=>T.trim());let y=!1;return k.forEach(T=>{if(T==="->"){y=!0;return}y?h.push(B[T]):P.push(B[T])}),o(P[0],i.is("first")),o(P[P.length-1],i.is("last")),y&&h.length>0&&(o(h[0],i.is("first")),o(h[h.length-1],i.is("last")),P.push(S)),e.h("div",{class:[i.b(),i.is("background",a.background),i.m(m.value)]},P)}}});const Ce=l.withInstall(ve);const Pe=e.defineComponent({__name:"index",props:{pageData:{type:Object,default:()=>({pageNum:1,pageSize:10})},total:{type:Number,default:0},pageSizes:{type:Array,default:()=>[10,20,30,50]},background:{type:Boolean,default:!0},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"}},emits:["update:pageData","change"],setup(a,{emit:u}){const t=u,s=a,i=e.computed({get(){return s.pageData.pageNum},set(m){t("update:pageData",{...s.pageData,pageNum:m})}}),d=e.computed({get(){return s.pageData.pageSize},set(m){t("update:pageData",{...s.pageData,pageSize:m})}}),g=()=>{t("change",s.pageData)};return(m,v)=>{const p=Ce,C=D.ElConfigProvider;return e.openBlock(),e.createBlock(C,{locale:e.unref(D.zhCn)},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(p,e.mergeProps({class:"st-pagination",currentPage:i.value,"onUpdate:currentPage":v[0]||(v[0]=c=>i.value=c),"page-size":d.value,"onUpdate:pageSize":v[1]||(v[1]=c=>d.value=c),total:a.total,background:a.background,"page-sizes":a.pageSizes,layout:a.layout},m.$attrs,{onSizeChange:g,onCurrentChange:g}),null,16,["currentPage","page-size","total","background","page-sizes","layout"]),[[e.vShow,a.total]])]),_:1},8,["locale"])}}});const he=K._export_sfc(Pe,[["__scopeId","data-v-61b7745b"]]),ze={install(a){a.component("st-pagination",he)}};module.exports=ze;
|