st-comp 0.0.268 → 0.0.269

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.
Files changed (128) hide show
  1. package/components.d.ts +1 -0
  2. package/es/CustomFunction.cjs +1 -1
  3. package/es/CustomFunction.js +22 -22
  4. package/es/FactorWarning.cjs +1 -1
  5. package/es/FactorWarning.js +26 -26
  6. package/es/Kline.cjs +1 -1
  7. package/es/Kline.js +11 -11
  8. package/es/KlineBasic.cjs +1 -1
  9. package/es/KlineBasic.js +19 -19
  10. package/es/KlineConfig.cjs +1 -1
  11. package/es/KlineConfig.js +16 -16
  12. package/es/KlineNew.cjs +1 -1
  13. package/es/KlineNew.js +10 -10
  14. package/es/KlinePlus.cjs +1 -1
  15. package/es/KlinePlus.js +12 -12
  16. package/es/MonacoEditor.cjs +1 -1
  17. package/es/MonacoEditor.js +18 -18
  18. package/es/Pagination.cjs +1 -1
  19. package/es/Pagination.js +14 -14
  20. package/es/PasswordPrompt.cjs +1 -1
  21. package/es/PasswordPrompt.js +2 -2
  22. package/es/Table.cjs +1 -1
  23. package/es/Table.js +18 -18
  24. package/es/User.cjs +1 -1
  25. package/es/User.js +19 -19
  26. package/es/VarSelectDialog.cjs +1 -1
  27. package/es/VarSelectDialog.js +19 -19
  28. package/es/VarietyAiHelper.cjs +8 -3
  29. package/es/VarietyAiHelper.js +485 -307
  30. package/es/VarietyAutoComplete.cjs +1 -1
  31. package/es/VarietyAutoComplete.js +8 -8
  32. package/es/VarietySearch.cjs +1 -1
  33. package/es/VarietySearch.js +31 -31
  34. package/es/{VarietySelect-639a8d9a.cjs → VarietySelect-7da473c5.cjs} +1 -1
  35. package/es/{VarietySelect-1ac10ec2.js → VarietySelect-b01281d3.js} +3 -3
  36. package/es/VarietyTextCopy.cjs +1 -1
  37. package/es/VarietyTextCopy.js +10 -10
  38. package/es/VirtualTable.cjs +1 -1
  39. package/es/VirtualTable.js +66 -66
  40. package/es/{_initCloneObject-6b8c230e.js → _initCloneObject-6243b839.js} +2 -2
  41. package/es/{_initCloneObject-9eddcb0c.cjs → _initCloneObject-76e116d0.cjs} +1 -1
  42. package/es/aiTools-275c9799.cjs +4 -0
  43. package/es/aiTools-9c59a74a.js +149 -0
  44. package/es/aiTools.js +121 -27
  45. package/es/{config-provider-56193d47.js → config-provider-20b05e99.js} +3 -3
  46. package/es/{config-provider-ea286661.cjs → config-provider-4c784baf.cjs} +1 -1
  47. package/es/{dropdown-f30148cc.cjs → dropdown-33c19e56.cjs} +1 -1
  48. package/es/{dropdown-4e541d60.js → dropdown-f8d9fe56.js} +3 -3
  49. package/es/{el-autocomplete-4b521c83.js → el-autocomplete-3f34a1c3.js} +6 -6
  50. package/es/{el-autocomplete-3949e68c.cjs → el-autocomplete-525ca867.cjs} +1 -1
  51. package/es/{el-button-dd065de0.cjs → el-button-13dc915f.cjs} +1 -1
  52. package/es/{el-button-4f201000.js → el-button-cd144ee1.js} +3 -3
  53. package/es/{el-checkbox-02ce40f0.cjs → el-checkbox-95325acd.cjs} +1 -1
  54. package/es/{el-checkbox-33cb73db.js → el-checkbox-d6c883f4.js} +3 -3
  55. package/es/{el-dialog-6501a151.cjs → el-dialog-4056070b.cjs} +1 -1
  56. package/es/{el-dialog-1939f7c5.js → el-dialog-59a23c2b.js} +4 -4
  57. package/es/{el-form-item-316b35d8.cjs → el-form-item-3475aaad.cjs} +1 -1
  58. package/es/{el-form-item-ea11211d.js → el-form-item-a9556441.js} +5 -5
  59. package/es/{el-input-58786d42.js → el-input-1f14a6e2.js} +33 -33
  60. package/es/{el-input-094afbe2.cjs → el-input-c7bf8e44.cjs} +1 -1
  61. package/es/{el-input-number-a7971697.js → el-input-number-411ac93d.js} +12 -12
  62. package/es/{el-input-number-a609a5e3.cjs → el-input-number-9d810842.cjs} +1 -1
  63. package/es/{el-loading-d171ce64.cjs → el-loading-84dde1a8.cjs} +1 -1
  64. package/es/{el-loading-f3815921.js → el-loading-cbeb3b86.js} +1 -1
  65. package/es/{el-menu-item-3d1e0aff.cjs → el-menu-item-18d7d869.cjs} +1 -1
  66. package/es/{el-menu-item-a166b997.js → el-menu-item-77152904.js} +5 -5
  67. package/es/{el-message-box-f2b667e9.js → el-message-box-a26e3ed4.js} +9 -9
  68. package/es/{el-message-box-b8ffcf34.cjs → el-message-box-e4b8cc99.cjs} +1 -1
  69. package/es/{el-overlay-1dfe3675.js → el-overlay-465cd11e.js} +3 -3
  70. package/es/{el-overlay-a94f8a98.cjs → el-overlay-d26a1b98.cjs} +1 -1
  71. package/es/{el-popconfirm-70e2849c.cjs → el-popconfirm-12f6f35c.cjs} +1 -1
  72. package/es/{el-popconfirm-ca31ceea.js → el-popconfirm-289b3e89.js} +5 -5
  73. package/es/{el-popper-ce575c12.cjs → el-popper-c7648df6.cjs} +1 -1
  74. package/es/{el-popper-db6c599f.js → el-popper-f96fc206.js} +2 -2
  75. package/es/{el-segmented-741f2252.js → el-segmented-598b92b0.js} +2 -2
  76. package/es/{el-segmented-4d50b63f.cjs → el-segmented-f0bce6f2.cjs} +1 -1
  77. package/es/{el-select-086bcb6c.js → el-select-d47b5923.js} +9 -9
  78. package/es/{el-select-2ebc8380.cjs → el-select-f3cc464f.cjs} +1 -1
  79. package/es/{el-table-column-2f07fbdb.cjs → el-table-column-220ae131.cjs} +1 -1
  80. package/es/{el-table-column-8a15378a.js → el-table-column-f1017e75.js} +10 -10
  81. package/es/{el-tag-65a99986.js → el-tag-0a4197f5.js} +2 -2
  82. package/es/{el-tag-f48b1190.cjs → el-tag-51bd491c.cjs} +1 -1
  83. package/es/{el-text-33359f44.cjs → el-text-abf10fdf.cjs} +1 -1
  84. package/es/{el-text-cbb693f2.js → el-text-c3ee80fe.js} +1 -1
  85. package/es/{index-18565979.cjs → index-0986e373.cjs} +1 -1
  86. package/es/{index-4f900527.cjs → index-09ce1753.cjs} +1 -1
  87. package/es/{index-eeae573e.cjs → index-0ff5fe69.cjs} +2 -2
  88. package/es/{index-ca91ac68.js → index-1b97095f.js} +83 -68
  89. package/es/{index-ff26b1a6.js → index-3301d870.js} +2 -2
  90. package/es/{index-1e91e986.js → index-33430c9f.js} +1 -1
  91. package/es/{index-0f767104.cjs → index-3ed7914e.cjs} +1 -1
  92. package/es/index-476c4459.cjs +1 -0
  93. package/es/{index-072c4a65.js → index-499cf989.js} +5 -5
  94. package/es/{index-21e8d2bc.cjs → index-4b95bae1.cjs} +1 -1
  95. package/es/{index-8439d2f9.cjs → index-60c69dd1.cjs} +1 -1
  96. package/es/{index-57d82da0.js → index-67180968.js} +2 -2
  97. package/es/{index-bf98dd03.cjs → index-68798830.cjs} +1 -1
  98. package/es/{index-f2583ae9.js → index-89cc0265.js} +10 -10
  99. package/es/{index-1955f23d.js → index-8e88a0bd.js} +1 -1
  100. package/es/{index-a4e252a0.js → index-a17c90c5.js} +1 -1
  101. package/es/{index-b51915a2.js → index-afc4a1e5.js} +2 -2
  102. package/es/{index-7eb88616.cjs → index-cfcd60ca.cjs} +1 -1
  103. package/es/{index-5b546f7d.cjs → index-d2cfd4a3.cjs} +1 -1
  104. package/es/{index-7db02db7.js → index-d3e9a6f2.js} +2 -2
  105. package/es/{python-86a0735f.js → python-c00abcbd.js} +18 -18
  106. package/es/{python-18d44a7b.cjs → python-e528f42b.cjs} +1 -1
  107. package/es/style.css +1 -1
  108. package/es/{use-form-common-props-00ec25ac.cjs → use-form-common-props-02be4928.cjs} +1 -1
  109. package/es/{use-form-common-props-c14990b9.js → use-form-common-props-dd9617de.js} +12 -12
  110. package/es/{use-global-config-28efb416.cjs → use-global-config-31b3ec57.cjs} +1 -1
  111. package/es/{use-global-config-a01b5ce1.js → use-global-config-4dfc7236.js} +2 -2
  112. package/es/{validator-65de1caf.js → validator-029bfc98.js} +1 -1
  113. package/es/{validator-119fdaf4.cjs → validator-ea292506.cjs} +1 -1
  114. package/es/{zh-cn-9fb29a39.cjs → zh-cn-0edc7234.cjs} +1 -1
  115. package/es/{zh-cn-c1c28e70.js → zh-cn-89e434f9.js} +1 -1
  116. package/lib/aiTools.js +121 -27
  117. package/lib/bundle.js +1 -1
  118. package/lib/bundle.umd.cjs +217 -212
  119. package/lib/{index-8edd5697.js → index-8ba1607b.js} +22647 -22455
  120. package/lib/{python-5c07749c.js → python-16c6e601.js} +1 -1
  121. package/lib/style.css +1 -1
  122. package/package.json +1 -1
  123. package/packages/VarietyAiHelper/index.vue +326 -292
  124. package/public/aiTools.js +121 -27
  125. package/src/App.vue +14 -0
  126. package/es/aiTools-822859d6.cjs +0 -4
  127. package/es/aiTools-9a9c997f.js +0 -149
  128. package/es/index-3792552a.cjs +0 -1
