st-comp 0.0.219 → 0.0.221
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/es/CustomFunction.cjs +5 -5
- package/es/CustomFunction.js +362 -299
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +25 -25
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +10 -10
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +425 -394
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +15 -15
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +9 -9
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +11 -11
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +13 -13
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +2 -2
- package/es/Table.cjs +1 -1
- package/es/Table.js +29 -29
- package/es/User.cjs +1 -1
- package/es/User.js +18 -18
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +17 -17
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +7 -7
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +26 -26
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +9 -9
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +5 -5
- package/es/{_initCloneObject-6429d105.cjs → _initCloneObject-52b6a510.cjs} +1 -1
- package/es/{_initCloneObject-4f4401b6.js → _initCloneObject-eaef9418.js} +2 -2
- package/es/{config-provider-285ead82.cjs → config-provider-a584d81e.cjs} +1 -1
- package/es/{config-provider-e1736401.js → config-provider-b16efd62.js} +3 -3
- package/es/{dropdown-6ba4a93d.cjs → dropdown-071c5d7e.cjs} +1 -1
- package/es/{dropdown-73ca08ef.js → dropdown-a59bba73.js} +2 -2
- package/es/{el-autocomplete-aeb7da33.cjs → el-autocomplete-a07e9439.cjs} +1 -1
- package/es/{el-autocomplete-2180fc5c.js → el-autocomplete-ba808eb6.js} +5 -5
- package/es/{el-button-e8b725f0.js → el-button-c95adb85.js} +3 -3
- package/es/{el-button-0dbb2d4a.cjs → el-button-eec58cff.cjs} +1 -1
- package/es/{el-checkbox-df0def51.js → el-checkbox-7421ccd3.js} +3 -3
- package/es/{el-checkbox-b8c558ca.cjs → el-checkbox-c25236a6.cjs} +1 -1
- package/es/{el-dialog-4330c5bd.js → el-dialog-41ab8417.js} +4 -4
- package/es/{el-dialog-5028c704.cjs → el-dialog-ae86edb8.cjs} +1 -1
- package/es/{el-form-item-f7e8255e.cjs → el-form-item-c3fe189b.cjs} +1 -1
- package/es/{el-form-item-b816e9f3.js → el-form-item-c53c374d.js} +5 -5
- package/es/{el-input-bd1ce1e9.js → el-input-2f75c4ba.js} +4 -4
- package/es/{el-input-2e9268ac.cjs → el-input-7fd293af.cjs} +1 -1
- package/es/{el-input-number-153a3742.cjs → el-input-number-22e21d16.cjs} +1 -1
- package/es/{el-input-number-088d2c66.js → el-input-number-5193fe6d.js} +4 -4
- package/es/{el-loading-03240202.cjs → el-loading-cfd86c15.cjs} +1 -1
- package/es/{el-loading-d0dac75f.js → el-loading-f6022062.js} +1 -1
- package/es/{el-menu-item-b843f5ee.cjs → el-menu-item-17dc717e.cjs} +1 -1
- package/es/{el-menu-item-c7202455.js → el-menu-item-7e881203.js} +4 -4
- package/es/{el-message-3d8d9810.cjs → el-message-5e6a6be9.cjs} +1 -1
- package/es/{el-message-box-7a952ec7.js → el-message-box-a93d2f6a.js} +9 -9
- package/es/{el-message-box-aafae7ee.cjs → el-message-box-c10adb52.cjs} +1 -1
- package/es/{el-message-290a93ff.js → el-message-e544a8f5.js} +5 -5
- package/es/{el-overlay-f72f3f3d.js → el-overlay-09ad71cd.js} +3 -3
- package/es/{el-overlay-ab0b3c66.cjs → el-overlay-9e34965f.cjs} +1 -1
- package/es/{el-popconfirm-a4a50f14.cjs → el-popconfirm-70a976bf.cjs} +1 -1
- package/es/{el-popconfirm-bdcb65fe.js → el-popconfirm-81dcd202.js} +4 -4
- package/es/{el-popper-b0ef8ed3.js → el-popper-b4f97157.js} +1 -1
- package/es/{el-popper-b37ec1ef.cjs → el-popper-b6c99b28.cjs} +1 -1
- package/es/{el-segmented-d0a61f41.js → el-segmented-b868d074.js} +2 -2
- package/es/{el-segmented-f505fd25.cjs → el-segmented-f8fce9ac.cjs} +1 -1
- package/es/{el-select-d63dc0f6.js → el-select-95627997.js} +8 -8
- package/es/{el-select-91145989.cjs → el-select-d8d91db1.cjs} +1 -1
- package/es/{el-table-column-5ad33084.js → el-table-column-376cd907.js} +9 -9
- package/es/{el-table-column-4dae58f0.cjs → el-table-column-c974cb96.cjs} +1 -1
- package/es/{el-tag-2da70fa3.js → el-tag-66cab138.js} +2 -2
- package/es/{el-tag-891b703d.cjs → el-tag-a33c4b22.cjs} +1 -1
- package/es/{el-text-d42a3be4.js → el-text-ac60d0f2.js} +1 -1
- package/es/{el-text-cfd2f326.cjs → el-text-c20a9f48.cjs} +1 -1
- package/es/index-098c2447.cjs +1 -0
- package/es/{index-eb3ca89a.cjs → index-11547a0c.cjs} +1 -1
- package/es/{index-23d35abc.js → index-1f7d4f70.js} +1 -1
- package/es/{index-f50a50b3.cjs → index-298075cf.cjs} +1 -1
- package/es/{index-af3c738f.js → index-57672682.js} +2 -2
- package/es/{index-5108cae0.js → index-844bdd85.js} +2 -2
- package/es/{index-d6a848ac.js → index-88546436.js} +2 -2
- package/es/{index-25bc46bb.cjs → index-9b9ef5dd.cjs} +1 -1
- package/es/{index-598d418b.js → index-a871c3eb.js} +111 -92
- package/es/{index-6c252a43.cjs → index-c108567d.cjs} +1 -1
- package/es/{index-0902dd2e.js → index-d91dc23f.js} +2 -2
- package/es/{index-b99c0c42.js → index-e5566b94.js} +1 -1
- package/es/{index-d7928b14.cjs → index-f3562b52.cjs} +1 -1
- package/es/{index-7a26fd8b.cjs → index-f967d6c1.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-b995a440.js → use-form-common-props-815d48a6.js} +12 -12
- package/es/{use-form-common-props-3b387353.cjs → use-form-common-props-fd9b61a0.cjs} +1 -1
- package/es/{use-global-config-2a4156cd.cjs → use-global-config-30d7d8ce.cjs} +1 -1
- package/es/{use-global-config-e20aee8c.js → use-global-config-b5e9d3d5.js} +2 -2
- package/es/{validator-7dacff4f.cjs → validator-1b8a6128.cjs} +1 -1
- package/es/{validator-6d23708b.js → validator-764a9db0.js} +1 -1
- package/es/{zh-cn-a3c3833a.cjs → zh-cn-90317f62.cjs} +1 -1
- package/es/{zh-cn-7530f035.js → zh-cn-e963c628.js} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +164 -164
- package/lib/{index-f90c4e75.js → index-d3e408b3.js} +16052 -15940
- package/lib/{python-8759beff.js → python-34cb78d0.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/components/ManageDialog.vue +31 -30
- package/packages/CustomFunction/index.vue +59 -4
- package/packages/KlineBasic/components/AverageTips/index.vue +33 -0
- package/packages/KlineBasic/components/KlineSub/index.vue +2 -2
- package/packages/KlineBasic/components/Tips/index.vue +21 -3
- package/es/index-7a85500c.cjs +0 -1
package/es/KlineConfig.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("./base-ef747d02.cjs"),A=require("./el-overlay-ab0b3c66.cjs"),F=require("./el-button-0dbb2d4a.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-f505fd25.cjs"),x=require("./el-checkbox-b8c558ca.cjs");require("./el-tag-891b703d.cjs");const U=require("./el-select-91145989.cjs"),h=require("./el-popper-b37ec1ef.cjs"),M=require("./el-divider-4713d74c.cjs"),e=require("vue"),$=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-7a85500c.cjs"),K=require("./validator-7dacff4f.cjs"),E=require("./use-form-common-props-3b387353.cjs"),H=require("./index-f50a50b3.cjs"),j=require("./index-f1c702f6.cjs"),G=require("./index-bb833443.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./index-9780a537.cjs");require("./use-global-config-2a4156cd.cjs");require("./index-6c252a43.cjs");require("./index-eea0bcb3.cjs");require("./index-d7928b14.cjs");require("./castArray-35947698.cjs");require("./index-eb3ca89a.cjs");require("./debounce-62f5b6e8.cjs");const J=u.buildProps({...A.dialogProps,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},resizable:Boolean,size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),W=A.dialogEmits;function X(r,w){const{width:v,height:c}=E.useWindowSize(),V=e.computed(()=>["ltr","rtl"].includes(r.direction)),b=e.computed(()=>["ltr","ttb"].includes(r.direction)?1:-1),s=e.computed(()=>V.value?v.value:c.value),l=e.computed(()=>u.clamp(p.value+b.value*y.value,4,s.value)),p=e.ref(0),y=e.ref(0),g=e.ref(!1),S=e.ref(!1);let C=[],I=[];const d=()=>{var f;const N=(f=w.value)==null?void 0:f.closest('[aria-modal="true"]');return N?V.value?N.offsetWidth:N.offsetHeight:100};e.watch(()=>[r.size,r.resizable],()=>{S.value=!1,p.value=0,y.value=0,i()});const a=f=>{r.resizable&&(S.value||(p.value=d(),S.value=!0),C=[f.pageX,f.pageY],g.value=!0,I.push(E.useEventListener(window,"mouseup",i),E.useEventListener(window,"mousemove",B)))},B=f=>{const{pageX:N,pageY:t}=f,m=N-C[0],z=t-C[1];y.value=V.value?m:z},i=()=>{C=[],p.value=l.value,y.value=0,g.value=!1,I.forEach(f=>f==null?void 0:f()),I=[]},k=E.useEventListener(w,"mousedown",a);return e.onBeforeUnmount(()=>{k(),i()}),{size:e.computed(()=>S.value?`${l.value}px`:u.addUnit(r.size)),isResizing:g,isHorizontal:V}}const Y=e.defineComponent({name:"ElDrawer",inheritAttrs:!1}),Q=e.defineComponent({...Y,props:J,emits:W,setup(r,{expose:w}){const v=r,c=e.useSlots();j.useDeprecated({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},e.computed(()=>!!c.title));const V=e.ref(),b=e.ref(),s=e.ref(),l=u.useNamespace("drawer"),{t:p}=G.useLocale(),{afterEnter:y,afterLeave:g,beforeLeave:S,visible:C,rendered:I,titleId:d,bodyId:a,zIndex:B,onModalClick:i,onOpenAutoFocus:k,onCloseAutoFocus:f,onFocusoutPrevented:N,onCloseRequested:t,handleClose:m}=A.useDialog(v,V),{isHorizontal:z,size:P,isResizing:o}=X(v,s);return w({handleClose:m,afterEnter:y,afterLeave:g}),(n,L)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:e.unref(l).b("fade"),onAfterEnter:e.unref(y),onAfterLeave:e.unref(g),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>{var q;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:n.modal,"overlay-class":[e.unref(l).is("drawer"),(q=n.modalClass)!=null?q:""],"z-index":e.unref(B),onClick:e.unref(i)},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElFocusTrap),{loop:"",trapped:e.unref(C),"focus-trap-el":V.value,"focus-start-el":b.value,onFocusAfterTrapped:e.unref(k),onFocusAfterReleased:e.unref(f),onFocusoutPrevented:e.unref(N),onReleaseRequested:e.unref(t)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:V,"aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:e.unref(d),"aria-describedby":e.unref(a)},n.$attrs,{class:[e.unref(l).b(),n.direction,e.unref(C)&&"open",e.unref(l).is("dragging",e.unref(o))],style:{[e.unref(z)?"width":"height"]:e.unref(P)},role:"dialog",onClick:e.withModifiers(()=>{},["stop"])}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:b,class:e.normalizeClass(e.unref(l).e("sr-focus")),tabindex:"-1"},null,2),n.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),n.headerClass])},[n.$slots.title?e.renderSlot(n.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(n.$slots,"header",{key:0,close:e.unref(m),titleId:e.unref(d),titleClass:e.unref(l).e("title")},()=>[e.createElementVNode("span",{id:e.unref(d),role:"heading","aria-level":n.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(n.title),11,["id","aria-level"])]),n.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(p)("el.drawer.close"),class:e.normalizeClass(e.unref(l).e("close-btn")),type:"button",onClick:e.unref(m)},[e.createVNode(e.unref(T.ElIcon),{class:e.normalizeClass(e.unref(l).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.close_default))]),_:1},8,["class"])],10,["aria-label","onClick"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(I)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(a),class:e.normalizeClass([e.unref(l).e("body"),n.bodyClass])},[e.renderSlot(n.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),n.footerClass])},[e.renderSlot(n.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),n.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:s,style:e.normalizeStyle({zIndex:e.unref(B)}),class:e.normalizeClass(e.unref(l).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[e.vShow,e.unref(C)]])]}),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Z=u._export_sfc(Q,[["__file","drawer.vue"]]);const ee=u.withInstall(Z),te=u.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:K.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:E.iconPropType},activeActionIcon:{type:E.iconPropType},activeIcon:{type:E.iconPropType},inactiveIcon:{type:E.iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:u.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...h.useAriaProps(["ariaLabel"])}),le={[h.UPDATE_MODEL_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.CHANGE_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.INPUT_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r)},O="ElSwitch",oe=e.defineComponent({name:O}),ae=e.defineComponent({...oe,props:te,emits:le,setup(r,{expose:w,emit:v}){const c=r,{formItem:V}=E.useFormItem(),b=E.useFormSize(),s=u.useNamespace("switch"),{inputId:l}=E.useFormItemInputId(c,{formItemContext:V}),p=E.useFormDisabled(e.computed(()=>c.loading)),y=e.ref(c.modelValue!==!1),g=e.ref(),S=e.ref(),C=e.computed(()=>[s.b(),s.m(b.value),s.is("disabled",p.value),s.is("checked",i.value)]),I=e.computed(()=>[s.e("label"),s.em("label","left"),s.is("active",!i.value)]),d=e.computed(()=>[s.e("label"),s.em("label","right"),s.is("active",i.value)]),a=e.computed(()=>({width:u.addUnit(c.width)}));e.watch(()=>c.modelValue,()=>{y.value=!0});const B=e.computed(()=>y.value?c.modelValue:!1),i=e.computed(()=>B.value===c.activeValue);[c.activeValue,c.inactiveValue].includes(B.value)||(v(h.UPDATE_MODEL_EVENT,c.inactiveValue),v(h.CHANGE_EVENT,c.inactiveValue),v(h.INPUT_EVENT,c.inactiveValue)),e.watch(i,t=>{var m;g.value.checked=t,c.validateEvent&&((m=V==null?void 0:V.validate)==null||m.call(V,"change").catch(z=>h.debugWarn()))});const k=()=>{const t=i.value?c.inactiveValue:c.activeValue;v(h.UPDATE_MODEL_EVENT,t),v(h.CHANGE_EVENT,t),v(h.INPUT_EVENT,t),e.nextTick(()=>{g.value.checked=i.value})},f=()=>{if(p.value)return;const{beforeChange:t}=c;if(!t){k();return}const m=t();[u.isPromise(m),u.isBoolean(m)].includes(!0)||h.throwError(O,"beforeChange must return type `Promise<boolean>` or `boolean`"),u.isPromise(m)?m.then(P=>{P&&k()}).catch(P=>{}):m&&k()},N=()=>{var t,m;(m=(t=g.value)==null?void 0:t.focus)==null||m.call(t)};return e.onMounted(()=>{g.value.checked=i.value}),w({focus:N,checked:i}),(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(C)),onClick:e.withModifiers(f,["prevent"])},[e.createElementVNode("input",{id:e.unref(l),ref_key:"input",ref:g,class:e.normalizeClass(e.unref(s).e("input")),type:"checkbox",role:"switch","aria-checked":e.unref(i),"aria-disabled":e.unref(p),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(p),tabindex:t.tabindex,onChange:k,onKeydown:e.withKeys(f,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(I))},[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.inactiveIcon&&t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":e.unref(i)},e.toDisplayString(t.inactiveText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{ref_key:"core",ref:S,class:e.normalizeClass(e.unref(s).e("core")),style:e.normalizeStyle(e.unref(a))},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("inner"))},[t.activeIcon||t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)?t.activeIcon:t.inactiveIcon)))]),_:1},8,["class"])):t.activeText||t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s).is("text")),"aria-hidden":!e.unref(i)},e.toDisplayString(e.unref(i)?t.activeText:t.inactiveText),11,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.loading_default))]),_:1},8,["class"])):e.unref(i)?e.renderSlot(t.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):e.unref(i)?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)])],2)],6),!t.inlinePrompt&&(t.activeIcon||t.activeText)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(d))},[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.activeIcon&&t.activeText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":!e.unref(i)},e.toDisplayString(t.activeText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0)],10,["onClick"]))}});var ne=u._export_sfc(ae,[["__file","switch.vue"]]);const re=u.withInstall(ne);const se=[{label:"买卖",value:0},{label:"开平",value:1}],D=()=>({mainIndicator:"MA",sellBuy:1,sellBuyByPrice:1,singelCycle:"6",multiCycleNum:6,multiCycleList:["1","2","3","4","5","6"],pageType:1,enable_tradeLogBrush:!0,enable_showScreenTimeRange:!0,enable_showScreenMaxPrice:!0,enable_dbClickOpenSingel:!0,enable_subChart:!0,enable_sliderChart:!0}),ie=(r,w)=>{var v;return((v=w.find(c=>c.value===r))==null?void 0:v.label)??"-"};const _=r=>(e.pushScopeId("data-v-6e5050a9"),r=r(),e.popScopeId(),r),ce={class:"kline-config element-dark"},ue={class:"setting-item"},de=_(()=>e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),me={class:"setting-item"},pe=_(()=>e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),fe={class:"setting-item"},ve=_(()=>e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),Ve={class:"setting-item"},be=_(()=>e.createElementVNode("span",{class:"label"},"单周期: ",-1)),ye={class:"setting-item"},ge=_(()=>e.createElementVNode("span",{class:"label"},"多周期: ",-1)),he={class:"mode"},ke={class:"cycleName"},Ce={class:"content"},Ne={class:"setting-item"},Ee=_(()=>e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),_e={class:"setting-item"},Be=_(()=>e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),we={class:"setting-item"},Se=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),Ie={class:"setting-item"},Te=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),ze={class:"setting-item"},Pe=_(()=>e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),Le={class:"setting-item"},qe=_(()=>e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),De={class:"setting-item"},Ae=_(()=>e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),Ue={class:"setting-footer"},Oe={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(r,{expose:w,emit:v}){const{request:c}=e.inject("stConfig"),V=v,b=r,s=e.ref(!1),l=e.reactive({}),p=e.ref([]),y=e.ref([]),g=()=>{Object.assign(l,D())},S=async()=>{const d=JSON.stringify(l);b.origin==="server"?await c.post("/common/qt/updateUserConfig",{appId:1,json:d}):localStorage.setItem("userKlineConfig",d),V("callBack",d),s.value=!1},C=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getUserConfig",{appId:1});Object.assign(l,D(),d?JSON.parse(d):{})}else{const d=localStorage.getItem("userKlineConfig");Object.assign(l,D(),d?JSON.parse(d):{})}},I=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getDict",{dictIds:[1002]});p.value=d[1002].map(a=>({label:a.dictName,value:a.dictCode}))}else p.value=b.cycleOptions};return e.onMounted(()=>{I(),y.value=b.indicatorStore.mainIndicatorList??[]}),e.watch(()=>b.indicatorStore.mainIndicatorList,()=>{y.value=b.indicatorStore.mainIndicatorList??[]}),w({open:async()=>{await C(),s.value=!0},getDefaultUserKlineConfig:D}),(d,a)=>{const B=M.ElDivider,i=U.ElOption,k=U.ElSelect,f=x.ElCheckbox,N=R.ElSegmented,t=re,m=H.ElScrollbar,z=F.ElButton,P=ee;return e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(P,{modelValue:s.value,"onUpdate:modelValue":a[12]||(a[12]=o=>s.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(m,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(B,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[e.createTextVNode("偏好设置")]),_:1}),e.createElementVNode("div",ue,[de,e.createVNode(k,{modelValue:l.mainIndicator,"onUpdate:modelValue":a[0]||(a[0]=o=>l.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",me,[pe,e.createVNode(k,{modelValue:l.sellBuy,"onUpdate:modelValue":a[1]||(a[1]=o=>l.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se),(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",fe,[ve,e.createVNode(f,{modelValue:l.sellBuyByPrice,"onUpdate:modelValue":a[2]||(a[2]=o=>l.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ve,[be,e.createVNode(k,{modelValue:l.singelCycle,"onUpdate:modelValue":a[3]||(a[3]=o=>l.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ye,[ge,e.createVNode(N,{size:"small",modelValue:l.multiCycleNum,"onUpdate:modelValue":a[4]||(a[4]=o=>l.multiCycleNum=o),options:[{label:"二图",value:2},{label:"四图",value:4},{label:"六图",value:6}],style:{height:"26px"}},null,8,["modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass(`setting-multi-box grid-${l.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.multiCycleList.slice(0,l.multiCycleNum),(o,n)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[n],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[n],"onUpdate:modelValue":L=>l.multiCycleList[n]=L,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(L,q)=>(e.openBlock(),e.createBlock(i,{key:q,label:L.label,value:L.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(n+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":a[5]||(a[5]=o=>l.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("功能配置")]),_:1}),e.createElementVNode("div",_e,[Be,e.createVNode(t,{modelValue:l.enable_tradeLogBrush,"onUpdate:modelValue":a[6]||(a[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":a[7]||(a[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":a[8]||(a[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":a[9]||(a[9]=o=>l.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("组件开关")]),_:1}),e.createElementVNode("div",Le,[qe,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":a[10]||(a[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":a[11]||(a[11]=o=>l.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Ue,[e.createVNode(z,{onClick:g},{default:e.withCtx(()=>[e.createTextVNode(" 恢复默认 ")]),_:1}),e.createVNode(z,{type:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(" 保存配置 ")]),_:1})])]),_:1},8,["modelValue"])])}}},Fe=$._export_sfc(Oe,[["__scopeId","data-v-6e5050a9"]]),Re={install(r){r.component("st-klineConfig",Fe)}};module.exports=Re;
|
|
1
|
+
"use strict";const u=require("./base-ef747d02.cjs"),A=require("./el-overlay-9e34965f.cjs"),F=require("./el-button-eec58cff.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-f8fce9ac.cjs"),x=require("./el-checkbox-c25236a6.cjs");require("./el-tag-a33c4b22.cjs");const U=require("./el-select-d8d91db1.cjs"),h=require("./el-popper-b6c99b28.cjs"),M=require("./el-divider-4713d74c.cjs"),e=require("vue"),$=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-098c2447.cjs"),K=require("./validator-1b8a6128.cjs"),E=require("./use-form-common-props-fd9b61a0.cjs"),H=require("./index-298075cf.cjs"),j=require("./index-f1c702f6.cjs"),G=require("./index-bb833443.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./index-9780a537.cjs");require("./use-global-config-30d7d8ce.cjs");require("./index-c108567d.cjs");require("./index-eea0bcb3.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./debounce-62f5b6e8.cjs");const J=u.buildProps({...A.dialogProps,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},resizable:Boolean,size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),W=A.dialogEmits;function X(r,w){const{width:v,height:c}=E.useWindowSize(),V=e.computed(()=>["ltr","rtl"].includes(r.direction)),b=e.computed(()=>["ltr","ttb"].includes(r.direction)?1:-1),s=e.computed(()=>V.value?v.value:c.value),l=e.computed(()=>u.clamp(p.value+b.value*y.value,4,s.value)),p=e.ref(0),y=e.ref(0),g=e.ref(!1),S=e.ref(!1);let C=[],I=[];const d=()=>{var f;const N=(f=w.value)==null?void 0:f.closest('[aria-modal="true"]');return N?V.value?N.offsetWidth:N.offsetHeight:100};e.watch(()=>[r.size,r.resizable],()=>{S.value=!1,p.value=0,y.value=0,i()});const a=f=>{r.resizable&&(S.value||(p.value=d(),S.value=!0),C=[f.pageX,f.pageY],g.value=!0,I.push(E.useEventListener(window,"mouseup",i),E.useEventListener(window,"mousemove",B)))},B=f=>{const{pageX:N,pageY:t}=f,m=N-C[0],z=t-C[1];y.value=V.value?m:z},i=()=>{C=[],p.value=l.value,y.value=0,g.value=!1,I.forEach(f=>f==null?void 0:f()),I=[]},k=E.useEventListener(w,"mousedown",a);return e.onBeforeUnmount(()=>{k(),i()}),{size:e.computed(()=>S.value?`${l.value}px`:u.addUnit(r.size)),isResizing:g,isHorizontal:V}}const Y=e.defineComponent({name:"ElDrawer",inheritAttrs:!1}),Q=e.defineComponent({...Y,props:J,emits:W,setup(r,{expose:w}){const v=r,c=e.useSlots();j.useDeprecated({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},e.computed(()=>!!c.title));const V=e.ref(),b=e.ref(),s=e.ref(),l=u.useNamespace("drawer"),{t:p}=G.useLocale(),{afterEnter:y,afterLeave:g,beforeLeave:S,visible:C,rendered:I,titleId:d,bodyId:a,zIndex:B,onModalClick:i,onOpenAutoFocus:k,onCloseAutoFocus:f,onFocusoutPrevented:N,onCloseRequested:t,handleClose:m}=A.useDialog(v,V),{isHorizontal:z,size:P,isResizing:o}=X(v,s);return w({handleClose:m,afterEnter:y,afterLeave:g}),(n,L)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:e.unref(l).b("fade"),onAfterEnter:e.unref(y),onAfterLeave:e.unref(g),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>{var q;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:n.modal,"overlay-class":[e.unref(l).is("drawer"),(q=n.modalClass)!=null?q:""],"z-index":e.unref(B),onClick:e.unref(i)},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElFocusTrap),{loop:"",trapped:e.unref(C),"focus-trap-el":V.value,"focus-start-el":b.value,onFocusAfterTrapped:e.unref(k),onFocusAfterReleased:e.unref(f),onFocusoutPrevented:e.unref(N),onReleaseRequested:e.unref(t)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:V,"aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:e.unref(d),"aria-describedby":e.unref(a)},n.$attrs,{class:[e.unref(l).b(),n.direction,e.unref(C)&&"open",e.unref(l).is("dragging",e.unref(o))],style:{[e.unref(z)?"width":"height"]:e.unref(P)},role:"dialog",onClick:e.withModifiers(()=>{},["stop"])}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:b,class:e.normalizeClass(e.unref(l).e("sr-focus")),tabindex:"-1"},null,2),n.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),n.headerClass])},[n.$slots.title?e.renderSlot(n.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(n.$slots,"header",{key:0,close:e.unref(m),titleId:e.unref(d),titleClass:e.unref(l).e("title")},()=>[e.createElementVNode("span",{id:e.unref(d),role:"heading","aria-level":n.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(n.title),11,["id","aria-level"])]),n.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(p)("el.drawer.close"),class:e.normalizeClass(e.unref(l).e("close-btn")),type:"button",onClick:e.unref(m)},[e.createVNode(e.unref(T.ElIcon),{class:e.normalizeClass(e.unref(l).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.close_default))]),_:1},8,["class"])],10,["aria-label","onClick"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(I)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(a),class:e.normalizeClass([e.unref(l).e("body"),n.bodyClass])},[e.renderSlot(n.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),n.footerClass])},[e.renderSlot(n.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),n.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:s,style:e.normalizeStyle({zIndex:e.unref(B)}),class:e.normalizeClass(e.unref(l).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[e.vShow,e.unref(C)]])]}),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Z=u._export_sfc(Q,[["__file","drawer.vue"]]);const ee=u.withInstall(Z),te=u.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:K.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:E.iconPropType},activeActionIcon:{type:E.iconPropType},activeIcon:{type:E.iconPropType},inactiveIcon:{type:E.iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:u.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...h.useAriaProps(["ariaLabel"])}),le={[h.UPDATE_MODEL_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.CHANGE_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.INPUT_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r)},O="ElSwitch",oe=e.defineComponent({name:O}),ae=e.defineComponent({...oe,props:te,emits:le,setup(r,{expose:w,emit:v}){const c=r,{formItem:V}=E.useFormItem(),b=E.useFormSize(),s=u.useNamespace("switch"),{inputId:l}=E.useFormItemInputId(c,{formItemContext:V}),p=E.useFormDisabled(e.computed(()=>c.loading)),y=e.ref(c.modelValue!==!1),g=e.ref(),S=e.ref(),C=e.computed(()=>[s.b(),s.m(b.value),s.is("disabled",p.value),s.is("checked",i.value)]),I=e.computed(()=>[s.e("label"),s.em("label","left"),s.is("active",!i.value)]),d=e.computed(()=>[s.e("label"),s.em("label","right"),s.is("active",i.value)]),a=e.computed(()=>({width:u.addUnit(c.width)}));e.watch(()=>c.modelValue,()=>{y.value=!0});const B=e.computed(()=>y.value?c.modelValue:!1),i=e.computed(()=>B.value===c.activeValue);[c.activeValue,c.inactiveValue].includes(B.value)||(v(h.UPDATE_MODEL_EVENT,c.inactiveValue),v(h.CHANGE_EVENT,c.inactiveValue),v(h.INPUT_EVENT,c.inactiveValue)),e.watch(i,t=>{var m;g.value.checked=t,c.validateEvent&&((m=V==null?void 0:V.validate)==null||m.call(V,"change").catch(z=>h.debugWarn()))});const k=()=>{const t=i.value?c.inactiveValue:c.activeValue;v(h.UPDATE_MODEL_EVENT,t),v(h.CHANGE_EVENT,t),v(h.INPUT_EVENT,t),e.nextTick(()=>{g.value.checked=i.value})},f=()=>{if(p.value)return;const{beforeChange:t}=c;if(!t){k();return}const m=t();[u.isPromise(m),u.isBoolean(m)].includes(!0)||h.throwError(O,"beforeChange must return type `Promise<boolean>` or `boolean`"),u.isPromise(m)?m.then(P=>{P&&k()}).catch(P=>{}):m&&k()},N=()=>{var t,m;(m=(t=g.value)==null?void 0:t.focus)==null||m.call(t)};return e.onMounted(()=>{g.value.checked=i.value}),w({focus:N,checked:i}),(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(C)),onClick:e.withModifiers(f,["prevent"])},[e.createElementVNode("input",{id:e.unref(l),ref_key:"input",ref:g,class:e.normalizeClass(e.unref(s).e("input")),type:"checkbox",role:"switch","aria-checked":e.unref(i),"aria-disabled":e.unref(p),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(p),tabindex:t.tabindex,onChange:k,onKeydown:e.withKeys(f,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(I))},[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.inactiveIcon&&t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":e.unref(i)},e.toDisplayString(t.inactiveText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{ref_key:"core",ref:S,class:e.normalizeClass(e.unref(s).e("core")),style:e.normalizeStyle(e.unref(a))},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("inner"))},[t.activeIcon||t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)?t.activeIcon:t.inactiveIcon)))]),_:1},8,["class"])):t.activeText||t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s).is("text")),"aria-hidden":!e.unref(i)},e.toDisplayString(e.unref(i)?t.activeText:t.inactiveText),11,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.loading_default))]),_:1},8,["class"])):e.unref(i)?e.renderSlot(t.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):e.unref(i)?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)])],2)],6),!t.inlinePrompt&&(t.activeIcon||t.activeText)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(d))},[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.activeIcon&&t.activeText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":!e.unref(i)},e.toDisplayString(t.activeText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0)],10,["onClick"]))}});var ne=u._export_sfc(ae,[["__file","switch.vue"]]);const re=u.withInstall(ne);const se=[{label:"买卖",value:0},{label:"开平",value:1}],D=()=>({mainIndicator:"MA",sellBuy:1,sellBuyByPrice:1,singelCycle:"6",multiCycleNum:6,multiCycleList:["1","2","3","4","5","6"],pageType:1,enable_tradeLogBrush:!0,enable_showScreenTimeRange:!0,enable_showScreenMaxPrice:!0,enable_dbClickOpenSingel:!0,enable_subChart:!0,enable_sliderChart:!0}),ie=(r,w)=>{var v;return((v=w.find(c=>c.value===r))==null?void 0:v.label)??"-"};const _=r=>(e.pushScopeId("data-v-6e5050a9"),r=r(),e.popScopeId(),r),ce={class:"kline-config element-dark"},ue={class:"setting-item"},de=_(()=>e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),me={class:"setting-item"},pe=_(()=>e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),fe={class:"setting-item"},ve=_(()=>e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),Ve={class:"setting-item"},be=_(()=>e.createElementVNode("span",{class:"label"},"单周期: ",-1)),ye={class:"setting-item"},ge=_(()=>e.createElementVNode("span",{class:"label"},"多周期: ",-1)),he={class:"mode"},ke={class:"cycleName"},Ce={class:"content"},Ne={class:"setting-item"},Ee=_(()=>e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),_e={class:"setting-item"},Be=_(()=>e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),we={class:"setting-item"},Se=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),Ie={class:"setting-item"},Te=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),ze={class:"setting-item"},Pe=_(()=>e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),Le={class:"setting-item"},qe=_(()=>e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),De={class:"setting-item"},Ae=_(()=>e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),Ue={class:"setting-footer"},Oe={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(r,{expose:w,emit:v}){const{request:c}=e.inject("stConfig"),V=v,b=r,s=e.ref(!1),l=e.reactive({}),p=e.ref([]),y=e.ref([]),g=()=>{Object.assign(l,D())},S=async()=>{const d=JSON.stringify(l);b.origin==="server"?await c.post("/common/qt/updateUserConfig",{appId:1,json:d}):localStorage.setItem("userKlineConfig",d),V("callBack",d),s.value=!1},C=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getUserConfig",{appId:1});Object.assign(l,D(),d?JSON.parse(d):{})}else{const d=localStorage.getItem("userKlineConfig");Object.assign(l,D(),d?JSON.parse(d):{})}},I=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getDict",{dictIds:[1002]});p.value=d[1002].map(a=>({label:a.dictName,value:a.dictCode}))}else p.value=b.cycleOptions};return e.onMounted(()=>{I(),y.value=b.indicatorStore.mainIndicatorList??[]}),e.watch(()=>b.indicatorStore.mainIndicatorList,()=>{y.value=b.indicatorStore.mainIndicatorList??[]}),w({open:async()=>{await C(),s.value=!0},getDefaultUserKlineConfig:D}),(d,a)=>{const B=M.ElDivider,i=U.ElOption,k=U.ElSelect,f=x.ElCheckbox,N=R.ElSegmented,t=re,m=H.ElScrollbar,z=F.ElButton,P=ee;return e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(P,{modelValue:s.value,"onUpdate:modelValue":a[12]||(a[12]=o=>s.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(m,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(B,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[e.createTextVNode("偏好设置")]),_:1}),e.createElementVNode("div",ue,[de,e.createVNode(k,{modelValue:l.mainIndicator,"onUpdate:modelValue":a[0]||(a[0]=o=>l.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",me,[pe,e.createVNode(k,{modelValue:l.sellBuy,"onUpdate:modelValue":a[1]||(a[1]=o=>l.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se),(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",fe,[ve,e.createVNode(f,{modelValue:l.sellBuyByPrice,"onUpdate:modelValue":a[2]||(a[2]=o=>l.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ve,[be,e.createVNode(k,{modelValue:l.singelCycle,"onUpdate:modelValue":a[3]||(a[3]=o=>l.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ye,[ge,e.createVNode(N,{size:"small",modelValue:l.multiCycleNum,"onUpdate:modelValue":a[4]||(a[4]=o=>l.multiCycleNum=o),options:[{label:"二图",value:2},{label:"四图",value:4},{label:"六图",value:6}],style:{height:"26px"}},null,8,["modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass(`setting-multi-box grid-${l.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.multiCycleList.slice(0,l.multiCycleNum),(o,n)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[n],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[n],"onUpdate:modelValue":L=>l.multiCycleList[n]=L,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(L,q)=>(e.openBlock(),e.createBlock(i,{key:q,label:L.label,value:L.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(n+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":a[5]||(a[5]=o=>l.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("功能配置")]),_:1}),e.createElementVNode("div",_e,[Be,e.createVNode(t,{modelValue:l.enable_tradeLogBrush,"onUpdate:modelValue":a[6]||(a[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":a[7]||(a[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":a[8]||(a[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":a[9]||(a[9]=o=>l.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("组件开关")]),_:1}),e.createElementVNode("div",Le,[qe,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":a[10]||(a[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":a[11]||(a[11]=o=>l.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Ue,[e.createVNode(z,{onClick:g},{default:e.withCtx(()=>[e.createTextVNode(" 恢复默认 ")]),_:1}),e.createVNode(z,{type:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(" 保存配置 ")]),_:1})])]),_:1},8,["modelValue"])])}}},Fe=$._export_sfc(Oe,[["__scopeId","data-v-6e5050a9"]]),Re={install(r){r.component("st-klineConfig",Fe)}};module.exports=Re;
|
package/es/KlineConfig.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { b as ne, m as fe, n as ie, u as re, _ as ue, w as de, e as be, o as G, c as x, p as ee, q as oe } from "./base-a5af3db3.js";
|
|
2
|
-
import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-
|
|
3
|
-
import { E as Ce } from "./el-button-
|
|
2
|
+
import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-09ad71cd.js";
|
|
3
|
+
import { E as Ce } from "./el-button-c95adb85.js";
|
|
4
4
|
import "./el-scrollbar-323542e7.js";
|
|
5
|
-
import { E as ke } from "./el-segmented-
|
|
6
|
-
import { E as we } from "./el-checkbox-
|
|
7
|
-
import "./el-tag-
|
|
8
|
-
import { E as Ve, a as Se } from "./el-select-
|
|
9
|
-
import { c as Ie, e as Ee, u as Te, U as te, C as ae, I as se, d as Be, b as ze } from "./el-popper-
|
|
5
|
+
import { E as ke } from "./el-segmented-b868d074.js";
|
|
6
|
+
import { E as we } from "./el-checkbox-7421ccd3.js";
|
|
7
|
+
import "./el-tag-66cab138.js";
|
|
8
|
+
import { E as Ve, a as Se } from "./el-select-95627997.js";
|
|
9
|
+
import { c as Ie, e as Ee, u as Te, U as te, C as ae, I as se, d as Be, b as ze } from "./el-popper-b4f97157.js";
|
|
10
10
|
import { E as Ne } from "./el-divider-4e059794.js";
|
|
11
11
|
import { computed as T, ref as B, watch as Q, onBeforeUnmount as Pe, defineComponent as Z, useSlots as Le, openBlock as o, createBlock as k, unref as e, withCtx as p, createVNode as m, Transition as Ae, withDirectives as Oe, createElementVNode as n, mergeProps as Ue, withModifiers as ce, normalizeClass as b, createElementBlock as y, renderSlot as $, toDisplayString as M, createCommentVNode as _, normalizeStyle as me, vShow as Re, onMounted as pe, withKeys as De, resolveDynamicComponent as q, nextTick as Fe, inject as $e, reactive as Me, createTextVNode as j, Fragment as H, renderList as J, pushScopeId as Ke, popScopeId as qe } from "vue";
|
|
12
12
|
import { _ as je } from "./_plugin-vue_export-helper-dad06003.js";
|
|
13
|
-
import { E as D, c as He, l as Je } from "./index-
|
|
14
|
-
import { i as We } from "./validator-
|
|
15
|
-
import { b as Xe, c as le, i as X, d as Ye, e as Ge, f as Qe, g as Ze } from "./use-form-common-props-
|
|
16
|
-
import { E as xe } from "./index-
|
|
13
|
+
import { E as D, c as He, l as Je } from "./index-a871c3eb.js";
|
|
14
|
+
import { i as We } from "./validator-764a9db0.js";
|
|
15
|
+
import { b as Xe, c as le, i as X, d as Ye, e as Ge, f as Qe, g as Ze } from "./use-form-common-props-815d48a6.js";
|
|
16
|
+
import { E as xe } from "./index-844bdd85.js";
|
|
17
17
|
import { u as el } from "./index-2e331d74.js";
|
|
18
18
|
import { u as ll } from "./index-d77a7336.js";
|
|
19
19
|
import "./vnode-5ddb7ed1.js";
|
|
20
20
|
import "./scroll-679bd6bf.js";
|
|
21
21
|
import "./index-960806da.js";
|
|
22
|
-
import "./use-global-config-
|
|
23
|
-
import "./index-
|
|
22
|
+
import "./use-global-config-b5e9d3d5.js";
|
|
23
|
+
import "./index-e5566b94.js";
|
|
24
24
|
import "./index-657047bb.js";
|
|
25
|
-
import "./index-
|
|
25
|
+
import "./index-57672682.js";
|
|
26
26
|
import "./castArray-7741a212.js";
|
|
27
|
-
import "./index-
|
|
27
|
+
import "./index-d91dc23f.js";
|
|
28
28
|
import "./debounce-8d53f4dd.js";
|
|
29
29
|
const tl = ne({
|
|
30
30
|
...ye,
|
package/es/KlineNew.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),C=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-8901a38c.cjs");require("./base-ef747d02.cjs");require("./el-tag-891b703d.cjs");const R=require("./el-select-91145989.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-b37ec1ef.cjs");const $=require("echarts");require("./index-6c252a43.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-3b387353.cjs");require("./index-7a85500c.cjs");require("./index-bb833443.cjs");require("./index-f50a50b3.cjs");require("./index-d7928b14.cjs");require("./castArray-35947698.cjs");require("./index-eb3ca89a.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function N(m){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const S in m)if(S!=="default"){const g=Object.getOwnPropertyDescriptor(m,S);Object.defineProperty(A,S,g.get?g:{enumerable:!0,get:()=>m[S]})}}return A.default=m,Object.freeze(A)}const E=N($),M=t.defineComponent({__name:"index",setup(m,{expose:A}){let S=!1,g=!0,v=[];const I=(h,u)=>h.length>u?h.slice(h.length-u):h;return A({initTalib:async()=>{if(!S)S=!0,await C.init("./talib.wasm"),g=!1,v.forEach(h=>{h()});else if(g)return new Promise(h=>{v.push(h)})},handleKeyDown:(h,u)=>{let{startValue:o,endValue:d,maxIndex:f}=u;if(h.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(h.code==="ArrowRight"){if(d===f)return;o=o+1,d=d+1}else if(h.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(h.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:h=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:f}=h;let p=-1,e=-1,i={};return d.forEach((a,n)=>{const l=a.split(" ")[0];i[l]=i[l]||0,i[l]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=n),new Date(a)<=new Date(o)&&(e=n)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*f}},formatDataBySlide:h=>{const{originDrawData:u,addData:o,startTime:d,endTime:f}=h,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:n,timeRange:l}=h,{loadAddCount:D,preLoadCount:q}=n;let _=[],b=[],F=[],w=[];d&&f?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(f)),w=[...o]):f?(_=[...o.filter((s,r)=>r>=o.length-D&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,r)=>r>=q&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1]))],w=_),_.forEach((s,r)=>{b.push([s[1],s[4],s[3],s[2],r===0?0:_[r-1][4],s[6]]),F.push(s[0])});let c=[],x=[];const y={time:[],open:[],close:[],high:[],low:[],originData:w};let B=null,T=null;return w.forEach((s,r)=>{y.time.push(s[0]),y.open.push(s[1]),y.close.push(s[4]),y.high.push(s[2]),y.low.push(s[3]),s[0]===_[0][0]&&(B=r),s[0]===_[_.length-1][0]&&(T=r+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:r}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:r?r(C.talib,y,k).slice(B,T):[]}}),x=a.find(({value:s})=>s===i).config.reduce((s,r)=>{const{source:k,calculationFn:V}=r;return k==="calculation"?[...s,{...r,data:V?V(C.talib,y).slice(B,T):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:x,xAxisData:F,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:h=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:f,subIndicator:p,subIndicatorList:e,config:i}=h;let a={};const{addCount:n,preLoadCount:l}=i,D=[],q=[],_=[],b=[],F=[];let w=[],c=[];const x=o.filter((r,k)=>(D.push(r[0]),q.push(r[1]),_.push(r[4]),b.push(r[2]),F.push(r[3]),w.push(r[0]),c.push([r[1],r[4],r[3],r[2],k===0?0:o[k-1][4],r[6]]),o.length>=n+l-1?k>=l:!0));w=I(w,x.length),c=I(c,x.length);const y={time:D,open:q,close:_,high:b,low:F,originData:o},T=f.find(r=>r.value===d).config.map(r=>({...r,data:I(r.calculationFn?r.calculationFn(C.talib,y,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,V)=>V.source==="calculation"?[...k,{...V,data:I(V.calculationFn?V.calculationFn(C.talib,y):[],w.length)}]:k,[])),u.length?a={originData:[...x,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((r,k)=>({...r,data:[...T[k].data,...r.data]})),subIndicatorData:u.subIndicatorData.map((r,k)=>({...r,data:[...s[k].data,...r.data]}))}:a={originData:x,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:()=>{}}),(h,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(A,S)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(g,v)=>(t.openBlock(),t.createElementBlock("div",{key:v,class:"kline-tips-item",style:t.normalizeStyle({color:g.color})},t.toDisplayString(g.label)+" "+t.toDisplayString(g.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},candlestickData:{type:Array,default:()=>null},mainIndicatorData:{type:Array,default:()=>null},activeIndex:{type:Number,require:!0}},setup(m){const{round:A,multiply:S,divide:g,subtract:v,formatValue:I}=z.x,h=m,u=t.computed(()=>{const{drawData:d,activeIndex:f,candlestickData:p}=h;if(p!=null&&p.length&&p[f]){let e;return p[f][6]>0?e="red":p[f][6]<0&&(e="green"),[{label:"开",value:p[f][0]},{label:"高",value:p[f][3]},{label:"低",value:p[f][2]},{label:"收",value:p[f][1]},{label:"额",value:I(p[f][4])},{label:"涨跌",value:`${A(p[f][6])}%`,color:e}]}else if(d.candlestickData&&d.candlestickData[f]){const e=d.candlestickData[f],i=[{label:"开",value:e[0]},{label:"高",value:e[3]},{label:"低",value:e[2]},{label:"收",value:e[1]}];e[5]!==void 0&&i.push({label:"额",value:I(e[5])});const a=A(S(g(v(e[1],e[4]),Math.abs(e[4])),100));let n;return a>0?n="red":a<0&&(n="green"),i.push({label:"涨跌",value:`${a}%`,color:n}),i}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:f}=h;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:A(e.data[f]),color:e.color})))||[]});return(d,f)=>(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-e75a1234"]]),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(m,{expose:A,emit:S}){const{round:g}=z.x;let v,I;const h=S,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){h("update:modelValue",e)}}),f=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(n=>n.value===d.value);return e.originData&&e.originData[i]?a.config.map(n=>{var D,q;let l="-";return n.source==="origin"?l=e.originData[i][n.dataIndex]||"-":n.source==="calculation"&&(l=(((q=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===n.key))==null?void 0:q.data)||[])[i]),{label:n.key,color:n.color,value:l==="-"?l:g(l)}}):[]});t.onMounted(()=>{v=E.init(o.value);let e=!0;I=new ResizeObserver(()=>{if(e){e=null;return}v.resize()}),I.observe(o.value)}),t.onUnmounted(()=>{v.dispose(),I.disconnect(),I=null});const p=(e,i)=>{const a=e[i],n=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=n[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return A({connect:e=>{E.connect([e,v])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:n}=e,{xAxisData:l,subIndicatorData:D,candlestickData:q,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),F=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(x=>x[b.dataIndex]):c=((w=D==null?void 0:D.find(x=>x.key===b.dataIndex))==null?void 0:w.data)||[],F.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((x,y)=>b.color==="kline"?{value:x,itemStyle:p(q,y)}:b.color==="value"?{value:x,itemStyle:{color:x>=0?"#FF0000":"#00FFFF"}}:{value:x,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let x=[];c.source==="origin"?x=_.map(y=>y[c.dataIndex]):c.source==="calculation"&&(x=c.data),F.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:x,lineStyle:{width:1},itemStyle:{color:c.color}})}}),v.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:n}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:x,value:y}=c;if(x==="x")return y;if(c.axisIndex===1)return String(g(y))}}},formatter:()=>""},xAxis:{type:"category",data:l,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:F},!0)})}}),(e,i)=>{const a=R.ElOption,n=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[f.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(n,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=l=>d.value=l),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,l=>(t.openBlock(),t.createBlock(a,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:f.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(m,{expose:A,emit:S}){let g,v,I=null;const h=S,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{g=E.init(o.value),d(),p();let e=!0;v=new ResizeObserver(()=>{if(e){e=null;return}g.resize()}),v.observe(o.value)}),t.onUnmounted(()=>{g.off("datazoom"),g.dispose(),v.disconnect(),v=null});const d=()=>{g.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(I),I=setTimeout(()=>{const{data:i}=u,{start:a,end:n}=e,l=Math.floor(a*i.length/100),D=n===100?i.length-1:Math.floor(n*i.length/100);f(l,D),clearTimeout(I)},100))})},f=(e,i)=>{const a=u.data;if(a.length===0)return;const n=a[e][0].split(" ")[0],l=a[i][0].split(" ")[0];h("change",{startTime:`${n} 00:00:00`,endTime:`${l} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(n=>n[0].split(" ")[0]),a=e.map(n=>n[1]);g.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 A({resetSlide:(e,i,a)=>{let n=-1,l=-1;u.data.forEach((D,q)=>{n===-1&&D[0]===e?n=q:n===-1&&new Date(D[0])>new Date(e)&&(n=q-1),(l===-1&&D[0]===i||l===-1&&new Date(D[0])>new Date(i))&&(l=q)}),l=l===-1?u.data.length-1:l,g.setOption({dataZoom:[{show:!0,startValue:n,endValue:l,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:n,endValue:l,maxValueSpan:a}]})},resize:()=>{g==null||g.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(m){m.component("st-klineUtils",M),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
|
|
1
|
+
"use strict";const t=require("vue"),C=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-8901a38c.cjs");require("./base-ef747d02.cjs");require("./el-tag-a33c4b22.cjs");const R=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-b6c99b28.cjs");const $=require("echarts");require("./index-c108567d.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-fd9b61a0.cjs");require("./index-098c2447.cjs");require("./index-bb833443.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function N(m){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const S in m)if(S!=="default"){const g=Object.getOwnPropertyDescriptor(m,S);Object.defineProperty(A,S,g.get?g:{enumerable:!0,get:()=>m[S]})}}return A.default=m,Object.freeze(A)}const E=N($),M=t.defineComponent({__name:"index",setup(m,{expose:A}){let S=!1,g=!0,v=[];const I=(h,u)=>h.length>u?h.slice(h.length-u):h;return A({initTalib:async()=>{if(!S)S=!0,await C.init("./talib.wasm"),g=!1,v.forEach(h=>{h()});else if(g)return new Promise(h=>{v.push(h)})},handleKeyDown:(h,u)=>{let{startValue:o,endValue:d,maxIndex:f}=u;if(h.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(h.code==="ArrowRight"){if(d===f)return;o=o+1,d=d+1}else if(h.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(h.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:h=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:f}=h;let p=-1,e=-1,i={};return d.forEach((a,n)=>{const l=a.split(" ")[0];i[l]=i[l]||0,i[l]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=n),new Date(a)<=new Date(o)&&(e=n)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*f}},formatDataBySlide:h=>{const{originDrawData:u,addData:o,startTime:d,endTime:f}=h,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:n,timeRange:l}=h,{loadAddCount:D,preLoadCount:q}=n;let _=[],b=[],F=[],w=[];d&&f?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(f)),w=[...o]):f?(_=[...o.filter((s,r)=>r>=o.length-D&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,r)=>r>=q&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1]))],w=_),_.forEach((s,r)=>{b.push([s[1],s[4],s[3],s[2],r===0?0:_[r-1][4],s[6]]),F.push(s[0])});let c=[],x=[];const y={time:[],open:[],close:[],high:[],low:[],originData:w};let B=null,T=null;return w.forEach((s,r)=>{y.time.push(s[0]),y.open.push(s[1]),y.close.push(s[4]),y.high.push(s[2]),y.low.push(s[3]),s[0]===_[0][0]&&(B=r),s[0]===_[_.length-1][0]&&(T=r+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:r}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:r?r(C.talib,y,k).slice(B,T):[]}}),x=a.find(({value:s})=>s===i).config.reduce((s,r)=>{const{source:k,calculationFn:V}=r;return k==="calculation"?[...s,{...r,data:V?V(C.talib,y).slice(B,T):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:x,xAxisData:F,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:h=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:f,subIndicator:p,subIndicatorList:e,config:i}=h;let a={};const{addCount:n,preLoadCount:l}=i,D=[],q=[],_=[],b=[],F=[];let w=[],c=[];const x=o.filter((r,k)=>(D.push(r[0]),q.push(r[1]),_.push(r[4]),b.push(r[2]),F.push(r[3]),w.push(r[0]),c.push([r[1],r[4],r[3],r[2],k===0?0:o[k-1][4],r[6]]),o.length>=n+l-1?k>=l:!0));w=I(w,x.length),c=I(c,x.length);const y={time:D,open:q,close:_,high:b,low:F,originData:o},T=f.find(r=>r.value===d).config.map(r=>({...r,data:I(r.calculationFn?r.calculationFn(C.talib,y,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,V)=>V.source==="calculation"?[...k,{...V,data:I(V.calculationFn?V.calculationFn(C.talib,y):[],w.length)}]:k,[])),u.length?a={originData:[...x,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((r,k)=>({...r,data:[...T[k].data,...r.data]})),subIndicatorData:u.subIndicatorData.map((r,k)=>({...r,data:[...s[k].data,...r.data]}))}:a={originData:x,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:()=>{}}),(h,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(A,S)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(g,v)=>(t.openBlock(),t.createElementBlock("div",{key:v,class:"kline-tips-item",style:t.normalizeStyle({color:g.color})},t.toDisplayString(g.label)+" "+t.toDisplayString(g.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},candlestickData:{type:Array,default:()=>null},mainIndicatorData:{type:Array,default:()=>null},activeIndex:{type:Number,require:!0}},setup(m){const{round:A,multiply:S,divide:g,subtract:v,formatValue:I}=z.x,h=m,u=t.computed(()=>{const{drawData:d,activeIndex:f,candlestickData:p}=h;if(p!=null&&p.length&&p[f]){let e;return p[f][6]>0?e="red":p[f][6]<0&&(e="green"),[{label:"开",value:p[f][0]},{label:"高",value:p[f][3]},{label:"低",value:p[f][2]},{label:"收",value:p[f][1]},{label:"额",value:I(p[f][4])},{label:"涨跌",value:`${A(p[f][6])}%`,color:e}]}else if(d.candlestickData&&d.candlestickData[f]){const e=d.candlestickData[f],i=[{label:"开",value:e[0]},{label:"高",value:e[3]},{label:"低",value:e[2]},{label:"收",value:e[1]}];e[5]!==void 0&&i.push({label:"额",value:I(e[5])});const a=A(S(g(v(e[1],e[4]),Math.abs(e[4])),100));let n;return a>0?n="red":a<0&&(n="green"),i.push({label:"涨跌",value:`${a}%`,color:n}),i}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:f}=h;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:A(e.data[f]),color:e.color})))||[]});return(d,f)=>(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-e75a1234"]]),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(m,{expose:A,emit:S}){const{round:g}=z.x;let v,I;const h=S,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){h("update:modelValue",e)}}),f=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(n=>n.value===d.value);return e.originData&&e.originData[i]?a.config.map(n=>{var D,q;let l="-";return n.source==="origin"?l=e.originData[i][n.dataIndex]||"-":n.source==="calculation"&&(l=(((q=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===n.key))==null?void 0:q.data)||[])[i]),{label:n.key,color:n.color,value:l==="-"?l:g(l)}}):[]});t.onMounted(()=>{v=E.init(o.value);let e=!0;I=new ResizeObserver(()=>{if(e){e=null;return}v.resize()}),I.observe(o.value)}),t.onUnmounted(()=>{v.dispose(),I.disconnect(),I=null});const p=(e,i)=>{const a=e[i],n=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=n[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return A({connect:e=>{E.connect([e,v])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:n}=e,{xAxisData:l,subIndicatorData:D,candlestickData:q,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),F=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(x=>x[b.dataIndex]):c=((w=D==null?void 0:D.find(x=>x.key===b.dataIndex))==null?void 0:w.data)||[],F.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((x,y)=>b.color==="kline"?{value:x,itemStyle:p(q,y)}:b.color==="value"?{value:x,itemStyle:{color:x>=0?"#FF0000":"#00FFFF"}}:{value:x,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let x=[];c.source==="origin"?x=_.map(y=>y[c.dataIndex]):c.source==="calculation"&&(x=c.data),F.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:x,lineStyle:{width:1},itemStyle:{color:c.color}})}}),v.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:n}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:x,value:y}=c;if(x==="x")return y;if(c.axisIndex===1)return String(g(y))}}},formatter:()=>""},xAxis:{type:"category",data:l,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:F},!0)})}}),(e,i)=>{const a=R.ElOption,n=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[f.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(n,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=l=>d.value=l),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,l=>(t.openBlock(),t.createBlock(a,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:f.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(m,{expose:A,emit:S}){let g,v,I=null;const h=S,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{g=E.init(o.value),d(),p();let e=!0;v=new ResizeObserver(()=>{if(e){e=null;return}g.resize()}),v.observe(o.value)}),t.onUnmounted(()=>{g.off("datazoom"),g.dispose(),v.disconnect(),v=null});const d=()=>{g.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(I),I=setTimeout(()=>{const{data:i}=u,{start:a,end:n}=e,l=Math.floor(a*i.length/100),D=n===100?i.length-1:Math.floor(n*i.length/100);f(l,D),clearTimeout(I)},100))})},f=(e,i)=>{const a=u.data;if(a.length===0)return;const n=a[e][0].split(" ")[0],l=a[i][0].split(" ")[0];h("change",{startTime:`${n} 00:00:00`,endTime:`${l} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(n=>n[0].split(" ")[0]),a=e.map(n=>n[1]);g.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 A({resetSlide:(e,i,a)=>{let n=-1,l=-1;u.data.forEach((D,q)=>{n===-1&&D[0]===e?n=q:n===-1&&new Date(D[0])>new Date(e)&&(n=q-1),(l===-1&&D[0]===i||l===-1&&new Date(D[0])>new Date(i))&&(l=q)}),l=l===-1?u.data.length-1:l,g.setOption({dataZoom:[{show:!0,startValue:n,endValue:l,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:n,endValue:l,maxValueSpan:a}]})},resize:()=>{g==null||g.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(m){m.component("st-klineUtils",M),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
|
package/es/KlineNew.js
CHANGED
|
@@ -3,20 +3,20 @@ 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
4
|
import { x as G } from "./index-7ed0999e.js";
|
|
5
5
|
import "./base-a5af3db3.js";
|
|
6
|
-
import "./el-tag-
|
|
7
|
-
import { E as ae, a as ne } from "./el-select-
|
|
6
|
+
import "./el-tag-66cab138.js";
|
|
7
|
+
import { E as ae, a as ne } from "./el-select-95627997.js";
|
|
8
8
|
import "./el-scrollbar-323542e7.js";
|
|
9
|
-
import "./el-popper-
|
|
9
|
+
import "./el-popper-b4f97157.js";
|
|
10
10
|
import * as B from "echarts";
|
|
11
|
-
import "./index-
|
|
11
|
+
import "./index-e5566b94.js";
|
|
12
12
|
import "./index-960806da.js";
|
|
13
|
-
import "./use-form-common-props-
|
|
14
|
-
import "./index-
|
|
13
|
+
import "./use-form-common-props-815d48a6.js";
|
|
14
|
+
import "./index-a871c3eb.js";
|
|
15
15
|
import "./index-d77a7336.js";
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
16
|
+
import "./index-844bdd85.js";
|
|
17
|
+
import "./index-57672682.js";
|
|
18
18
|
import "./castArray-7741a212.js";
|
|
19
|
-
import "./index-
|
|
19
|
+
import "./index-d91dc23f.js";
|
|
20
20
|
import "./scroll-679bd6bf.js";
|
|
21
21
|
import "./debounce-8d53f4dd.js";
|
|
22
22
|
import "./vnode-5ddb7ed1.js";
|
package/es/KlinePlus.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const Te=require("./el-loading-03240202.cjs"),ge=require("./el-empty-1697ded8.cjs");require("./el-tag-891b703d.cjs");const ze=require("./el-select-91145989.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-b37ec1ef.cjs");const t=require("vue"),L=require("./dayjs.min-2c20abe6.cjs"),Ie=require("echarts"),G=require("./index-8901a38c.cjs"),se=require("./_plugin-vue_export-helper-f246444f.cjs");require("./use-global-config-2a4156cd.cjs");require("./use-form-common-props-3b387353.cjs");require("./index-9780a537.cjs");require("./index-7a85500c.cjs");require("./index-bb833443.cjs");require("./index-6c252a43.cjs");require("./index-f50a50b3.cjs");require("./index-d7928b14.cjs");require("./castArray-35947698.cjs");require("./index-eb3ca89a.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function Ye(i){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const c in i)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(i,c);Object.defineProperty(l,c,s.get?s:{enumerable:!0,get:()=>i[c]})}}return l.default=i,Object.freeze(l)}const ae=Ye(Ie),Le="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjM4NzI1IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjI2MjUiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTE5OC4wMTY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L.dayjs(i);if(L.dayjs(l).diff(T,"day")<=p)return[i,l];if(s==="end")return[L.dayjs(l).subtract(p,"day").format("YYYY-MM-DD HH:mm:ss"),l];if(s==="middle"){const k=L.dayjs((L.dayjs(i).valueOf()+L.dayjs(l).valueOf())/2).format("YYYY-MM-DD HH:mm:ss");return console.log("超过一屏数量上限, 进行中间时间计算",k,p/2),[L.dayjs(k).subtract(p/2,"day").format("YYYY-MM-DD HH:mm:ss"),L.dayjs(k).add(p/2,"day").format("YYYY-MM-DD HH:mm:ss")]}},we=(i,l)=>{const c=i[l],s=l===0?i[l]:i[l-1];return c[0]===c[1]?c[0]>=s[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:c[1]>c[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}},xe=(i,l,c)=>{var z,p,T,D;const s=i.subIndicator.map(e=>{if(e.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:e.data.map((k,P)=>e.seriesColor==="kline"?{value:k,itemStyle:we(i.data,P)}:e.seriesColor==="value"?{value:k,itemStyle:{color:k>=0?"#FF0000":"#00FFFF"}}:{value:k,itemStyle:{color:e.seriesColor}})};if(e.series==="line")return{xAxisIndex:0,yAxisIndex:e.yAxis==="right"?2:1,name:e.key,type:"line",silent:!0,symbol:"none",data:e.data,lineStyle:{width:1},itemStyle:{color:e.color}}});return{animation:!1,grid:{top:"10px",left:"60px",right:"20px",bottom:"10px"},dataZoom:[{type:"inside",startValue:l,endValue:c,maxValueSpan:Z.maxValueSpan}],tooltip:{show:!1},axisPointer:{show:!0,triggerTooltip:!1,label:{rich:{},formatter:e=>{const{axisDimension:k,value:P}=e;if(k==="x")return null;if(e.axisIndex===1)return String(fe(P))}}},xAxis:{type:"category",data:i.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!1}},yAxis:[{position:"right"},{position:"left",min:((z=i.subIndicator[0])==null?void 0:z.leftYAxisRange)==="cover"?e=>e.min:null,max:((p=i.subIndicator[0])==null?void 0:p.leftYAxisRange)==="cover"?e=>e.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:((T=i.subIndicator[0])==null?void 0:T.rightYAxisRange)==="cover"?e=>e.min:null,max:((D=i.subIndicator[0])==null?void 0:D.rightYAxisRange)==="cover"?e=>e.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:s}},oe=(i,l,c="strict")=>{let s=0,z=i.length-1,p=-1;for(;s<=z;){let T=Math.floor((s+z)/2);if(c==="strict"){if(i[T]===l)return T;i[T]<l?s=T+1:z=T-1}else c==="gte"&&(i[T]>=l?(p=T,z=T-1):s=T+1)}return c==="strict"?-1:p},Oe=i=>{const l=[];return i.reduce((c,s)=>{const z=`${s.coord[0]}+${s.label.position}`,p=s.label.position==="top"?-16:16,T=c.get(z);return T?(c.set(z,T+1),s.symbolOffset[1]=p*(T+1)):(c.set(z,1),s.symbolOffset[1]=s.label.position==="top"?-7:7),l.push(s),c},new Map),l},de=(i,l)=>({data:[...i.data,...l.data.slice(1)],mainIndicator:i.mainIndicator.map((c,s)=>({...c,data:[...c.data,...l.mainIndicator[s].data.slice(1)]})),subIndicator:i.subIndicator.map((c,s)=>({...c,data:[...c.data,...l.subIndicator[s].data.slice(1)]})),time:[...i.time,...l.time.slice(1)]}),re=(i,l,c)=>{switch(c){case"5":{let I=[...new Set(i.slice(-20).map(y=>{const o=new Date(y),g=String(o.getHours()).padStart(2,"0"),d=String(o.getMinutes()).padStart(2,"0"),C=String(o.getSeconds()).padStart(2,"0");return`${g}:${d}:${C}`}))];I.includes("00:00:00")&&(I.splice(I.indexOf("00:00:00"),1),I.push("24:00:00")),I=I.sort((y,o)=>new Date(`2000-01-30 ${y}`).getTime()-new Date(`2000-01-30 ${o}`).getTime());const x=new Date(l),N=x.getFullYear(),j=String(x.getMonth()+1).padStart(2,"0"),n=String(x.getDate()).padStart(2,"0"),O=String(x.getHours()).padStart(2,"0"),m=String(x.getMinutes()).padStart(2,"0"),M=String(x.getSeconds()).padStart(2,"0");if(`${O}:${m}:${M}`=="00:00:00")return`${N}-${j}-${n} 01:00:00`;{let y=null;for(let o=0;o<I.length;o++){const g=I[o].split(":");if(+`${g[0]}${g[1]}${g[2]}`>=+`${O}${m}${M}`){y=I[o];break}}if(y==="24:00:00"){const o=new Date(l);o.setDate(o.getDate()+1);const g=o.getFullYear(),d=String(o.getMonth()+1).padStart(2,"0"),C=String(o.getDate()).padStart(2,"0");return`${g}-${d}-${C} 00:00:00`}return`${N}-${j}-${n} ${y}`}}case"6":{const I=new Date(l),x=I.getHours();if(x>=4&&x<21){const N=I.getFullYear(),j=String(I.getMonth()+1).padStart(2,"0"),n=String(I.getDate()).padStart(2,"0");return`${N}-${j}-${n} 09:00:00`}else{const N=new Date(l);N.getHours()>=21&&N.setDate(N.getDate()+1);const j=N.getFullYear(),n=String(N.getMonth()+1).padStart(2,"0"),O=String(N.getDate()).padStart(2,"0"),m=`${j}-${n}-${O} 09:00:00`,M=oe(i,m,"gte");return M===-1?m:i[M]}}case"7":{const I=new Date(l),x=new Date(I);x.setDate(I.getDate()-I.getDay()),x.setHours(0,0,0,0);const N=new Date(x);N.setDate(x.getDate()+5),N.setHours(23,59,59,0);const j=new Date(x);j.setDate(x.getDate()+12),j.setHours(9,0,0,0);const n=I<=N?N:j,O=n.getFullYear(),m=String(n.getMonth()+1).padStart(2,"0"),M=String(n.getDate()).padStart(2,"0");return`${O}-${m}-${M} 09:00:00`}case"8":{const I=new Date(l),x=new Date(I.getFullYear(),I.getMonth()+1,1),N=new Date(x);N.setDate(x.getDate()-1),N.setHours(9,0,0,0);const j=N.getFullYear(),n=String(N.getMonth()+1).padStart(2,"0"),O=String(N.getDate()).padStart(2,"0");return`${j}-${n}-${O} 09:00:00`}}const s=new Date(l),z=s.getFullYear(),p=s.getMonth(),T=s.getDate(),D=s.getHours(),e=s.getMinutes(),k=s.getSeconds(),P=I=>{let x=null;const N=Math.floor(e/I);e%I===0&&k===0?x=e:x=(N+1)*I;const j=Math.floor(x/60),n=D+j,O=x%60,m=new Date(z,p,T,n,O,0),M=S=>String(S).padStart(2,"0"),y=m.getFullYear(),o=M(m.getMonth()+1),g=M(m.getDate()),d=M(m.getHours()),C=M(m.getMinutes());return`${y}-${o}-${g} ${d}:${C}:00`};switch(c){case"1":return P(1);case"2":return P(5);case"3":return P(15);case"4":return P(30);default:throw new Error(`Unsupported cycle: ${l} ${c}`)}},ie=(i,l,c)=>{let s=null,z=null;const[p,T]=l;switch(c){case"6":{s=i.find(D=>new Date(L.dayjs(D).format("YYYY-MM-DD 23:59:59")).getTime()>=new Date(p).getTime()),z=i.findLast(D=>new Date(L.dayjs(D).format("YYYY-MM-DD 00:00:00")).getTime()<=new Date(T).getTime());break}case"7":{const D=L.dayjs(T).endOf("week").add(1,"day").format("YYYY-MM-DD 23:59:59");s=i.find(e=>L.dayjs(e).endOf("week").add(1,"day").format("YYYY-MM-DD")===L.dayjs(p).endOf("week").add(1,"day").format("YYYY-MM-DD")),z=i.findLast(e=>new Date(e).getTime()<=new Date(D).getTime());break}case"8":{s=i.find(D=>L.dayjs(D).format("YYYY-MM")===L.dayjs(p).format("YYYY-MM")),z=i.findLast(D=>L.dayjs(D).format("YYYY-MM")===L.dayjs(T).format("YYYY-MM"));break}default:s=i.find(D=>new Date(D).getTime()>=new Date(p).getTime()),z=i.findLast(D=>new Date(D).getTime()<=new Date(T).getTime())}return[s,z]},Ce=(i,l,c,s,z,p)=>{const T=(N,j)=>{const{direction:n="",tradeAction:O="",tradeType:m=""}=N,M=m??n+O;switch(j){case 0:return new Map([["开多","买"],["平多","卖"],["开空","卖"],["平空","买"]]).get(M);case 1:return m??n+O}},D=(N,j,n,O)=>N.reduce((m,M)=>{var F;const y=T(M,0),o=N.filter(B=>B.klineTime===M.klineTime),g=[...new Set(o.map(B=>T(B,0)))];let d=null;g.length>1?d="image://"+new URL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/buy.svg":Le,"./images/sell.svg":me,"./images/t.svg":Ae})[`./images/${y==="买"?"buy":"sell"}.svg`],self.location).href;const C=oe(n,M.klineTime),S=(F=O[C])==null?void 0:F[3];return j.forEach(B=>{var W;const U=y==="买"?0:1;B.range[U]===M.klineTime&&(B.rangeValue[U]=(W=O[C])==null?void 0:W[y==="买"?2:3])}),m.push({symbol:d,symbolSize:25,symbolRotate:0,symbolOffset:[0,0],label:{show:!1,position:"top"},coord:[M.klineTime,S],silent:!0,animation:!1,customData:{tradeType:y,amount:M.amount,part:M.part,profitAndLoss:M.profitAndLoss,openPriceAll:M.openPriceAll,closePriceAll:M.closePriceAll}}),m},[]),e=(N,j,n,O)=>{const{sellBuyByPrice:m}=p,M=N.reduce((y,o,g)=>{var F,B;const d=T(o,1),C=["开多","开空"].includes(d)?"top":"bottom";let S=null;if(m)S=C==="top"?(o.openPriceAll/o.amount).toFixed(2):(o.closePriceAll/o.amount).toFixed(2);else{const U=oe(n,o.klineTime);S=C==="top"?(F=O[U])==null?void 0:F[3]:(B=O[U])==null?void 0:B[2]}return j.forEach(U=>{(C==="top"?U.range[0]:U.range[1])===o.klineTime&&(U.rangeValue[C==="top"?0:1]=S)}),y.push({symbol:"triangle",symbolSize:[10,12],symbolRotate:C==="top"?180:0,symbolOffset:[0,0],label:{show:!0,position:C,color:"#fff",formatter:`${d} ${C==="top"?"+":"-"} ${o.amount}手 ${o.part?`(${o.part}份)`:""}`},itemStyle:{color:C==="top"?"#FF0000":"#389e0d"},coord:[o.klineTime,S],silent:!0,animation:!1,customData:{tradeType:d,amount:o.amount,part:o.part,profitAndLoss:o.profitAndLoss,openPriceAll:o.openPriceAll,closePriceAll:o.closePriceAll}}),y},[]);return m?M:Oe(M)},k=(N,j,n)=>{const{basePointData:O,baseLineData:m}=N.reduce((g,d)=>{const C={pointTime:d.openTime,tradeAction:"开",tradeDirection:d.tradeDirection?"空":"多",tradeType:`开${d.tradeDirection?"空":"多"}`,part:null,amount:d.tradeVolume,profitAndLoss:d.profitAndLoss,openPriceAll:d.openPrice*d.tradeVolume,closePriceAll:d.closePrice*d.tradeVolume,klineTime:re(n,d.openTime,j)},S={pointTime:d.closeTime,tradeAction:"平",tradeDirection:d.tradeDirection?"空":"多",tradeType:`平${d.tradeDirection?"空":"多"}`,part:null,amount:d.tradeVolume,profitAndLoss:d.profitAndLoss,openPriceAll:d.openPrice*d.tradeVolume,closePriceAll:d.closePrice*d.tradeVolume,klineTime:re(n,d.closeTime,j)},F={range:[C.klineTime,S.klineTime],rangeValue:[null,null],color:S.profitAndLoss>0?"#FF0000":"#389e0d"};return g.basePointData.push(C,S),g.baseLineData.push(F),g},{basePointData:[],baseLineData:[]}),y=[...O.reduce((g,d)=>{const C=JSON.parse(JSON.stringify(d)),S=C.klineTime+C.tradeType;if(g.has(S)){const F=g.get(S);C.amount+=F.amount,C.part+=F.part,C.profitAndLoss+=F.profitAndLoss,C.openPriceAll+=F.openPriceAll,C.closePriceAll+=F.closePriceAll}return g.set(S,C),g},new Map([])).values()].sort((g,d)=>new Date(g.klineTime)-new Date(d.klineTime)),o=m.filter(({range:g})=>g[0]!==g[1]);return{pointData:y,lineData:o}},{pointData:P,lineData:I}=k(i,l,s);return{tradePointData:(c===0?D:e)(P,I,s,z),tradeLineData:I.map(({range:N,rangeValue:j,color:n})=>[{symbol:"none",coord:[N[0],j[0]],lineStyle:{color:n,width:2,type:"solid"},silent:!0,animation:!1},{symbol:"none",coord:[N[1],j[1]],silent:!0,animation:!1}])}},be=(i,l)=>{let c=[];if(Number(l)<=5)c=i.map(({tradeDate:s,netPositionValue:z})=>[L.dayjs(s).format("YYYY-MM-DD HH:mm:ss"),z]);else if(Number(l)===6){const s=i.reduce((z,p)=>{const{tradeDate:T,netPositionValue:D}=p;return z.set(L.dayjs(T).format("YYYY-MM-DD 09:00:00"),D),z},new Map);c=Array.from(s,([z,p])=>[z,p])}else c=[];return{netPositionLineData:c}},he=(i,l,c,s)=>{let z=[];if(["6","7","8"].includes(l)){const p=i.reduce((T,D)=>{const e=re(s,D.date,l),k=D[c===0?"simple":"compound"];return T.set(e,k),T},new Map);z=Array.from(p,([T,D])=>[T,D])}else z=[];return{tradeIncomeRateLineData:z}};const ke={class:"tips"},Ee={__name:"Tips",props:{data:{type:Array,default:()=>[]}},setup(i){return(l,c)=>(t.openBlock(),t.createElementBlock("div",ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.data,(s,z)=>(t.openBlock(),t.createElementBlock("span",{key:z,class:"item",style:t.normalizeStyle({color:s.color})},t.toDisplayString(s.label)+" "+t.toDisplayString(s.value),5))),128))]))}},ne=se._export_sfc(Ee,[["__scopeId","data-v-df1caefe"]]);const ve={__name:"SliderChart",props:{screenTimeRange:{type:Array,required:!0},varietyCode:{type:String,required:!0},varietyStock:{type:Number,required:!0},rightType:{type:[Number,null],default:null},klineType:{type:[Number,null],default:null},deleteFirstNumber:{type:Number,default:1},withoutPermission:{type:Number,default:0}},emits:["change"],setup(i,{expose:l,emit:c}){const{request:s}=t.inject("stConfig");let z=null;const p=t.ref(null),T=c,D=i,e=t.ref({data:[],mainIndicator:[],subIndicator:[],time:[]}),k=async()=>{const N={varietyCode:D.varietyCode,cycle:"6",right:D.varietyStock===1?D.rightType:0,contractType:D.varietyStock?null:D.klineType,startTime:"1999-01-01 00:00:00",endTime:L.dayjs().format("YYYY-MM-DD 23:59:59"),deleteFirstNumber:D.deleteFirstNumber,withoutPermission:D.withoutPermission},{body:j}=await s.post("/middleLayer/kline/getKline",N);j?e.value=j:e.value={data:[],mainIndicator:[],subIndicator:[],time:[]},x("init")},P=G.G(N=>{if(!N.dataZoomId)return;const j=z.getOption();if(j!=null&&j.dataZoom[0]){const{startValue:n,endValue:O}=z.getOption().dataZoom[0],{time:m}=e.value,M=`${m[n].split(" ")[0]} 00:00:00`,y=`${m[O].split(" ")[0]} 23:59:59`;console.log(`检测到拖拽轴被拖动, 时间区间: ${M} - ${y}`),T("change",{startTime:M,endTime:y})}},200),I=G.G(({startTime:N,endTime:j})=>{x("reset",{startTime:N,endTime:j})},100),x=(N,j)=>{switch(N){case"init":{const{data:n,time:O}=e.value,{xAxisData:m,lineData:M}=n.reduce((o,g,d)=>(o.xAxisData.push(O[d].split(" ")[0]),o.lineData.push(g[1]),o),{xAxisData:[],lineData:[]}),y={grid:{height:0,left:"100px",right:"80px"},xAxis:{type:"category",data:m,show:!1},yAxis:{type:"value"},dataZoom:[{show:!0,startValue:0,endValue:0,textStyle:{color:"#ccc"}},{type:"inside",startValue:0,endValue:0}],series:[{data:M,type:"line"}]};if(z.setOption(y,!0),D.screenTimeRange.length){const[o,g]=D.screenTimeRange;I({startTime:o,endTime:g})}break}case"reset":{const{time:n}=e.value,O=L.dayjs(j.startTime).format("YYYY-MM-DD"),m=L.dayjs(j.endTime).format("YYYY-MM-DD");let M=-1,y=-1;for(let o=0;o<n.length;o++){const g=L.dayjs(n[o]).format("YYYY-MM-DD");if(M!==-1&&y!==-1)break;M===-1&&(new Date(g)===new Date(O)?M=o:new Date(g)>new Date(O)&&(M=o-1)),y===-1&&(new Date(g)===new Date(m)?y=o:new Date(g)>new Date(m)&&(y=o-1))}y===-1&&(y=n.length-1),z.dispatchAction({type:"dataZoom",startValue:M,endValue:y});break}}};return t.onMounted(()=>{t.nextTick(()=>{z=ae.init(p.value),z.on("datazoom",P),k()})}),t.watch(()=>D.screenTimeRange,N=>{const[j,n]=N;I({startTime:j,endTime:n})},{deep:!0}),t.onUnmounted(()=>{z.off("datazoom"),z.dispose()}),l({resize:G.G(()=>z.resize(),100)}),(N,j)=>(t.openBlock(),t.createElementBlock("div",{class:"chart",ref_key:"sliderChartRef",ref:p},null,512))}},Se=se._export_sfc(ve,[["__scopeId","data-v-0c715da1"]]);const Qe={class:"main-chart"},Pe={class:"indicator"},Re={key:0,class:"screen-time-range"},Fe={key:0,class:"sub-chart"},Ue={class:"indicator"},Ve={class:"title"},Be={key:1,class:"slider-chart"},_e={__name:"index",props:{varietyCode:{type:String,required:!0},varietyStock:{type:Number,required:!0},indicatorStore:{type:Object,required:!0},userKlineConfig:{type:Object,required:!0},cycle:{type:String,required:!0},sellBuy:{type:Number,default:1},rightType:{type:[Number,null],default:null},klineType:{type:[Number,null],default:null},incomeType:{type:Number,default:0},initTimeRange:{type:Array,required:!0},mainIndicator:{type:String,required:!0},tradeLog:{type:Array,default:()=>[]},netPositionData:{type:Array,default:()=>[]},tradeIncomeRateData:{type:Array,default:()=>[]},positionTime:{type:[String,null],default:null},syncBrushRange:{type:Object,default:()=>({cycleList:[],startTime:null,endTime:null})},deleteFirstNumber:{type:Number,default:1},withoutPermission:{type:Number,default:0}},setup(i,{expose:l}){const{round:c,formatValue:s}=G.x,{request:z}=t.inject("stConfig"),p=t.ref(),T=t.ref(!1),D=t.ref(!1),e=i;let k=!1,P=!1,I=!1,x=!1,N=null,j=null,n=null;const O=t.ref(null),m=t.ref(null),M=t.ref({data:[],mainIndicator:[],subIndicator:[],time:[]}),y=t.ref(0),o=t.ref([]),g=t.ref(null),d=t.ref("VOL"),C=t.computed(()=>{const a=M.value.data[y.value];if(!a)return[{label:"开",value:"-"},{label:"高",value:"-"},{label:"低",value:"-"},{label:"收",value:"-"},{label:"额",value:"-"},{label:"涨跌",value:"-"}];const r=[{label:"开",value:a[0]},{label:"高",value:a[3]},{label:"低",value:a[2]},{label:"收",value:a[1]}];a[4]!==null&&r.push({label:"额",value:s(a[4])});let u;return a[6]>0?u="red":a[6]<0&&(u="green"),r.push({label:"涨跌",value:`${c(a[6])}%`,color:u}),r}),S=t.computed(()=>{var a,r;return((r=(a=M.value)==null?void 0:a.mainIndicator)==null?void 0:r.map(u=>({label:u.key,value:c(u.data[y.value]),color:u.color})))||[]}),F=t.computed(()=>{var a,r;return((r=(a=M.value)==null?void 0:a.subIndicator)==null?void 0:r.map(u=>({label:u.key,color:u.color,value:u.data[y.value]||"-"})))||[]}),B=()=>{n||(n=ae.init(m.value),n.on("highlight",G.G(a=>{var r;a.dataIndex?y.value=a.dataIndex:y.value=((r=a.batch)==null?void 0:r[0].dataIndex)??-1},10)),n.on("datazoom",G.G(async()=>{var b;const{loadCheckCount:a}=Z,{startValue:r,endValue:u}=((b=n.getOption())==null?void 0:b.dataZoom[0])??{};I===!1&&x===!1&&r<a&&await W("history"),k===!1&&P===!1&&u>M.value.time.length-a&&await W("new"),ce(),le()})),n.on("globalout",()=>{const a=n.getOption();y.value=a.dataZoom[0].endValue}),n.getZr().on("contextmenu",()=>{var a;g.value=(a=M.value)==null?void 0:a.time[y.value]}),window.addEventListener("keydown",Ne),e.userKlineConfig.enable_subChart&&(j=ae.init(O.value),ae.connect([n,j])),N=G.D(m.value),N.listen(()=>{requestAnimationFrame(()=>{var a;n.resize(),j==null||j.resize(),(a=p.value)==null||a.resize()})}))},U=async({startTime:a,endTime:r})=>{I=!1,x=!1,k=!1,P=!1;try{T.value=!0;const u={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission};["1","2","3","4","5"].includes(e.cycle)?Object.assign(u,{startTime:L.dayjs(a).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(1,"day").format("YYYY-MM-DD HH:mm:ss")}):["6","7"].includes(e.cycle)?Object.assign(u,{startTime:L.dayjs(a).subtract(50,"day").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(50,"day").format("YYYY-MM-DD HH:mm:ss")}):Object.assign(u,{startTime:L.dayjs(a).subtract(10,"month").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(10,"month").format("YYYY-MM-DD HH:mm:ss")});const{body:b}=await z.post("/middleLayer/kline/getKline",u);M.value=b??{data:[],mainIndicator:[],subIndicator:[],time:[]};let f=-1,Y=-1;for(let w=0;w<M.value.time.length;w++){const Q=L.dayjs(M.value.time[w]).format("YYYY-MM-DD");if(f!==-1&&Y!==-1)break;f===-1&&(new Date(Q)===new Date(a)?f=w:new Date(Q)>new Date(a)&&(f=w-1)),Y===-1&&(new Date(Q)===new Date(r)?Y=w:new Date(Q)>new Date(r)&&(Y=w-1))}Y===-1&&(Y=M.value.time.length-1),ee({startValue:f===-1?0:f,endValue:Y===-1?M.value.time.length-1:Y})}finally{T.value=!1}},W=async a=>{var Q,q;const{loadAddCount:r}=Z;switch(a){case"history":{I=!0;const V={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,endTime:M.value.time[0],limit:r,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission},{body:R}=await z.post("/middleLayer/kline/getKline",V);M.value=de(R,M.value),R.data.length<r&&(console.log("[K线] 获取更多数据: 左侧已全部获取完毕, 关闭"),x=!0),I=!1;break}case"new":{k=!0;const V={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,startTime:M.value.time[M.value.time.length-1],limit:r,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission},{body:R}=await z.post("/middleLayer/kline/getKline",V);M.value=de(M.value,R),R.data.length<r&&(console.log("[K线] 获取更多数据: 右侧已全部获取完毕, 关闭"),P=!0),k=!1;break}}const{startValue:u,endValue:b}=((Q=n.getOption())==null?void 0:Q.dataZoom[0])??{},f=(q=n.getOption())==null?void 0:q.xAxis[0].data,Y=M.value.time.findIndex(V=>new Date(V)>=new Date(f[u])),w=M.value.time.findIndex(V=>new Date(V)>=new Date(f[b]));ee({startValue:Y===-1?0:Y,endValue:w===-1?M.value.time.length-1:w})},ce=()=>{var Y;if(!M.value.time.length)return o.value=[];const{time:a}=M.value,{startValue:r,endValue:u}=((Y=n.getOption())==null?void 0:Y.dataZoom[0])??{},b=a[r],f=a[u];["6","7","8"].includes(e.cycle)?o.value=[L.dayjs(b).format("YYYY-MM-DD"),L.dayjs(f).format("YYYY-MM-DD")]:o.value=[b,f]},ee=(a={startValue:0,endValue:0})=>{B();const{maxValueSpan:r}=Z,{time:u,data:b,mainIndicator:f}=M.value,Y=a.endValue-a.startValue>r?a.endValue-r:a.startValue,w=a.endValue,Q=f.map(A=>({name:A.key,type:"line",silent:!0,symbol:"none",data:A.data,lineStyle:{width:A.width||1},itemStyle:{color:A.color}})),{netPositionLineData:q}=be(e.netPositionData,e.cycle),{tradeIncomeRateLineData:V}=he(e.tradeIncomeRateData,e.cycle,e.incomeType,u),{tradePointData:R,tradeLineData:te}=Ce(e.tradeLog,e.cycle,e.sellBuy,u,b,e.userKlineConfig);n.setOption({animation:!1,grid:{top:"40px",left:"60px",right:"20px",bottom:"20px"},dataZoom:[{type:"inside",startValue:Y,endValue:w,minValueSpan:Z.minValueSpan,maxValueSpan:Z.maxValueSpan}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:A=>{const{axisDimension:h,value:E}=A;return h==="x"?["6","7","8"].includes(e.cycle)?L.dayjs(E).format("YYYY-MM-DD"):E:String(c(E))}}},formatter:A=>{if(!(A!=null&&A.length))return null;let h="";if(A.forEach(v=>{if(v.seriesName==="netPosition"&&v.data!==null&&(h+=`<div>资产持仓净值: ${v.data[1]}</div>`),v.componentSubType==="candlestick")if(e.sellBuy===0){const J=R.filter(_=>(_==null?void 0:_.coord[0])===v.axisValue);let $=0,H=0;J.forEach(_=>{const{tradeType:K,amount:Me}=_.customData;K==="买"&&($+=Me),K==="卖"&&(H+=Me)}),$&&(h+=`<div>买: ${$}</div>`),H&&(h+=`<div>卖: ${H}</div>`)}else R.forEach(J=>{if((J==null?void 0:J.coord[0])===v.axisValue){const{tradeType:$,amount:H,profitAndLoss:_,openPriceAll:K,closePriceAll:Me}=J.customData;let X=`<div>${$}: ${H}手</div>`;if($.includes("开")&&(X+=`<div>开仓价: ${(K/H).toFixed(2)}</div>`),$.includes("平")){const ue=(K/H).toFixed(2),je=(Me/H).toFixed(2);X+=`<div>平仓价: ${je}</div>`,X+=`<div>盈亏: ${_==null?void 0:_.toFixed(2)}</div>`,X+=`<div>盈亏比率: ${((je-ue)/ue*100).toFixed(2)} %</div>`}h+=X}})}),!h)return null;let E=A[0].axisValue;return["6","7","8"].includes(e.cycle)&&(E=L.dayjs(E).format("YYYY-MM-DD")),`
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const Te=require("./el-loading-cfd86c15.cjs"),ge=require("./el-empty-1697ded8.cjs");require("./el-tag-a33c4b22.cjs");const ze=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-b6c99b28.cjs");const t=require("vue"),L=require("./dayjs.min-2c20abe6.cjs"),Ie=require("echarts"),G=require("./index-8901a38c.cjs"),se=require("./_plugin-vue_export-helper-f246444f.cjs");require("./use-global-config-30d7d8ce.cjs");require("./use-form-common-props-fd9b61a0.cjs");require("./index-9780a537.cjs");require("./index-098c2447.cjs");require("./index-bb833443.cjs");require("./index-c108567d.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function Ye(i){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const c in i)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(i,c);Object.defineProperty(l,c,s.get?s:{enumerable:!0,get:()=>i[c]})}}return l.default=i,Object.freeze(l)}const ae=Ye(Ie),Le="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FT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LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",{round:fe}=G.x,Z={minValueSpan:5,maxValueSpan:2e3,loadCheckCount:500,loadAddCount:2e3},pe={1:240,2:48,3:16,4:8,5:4,6:1,7:.2,8:.033},ye=({startTime:i,endTime:l,cycle:c,type:s="end"})=>{const{maxValueSpan:z}=Z,p=Math.ceil((z+1e3)/pe[c]),T=L.dayjs(i);if(L.dayjs(l).diff(T,"day")<=p)return[i,l];if(s==="end")return[L.dayjs(l).subtract(p,"day").format("YYYY-MM-DD HH:mm:ss"),l];if(s==="middle"){const k=L.dayjs((L.dayjs(i).valueOf()+L.dayjs(l).valueOf())/2).format("YYYY-MM-DD HH:mm:ss");return console.log("超过一屏数量上限, 进行中间时间计算",k,p/2),[L.dayjs(k).subtract(p/2,"day").format("YYYY-MM-DD HH:mm:ss"),L.dayjs(k).add(p/2,"day").format("YYYY-MM-DD HH:mm:ss")]}},we=(i,l)=>{const c=i[l],s=l===0?i[l]:i[l-1];return c[0]===c[1]?c[0]>=s[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:c[1]>c[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}},xe=(i,l,c)=>{var z,p,T,D;const s=i.subIndicator.map(e=>{if(e.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:e.data.map((k,P)=>e.seriesColor==="kline"?{value:k,itemStyle:we(i.data,P)}:e.seriesColor==="value"?{value:k,itemStyle:{color:k>=0?"#FF0000":"#00FFFF"}}:{value:k,itemStyle:{color:e.seriesColor}})};if(e.series==="line")return{xAxisIndex:0,yAxisIndex:e.yAxis==="right"?2:1,name:e.key,type:"line",silent:!0,symbol:"none",data:e.data,lineStyle:{width:1},itemStyle:{color:e.color}}});return{animation:!1,grid:{top:"10px",left:"60px",right:"20px",bottom:"10px"},dataZoom:[{type:"inside",startValue:l,endValue:c,maxValueSpan:Z.maxValueSpan}],tooltip:{show:!1},axisPointer:{show:!0,triggerTooltip:!1,label:{rich:{},formatter:e=>{const{axisDimension:k,value:P}=e;if(k==="x")return null;if(e.axisIndex===1)return String(fe(P))}}},xAxis:{type:"category",data:i.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!1}},yAxis:[{position:"right"},{position:"left",min:((z=i.subIndicator[0])==null?void 0:z.leftYAxisRange)==="cover"?e=>e.min:null,max:((p=i.subIndicator[0])==null?void 0:p.leftYAxisRange)==="cover"?e=>e.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:((T=i.subIndicator[0])==null?void 0:T.rightYAxisRange)==="cover"?e=>e.min:null,max:((D=i.subIndicator[0])==null?void 0:D.rightYAxisRange)==="cover"?e=>e.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:s}},oe=(i,l,c="strict")=>{let s=0,z=i.length-1,p=-1;for(;s<=z;){let T=Math.floor((s+z)/2);if(c==="strict"){if(i[T]===l)return T;i[T]<l?s=T+1:z=T-1}else c==="gte"&&(i[T]>=l?(p=T,z=T-1):s=T+1)}return c==="strict"?-1:p},Oe=i=>{const l=[];return i.reduce((c,s)=>{const z=`${s.coord[0]}+${s.label.position}`,p=s.label.position==="top"?-16:16,T=c.get(z);return T?(c.set(z,T+1),s.symbolOffset[1]=p*(T+1)):(c.set(z,1),s.symbolOffset[1]=s.label.position==="top"?-7:7),l.push(s),c},new Map),l},de=(i,l)=>({data:[...i.data,...l.data.slice(1)],mainIndicator:i.mainIndicator.map((c,s)=>({...c,data:[...c.data,...l.mainIndicator[s].data.slice(1)]})),subIndicator:i.subIndicator.map((c,s)=>({...c,data:[...c.data,...l.subIndicator[s].data.slice(1)]})),time:[...i.time,...l.time.slice(1)]}),re=(i,l,c)=>{switch(c){case"5":{let I=[...new Set(i.slice(-20).map(y=>{const o=new Date(y),g=String(o.getHours()).padStart(2,"0"),d=String(o.getMinutes()).padStart(2,"0"),C=String(o.getSeconds()).padStart(2,"0");return`${g}:${d}:${C}`}))];I.includes("00:00:00")&&(I.splice(I.indexOf("00:00:00"),1),I.push("24:00:00")),I=I.sort((y,o)=>new Date(`2000-01-30 ${y}`).getTime()-new Date(`2000-01-30 ${o}`).getTime());const x=new Date(l),N=x.getFullYear(),j=String(x.getMonth()+1).padStart(2,"0"),n=String(x.getDate()).padStart(2,"0"),O=String(x.getHours()).padStart(2,"0"),m=String(x.getMinutes()).padStart(2,"0"),M=String(x.getSeconds()).padStart(2,"0");if(`${O}:${m}:${M}`=="00:00:00")return`${N}-${j}-${n} 01:00:00`;{let y=null;for(let o=0;o<I.length;o++){const g=I[o].split(":");if(+`${g[0]}${g[1]}${g[2]}`>=+`${O}${m}${M}`){y=I[o];break}}if(y==="24:00:00"){const o=new Date(l);o.setDate(o.getDate()+1);const g=o.getFullYear(),d=String(o.getMonth()+1).padStart(2,"0"),C=String(o.getDate()).padStart(2,"0");return`${g}-${d}-${C} 00:00:00`}return`${N}-${j}-${n} ${y}`}}case"6":{const I=new Date(l),x=I.getHours();if(x>=4&&x<21){const N=I.getFullYear(),j=String(I.getMonth()+1).padStart(2,"0"),n=String(I.getDate()).padStart(2,"0");return`${N}-${j}-${n} 09:00:00`}else{const N=new Date(l);N.getHours()>=21&&N.setDate(N.getDate()+1);const j=N.getFullYear(),n=String(N.getMonth()+1).padStart(2,"0"),O=String(N.getDate()).padStart(2,"0"),m=`${j}-${n}-${O} 09:00:00`,M=oe(i,m,"gte");return M===-1?m:i[M]}}case"7":{const I=new Date(l),x=new Date(I);x.setDate(I.getDate()-I.getDay()),x.setHours(0,0,0,0);const N=new Date(x);N.setDate(x.getDate()+5),N.setHours(23,59,59,0);const j=new Date(x);j.setDate(x.getDate()+12),j.setHours(9,0,0,0);const n=I<=N?N:j,O=n.getFullYear(),m=String(n.getMonth()+1).padStart(2,"0"),M=String(n.getDate()).padStart(2,"0");return`${O}-${m}-${M} 09:00:00`}case"8":{const I=new Date(l),x=new Date(I.getFullYear(),I.getMonth()+1,1),N=new Date(x);N.setDate(x.getDate()-1),N.setHours(9,0,0,0);const j=N.getFullYear(),n=String(N.getMonth()+1).padStart(2,"0"),O=String(N.getDate()).padStart(2,"0");return`${j}-${n}-${O} 09:00:00`}}const s=new Date(l),z=s.getFullYear(),p=s.getMonth(),T=s.getDate(),D=s.getHours(),e=s.getMinutes(),k=s.getSeconds(),P=I=>{let x=null;const N=Math.floor(e/I);e%I===0&&k===0?x=e:x=(N+1)*I;const j=Math.floor(x/60),n=D+j,O=x%60,m=new Date(z,p,T,n,O,0),M=S=>String(S).padStart(2,"0"),y=m.getFullYear(),o=M(m.getMonth()+1),g=M(m.getDate()),d=M(m.getHours()),C=M(m.getMinutes());return`${y}-${o}-${g} ${d}:${C}:00`};switch(c){case"1":return P(1);case"2":return P(5);case"3":return P(15);case"4":return P(30);default:throw new Error(`Unsupported cycle: ${l} ${c}`)}},ie=(i,l,c)=>{let s=null,z=null;const[p,T]=l;switch(c){case"6":{s=i.find(D=>new Date(L.dayjs(D).format("YYYY-MM-DD 23:59:59")).getTime()>=new Date(p).getTime()),z=i.findLast(D=>new Date(L.dayjs(D).format("YYYY-MM-DD 00:00:00")).getTime()<=new Date(T).getTime());break}case"7":{const D=L.dayjs(T).endOf("week").add(1,"day").format("YYYY-MM-DD 23:59:59");s=i.find(e=>L.dayjs(e).endOf("week").add(1,"day").format("YYYY-MM-DD")===L.dayjs(p).endOf("week").add(1,"day").format("YYYY-MM-DD")),z=i.findLast(e=>new Date(e).getTime()<=new Date(D).getTime());break}case"8":{s=i.find(D=>L.dayjs(D).format("YYYY-MM")===L.dayjs(p).format("YYYY-MM")),z=i.findLast(D=>L.dayjs(D).format("YYYY-MM")===L.dayjs(T).format("YYYY-MM"));break}default:s=i.find(D=>new Date(D).getTime()>=new Date(p).getTime()),z=i.findLast(D=>new Date(D).getTime()<=new Date(T).getTime())}return[s,z]},Ce=(i,l,c,s,z,p)=>{const T=(N,j)=>{const{direction:n="",tradeAction:O="",tradeType:m=""}=N,M=m??n+O;switch(j){case 0:return new Map([["开多","买"],["平多","卖"],["开空","卖"],["平空","买"]]).get(M);case 1:return m??n+O}},D=(N,j,n,O)=>N.reduce((m,M)=>{var F;const y=T(M,0),o=N.filter(B=>B.klineTime===M.klineTime),g=[...new Set(o.map(B=>T(B,0)))];let d=null;g.length>1?d="image://"+new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNjgzNzAzMjI4MjAyIiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjMwNzgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTE5OC4wMTYgMTA5LjczODY2N0E3Ny44NjY2NjcgNzcuODY2NjY3IDAgMCAwIDE3MC42NjY2NjcgMTY3LjY4bDAuNTEyIDQxOC45NDRjMCAyMi44NjkzMzMgNi40IDQ4IDE5LjAyOTMzMyA3NS4zMDY2NjcgMTIuNjcyIDI3LjIyMTMzMyAyNy45ODkzMzMgNDguOTM4NjY3IDQ1Ljk1MiA2NC45Mzg2NjZsMjExLjE1NzMzMyAxODguMjAyNjY3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1MzMzIDM2LjU2NTMzMyAwIDAgMC0xMi41MDEzMzQgMjEuNTA0bC0wLjQyNjY2NiA0LjY5MzMzM3oiIGZpbGw9IiNBRTQ0RkYiIHAtaWQ9IjMwODAiPjwvcGF0aD48cGF0aCBkPSJNNDc1LjMwNjY2NyA2NTguMjE4NjY3aDczLjQ3MlYzMDYuMzg5MzMzaDExNi40OFYyNDguNDQ4aC0zMDcuNjI2NjY3djU3Ljk0MTMzM2gxMTcuNjc0NjY3eiIgZmlsbD0iI0ZGRkZGRiIgcC1pZD0iMzA4MSI+PC9wYXRoPjwvc3ZnPg==",self.location).href:d="image://"+new URL(Object.assign({"./images/buy.svg":Le,"./images/sell.svg":me,"./images/t.svg":Ae})[`./images/${y==="买"?"buy":"sell"}.svg`],self.location).href;const C=oe(n,M.klineTime),S=(F=O[C])==null?void 0:F[3];return j.forEach(B=>{var W;const U=y==="买"?0:1;B.range[U]===M.klineTime&&(B.rangeValue[U]=(W=O[C])==null?void 0:W[y==="买"?2:3])}),m.push({symbol:d,symbolSize:25,symbolRotate:0,symbolOffset:[0,0],label:{show:!1,position:"top"},coord:[M.klineTime,S],silent:!0,animation:!1,customData:{tradeType:y,amount:M.amount,part:M.part,profitAndLoss:M.profitAndLoss,openPriceAll:M.openPriceAll,closePriceAll:M.closePriceAll}}),m},[]),e=(N,j,n,O)=>{const{sellBuyByPrice:m}=p,M=N.reduce((y,o,g)=>{var F,B;const d=T(o,1),C=["开多","开空"].includes(d)?"top":"bottom";let S=null;if(m)S=C==="top"?(o.openPriceAll/o.amount).toFixed(2):(o.closePriceAll/o.amount).toFixed(2);else{const U=oe(n,o.klineTime);S=C==="top"?(F=O[U])==null?void 0:F[3]:(B=O[U])==null?void 0:B[2]}return j.forEach(U=>{(C==="top"?U.range[0]:U.range[1])===o.klineTime&&(U.rangeValue[C==="top"?0:1]=S)}),y.push({symbol:"triangle",symbolSize:[10,12],symbolRotate:C==="top"?180:0,symbolOffset:[0,0],label:{show:!0,position:C,color:"#fff",formatter:`${d} ${C==="top"?"+":"-"} ${o.amount}手 ${o.part?`(${o.part}份)`:""}`},itemStyle:{color:C==="top"?"#FF0000":"#389e0d"},coord:[o.klineTime,S],silent:!0,animation:!1,customData:{tradeType:d,amount:o.amount,part:o.part,profitAndLoss:o.profitAndLoss,openPriceAll:o.openPriceAll,closePriceAll:o.closePriceAll}}),y},[]);return m?M:Oe(M)},k=(N,j,n)=>{const{basePointData:O,baseLineData:m}=N.reduce((g,d)=>{const C={pointTime:d.openTime,tradeAction:"开",tradeDirection:d.tradeDirection?"空":"多",tradeType:`开${d.tradeDirection?"空":"多"}`,part:null,amount:d.tradeVolume,profitAndLoss:d.profitAndLoss,openPriceAll:d.openPrice*d.tradeVolume,closePriceAll:d.closePrice*d.tradeVolume,klineTime:re(n,d.openTime,j)},S={pointTime:d.closeTime,tradeAction:"平",tradeDirection:d.tradeDirection?"空":"多",tradeType:`平${d.tradeDirection?"空":"多"}`,part:null,amount:d.tradeVolume,profitAndLoss:d.profitAndLoss,openPriceAll:d.openPrice*d.tradeVolume,closePriceAll:d.closePrice*d.tradeVolume,klineTime:re(n,d.closeTime,j)},F={range:[C.klineTime,S.klineTime],rangeValue:[null,null],color:S.profitAndLoss>0?"#FF0000":"#389e0d"};return g.basePointData.push(C,S),g.baseLineData.push(F),g},{basePointData:[],baseLineData:[]}),y=[...O.reduce((g,d)=>{const C=JSON.parse(JSON.stringify(d)),S=C.klineTime+C.tradeType;if(g.has(S)){const F=g.get(S);C.amount+=F.amount,C.part+=F.part,C.profitAndLoss+=F.profitAndLoss,C.openPriceAll+=F.openPriceAll,C.closePriceAll+=F.closePriceAll}return g.set(S,C),g},new Map([])).values()].sort((g,d)=>new Date(g.klineTime)-new Date(d.klineTime)),o=m.filter(({range:g})=>g[0]!==g[1]);return{pointData:y,lineData:o}},{pointData:P,lineData:I}=k(i,l,s);return{tradePointData:(c===0?D:e)(P,I,s,z),tradeLineData:I.map(({range:N,rangeValue:j,color:n})=>[{symbol:"none",coord:[N[0],j[0]],lineStyle:{color:n,width:2,type:"solid"},silent:!0,animation:!1},{symbol:"none",coord:[N[1],j[1]],silent:!0,animation:!1}])}},be=(i,l)=>{let c=[];if(Number(l)<=5)c=i.map(({tradeDate:s,netPositionValue:z})=>[L.dayjs(s).format("YYYY-MM-DD HH:mm:ss"),z]);else if(Number(l)===6){const s=i.reduce((z,p)=>{const{tradeDate:T,netPositionValue:D}=p;return z.set(L.dayjs(T).format("YYYY-MM-DD 09:00:00"),D),z},new Map);c=Array.from(s,([z,p])=>[z,p])}else c=[];return{netPositionLineData:c}},he=(i,l,c,s)=>{let z=[];if(["6","7","8"].includes(l)){const p=i.reduce((T,D)=>{const e=re(s,D.date,l),k=D[c===0?"simple":"compound"];return T.set(e,k),T},new Map);z=Array.from(p,([T,D])=>[T,D])}else z=[];return{tradeIncomeRateLineData:z}};const ke={class:"tips"},Ee={__name:"Tips",props:{data:{type:Array,default:()=>[]}},setup(i){return(l,c)=>(t.openBlock(),t.createElementBlock("div",ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.data,(s,z)=>(t.openBlock(),t.createElementBlock("span",{key:z,class:"item",style:t.normalizeStyle({color:s.color})},t.toDisplayString(s.label)+" "+t.toDisplayString(s.value),5))),128))]))}},ne=se._export_sfc(Ee,[["__scopeId","data-v-df1caefe"]]);const ve={__name:"SliderChart",props:{screenTimeRange:{type:Array,required:!0},varietyCode:{type:String,required:!0},varietyStock:{type:Number,required:!0},rightType:{type:[Number,null],default:null},klineType:{type:[Number,null],default:null},deleteFirstNumber:{type:Number,default:1},withoutPermission:{type:Number,default:0}},emits:["change"],setup(i,{expose:l,emit:c}){const{request:s}=t.inject("stConfig");let z=null;const p=t.ref(null),T=c,D=i,e=t.ref({data:[],mainIndicator:[],subIndicator:[],time:[]}),k=async()=>{const N={varietyCode:D.varietyCode,cycle:"6",right:D.varietyStock===1?D.rightType:0,contractType:D.varietyStock?null:D.klineType,startTime:"1999-01-01 00:00:00",endTime:L.dayjs().format("YYYY-MM-DD 23:59:59"),deleteFirstNumber:D.deleteFirstNumber,withoutPermission:D.withoutPermission},{body:j}=await s.post("/middleLayer/kline/getKline",N);j?e.value=j:e.value={data:[],mainIndicator:[],subIndicator:[],time:[]},x("init")},P=G.G(N=>{if(!N.dataZoomId)return;const j=z.getOption();if(j!=null&&j.dataZoom[0]){const{startValue:n,endValue:O}=z.getOption().dataZoom[0],{time:m}=e.value,M=`${m[n].split(" ")[0]} 00:00:00`,y=`${m[O].split(" ")[0]} 23:59:59`;console.log(`检测到拖拽轴被拖动, 时间区间: ${M} - ${y}`),T("change",{startTime:M,endTime:y})}},200),I=G.G(({startTime:N,endTime:j})=>{x("reset",{startTime:N,endTime:j})},100),x=(N,j)=>{switch(N){case"init":{const{data:n,time:O}=e.value,{xAxisData:m,lineData:M}=n.reduce((o,g,d)=>(o.xAxisData.push(O[d].split(" ")[0]),o.lineData.push(g[1]),o),{xAxisData:[],lineData:[]}),y={grid:{height:0,left:"100px",right:"80px"},xAxis:{type:"category",data:m,show:!1},yAxis:{type:"value"},dataZoom:[{show:!0,startValue:0,endValue:0,textStyle:{color:"#ccc"}},{type:"inside",startValue:0,endValue:0}],series:[{data:M,type:"line"}]};if(z.setOption(y,!0),D.screenTimeRange.length){const[o,g]=D.screenTimeRange;I({startTime:o,endTime:g})}break}case"reset":{const{time:n}=e.value,O=L.dayjs(j.startTime).format("YYYY-MM-DD"),m=L.dayjs(j.endTime).format("YYYY-MM-DD");let M=-1,y=-1;for(let o=0;o<n.length;o++){const g=L.dayjs(n[o]).format("YYYY-MM-DD");if(M!==-1&&y!==-1)break;M===-1&&(new Date(g)===new Date(O)?M=o:new Date(g)>new Date(O)&&(M=o-1)),y===-1&&(new Date(g)===new Date(m)?y=o:new Date(g)>new Date(m)&&(y=o-1))}y===-1&&(y=n.length-1),z.dispatchAction({type:"dataZoom",startValue:M,endValue:y});break}}};return t.onMounted(()=>{t.nextTick(()=>{z=ae.init(p.value),z.on("datazoom",P),k()})}),t.watch(()=>D.screenTimeRange,N=>{const[j,n]=N;I({startTime:j,endTime:n})},{deep:!0}),t.onUnmounted(()=>{z.off("datazoom"),z.dispose()}),l({resize:G.G(()=>z.resize(),100)}),(N,j)=>(t.openBlock(),t.createElementBlock("div",{class:"chart",ref_key:"sliderChartRef",ref:p},null,512))}},Se=se._export_sfc(ve,[["__scopeId","data-v-0c715da1"]]);const Qe={class:"main-chart"},Pe={class:"indicator"},Re={key:0,class:"screen-time-range"},Fe={key:0,class:"sub-chart"},Ue={class:"indicator"},Ve={class:"title"},Be={key:1,class:"slider-chart"},_e={__name:"index",props:{varietyCode:{type:String,required:!0},varietyStock:{type:Number,required:!0},indicatorStore:{type:Object,required:!0},userKlineConfig:{type:Object,required:!0},cycle:{type:String,required:!0},sellBuy:{type:Number,default:1},rightType:{type:[Number,null],default:null},klineType:{type:[Number,null],default:null},incomeType:{type:Number,default:0},initTimeRange:{type:Array,required:!0},mainIndicator:{type:String,required:!0},tradeLog:{type:Array,default:()=>[]},netPositionData:{type:Array,default:()=>[]},tradeIncomeRateData:{type:Array,default:()=>[]},positionTime:{type:[String,null],default:null},syncBrushRange:{type:Object,default:()=>({cycleList:[],startTime:null,endTime:null})},deleteFirstNumber:{type:Number,default:1},withoutPermission:{type:Number,default:0}},setup(i,{expose:l}){const{round:c,formatValue:s}=G.x,{request:z}=t.inject("stConfig"),p=t.ref(),T=t.ref(!1),D=t.ref(!1),e=i;let k=!1,P=!1,I=!1,x=!1,N=null,j=null,n=null;const O=t.ref(null),m=t.ref(null),M=t.ref({data:[],mainIndicator:[],subIndicator:[],time:[]}),y=t.ref(0),o=t.ref([]),g=t.ref(null),d=t.ref("VOL"),C=t.computed(()=>{const a=M.value.data[y.value];if(!a)return[{label:"开",value:"-"},{label:"高",value:"-"},{label:"低",value:"-"},{label:"收",value:"-"},{label:"额",value:"-"},{label:"涨跌",value:"-"}];const r=[{label:"开",value:a[0]},{label:"高",value:a[3]},{label:"低",value:a[2]},{label:"收",value:a[1]}];a[4]!==null&&r.push({label:"额",value:s(a[4])});let u;return a[6]>0?u="red":a[6]<0&&(u="green"),r.push({label:"涨跌",value:`${c(a[6])}%`,color:u}),r}),S=t.computed(()=>{var a,r;return((r=(a=M.value)==null?void 0:a.mainIndicator)==null?void 0:r.map(u=>({label:u.key,value:c(u.data[y.value]),color:u.color})))||[]}),F=t.computed(()=>{var a,r;return((r=(a=M.value)==null?void 0:a.subIndicator)==null?void 0:r.map(u=>({label:u.key,color:u.color,value:u.data[y.value]||"-"})))||[]}),B=()=>{n||(n=ae.init(m.value),n.on("highlight",G.G(a=>{var r;a.dataIndex?y.value=a.dataIndex:y.value=((r=a.batch)==null?void 0:r[0].dataIndex)??-1},10)),n.on("datazoom",G.G(async()=>{var b;const{loadCheckCount:a}=Z,{startValue:r,endValue:u}=((b=n.getOption())==null?void 0:b.dataZoom[0])??{};I===!1&&x===!1&&r<a&&await W("history"),k===!1&&P===!1&&u>M.value.time.length-a&&await W("new"),ce(),le()})),n.on("globalout",()=>{const a=n.getOption();y.value=a.dataZoom[0].endValue}),n.getZr().on("contextmenu",()=>{var a;g.value=(a=M.value)==null?void 0:a.time[y.value]}),window.addEventListener("keydown",Ne),e.userKlineConfig.enable_subChart&&(j=ae.init(O.value),ae.connect([n,j])),N=G.D(m.value),N.listen(()=>{requestAnimationFrame(()=>{var a;n.resize(),j==null||j.resize(),(a=p.value)==null||a.resize()})}))},U=async({startTime:a,endTime:r})=>{I=!1,x=!1,k=!1,P=!1;try{T.value=!0;const u={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission};["1","2","3","4","5"].includes(e.cycle)?Object.assign(u,{startTime:L.dayjs(a).subtract(1,"day").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(1,"day").format("YYYY-MM-DD HH:mm:ss")}):["6","7"].includes(e.cycle)?Object.assign(u,{startTime:L.dayjs(a).subtract(50,"day").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(50,"day").format("YYYY-MM-DD HH:mm:ss")}):Object.assign(u,{startTime:L.dayjs(a).subtract(10,"month").format("YYYY-MM-DD HH:mm:ss"),endTime:L.dayjs(r).add(10,"month").format("YYYY-MM-DD HH:mm:ss")});const{body:b}=await z.post("/middleLayer/kline/getKline",u);M.value=b??{data:[],mainIndicator:[],subIndicator:[],time:[]};let f=-1,Y=-1;for(let w=0;w<M.value.time.length;w++){const Q=L.dayjs(M.value.time[w]).format("YYYY-MM-DD");if(f!==-1&&Y!==-1)break;f===-1&&(new Date(Q)===new Date(a)?f=w:new Date(Q)>new Date(a)&&(f=w-1)),Y===-1&&(new Date(Q)===new Date(r)?Y=w:new Date(Q)>new Date(r)&&(Y=w-1))}Y===-1&&(Y=M.value.time.length-1),ee({startValue:f===-1?0:f,endValue:Y===-1?M.value.time.length-1:Y})}finally{T.value=!1}},W=async a=>{var Q,q;const{loadAddCount:r}=Z;switch(a){case"history":{I=!0;const V={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,endTime:M.value.time[0],limit:r,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission},{body:R}=await z.post("/middleLayer/kline/getKline",V);M.value=de(R,M.value),R.data.length<r&&(console.log("[K线] 获取更多数据: 左侧已全部获取完毕, 关闭"),x=!0),I=!1;break}case"new":{k=!0;const V={varietyCode:e.varietyCode,cycle:e.cycle,right:e.varietyStock===1?e.rightType:0,contractType:e.varietyStock?null:e.klineType,startTime:M.value.time[M.value.time.length-1],limit:r,mainIndicatorList:e.indicatorStore.getIndicatorParams(e.mainIndicator),subIndicator:d.value,deleteFirstNumber:e.deleteFirstNumber,withoutPermission:e.withoutPermission},{body:R}=await z.post("/middleLayer/kline/getKline",V);M.value=de(M.value,R),R.data.length<r&&(console.log("[K线] 获取更多数据: 右侧已全部获取完毕, 关闭"),P=!0),k=!1;break}}const{startValue:u,endValue:b}=((Q=n.getOption())==null?void 0:Q.dataZoom[0])??{},f=(q=n.getOption())==null?void 0:q.xAxis[0].data,Y=M.value.time.findIndex(V=>new Date(V)>=new Date(f[u])),w=M.value.time.findIndex(V=>new Date(V)>=new Date(f[b]));ee({startValue:Y===-1?0:Y,endValue:w===-1?M.value.time.length-1:w})},ce=()=>{var Y;if(!M.value.time.length)return o.value=[];const{time:a}=M.value,{startValue:r,endValue:u}=((Y=n.getOption())==null?void 0:Y.dataZoom[0])??{},b=a[r],f=a[u];["6","7","8"].includes(e.cycle)?o.value=[L.dayjs(b).format("YYYY-MM-DD"),L.dayjs(f).format("YYYY-MM-DD")]:o.value=[b,f]},ee=(a={startValue:0,endValue:0})=>{B();const{maxValueSpan:r}=Z,{time:u,data:b,mainIndicator:f}=M.value,Y=a.endValue-a.startValue>r?a.endValue-r:a.startValue,w=a.endValue,Q=f.map(A=>({name:A.key,type:"line",silent:!0,symbol:"none",data:A.data,lineStyle:{width:A.width||1},itemStyle:{color:A.color}})),{netPositionLineData:q}=be(e.netPositionData,e.cycle),{tradeIncomeRateLineData:V}=he(e.tradeIncomeRateData,e.cycle,e.incomeType,u),{tradePointData:R,tradeLineData:te}=Ce(e.tradeLog,e.cycle,e.sellBuy,u,b,e.userKlineConfig);n.setOption({animation:!1,grid:{top:"40px",left:"60px",right:"20px",bottom:"20px"},dataZoom:[{type:"inside",startValue:Y,endValue:w,minValueSpan:Z.minValueSpan,maxValueSpan:Z.maxValueSpan}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:A=>{const{axisDimension:h,value:E}=A;return h==="x"?["6","7","8"].includes(e.cycle)?L.dayjs(E).format("YYYY-MM-DD"):E:String(c(E))}}},formatter:A=>{if(!(A!=null&&A.length))return null;let h="";if(A.forEach(v=>{if(v.seriesName==="netPosition"&&v.data!==null&&(h+=`<div>资产持仓净值: ${v.data[1]}</div>`),v.componentSubType==="candlestick")if(e.sellBuy===0){const J=R.filter(_=>(_==null?void 0:_.coord[0])===v.axisValue);let $=0,H=0;J.forEach(_=>{const{tradeType:K,amount:Me}=_.customData;K==="买"&&($+=Me),K==="卖"&&(H+=Me)}),$&&(h+=`<div>买: ${$}</div>`),H&&(h+=`<div>卖: ${H}</div>`)}else R.forEach(J=>{if((J==null?void 0:J.coord[0])===v.axisValue){const{tradeType:$,amount:H,profitAndLoss:_,openPriceAll:K,closePriceAll:Me}=J.customData;let X=`<div>${$}: ${H}手</div>`;if($.includes("开")&&(X+=`<div>开仓价: ${(K/H).toFixed(2)}</div>`),$.includes("平")){const ue=(K/H).toFixed(2),je=(Me/H).toFixed(2);X+=`<div>平仓价: ${je}</div>`,X+=`<div>盈亏: ${_==null?void 0:_.toFixed(2)}</div>`,X+=`<div>盈亏比率: ${((je-ue)/ue*100).toFixed(2)} %</div>`}h+=X}})}),!h)return null;let E=A[0].axisValue;return["6","7","8"].includes(e.cycle)&&(E=L.dayjs(E).format("YYYY-MM-DD")),`
|
|
2
2
|
<div>
|
|
3
3
|
<span style="font-weight: bold;">${E}</span>
|
|
4
4
|
${h}
|
package/es/KlinePlus.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import "./base-a5af3db3.js";
|
|
2
|
-
import { v as he } from "./el-loading-
|
|
2
|
+
import { v as he } from "./el-loading-f6022062.js";
|
|
3
3
|
import { E as ke } from "./el-empty-33cb66f1.js";
|
|
4
|
-
import "./el-tag-
|
|
5
|
-
import { E as ve, a as Ee } from "./el-select-
|
|
4
|
+
import "./el-tag-66cab138.js";
|
|
5
|
+
import { E as ve, a as Ee } from "./el-select-95627997.js";
|
|
6
6
|
import "./el-scrollbar-323542e7.js";
|
|
7
|
-
import "./el-popper-
|
|
7
|
+
import "./el-popper-b4f97157.js";
|
|
8
8
|
import { openBlock as _, createElementBlock as Z, Fragment as pe, renderList as we, normalizeStyle as Se, toDisplayString as ie, inject as fe, ref as V, onMounted as xe, nextTick as Qe, watch as ae, onUnmounted as Oe, computed as ce, withDirectives as Pe, createElementVNode as W, createVNode as Me, createCommentVNode as le, withCtx as Re, createBlock as Le } from "vue";
|
|
9
9
|
import { d as Y } from "./dayjs.min-8313b006.js";
|
|
10
10
|
import * as Ne from "echarts";
|
|
11
11
|
import { x as Ce, G as ne, D as Fe } from "./index-7ed0999e.js";
|
|
12
12
|
import { _ as de } from "./_plugin-vue_export-helper-dad06003.js";
|
|
13
|
-
import "./use-global-config-
|
|
14
|
-
import "./use-form-common-props-
|
|
13
|
+
import "./use-global-config-b5e9d3d5.js";
|
|
14
|
+
import "./use-form-common-props-815d48a6.js";
|
|
15
15
|
import "./index-960806da.js";
|
|
16
|
-
import "./index-
|
|
16
|
+
import "./index-a871c3eb.js";
|
|
17
17
|
import "./index-d77a7336.js";
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
18
|
+
import "./index-e5566b94.js";
|
|
19
|
+
import "./index-844bdd85.js";
|
|
20
|
+
import "./index-57672682.js";
|
|
21
21
|
import "./castArray-7741a212.js";
|
|
22
|
-
import "./index-
|
|
22
|
+
import "./index-d91dc23f.js";
|
|
23
23
|
import "./scroll-679bd6bf.js";
|
|
24
24
|
import "./debounce-8d53f4dd.js";
|
|
25
25
|
import "./vnode-5ddb7ed1.js";
|
package/es/Pagination.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./base-ef747d02.cjs"),V=require("./zh-cn-a3c3833a.cjs");require("./el-tag-891b703d.cjs");const A=require("./el-select-91145989.cjs");require("./el-scrollbar-bc3f790d.cjs");const $=require("./el-popper-b37ec1ef.cjs"),H=require("./el-input-2e9268ac.cjs"),e=require("vue"),N=require("./index-7a85500c.cjs"),B=require("./use-form-common-props-3b387353.cjs"),x=require("./index-bb833443.cjs"),j=require("./typescript-b63f8e83.cjs"),K=require("./index-6c252a43.cjs"),G=require("./index-f1c702f6.cjs"),O=require("./_plugin-vue_export-helper-f246444f.cjs");require("./config-provider-285ead82.cjs");require("./use-global-config-2a4156cd.cjs");require("./index-9780a537.cjs");require("./index-f50a50b3.cjs");require("./index-d7928b14.cjs");require("./castArray-35947698.cjs");require("./index-eb3ca89a.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");const U=Symbol("elPaginationKey"),W=i.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:B.iconPropType}}),J={click:a=>a instanceof MouseEvent},R=e.defineComponent({name:"ElPaginationPrev"}),Q=e.defineComponent({...R,props:W,emits:J,setup(a){const u=a,{t:r}=x.useLocale(),s=e.computed(()=>u.disabled||u.currentPage<=1);return(l,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-prev",disabled:e.unref(s),"aria-label":l.prevText||e.unref(r)("el.pagination.prev"),"aria-disabled":e.unref(s),onClick:f=>l.$emit("click",f)},[l.prevText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(l.prevText),1)):(e.openBlock(),e.createBlock(e.unref(N.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var X=i._export_sfc(Q,[["__file","prev.vue"]]);const Y=i.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:B.iconPropType}}),Z=e.defineComponent({name:"ElPaginationNext"}),ee=e.defineComponent({...Z,props:Y,emits:["click"],setup(a){const u=a,{t:r}=x.useLocale(),s=e.computed(()=>u.disabled||u.currentPage===u.pageCount||u.pageCount===0);return(l,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-next",disabled:e.unref(s),"aria-label":l.nextText||e.unref(r)("el.pagination.next"),"aria-disabled":e.unref(s),onClick:f=>l.$emit("click",f)},[l.nextText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(l.nextText),1)):(e.openBlock(),e.createBlock(e.unref(N.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var ae=i._export_sfc(ee,[["__file","next.vue"]]);const L=()=>e.inject(U,{}),ne=i.buildProps({pageSize:{type:Number,required:!0},pageSizes:{type:i.definePropType(Array),default:()=>j.mutable([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:B.componentSizes},appendSizeTo:String}),te=e.defineComponent({name:"ElPaginationSizes"}),re=e.defineComponent({...te,props:ne,emits:["page-size-change"],setup(a,{emit:u}){const r=a,{t:s}=x.useLocale(),l=i.useNamespace("pagination"),d=L(),f=e.ref(r.pageSize);e.watch(()=>r.pageSizes,(c,P)=>{if(!K.isEqual(c,P)&&i.isArray(c)){const p=c.includes(r.pageSize)?r.pageSize:r.pageSizes[0];u("page-size-change",p)}}),e.watch(()=>r.pageSize,c=>{f.value=c});const b=e.computed(()=>r.pageSizes);function C(c){var P;c!==f.value&&(f.value=c,(P=d.handleSizeChange)==null||P.call(d,Number(c)))}return(c,P)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(l).e("sizes"))},[e.createVNode(e.unref(A.ElSelect),{"model-value":f.value,disabled:c.disabled,"popper-class":c.popperClass,size:c.size,teleported:c.teleported,"validate-event":!1,"append-to":c.appendSizeTo,onChange:C},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),p=>(e.openBlock(),e.createBlock(e.unref(A.ElOption),{key:p,value:p,label:p+e.unref(s)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var oe=i._export_sfc(re,[["__file","sizes.vue"]]);const le=i.buildProps({size:{type:String,values:B.componentSizes}}),ie=e.defineComponent({name:"ElPaginationJumper"}),ue=e.defineComponent({...ie,props:le,setup(a){const{t:u}=x.useLocale(),r=i.useNamespace("pagination"),{pageCount:s,disabled:l,currentPage:d,changeEvent:f}=L(),b=e.ref(),C=e.computed(()=>{var p;return(p=b.value)!=null?p:d==null?void 0:d.value});function c(p){b.value=p?+p:""}function P(p){p=Math.trunc(+p),f==null||f(p),b.value=void 0}return(p,q)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r).e("jump")),disabled:e.unref(l)},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(r).e("goto")])},e.toDisplayString(e.unref(u)("el.pagination.goto")),3),e.createVNode(e.unref(H.ElInput),{size:p.size,class:e.normalizeClass([e.unref(r).e("editor"),e.unref(r).is("in-pagination")]),min:1,max:e.unref(s),disabled:e.unref(l),"model-value":e.unref(C),"validate-event":!1,"aria-label":e.unref(u)("el.pagination.page"),type:"number","onUpdate:modelValue":c,onChange:P},null,8,["size","class","max","disabled","model-value","aria-label"]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(r).e("classifier")])},e.toDisplayString(e.unref(u)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var se=i._export_sfc(ue,[["__file","jumper.vue"]]);const ce=i.buildProps({total:{type:Number,default:1e3}}),pe=e.defineComponent({name:"ElPaginationTotal"}),de=e.defineComponent({...pe,props:ce,setup(a){const{t:u}=x.useLocale(),r=i.useNamespace("pagination"),{disabled:s}=L();return(l,d)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r).e("total")),disabled:e.unref(s)},e.toDisplayString(e.unref(u)("el.pagination.total",{total:l.total})),11,["disabled"]))}});var ge=i._export_sfc(de,[["__file","total.vue"]]);const fe=i.buildProps({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),me=e.defineComponent({name:"ElPaginationPager"}),be=e.defineComponent({...me,props:fe,emits:[$.CHANGE_EVENT],setup(a,{emit:u}){const r=a,s=i.useNamespace("pager"),l=i.useNamespace("icon"),{t:d}=x.useLocale(),f=e.ref(!1),b=e.ref(!1),C=e.ref(!1),c=e.ref(!1),P=e.ref(!1),p=e.ref(!1),q=e.computed(()=>{const o=r.pagerCount,n=(o-1)/2,t=Number(r.currentPage),v=Number(r.pageCount);let m=!1,k=!1;v>o&&(t>o-n&&(m=!0),t<v-n&&(k=!0));const S=[];if(m&&!k){const h=v-(o-2);for(let y=h;y<v;y++)S.push(y)}else if(!m&&k)for(let h=2;h<o;h++)S.push(h);else if(m&&k){const h=Math.floor(o/2)-1;for(let y=t-h;y<=t+h;y++)S.push(y)}else for(let h=2;h<v;h++)S.push(h);return S}),E=e.computed(()=>["more","btn-quickprev",l.b(),s.is("disabled",r.disabled)]),_=e.computed(()=>["more","btn-quicknext",l.b(),s.is("disabled",r.disabled)]),g=e.computed(()=>r.disabled?-1:0);e.watch(()=>[r.pageCount,r.pagerCount,r.currentPage],([o,n,t])=>{const v=(n-1)/2;let m=!1,k=!1;o>n&&(m=t>n-v,k=t<o-v),C.value&&(C.value=m),c.value&&(c.value=k),f.value=m,b.value=k},{immediate:!0});function T(o=!1){r.disabled||(o?C.value=!0:c.value=!0)}function M(o=!1){o?P.value=!0:p.value=!0}function I(o){const n=o.target;if(n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("number")){const t=Number(n.textContent);t!==r.currentPage&&u($.CHANGE_EVENT,t)}else n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("more")&&D(o)}function D(o){const n=o.target;if(n.tagName.toLowerCase()==="ul"||r.disabled)return;let t=Number(n.textContent);const v=r.pageCount,m=r.currentPage,k=r.pagerCount-2;n.className.includes("more")&&(n.className.includes("quickprev")?t=m-k:n.className.includes("quicknext")&&(t=m+k)),Number.isNaN(+t)||(t<1&&(t=1),t>v&&(t=v)),t!==m&&u($.CHANGE_EVENT,t)}return(o,n)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(s).b()),onClick:D,onKeyup:e.withKeys(I,["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(g)}," 1 ",10,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0),f.value?(e.openBlock(),e.createElementBlock("li",{key:1,class:e.normalizeClass(e.unref(E)),tabindex:e.unref(g),"aria-label":e.unref(d)("el.pagination.prevPages",{pager:o.pagerCount-2}),onMouseenter:t=>T(!0),onMouseleave:t=>C.value=!1,onFocus:t=>M(!0),onBlur:t=>P.value=!1},[(C.value||P.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(N.d_arrow_left_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.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(q),t=>(e.openBlock(),e.createElementBlock("li",{key:t,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===t),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===t,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:t}),tabindex:e.unref(g)},e.toDisplayString(t),11,["aria-current","aria-label","tabindex"]))),128)),b.value?(e.openBlock(),e.createElementBlock("li",{key:2,class:e.normalizeClass(e.unref(_)),tabindex:e.unref(g),"aria-label":e.unref(d)("el.pagination.nextPages",{pager:o.pagerCount-2}),onMouseenter:t=>T(),onMouseleave:t=>c.value=!1,onFocus:t=>M(),onBlur:t=>p.value=!1},[(c.value||p.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(N.d_arrow_right_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.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(g)},e.toDisplayString(o.pageCount),11,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0)],42,["onKeyup"]))}});var ve=i._export_sfc(be,[["__file","pager.vue"]]);const z=a=>typeof a!="number",Ce=i.buildProps({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:a=>i.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:i.definePropType(Array),default:()=>j.mutable([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:B.iconPropType,default:()=>N.arrow_left_default},nextText:{type:String,default:""},nextIcon:{type:B.iconPropType,default:()=>N.arrow_right_default},teleported:{type:Boolean,default:!0},small:Boolean,size:B.useSizeProp,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),Pe={"update:current-page":a=>i.isNumber(a),"update:page-size":a=>i.isNumber(a),"size-change":a=>i.isNumber(a),change:(a,u)=>i.isNumber(a)&&i.isNumber(u),"current-change":a=>i.isNumber(a),"prev-click":a=>i.isNumber(a),"next-click":a=>i.isNumber(a)},F="ElPagination";var ze=e.defineComponent({name:F,props:Ce,emits:Pe,setup(a,{emit:u,slots:r}){const{t:s}=x.useLocale(),l=i.useNamespace("pagination"),d=e.getCurrentInstance().vnode.props||{},f=B.useGlobalSize(),b=e.computed(()=>{var n;return a.small?"small":(n=a.size)!=null?n:f.value});G.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 C="onUpdate:currentPage"in d||"onUpdate:current-page"in d||"onCurrentChange"in d,c="onUpdate:pageSize"in d||"onUpdate:page-size"in d||"onSizeChange"in d,P=e.computed(()=>{if(z(a.total)&&z(a.pageCount)||!z(a.currentPage)&&!C)return!1;if(a.layout.includes("sizes")){if(z(a.pageCount)){if(!z(a.total)&&!z(a.pageSize)&&!c)return!1}else if(!c)return!1}return!0}),p=e.ref(z(a.defaultPageSize)?10:a.defaultPageSize),q=e.ref(z(a.defaultCurrentPage)?1:a.defaultCurrentPage),E=e.computed({get(){return z(a.pageSize)?p.value:a.pageSize},set(n){z(a.pageSize)&&(p.value=n),c&&(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/E.value))):n=a.pageCount,n}),g=e.computed({get(){return z(a.currentPage)?q.value:a.currentPage},set(n){let t=n;n<1?t=1:n>_.value&&(t=_.value),z(a.currentPage)&&(q.value=t),C&&(u("update:current-page",t),u("current-change",t))}});e.watch(_,n=>{g.value>n&&(g.value=n)}),e.watch([g,E],n=>{u($.CHANGE_EVENT,...n)},{flush:"post"});function T(n){g.value=n}function M(n){E.value=n;const t=_.value;g.value>t&&(g.value=t)}function I(){a.disabled||(g.value-=1,u("prev-click",g.value))}function D(){a.disabled||(g.value+=1,u("next-click",g.value))}function o(n,t){n&&(n.props||(n.props={}),n.props.class=[n.props.class,t].join(" "))}return e.provide(U,{pageCount:_,disabled:e.computed(()=>a.disabled),currentPage:g,changeEvent:T,handleSizeChange:M}),()=>{var n,t;if(!P.value)return $.debugWarn(F,s("el.pagination.deprecationWarning")),null;if(!a.layout||a.hideOnSinglePage&&_.value<=1)return null;const v=[],m=[],k=e.h("div",{class:l.e("rightwrapper")},m),S={prev:e.h(X,{disabled:a.disabled,currentPage:g.value,prevText:a.prevText,prevIcon:a.prevIcon,onClick:I}),jumper:e.h(se,{size:b.value}),pager:e.h(ve,{currentPage:g.value,pageCount:_.value,pagerCount:a.pagerCount,onChange:T,disabled:a.disabled}),next:e.h(ae,{disabled:a.disabled,currentPage:g.value,pageCount:_.value,nextText:a.nextText,nextIcon:a.nextIcon,onClick:D}),sizes:e.h(oe,{pageSize:E.value,pageSizes:a.pageSizes,popperClass:a.popperClass,disabled:a.disabled,teleported:a.teleported,size:b.value,appendSizeTo:a.appendSizeTo}),slot:(t=(n=r==null?void 0:r.default)==null?void 0:n.call(r))!=null?t:null,total:e.h(ge,{total:z(a.total)?0:a.total})},h=a.layout.split(",").map(w=>w.trim());let y=!1;return h.forEach(w=>{if(w==="->"){y=!0;return}y?m.push(S[w]):v.push(S[w])}),o(v[0],l.is("first")),o(v[v.length-1],l.is("last")),y&&m.length>0&&(o(m[0],l.is("first")),o(m[m.length-1],l.is("last")),v.push(k)),e.h("div",{class:[l.b(),l.is("background",a.background),l.m(b.value)]},v)}}});const he=i.withInstall(ze);const ke=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 r=u,s=a,l=e.computed({get(){return s.pageData.pageNum},set(b){r("update:pageData",{...s.pageData,pageNum:b})}}),d=e.computed({get(){return s.pageData.pageSize},set(b){r("update:pageData",{...s.pageData,pageSize:b})}}),f=()=>{r("change",s.pageData)};return(b,C)=>{const c=he,P=V.ElConfigProvider;return e.openBlock(),e.createBlock(P,{locale:e.unref(V.zhCn)},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(c,e.mergeProps({class:"st-pagination",currentPage:l.value,"onUpdate:currentPage":C[0]||(C[0]=p=>l.value=p),"page-size":d.value,"onUpdate:pageSize":C[1]||(C[1]=p=>d.value=p),total:a.total,background:a.background,"page-sizes":a.pageSizes,layout:a.layout},b.$attrs,{onSizeChange:f,onCurrentChange:f}),null,16,["currentPage","page-size","total","background","page-sizes","layout"]),[[e.vShow,a.total]])]),_:1},8,["locale"])}}});const ye=O._export_sfc(ke,[["__scopeId","data-v-61b7745b"]]),_e={install(a){a.component("st-pagination",ye)}};module.exports=_e;
|
|
1
|
+
"use strict";const i=require("./base-ef747d02.cjs"),V=require("./zh-cn-90317f62.cjs");require("./el-tag-a33c4b22.cjs");const A=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");const $=require("./el-popper-b6c99b28.cjs"),H=require("./el-input-7fd293af.cjs"),e=require("vue"),N=require("./index-098c2447.cjs"),B=require("./use-form-common-props-fd9b61a0.cjs"),x=require("./index-bb833443.cjs"),j=require("./typescript-b63f8e83.cjs"),K=require("./index-c108567d.cjs"),G=require("./index-f1c702f6.cjs"),O=require("./_plugin-vue_export-helper-f246444f.cjs");require("./config-provider-a584d81e.cjs");require("./use-global-config-30d7d8ce.cjs");require("./index-9780a537.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");const U=Symbol("elPaginationKey"),W=i.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},prevText:{type:String},prevIcon:{type:B.iconPropType}}),J={click:a=>a instanceof MouseEvent},R=e.defineComponent({name:"ElPaginationPrev"}),Q=e.defineComponent({...R,props:W,emits:J,setup(a){const u=a,{t:r}=x.useLocale(),s=e.computed(()=>u.disabled||u.currentPage<=1);return(l,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-prev",disabled:e.unref(s),"aria-label":l.prevText||e.unref(r)("el.pagination.prev"),"aria-disabled":e.unref(s),onClick:f=>l.$emit("click",f)},[l.prevText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(l.prevText),1)):(e.openBlock(),e.createBlock(e.unref(N.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.prevIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var X=i._export_sfc(Q,[["__file","prev.vue"]]);const Y=i.buildProps({disabled:Boolean,currentPage:{type:Number,default:1},pageCount:{type:Number,default:50},nextText:{type:String},nextIcon:{type:B.iconPropType}}),Z=e.defineComponent({name:"ElPaginationNext"}),ee=e.defineComponent({...Z,props:Y,emits:["click"],setup(a){const u=a,{t:r}=x.useLocale(),s=e.computed(()=>u.disabled||u.currentPage===u.pageCount||u.pageCount===0);return(l,d)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"btn-next",disabled:e.unref(s),"aria-label":l.nextText||e.unref(r)("el.pagination.next"),"aria-disabled":e.unref(s),onClick:f=>l.$emit("click",f)},[l.nextText?(e.openBlock(),e.createElementBlock("span",{key:0},e.toDisplayString(l.nextText),1)):(e.openBlock(),e.createBlock(e.unref(N.ElIcon),{key:1},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.nextIcon)))]),_:1}))],8,["disabled","aria-label","aria-disabled","onClick"]))}});var ae=i._export_sfc(ee,[["__file","next.vue"]]);const L=()=>e.inject(U,{}),ne=i.buildProps({pageSize:{type:Number,required:!0},pageSizes:{type:i.definePropType(Array),default:()=>j.mutable([10,20,30,40,50,100])},popperClass:{type:String},disabled:Boolean,teleported:Boolean,size:{type:String,values:B.componentSizes},appendSizeTo:String}),te=e.defineComponent({name:"ElPaginationSizes"}),re=e.defineComponent({...te,props:ne,emits:["page-size-change"],setup(a,{emit:u}){const r=a,{t:s}=x.useLocale(),l=i.useNamespace("pagination"),d=L(),f=e.ref(r.pageSize);e.watch(()=>r.pageSizes,(c,P)=>{if(!K.isEqual(c,P)&&i.isArray(c)){const p=c.includes(r.pageSize)?r.pageSize:r.pageSizes[0];u("page-size-change",p)}}),e.watch(()=>r.pageSize,c=>{f.value=c});const b=e.computed(()=>r.pageSizes);function C(c){var P;c!==f.value&&(f.value=c,(P=d.handleSizeChange)==null||P.call(d,Number(c)))}return(c,P)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(l).e("sizes"))},[e.createVNode(e.unref(A.ElSelect),{"model-value":f.value,disabled:c.disabled,"popper-class":c.popperClass,size:c.size,teleported:c.teleported,"validate-event":!1,"append-to":c.appendSizeTo,onChange:C},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),p=>(e.openBlock(),e.createBlock(e.unref(A.ElOption),{key:p,value:p,label:p+e.unref(s)("el.pagination.pagesize")},null,8,["value","label"]))),128))]),_:1},8,["model-value","disabled","popper-class","size","teleported","append-to"])],2))}});var oe=i._export_sfc(re,[["__file","sizes.vue"]]);const le=i.buildProps({size:{type:String,values:B.componentSizes}}),ie=e.defineComponent({name:"ElPaginationJumper"}),ue=e.defineComponent({...ie,props:le,setup(a){const{t:u}=x.useLocale(),r=i.useNamespace("pagination"),{pageCount:s,disabled:l,currentPage:d,changeEvent:f}=L(),b=e.ref(),C=e.computed(()=>{var p;return(p=b.value)!=null?p:d==null?void 0:d.value});function c(p){b.value=p?+p:""}function P(p){p=Math.trunc(+p),f==null||f(p),b.value=void 0}return(p,q)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r).e("jump")),disabled:e.unref(l)},[e.createElementVNode("span",{class:e.normalizeClass([e.unref(r).e("goto")])},e.toDisplayString(e.unref(u)("el.pagination.goto")),3),e.createVNode(e.unref(H.ElInput),{size:p.size,class:e.normalizeClass([e.unref(r).e("editor"),e.unref(r).is("in-pagination")]),min:1,max:e.unref(s),disabled:e.unref(l),"model-value":e.unref(C),"validate-event":!1,"aria-label":e.unref(u)("el.pagination.page"),type:"number","onUpdate:modelValue":c,onChange:P},null,8,["size","class","max","disabled","model-value","aria-label"]),e.createElementVNode("span",{class:e.normalizeClass([e.unref(r).e("classifier")])},e.toDisplayString(e.unref(u)("el.pagination.pageClassifier")),3)],10,["disabled"]))}});var se=i._export_sfc(ue,[["__file","jumper.vue"]]);const ce=i.buildProps({total:{type:Number,default:1e3}}),pe=e.defineComponent({name:"ElPaginationTotal"}),de=e.defineComponent({...pe,props:ce,setup(a){const{t:u}=x.useLocale(),r=i.useNamespace("pagination"),{disabled:s}=L();return(l,d)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(r).e("total")),disabled:e.unref(s)},e.toDisplayString(e.unref(u)("el.pagination.total",{total:l.total})),11,["disabled"]))}});var ge=i._export_sfc(de,[["__file","total.vue"]]);const fe=i.buildProps({currentPage:{type:Number,default:1},pageCount:{type:Number,required:!0},pagerCount:{type:Number,default:7},disabled:Boolean}),me=e.defineComponent({name:"ElPaginationPager"}),be=e.defineComponent({...me,props:fe,emits:[$.CHANGE_EVENT],setup(a,{emit:u}){const r=a,s=i.useNamespace("pager"),l=i.useNamespace("icon"),{t:d}=x.useLocale(),f=e.ref(!1),b=e.ref(!1),C=e.ref(!1),c=e.ref(!1),P=e.ref(!1),p=e.ref(!1),q=e.computed(()=>{const o=r.pagerCount,n=(o-1)/2,t=Number(r.currentPage),v=Number(r.pageCount);let m=!1,k=!1;v>o&&(t>o-n&&(m=!0),t<v-n&&(k=!0));const S=[];if(m&&!k){const h=v-(o-2);for(let y=h;y<v;y++)S.push(y)}else if(!m&&k)for(let h=2;h<o;h++)S.push(h);else if(m&&k){const h=Math.floor(o/2)-1;for(let y=t-h;y<=t+h;y++)S.push(y)}else for(let h=2;h<v;h++)S.push(h);return S}),E=e.computed(()=>["more","btn-quickprev",l.b(),s.is("disabled",r.disabled)]),_=e.computed(()=>["more","btn-quicknext",l.b(),s.is("disabled",r.disabled)]),g=e.computed(()=>r.disabled?-1:0);e.watch(()=>[r.pageCount,r.pagerCount,r.currentPage],([o,n,t])=>{const v=(n-1)/2;let m=!1,k=!1;o>n&&(m=t>n-v,k=t<o-v),C.value&&(C.value=m),c.value&&(c.value=k),f.value=m,b.value=k},{immediate:!0});function T(o=!1){r.disabled||(o?C.value=!0:c.value=!0)}function M(o=!1){o?P.value=!0:p.value=!0}function I(o){const n=o.target;if(n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("number")){const t=Number(n.textContent);t!==r.currentPage&&u($.CHANGE_EVENT,t)}else n.tagName.toLowerCase()==="li"&&Array.from(n.classList).includes("more")&&D(o)}function D(o){const n=o.target;if(n.tagName.toLowerCase()==="ul"||r.disabled)return;let t=Number(n.textContent);const v=r.pageCount,m=r.currentPage,k=r.pagerCount-2;n.className.includes("more")&&(n.className.includes("quickprev")?t=m-k:n.className.includes("quicknext")&&(t=m+k)),Number.isNaN(+t)||(t<1&&(t=1),t>v&&(t=v)),t!==m&&u($.CHANGE_EVENT,t)}return(o,n)=>(e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(e.unref(s).b()),onClick:D,onKeyup:e.withKeys(I,["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(g)}," 1 ",10,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0),f.value?(e.openBlock(),e.createElementBlock("li",{key:1,class:e.normalizeClass(e.unref(E)),tabindex:e.unref(g),"aria-label":e.unref(d)("el.pagination.prevPages",{pager:o.pagerCount-2}),onMouseenter:t=>T(!0),onMouseleave:t=>C.value=!1,onFocus:t=>M(!0),onBlur:t=>P.value=!1},[(C.value||P.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(N.d_arrow_left_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.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(q),t=>(e.openBlock(),e.createElementBlock("li",{key:t,class:e.normalizeClass([[e.unref(s).is("active",o.currentPage===t),e.unref(s).is("disabled",o.disabled)],"number"]),"aria-current":o.currentPage===t,"aria-label":e.unref(d)("el.pagination.currentPage",{pager:t}),tabindex:e.unref(g)},e.toDisplayString(t),11,["aria-current","aria-label","tabindex"]))),128)),b.value?(e.openBlock(),e.createElementBlock("li",{key:2,class:e.normalizeClass(e.unref(_)),tabindex:e.unref(g),"aria-label":e.unref(d)("el.pagination.nextPages",{pager:o.pagerCount-2}),onMouseenter:t=>T(),onMouseleave:t=>c.value=!1,onFocus:t=>M(),onBlur:t=>p.value=!1},[(c.value||p.value)&&!o.disabled?(e.openBlock(),e.createBlock(e.unref(N.d_arrow_right_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.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(g)},e.toDisplayString(o.pageCount),11,["aria-current","aria-label","tabindex"])):e.createCommentVNode("v-if",!0)],42,["onKeyup"]))}});var ve=i._export_sfc(be,[["__file","pager.vue"]]);const z=a=>typeof a!="number",Ce=i.buildProps({pageSize:Number,defaultPageSize:Number,total:Number,pageCount:Number,pagerCount:{type:Number,validator:a=>i.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:i.definePropType(Array),default:()=>j.mutable([10,20,30,40,50,100])},popperClass:{type:String,default:""},prevText:{type:String,default:""},prevIcon:{type:B.iconPropType,default:()=>N.arrow_left_default},nextText:{type:String,default:""},nextIcon:{type:B.iconPropType,default:()=>N.arrow_right_default},teleported:{type:Boolean,default:!0},small:Boolean,size:B.useSizeProp,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean,appendSizeTo:String}),Pe={"update:current-page":a=>i.isNumber(a),"update:page-size":a=>i.isNumber(a),"size-change":a=>i.isNumber(a),change:(a,u)=>i.isNumber(a)&&i.isNumber(u),"current-change":a=>i.isNumber(a),"prev-click":a=>i.isNumber(a),"next-click":a=>i.isNumber(a)},F="ElPagination";var ze=e.defineComponent({name:F,props:Ce,emits:Pe,setup(a,{emit:u,slots:r}){const{t:s}=x.useLocale(),l=i.useNamespace("pagination"),d=e.getCurrentInstance().vnode.props||{},f=B.useGlobalSize(),b=e.computed(()=>{var n;return a.small?"small":(n=a.size)!=null?n:f.value});G.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 C="onUpdate:currentPage"in d||"onUpdate:current-page"in d||"onCurrentChange"in d,c="onUpdate:pageSize"in d||"onUpdate:page-size"in d||"onSizeChange"in d,P=e.computed(()=>{if(z(a.total)&&z(a.pageCount)||!z(a.currentPage)&&!C)return!1;if(a.layout.includes("sizes")){if(z(a.pageCount)){if(!z(a.total)&&!z(a.pageSize)&&!c)return!1}else if(!c)return!1}return!0}),p=e.ref(z(a.defaultPageSize)?10:a.defaultPageSize),q=e.ref(z(a.defaultCurrentPage)?1:a.defaultCurrentPage),E=e.computed({get(){return z(a.pageSize)?p.value:a.pageSize},set(n){z(a.pageSize)&&(p.value=n),c&&(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/E.value))):n=a.pageCount,n}),g=e.computed({get(){return z(a.currentPage)?q.value:a.currentPage},set(n){let t=n;n<1?t=1:n>_.value&&(t=_.value),z(a.currentPage)&&(q.value=t),C&&(u("update:current-page",t),u("current-change",t))}});e.watch(_,n=>{g.value>n&&(g.value=n)}),e.watch([g,E],n=>{u($.CHANGE_EVENT,...n)},{flush:"post"});function T(n){g.value=n}function M(n){E.value=n;const t=_.value;g.value>t&&(g.value=t)}function I(){a.disabled||(g.value-=1,u("prev-click",g.value))}function D(){a.disabled||(g.value+=1,u("next-click",g.value))}function o(n,t){n&&(n.props||(n.props={}),n.props.class=[n.props.class,t].join(" "))}return e.provide(U,{pageCount:_,disabled:e.computed(()=>a.disabled),currentPage:g,changeEvent:T,handleSizeChange:M}),()=>{var n,t;if(!P.value)return $.debugWarn(F,s("el.pagination.deprecationWarning")),null;if(!a.layout||a.hideOnSinglePage&&_.value<=1)return null;const v=[],m=[],k=e.h("div",{class:l.e("rightwrapper")},m),S={prev:e.h(X,{disabled:a.disabled,currentPage:g.value,prevText:a.prevText,prevIcon:a.prevIcon,onClick:I}),jumper:e.h(se,{size:b.value}),pager:e.h(ve,{currentPage:g.value,pageCount:_.value,pagerCount:a.pagerCount,onChange:T,disabled:a.disabled}),next:e.h(ae,{disabled:a.disabled,currentPage:g.value,pageCount:_.value,nextText:a.nextText,nextIcon:a.nextIcon,onClick:D}),sizes:e.h(oe,{pageSize:E.value,pageSizes:a.pageSizes,popperClass:a.popperClass,disabled:a.disabled,teleported:a.teleported,size:b.value,appendSizeTo:a.appendSizeTo}),slot:(t=(n=r==null?void 0:r.default)==null?void 0:n.call(r))!=null?t:null,total:e.h(ge,{total:z(a.total)?0:a.total})},h=a.layout.split(",").map(w=>w.trim());let y=!1;return h.forEach(w=>{if(w==="->"){y=!0;return}y?m.push(S[w]):v.push(S[w])}),o(v[0],l.is("first")),o(v[v.length-1],l.is("last")),y&&m.length>0&&(o(m[0],l.is("first")),o(m[m.length-1],l.is("last")),v.push(k)),e.h("div",{class:[l.b(),l.is("background",a.background),l.m(b.value)]},v)}}});const he=i.withInstall(ze);const ke=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 r=u,s=a,l=e.computed({get(){return s.pageData.pageNum},set(b){r("update:pageData",{...s.pageData,pageNum:b})}}),d=e.computed({get(){return s.pageData.pageSize},set(b){r("update:pageData",{...s.pageData,pageSize:b})}}),f=()=>{r("change",s.pageData)};return(b,C)=>{const c=he,P=V.ElConfigProvider;return e.openBlock(),e.createBlock(P,{locale:e.unref(V.zhCn)},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(c,e.mergeProps({class:"st-pagination",currentPage:l.value,"onUpdate:currentPage":C[0]||(C[0]=p=>l.value=p),"page-size":d.value,"onUpdate:pageSize":C[1]||(C[1]=p=>d.value=p),total:a.total,background:a.background,"page-sizes":a.pageSizes,layout:a.layout},b.$attrs,{onSizeChange:f,onCurrentChange:f}),null,16,["currentPage","page-size","total","background","page-sizes","layout"]),[[e.vShow,a.total]])]),_:1},8,["locale"])}}});const ye=O._export_sfc(ke,[["__scopeId","data-v-61b7745b"]]),_e={install(a){a.component("st-pagination",ye)}};module.exports=_e;
|