st-comp 0.0.148 → 0.0.149
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/components.d.ts +3 -0
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +2 -2
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +16 -14
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +576 -632
- package/es/Kline.cjs +1 -0
- package/es/Kline.js +1901 -0
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +675 -1428
- package/es/KlineNew.cjs +1 -3
- package/es/KlineNew.js +314 -2740
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +85 -85
- package/es/Table.cjs +1 -1
- package/es/Table.js +57 -55
- package/es/User.cjs +1 -1
- package/es/User.js +89 -87
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +2393 -1
- package/es/VirtualTable.cjs +5 -5
- package/es/VirtualTable.js +59 -58
- package/es/{_initCloneObject-ec5c9523.js → _initCloneObject-14b53c6f.js} +24 -24
- package/es/_initCloneObject-441db749.cjs +1 -0
- package/es/{base-950bac7e.js → base-437d17f3.js} +65 -65
- package/es/{base-6ccc8fc2.cjs → base-ec05f348.cjs} +1 -1
- package/es/{castArray-c770910d.js → castArray-4251bbe4.js} +1 -1
- package/es/castArray-a45823fe.cjs +1 -0
- package/es/{config-provider-feed0e8a.js → config-provider-55482a43.js} +3 -3
- package/es/{config-provider-c87e277f.cjs → config-provider-7cdfca4d.cjs} +1 -1
- package/es/{debounce-c64fb3b5.js → debounce-ac30be50.js} +20 -20
- package/es/debounce-b2ff12bd.cjs +1 -0
- package/es/{dropdown-c9272ca3.js → dropdown-634b5e27.js} +4 -4
- package/es/{dropdown-6bdb3cf4.cjs → dropdown-d7c59a21.cjs} +1 -1
- package/es/el-button-196807af.cjs +1 -0
- package/es/el-button-e1665717.js +235 -0
- package/es/el-checkbox-group-492b95cc.cjs +1 -0
- package/es/el-checkbox-group-e8fece80.js +67 -0
- package/es/{el-empty-12eece57.cjs → el-empty-19ea04f4.cjs} +1 -1
- package/es/{el-empty-89a523ed.js → el-empty-bacc6613.js} +1 -1
- package/es/{el-form-item-ebbf096d.cjs → el-form-item-5bdffd07.cjs} +2 -2
- package/es/{el-form-item-55d36086.js → el-form-item-af1855f0.js} +81 -81
- package/es/el-input-23e2bac3.cjs +1 -0
- package/es/{el-input-cb528574.js → el-input-4961b99f.js} +80 -80
- package/es/el-input-number-40a81eb5.cjs +1 -0
- package/es/{el-input-number-ce30bfa8.js → el-input-number-610fc8ba.js} +26 -26
- package/es/el-menu-item-78b858f2.cjs +1 -0
- package/es/el-menu-item-7d04c11a.js +771 -0
- package/es/{el-message-d51d032b.js → el-message-c3b3ac96.js} +18 -18
- package/es/{el-message-612c2346.cjs → el-message-d4df8136.cjs} +1 -1
- package/es/el-overlay-12dd9b35.js +519 -0
- package/es/el-overlay-bc0790a2.cjs +1 -0
- package/es/el-popover-0aa071f2.js +138 -0
- package/es/el-popover-8a77e015.cjs +1 -0
- package/es/{el-popper-f4b01f85.js → el-popper-50100766.js} +31 -31
- package/es/el-popper-746070ba.cjs +1 -0
- package/es/{el-scrollbar-e8e93751.js → el-scrollbar-562d0595.js} +19 -19
- package/es/el-scrollbar-d1c3e7f7.cjs +1 -0
- package/es/{el-select-e71af2e6.js → el-select-9381b156.js} +11 -11
- package/es/el-select-b162dffc.cjs +1 -0
- package/es/el-table-column-55bffba5.js +3802 -0
- package/es/el-table-column-6d761fce.cjs +14 -0
- package/es/{el-tag-d65768f4.js → el-tag-985d9aff.js} +72 -72
- package/es/el-tag-c51a6490.cjs +1 -0
- package/es/index-09e01b1d.js +81 -0
- package/es/{index-121e2861.js → index-0cb48e01.js} +3 -3
- package/es/{index-92ba4292.js → index-39ec9741.js} +17 -17
- package/es/{index-18416440.cjs → index-3bf8d597.cjs} +1 -1
- package/es/index-657047bb.js +513 -0
- package/es/{index-0ed86daf.cjs → index-8a0b1c53.cjs} +1 -1
- package/es/{index-674d2fd7.cjs → index-a387515d.cjs} +1 -1
- package/es/{index-709675d5.js → index-a902a0d9.js} +18 -18
- package/es/{index-da646183.cjs → index-deb8de52.cjs} +1 -1
- package/es/index-eea0bcb3.cjs +1 -0
- package/es/index.esm-8d9a2abe.js +2432 -0
- package/es/index.esm-94a95a2a.cjs +3 -0
- package/es/{raf-2d77cbbe.cjs → raf-8fc301fd.cjs} +1 -1
- package/es/{raf-f55e0daa.js → raf-b128c7b7.js} +1 -1
- package/es/{scroll-ca84f80a.js → scroll-387fcfdb.js} +1 -1
- package/es/{scroll-c8ac196e.cjs → scroll-41224831.cjs} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-c1960844.cjs → use-form-common-props-1b84d8f4.cjs} +2 -2
- package/es/{use-form-common-props-4d37077d.js → use-form-common-props-f377e500.js} +64 -63
- package/es/vnode-7dfd4ed5.js +14 -0
- package/es/vnode-7fbc61e1.cjs +1 -0
- package/es/{zh-cn-414d7f0c.cjs → zh-cn-ab9a583d.cjs} +1 -1
- package/es/{zh-cn-23c8e0d1.js → zh-cn-eb9c2820.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +206 -206
- package/lib/{index-ffeb163e.js → index-d2de454d.js} +33249 -31372
- package/lib/{python-0ec8f68c.js → python-22975586.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/Kline/components/Contextmenu/index.vue +110 -0
- package/packages/Kline/components/Tips/index.vue +40 -0
- package/packages/Kline/componentsNew/KlineSlide/index.vue +155 -0
- package/packages/Kline/componentsNew/KlineSub/index.vue +297 -0
- package/packages/Kline/componentsNew/KlineTips/index.vue +66 -0
- package/packages/Kline/componentsNew/KlineUtils/index.vue +84 -0
- package/packages/Kline/componentsNew/Tips/index.vue +33 -0
- package/packages/Kline/formatKlineData.ts +109 -0
- package/packages/Kline/images/buy.svg +1 -0
- package/packages/Kline/images/pen.png +0 -0
- package/packages/Kline/images/sell.svg +1 -0
- package/packages/Kline/images/t.svg +1 -0
- package/packages/Kline/index.ts +16 -0
- package/packages/Kline/index.vue +891 -0
- package/packages/Kline/option.ts +539 -0
- package/packages/Kline/type.d.ts +219 -0
- package/packages/Kline/utils.ts +682 -0
- package/packages/index.ts +2 -0
- package/src/pages/Kline/index.vue +12 -0
- package/src/router/routes.ts +5 -0
- package/es/_initCloneObject-476b02ce.cjs +0 -1
- package/es/castArray-374558a5.cjs +0 -1
- package/es/debounce-a6b4f91b.cjs +0 -1
- package/es/el-button-b8f71c7d.cjs +0 -1
- package/es/el-button-d7b6eebd.js +0 -745
- package/es/el-input-2c7e70a3.cjs +0 -1
- package/es/el-input-number-8e168e83.cjs +0 -1
- package/es/el-overlay-07414277.js +0 -526
- package/es/el-overlay-fb255b83.cjs +0 -1
- package/es/el-popper-8360bd91.cjs +0 -1
- package/es/el-scrollbar-271142ad.cjs +0 -1
- package/es/el-select-2e71d4af.cjs +0 -1
- package/es/el-table-column-9fe79f05.cjs +0 -14
- package/es/el-table-column-dc562f14.js +0 -3933
- package/es/el-tag-930e7b32.cjs +0 -1
- package/es/index-aece600c.js +0 -81
package/es/KlineBasic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const w=require("./base-6ccc8fc2.cjs"),be=require("./el-overlay-fb255b83.cjs");require("./el-input-2c7e70a3.cjs");const Ee=require("./el-input-number-8e168e83.cjs"),xe=require("./el-button-b8f71c7d.cjs"),Ye=require("./el-empty-12eece57.cjs");require("./el-tooltip-0ea8fbf8.cjs");const Me=require("./el-popper-8360bd91.cjs"),e=require("vue"),Ce=require("echarts"),ne=require("./index-a96158ae.cjs"),ce=require("./el-message-612c2346.cjs"),ie=require("./_plugin-vue_export-helper-f246444f.cjs"),Ne=require("./el-tag-930e7b32.cjs"),ye=require("./el-select-2e71d4af.cjs"),Ie=require("./el-scrollbar-271142ad.cjs"),re=require("./use-form-common-props-c1960844.cjs"),Z=require("./index-18416440.cjs"),Oe=require("./typescript-b63f8e83.cjs");require("./scroll-c8ac196e.cjs");require("./index-0ed86daf.cjs");require("./index-da646183.cjs");require("./config-provider-c87e277f.cjs");require("./index-674d2fd7.cjs");require("./castArray-374558a5.cjs");require("./debounce-a6b4f91b.cjs");function Be(t){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const h=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(d,i,h.get?h:{enumerable:!0,get:()=>t[i]})}}return d.default=t,Object.freeze(d)}const ve=Be(Ce);var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Le(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _e={exports:{}};(function(t,d){(function(i,h){t.exports=h()})(Ve,function(){var i=1e3,h=6e4,o=36e5,l="millisecond",M="second",$="minute",f="hour",b="day",k="week",p="month",g="quarter",T="year",D="date",R="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,B={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var r=["th","st","nd","rd"],a=x%100;return"["+x+(r[(a-20)%10]||r[a]||r[0])+"]"}},U=function(x,r,a){var u=String(x);return!u||u.length>=r?x:""+Array(r+1-u.length).join(a)+x},E={s:U,z:function(x){var r=-x.utcOffset(),a=Math.abs(r),u=Math.floor(a/60),c=a%60;return(r<=0?"+":"-")+U(u,2,"0")+":"+U(c,2,"0")},m:function x(r,a){if(r.date()<a.date())return-x(a,r);var u=12*(a.year()-r.year())+(a.month()-r.month()),c=r.clone().add(u,p),m=a-c<0,n=r.clone().add(u+(m?-1:1),p);return+(-(u+(a-c)/(m?c-n:n-c))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:p,y:T,w:k,d:b,D,h:f,m:$,s:M,ms:l,Q:g}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},H="en",V={};V[H]=B;var K="$isDayjsObject",j=function(x){return x instanceof G||!(!x||!x[K])},X=function x(r,a,u){var c;if(!r)return H;if(typeof r=="string"){var m=r.toLowerCase();V[m]&&(c=m),a&&(V[m]=a,c=m);var n=r.split("-");if(!c&&n.length>1)return x(n[0])}else{var s=r.name;V[s]=r,c=s}return!u&&c&&(H=c),c||!u&&H},P=function(x,r){if(j(x))return x.clone();var a=typeof r=="object"?r:{};return a.date=x,a.args=arguments,new G(a)},Y=E;Y.l=X,Y.i=j,Y.w=function(x,r){return P(x,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var G=function(){function x(a){this.$L=X(a.locale,null,!0),this.parse(a),this.$x=this.$x||a.x||{},this[K]=!0}var r=x.prototype;return r.parse=function(a){this.$d=function(u){var c=u.date,m=u.utc;if(c===null)return new Date(NaN);if(Y.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var n=c.match(I);if(n){var s=n[2]-1||0,v=(n[7]||"0").substring(0,3);return m?new Date(Date.UTC(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,v)):new Date(n[1],s,n[3]||1,n[4]||0,n[5]||0,n[6]||0,v)}}return new Date(c)}(a),this.init()},r.init=function(){var a=this.$d;this.$y=a.getFullYear(),this.$M=a.getMonth(),this.$D=a.getDate(),this.$W=a.getDay(),this.$H=a.getHours(),this.$m=a.getMinutes(),this.$s=a.getSeconds(),this.$ms=a.getMilliseconds()},r.$utils=function(){return Y},r.isValid=function(){return this.$d.toString()!==R},r.isSame=function(a,u){var c=P(a);return this.startOf(u)<=c&&c<=this.endOf(u)},r.isAfter=function(a,u){return P(a)<this.startOf(u)},r.isBefore=function(a,u){return this.endOf(u)<P(a)},r.$g=function(a,u,c){return Y.u(a)?this[u]:this.set(c,a)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(a,u){var c=this,m=!!Y.u(u)||u,n=Y.p(a),s=function(O,A){var J=Y.w(c.$u?Date.UTC(c.$y,A,O):new Date(c.$y,A,O),c);return m?J:J.endOf(b)},v=function(O,A){return Y.w(c.toDate()[O].apply(c.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(A)),c)},y=this.$W,S=this.$M,_=this.$D,C="set"+(this.$u?"UTC":"");switch(n){case T:return m?s(1,0):s(31,11);case p:return m?s(1,S):s(0,S+1);case k:var F=this.$locale().weekStart||0,q=(y<F?y+7:y)-F;return s(m?_-q:_+(6-q),S);case b:case D:return v(C+"Hours",0);case f:return v(C+"Minutes",1);case $:return v(C+"Seconds",2);case M:return v(C+"Milliseconds",3);default:return this.clone()}},r.endOf=function(a){return this.startOf(a,!1)},r.$set=function(a,u){var c,m=Y.p(a),n="set"+(this.$u?"UTC":""),s=(c={},c[b]=n+"Date",c[D]=n+"Date",c[p]=n+"Month",c[T]=n+"FullYear",c[f]=n+"Hours",c[$]=n+"Minutes",c[M]=n+"Seconds",c[l]=n+"Milliseconds",c)[m],v=m===b?this.$D+(u-this.$W):u;if(m===p||m===T){var y=this.clone().set(D,1);y.$d[s](v),y.init(),this.$d=y.set(D,Math.min(this.$D,y.daysInMonth())).$d}else s&&this.$d[s](v);return this.init(),this},r.set=function(a,u){return this.clone().$set(a,u)},r.get=function(a){return this[Y.p(a)]()},r.add=function(a,u){var c,m=this;a=Number(a);var n=Y.p(u),s=function(S){var _=P(m);return Y.w(_.date(_.date()+Math.round(S*a)),m)};if(n===p)return this.set(p,this.$M+a);if(n===T)return this.set(T,this.$y+a);if(n===b)return s(1);if(n===k)return s(7);var v=(c={},c[$]=h,c[f]=o,c[M]=i,c)[n]||1,y=this.$d.getTime()+a*v;return Y.w(y,this)},r.subtract=function(a,u){return this.add(-1*a,u)},r.format=function(a){var u=this,c=this.$locale();if(!this.isValid())return c.invalidDate||R;var m=a||"YYYY-MM-DDTHH:mm:ssZ",n=Y.z(this),s=this.$H,v=this.$m,y=this.$M,S=c.weekdays,_=c.months,C=c.meridiem,F=function(A,J,Q,W){return A&&(A[J]||A(u,m))||Q[J].slice(0,W)},q=function(A){return Y.s(s%12||12,A,"0")},O=C||function(A,J,Q){var W=A<12?"AM":"PM";return Q?W.toLowerCase():W};return m.replace(z,function(A,J){return J||function(Q){switch(Q){case"YY":return String(u.$y).slice(-2);case"YYYY":return Y.s(u.$y,4,"0");case"M":return y+1;case"MM":return Y.s(y+1,2,"0");case"MMM":return F(c.monthsShort,y,_,3);case"MMMM":return F(_,y);case"D":return u.$D;case"DD":return Y.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return F(c.weekdaysMin,u.$W,S,2);case"ddd":return F(c.weekdaysShort,u.$W,S,3);case"dddd":return S[u.$W];case"H":return String(s);case"HH":return Y.s(s,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return O(s,v,!0);case"A":return O(s,v,!1);case"m":return String(v);case"mm":return Y.s(v,2,"0");case"s":return String(u.$s);case"ss":return Y.s(u.$s,2,"0");case"SSS":return Y.s(u.$ms,3,"0");case"Z":return n}return null}(A)||n.replace(":","")})},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(a,u,c){var m,n=this,s=Y.p(u),v=P(a),y=(v.utcOffset()-this.utcOffset())*h,S=this-v,_=function(){return Y.m(n,v)};switch(s){case T:m=_()/12;break;case p:m=_();break;case g:m=_()/3;break;case k:m=(S-y)/6048e5;break;case b:m=(S-y)/864e5;break;case f:m=S/o;break;case $:m=S/h;break;case M:m=S/i;break;default:m=S}return c?m:Y.a(m)},r.daysInMonth=function(){return this.endOf(p).$D},r.$locale=function(){return V[this.$L]},r.locale=function(a,u){if(!a)return this.$L;var c=this.clone(),m=X(a,u,!0);return m&&(c.$L=m),c},r.clone=function(){return Y.w(this.$d,this)},r.toDate=function(){return new Date(this.valueOf())},r.toJSON=function(){return this.isValid()?this.toISOString():null},r.toISOString=function(){return this.$d.toISOString()},r.toString=function(){return this.$d.toUTCString()},x}(),ae=G.prototype;return P.prototype=ae,[["$ms",l],["$s",M],["$m",$],["$H",f],["$W",b],["$M",p],["$y",T],["$D",D]].forEach(function(x){ae[x[1]]=function(r){return this.$g(r,x[0],x[1])}}),P.extend=function(x,r){return x.$i||(x(r,G,P),x.$i=!0),P},P.locale=X,P.isDayjs=j,P.unix=function(x){return P(1e3*x)},P.en=V[H],P.Ls=V,P.p={},P})})(_e);var Pe=_e.exports;const N=Le(Pe),Fe=e.defineComponent({name:"ElCollapseTransition"}),Ae=e.defineComponent({...Fe,setup(t){const d=w.useNamespace("collapse-transition"),i=o=>{o.style.maxHeight="",o.style.overflow=o.dataset.oldOverflow,o.style.paddingTop=o.dataset.oldPaddingTop,o.style.paddingBottom=o.dataset.oldPaddingBottom},h={beforeEnter(o){o.dataset||(o.dataset={}),o.dataset.oldPaddingTop=o.style.paddingTop,o.dataset.oldPaddingBottom=o.style.paddingBottom,o.style.height&&(o.dataset.elExistsHeight=o.style.height),o.style.maxHeight=0,o.style.paddingTop=0,o.style.paddingBottom=0},enter(o){requestAnimationFrame(()=>{o.dataset.oldOverflow=o.style.overflow,o.dataset.elExistsHeight?o.style.maxHeight=o.dataset.elExistsHeight:o.scrollHeight!==0?o.style.maxHeight=`${o.scrollHeight}px`:o.style.maxHeight=0,o.style.paddingTop=o.dataset.oldPaddingTop,o.style.paddingBottom=o.dataset.oldPaddingBottom,o.style.overflow="hidden"})},afterEnter(o){o.style.maxHeight="",o.style.overflow=o.dataset.oldOverflow},enterCancelled(o){i(o)},beforeLeave(o){o.dataset||(o.dataset={}),o.dataset.oldPaddingTop=o.style.paddingTop,o.dataset.oldPaddingBottom=o.style.paddingBottom,o.dataset.oldOverflow=o.style.overflow,o.style.maxHeight=`${o.scrollHeight}px`,o.style.overflow="hidden"},leave(o){o.scrollHeight!==0&&(o.style.maxHeight=0,o.style.paddingTop=0,o.style.paddingBottom=0)},afterLeave(o){i(o)},leaveCancelled(o){i(o)}};return(o,l)=>(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({name:e.unref(d).b()},e.toHandlers(h)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["name"]))}});var Re=w._export_sfc(Ae,[["__file","collapse-transition.vue"]]);const qe=w.withInstall(Re);let We=class{constructor(d,i){this.parent=d,this.domNode=i,this.subIndex=0,this.subIndex=0,this.init()}init(){this.subMenuItems=this.domNode.querySelectorAll("li"),this.addListeners()}gotoSubIndex(d){d===this.subMenuItems.length?d=0:d<0&&(d=this.subMenuItems.length-1),this.subMenuItems[d].focus(),this.subIndex=d}addListeners(){const d=this.parent.domNode;Array.prototype.forEach.call(this.subMenuItems,i=>{i.addEventListener("keydown",h=>{let o=!1;switch(h.code){case Z.EVENT_CODE.down:{this.gotoSubIndex(this.subIndex+1),o=!0;break}case Z.EVENT_CODE.up:{this.gotoSubIndex(this.subIndex-1),o=!0;break}case Z.EVENT_CODE.tab:{Z.triggerEvent(d,"mouseleave");break}case Z.EVENT_CODE.enter:case Z.EVENT_CODE.numpadEnter:case Z.EVENT_CODE.space:{o=!0,h.currentTarget.click();break}}return o&&(h.preventDefault(),h.stopPropagation()),!1})})}},ze=class{constructor(d,i){this.domNode=d,this.submenu=null,this.submenu=null,this.init(i)}init(d){this.domNode.setAttribute("tabindex","0");const i=this.domNode.querySelector(`.${d}-menu`);i&&(this.submenu=new We(this,i)),this.addListeners()}addListeners(){this.domNode.addEventListener("keydown",d=>{let i=!1;switch(d.code){case Z.EVENT_CODE.down:{Z.triggerEvent(d.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(0),i=!0;break}case Z.EVENT_CODE.up:{Z.triggerEvent(d.currentTarget,"mouseenter"),this.submenu&&this.submenu.gotoSubIndex(this.submenu.subMenuItems.length-1),i=!0;break}case Z.EVENT_CODE.tab:{Z.triggerEvent(d.currentTarget,"mouseleave");break}case Z.EVENT_CODE.enter:case Z.EVENT_CODE.numpadEnter:case Z.EVENT_CODE.space:{i=!0,d.currentTarget.click();break}}i&&d.preventDefault()})}},He=class{constructor(d,i){this.domNode=d,this.init(i)}init(d){const i=this.domNode.childNodes;Array.from(i).forEach(h=>{h.nodeType===1&&new ze(h,d)})}};const je=e.defineComponent({name:"ElMenuCollapseTransition",setup(){const t=w.useNamespace("menu");return{listeners:{onBeforeEnter:i=>i.style.opacity="0.2",onEnter(i,h){w.addClass(i,`${t.namespace.value}-opacity-transition`),i.style.opacity="1",h()},onAfterEnter(i){w.removeClass(i,`${t.namespace.value}-opacity-transition`),i.style.opacity=""},onBeforeLeave(i){i.dataset||(i.dataset={}),w.hasClass(i,t.m("collapse"))?(w.removeClass(i,t.m("collapse")),i.dataset.oldOverflow=i.style.overflow,i.dataset.scrollWidth=i.clientWidth.toString(),w.addClass(i,t.m("collapse"))):(w.addClass(i,t.m("collapse")),i.dataset.oldOverflow=i.style.overflow,i.dataset.scrollWidth=i.clientWidth.toString(),w.removeClass(i,t.m("collapse"))),i.style.width=`${i.scrollWidth}px`,i.style.overflow="hidden"},onLeave(i){w.addClass(i,"horizontal-collapse-transition"),i.style.width=`${i.dataset.scrollWidth}px`}}}}});function Ue(t,d,i,h,o,l){return e.openBlock(),e.createBlock(e.Transition,e.mergeProps({mode:"out-in"},t.listeners),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16)}var Ze=w._export_sfc(je,[["render",Ue],["__file","menu-collapse-transition.vue"]]);function we(t,d){const i=e.computed(()=>{let o=t.parent;const l=[d.value];for(;o.type.name!=="ElMenu";)o.props.index&&l.unshift(o.props.index),o=o.parent;return l});return{parentMenu:e.computed(()=>{let o=t.parent;for(;o&&!["ElMenu","ElSubMenu"].includes(o.type.name);)o=o.parent;return o}),indexPath:i}}function Ke(t){return e.computed(()=>{const i=t.backgroundColor;return i?new xe.TinyColor(i).shade(20).toString():""})}const ke=(t,d)=>{const i=w.useNamespace("menu");return e.computed(()=>i.cssVarBlock({"text-color":t.textColor||"","hover-text-color":t.textColor||"","bg-color":t.backgroundColor||"","hover-bg-color":Ke(t).value||"","active-color":t.activeTextColor||"",level:`${d}`}))},Xe=w.buildProps({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:re.iconPropType},expandOpenIcon:{type:re.iconPropType},collapseCloseIcon:{type:re.iconPropType},collapseOpenIcon:{type:re.iconPropType}}),fe="ElSubMenu";var ge=e.defineComponent({name:fe,props:Xe,setup(t,{slots:d,expose:i}){const h=e.getCurrentInstance(),{indexPath:o,parentMenu:l}=we(h,e.computed(()=>t.index)),M=w.useNamespace("menu"),$=w.useNamespace("sub-menu"),f=e.inject("rootMenu");f||w.throwError(fe,"can not inject root menu");const b=e.inject(`subMenu:${l.value.uid}`);b||w.throwError(fe,"can not inject sub menu");const k=e.ref({}),p=e.ref({});let g;const T=e.ref(!1),D=e.ref(),R=e.ref(null),I=e.computed(()=>j.value==="horizontal"&&B.value?"bottom-start":"right-start"),z=e.computed(()=>j.value==="horizontal"&&B.value||j.value==="vertical"&&!f.props.collapse?t.expandCloseIcon&&t.expandOpenIcon?V.value?t.expandOpenIcon:t.expandCloseIcon:re.arrow_down_default:t.collapseCloseIcon&&t.collapseOpenIcon?V.value?t.collapseOpenIcon:t.collapseCloseIcon:re.arrow_right_default),B=e.computed(()=>b.level===0),U=e.computed(()=>{const n=t.teleported;return n===void 0?B.value:n}),E=e.computed(()=>f.props.collapse?`${M.namespace.value}-zoom-in-left`:`${M.namespace.value}-zoom-in-top`),H=e.computed(()=>j.value==="horizontal"&&B.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),V=e.computed(()=>f.openedMenus.includes(t.index)),K=e.computed(()=>{let n=!1;return Object.values(k.value).forEach(s=>{s.active&&(n=!0)}),Object.values(p.value).forEach(s=>{s.active&&(n=!0)}),n}),j=e.computed(()=>f.props.mode),X=e.reactive({index:t.index,indexPath:o,active:K}),P=ke(f.props,b.level+1),Y=e.computed(()=>{var n;return(n=t.popperOffset)!=null?n:f.props.popperOffset}),G=e.computed(()=>{var n;return(n=t.popperClass)!=null?n:f.props.popperClass}),ae=e.computed(()=>{var n;return(n=t.showTimeout)!=null?n:f.props.showTimeout}),x=e.computed(()=>{var n;return(n=t.hideTimeout)!=null?n:f.props.hideTimeout}),r=()=>{var n,s,v;return(v=(s=(n=R.value)==null?void 0:n.popperRef)==null?void 0:s.popperInstanceRef)==null?void 0:v.destroy()},a=n=>{n||r()},u=()=>{f.props.menuTrigger==="hover"&&f.props.mode==="horizontal"||f.props.collapse&&f.props.mode==="vertical"||t.disabled||f.handleSubMenuClick({index:t.index,indexPath:o.value,active:K.value})},c=(n,s=ae.value)=>{var v;if(n.type!=="focus"){if(f.props.menuTrigger==="click"&&f.props.mode==="horizontal"||!f.props.collapse&&f.props.mode==="vertical"||t.disabled){b.mouseInChild.value=!0;return}b.mouseInChild.value=!0,g==null||g(),{stop:g}=w.useTimeoutFn(()=>{f.openMenu(t.index,o.value)},s),U.value&&((v=l.value.vnode.el)==null||v.dispatchEvent(new MouseEvent("mouseenter")))}},m=(n=!1)=>{var s;if(f.props.menuTrigger==="click"&&f.props.mode==="horizontal"||!f.props.collapse&&f.props.mode==="vertical"){b.mouseInChild.value=!1;return}g==null||g(),b.mouseInChild.value=!1,{stop:g}=w.useTimeoutFn(()=>!T.value&&f.closeMenu(t.index,o.value),x.value),U.value&&n&&((s=b.handleMouseleave)==null||s.call(b,!0))};e.watch(()=>f.props.collapse,n=>a(!!n));{const n=v=>{p.value[v.index]=v},s=v=>{delete p.value[v.index]};e.provide(`subMenu:${h.uid}`,{addSubMenu:n,removeSubMenu:s,handleMouseleave:m,mouseInChild:T,level:b.level+1})}return i({opened:V}),e.onMounted(()=>{f.addSubMenu(X),b.addSubMenu(X)}),e.onBeforeUnmount(()=>{b.removeSubMenu(X),f.removeSubMenu(X)}),()=>{var n;const s=[(n=d.title)==null?void 0:n.call(d),e.h(re.ElIcon,{class:$.e("icon-arrow"),style:{transform:V.value?t.expandCloseIcon&&t.expandOpenIcon||t.collapseCloseIcon&&t.collapseOpenIcon&&f.props.collapse?"none":"rotateZ(180deg)":"none"}},{default:()=>w.isString$1(z.value)?e.h(h.appContext.components[z.value]):e.h(z.value)})],v=f.isMenuPopup?e.h(Me.ElTooltip,{ref:R,visible:V.value,effect:"light",pure:!0,offset:Y.value,showArrow:!1,persistent:!0,popperClass:G.value,placement:I.value,teleported:U.value,fallbackPlacements:H.value,transition:E.value,gpuAcceleration:!1},{content:()=>{var y;return e.h("div",{class:[M.m(j.value),M.m("popup-container"),G.value],onMouseenter:S=>c(S,100),onMouseleave:()=>m(!0),onFocus:S=>c(S,100)},[e.h("ul",{class:[M.b(),M.m("popup"),M.m(`popup-${I.value}`)],style:P.value},[(y=d.default)==null?void 0:y.call(d)])])},default:()=>e.h("div",{class:$.e("title"),onClick:u},s)}):e.h(e.Fragment,{},[e.h("div",{class:$.e("title"),ref:D,onClick:u},s),e.h(qe,{},{default:()=>{var y;return e.withDirectives(e.h("ul",{role:"menu",class:[M.b(),M.m("inline")],style:P.value},[(y=d.default)==null?void 0:y.call(d)]),[[e.vShow,V.value]])}})]);return e.h("li",{class:[$.b(),$.is("active",K.value),$.is("opened",V.value),$.is("disabled",t.disabled)],role:"menuitem",ariaHaspopup:!0,ariaExpanded:V.value,onMouseenter:c,onMouseleave:()=>m(),onFocus:c},[v])}}});const Ge=w.buildProps({mode:{type:String,values:["horizontal","vertical"],default:"vertical"},defaultActive:{type:String,default:""},defaultOpeneds:{type:w.definePropType(Array),default:()=>Oe.mutable([])},uniqueOpened:Boolean,router:Boolean,menuTrigger:{type:String,values:["hover","click"],default:"hover"},collapse:Boolean,backgroundColor:String,textColor:String,activeTextColor:String,closeOnClickOutside:Boolean,collapseTransition:{type:Boolean,default:!0},ellipsis:{type:Boolean,default:!0},popperOffset:{type:Number,default:6},ellipsisIcon:{type:re.iconPropType,default:()=>re.more_default},popperEffect:{type:w.definePropType(String),default:"dark"},popperClass:String,showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300}}),pe=t=>w.isArray$1(t)&&t.every(d=>w.isString$1(d)),Je={close:(t,d)=>w.isString$1(t)&&pe(d),open:(t,d)=>w.isString$1(t)&&pe(d),select:(t,d,i,h)=>w.isString$1(t)&&pe(d)&&w.isObject$1(i)&&(h===void 0||h instanceof Promise)};var Qe=e.defineComponent({name:"ElMenu",props:Ge,emits:Je,setup(t,{emit:d,slots:i,expose:h}){const o=e.getCurrentInstance(),l=o.appContext.config.globalProperties.$router,M=e.ref(),$=w.useNamespace("menu"),f=w.useNamespace("sub-menu"),b=e.ref(-1),k=e.ref(t.defaultOpeneds&&!t.collapse?t.defaultOpeneds.slice(0):[]),p=e.ref(t.defaultActive),g=e.ref({}),T=e.ref({}),D=e.computed(()=>t.mode==="horizontal"||t.mode==="vertical"&&t.collapse),R=()=>{const r=p.value&&g.value[p.value];if(!r||t.mode==="horizontal"||t.collapse)return;r.indexPath.forEach(u=>{const c=T.value[u];c&&I(u,c.indexPath)})},I=(r,a)=>{k.value.includes(r)||(t.uniqueOpened&&(k.value=k.value.filter(u=>a.includes(u))),k.value.push(r),d("open",r,a))},z=r=>{const a=k.value.indexOf(r);a!==-1&&k.value.splice(a,1)},B=(r,a)=>{z(r),d("close",r,a)},U=({index:r,indexPath:a})=>{k.value.includes(r)?B(r,a):I(r,a)},E=r=>{(t.mode==="horizontal"||t.collapse)&&(k.value=[]);const{index:a,indexPath:u}=r;if(!(w.isNil(a)||w.isNil(u)))if(t.router&&l){const c=r.route||a,m=l.push(c).then(n=>(n||(p.value=a),n));d("select",a,u,{index:a,indexPath:u,route:c},m)}else p.value=a,d("select",a,u,{index:a,indexPath:u})},H=r=>{const a=g.value,u=a[r]||p.value&&a[p.value]||a[t.defaultActive];u?p.value=u.index:p.value=r},V=r=>{const a=getComputedStyle(r),u=Number.parseInt(a.marginLeft,10),c=Number.parseInt(a.marginRight,10);return r.offsetWidth+u+c||0},K=()=>{var r,a;if(!M.value)return-1;const u=Array.from((a=(r=M.value)==null?void 0:r.childNodes)!=null?a:[]).filter(_=>_.nodeName!=="#text"||_.nodeValue),c=64,m=getComputedStyle(M.value),n=Number.parseInt(m.paddingLeft,10),s=Number.parseInt(m.paddingRight,10),v=M.value.clientWidth-n-s;let y=0,S=0;return u.forEach((_,C)=>{_.nodeName!=="#comment"&&(y+=V(_),y<=v-c&&(S=C+1))}),S===u.length?-1:S},j=r=>T.value[r].indexPath,X=(r,a=33.34)=>{let u;return()=>{u&&clearTimeout(u),u=setTimeout(()=>{r()},a)}};let P=!0;const Y=()=>{if(b.value===K())return;const r=()=>{b.value=-1,e.nextTick(()=>{b.value=K()})};P?r():X(r)(),P=!1};e.watch(()=>t.defaultActive,r=>{g.value[r]||(p.value=""),H(r)}),e.watch(()=>t.collapse,r=>{r&&(k.value=[])}),e.watch(g.value,R);let G;e.watchEffect(()=>{t.mode==="horizontal"&&t.ellipsis?G=Ie.useResizeObserver(M,Y).stop:G==null||G()});const ae=e.ref(!1);{const r=m=>{T.value[m.index]=m},a=m=>{delete T.value[m.index]},u=m=>{g.value[m.index]=m},c=m=>{delete g.value[m.index]};e.provide("rootMenu",e.reactive({props:t,openedMenus:k,items:g,subMenus:T,activeIndex:p,isMenuPopup:D,addMenuItem:u,removeMenuItem:c,addSubMenu:r,removeSubMenu:a,openMenu:I,closeMenu:B,handleMenuItemClick:E,handleSubMenuClick:U})),e.provide(`subMenu:${o.uid}`,{addSubMenu:r,removeSubMenu:a,mouseInChild:ae,level:0})}e.onMounted(()=>{t.mode==="horizontal"&&new He(o.vnode.el,$.namespace.value)}),h({open:a=>{const{indexPath:u}=T.value[a];u.forEach(c=>I(c,u))},close:z,handleResize:Y});const x=ke(t,0);return()=>{var r,a;let u=(a=(r=i.default)==null?void 0:r.call(i))!=null?a:[];const c=[];if(t.mode==="horizontal"&&M.value){const s=be.flattedChildren(u),v=b.value===-1?s:s.slice(0,b.value),y=b.value===-1?[]:s.slice(b.value);y!=null&&y.length&&t.ellipsis&&(u=v,c.push(e.h(ge,{index:"sub-menu-more",class:f.e("hide-arrow"),popperOffset:t.popperOffset},{title:()=>e.h(re.ElIcon,{class:f.e("icon-more")},{default:()=>e.h(t.ellipsisIcon)}),default:()=>y})))}const m=t.closeOnClickOutside?[[Ne.ClickOutside,()=>{k.value.length&&(ae.value||(k.value.forEach(s=>d("close",s,j(s))),k.value=[]))}]]:[],n=e.withDirectives(e.h("ul",{key:String(t.collapse),role:"menubar",ref:M,style:x.value,class:{[$.b()]:!0,[$.m(t.mode)]:!0,[$.m("collapse")]:t.collapse}},[...u,...c]),m);return t.collapseTransition&&t.mode==="vertical"?e.h(Ze,()=>n):n}}});const et=w.buildProps({index:{type:w.definePropType([String,null]),default:null},route:{type:w.definePropType([String,Object])},disabled:Boolean}),tt={click:t=>w.isString$1(t.index)&&w.isArray$1(t.indexPath)},me="ElMenuItem",nt=e.defineComponent({name:me,components:{ElTooltip:Me.ElTooltip},props:et,emits:tt,setup(t,{emit:d}){const i=e.getCurrentInstance(),h=e.inject("rootMenu"),o=w.useNamespace("menu"),l=w.useNamespace("menu-item");h||w.throwError(me,"can not inject root menu");const{parentMenu:M,indexPath:$}=we(i,e.toRef(t,"index")),f=e.inject(`subMenu:${M.value.uid}`);f||w.throwError(me,"can not inject sub menu");const b=e.computed(()=>t.index===h.activeIndex),k=e.reactive({index:t.index,indexPath:$,active:b}),p=()=>{t.disabled||(h.handleMenuItemClick({index:t.index,indexPath:$.value,route:t.route}),d("click",k))};return e.onMounted(()=>{f.addSubMenu(k),h.addMenuItem(k)}),e.onBeforeUnmount(()=>{f.removeSubMenu(k),h.removeMenuItem(k)}),{parentMenu:M,rootMenu:h,active:b,nsMenu:o,nsMenuItem:l,handleClick:p}}});function ot(t,d,i,h,o,l){const M=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([t.nsMenuItem.b(),t.nsMenuItem.is("active",t.active),t.nsMenuItem.is("disabled",t.disabled)]),role:"menuitem",tabindex:"-1",onClick:t.handleClick},[t.parentMenu.type.name==="ElMenu"&&t.rootMenu.props.collapse&&t.$slots.title?(e.openBlock(),e.createBlock(M,{key:0,effect:t.rootMenu.props.popperEffect,placement:"right","fallback-placements":["left"],persistent:""},{content:e.withCtx(()=>[e.renderSlot(t.$slots,"title")]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(t.nsMenu.be("tooltip","trigger"))},[e.renderSlot(t.$slots,"default")],2)]),_:3},8,["effect"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"title")],64))],10,["onClick"])}var Se=w._export_sfc(nt,[["render",ot],["__file","menu-item.vue"]]);const at={title:String},rt="ElMenuItemGroup",st=e.defineComponent({name:rt,props:at,setup(){return{ns:w.useNamespace("menu-item-group")}}});function lt(t,d,i,h,o,l){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(t.ns.b())},[e.createElementVNode("div",{class:e.normalizeClass(t.ns.e("title"))},[t.$slots.title?e.renderSlot(t.$slots,"title",{key:1}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.title),1)],64))],2),e.createElementVNode("ul",null,[e.renderSlot(t.$slots,"default")])],2)}var $e=w._export_sfc(st,[["render",lt],["__file","menu-item-group.vue"]]);const it=w.withInstall(Qe,{MenuItem:Se,MenuItemGroup:$e,SubMenu:ge}),ut=w.withNoopInstall(Se);w.withNoopInstall($e);w.withNoopInstall(ge);let se=null;const ct=t=>{const d=ne.y(t,{handleReq:i=>{ne.v()&&(i.headers.token=ne.U())},handleRes:i=>{const{data:h}=i;if(h.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:ne.K(),!0}});d.get,se=d.post},dt=t=>se("/middleLayer/kline/getKlineBasic",{...t,userId:ne.V("id")}),ft=t=>se("/middleLayer/kline/getKline",t),pt=async t=>se("/alarm/deliversign/addAlarmPrice",{...t,userId:ne.V("id")}),mt=async t=>se("/alarm/deliversign/findAlarmPriceByUserId",{...t,userId:ne.V("id")}),Te=async t=>se("/alarm/deliversign/updateAlarmPrice",{...t,userId:ne.V("id")}),vt=async t=>se("/alarm/deliversign/deleteAlarmPrice",{...t,userId:ne.V("id")}),{round:le}=ne.x,ht=(t,d,i,h,o)=>{const{data:l,time:M}=t,{gridTop:$,gridRight:f,gridLeft:b,maxShowCounts:k,showSubChart:p}=d;return{animation:!1,grid:{top:`${$}px`,right:`${f}px`,bottom:p?"6px":"24px",left:`${b}px`},dataZoom:[{type:"inside",startValue:i,endValue:h,maxValueSpan:k}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:g=>{const{axisDimension:T,value:D}=g;return T==="x"?p?"":["6","7","8"].includes(o)?N(D).format("YYYY-MM-DD"):D:String(le(D))}}},formatter:()=>""},xAxis:{show:!p,type:"category",data:M,splitLine:{show:!1},axisLabel:{formatter:g=>["6","7","8"].includes(o)?N(g).format("YYYY-MM-DD"):g}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:g=>le(g.min),max:g=>le(g.max)},series:[{type:"candlestick",data:l,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...t.mainIndicator.map(g=>({name:g.key,type:"line",silent:!0,symbol:"none",data:g.data,lineStyle:{width:g.width||1},itemStyle:{color:g.color}}))],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:2},brushStyle:{color:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.4)"}}}},gt=(t,d,i,h,o)=>{const{variety:l,featureId:M,featureType:$}=i,{gridTop:f,gridLeft:b,gridRight:k}=h;return d.reduce((p,g)=>{const{warnPrice:T}=g,D=t==null?void 0:t.convertToPixel({yAxisIndex:0},T);if(D<=f||D>=(t==null?void 0:t.getHeight()))return p;let R=0;return[...p,{type:"group",name:"warningLine",info:g,draggable:"vertical",children:[{type:"line",info:g,shape:{x1:b,y1:D,x2:(t==null?void 0:t.getWidth())-k,y2:D},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:g,x:(t==null?void 0:t.getWidth())-k,y:D-5,style:{fill:"#FFF",text:T,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:I=>{R=I.offsetY},ondrag:I=>{var z;if(I.target&&I.target.childAt(1)){const B=t.convertFromPixel({yAxisIndex:0},D+(I.offsetY-R));(z=I.target.childAt(1))==null||z.animate("style",!1).when(1,{text:le(B,3)}).start()}},ondragend:async I=>{const B=I.offsetY-R;if(B!==0){const U=t==null?void 0:t.convertFromPixel({yAxisIndex:0},B+D),E={id:g.id,warnPrice:le(U,3),featureId:M,featureCode:l,featureType:$};await Te(E),ce.ElMessage.success("画线预警修改成功"),o&&o()}}}]},[])},yt={class:"kline-tips"},bt=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(t){return(d,i)=>(e.openBlock(),e.createElementBlock("div",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(h,o)=>(e.openBlock(),e.createElementBlock("div",{key:o,class:"kline-tips-item",style:e.normalizeStyle({color:h.color})},e.toDisplayString(h.label)+" "+e.toDisplayString(h.value),5))),128))]))}});const he=ie._export_sfc(bt,[["__scopeId","data-v-f83b6b36"]]);const xt={class:"kline-tips"},Mt={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(t){const{round:d,formatValue:i}=ne.x,h=t,o=e.computed(()=>{const{data:M,activeIndex:$}=h;if(M.data&&M.data[$]){const f=M.data[$],b=[{label:"开",value:d(f[0])},{label:"高",value:d(f[3])},{label:"低",value:d(f[2])},{label:"收",value:d(f[1])}];f[4]!==null&&b.push({label:"额",value:i(f[4])});let k;return f[6]>0?k="red":f[6]<0&&(k="green"),b.push({label:"涨跌",value:`${d(f[6])}%`,color:k}),b}return[]}),l=e.computed(()=>{var f;const{data:M,activeIndex:$}=h;return((f=M==null?void 0:M.mainIndicator)==null?void 0:f.map(b=>({label:b.key,value:d(b.data[$]),color:b.color})))||[]});return(M,$)=>(e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(he,{data:o.value},null,8,["data"]),e.createVNode(he,{data:l.value},null,8,["data"])]))}},_t=ie._export_sfc(Mt,[["__scopeId","data-v-64b5c2a3"]]);const wt={class:"klineSub"},kt={class:"klineSub-tips"},St={key:0,class:"klineSub-tips-select"},$t={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(t,{expose:d,emit:i}){const{round:h}=ne.x;let o,l;const M=i,$=t,f=e.ref(),b=e.computed({get(){return $.modelValue},set(g){M("update:modelValue",g)}}),k=e.computed(()=>{var D;const{data:g,activeIndex:T}=$;return((D=g==null?void 0:g.subIndicator)==null?void 0:D.map(R=>({label:R.key,color:R.color,value:R.data[T]||"-"})))||[]});e.onMounted(()=>{o=ve.init(f.value);let g=!0;l=new ResizeObserver(()=>{if(g){g=null;return}o.resize()}),l.observe(f.value)}),e.onUnmounted(()=>{o.dispose(),l.disconnect(),l=null});const p=(g,T)=>{const D=g[T],R=T===0?g[T]:g[T-1];return D[0]===D[1]?D[0]>=R[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:D[1]>D[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return d({connect:g=>{ve.connect([g,o])},draw:(g,T)=>{e.nextTick(()=>{const{startValue:D,endValue:R,maxValueSpan:I}=g,{leftYAxisRange:z,rightYAxisRange:B}=$.data.subIndicator[0],U=$.data.subIndicator.map(E=>{if(E.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:E.data.map((H,V)=>E.seriesColor==="kline"?{value:H,itemStyle:p($.data.data,V)}:E.seriesColor==="value"?{value:H,itemStyle:{color:H>=0?"#FF0000":"#00FFFF"}}:{value:H,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}}});o.setOption({animation:!1,grid:{left:`${T.gridLeft}px`,top:"10px",right:`${T.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:D,endValue:R,maxValueSpan:I}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:E=>{const{axisDimension:H,value:V}=E;if(H==="x")return["6","7","8"].includes($.cycle)?N(V).format("YYYY-MM-DD"):V;if(E.axisIndex===1)return String(h(V))}}},formatter:()=>""},xAxis:{type:"category",data:$.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:E=>["6","7","8"].includes($.cycle)?N(E).format("YYYY-MM-DD"):E}},yAxis:[{position:"right"},{position:"left",min:z==="cover"?E=>E.min:null,max:z==="cover"?E=>E.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:B==="cover"?E=>E.min:null,max:B==="cover"?E=>E.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:U},!0)})}}),(g,T)=>{const D=ye.ElOption,R=ye.ElSelect;return e.openBlock(),e.createElementBlock("div",wt,[e.createElementVNode("div",kt,[k.value.length?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(R,{modelValue:b.value,"onUpdate:modelValue":T[0]||(T[0]=I=>b.value=I),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subIndicatorList,I=>(e.openBlock(),e.createBlock(D,{key:I.value,label:I.label,value:I.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(he,{data:k.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:f},null,512)])}}},Tt=ie._export_sfc($t,[["__scopeId","data-v-ab519de5"]]),Dt=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(t,{emit:d}){const i=d,h=e.ref(),o=e.ref(),l=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{l.value.display="none",i("closeContextMenuCallBack"),document.removeEventListener("click",M)},$=f=>{if(f.preventDefault(),l.value.display==="block"){const{offsetX:b,offsetY:k}=f,{offsetWidth:p,offsetHeight:g}=o.value;if(b<=p&&k<=g)return}h.value.click(),l.value={display:"block",top:`${f.offsetY}px`,left:`${f.offsetX}px`},e.nextTick(()=>{const b=h.value.getBoundingClientRect(),k=o.value.getBoundingClientRect();k.left+k.width>=b.right&&(l.value.left=`${f.offsetX-k.width}px`),k.top+k.height>=b.bottom&&(console.log("高度超出"),l.value.top=`${f.offsetY-k.height}px`)}),document.addEventListener("click",M)};return(f,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:h,class:"contextmenu",onContextmenu:$,onMouseleave:M},[e.renderSlot(f.$slots,"default",{},void 0,!0),l.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:o,class:"contextmenu-popover",style:e.normalizeStyle(l.value)},[e.renderSlot(f.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Et=ie._export_sfc(Dt,[["__scopeId","data-v-811db6b4"]]);const De=t=>(e.pushScopeId("data-v-95b8303f"),t=t(),e.popScopeId(),t),Yt={class:"klineBasic"},Ct={class:"klineBasic-tips"},Nt={key:0,class:"klineBasic-sub"},It={key:1,class:"klineBasic-empty"},Ot={key:2,class:"klineBasic-error"},Bt=De(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Vt={style:{"text-align":"center"}},Lt=De(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Pt={class:"dialog-footer"},Ft={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(t,{expose:d,emit:i}){const h=[{label:"画线预警",key:"drawWarningLine"}];let o=null,l=null,M,$,f=!1,b=!1;const k=i,p=t,g=e.ref(!1),T=e.ref(!1),D=e.ref(null),R=e.ref(null),I=e.ref("VOL"),z=e.ref(0),B=e.ref({}),U=e.ref([]),E=e.ref({}),H=e.ref(!1),V=e.ref(""),K=e.ref([...h]),j=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...p.config}));e.watch(()=>{var n,s;return[p.variety,p.cycle,p.mainIndicator,I.value,(n=p.indicatorStore)==null?void 0:n.filterIndicator,(s=p.indicatorStore)==null?void 0:s.customIndicator]},()=>{Y()},{deep:!0}),e.onMounted(()=>{ct(p.env),Y()}),e.onUnmounted(()=>{l==null||l.off("datazoom"),l==null||l.off("highlight"),l==null||l.off("globalout"),l==null||l.dispose(),o==null||o.dispose()});const X=()=>{l||(l=ve.init(D.value),P(),j.value.showSubChart&&R.value.connect(l),o=ne.D(D.value),o.listen(()=>{requestAnimationFrame(()=>{l.resize()})}))},P=()=>{l==null||l.on("datazoom",s=>{clearTimeout($),$=setTimeout(()=>{var y,S,_,C;const{loadCheckCounts:v}=j.value;if((S=(y=l==null?void 0:l.getOption())==null?void 0:y.dataZoom)!=null&&S[0]){const{startValue:F}=(C=(_=l==null?void 0:l.getOption())==null?void 0:_.dataZoom)==null?void 0:C[0];F<v&&f===!1&&b===!1&&(f=!0,G("history")),x()}clearTimeout($)},100)}),l==null||l.on("highlight",s=>{var y,S;let v=s.dataIndex||-1;s.batch&&(v=typeof((y=s==null?void 0:s.batch[0])==null?void 0:y.dataIndex)=="number"?(S=s==null?void 0:s.batch[0])==null?void 0:S.dataIndex:-1),clearTimeout(M),M=setTimeout(()=>{z.value=v,clearTimeout(M)},20)}),l==null||l.on("globalout",()=>{var v,y,S;const s=(S=(y=(v=l==null?void 0:l.getOption())==null?void 0:v.dataZoom)==null?void 0:y[0])==null?void 0:S.endValue;z.value=s});let n=null;l==null||l.on("contextmenu",s=>{n=setTimeout(()=>{s.componentType==="graphic"&&(E.value=s.info,K.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(n),n=null})})},Y=async()=>{var n,s,v,y,S,_;try{if(!p.variety||!p.cycle)return;const{variety:C,featureId:F,cycle:q,indicatorStore:O,mainIndicator:A,right:J,startTime:Q,endTime:W}=p,{defaultShowCounts:ee,addCounts:L,showWarningLine:de,getFactorData:ue}=j.value,te={variety:C,featureId:F,cycle:q,mainIndicatorList:O.getIndicatorParams(A),subIndicator:I.value,right:J,showWarningLine:de,getFactorData:ue};Q&&W?(te.startTime=Q,te.endTime=W):Q?(te.startTime=Q,te.limit=ee+L):W?(te.endTime=W,te.limit=ee+L):(te.endTime=N().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),te.limit=ee+L);const oe=await dt(te);if((v=(s=(n=oe==null?void 0:oe.body)==null?void 0:n.kline)==null?void 0:s.time)!=null&&v.length)g.value=!1,T.value=!1;else{g.value=!0,T.value=!1;return}B.value=(y=oe==null?void 0:oe.body)==null?void 0:y.kline,U.value=((S=oe==null?void 0:oe.body)==null?void 0:S.warningLine)||[],ae(),x(),ue&&k("getFactorData",(_=oe==null?void 0:oe.body)==null?void 0:_.factor)}catch(C){throw T.value=!0,g.value=!1,new Error(C)}},G=async n=>{const{variety:s,cycle:v,indicatorStore:y,mainIndicator:S,right:_}=p,{addCounts:C}=j.value,{time:F}=B.value;if(n==="history"){const q=await ft({variety:s,cycle:v,endTime:F[0],limit:C,mainIndicatorList:y.getIndicatorParams(S),subIndicator:I.value,right:_});B.value={time:[...q.body.time,...B.value.time.slice(1)],data:[...q.body.data,...B.value.data.slice(1)],mainIndicator:B.value.mainIndicator.map((O,A)=>({...O,data:[...q.body.mainIndicator[A].data,...O.data.slice(1)]})),subIndicator:B.value.subIndicator.map((O,A)=>({...O,data:[...q.body.subIndicator[A].data,...O.data.slice(1)]}))},ae(!0),q.body.data.length<C&&(b=!0),f=!1}},ae=(n=!1)=>{var A,J,Q;X();const{time:s}=B.value,{gridRight:v,gridLeft:y,defaultShowCounts:S,maxShowCounts:_,showSubChart:C}=j.value;let F=s.length-1-S,q=s.length-1;if(n){const W=l.getOption(),ee=(J=(A=W==null?void 0:W.xAxis)==null?void 0:A[0])==null?void 0:J.data,L=(Q=W==null?void 0:W.dataZoom)==null?void 0:Q[0],de=ee[L==null?void 0:L.startValue],ue=ee[L==null?void 0:L.endValue];F=s.findIndex(te=>te===de),q=s.findIndex(te=>te===ue)}const O=ht(B.value,j.value,F,q,p.cycle);if(l.setOption(O,!0),z.value=q,p.brushRange){let W=null,ee=null;switch(p.cycle){case"6":{W=s.find(L=>new Date(L).getTime()>=new Date(p.brushRange[0]).getTime()||N(L).format("YYYY-MM-DD")===N(p.brushRange[0]).format("YYYY-MM-DD")),ee=s.findLast(L=>new Date(L).getTime()<=new Date(p.brushRange[1]).getTime()||N(L).format("YYYY-MM-DD")===N(p.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{W=s.find(L=>N(L).day(5).format("YYYY-MM-DD")===N(p.brushRange[0]).day(5).format("YYYY-MM-DD")),ee=s.findLast(L=>N(L).day(5).format("YYYY-MM-DD")===N(p.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{W=s.find(L=>N(L).endOf("month").format("YYYY-MM-DD")===N(p.brushRange[0]).endOf("month").format("YYYY-MM-DD")),ee=s.findLast(L=>N(L).endOf("month").format("YYYY-MM-DD")===N(p.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:W=s.find(L=>new Date(L).getTime()>=new Date(p.brushRange[0]).getTime()),ee=s.findLast(L=>new Date(L).getTime()<=new Date(p.brushRange[1]).getTime())}console.log(W,ee),l.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[W,ee],xAxisIndex:0}]})}C&&R.value.draw({startValue:F,endValue:q,maxValueSpan:_},{gridLeft:y,gridRight:v}),r()},x=()=>{if(!l)return;const n=l==null?void 0:l.getOption();n&&(l==null||l.setOption({...n,graphic:[...gt(l,U.value,p,j.value,()=>{a()})]},!0),r())},r=()=>{const{time:n}=B.value;if(p.brushRange&&(n!=null&&n.length)){let s=N(p.brushRange[0]).format("YYYY-MM-DD 00:00:00"),v=N(p.brushRange[1]).format("YYYY-MM-DD 23:59:59"),y=null,S=null;switch(p.cycle){case"6":{y=n.find(_=>N(_).format("YYYY-MM-DD")===N(s).format("YYYY-MM-DD")),S=y;break}case"7":{y=n.find(_=>N(_).day(5).format("YYYY-MM-DD")===N(s).day(5).format("YYYY-MM-DD")),S=n.findLast(_=>N(_).day(5).format("YYYY-MM-DD")===N(v).day(5).format("YYYY-MM-DD"));break}case"8":{y=n.find(_=>N(_).endOf("month").format("YYYY-MM-DD")===N(s).endOf("month").format("YYYY-MM-DD")),S=n.findLast(_=>N(_).endOf("month").format("YYYY-MM-DD")===N(v).endOf("month").format("YYYY-MM-DD"));break}default:y=n.find(_=>{const C=N(_).format("YYYY-MM-DD")===N(s).format("YYYY-MM-DD"),F=new Date(_).getTime()>=new Date(s).getTime();return C&&F}),S=n.findLast(_=>{const C=N(_).format("YYYY-MM-DD")===N(v).format("YYYY-MM-DD"),F=new Date(_).getTime()<=new Date(v).getTime();return C&&F})}l.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[y,S],xAxisIndex:0}]})}},a=async()=>{const n=await mt({featureId:p.featureId});U.value=(n==null?void 0:n.body)||[],x(),k("change","warningLine",U.value)},u=async n=>{const{variety:s,varietyName:v,featureId:y,featureType:S}=p;if(n.key==="drawWarningLine"){const _=l==null?void 0:l.getOption(),C=_.tooltip[0];l==null||l.setOption({..._,tooltip:{...C,axisPointer:{...C.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...C.axisPointer.label,backgroundColor:"transparent",formatter:q=>""}}}});const F=async q=>{l==null||l.getZr().off("mousedown",F);const O=l==null?void 0:l.convertFromPixel({yAxisIndex:0},q.offsetY),A=Math.round(O*1e3)/1e3;l==null||l.setOption({..._,tooltip:{...C,axisPointer:{...C.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...C.axisPointer.label,backgroundColor:null}}}}),await pt({featureCode:s,featureName:v,featureId:y,featureType:S,warnPrice:A}),ce.ElMessage.success("画线预警成功!"),a()};l==null||l.getZr().on("mousedown",F)}else n.key==="deleteWarningLine"?(await vt({id:E.value.id}),ce.ElMessage.success("画线预警删除成功"),a()):n.key==="changeWarningLine"&&(H.value=!0,V.value=E.value.warnPrice)},c=async()=>{const{variety:n,varietyName:s,featureId:v,featureType:y}=p;await Te({id:E.value.id,featureCode:n,featureName:s,featureId:v,featureType:y,warnPrice:V.value}),ce.ElMessage.success("画线预警修改成功"),a()},m=()=>{K.value=[...h]};return d({draw:(n,s)=>{n==="warningLine"&&(U.value=s,x())}}),(n,s)=>{var q;const v=ut,y=it,S=Ye.ElEmpty,_=xe.ElButton,C=Ee.ElInputNumber,F=be.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Yt,[e.createElementVNode("div",Ct,[e.createVNode(_t,{data:B.value,activeIndex:z.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:j.value.showSubChart?"70%":"100%"})},[e.createVNode(Et,{onCloseContextMenuCallBack:m},{popover:e.withCtx(()=>[e.createVNode(y,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,O=>(e.openBlock(),e.createBlock(v,{style:{height:"36px"},key:O.key,index:O.key,onClick:A=>u(O)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(O.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:D,style:{height:"100%"}},null,512)]),_:1})],4),j.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Nt,[e.createVNode(Tt,{ref_key:"klineSubRef",ref:R,modelValue:I.value,"onUpdate:modelValue":s[0]||(s[0]=O=>I.value=O),data:B.value,cycle:t.cycle,activeIndex:z.value,subIndicatorList:(q=t.indicatorStore)==null?void 0:q.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("div",It,[e.createVNode(S,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("div",Ot,[Bt,e.createElementVNode("div",Vt,[e.createVNode(_,{onClick:Y},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)]),e.createVNode(F,{modelValue:H.value,"onUpdate:modelValue":s[3]||(s[3]=O=>H.value=O),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Pt,[e.createVNode(_,{onClick:s[2]||(s[2]=O=>H.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(_,{type:"primary",onClick:c},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Lt,e.createVNode(C,{modelValue:V.value,"onUpdate:modelValue":s[1]||(s[1]=O=>V.value=O),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},At=ie._export_sfc(Ft,[["__scopeId","data-v-95b8303f"]]),Rt={install(t){t.component("st-klineBasic",At)}};module.exports=Rt;
|
|
1
|
+
"use strict";require("./base-ec05f348.cjs");const ge=require("./el-overlay-bc0790a2.cjs");require("./el-input-23e2bac3.cjs");const he=require("./el-input-number-40a81eb5.cjs"),ve=require("./el-button-196807af.cjs"),be=require("./el-empty-19ea04f4.cjs"),de=require("./el-menu-item-78b858f2.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-746070ba.cjs");const e=require("vue"),xe=require("echarts"),J=require("./index-a96158ae.cjs"),se=require("./el-message-d4df8136.cjs"),ae=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-c51a6490.cjs");const fe=require("./el-select-b162dffc.cjs");require("./el-scrollbar-d1c3e7f7.cjs");require("./vnode-7fbc61e1.cjs");require("./index-3bf8d597.cjs");require("./use-form-common-props-1b84d8f4.cjs");require("./scroll-41224831.cjs");require("./index-8a0b1c53.cjs");require("./typescript-b63f8e83.cjs");require("./index-deb8de52.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-7cdfca4d.cjs");require("./index-a387515d.cjs");require("./castArray-a45823fe.cjs");require("./debounce-b2ff12bd.cjs");function _e(s){const N=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const E in s)if(E!=="default"){const S=Object.getOwnPropertyDescriptor(s,E);Object.defineProperty(N,E,S.get?S:{enumerable:!0,get:()=>s[E]})}}return N.default=s,Object.freeze(N)}const ue=_e(xe);var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var pe={exports:{}};(function(s,N){(function(E,S){s.exports=S()})(Ye,function(){var E=1e3,S=6e4,T=36e5,t="millisecond",$="second",D="minute",h="hour",_="day",V="week",l="month",d="quarter",M="year",v="date",I="Invalid Date",F=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,q={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var i=["th","st","nd","rd"],o=c%100;return"["+c+(i[(o-20)%10]||i[o]||i[0])+"]"}},H=function(c,i,o){var u=String(c);return!u||u.length>=i?c:""+Array(i+1-u.length).join(o)+c},b={s:H,z:function(c){var i=-c.utcOffset(),o=Math.abs(i),u=Math.floor(o/60),a=o%60;return(i<=0?"+":"-")+H(u,2,"0")+":"+H(a,2,"0")},m:function c(i,o){if(i.date()<o.date())return-c(o,i);var u=12*(o.year()-i.year())+(o.month()-i.month()),a=i.clone().add(u,l),y=o-a<0,r=i.clone().add(u+(y?-1:1),l);return+(-(u+(o-a)/(y?a-r:r-a))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:l,y:M,w:V,d:_,D:v,h,m:D,s:$,ms:t,Q:d}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},P="en",W={};W[P]=q;var ee="$isDayjsObject",z=function(c){return c instanceof ne||!(!c||!c[ee])},te=function c(i,o,u){var a;if(!i)return P;if(typeof i=="string"){var y=i.toLowerCase();W[y]&&(a=y),o&&(W[y]=o,a=y);var r=i.split("-");if(!a&&r.length>1)return c(r[0])}else{var n=i.name;W[n]=i,a=n}return!u&&a&&(P=a),a||!u&&P},C=function(c,i){if(z(c))return c.clone();var o=typeof i=="object"?i:{};return o.date=c,o.args=arguments,new ne(o)},Y=b;Y.l=te,Y.i=z,Y.w=function(c,i){return C(c,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var ne=function(){function c(o){this.$L=te(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[ee]=!0}var i=c.prototype;return i.parse=function(o){this.$d=function(u){var a=u.date,y=u.utc;if(a===null)return new Date(NaN);if(Y.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var r=a.match(F);if(r){var n=r[2]-1||0,f=(r[7]||"0").substring(0,3);return y?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,f)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,f)}}return new Date(a)}(o),this.init()},i.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},i.$utils=function(){return Y},i.isValid=function(){return this.$d.toString()!==I},i.isSame=function(o,u){var a=C(o);return this.startOf(u)<=a&&a<=this.endOf(u)},i.isAfter=function(o,u){return C(o)<this.startOf(u)},i.isBefore=function(o,u){return this.endOf(u)<C(o)},i.$g=function(o,u,a){return Y.u(o)?this[u]:this.set(a,o)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(o,u){var a=this,y=!!Y.u(u)||u,r=Y.p(o),n=function(k,O){var U=Y.w(a.$u?Date.UTC(a.$y,O,k):new Date(a.$y,O,k),a);return y?U:U.endOf(_)},f=function(k,O){return Y.w(a.toDate()[k].apply(a.toDate("s"),(y?[0,0,0,0]:[23,59,59,999]).slice(O)),a)},p=this.$W,g=this.$M,m=this.$D,w="set"+(this.$u?"UTC":"");switch(r){case M:return y?n(1,0):n(31,11);case l:return y?n(1,g):n(0,g+1);case V:var B=this.$locale().weekStart||0,A=(p<B?p+7:p)-B;return n(y?m-A:m+(6-A),g);case _:case v:return f(w+"Hours",0);case h:return f(w+"Minutes",1);case D:return f(w+"Seconds",2);case $:return f(w+"Milliseconds",3);default:return this.clone()}},i.endOf=function(o){return this.startOf(o,!1)},i.$set=function(o,u){var a,y=Y.p(o),r="set"+(this.$u?"UTC":""),n=(a={},a[_]=r+"Date",a[v]=r+"Date",a[l]=r+"Month",a[M]=r+"FullYear",a[h]=r+"Hours",a[D]=r+"Minutes",a[$]=r+"Seconds",a[t]=r+"Milliseconds",a)[y],f=y===_?this.$D+(u-this.$W):u;if(y===l||y===M){var p=this.clone().set(v,1);p.$d[n](f),p.init(),this.$d=p.set(v,Math.min(this.$D,p.daysInMonth())).$d}else n&&this.$d[n](f);return this.init(),this},i.set=function(o,u){return this.clone().$set(o,u)},i.get=function(o){return this[Y.p(o)]()},i.add=function(o,u){var a,y=this;o=Number(o);var r=Y.p(u),n=function(g){var m=C(y);return Y.w(m.date(m.date()+Math.round(g*o)),y)};if(r===l)return this.set(l,this.$M+o);if(r===M)return this.set(M,this.$y+o);if(r===_)return n(1);if(r===V)return n(7);var f=(a={},a[D]=S,a[h]=T,a[$]=E,a)[r]||1,p=this.$d.getTime()+o*f;return Y.w(p,this)},i.subtract=function(o,u){return this.add(-1*o,u)},i.format=function(o){var u=this,a=this.$locale();if(!this.isValid())return a.invalidDate||I;var y=o||"YYYY-MM-DDTHH:mm:ssZ",r=Y.z(this),n=this.$H,f=this.$m,p=this.$M,g=a.weekdays,m=a.months,w=a.meridiem,B=function(O,U,Z,R){return O&&(O[U]||O(u,y))||Z[U].slice(0,R)},A=function(O){return Y.s(n%12||12,O,"0")},k=w||function(O,U,Z){var R=O<12?"AM":"PM";return Z?R.toLowerCase():R};return y.replace(j,function(O,U){return U||function(Z){switch(Z){case"YY":return String(u.$y).slice(-2);case"YYYY":return Y.s(u.$y,4,"0");case"M":return p+1;case"MM":return Y.s(p+1,2,"0");case"MMM":return B(a.monthsShort,p,m,3);case"MMMM":return B(m,p);case"D":return u.$D;case"DD":return Y.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return B(a.weekdaysMin,u.$W,g,2);case"ddd":return B(a.weekdaysShort,u.$W,g,3);case"dddd":return g[u.$W];case"H":return String(n);case"HH":return Y.s(n,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return k(n,f,!0);case"A":return k(n,f,!1);case"m":return String(f);case"mm":return Y.s(f,2,"0");case"s":return String(u.$s);case"ss":return Y.s(u.$s,2,"0");case"SSS":return Y.s(u.$ms,3,"0");case"Z":return r}return null}(O)||r.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(o,u,a){var y,r=this,n=Y.p(u),f=C(o),p=(f.utcOffset()-this.utcOffset())*S,g=this-f,m=function(){return Y.m(r,f)};switch(n){case M:y=m()/12;break;case l:y=m();break;case d:y=m()/3;break;case V:y=(g-p)/6048e5;break;case _:y=(g-p)/864e5;break;case h:y=g/T;break;case D:y=g/S;break;case $:y=g/E;break;default:y=g}return a?y:Y.a(y)},i.daysInMonth=function(){return this.endOf(l).$D},i.$locale=function(){return W[this.$L]},i.locale=function(o,u){if(!o)return this.$L;var a=this.clone(),y=te(o,u,!0);return y&&(a.$L=y),a},i.clone=function(){return Y.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},c}(),re=ne.prototype;return C.prototype=re,[["$ms",t],["$s",$],["$m",D],["$H",h],["$W",_],["$M",l],["$y",M],["$D",v]].forEach(function(c){re[c[1]]=function(i){return this.$g(i,c[0],c[1])}}),C.extend=function(c,i){return c.$i||(c(i,ne,C),c.$i=!0),C},C.locale=te,C.isDayjs=z,C.unix=function(c){return C(1e3*c)},C.en=W[P],C.Ls=W,C.p={},C})})(pe);var Me=pe.exports;const x=De(Me);let Q=null;const we=s=>{const N=J.y(s,{handleReq:E=>{J.v()&&(E.headers.token=J.U())},handleRes:E=>{const{data:S}=E;if(S.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:J.K(),!0}});N.get,Q=N.post},ke=s=>Q("/middleLayer/kline/getKlineBasic",{...s,userId:J.V("id")}),Se=s=>Q("/middleLayer/kline/getKline",s),$e=async s=>Q("/alarm/deliversign/addAlarmPrice",{...s,userId:J.V("id")}),Te=async s=>Q("/alarm/deliversign/findAlarmPriceByUserId",{...s,userId:J.V("id")}),me=async s=>Q("/alarm/deliversign/updateAlarmPrice",{...s,userId:J.V("id")}),Ve=async s=>Q("/alarm/deliversign/deleteAlarmPrice",{...s,userId:J.V("id")}),{round:oe}=J.x,Le=(s,N,E,S,T)=>{const{data:t,time:$}=s,{gridTop:D,gridRight:h,gridLeft:_,maxShowCounts:V,showSubChart:l}=N;return{animation:!1,grid:{top:`${D}px`,right:`${h}px`,bottom:l?"6px":"24px",left:`${_}px`},dataZoom:[{type:"inside",startValue:E,endValue:S,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:d=>{const{axisDimension:M,value:v}=d;return M==="x"?l?"":["6","7","8"].includes(T)?x(v).format("YYYY-MM-DD"):v:String(oe(v))}}},formatter:()=>""},xAxis:{show:!l,type:"category",data:$,splitLine:{show:!1},axisLabel:{formatter:d=>["6","7","8"].includes(T)?x(d).format("YYYY-MM-DD"):d}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:d=>oe(d.min),max:d=>oe(d.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...s.mainIndicator.map(d=>({name:d.key,type:"line",silent:!0,symbol:"none",data:d.data,lineStyle:{width:d.width||1},itemStyle:{color:d.color}}))],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:2},brushStyle:{color:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.4)"}}}},Be=(s,N,E,S,T)=>{const{variety:t,featureId:$,featureType:D}=E,{gridTop:h,gridLeft:_,gridRight:V}=S;return N.reduce((l,d)=>{const{warnPrice:M}=d,v=s==null?void 0:s.convertToPixel({yAxisIndex:0},M);if(v<=h||v>=(s==null?void 0:s.getHeight()))return l;let I=0;return[...l,{type:"group",name:"warningLine",info:d,draggable:"vertical",children:[{type:"line",info:d,shape:{x1:_,y1:v,x2:(s==null?void 0:s.getWidth())-V,y2:v},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:d,x:(s==null?void 0:s.getWidth())-V,y:v-5,style:{fill:"#FFF",text:M,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:F=>{I=F.offsetY},ondrag:F=>{var j;if(F.target&&F.target.childAt(1)){const q=s.convertFromPixel({yAxisIndex:0},v+(F.offsetY-I));(j=F.target.childAt(1))==null||j.animate("style",!1).when(1,{text:oe(q,3)}).start()}},ondragend:async F=>{const q=F.offsetY-I;if(q!==0){const H=s==null?void 0:s.convertFromPixel({yAxisIndex:0},q+v),b={id:d.id,warnPrice:oe(H,3),featureId:$,featureCode:t,featureType:D};await me(b),se.ElMessage.success("画线预警修改成功"),T&&T()}}}]},[])},Oe={class:"kline-tips"},Ne=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(s){return(N,E)=>(e.openBlock(),e.createElementBlock("div",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.data,(S,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"kline-tips-item",style:e.normalizeStyle({color:S.color})},e.toDisplayString(S.label)+" "+e.toDisplayString(S.value),5))),128))]))}});const ce=ae._export_sfc(Ne,[["__scopeId","data-v-f83b6b36"]]);const Ee={class:"kline-tips"},Fe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(s){const{round:N,formatValue:E}=J.x,S=s,T=e.computed(()=>{const{data:$,activeIndex:D}=S;if($.data&&$.data[D]){const h=$.data[D],_=[{label:"开",value:N(h[0])},{label:"高",value:N(h[3])},{label:"低",value:N(h[2])},{label:"收",value:N(h[1])}];h[4]!==null&&_.push({label:"额",value:E(h[4])});let V;return h[6]>0?V="red":h[6]<0&&(V="green"),_.push({label:"涨跌",value:`${N(h[6])}%`,color:V}),_}return[]}),t=e.computed(()=>{var h;const{data:$,activeIndex:D}=S;return((h=$==null?void 0:$.mainIndicator)==null?void 0:h.map(_=>({label:_.key,value:N(_.data[D]),color:_.color})))||[]});return($,D)=>(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(ce,{data:T.value},null,8,["data"]),e.createVNode(ce,{data:t.value},null,8,["data"])]))}},Ae=ae._export_sfc(Fe,[["__scopeId","data-v-64b5c2a3"]]);const Re={class:"klineSub"},qe={class:"klineSub-tips"},Ie={key:0,class:"klineSub-tips-select"},Ce={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(s,{expose:N,emit:E}){const{round:S}=J.x;let T,t;const $=E,D=s,h=e.ref(),_=e.computed({get(){return D.modelValue},set(d){$("update:modelValue",d)}}),V=e.computed(()=>{var v;const{data:d,activeIndex:M}=D;return((v=d==null?void 0:d.subIndicator)==null?void 0:v.map(I=>({label:I.key,color:I.color,value:I.data[M]||"-"})))||[]});e.onMounted(()=>{T=ue.init(h.value);let d=!0;t=new ResizeObserver(()=>{if(d){d=null;return}T.resize()}),t.observe(h.value)}),e.onUnmounted(()=>{T.dispose(),t.disconnect(),t=null});const l=(d,M)=>{const v=d[M],I=M===0?d[M]:d[M-1];return v[0]===v[1]?v[0]>=I[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:v[1]>v[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return N({connect:d=>{ue.connect([d,T])},draw:(d,M)=>{e.nextTick(()=>{const{startValue:v,endValue:I,maxValueSpan:F}=d,{leftYAxisRange:j,rightYAxisRange:q}=D.data.subIndicator[0],H=D.data.subIndicator.map(b=>{if(b.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:b.data.map((P,W)=>b.seriesColor==="kline"?{value:P,itemStyle:l(D.data.data,W)}:b.seriesColor==="value"?{value:P,itemStyle:{color:P>=0?"#FF0000":"#00FFFF"}}:{value:P,itemStyle:{color:b.seriesColor}})};if(b.series==="line")return{xAxisIndex:0,yAxisIndex:b.yAxis==="right"?2:1,name:b.key,type:"line",silent:!0,symbol:"none",data:b.data,lineStyle:{width:1},itemStyle:{color:b.color}}});T.setOption({animation:!1,grid:{left:`${M.gridLeft}px`,top:"10px",right:`${M.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:v,endValue:I,maxValueSpan:F}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:b=>{const{axisDimension:P,value:W}=b;if(P==="x")return["6","7","8"].includes(D.cycle)?x(W).format("YYYY-MM-DD"):W;if(b.axisIndex===1)return String(S(W))}}},formatter:()=>""},xAxis:{type:"category",data:D.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:b=>["6","7","8"].includes(D.cycle)?x(b).format("YYYY-MM-DD"):b}},yAxis:[{position:"right"},{position:"left",min:j==="cover"?b=>b.min:null,max:j==="cover"?b=>b.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:q==="cover"?b=>b.min:null,max:q==="cover"?b=>b.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:H},!0)})}}),(d,M)=>{const v=fe.ElOption,I=fe.ElSelect;return e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("div",qe,[V.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(I,{modelValue:_.value,"onUpdate:modelValue":M[0]||(M[0]=F=>_.value=F),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.subIndicatorList,F=>(e.openBlock(),e.createBlock(v,{key:F.value,label:F.label,value:F.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(ce,{data:V.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:h},null,512)])}}},We=ae._export_sfc(Ce,[["__scopeId","data-v-ab519de5"]]),Pe=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(s,{emit:N}){const E=N,S=e.ref(),T=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),$=()=>{t.value.display="none",E("closeContextMenuCallBack"),document.removeEventListener("click",$)},D=h=>{if(h.preventDefault(),t.value.display==="block"){const{offsetX:_,offsetY:V}=h,{offsetWidth:l,offsetHeight:d}=T.value;if(_<=l&&V<=d)return}S.value.click(),t.value={display:"block",top:`${h.offsetY}px`,left:`${h.offsetX}px`},e.nextTick(()=>{const _=S.value.getBoundingClientRect(),V=T.value.getBoundingClientRect();V.left+V.width>=_.right&&(t.value.left=`${h.offsetX-V.width}px`),V.top+V.height>=_.bottom&&(console.log("高度超出"),t.value.top=`${h.offsetY-V.height}px`)}),document.addEventListener("click",$)};return(h,_)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:S,class:"contextmenu",onContextmenu:D,onMouseleave:$},[e.renderSlot(h.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:T,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(h.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const je=ae._export_sfc(Pe,[["__scopeId","data-v-811db6b4"]]);const ye=s=>(e.pushScopeId("data-v-95b8303f"),s=s(),e.popScopeId(),s),He={class:"klineBasic"},ze={class:"klineBasic-tips"},Ue={key:0,class:"klineBasic-sub"},Ze={key:1,class:"klineBasic-empty"},Ke={key:2,class:"klineBasic-error"},Xe=ye(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Je={style:{"text-align":"center"}},Ge=ye(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Qe={class:"dialog-footer"},et={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(s,{expose:N,emit:E}){const S=[{label:"画线预警",key:"drawWarningLine"}];let T=null,t=null,$,D,h=!1,_=!1;const V=E,l=s,d=e.ref(!1),M=e.ref(!1),v=e.ref(null),I=e.ref(null),F=e.ref("VOL"),j=e.ref(0),q=e.ref({}),H=e.ref([]),b=e.ref({}),P=e.ref(!1),W=e.ref(""),ee=e.ref([...S]),z=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...l.config}));e.watch(()=>{var r,n;return[l.variety,l.cycle,l.mainIndicator,F.value,(r=l.indicatorStore)==null?void 0:r.filterIndicator,(n=l.indicatorStore)==null?void 0:n.customIndicator]},()=>{Y()},{deep:!0}),e.onMounted(()=>{we(l.env),Y()}),e.onUnmounted(()=>{t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),T==null||T.dispose()});const te=()=>{t||(t=ue.init(v.value),C(),z.value.showSubChart&&I.value.connect(t),T=J.D(v.value),T.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},C=()=>{t==null||t.on("datazoom",n=>{clearTimeout(D),D=setTimeout(()=>{var p,g,m,w;const{loadCheckCounts:f}=z.value;if((g=(p=t==null?void 0:t.getOption())==null?void 0:p.dataZoom)!=null&&g[0]){const{startValue:B}=(w=(m=t==null?void 0:t.getOption())==null?void 0:m.dataZoom)==null?void 0:w[0];B<f&&h===!1&&_===!1&&(h=!0,ne("history")),c()}clearTimeout(D)},100)}),t==null||t.on("highlight",n=>{var p,g;let f=n.dataIndex||-1;n.batch&&(f=typeof((p=n==null?void 0:n.batch[0])==null?void 0:p.dataIndex)=="number"?(g=n==null?void 0:n.batch[0])==null?void 0:g.dataIndex:-1),clearTimeout($),$=setTimeout(()=>{j.value=f,clearTimeout($)},20)}),t==null||t.on("globalout",()=>{var f,p,g;const n=(g=(p=(f=t==null?void 0:t.getOption())==null?void 0:f.dataZoom)==null?void 0:p[0])==null?void 0:g.endValue;j.value=n});let r=null;t==null||t.on("contextmenu",n=>{r=setTimeout(()=>{n.componentType==="graphic"&&(b.value=n.info,ee.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(r),r=null})})},Y=async()=>{var r,n,f,p,g,m;try{if(!l.variety||!l.cycle)return;const{variety:w,featureId:B,cycle:A,indicatorStore:k,mainIndicator:O,right:U,startTime:Z,endTime:R}=l,{defaultShowCounts:K,addCounts:L,showWarningLine:le,getFactorData:ie}=z.value,X={variety:w,featureId:B,cycle:A,mainIndicatorList:k.getIndicatorParams(O),subIndicator:F.value,right:U,showWarningLine:le,getFactorData:ie};Z&&R?(X.startTime=Z,X.endTime=R):Z?(X.startTime=Z,X.limit=K+L):R?(X.endTime=R,X.limit=K+L):(X.endTime=x().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),X.limit=K+L);const G=await ke(X);if((f=(n=(r=G==null?void 0:G.body)==null?void 0:r.kline)==null?void 0:n.time)!=null&&f.length)d.value=!1,M.value=!1;else{d.value=!0,M.value=!1;return}q.value=(p=G==null?void 0:G.body)==null?void 0:p.kline,H.value=((g=G==null?void 0:G.body)==null?void 0:g.warningLine)||[],re(),c(),ie&&V("getFactorData",(m=G==null?void 0:G.body)==null?void 0:m.factor)}catch(w){throw M.value=!0,d.value=!1,new Error(w)}},ne=async r=>{const{variety:n,cycle:f,indicatorStore:p,mainIndicator:g,right:m}=l,{addCounts:w}=z.value,{time:B}=q.value;if(r==="history"){const A=await Se({variety:n,cycle:f,endTime:B[0],limit:w,mainIndicatorList:p.getIndicatorParams(g),subIndicator:F.value,right:m});q.value={time:[...A.body.time,...q.value.time.slice(1)],data:[...A.body.data,...q.value.data.slice(1)],mainIndicator:q.value.mainIndicator.map((k,O)=>({...k,data:[...A.body.mainIndicator[O].data,...k.data.slice(1)]})),subIndicator:q.value.subIndicator.map((k,O)=>({...k,data:[...A.body.subIndicator[O].data,...k.data.slice(1)]}))},re(!0),A.body.data.length<w&&(_=!0),h=!1}},re=(r=!1)=>{var O,U,Z;te();const{time:n}=q.value,{gridRight:f,gridLeft:p,defaultShowCounts:g,maxShowCounts:m,showSubChart:w}=z.value;let B=n.length-1-g,A=n.length-1;if(r){const R=t.getOption(),K=(U=(O=R==null?void 0:R.xAxis)==null?void 0:O[0])==null?void 0:U.data,L=(Z=R==null?void 0:R.dataZoom)==null?void 0:Z[0],le=K[L==null?void 0:L.startValue],ie=K[L==null?void 0:L.endValue];B=n.findIndex(X=>X===le),A=n.findIndex(X=>X===ie)}const k=Le(q.value,z.value,B,A,l.cycle);if(t.setOption(k,!0),j.value=A,l.brushRange){let R=null,K=null;switch(l.cycle){case"6":{R=n.find(L=>new Date(L).getTime()>=new Date(l.brushRange[0]).getTime()||x(L).format("YYYY-MM-DD")===x(l.brushRange[0]).format("YYYY-MM-DD")),K=n.findLast(L=>new Date(L).getTime()<=new Date(l.brushRange[1]).getTime()||x(L).format("YYYY-MM-DD")===x(l.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{R=n.find(L=>x(L).day(5).format("YYYY-MM-DD")===x(l.brushRange[0]).day(5).format("YYYY-MM-DD")),K=n.findLast(L=>x(L).day(5).format("YYYY-MM-DD")===x(l.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{R=n.find(L=>x(L).endOf("month").format("YYYY-MM-DD")===x(l.brushRange[0]).endOf("month").format("YYYY-MM-DD")),K=n.findLast(L=>x(L).endOf("month").format("YYYY-MM-DD")===x(l.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:R=n.find(L=>new Date(L).getTime()>=new Date(l.brushRange[0]).getTime()),K=n.findLast(L=>new Date(L).getTime()<=new Date(l.brushRange[1]).getTime())}console.log(R,K),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[R,K],xAxisIndex:0}]})}w&&I.value.draw({startValue:B,endValue:A,maxValueSpan:m},{gridLeft:p,gridRight:f}),i()},c=()=>{if(!t)return;const r=t==null?void 0:t.getOption();r&&(t==null||t.setOption({...r,graphic:[...Be(t,H.value,l,z.value,()=>{o()})]},!0),i())},i=()=>{const{time:r}=q.value;if(l.brushRange&&(r!=null&&r.length)){let n=x(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),f=x(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),p=null,g=null;switch(l.cycle){case"6":{p=r.find(m=>x(m).format("YYYY-MM-DD")===x(n).format("YYYY-MM-DD")),g=p;break}case"7":{p=r.find(m=>x(m).day(5).format("YYYY-MM-DD")===x(n).day(5).format("YYYY-MM-DD")),g=r.findLast(m=>x(m).day(5).format("YYYY-MM-DD")===x(f).day(5).format("YYYY-MM-DD"));break}case"8":{p=r.find(m=>x(m).endOf("month").format("YYYY-MM-DD")===x(n).endOf("month").format("YYYY-MM-DD")),g=r.findLast(m=>x(m).endOf("month").format("YYYY-MM-DD")===x(f).endOf("month").format("YYYY-MM-DD"));break}default:p=r.find(m=>{const w=x(m).format("YYYY-MM-DD")===x(n).format("YYYY-MM-DD"),B=new Date(m).getTime()>=new Date(n).getTime();return w&&B}),g=r.findLast(m=>{const w=x(m).format("YYYY-MM-DD")===x(f).format("YYYY-MM-DD"),B=new Date(m).getTime()<=new Date(f).getTime();return w&&B})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[p,g],xAxisIndex:0}]})}},o=async()=>{const r=await Te({featureId:l.featureId});H.value=(r==null?void 0:r.body)||[],c(),V("change","warningLine",H.value)},u=async r=>{const{variety:n,varietyName:f,featureId:p,featureType:g}=l;if(r.key==="drawWarningLine"){const m=t==null?void 0:t.getOption(),w=m.tooltip[0];t==null||t.setOption({...m,tooltip:{...w,axisPointer:{...w.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...w.axisPointer.label,backgroundColor:"transparent",formatter:A=>""}}}});const B=async A=>{t==null||t.getZr().off("mousedown",B);const k=t==null?void 0:t.convertFromPixel({yAxisIndex:0},A.offsetY),O=Math.round(k*1e3)/1e3;t==null||t.setOption({...m,tooltip:{...w,axisPointer:{...w.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...w.axisPointer.label,backgroundColor:null}}}}),await $e({featureCode:n,featureName:f,featureId:p,featureType:g,warnPrice:O}),se.ElMessage.success("画线预警成功!"),o()};t==null||t.getZr().on("mousedown",B)}else r.key==="deleteWarningLine"?(await Ve({id:b.value.id}),se.ElMessage.success("画线预警删除成功"),o()):r.key==="changeWarningLine"&&(P.value=!0,W.value=b.value.warnPrice)},a=async()=>{const{variety:r,varietyName:n,featureId:f,featureType:p}=l;await me({id:b.value.id,featureCode:r,featureName:n,featureId:f,featureType:p,warnPrice:W.value}),se.ElMessage.success("画线预警修改成功"),o()},y=()=>{ee.value=[...S]};return N({draw:(r,n)=>{r==="warningLine"&&(H.value=n,c())}}),(r,n)=>{var A;const f=de.ElMenuItem,p=de.ElMenu,g=be.ElEmpty,m=ve.ElButton,w=he.ElInputNumber,B=ge.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",He,[e.createElementVNode("div",ze,[e.createVNode(Ae,{data:q.value,activeIndex:j.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:z.value.showSubChart?"70%":"100%"})},[e.createVNode(je,{onCloseContextMenuCallBack:y},{popover:e.withCtx(()=>[e.createVNode(p,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,k=>(e.openBlock(),e.createBlock(f,{style:{height:"36px"},key:k.key,index:k.key,onClick:O=>u(k)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:v,style:{height:"100%"}},null,512)]),_:1})],4),z.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(We,{ref_key:"klineSubRef",ref:I,modelValue:F.value,"onUpdate:modelValue":n[0]||(n[0]=k=>F.value=k),data:q.value,cycle:s.cycle,activeIndex:j.value,subIndicatorList:(A=s.indicatorStore)==null?void 0:A.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",Ze,[e.createVNode(g,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("div",Ke,[Xe,e.createElementVNode("div",Je,[e.createVNode(m,{onClick:Y},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)]),e.createVNode(B,{modelValue:P.value,"onUpdate:modelValue":n[3]||(n[3]=k=>P.value=k),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Qe,[e.createVNode(m,{onClick:n[2]||(n[2]=k=>P.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(m,{type:"primary",onClick:a},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Ge,e.createVNode(w,{modelValue:W.value,"onUpdate:modelValue":n[1]||(n[1]=k=>W.value=k),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},tt=ae._export_sfc(et,[["__scopeId","data-v-95b8303f"]]),nt={install(s){s.component("st-klineBasic",tt)}};module.exports=nt;
|