package/es/Kline.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import "./base-29f73b05.js";
2
- import { E as he, a as Ce } from "./el-menu-item-a166b997.js";
2
+ import { E as he, a as Ce } from "./el-menu-item-77152904.js";
3
3
  import "./el-tooltip-4ed993c7.js";
4
- import "./el-popper-db6c599f.js";
4
+ import "./el-popper-f96fc206.js";
5
5
  import { defineComponent as Me, openBlock as h, createElementBlock as k, createElementVNode as K, Fragment as ae, renderList as le, normalizeStyle as ye, toDisplayString as q, ref as S, renderSlot as De, createCommentVNode as xe, nextTick as Ye, computed as W, watch as H, onMounted as de, onUnmounted as ge, createVNode as V, withCtx as X, createBlock as Ae, createTextVNode as Oe, normalizeClass as ke } from "vue";
6
6
  import * as oe from "echarts";
7
7
  import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
8
8
  import { x as re } from "./index-7ed0999e.js";
9
9
  import { i as ve, t as be } from "./index.esm-8d9a2abe.js";
10
- import "./el-tag-65a99986.js";
11
- import { E as Ee, a as Se } from "./el-select-086bcb6c.js";
10
+ import "./el-tag-0a4197f5.js";
11
+ import { E as Ee, a as Se } from "./el-select-d47b5923.js";
12
12
  import "./el-scrollbar-323542e7.js";
13
- import "./use-form-common-props-c14990b9.js";
13
+ import "./use-form-common-props-dd9617de.js";
14
14
  import "./index-8391a3df.js";
15
- import "./index-ca91ac68.js";
16
- import "./index-1955f23d.js";
15
+ import "./index-1b97095f.js";
16
+ import "./index-8e88a0bd.js";
17
17
  import "./index-657047bb.js";
18
18
  import "./typescript-7ae59c4c.js";
19
19
  import "./vnode-a83e6de8.js";
20
- import "./index-1e91e986.js";
20
+ import "./index-33430c9f.js";
21
21
  import "./index-de24705f.js";
22
- import "./index-57d82da0.js";
23
- import "./index-b51915a2.js";
22
+ import "./index-67180968.js";
23
+ import "./index-afc4a1e5.js";
24
24
  import "./castArray-609a313e.js";
25
- import "./index-7db02db7.js";
25
+ import "./index-d3e9a6f2.js";
26
26
  import "./scroll-6799bafc.js";
27
27
  import "./debounce-a09ce9a3.js";
28
28
  const Fe = { class: "st-kline-tips" }, Qe = { class: "st-kline-tips-row" }, _e = /* @__PURE__ */ Me({
package/es/KlineBasic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";require("./base-ef747d02.cjs");const ke=require("./el-dialog-6501a151.cjs");require("./el-overlay-a94f8a98.cjs");require("./el-input-094afbe2.cjs");const we=require("./el-input-number-a609a5e3.cjs"),Ye=require("./el-button-dd065de0.cjs"),De=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-3d1e0aff.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-ce575c12.cjs");const e=require("vue"),B=require("./dayjs.min-2c20abe6.cjs"),Se=require("echarts"),q=require("./index-8901a38c.cjs");require("./el-message-0ea8fbf8.cjs");const J=require("./index-21e8d2bc.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-f48b1190.cjs");const se=require("./el-select-2ebc8380.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-bf98dd03.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-00ec25ac.cjs");require("./index-3792552a.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-28efb416.cjs");require("./index-7eb88616.cjs");require("./typescript-b63f8e83.cjs");require("./index-4f900527.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-ea286661.cjs");require("./index-5b546f7d.cjs");require("./index-8439d2f9.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ve(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>n[b]})}}return w.default=n,Object.freeze(w)}const oe=Ve(Se);let z=null;const Me=n=>{const w=q.y(n,{handleReq:b=>{q.v()&&(b.headers.token=q.U())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:q.K(),!0}});w.get,z=w.post},Le=n=>z("/middleLayer/kline/getKlineBasic",{...n,userId:q.V("id")}),Be=n=>z("/middleLayer/kline/getKline",n),Fe=async n=>z("/alarm/deliversign/addAlarmPrice",{...n,userId:q.V("id")}),qe=async n=>z("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:q.V("id")}),ce=async n=>z("/alarm/deliversign/updateAlarmPrice",{...n,userId:q.V("id")}),Ne=async n=>z("/alarm/deliversign/deleteAlarmPrice",{...n,userId:q.V("id")}),{round:C}=q.x,Ae=(n,w,b,r,s)=>{const{data:t,time:y}=n,{gridTop:u,gridRight:f,gridLeft:p,maxShowCounts:g,showSubChart:D}=w;return{animation:!1,grid:{top:`${u}px`,right:`${f}px`,bottom:D?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:r,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:l=>{const{axisDimension:m,value:k}=l;return m==="x"?D?"":["6","7","8"].includes(s)?B.dayjs(k).format("YYYY-MM-DD"):k:String(C(k))}}},formatter:()=>""},xAxis:{show:!D,type:"category",data:y,splitLine:{show:!1},axisLabel:{formatter:l=>["6","7","8"].includes(s)?B.dayjs(l).format("YYYY-MM-DD"):l}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:l=>C(l.min),max:l=>C(l.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(l=>({name:l.key,type:"line",silent:!0,symbol:"none",data:l.data,lineStyle:{width:l.width||1},itemStyle:{color:l.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)"}}}},Ee=(n,w,b,r,s)=>{const{variety:t,featureId:y,featureType:u}=b,{gridTop:f,gridLeft:p,gridRight:g}=r;return w.reduce((D,l)=>{const{warnPrice:m}=l,k=n==null?void 0:n.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(n==null?void 0:n.getHeight()))return D;let L=0;return[...D,{type:"group",name:"warningLine",info:l,draggable:"vertical",children:[{type:"line",info:l,shape:{x1:p,y1:k,x2:(n==null?void 0:n.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(n==null?void 0:n.getWidth())-g,y:k-5,style:{fill:"#FFF",text:m,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:S=>{L=S.offsetY},ondrag:S=>{var N;if(S.target&&S.target.childAt(1)){const E=n.convertFromPixel({yAxisIndex:0},k+(S.offsetY-L));(N=S.target.childAt(1))==null||N.animate("style",!1).when(1,{text:C(E,3)}).start()}},ondragend:async S=>{const E=S.offsetY-L;if(E!==0){const A=n==null?void 0:n.convertFromPixel({yAxisIndex:0},E+k),F={id:l.id,warnPrice:C(A,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(n){function w(r){if(typeof r=="number")return Number.isFinite(r)?r:null;if(typeof r=="string"){const s=r.trim();if(s==="")return null;const t=Number(s);return Number.isFinite(t)?t:null}return null}const b=w(n);if(b===null)return"-";try{if(b>=1||b<=-1)return C(b);{const r=b.toPrecision(3);return C(r,r.split(".")[1].length-1)}}catch{return"-"}}const Te=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const w=n,b=e.ref(null),r=e.ref([]);return e.watch(()=>w.data,()=>{r.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((s,t)=>{var y,u,f,p,g,D,l,m;((u=(y=w.data)==null?void 0:y[t])==null?void 0:u.label)==="涨跌"?r.value[t]="85px":((p=(f=w.data)==null?void 0:f[t])==null?void 0:p.label)==="至今涨幅"?r.value[t]="115px":((D=(g=w.data)==null?void 0:g[t])==null?void 0:D.label)==="额"?r.value[t]="85px":["开","高","低","收"].includes((m=(l=w.data)==null?void 0:l[t])==null?void 0:m.label)?r.value[t]=`${s.offsetWidth+24}px`:r.value[t]=`${s.offsetWidth+36}px`})})}),(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(y,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-tips-item",style:e.normalizeStyle({color:y.color,width:r.value[u]?r.value[u]:null})},e.toDisplayString(y.label)+" "+e.toDisplayString(y.value),5))),128))],512))}});const ue=U._export_sfc(Te,[["__scopeId","data-v-096c0d10"]]);const Re={class:"kline-tips"},Oe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:w,formatValue:b}=q.x,r=n,s=e.ref(null);e.watch(()=>r.activeIndex,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.data,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.variety,()=>{s.value=null});const t=e.computed(()=>{const{data:u,activeIndex:f}=r;if(u.data&&u.data[f]){const p=u.data[f],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let D;p[6]>0?D="red":p[6]<0&&(D="green"),g.push({label:"涨跌",value:`${w(p[6])}%`,color:D});const l=(s.value/p[1]-1)*100;let m;return l>0?m="red":l<0&&(m="green"),g.push({label:"至今涨幅",value:`${w(l)}%`,color:m}),g}return[]}),y=e.computed(()=>{var p;const{data:u,activeIndex:f}=r;return((p=u==null?void 0:u.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:de(g.data[f]),color:g.color})))||[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},Ie=U._export_sfc(Oe,[["__scopeId","data-v-832d18ff"]]),$e={class:"kline-averageTips"},je=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(w,b)=>(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"kline-averageTips-item",style:e.normalizeStyle({color:r.color})},e.toDisplayString(r.label)+" "+e.toDisplayString(r.value),5))),128))]))}});const Pe=U._export_sfc(je,[["__scopeId","data-v-2ce54548"]]);const We={class:"klineSub"},Ce={class:"klineSub-tips"},ze={key:0,class:"klineSub-tips-select"},Ze={__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(n,{expose:w,emit:b}){const{round:r}=q.x;let s=null,t=null;const y=e.ref(!0),u=b,f=n,p=e.ref(),g=e.computed({get(){return f.modelValue},set(m){u("update:modelValue",m)}}),D=e.computed(()=>{var L;if(!y.value)return[];const{data:m,activeIndex:k}=f;return((L=m==null?void 0:m.subIndicator)==null?void 0:L.map(S=>({label:S.key,color:S.color,value:de(S.data[k])})))||[]});e.onMounted(()=>{if(y.value=!0,!p.value)return;s=oe.init(p.value);let m=!0;t=new ResizeObserver(()=>{if(m){m=!1;return}y.value&&s&&!s.isDisposed()&&s.resize()}),t.observe(p.value)}),e.onUnmounted(()=>{y.value=!1,s&&!s.isDisposed()&&(s.dispose(),s=null),t&&(t.disconnect(),t=null)});const l=(m,k)=>{const L=m[k],S=k===0?m[k]:m[k-1];return L[0]===L[1]?L[0]>=S[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:L[1]>L[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return w({connect:m=>{!y.value||!s||s.isDisposed()||oe.connect([m,s])},draw:(m,k)=>{!y.value||!s||s.isDisposed()||e.nextTick(()=>{if(!y.value||!s||s.isDisposed())return;const{startValue:L,endValue:S,maxValueSpan:N}=m,{leftYAxisRange:E,rightYAxisRange:A}=f.data.subIndicator[0],F=f.data.subIndicator.map(_=>{if(_.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:_.data.map((O,$)=>_.seriesColor==="kline"?{value:O,itemStyle:l(f.data.data,$)}:_.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:_.seriesColor}})};if(_.series==="line")return{xAxisIndex:0,yAxisIndex:_.yAxis==="right"?2:1,name:_.key,type:"line",silent:!0,symbol:"none",data:_.data,lineStyle:{width:1},itemStyle:{color:_.color}}});s.setOption({animation:!1,grid:{left:`${k.gridLeft}px`,top:"10px",right:`${k.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:L,endValue:S,maxValueSpan:N}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:_=>{const{axisDimension:O,value:$}=_;if(O==="x")return["6","7","8"].includes(f.cycle)?B.dayjs($).format("YYYY-MM-DD"):$;if(_.axisIndex===1)return String(r($))}}},formatter:()=>""},xAxis:{type:"category",data:f.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:_=>["6","7","8"].includes(f.cycle)?B.dayjs(_).format("YYYY-MM-DD"):_}},yAxis:[{position:"right"},{position:"left",min:E==="cover"?_=>_.min:null,max:E==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:A==="cover"?_=>_.min:null,max:A==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(m,k)=>{const L=se.ElOption,S=se.ElSelect;return e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Ce,[D.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(S,{modelValue:g.value,"onUpdate:modelValue":k[0]||(k[0]=N=>g.value=N),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.subIndicatorList,N=>(e.openBlock(),e.createBlock(L,{key:N.value,label:N.label,value:N.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Pe,{data:D.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:p},null,512)])}}},Ue=U._export_sfc(Ze,[["__scopeId","data-v-d720c2c7"]]),He=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:w}){const b=w,r=e.ref(),s=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),y=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",y)},u=f=>{if(f.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=f,{offsetWidth:D,offsetHeight:l}=s.value;if(p<=D&&g<=l)return}r.value.click(),t.value={display:"block",top:`${f.offsetY}px`,left:`${f.offsetX}px`},e.nextTick(()=>{const p=r.value.getBoundingClientRect(),g=s.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${f.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${f.offsetY-g.height}px`)}),document.addEventListener("click",y)};return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:r,class:"contextmenu",onContextmenu:u,onMouseleave:y},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:s,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(f.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Ke=U._export_sfc(He,[["__scopeId","data-v-811db6b4"]]);const fe=n=>(e.pushScopeId("data-v-dbb75956"),n=n(),e.popScopeId(),n),Ge={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Je={key:2,class:"klineBasic-empty"},Qe={key:3,class:"klineBasic-error"},et=fe(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),tt={style:{"text-align":"center"}},nt=fe(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),ot={class:"dialog-footer"},at={__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(n,{expose:w,emit:b}){const r=[{label:"画线预警",key:"drawWarningLine"}];let s=null,t=null,y=null,u=null,f=null,p=!1,g=!1;const D=b,l=n,m=e.ref(!1),k=e.ref(!1),L=e.ref(!1),S=e.ref(null),N=e.ref(null),E=e.ref("VOL"),A=e.ref(0),F=e.ref({}),_=e.ref([]),O=e.ref({}),$=e.ref(!1),G=e.ref(""),Q=e.ref([...r]),I=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),pe=()=>{t||(t=oe.init(S.value),xe(),I.value.showSubChart&&N.value.connect(t),s=q.D(S.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(o=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{me(o),y=requestAnimationFrame(()=>{ye(),y=requestAnimationFrame(()=>{H(),y=null})})})},me=(o=!1)=>{var c,V,Y;if(!t||t.isDisposed())return;const{time:a}=F.value,{defaultShowCounts:v}=I.value;let d=a.length-1-v,x=a.length-1;if(o&&t){const M=t.getOption(),h=(V=(c=M==null?void 0:M.xAxis)==null?void 0:c[0])==null?void 0:V.data,T=(Y=M==null?void 0:M.dataZoom)==null?void 0:Y[0];if(h!=null&&h.length&&T){const P=h[T.startValue],W=h[T.endValue];if(P&&W){const ne=a.findIndex(K=>new Date(K).getTime()>=new Date(P).getTime()),Z=a.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=Z!==-1?Z:a.length-1,d>x&&(d=Math.max(0,x-Math.min(100,a.length-1)))}}}const i=Ae(F.value,I.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),A.value=x,requestAnimationFrame(()=>{ve()})})},ye=()=>{var V;if(!I.value.showSubChart||!N.value)return;const{time:o}=F.value,{gridLeft:a,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=I.value;let i=o.length-1-x,c=o.length-1;if(t&&!t.isDisposed()){const Y=t.getOption();if((V=Y==null?void 0:Y.dataZoom)!=null&&V[0]){const{startValue:M,endValue:h}=Y.dataZoom[0];M!==void 0&&h!==void 0&&(i=M,c=h)}}requestAnimationFrame(()=>{var Y;(Y=N.value)==null||Y.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:a,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const a=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!a||!v||(t==null||t.setOption({graphic:Ee(t,_.value,l,I.value,()=>{X()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ve=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:o}=F.value;if(!l.brushRange||!(o!=null&&o.length)||!t)return;let a=B.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),v=B.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),d=null,x=null;switch(String(l.cycle)){case"6":{d=o.find(i=>B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(a).format("YYYY-MM-DD")),x=d;break}case"7":{d=o.find(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(a).day(5).format("YYYY-MM-DD")),x=o.findLast(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=o.find(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(a).endOf("month").format("YYYY-MM-DD")),x=o.findLast(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=o.find(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(a).format("YYYY-MM-DD"),V=new Date(i).getTime()>=new Date(a).getTime();return c&&V}),x=o.findLast(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(v).format("YYYY-MM-DD"),V=new Date(i).getTime()<=new Date(v).getTime();return c&&V})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var o,a,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:V,cycle:Y,indicatorStore:M,mainIndicator:h,right:T,startTime:P,endTime:W}=l,{defaultShowCounts:ne,addCounts:Z,showWarningLine:K,getFactorData:re}=I.value;pe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const j={variety:c,featureId:V,cycle:Y,mainIndicatorList:M.getIndicatorParams(h),subIndicator:E.value,right:T,showWarningLine:K,getFactorData:re};P&&W?(j.startTime=P,j.endTime=W):P?(j.startTime=P,j.limit=Z):W?(j.endTime=W,j.limit=Z):(j.endTime=B.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),j.limit=Z);const R=await Le(j);if(!((v=(a=(o=R==null?void 0:R.body)==null?void 0:o.kline)==null?void 0:a.time)!=null&&v.length)){k.value=!0,L.value=!1,ee();return}k.value=!1,L.value=!1,F.value=(d=R==null?void 0:R.body)==null?void 0:d.kline,_.value=((x=R==null?void 0:R.body)==null?void 0:x.warningLine)||[],await e.nextTick(),ae(!1),re&&D("getFactorData",(i=R==null?void 0:R.body)==null?void 0:i.factor),ee()}catch(c){throw ee(),L.value=!0,k.value=!1,new Error(c)}},ge=async o=>{const{variety:a,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=I.value,{time:V}=F.value;if(o==="history"){const Y=await Be({variety:a,cycle:v,endTime:V[0],limit:c,mainIndicatorList:d.getIndicatorParams(x),subIndicator:E.value,right:i});F.value={time:[...Y.body.time,...F.value.time.slice(1)],data:[...Y.body.data,...F.value.data.slice(1)],mainIndicator:F.value.mainIndicator.map((M,h)=>{var T;return{...M,data:[...((T=Y.body.mainIndicator[h])==null?void 0:T.data)??[],...M.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((M,h)=>{var T;return{...M,data:[...((T=Y.body.subIndicator[h])==null?void 0:T.data)??[],...M.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),Y.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:o,ctrlKey:a})=>{if(!(a||m.value))return;const{xAxis:v,dataZoom:d}=t.getOption(),{data:x}=(v==null?void 0:v[0])??{data:[]};let{startValue:i,endValue:c}=(d==null?void 0:d[0])??{};if(x!=null&&x.length){switch(o){case"ArrowUp":{if(c-i<5)return;const V=Math.floor((c-i)/2)+1;i=i+V,c-i<5&&(i=c-4);break}case"ArrowDown":{const V=Math.min(500,c-i);i=i-V-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),A.value>0&&(A.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&A.value<x.length-1&&(A.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?A.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?A.value:c})})}},xe=()=>{t==null||t.on("datazoom",q.G(o=>{var v,d,x,i;const{loadCheckCounts:a}=I.value;if((d=(v=t==null?void 0:t.getOption())==null?void 0:v.dataZoom)!=null&&d[0]){const{startValue:c}=(i=(x=t==null?void 0:t.getOption())==null?void 0:x.dataZoom)==null?void 0:i[0];c<a&&!p&&!g&&(p=!0,ge("history")),H()}},100)),t==null||t.on("highlight",q.G(o=>{var v,d;let a=o.dataIndex||-1;o.batch&&(a=typeof((v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex)=="number"?(d=o==null?void 0:o.batch[0])==null?void 0:d.dataIndex:-1),A.value=a},20)),t==null||t.on("globalout",q.G(()=>{var o,a,v;if(t){const d=(v=(a=(o=t==null?void 0:t.getOption())==null?void 0:o.dataZoom)==null?void 0:a[0])==null?void 0:v.endValue;A.value=d}},30)),t==null||t.on("contextmenu",q.G(o=>{o.componentType==="graphic"&&(O.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},X=async()=>{const o=await qe({featureId:l.featureId});_.value=(o==null?void 0:o.body)||[],H(),D("change","warningLine",_.value)},be=async o=>{const{variety:a,varietyName:v,featureId:d,featureType:x}=l;if(o.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:()=>""}}}});const V=async Y=>{t==null||t.getZr().off("mousedown",V);const M=t==null?void 0:t.convertFromPixel({yAxisIndex:0},Y.offsetY),h=Math.round(M*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Fe({featureCode:a,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",V)}else o.key==="deleteWarningLine"?(await Ne({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):o.key==="changeWarningLine"&&($.value=!0,G.value=O.value.warnPrice)},_e=async()=>{const{variety:o,varietyName:a,featureId:v,featureType:d}=l;await ce({id:O.value.id,featureCode:o,featureName:a,featureId:v,featureType:d,warnPrice:G.value}),J.ElMessage.success("画线预警修改成功"),X()},he=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var o,a;return[l.variety,l.cycle,l.mainIndicator,E.value,(o=l.indicatorStore)==null?void 0:o.filterIndicator,(a=l.indicatorStore)==null?void 0:a.customIndicator]},()=>{p=!1,g=!1,te()},{deep:!0}),e.onUnmounted(()=>{y&&(cancelAnimationFrame(y),y=null),u&&(cancelAnimationFrame(u),u=null),t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),s==null||s.dispose(),window.removeEventListener("keydown",le)}),w({draw:(o,a)=>{o==="warningLine"&&(_.value=a,H())}}),(o,a)=>{var Y,M;const v=ie.ElMenuItem,d=ie.ElMenu,x=De.ElEmpty,i=Ye.ElButton,c=we.ElInputNumber,V=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:a[1]||(a[1]=h=>m.value=!0),onMouseout:a[2]||(a[2]=h=>m.value=!1)},[(Y=F.value.time)!=null&&Y.length?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(Ie,{variety:n.variety,data:F.value,activeIndex:A.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:I.value.showSubChart?"70%":"100%"})},[e.createVNode(Ke,{onCloseContextMenuCallBack:he},{popover:e.withCtx(()=>[e.createVNode(d,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,h=>(e.openBlock(),e.createBlock(v,{style:{height:"36px"},key:h.key,index:h.key,onClick:T=>be(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:S,style:{height:"100%"}},null,512)]),_:1})],4),I.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:N,modelValue:E.value,"onUpdate:modelValue":a[0]||(a[0]=h=>E.value=h),data:F.value,cycle:n.cycle,activeIndex:A.value,subIndicatorList:(M=n.indicatorStore)==null?void 0:M.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",Qe,[et,e.createElementVNode("div",tt,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(V,{modelValue:$.value,"onUpdate:modelValue":a[5]||(a[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",ot,[e.createVNode(i,{onClick:a[4]||(a[4]=h=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:_e},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[nt,e.createVNode(c,{modelValue:G.value,"onUpdate:modelValue":a[3]||(a[3]=h=>G.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},lt=U._export_sfc(at,[["__scopeId","data-v-dbb75956"]]),rt={install(n){n.component("st-klineBasic",lt)}};module.exports=rt;
1
+ "use strict";require("./base-ef747d02.cjs");const ke=require("./el-dialog-4056070b.cjs");require("./el-overlay-d26a1b98.cjs");require("./el-input-c7bf8e44.cjs");const we=require("./el-input-number-9d810842.cjs"),Ye=require("./el-button-13dc915f.cjs"),De=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-18d7d869.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-c7648df6.cjs");const e=require("vue"),B=require("./dayjs.min-2c20abe6.cjs"),Se=require("echarts"),q=require("./index-8901a38c.cjs");require("./el-message-0ea8fbf8.cjs");const J=require("./index-4b95bae1.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-51bd491c.cjs");const se=require("./el-select-f3cc464f.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-68798830.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-02be4928.cjs");require("./index-476c4459.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-31b3ec57.cjs");require("./index-cfcd60ca.cjs");require("./typescript-b63f8e83.cjs");require("./index-09ce1753.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-4c784baf.cjs");require("./index-d2cfd4a3.cjs");require("./index-60c69dd1.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ve(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>n[b]})}}return w.default=n,Object.freeze(w)}const oe=Ve(Se);let z=null;const Me=n=>{const w=q.y(n,{handleReq:b=>{q.v()&&(b.headers.token=q.U())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:q.K(),!0}});w.get,z=w.post},Le=n=>z("/middleLayer/kline/getKlineBasic",{...n,userId:q.V("id")}),Be=n=>z("/middleLayer/kline/getKline",n),Fe=async n=>z("/alarm/deliversign/addAlarmPrice",{...n,userId:q.V("id")}),qe=async n=>z("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:q.V("id")}),ce=async n=>z("/alarm/deliversign/updateAlarmPrice",{...n,userId:q.V("id")}),Ne=async n=>z("/alarm/deliversign/deleteAlarmPrice",{...n,userId:q.V("id")}),{round:C}=q.x,Ae=(n,w,b,r,s)=>{const{data:t,time:y}=n,{gridTop:u,gridRight:f,gridLeft:p,maxShowCounts:g,showSubChart:D}=w;return{animation:!1,grid:{top:`${u}px`,right:`${f}px`,bottom:D?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:r,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:l=>{const{axisDimension:m,value:k}=l;return m==="x"?D?"":["6","7","8"].includes(s)?B.dayjs(k).format("YYYY-MM-DD"):k:String(C(k))}}},formatter:()=>""},xAxis:{show:!D,type:"category",data:y,splitLine:{show:!1},axisLabel:{formatter:l=>["6","7","8"].includes(s)?B.dayjs(l).format("YYYY-MM-DD"):l}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:l=>C(l.min),max:l=>C(l.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(l=>({name:l.key,type:"line",silent:!0,symbol:"none",data:l.data,lineStyle:{width:l.width||1},itemStyle:{color:l.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)"}}}},Ee=(n,w,b,r,s)=>{const{variety:t,featureId:y,featureType:u}=b,{gridTop:f,gridLeft:p,gridRight:g}=r;return w.reduce((D,l)=>{const{warnPrice:m}=l,k=n==null?void 0:n.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(n==null?void 0:n.getHeight()))return D;let L=0;return[...D,{type:"group",name:"warningLine",info:l,draggable:"vertical",children:[{type:"line",info:l,shape:{x1:p,y1:k,x2:(n==null?void 0:n.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(n==null?void 0:n.getWidth())-g,y:k-5,style:{fill:"#FFF",text:m,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:S=>{L=S.offsetY},ondrag:S=>{var N;if(S.target&&S.target.childAt(1)){const E=n.convertFromPixel({yAxisIndex:0},k+(S.offsetY-L));(N=S.target.childAt(1))==null||N.animate("style",!1).when(1,{text:C(E,3)}).start()}},ondragend:async S=>{const E=S.offsetY-L;if(E!==0){const A=n==null?void 0:n.convertFromPixel({yAxisIndex:0},E+k),F={id:l.id,warnPrice:C(A,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(n){function w(r){if(typeof r=="number")return Number.isFinite(r)?r:null;if(typeof r=="string"){const s=r.trim();if(s==="")return null;const t=Number(s);return Number.isFinite(t)?t:null}return null}const b=w(n);if(b===null)return"-";try{if(b>=1||b<=-1)return C(b);{const r=b.toPrecision(3);return C(r,r.split(".")[1].length-1)}}catch{return"-"}}const Te=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const w=n,b=e.ref(null),r=e.ref([]);return e.watch(()=>w.data,()=>{r.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((s,t)=>{var y,u,f,p,g,D,l,m;((u=(y=w.data)==null?void 0:y[t])==null?void 0:u.label)==="涨跌"?r.value[t]="85px":((p=(f=w.data)==null?void 0:f[t])==null?void 0:p.label)==="至今涨幅"?r.value[t]="115px":((D=(g=w.data)==null?void 0:g[t])==null?void 0:D.label)==="额"?r.value[t]="85px":["开","高","低","收"].includes((m=(l=w.data)==null?void 0:l[t])==null?void 0:m.label)?r.value[t]=`${s.offsetWidth+24}px`:r.value[t]=`${s.offsetWidth+36}px`})})}),(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(y,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-tips-item",style:e.normalizeStyle({color:y.color,width:r.value[u]?r.value[u]:null})},e.toDisplayString(y.label)+" "+e.toDisplayString(y.value),5))),128))],512))}});const ue=U._export_sfc(Te,[["__scopeId","data-v-096c0d10"]]);const Re={class:"kline-tips"},Oe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:w,formatValue:b}=q.x,r=n,s=e.ref(null);e.watch(()=>r.activeIndex,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.data,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.variety,()=>{s.value=null});const t=e.computed(()=>{const{data:u,activeIndex:f}=r;if(u.data&&u.data[f]){const p=u.data[f],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let D;p[6]>0?D="red":p[6]<0&&(D="green"),g.push({label:"涨跌",value:`${w(p[6])}%`,color:D});const l=(s.value/p[1]-1)*100;let m;return l>0?m="red":l<0&&(m="green"),g.push({label:"至今涨幅",value:`${w(l)}%`,color:m}),g}return[]}),y=e.computed(()=>{var p;const{data:u,activeIndex:f}=r;return((p=u==null?void 0:u.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:de(g.data[f]),color:g.color})))||[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},Ie=U._export_sfc(Oe,[["__scopeId","data-v-832d18ff"]]),$e={class:"kline-averageTips"},je=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(w,b)=>(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"kline-averageTips-item",style:e.normalizeStyle({color:r.color})},e.toDisplayString(r.label)+" "+e.toDisplayString(r.value),5))),128))]))}});const Pe=U._export_sfc(je,[["__scopeId","data-v-2ce54548"]]);const We={class:"klineSub"},Ce={class:"klineSub-tips"},ze={key:0,class:"klineSub-tips-select"},Ze={__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(n,{expose:w,emit:b}){const{round:r}=q.x;let s=null,t=null;const y=e.ref(!0),u=b,f=n,p=e.ref(),g=e.computed({get(){return f.modelValue},set(m){u("update:modelValue",m)}}),D=e.computed(()=>{var L;if(!y.value)return[];const{data:m,activeIndex:k}=f;return((L=m==null?void 0:m.subIndicator)==null?void 0:L.map(S=>({label:S.key,color:S.color,value:de(S.data[k])})))||[]});e.onMounted(()=>{if(y.value=!0,!p.value)return;s=oe.init(p.value);let m=!0;t=new ResizeObserver(()=>{if(m){m=!1;return}y.value&&s&&!s.isDisposed()&&s.resize()}),t.observe(p.value)}),e.onUnmounted(()=>{y.value=!1,s&&!s.isDisposed()&&(s.dispose(),s=null),t&&(t.disconnect(),t=null)});const l=(m,k)=>{const L=m[k],S=k===0?m[k]:m[k-1];return L[0]===L[1]?L[0]>=S[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:L[1]>L[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return w({connect:m=>{!y.value||!s||s.isDisposed()||oe.connect([m,s])},draw:(m,k)=>{!y.value||!s||s.isDisposed()||e.nextTick(()=>{if(!y.value||!s||s.isDisposed())return;const{startValue:L,endValue:S,maxValueSpan:N}=m,{leftYAxisRange:E,rightYAxisRange:A}=f.data.subIndicator[0],F=f.data.subIndicator.map(_=>{if(_.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:_.data.map((O,$)=>_.seriesColor==="kline"?{value:O,itemStyle:l(f.data.data,$)}:_.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:_.seriesColor}})};if(_.series==="line")return{xAxisIndex:0,yAxisIndex:_.yAxis==="right"?2:1,name:_.key,type:"line",silent:!0,symbol:"none",data:_.data,lineStyle:{width:1},itemStyle:{color:_.color}}});s.setOption({animation:!1,grid:{left:`${k.gridLeft}px`,top:"10px",right:`${k.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:L,endValue:S,maxValueSpan:N}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:_=>{const{axisDimension:O,value:$}=_;if(O==="x")return["6","7","8"].includes(f.cycle)?B.dayjs($).format("YYYY-MM-DD"):$;if(_.axisIndex===1)return String(r($))}}},formatter:()=>""},xAxis:{type:"category",data:f.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:_=>["6","7","8"].includes(f.cycle)?B.dayjs(_).format("YYYY-MM-DD"):_}},yAxis:[{position:"right"},{position:"left",min:E==="cover"?_=>_.min:null,max:E==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:A==="cover"?_=>_.min:null,max:A==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(m,k)=>{const L=se.ElOption,S=se.ElSelect;return e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Ce,[D.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(S,{modelValue:g.value,"onUpdate:modelValue":k[0]||(k[0]=N=>g.value=N),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.subIndicatorList,N=>(e.openBlock(),e.createBlock(L,{key:N.value,label:N.label,value:N.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Pe,{data:D.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:p},null,512)])}}},Ue=U._export_sfc(Ze,[["__scopeId","data-v-d720c2c7"]]),He=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:w}){const b=w,r=e.ref(),s=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),y=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",y)},u=f=>{if(f.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=f,{offsetWidth:D,offsetHeight:l}=s.value;if(p<=D&&g<=l)return}r.value.click(),t.value={display:"block",top:`${f.offsetY}px`,left:`${f.offsetX}px`},e.nextTick(()=>{const p=r.value.getBoundingClientRect(),g=s.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${f.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${f.offsetY-g.height}px`)}),document.addEventListener("click",y)};return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:r,class:"contextmenu",onContextmenu:u,onMouseleave:y},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:s,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(f.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Ke=U._export_sfc(He,[["__scopeId","data-v-811db6b4"]]);const fe=n=>(e.pushScopeId("data-v-dbb75956"),n=n(),e.popScopeId(),n),Ge={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Je={key:2,class:"klineBasic-empty"},Qe={key:3,class:"klineBasic-error"},et=fe(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),tt={style:{"text-align":"center"}},nt=fe(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),ot={class:"dialog-footer"},at={__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(n,{expose:w,emit:b}){const r=[{label:"画线预警",key:"drawWarningLine"}];let s=null,t=null,y=null,u=null,f=null,p=!1,g=!1;const D=b,l=n,m=e.ref(!1),k=e.ref(!1),L=e.ref(!1),S=e.ref(null),N=e.ref(null),E=e.ref("VOL"),A=e.ref(0),F=e.ref({}),_=e.ref([]),O=e.ref({}),$=e.ref(!1),G=e.ref(""),Q=e.ref([...r]),I=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),pe=()=>{t||(t=oe.init(S.value),xe(),I.value.showSubChart&&N.value.connect(t),s=q.D(S.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(o=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{me(o),y=requestAnimationFrame(()=>{ye(),y=requestAnimationFrame(()=>{H(),y=null})})})},me=(o=!1)=>{var c,V,Y;if(!t||t.isDisposed())return;const{time:a}=F.value,{defaultShowCounts:v}=I.value;let d=a.length-1-v,x=a.length-1;if(o&&t){const M=t.getOption(),h=(V=(c=M==null?void 0:M.xAxis)==null?void 0:c[0])==null?void 0:V.data,T=(Y=M==null?void 0:M.dataZoom)==null?void 0:Y[0];if(h!=null&&h.length&&T){const P=h[T.startValue],W=h[T.endValue];if(P&&W){const ne=a.findIndex(K=>new Date(K).getTime()>=new Date(P).getTime()),Z=a.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=Z!==-1?Z:a.length-1,d>x&&(d=Math.max(0,x-Math.min(100,a.length-1)))}}}const i=Ae(F.value,I.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),A.value=x,requestAnimationFrame(()=>{ve()})})},ye=()=>{var V;if(!I.value.showSubChart||!N.value)return;const{time:o}=F.value,{gridLeft:a,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=I.value;let i=o.length-1-x,c=o.length-1;if(t&&!t.isDisposed()){const Y=t.getOption();if((V=Y==null?void 0:Y.dataZoom)!=null&&V[0]){const{startValue:M,endValue:h}=Y.dataZoom[0];M!==void 0&&h!==void 0&&(i=M,c=h)}}requestAnimationFrame(()=>{var Y;(Y=N.value)==null||Y.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:a,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const a=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!a||!v||(t==null||t.setOption({graphic:Ee(t,_.value,l,I.value,()=>{X()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ve=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:o}=F.value;if(!l.brushRange||!(o!=null&&o.length)||!t)return;let a=B.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),v=B.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),d=null,x=null;switch(String(l.cycle)){case"6":{d=o.find(i=>B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(a).format("YYYY-MM-DD")),x=d;break}case"7":{d=o.find(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(a).day(5).format("YYYY-MM-DD")),x=o.findLast(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=o.find(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(a).endOf("month").format("YYYY-MM-DD")),x=o.findLast(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=o.find(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(a).format("YYYY-MM-DD"),V=new Date(i).getTime()>=new Date(a).getTime();return c&&V}),x=o.findLast(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(v).format("YYYY-MM-DD"),V=new Date(i).getTime()<=new Date(v).getTime();return c&&V})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var o,a,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:V,cycle:Y,indicatorStore:M,mainIndicator:h,right:T,startTime:P,endTime:W}=l,{defaultShowCounts:ne,addCounts:Z,showWarningLine:K,getFactorData:re}=I.value;pe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const j={variety:c,featureId:V,cycle:Y,mainIndicatorList:M.getIndicatorParams(h),subIndicator:E.value,right:T,showWarningLine:K,getFactorData:re};P&&W?(j.startTime=P,j.endTime=W):P?(j.startTime=P,j.limit=Z):W?(j.endTime=W,j.limit=Z):(j.endTime=B.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),j.limit=Z);const R=await Le(j);if(!((v=(a=(o=R==null?void 0:R.body)==null?void 0:o.kline)==null?void 0:a.time)!=null&&v.length)){k.value=!0,L.value=!1,ee();return}k.value=!1,L.value=!1,F.value=(d=R==null?void 0:R.body)==null?void 0:d.kline,_.value=((x=R==null?void 0:R.body)==null?void 0:x.warningLine)||[],await e.nextTick(),ae(!1),re&&D("getFactorData",(i=R==null?void 0:R.body)==null?void 0:i.factor),ee()}catch(c){throw ee(),L.value=!0,k.value=!1,new Error(c)}},ge=async o=>{const{variety:a,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=I.value,{time:V}=F.value;if(o==="history"){const Y=await Be({variety:a,cycle:v,endTime:V[0],limit:c,mainIndicatorList:d.getIndicatorParams(x),subIndicator:E.value,right:i});F.value={time:[...Y.body.time,...F.value.time.slice(1)],data:[...Y.body.data,...F.value.data.slice(1)],mainIndicator:F.value.mainIndicator.map((M,h)=>{var T;return{...M,data:[...((T=Y.body.mainIndicator[h])==null?void 0:T.data)??[],...M.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((M,h)=>{var T;return{...M,data:[...((T=Y.body.subIndicator[h])==null?void 0:T.data)??[],...M.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),Y.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:o,ctrlKey:a})=>{if(!(a||m.value))return;const{xAxis:v,dataZoom:d}=t.getOption(),{data:x}=(v==null?void 0:v[0])??{data:[]};let{startValue:i,endValue:c}=(d==null?void 0:d[0])??{};if(x!=null&&x.length){switch(o){case"ArrowUp":{if(c-i<5)return;const V=Math.floor((c-i)/2)+1;i=i+V,c-i<5&&(i=c-4);break}case"ArrowDown":{const V=Math.min(500,c-i);i=i-V-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),A.value>0&&(A.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&A.value<x.length-1&&(A.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?A.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?A.value:c})})}},xe=()=>{t==null||t.on("datazoom",q.G(o=>{var v,d,x,i;const{loadCheckCounts:a}=I.value;if((d=(v=t==null?void 0:t.getOption())==null?void 0:v.dataZoom)!=null&&d[0]){const{startValue:c}=(i=(x=t==null?void 0:t.getOption())==null?void 0:x.dataZoom)==null?void 0:i[0];c<a&&!p&&!g&&(p=!0,ge("history")),H()}},100)),t==null||t.on("highlight",q.G(o=>{var v,d;let a=o.dataIndex||-1;o.batch&&(a=typeof((v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex)=="number"?(d=o==null?void 0:o.batch[0])==null?void 0:d.dataIndex:-1),A.value=a},20)),t==null||t.on("globalout",q.G(()=>{var o,a,v;if(t){const d=(v=(a=(o=t==null?void 0:t.getOption())==null?void 0:o.dataZoom)==null?void 0:a[0])==null?void 0:v.endValue;A.value=d}},30)),t==null||t.on("contextmenu",q.G(o=>{o.componentType==="graphic"&&(O.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},X=async()=>{const o=await qe({featureId:l.featureId});_.value=(o==null?void 0:o.body)||[],H(),D("change","warningLine",_.value)},be=async o=>{const{variety:a,varietyName:v,featureId:d,featureType:x}=l;if(o.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:()=>""}}}});const V=async Y=>{t==null||t.getZr().off("mousedown",V);const M=t==null?void 0:t.convertFromPixel({yAxisIndex:0},Y.offsetY),h=Math.round(M*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Fe({featureCode:a,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",V)}else o.key==="deleteWarningLine"?(await Ne({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):o.key==="changeWarningLine"&&($.value=!0,G.value=O.value.warnPrice)},_e=async()=>{const{variety:o,varietyName:a,featureId:v,featureType:d}=l;await ce({id:O.value.id,featureCode:o,featureName:a,featureId:v,featureType:d,warnPrice:G.value}),J.ElMessage.success("画线预警修改成功"),X()},he=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var o,a;return[l.variety,l.cycle,l.mainIndicator,E.value,(o=l.indicatorStore)==null?void 0:o.filterIndicator,(a=l.indicatorStore)==null?void 0:a.customIndicator]},()=>{p=!1,g=!1,te()},{deep:!0}),e.onUnmounted(()=>{y&&(cancelAnimationFrame(y),y=null),u&&(cancelAnimationFrame(u),u=null),t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),s==null||s.dispose(),window.removeEventListener("keydown",le)}),w({draw:(o,a)=>{o==="warningLine"&&(_.value=a,H())}}),(o,a)=>{var Y,M;const v=ie.ElMenuItem,d=ie.ElMenu,x=De.ElEmpty,i=Ye.ElButton,c=we.ElInputNumber,V=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:a[1]||(a[1]=h=>m.value=!0),onMouseout:a[2]||(a[2]=h=>m.value=!1)},[(Y=F.value.time)!=null&&Y.length?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(Ie,{variety:n.variety,data:F.value,activeIndex:A.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:I.value.showSubChart?"70%":"100%"})},[e.createVNode(Ke,{onCloseContextMenuCallBack:he},{popover:e.withCtx(()=>[e.createVNode(d,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,h=>(e.openBlock(),e.createBlock(v,{style:{height:"36px"},key:h.key,index:h.key,onClick:T=>be(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:S,style:{height:"100%"}},null,512)]),_:1})],4),I.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:N,modelValue:E.value,"onUpdate:modelValue":a[0]||(a[0]=h=>E.value=h),data:F.value,cycle:n.cycle,activeIndex:A.value,subIndicatorList:(M=n.indicatorStore)==null?void 0:M.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",Qe,[et,e.createElementVNode("div",tt,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(V,{modelValue:$.value,"onUpdate:modelValue":a[5]||(a[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",ot,[e.createVNode(i,{onClick:a[4]||(a[4]=h=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:_e},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[nt,e.createVNode(c,{modelValue:G.value,"onUpdate:modelValue":a[3]||(a[3]=h=>G.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},lt=U._export_sfc(at,[["__scopeId","data-v-dbb75956"]]),rt={install(n){n.component("st-klineBasic",lt)}};module.exports=rt;
package/es/KlineBasic.js CHANGED
@@ -1,39 +1,39 @@
1
1
  import "./base-29f73b05.js";
2
- import { E as We } from "./el-dialog-1939f7c5.js";
3
- import "./el-overlay-1dfe3675.js";
4
- import "./el-input-58786d42.js";
5
- import { E as qe } from "./el-input-number-a7971697.js";
6
- import { E as ze } from "./el-button-4f201000.js";
2
+ import { E as We } from "./el-dialog-59a23c2b.js";
3
+ import "./el-overlay-465cd11e.js";
4
+ import "./el-input-1f14a6e2.js";
5
+ import { E as qe } from "./el-input-number-411ac93d.js";
6
+ import { E as ze } from "./el-button-cd144ee1.js";
7
7
  import { E as Ze } from "./el-empty-f5a1607a.js";
8
- import { E as Ke, a as Ue } from "./el-menu-item-a166b997.js";
8
+ import { E as Ke, a as Ue } from "./el-menu-item-77152904.js";
9
9
  import "./el-tooltip-4ed993c7.js";
10
- import "./el-popper-db6c599f.js";
10
+ import "./el-popper-f96fc206.js";
11
11
  import { defineComponent as xe, ref as A, watch as te, nextTick as ne, openBlock as T, createElementBlock as E, Fragment as oe, renderList as fe, normalizeStyle as pe, toDisplayString as ae, computed as le, createVNode as I, onMounted as Se, onUnmounted as Me, createElementVNode as K, withCtx as z, createBlock as Le, createCommentVNode as G, renderSlot as Ye, createTextVNode as ue, pushScopeId as He, popScopeId as je } from "vue";
12
12
  import { d as F } from "./dayjs.min-8313b006.js";
13
13
  import * as be from "echarts";
14
14
  import { y as Ce, v as Xe, U as Ge, K as Je, V as ie, x as _e, D as Qe, G as ce } from "./index-7ed0999e.js";
15
15
  import "./el-message-4ed993c7.js";
16
- import { E as de } from "./index-072c4a65.js";
16
+ import { E as de } from "./index-499cf989.js";
17
17
  import { _ as J } from "./_plugin-vue_export-helper-dad06003.js";
18
- import "./el-tag-65a99986.js";
19
- import { E as et, a as tt } from "./el-select-086bcb6c.js";
18
+ import "./el-tag-0a4197f5.js";
19
+ import { E as et, a as tt } from "./el-select-d47b5923.js";
20
20
  import "./el-scrollbar-323542e7.js";
21
- import "./index-1955f23d.js";
21
+ import "./index-8e88a0bd.js";
22
22
  import "./index-8391a3df.js";
23
- import "./use-form-common-props-c14990b9.js";
24
- import "./index-ca91ac68.js";
23
+ import "./use-form-common-props-dd9617de.js";
24
+ import "./index-1b97095f.js";
25
25
  import "./index-de24705f.js";
26
26
  import "./index-2e331d74.js";
27
27
  import "./vnode-a83e6de8.js";
28
28
  import "./scroll-6799bafc.js";
29
- import "./use-global-config-a01b5ce1.js";
30
- import "./index-1e91e986.js";
29
+ import "./use-global-config-4dfc7236.js";
30
+ import "./index-33430c9f.js";
31
31
  import "./typescript-7ae59c4c.js";
32
- import "./index-7db02db7.js";
32
+ import "./index-d3e9a6f2.js";
33
33
  import "./index-657047bb.js";
34
- import "./config-provider-56193d47.js";
35
- import "./index-57d82da0.js";
36
- import "./index-b51915a2.js";
34
+ import "./config-provider-20b05e99.js";
35
+ import "./index-67180968.js";
36
+ import "./index-afc4a1e5.js";
37
37
  import "./castArray-609a313e.js";
38
38
  import "./debounce-a09ce9a3.js";
39
39
  let C = null;
@@ -1 +1 @@
1
- "use strict";const u=require("./base-ef747d02.cjs"),A=require("./el-overlay-a94f8a98.cjs"),F=require("./el-button-dd065de0.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-4d50b63f.cjs"),x=require("./el-checkbox-02ce40f0.cjs");require("./el-tag-f48b1190.cjs");const U=require("./el-select-2ebc8380.cjs");require("./el-popper-ce575c12.cjs");const $=require("./el-divider-4713d74c.cjs"),e=require("vue"),M=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-3792552a.cjs"),K=require("./validator-119fdaf4.cjs"),E=require("./use-form-common-props-00ec25ac.cjs"),h=require("./index-bf98dd03.cjs"),H=require("./index-5b546f7d.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-28efb416.cjs");require("./index-7eb88616.cjs");require("./index-eea0bcb3.cjs");require("./index-8439d2f9.cjs");require("./castArray-35947698.cjs");require("./index-4f900527.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 n=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",n);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:n,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}),(a,q)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:a.appendTo,disabled:a.appendTo!=="body"?!1:!a.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 L;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:a.modal,"overlay-class":[e.unref(l).is("drawer"),(L=a.modalClass)!=null?L:""],"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":a.title||void 0,"aria-labelledby":a.title?void 0:e.unref(d),"aria-describedby":e.unref(n)},a.$attrs,{class:[e.unref(l).b(),a.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),a.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),a.headerClass])},[a.$slots.title?e.renderSlot(a.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(a.$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":a.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(a.title),11,["id","aria-level"])]),a.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(n),class:e.normalizeClass([e.unref(l).e("body"),a.bodyClass])},[e.renderSlot(a.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),a.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),a.footerClass])},[e.renderSlot(a.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),a.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}),ne=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)]),n=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(n))},[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 ae=u._export_sfc(ne,[["__file","switch.vue"]]);const re=u.withInstall(ae);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)),qe={class:"setting-item"},Le=_(()=>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(n=>({label:n.dictName,value:n.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,n)=>{const B=$.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":n[12]||(n[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":n[0]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[1]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[2]||(n[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":n[3]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[4]||(n[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,a)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[a],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[a],"onUpdate:modelValue":q=>l.multiCycleList[a]=q,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(q,L)=>(e.openBlock(),e.createBlock(i,{key:L,label:q.label,value:q.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(a+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":n[5]||(n[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":n[6]||(n[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":n[7]||(n[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":n[8]||(n[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":n[9]||(n[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",qe,[Le,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":n[10]||(n[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":n[11]||(n[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=M._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-d26a1b98.cjs"),F=require("./el-button-13dc915f.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-f0bce6f2.cjs"),x=require("./el-checkbox-95325acd.cjs");require("./el-tag-51bd491c.cjs");const U=require("./el-select-f3cc464f.cjs");require("./el-popper-c7648df6.cjs");const $=require("./el-divider-4713d74c.cjs"),e=require("vue"),M=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-476c4459.cjs"),K=require("./validator-ea292506.cjs"),E=require("./use-form-common-props-02be4928.cjs"),h=require("./index-68798830.cjs"),H=require("./index-d2cfd4a3.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-31b3ec57.cjs");require("./index-cfcd60ca.cjs");require("./index-eea0bcb3.cjs");require("./index-60c69dd1.cjs");require("./castArray-35947698.cjs");require("./index-09ce1753.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 n=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",n);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:n,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}),(a,q)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:a.appendTo,disabled:a.appendTo!=="body"?!1:!a.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 L;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:a.modal,"overlay-class":[e.unref(l).is("drawer"),(L=a.modalClass)!=null?L:""],"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":a.title||void 0,"aria-labelledby":a.title?void 0:e.unref(d),"aria-describedby":e.unref(n)},a.$attrs,{class:[e.unref(l).b(),a.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),a.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),a.headerClass])},[a.$slots.title?e.renderSlot(a.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(a.$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":a.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(a.title),11,["id","aria-level"])]),a.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(n),class:e.normalizeClass([e.unref(l).e("body"),a.bodyClass])},[e.renderSlot(a.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),a.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),a.footerClass])},[e.renderSlot(a.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),a.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}),ne=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)]),n=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(n))},[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 ae=u._export_sfc(ne,[["__file","switch.vue"]]);const re=u.withInstall(ae);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)),qe={class:"setting-item"},Le=_(()=>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(n=>({label:n.dictName,value:n.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,n)=>{const B=$.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":n[12]||(n[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":n[0]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[1]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[2]||(n[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":n[3]||(n[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,a)=>(e.openBlock(),e.createBlock(i,{key:a,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":n[4]||(n[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,a)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[a],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[a],"onUpdate:modelValue":q=>l.multiCycleList[a]=q,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(q,L)=>(e.openBlock(),e.createBlock(i,{key:L,label:q.label,value:q.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(a+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":n[5]||(n[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":n[6]||(n[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":n[7]||(n[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":n[8]||(n[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":n[9]||(n[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",qe,[Le,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":n[10]||(n[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":n[11]||(n[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=M._export_sfc(Oe,[["__scopeId","data-v-6e5050a9"]]),Re={install(r){r.component("st-klineConfig",Fe)}};module.exports=Re;
package/es/KlineConfig.js CHANGED
@@ -1,31 +1,31 @@
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-29f73b05.js";
2
- import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-1dfe3675.js";
3
- import { E as Ce } from "./el-button-4f201000.js";
2
+ import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-465cd11e.js";
3
+ import { E as Ce } from "./el-button-cd144ee1.js";
4
4
  import "./el-scrollbar-323542e7.js";
5
- import { E as ke } from "./el-segmented-741f2252.js";
6
- import { E as we } from "./el-checkbox-33cb73db.js";
7
- import "./el-tag-65a99986.js";
8
- import { E as Ve, a as Se } from "./el-select-086bcb6c.js";
9
- import "./el-popper-db6c599f.js";
5
+ import { E as ke } from "./el-segmented-598b92b0.js";
6
+ import { E as we } from "./el-checkbox-d6c883f4.js";
7
+ import "./el-tag-0a4197f5.js";
8
+ import { E as Ve, a as Se } from "./el-select-d47b5923.js";
9
+ import "./el-popper-f96fc206.js";
10
10
  import { E as Ie } from "./el-divider-523e5874.js";
11
11
  import { computed as T, ref as B, watch as Q, onBeforeUnmount as Ee, defineComponent as Z, useSlots as Te, openBlock as o, createBlock as k, unref as e, withCtx as p, createVNode as m, Transition as Be, withDirectives as ze, createElementVNode as n, mergeProps as Ne, withModifiers as ce, normalizeClass as b, createElementBlock as y, renderSlot as $, toDisplayString as M, createCommentVNode as _, normalizeStyle as me, vShow as Pe, onMounted as pe, withKeys as Le, resolveDynamicComponent as q, nextTick as Ae, inject as Oe, reactive as Ue, createTextVNode as j, Fragment as H, renderList as J, pushScopeId as Re, popScopeId as De } from "vue";
12
12
  import { _ as Fe } from "./_plugin-vue_export-helper-dad06003.js";
13
- import { E as D, c as $e, l as Me } from "./index-ca91ac68.js";
14
- import { i as Ke } from "./validator-65de1caf.js";
15
- import { b as qe, c as le, i as X, d as je, e as He, f as Je, g as We } from "./use-form-common-props-c14990b9.js";
16
- import { b as Xe, c as Ye, u as Ge, U as te, C as ae, I as se, d as Qe, a as Ze } from "./index-1955f23d.js";
17
- import { E as xe } from "./index-57d82da0.js";
13
+ import { E as D, c as $e, l as Me } from "./index-1b97095f.js";
14
+ import { i as Ke } from "./validator-029bfc98.js";
15
+ import { b as qe, c as le, i as X, d as je, e as He, f as Je, g as We } from "./use-form-common-props-dd9617de.js";
16
+ import { b as Xe, c as Ye, u as Ge, U as te, C as ae, I as se, d as Qe, a as Ze } from "./index-8e88a0bd.js";
17
+ import { E as xe } from "./index-67180968.js";
18
18
  import { u as el } from "./index-2e331d74.js";
19
19
  import { u as ll } from "./index-de24705f.js";
20
20
  import "./vnode-a83e6de8.js";
21
21
  import "./scroll-6799bafc.js";
22
22
  import "./index-8391a3df.js";
23
- import "./use-global-config-a01b5ce1.js";
24
- import "./index-1e91e986.js";
23
+ import "./use-global-config-4dfc7236.js";
24
+ import "./index-33430c9f.js";
25
25
  import "./index-657047bb.js";
26
- import "./index-b51915a2.js";
26
+ import "./index-afc4a1e5.js";
27
27
  import "./castArray-609a313e.js";
28
- import "./index-7db02db7.js";
28
+ import "./index-d3e9a6f2.js";
29
29
  import "./debounce-a09ce9a3.js";
30
30
  const tl = ne({
31
31
  ...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-f48b1190.cjs");const R=require("./el-select-2ebc8380.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-ce575c12.cjs");const $=require("echarts");require("./index-7eb88616.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-00ec25ac.cjs");require("./index-3792552a.cjs");require("./index-bb833443.cjs");require("./index-bf98dd03.cjs");require("./index-5b546f7d.cjs");require("./index-8439d2f9.cjs");require("./castArray-35947698.cjs");require("./index-4f900527.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-51bd491c.cjs");const R=require("./el-select-f3cc464f.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-c7648df6.cjs");const $=require("echarts");require("./index-cfcd60ca.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-02be4928.cjs");require("./index-476c4459.cjs");require("./index-bb833443.cjs");require("./index-68798830.cjs");require("./index-d2cfd4a3.cjs");require("./index-60c69dd1.cjs");require("./castArray-35947698.cjs");require("./index-09ce1753.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,21 +3,21 @@ 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-29f73b05.js";
6
- import "./el-tag-65a99986.js";
7
- import { E as ae, a as ne } from "./el-select-086bcb6c.js";
6
+ import "./el-tag-0a4197f5.js";
7
+ import { E as ae, a as ne } from "./el-select-d47b5923.js";
8
8
  import "./el-scrollbar-323542e7.js";
9
- import "./el-popper-db6c599f.js";
9
+ import "./el-popper-f96fc206.js";
10
10
  import * as B from "echarts";
11
- import "./index-1e91e986.js";
11
+ import "./index-33430c9f.js";
12
12
  import "./index-8391a3df.js";
13
- import "./use-form-common-props-c14990b9.js";
14
- import "./index-ca91ac68.js";
13
+ import "./use-form-common-props-dd9617de.js";
14
+ import "./index-1b97095f.js";
15
15
  import "./index-de24705f.js";
16
- import "./index-1955f23d.js";
17
- import "./index-57d82da0.js";
18
- import "./index-b51915a2.js";
16
+ import "./index-8e88a0bd.js";
17
+ import "./index-67180968.js";
18
+ import "./index-afc4a1e5.js";
19
19
  import "./castArray-609a313e.js";
20
- import "./index-7db02db7.js";
20
+ import "./index-d3e9a6f2.js";
21
21
  import "./scroll-6799bafc.js";
22
22
  import "./debounce-a09ce9a3.js";
23
23
  import "./vnode-a83e6de8.js";