st-comp 0.0.280 → 0.0.281

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 (116) hide show
  1. package/es/CustomFunction.cjs +2 -2
  2. package/es/CustomFunction.js +512 -306
  3. package/es/FactorWarning.cjs +1 -1
  4. package/es/FactorWarning.js +25 -25
  5. package/es/Kline.cjs +1 -1
  6. package/es/Kline.js +10 -10
  7. package/es/KlineBasic.cjs +1 -1
  8. package/es/KlineBasic.js +39 -39
  9. package/es/KlineConfig.cjs +1 -1
  10. package/es/KlineConfig.js +16 -16
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +9 -9
  13. package/es/KlinePlus.cjs +1 -1
  14. package/es/KlinePlus.js +11 -11
  15. package/es/MonacoEditor.cjs +1 -1
  16. package/es/MonacoEditor.js +17 -17
  17. package/es/Pagination.cjs +1 -1
  18. package/es/Pagination.js +13 -13
  19. package/es/PasswordPrompt.cjs +1 -1
  20. package/es/PasswordPrompt.js +2 -2
  21. package/es/Table.cjs +1 -1
  22. package/es/Table.js +22 -22
  23. package/es/User.cjs +1 -1
  24. package/es/User.js +18 -18
  25. package/es/VarSelectDialog.cjs +1 -1
  26. package/es/VarSelectDialog.js +19 -19
  27. package/es/VarietyAiHelper.cjs +7 -7
  28. package/es/VarietyAiHelper.js +426 -437
  29. package/es/VarietyAutoComplete.cjs +1 -1
  30. package/es/VarietyAutoComplete.js +7 -7
  31. package/es/VarietySearch.cjs +1 -1
  32. package/es/VarietySearch.js +29 -29
  33. package/es/{VarietySelect-c402bade.js → VarietySelect-3fc0f0ce.js} +3 -3
  34. package/es/{VarietySelect-aa082a9c.cjs → VarietySelect-d2d25a3d.cjs} +1 -1
  35. package/es/VarietyTextCopy.cjs +1 -1
  36. package/es/VarietyTextCopy.js +10 -10
  37. package/es/VirtualTable.cjs +1 -1
  38. package/es/VirtualTable.js +94 -94
  39. package/es/{_baseClone-10bdb989.cjs → _baseClone-f8e5d3ba.cjs} +1 -1
  40. package/es/{_baseClone-98af8b33.js → _baseClone-fb6a3947.js} +2 -2
  41. package/es/{config-provider-563023c9.js → config-provider-06d8207f.js} +3 -3
  42. package/es/{config-provider-33a127c4.cjs → config-provider-bb61bd3e.cjs} +1 -1
  43. package/es/{dropdown-ce7496c7.cjs → dropdown-8fa21bfd.cjs} +1 -1
  44. package/es/{dropdown-feea8702.js → dropdown-bcf8d198.js} +2 -2
  45. package/es/{el-autocomplete-d9253bba.cjs → el-autocomplete-13b9e372.cjs} +1 -1
  46. package/es/{el-autocomplete-eac54f9f.js → el-autocomplete-419bfbcf.js} +5 -5
  47. package/es/{el-button-8a9721f8.js → el-button-ee9fe159.js} +3 -3
  48. package/es/{el-button-8259594b.cjs → el-button-fac5e058.cjs} +1 -1
  49. package/es/{el-checkbox-6303fc92.cjs → el-checkbox-6cf1a71c.cjs} +1 -1
  50. package/es/{el-checkbox-c328b097.js → el-checkbox-b5ac7f04.js} +4 -4
  51. package/es/{el-dialog-67536fac.js → el-dialog-060b3735.js} +4 -4
  52. package/es/{el-dialog-8788bcc1.cjs → el-dialog-54aebacd.cjs} +1 -1
  53. package/es/{el-form-item-8efcf2c3.js → el-form-item-2be6b683.js} +3 -3
  54. package/es/{el-form-item-95e68669.cjs → el-form-item-758dfefa.cjs} +1 -1
  55. package/es/{el-input-c8a9bb71.cjs → el-input-7fe53030.cjs} +1 -1
  56. package/es/{el-input-e66500b7.js → el-input-d23f5442.js} +60 -60
  57. package/es/{el-input-number-68ee0d65.js → el-input-number-484fb184.js} +15 -15
  58. package/es/{el-input-number-d7a81922.cjs → el-input-number-f0f4eedb.cjs} +1 -1
  59. package/es/{el-loading-db4c6d13.js → el-loading-9d3e405c.js} +1 -1
  60. package/es/{el-loading-62132db2.cjs → el-loading-fafaaa7b.cjs} +1 -1
  61. package/es/{el-menu-item-c2523d82.js → el-menu-item-0ac22681.js} +4 -4
  62. package/es/{el-menu-item-4b8e7794.cjs → el-menu-item-c91ae430.cjs} +1 -1
  63. package/es/{el-message-box-7c13546c.js → el-message-box-568a0aa6.js} +9 -9
  64. package/es/{el-message-box-fed174f0.cjs → el-message-box-ceacb54e.cjs} +1 -1
  65. package/es/{el-overlay-17299785.cjs → el-overlay-9f36e73c.cjs} +1 -1
  66. package/es/{el-overlay-36f223e9.js → el-overlay-cb5c85aa.js} +3 -3
  67. package/es/{el-popconfirm-520b2928.cjs → el-popconfirm-4a8cd35c.cjs} +1 -1
  68. package/es/{el-popconfirm-a857c54a.js → el-popconfirm-6f8e65c8.js} +4 -4
  69. package/es/{el-popper-852446fd.js → el-popper-0454c8e8.js} +1 -1
  70. package/es/{el-popper-f824c63b.cjs → el-popper-acd0ff35.cjs} +1 -1
  71. package/es/{el-segmented-bf08279f.js → el-segmented-64dc7258.js} +2 -2
  72. package/es/{el-segmented-45dcc036.cjs → el-segmented-eb3c8e65.cjs} +1 -1
  73. package/es/{el-select-a34348e1.js → el-select-a573c78b.js} +8 -8
  74. package/es/{el-select-d2958ae8.cjs → el-select-c317294a.cjs} +1 -1
  75. package/es/{el-table-column-e2be313e.js → el-table-column-1c443963.js} +9 -9
  76. package/es/{el-table-column-ad70ee0e.cjs → el-table-column-f555115d.cjs} +1 -1
  77. package/es/{el-tag-9bcfae32.js → el-tag-2d8a3fe7.js} +2 -2
  78. package/es/{el-tag-527f06f0.cjs → el-tag-dca1292c.cjs} +1 -1
  79. package/es/{el-text-fc345ffd.cjs → el-text-649c986a.cjs} +1 -1
  80. package/es/{el-text-f9379288.js → el-text-761e6717.js} +1 -1
  81. package/es/{index-7711aa69.cjs → index-11181b5f.cjs} +1 -1
  82. package/es/{index-5e76a22d.cjs → index-21a3dc89.cjs} +1 -1
  83. package/es/{index-99bb359f.cjs → index-33e039e3.cjs} +1 -1
  84. package/es/{index-bb0bc131.cjs → index-4614e8e9.cjs} +2 -2
  85. package/es/{index-dfb34e00.js → index-53beef02.js} +1 -1
  86. package/es/index-5cada1ed.cjs +1 -0
  87. package/es/{index-3ed0c678.cjs → index-6a36e1fc.cjs} +1 -1
  88. package/es/{index-60900c6c.js → index-6a52dc7c.js} +112 -82
  89. package/es/{index-b9a26e7f.js → index-78dab605.js} +3 -3
  90. package/es/{index-99d4335d.cjs → index-798fec2d.cjs} +1 -1
  91. package/es/{index-47d30a52.js → index-9573f74b.js} +1 -1
  92. package/es/{index-69d2353a.js → index-ab0ad219.js} +9 -9
  93. package/es/{index-3a0a7c36.cjs → index-beb5cb7d.cjs} +1 -1
  94. package/es/{index-86678b72.js → index-c09fc6f5.js} +2 -2
  95. package/es/{index-5dec535a.cjs → index-ceae4c47.cjs} +1 -1
  96. package/es/{index-a0522466.js → index-d9379af4.js} +2 -2
  97. package/es/{index-7c4d8f5d.js → index-dddacf80.js} +1 -1
  98. package/es/{index-2419d69a.js → index-e2e58ea9.js} +5 -5
  99. package/es/{python-922eca89.cjs → python-60e79979.cjs} +1 -1
  100. package/es/{python-6eafa04b.js → python-673bf8b8.js} +17 -17
  101. package/es/style.css +1 -1
  102. package/es/{use-form-item-0a831287.cjs → use-form-item-76516e50.cjs} +1 -1
  103. package/es/{use-form-item-187cd7db.js → use-form-item-784142b4.js} +16 -16
  104. package/es/{use-global-config-c90c91f7.cjs → use-global-config-7ff9a1c2.cjs} +1 -1
  105. package/es/{use-global-config-17dafd40.js → use-global-config-9a4ccf33.js} +2 -2
  106. package/es/{validator-ee5bc3eb.cjs → validator-1926345b.cjs} +1 -1
  107. package/es/{validator-800ed2ba.js → validator-a66ec4f8.js} +1 -1
  108. package/es/{zh-cn-26cc7233.js → zh-cn-51c2e528.js} +1 -1
  109. package/es/{zh-cn-a22a6792.cjs → zh-cn-ad12d9f5.cjs} +1 -1
  110. package/lib/bundle.js +1 -1
  111. package/lib/bundle.umd.cjs +197 -197
  112. package/lib/{index-74ed48c6.js → index-7282d3be.js} +22370 -22147
  113. package/lib/{python-7aaa84e4.js → python-418be57d.js} +1 -1
  114. package/lib/style.css +1 -1
  115. package/package.json +1 -1
  116. package/es/index-3e7d5ffb.cjs +0 -1
package/es/KlineBasic.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const he=require("./el-button-8259594b.cjs"),ke=require("./el-dialog-8788bcc1.cjs"),we=require("./el-empty-58bc2a10.cjs"),Ye=require("./el-input-number-d7a81922.cjs"),ie=require("./el-menu-item-4b8e7794.cjs"),J=require("./index-5dec535a.cjs"),B=require("./base-d987e5c9.cjs");require("./el-overlay-17299785.cjs");require("./el-input-c8a9bb71.cjs");require("./el-popper-f824c63b.cjs");require("./el-tooltip-0ea8fbf8.cjs");const e=require("vue"),De=require("echarts"),A=require("./index-94131fd7.cjs");require("./el-message-0ea8fbf8.cjs");const Z=require("./_plugin-vue_export-helper-f246444f.cjs"),se=require("./el-select-d2958ae8.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-tag-527f06f0.cjs");require("./index-3e7d5ffb.cjs");require("./use-form-item-0a831287.cjs");require("./index-d372e68f.cjs");require("./index-f5474dcc.cjs");require("./use-global-config-c90c91f7.cjs");require("./index-3ed0c678.cjs");require("./index-71ba4c28.cjs");require("./clamp-17c4d8aa.cjs");require("./toNumber-b47ceb68.cjs");require("./vnode-6f7b84f0.cjs");require("./typescript-b63f8e83.cjs");require("./config-provider-33a127c4.cjs");require("./scroll-07bade1e.cjs");require("./raf-735cc598.cjs");require("./index-7711aa69.cjs");require("./castArray-d9ffe84a.cjs");require("./index-3a0a7c36.cjs");require("./index-5e76a22d.cjs");function Se(o){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const b in o)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(o,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>o[b]})}}return w.default=o,Object.freeze(w)}const oe=Se(De);let z=null;const Me=o=>{const w=A.y(o,{handleReq:b=>{A.V()&&(b.headers.token=A.R())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.A(),!0}});w.get,z=w.post},Ve=o=>z("/middleLayer/kline/getKlineBasic",{...o,userId:A.U("id")}),Le=o=>z("/middleLayer/kline/getKline",o),Be=async o=>z("/alarm/deliversign/addAlarmPrice",{...o,userId:A.U("id")}),Fe=async o=>z("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:A.U("id")}),ce=async o=>z("/alarm/deliversign/updateAlarmPrice",{...o,userId:A.U("id")}),Ae=async o=>z("/alarm/deliversign/deleteAlarmPrice",{...o,userId:A.U("id")}),{round:C}=A.x,Ne=(o,w,b,r,s)=>{const{data:t,time:y}=o,{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}},...o.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)"}}}},qe=(o,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=o==null?void 0:o.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(o==null?void 0:o.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:(o==null?void 0:o.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(o==null?void 0:o.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=o.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 q=o==null?void 0:o.convertFromPixel({yAxisIndex:0},E+k),F={id:l.id,warnPrice:C(q,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(o){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(o);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 Ee=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){const w=o,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(o.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=Z._export_sfc(Ee,[["__scopeId","data-v-0ed8d951"]]);const Te={class:"kline-tips"},Re={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(o){const{round:w,formatValue:b}=A.x,r=o,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",Te,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},je=Z._export_sfc(Re,[["__scopeId","data-v-db894a3c"]]),Oe={class:"kline-averageTips"},$e=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(w,b)=>(e.openBlock(),e.createElementBlock("div",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.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=Z._export_sfc($e,[["__scopeId","data-v-c544514b"]]);const Ie={class:"klineSub"},We={class:"klineSub-tips"},Ce={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(o,{expose:w,emit:b}){const{round:r}=A.x;let s=null,t=null;const y=e.ref(!0),u=b,f=o,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:q}=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((j,$)=>_.seriesColor==="kline"?{value:j,itemStyle:l(f.data.data,$)}:_.seriesColor==="value"?{value:j,itemStyle:{color:j>=0?"#FF0000":"#00FFFF"}}:{value:j,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:j,value:$}=_;if(j==="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:q==="cover"?_=>_.min:null,max:q==="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",Ie,[e.createElementVNode("div",We,[D.value.length?(e.openBlock(),e.createElementBlock("div",Ce,[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(o.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=Z._export_sfc(ze,[["__scopeId","data-v-6e6b5f5b"]]),Ze=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{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 He=Z._export_sfc(Ze,[["__scopeId","data-v-8d581ce9"]]);const Ke={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Ge={key:2,class:"klineBasic-empty"},Je={key:3,class:"klineBasic-error"},Qe={style:{"text-align":"center"}},et={class:"dialog-footer"},tt={__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(o,{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=o,m=e.ref(!1),k=e.ref(!1),L=e.ref(!1),S=e.ref(null),N=e.ref(null),E=e.ref("VOL"),q=e.ref(0),F=e.ref({}),_=e.ref([]),j=e.ref({}),$=e.ref(!1),X=e.ref(""),Q=e.ref([...r]),O=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),fe=()=>{t||(t=oe.init(S.value),ge(),O.value.showSubChart&&N.value.connect(t),s=A.D(S.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(a=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{pe(a),y=requestAnimationFrame(()=>{me(),y=requestAnimationFrame(()=>{H(),y=null})})})},pe=(a=!1)=>{var c,M,Y;if(!t||t.isDisposed())return;const{time:n}=F.value,{defaultShowCounts:v}=O.value;let d=n.length-1-v,x=n.length-1;if(a&&t){const V=t.getOption(),h=(M=(c=V==null?void 0:V.xAxis)==null?void 0:c[0])==null?void 0:M.data,T=(Y=V==null?void 0:V.dataZoom)==null?void 0:Y[0];if(h!=null&&h.length&&T){const I=h[T.startValue],W=h[T.endValue];if(I&&W){const ne=n.findIndex(K=>new Date(K).getTime()>=new Date(I).getTime()),U=n.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=U!==-1?U:n.length-1,d>x&&(d=Math.max(0,x-Math.min(100,n.length-1)))}}}const i=Ne(F.value,O.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),q.value=x,requestAnimationFrame(()=>{ye()})})},me=()=>{var M;if(!O.value.showSubChart||!N.value)return;const{time:a}=F.value,{gridLeft:n,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=O.value;let i=a.length-1-x,c=a.length-1;if(t&&!t.isDisposed()){const Y=t.getOption();if((M=Y==null?void 0:Y.dataZoom)!=null&&M[0]){const{startValue:V,endValue:h}=Y.dataZoom[0];V!==void 0&&h!==void 0&&(i=V,c=h)}}requestAnimationFrame(()=>{var Y;(Y=N.value)==null||Y.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:n,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const n=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!n||!v||(t==null||t.setOption({graphic:qe(t,_.value,l,O.value,()=>{G()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ye=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:a}=F.value;if(!l.brushRange||!(a!=null&&a.length)||!t)return;let n=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=a.find(i=>B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(n).format("YYYY-MM-DD")),x=d;break}case"7":{d=a.find(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(n).day(5).format("YYYY-MM-DD")),x=a.findLast(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=a.find(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(n).endOf("month").format("YYYY-MM-DD")),x=a.findLast(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=a.find(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(n).format("YYYY-MM-DD"),M=new Date(i).getTime()>=new Date(n).getTime();return c&&M}),x=a.findLast(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(v).format("YYYY-MM-DD"),M=new Date(i).getTime()<=new Date(v).getTime();return c&&M})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var a,n,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:M,cycle:Y,indicatorStore:V,mainIndicator:h,right:T,startTime:I,endTime:W}=l,{defaultShowCounts:ne,addCounts:U,showWarningLine:K,getFactorData:re}=O.value;fe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const P={variety:c,featureId:M,cycle:Y,mainIndicatorList:V.getIndicatorParams(h),subIndicator:E.value,right:T,showWarningLine:K,getFactorData:re};I&&W?(P.startTime=I,P.endTime=W):I?(P.startTime=I,P.limit=U):W?(P.endTime=W,P.limit=U):(P.endTime=B.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),P.limit=U);const R=await Ve(P);if(!((v=(n=(a=R==null?void 0:R.body)==null?void 0:a.kline)==null?void 0:n.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)}},ve=async a=>{const{variety:n,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=O.value,{time:M}=F.value;if(a==="history"){const Y=await Le({variety:n,cycle:v,endTime:M[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((V,h)=>{var T;return{...V,data:[...((T=Y.body.mainIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((V,h)=>{var T;return{...V,data:[...((T=Y.body.subIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),Y.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:a,ctrlKey:n})=>{if(!(n||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(a){case"ArrowUp":{if(c-i<5)return;const M=Math.floor((c-i)/2)+1;i=i+M,c-i<5&&(i=c-4);break}case"ArrowDown":{const M=Math.min(500,c-i);i=i-M-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),q.value>0&&(q.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&q.value<x.length-1&&(q.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?q.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?q.value:c})})}},ge=()=>{t==null||t.on("datazoom",A.j(a=>{var v,d,x,i;const{loadCheckCounts:n}=O.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<n&&!p&&!g&&(p=!0,ve("history")),H()}},100)),t==null||t.on("highlight",A.j(a=>{var v,d;let n=a.dataIndex||-1;a.batch&&(n=typeof((v=a==null?void 0:a.batch[0])==null?void 0:v.dataIndex)=="number"?(d=a==null?void 0:a.batch[0])==null?void 0:d.dataIndex:-1),q.value=n},20)),t==null||t.on("globalout",A.j(()=>{var a,n,v;if(t){const d=(v=(n=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:n[0])==null?void 0:v.endValue;q.value=d}},30)),t==null||t.on("contextmenu",A.j(a=>{a.componentType==="graphic"&&(j.value=a.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},G=async()=>{const a=await Fe({featureId:l.featureId});_.value=(a==null?void 0:a.body)||[],H(),D("change","warningLine",_.value)},xe=async a=>{const{variety:n,varietyName:v,featureId:d,featureType:x}=l;if(a.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 M=async Y=>{t==null||t.getZr().off("mousedown",M);const V=t==null?void 0:t.convertFromPixel({yAxisIndex:0},Y.offsetY),h=Math.round(V*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 Be({featureCode:n,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),G()};t==null||t.getZr().on("mousedown",M)}else a.key==="deleteWarningLine"?(await Ae({id:j.value.id}),J.ElMessage.success("画线预警删除成功"),G()):a.key==="changeWarningLine"&&($.value=!0,X.value=j.value.warnPrice)},be=async()=>{const{variety:a,varietyName:n,featureId:v,featureType:d}=l;await ce({id:j.value.id,featureCode:a,featureName:n,featureId:v,featureType:d,warnPrice:X.value}),J.ElMessage.success("画线预警修改成功"),G()},_e=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var a,n;return[l.variety,l.cycle,l.mainIndicator,E.value,(a=l.indicatorStore)==null?void 0:a.filterIndicator,(n=l.indicatorStore)==null?void 0:n.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:(a,n)=>{a==="warningLine"&&(_.value=n,H())}}),(a,n)=>{var Y,V;const v=ie.ElMenuItem,d=ie.ElMenu,x=we.ElEmpty,i=he.ElButton,c=Ye.ElInputNumber,M=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=h=>m.value=!0),onMouseout:n[2]||(n[2]=h=>m.value=!1)},[(Y=F.value.time)!=null&&Y.length?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(je,{variety:o.variety,data:F.value,activeIndex:q.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:O.value.showSubChart?"70%":"100%"})},[e.createVNode(He,{onCloseContextMenuCallBack:_e},{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=>xe(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),O.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:N,modelValue:E.value,"onUpdate:modelValue":n[0]||(n[0]=h=>E.value=h),data:F.value,cycle:o.cycle,activeIndex:q.value,subIndicatorList:(V=o.indicatorStore)==null?void 0:V.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",Je,[n[7]||(n[7]=e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),e.createElementVNode("div",Qe,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[...n[6]||(n[6]=[e.createTextVNode("刷新",-1)])]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(M,{modelValue:$.value,"onUpdate:modelValue":n[5]||(n[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",et,[e.createVNode(i,{onClick:n[4]||(n[4]=h=>$.value=!1)},{default:e.withCtx(()=>[...n[8]||(n[8]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(i,{type:"primary",onClick:be},{default:e.withCtx(()=>[...n[9]||(n[9]=[e.createTextVNode("确定",-1)])]),_:1})])]),default:e.withCtx(()=>[n[10]||(n[10]=e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),e.createVNode(c,{modelValue:X.value,"onUpdate:modelValue":n[3]||(n[3]=h=>X.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},nt=Z._export_sfc(tt,[["__scopeId","data-v-c051c308"]]),ot={install(o){o.component("st-klineBasic",nt)}};module.exports=ot;
1
+ "use strict";const he=require("./el-button-fac5e058.cjs"),ke=require("./el-dialog-54aebacd.cjs"),we=require("./el-empty-58bc2a10.cjs"),Ye=require("./el-input-number-f0f4eedb.cjs"),ie=require("./el-menu-item-c91ae430.cjs"),J=require("./index-ceae4c47.cjs"),B=require("./base-d987e5c9.cjs");require("./el-overlay-9f36e73c.cjs");require("./el-input-7fe53030.cjs");require("./el-popper-acd0ff35.cjs");require("./el-tooltip-0ea8fbf8.cjs");const e=require("vue"),De=require("echarts"),A=require("./index-94131fd7.cjs");require("./el-message-0ea8fbf8.cjs");const Z=require("./_plugin-vue_export-helper-f246444f.cjs"),se=require("./el-select-c317294a.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-tag-dca1292c.cjs");require("./index-5cada1ed.cjs");require("./use-form-item-76516e50.cjs");require("./index-d372e68f.cjs");require("./index-f5474dcc.cjs");require("./use-global-config-7ff9a1c2.cjs");require("./index-6a36e1fc.cjs");require("./index-71ba4c28.cjs");require("./clamp-17c4d8aa.cjs");require("./toNumber-b47ceb68.cjs");require("./vnode-6f7b84f0.cjs");require("./typescript-b63f8e83.cjs");require("./config-provider-bb61bd3e.cjs");require("./scroll-07bade1e.cjs");require("./raf-735cc598.cjs");require("./index-11181b5f.cjs");require("./castArray-d9ffe84a.cjs");require("./index-beb5cb7d.cjs");require("./index-21a3dc89.cjs");function Se(o){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const b in o)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(o,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>o[b]})}}return w.default=o,Object.freeze(w)}const oe=Se(De);let z=null;const Me=o=>{const w=A.y(o,{handleReq:b=>{A.V()&&(b.headers.token=A.R())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.A(),!0}});w.get,z=w.post},Ve=o=>z("/middleLayer/kline/getKlineBasic",{...o,userId:A.U("id")}),Le=o=>z("/middleLayer/kline/getKline",o),Be=async o=>z("/alarm/deliversign/addAlarmPrice",{...o,userId:A.U("id")}),Fe=async o=>z("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:A.U("id")}),ce=async o=>z("/alarm/deliversign/updateAlarmPrice",{...o,userId:A.U("id")}),Ae=async o=>z("/alarm/deliversign/deleteAlarmPrice",{...o,userId:A.U("id")}),{round:C}=A.x,Ne=(o,w,b,r,s)=>{const{data:t,time:y}=o,{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}},...o.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)"}}}},qe=(o,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=o==null?void 0:o.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(o==null?void 0:o.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:(o==null?void 0:o.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(o==null?void 0:o.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=o.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 q=o==null?void 0:o.convertFromPixel({yAxisIndex:0},E+k),F={id:l.id,warnPrice:C(q,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(o){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(o);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 Ee=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){const w=o,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(o.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=Z._export_sfc(Ee,[["__scopeId","data-v-0ed8d951"]]);const Te={class:"kline-tips"},Re={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(o){const{round:w,formatValue:b}=A.x,r=o,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",Te,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},je=Z._export_sfc(Re,[["__scopeId","data-v-db894a3c"]]),Oe={class:"kline-averageTips"},$e=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(w,b)=>(e.openBlock(),e.createElementBlock("div",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.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=Z._export_sfc($e,[["__scopeId","data-v-c544514b"]]);const Ie={class:"klineSub"},We={class:"klineSub-tips"},Ce={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(o,{expose:w,emit:b}){const{round:r}=A.x;let s=null,t=null;const y=e.ref(!0),u=b,f=o,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:q}=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((j,$)=>_.seriesColor==="kline"?{value:j,itemStyle:l(f.data.data,$)}:_.seriesColor==="value"?{value:j,itemStyle:{color:j>=0?"#FF0000":"#00FFFF"}}:{value:j,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:j,value:$}=_;if(j==="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:q==="cover"?_=>_.min:null,max:q==="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",Ie,[e.createElementVNode("div",We,[D.value.length?(e.openBlock(),e.createElementBlock("div",Ce,[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(o.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=Z._export_sfc(ze,[["__scopeId","data-v-6e6b5f5b"]]),Ze=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{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 He=Z._export_sfc(Ze,[["__scopeId","data-v-8d581ce9"]]);const Ke={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Ge={key:2,class:"klineBasic-empty"},Je={key:3,class:"klineBasic-error"},Qe={style:{"text-align":"center"}},et={class:"dialog-footer"},tt={__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(o,{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=o,m=e.ref(!1),k=e.ref(!1),L=e.ref(!1),S=e.ref(null),N=e.ref(null),E=e.ref("VOL"),q=e.ref(0),F=e.ref({}),_=e.ref([]),j=e.ref({}),$=e.ref(!1),X=e.ref(""),Q=e.ref([...r]),O=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),fe=()=>{t||(t=oe.init(S.value),ge(),O.value.showSubChart&&N.value.connect(t),s=A.D(S.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(a=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{pe(a),y=requestAnimationFrame(()=>{me(),y=requestAnimationFrame(()=>{H(),y=null})})})},pe=(a=!1)=>{var c,M,Y;if(!t||t.isDisposed())return;const{time:n}=F.value,{defaultShowCounts:v}=O.value;let d=n.length-1-v,x=n.length-1;if(a&&t){const V=t.getOption(),h=(M=(c=V==null?void 0:V.xAxis)==null?void 0:c[0])==null?void 0:M.data,T=(Y=V==null?void 0:V.dataZoom)==null?void 0:Y[0];if(h!=null&&h.length&&T){const I=h[T.startValue],W=h[T.endValue];if(I&&W){const ne=n.findIndex(K=>new Date(K).getTime()>=new Date(I).getTime()),U=n.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=U!==-1?U:n.length-1,d>x&&(d=Math.max(0,x-Math.min(100,n.length-1)))}}}const i=Ne(F.value,O.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),q.value=x,requestAnimationFrame(()=>{ye()})})},me=()=>{var M;if(!O.value.showSubChart||!N.value)return;const{time:a}=F.value,{gridLeft:n,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=O.value;let i=a.length-1-x,c=a.length-1;if(t&&!t.isDisposed()){const Y=t.getOption();if((M=Y==null?void 0:Y.dataZoom)!=null&&M[0]){const{startValue:V,endValue:h}=Y.dataZoom[0];V!==void 0&&h!==void 0&&(i=V,c=h)}}requestAnimationFrame(()=>{var Y;(Y=N.value)==null||Y.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:n,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const n=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!n||!v||(t==null||t.setOption({graphic:qe(t,_.value,l,O.value,()=>{G()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ye=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:a}=F.value;if(!l.brushRange||!(a!=null&&a.length)||!t)return;let n=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=a.find(i=>B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(n).format("YYYY-MM-DD")),x=d;break}case"7":{d=a.find(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(n).day(5).format("YYYY-MM-DD")),x=a.findLast(i=>B.dayjs(i).day(5).format("YYYY-MM-DD")===B.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=a.find(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(n).endOf("month").format("YYYY-MM-DD")),x=a.findLast(i=>B.dayjs(i).endOf("month").format("YYYY-MM-DD")===B.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=a.find(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(n).format("YYYY-MM-DD"),M=new Date(i).getTime()>=new Date(n).getTime();return c&&M}),x=a.findLast(i=>{const c=B.dayjs(i).format("YYYY-MM-DD")===B.dayjs(v).format("YYYY-MM-DD"),M=new Date(i).getTime()<=new Date(v).getTime();return c&&M})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var a,n,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:M,cycle:Y,indicatorStore:V,mainIndicator:h,right:T,startTime:I,endTime:W}=l,{defaultShowCounts:ne,addCounts:U,showWarningLine:K,getFactorData:re}=O.value;fe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const P={variety:c,featureId:M,cycle:Y,mainIndicatorList:V.getIndicatorParams(h),subIndicator:E.value,right:T,showWarningLine:K,getFactorData:re};I&&W?(P.startTime=I,P.endTime=W):I?(P.startTime=I,P.limit=U):W?(P.endTime=W,P.limit=U):(P.endTime=B.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),P.limit=U);const R=await Ve(P);if(!((v=(n=(a=R==null?void 0:R.body)==null?void 0:a.kline)==null?void 0:n.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){ee(),console.error("KlineBasic getMainData 失败:",c),L.value=!0,k.value=!1}},ve=async a=>{const{variety:n,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=O.value,{time:M}=F.value;if(a==="history"){const Y=await Le({variety:n,cycle:v,endTime:M[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((V,h)=>{var T;return{...V,data:[...((T=Y.body.mainIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((V,h)=>{var T;return{...V,data:[...((T=Y.body.subIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),Y.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:a,ctrlKey:n})=>{if(!(n||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(a){case"ArrowUp":{if(c-i<5)return;const M=Math.floor((c-i)/2)+1;i=i+M,c-i<5&&(i=c-4);break}case"ArrowDown":{const M=Math.min(500,c-i);i=i-M-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),q.value>0&&(q.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&q.value<x.length-1&&(q.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?q.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?q.value:c})})}},ge=()=>{t==null||t.on("datazoom",A.j(a=>{var v,d,x,i;const{loadCheckCounts:n}=O.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<n&&!p&&!g&&(p=!0,ve("history")),H()}},100)),t==null||t.on("highlight",A.j(a=>{var v,d;let n=a.dataIndex||-1;a.batch&&(n=typeof((v=a==null?void 0:a.batch[0])==null?void 0:v.dataIndex)=="number"?(d=a==null?void 0:a.batch[0])==null?void 0:d.dataIndex:-1),q.value=n},20)),t==null||t.on("globalout",A.j(()=>{var a,n,v;if(t){const d=(v=(n=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:n[0])==null?void 0:v.endValue;q.value=d}},30)),t==null||t.on("contextmenu",A.j(a=>{a.componentType==="graphic"&&(j.value=a.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},G=async()=>{const a=await Fe({featureId:l.featureId});_.value=(a==null?void 0:a.body)||[],H(),D("change","warningLine",_.value)},xe=async a=>{const{variety:n,varietyName:v,featureId:d,featureType:x}=l;if(a.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 M=async Y=>{t==null||t.getZr().off("mousedown",M);const V=t==null?void 0:t.convertFromPixel({yAxisIndex:0},Y.offsetY),h=Math.round(V*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 Be({featureCode:n,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),G()};t==null||t.getZr().on("mousedown",M)}else a.key==="deleteWarningLine"?(await Ae({id:j.value.id}),J.ElMessage.success("画线预警删除成功"),G()):a.key==="changeWarningLine"&&($.value=!0,X.value=j.value.warnPrice)},be=async()=>{const{variety:a,varietyName:n,featureId:v,featureType:d}=l;await ce({id:j.value.id,featureCode:a,featureName:n,featureId:v,featureType:d,warnPrice:X.value}),J.ElMessage.success("画线预警修改成功"),G()},_e=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var a,n;return[l.variety,l.cycle,l.mainIndicator,E.value,(a=l.indicatorStore)==null?void 0:a.filterIndicator,(n=l.indicatorStore)==null?void 0:n.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:(a,n)=>{a==="warningLine"&&(_.value=n,H())}}),(a,n)=>{var Y,V;const v=ie.ElMenuItem,d=ie.ElMenu,x=we.ElEmpty,i=he.ElButton,c=Ye.ElInputNumber,M=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=h=>m.value=!0),onMouseout:n[2]||(n[2]=h=>m.value=!1)},[(Y=F.value.time)!=null&&Y.length?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(je,{variety:o.variety,data:F.value,activeIndex:q.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:O.value.showSubChart?"70%":"100%"})},[e.createVNode(He,{onCloseContextMenuCallBack:_e},{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=>xe(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),O.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:N,modelValue:E.value,"onUpdate:modelValue":n[0]||(n[0]=h=>E.value=h),data:F.value,cycle:o.cycle,activeIndex:q.value,subIndicatorList:(V=o.indicatorStore)==null?void 0:V.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("div",Je,[n[7]||(n[7]=e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),e.createElementVNode("div",Qe,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[...n[6]||(n[6]=[e.createTextVNode("刷新",-1)])]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(M,{modelValue:$.value,"onUpdate:modelValue":n[5]||(n[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",et,[e.createVNode(i,{onClick:n[4]||(n[4]=h=>$.value=!1)},{default:e.withCtx(()=>[...n[8]||(n[8]=[e.createTextVNode("取消",-1)])]),_:1}),e.createVNode(i,{type:"primary",onClick:be},{default:e.withCtx(()=>[...n[9]||(n[9]=[e.createTextVNode("确定",-1)])]),_:1})])]),default:e.withCtx(()=>[n[10]||(n[10]=e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),e.createVNode(c,{modelValue:X.value,"onUpdate:modelValue":n[3]||(n[3]=h=>X.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},nt=Z._export_sfc(tt,[["__scopeId","data-v-28fac523"]]),ot={install(o){o.component("st-klineBasic",nt)}};module.exports=ot;
package/es/KlineBasic.js CHANGED
@@ -1,45 +1,45 @@
1
- import { E as Ie } from "./el-button-8a9721f8.js";
2
- import { E as We } from "./el-dialog-67536fac.js";
1
+ import { E as Ie } from "./el-button-ee9fe159.js";
2
+ import { E as We } from "./el-dialog-060b3735.js";
3
3
  import { E as qe } from "./el-empty-552baf04.js";
4
- import { E as ze } from "./el-input-number-68ee0d65.js";
5
- import { E as Ze, a as Ue } from "./el-menu-item-c2523d82.js";
6
- import { E as ce } from "./index-2419d69a.js";
4
+ import { E as ze } from "./el-input-number-484fb184.js";
5
+ import { E as Ze, a as Ke } from "./el-menu-item-0ac22681.js";
6
+ import { E as ce } from "./index-e2e58ea9.js";
7
7
  import { d as F } from "./base-dd156b8e.js";
8
- import "./el-overlay-36f223e9.js";
9
- import "./el-input-e66500b7.js";
10
- import "./el-popper-852446fd.js";
8
+ import "./el-overlay-cb5c85aa.js";
9
+ import "./el-input-d23f5442.js";
10
+ import "./el-popper-0454c8e8.js";
11
11
  import "./el-tooltip-4ed993c7.js";
12
- import { defineComponent as be, 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 $, onMounted as Se, onUnmounted as Me, createElementVNode as U, withCtx as z, createBlock as Le, createCommentVNode as G, renderSlot as Ye, createTextVNode as ue } from "vue";
12
+ import { defineComponent as be, 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 $, onMounted as Se, onUnmounted as Me, createElementVNode as K, withCtx as z, createBlock as Le, createCommentVNode as G, renderSlot as Ye, createTextVNode as ue } from "vue";
13
13
  import * as xe from "echarts";
14
- import { y as He, V as Ke, R as je, A as Ce, U as ie, x as _e, D as Xe, j as de } from "./index-53cc4e43.js";
14
+ import { y as Ue, V as He, R as je, A as Ce, U as ie, x as _e, D as Xe, j as de } from "./index-53cc4e43.js";
15
15
  import "./el-message-4ed993c7.js";
16
16
  import { _ as J } from "./_plugin-vue_export-helper-dad06003.js";
17
- import { E as Ge, a as Je } from "./el-select-a34348e1.js";
17
+ import { E as Ge, a as Je } from "./el-select-a573c78b.js";
18
18
  import "./el-scrollbar-0a42c1d0.js";
19
- import "./el-tag-9bcfae32.js";
20
- import "./index-60900c6c.js";
21
- import "./use-form-item-187cd7db.js";
19
+ import "./el-tag-2d8a3fe7.js";
20
+ import "./index-6a52dc7c.js";
21
+ import "./use-form-item-784142b4.js";
22
22
  import "./index-a181f161.js";
23
23
  import "./index-de9ad85c.js";
24
- import "./use-global-config-17dafd40.js";
25
- import "./index-47d30a52.js";
24
+ import "./use-global-config-9a4ccf33.js";
25
+ import "./index-9573f74b.js";
26
26
  import "./index-3806160e.js";
27
27
  import "./clamp-c7512966.js";
28
28
  import "./toNumber-f077c66a.js";
29
29
  import "./vnode-8ee9bf4e.js";
30
30
  import "./typescript-7ae59c4c.js";
31
- import "./config-provider-563023c9.js";
31
+ import "./config-provider-06d8207f.js";
32
32
  import "./scroll-70271cb1.js";
33
33
  import "./raf-b4fd1e12.js";
34
- import "./index-7c4d8f5d.js";
34
+ import "./index-dddacf80.js";
35
35
  import "./castArray-18eb6a41.js";
36
- import "./index-a0522466.js";
37
- import "./index-86678b72.js";
36
+ import "./index-d9379af4.js";
37
+ import "./index-c09fc6f5.js";
38
38
  let C = null;
39
39
  const Qe = (o) => {
40
- const w = He(o, {
40
+ const w = Ue(o, {
41
41
  handleReq: (h) => {
42
- Ke() && (h.headers.token = je());
42
+ He() && (h.headers.token = je());
43
43
  },
44
44
  handleRes: (h) => {
45
45
  const { data: r } = h;
@@ -571,7 +571,7 @@ const mt = { class: "klineSub" }, vt = { class: "klineSub-tips" }, yt = {
571
571
  }), (p, _) => {
572
572
  const L = Ge, D = Je;
573
573
  return T(), E("div", mt, [
574
- U("div", vt, [
574
+ K("div", vt, [
575
575
  Y.value.length ? (T(), E("div", yt, [
576
576
  $(D, {
577
577
  modelValue: y.value,
@@ -592,7 +592,7 @@ const mt = { class: "klineSub" }, vt = { class: "klineSub-tips" }, yt = {
592
592
  ])) : G("", !0),
593
593
  $(pt, { data: Y.value }, null, 8, ["data"])
594
594
  ]),
595
- U("div", {
595
+ K("div", {
596
596
  class: "klineSub-chart",
597
597
  ref_key: "subChartRef",
598
598
  ref: f
@@ -755,9 +755,9 @@ const ht = {
755
755
  if (n && e) {
756
756
  const M = e.getOption(), b = (S = (u = M == null ? void 0 : M.xAxis) == null ? void 0 : u[0]) == null ? void 0 : S.data, O = (k = M == null ? void 0 : M.dataZoom) == null ? void 0 : k[0];
757
757
  if (b != null && b.length && O) {
758
- const H = b[O.startValue], K = b[O.endValue];
759
- if (H && K) {
760
- const ge = t.findIndex((ee) => new Date(ee).getTime() >= new Date(H).getTime()), X = t.findLastIndex((ee) => new Date(ee).getTime() <= new Date(K).getTime());
758
+ const U = b[O.startValue], H = b[O.endValue];
759
+ if (U && H) {
760
+ const ge = t.findIndex((ee) => new Date(ee).getTime() >= new Date(U).getTime()), X = t.findLastIndex((ee) => new Date(ee).getTime() <= new Date(H).getTime());
761
761
  d = ge !== -1 ? ge : 0, g = X !== -1 ? X : t.length - 1, d > g && (d = Math.max(0, g - Math.min(100, t.length - 1)));
762
762
  }
763
763
  }
@@ -847,7 +847,7 @@ const ht = {
847
847
  try {
848
848
  if (!a.variety || !a.cycle)
849
849
  return;
850
- const { variety: u, featureId: S, cycle: k, indicatorStore: M, mainIndicator: b, right: O, startTime: H, endTime: K } = a, { defaultShowCounts: ge, addCounts: X, showWarningLine: ee, getFactorData: ke } = W.value;
850
+ const { variety: u, featureId: S, cycle: k, indicatorStore: M, mainIndicator: b, right: O, startTime: U, endTime: H } = a, { defaultShowCounts: ge, addCounts: X, showWarningLine: ee, getFactorData: ke } = W.value;
851
851
  Te(), e && !e.isDisposed() && e.showLoading({
852
852
  text: "加载中...",
853
853
  color: "#409eff",
@@ -865,7 +865,7 @@ const ht = {
865
865
  showWarningLine: ee,
866
866
  getFactorData: ke
867
867
  };
868
- H && K ? (Z.startTime = H, Z.endTime = K) : H ? (Z.startTime = H, Z.limit = X) : K ? (Z.endTime = K, Z.limit = X) : (Z.endTime = F().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), Z.limit = X);
868
+ U && H ? (Z.startTime = U, Z.endTime = H) : U ? (Z.startTime = U, Z.limit = X) : H ? (Z.endTime = H, Z.limit = X) : (Z.endTime = F().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), Z.limit = X);
869
869
  const P = await et(Z);
870
870
  if (!((v = (t = (n = P == null ? void 0 : P.body) == null ? void 0 : n.kline) == null ? void 0 : t.time) != null && v.length)) {
871
871
  _.value = !0, L.value = !1, ve();
@@ -873,7 +873,7 @@ const ht = {
873
873
  }
874
874
  _.value = !1, L.value = !1, V.value = (d = P == null ? void 0 : P.body) == null ? void 0 : d.kline, x.value = ((g = P == null ? void 0 : P.body) == null ? void 0 : g.warningLine) || [], await ne(), he(!1), ke && Y("getFactorData", (l = P == null ? void 0 : P.body) == null ? void 0 : l.factor), ve();
875
875
  } catch (u) {
876
- throw ve(), L.value = !0, _.value = !1, new Error(u);
876
+ ve(), console.error("KlineBasic getMainData 失败:", u), L.value = !0, _.value = !1;
877
877
  }
878
878
  }, Be = async (n) => {
879
879
  const { variety: t, cycle: v, indicatorStore: d, mainIndicator: g, right: l } = a, { addCounts: u } = W.value, { time: S } = V.value;
@@ -1064,9 +1064,9 @@ const ht = {
1064
1064
  }
1065
1065
  }), (n, t) => {
1066
1066
  var k, M;
1067
- const v = Ze, d = Ue, g = qe, l = Ie, u = ze, S = We;
1067
+ const v = Ze, d = Ke, g = qe, l = Ie, u = ze, S = We;
1068
1068
  return T(), E(oe, null, [
1069
- U("div", {
1069
+ K("div", {
1070
1070
  class: "klineBasic",
1071
1071
  onMousemove: t[1] || (t[1] = (b) => p.value = !0),
1072
1072
  onMouseout: t[2] || (t[2] = (b) => p.value = !1)
@@ -1078,7 +1078,7 @@ const ht = {
1078
1078
  activeIndex: B.value
1079
1079
  }, null, 8, ["variety", "data", "activeIndex"])
1080
1080
  ])) : G("", !0),
1081
- U("div", {
1081
+ K("div", {
1082
1082
  class: "klineBasic-main",
1083
1083
  style: pe({ height: W.value.showSubChart ? "70%" : "100%" })
1084
1084
  }, [
@@ -1107,7 +1107,7 @@ const ht = {
1107
1107
  })
1108
1108
  ]),
1109
1109
  default: z(() => [
1110
- U("div", {
1110
+ K("div", {
1111
1111
  ref_key: "klineBasicMainRef",
1112
1112
  ref: D,
1113
1113
  style: { height: "100%" }
@@ -1135,8 +1135,8 @@ const ht = {
1135
1135
  })
1136
1136
  ])) : G("", !0),
1137
1137
  L.value ? (T(), E("div", Yt, [
1138
- t[7] || (t[7] = U("div", { class: "klineBasic-error-content" }, "加载失败,请刷新重试", -1)),
1139
- U("div", Dt, [
1138
+ t[7] || (t[7] = K("div", { class: "klineBasic-error-content" }, "加载失败,请刷新重试", -1)),
1139
+ K("div", Dt, [
1140
1140
  $(l, { onClick: ye }, {
1141
1141
  default: z(() => [...t[6] || (t[6] = [
1142
1142
  ue("刷新", -1)
@@ -1154,7 +1154,7 @@ const ht = {
1154
1154
  "align-center": ""
1155
1155
  }, {
1156
1156
  footer: z(() => [
1157
- U("span", St, [
1157
+ K("span", St, [
1158
1158
  $(l, {
1159
1159
  onClick: t[4] || (t[4] = (b) => q.value = !1)
1160
1160
  }, {
@@ -1175,7 +1175,7 @@ const ht = {
1175
1175
  ])
1176
1176
  ]),
1177
1177
  default: z(() => [
1178
- t[10] || (t[10] = U("span", { style: { "margin-right": "10px" } }, "预警价格:", -1)),
1178
+ t[10] || (t[10] = K("span", { style: { "margin-right": "10px" } }, "预警价格:", -1)),
1179
1179
  $(u, {
1180
1180
  modelValue: re.value,
1181
1181
  "onUpdate:modelValue": t[3] || (t[3] = (b) => re.value = b),
@@ -1187,7 +1187,7 @@ const ht = {
1187
1187
  ], 64);
1188
1188
  };
1189
1189
  }
1190
- }, Lt = /* @__PURE__ */ J(Mt, [["__scopeId", "data-v-c051c308"]]), fn = {
1190
+ }, Lt = /* @__PURE__ */ J(Mt, [["__scopeId", "data-v-28fac523"]]), fn = {
1191
1191
  install(o) {
1192
1192
  o.component("st-klineBasic", Lt);
1193
1193
  }
@@ -1 +1 @@
1
- "use strict";const F=require("./index-3a0a7c36.cjs"),M=require("./el-button-8259594b.cjs"),O=require("./el-select-d2958ae8.cjs"),K=require("./el-checkbox-6303fc92.cjs"),H=require("./el-divider-3f0320be.cjs"),s=require("./base-d987e5c9.cjs"),j=require("./index-f5474dcc.cjs"),W=require("./index-d372e68f.cjs"),z=require("./index-3e7d5ffb.cjs"),w=require("./el-popper-f824c63b.cjs"),A=require("./el-overlay-17299785.cjs"),N=require("./use-form-item-0a831287.cjs"),e=require("vue"),G=require("./validator-ee5bc3eb.cjs"),J=require("./el-segmented-45dcc036.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-tag-527f06f0.cjs");const X=require("./_plugin-vue_export-helper-f246444f.cjs");require("./use-global-config-c90c91f7.cjs");require("./index-3ed0c678.cjs");require("./index-71ba4c28.cjs");require("./castArray-d9ffe84a.cjs");require("./vnode-6f7b84f0.cjs");require("./index-5e76a22d.cjs");require("./scroll-07bade1e.cjs");require("./index-7711aa69.cjs");require("./toNumber-b47ceb68.cjs");require("./clamp-17c4d8aa.cjs");require("./_baseClone-10bdb989.cjs");const Y=s.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"}}),_={...A.dialogEmits,"resize-start":(t,f)=>t instanceof MouseEvent&&typeof f=="number",resize:(t,f)=>t instanceof MouseEvent&&typeof f=="number","resize-end":(t,f)=>t instanceof MouseEvent&&typeof f=="number"};function Q(t,f,y){const{width:i,height:k}=N.useWindowSize(),d=e.computed(()=>["ltr","rtl"].includes(t.direction)),g=e.computed(()=>["ltr","ttb"].includes(t.direction)?1:-1),n=e.computed(()=>d.value?i.value:k.value),b=e.computed(()=>s.clamp(r.value+g.value*B.value,4,n.value)),r=e.ref(0),B=e.ref(0),V=e.ref(!1),h=e.ref(!1);let S=[],u=[];const l=()=>{var a;const m=(a=f.value)==null?void 0:a.closest('[aria-modal="true"]');return m?d.value?m.offsetWidth:m.offsetHeight:100};e.watch(()=>[t.size,t.resizable],()=>{h.value=!1,r.value=0,B.value=0,p()});const C=m=>{t.resizable&&(h.value||(r.value=l(),h.value=!0),S=[m.pageX,m.pageY],V.value=!0,y("resize-start",m,r.value),u.push(N.useEventListener(window,"mouseup",p),N.useEventListener(window,"mousemove",c)))},c=m=>{const{pageX:a,pageY:v}=m,x=a-S[0],T=v-S[1];B.value=d.value?x:T,y("resize",m,b.value)},p=m=>{V.value&&(S=[],r.value=b.value,B.value=0,V.value=!1,u.forEach(a=>a==null?void 0:a()),u=[],m&&y("resize-end",m,r.value))},I=N.useEventListener(f,"mousedown",C);return e.onBeforeUnmount(()=>{I(),p()}),{size:e.computed(()=>h.value?`${b.value}px`:s.addUnit(t.size)),isResizing:V,isHorizontal:d}}const Z=["aria-label","aria-labelledby","aria-describedby"],ee=["id","aria-level"],te=["aria-label"],le=["id"];var ne=e.defineComponent({name:"ElDrawer",inheritAttrs:!1,__name:"drawer",props:Y,emits:_,setup(t,{expose:f,emit:y}){const i=t,k=y,d=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(()=>!!d.title));const g=e.ref(),n=e.ref(),b=e.ref(),r=s.useNamespace("drawer"),{t:B}=W.useLocale(),{afterEnter:V,afterLeave:h,beforeLeave:S,visible:u,rendered:l,titleId:C,bodyId:c,zIndex:p,onModalClick:I,onOpenAutoFocus:m,onCloseAutoFocus:a,onFocusoutPrevented:v,onCloseRequested:x,handleClose:T}=A.useDialog(i,g),{isHorizontal:o,size:E,isResizing:q}=Q(i,b,k),U=e.computed(()=>i.modalPenetrable&&!i.modal);return f({handleClose:T}),(P,L)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.appendTo,disabled:t.appendTo!=="body"?!1:!t.appendToBody},[e.createVNode(e.Transition,{name:e.unref(r).b("fade"),onAfterEnter:e.unref(V),onAfterLeave:e.unref(h),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:t.modal,"overlay-class":[e.unref(r).is("drawer"),t.modalClass??"",`${e.unref(r).namespace.value}-modal-drawer`,e.unref(r).is("penetrable",U.value)],"z-index":e.unref(p),onClick:e.unref(I)},{default:e.withCtx(()=>[e.createVNode(e.unref(w.focus_trap_default$1),{loop:"",trapped:e.unref(u),"focus-trap-el":g.value,"focus-start-el":n.value,onFocusAfterTrapped:e.unref(m),onFocusAfterReleased:e.unref(a),onFocusoutPrevented:e.unref(v),onReleaseRequested:e.unref(x)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:g,"aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:e.unref(C),"aria-describedby":e.unref(c)},P.$attrs,{class:[e.unref(r).b(),t.direction,e.unref(u)&&"open",e.unref(r).is("dragging",e.unref(q))],style:{[e.unref(o)?"width":"height"]:e.unref(E)},role:"dialog",onClick:L[1]||(L[1]=e.withModifiers(()=>{},["stop"]))}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:n,class:e.normalizeClass(e.unref(r).e("sr-focus")),tabindex:"-1"},null,2),t.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(r).e("header"),t.headerClass])},[P.$slots.title?e.renderSlot(P.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(P.$slots,"header",{key:0,close:e.unref(T),titleId:e.unref(C),titleClass:e.unref(r).e("title")},()=>[e.createElementVNode("span",{id:e.unref(C),role:"heading","aria-level":t.headerAriaLevel,class:e.normalizeClass(e.unref(r).e("title"))},e.toDisplayString(t.title),11,ee)]),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(B)("el.drawer.close"),class:e.normalizeClass(e.unref(r).e("close-btn")),type:"button",onClick:L[0]||(L[0]=(...R)=>e.unref(T)&&e.unref(T)(...R))},[e.createVNode(e.unref(z.ElIcon),{class:e.normalizeClass(e.unref(r).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.close_default))]),_:1},8,["class"])],10,te)):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(l)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(c),class:e.normalizeClass([e.unref(r).e("body"),t.bodyClass])},[e.renderSlot(P.$slots,"default")],10,le)):e.createCommentVNode("v-if",!0),P.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(r).e("footer"),t.footerClass])},[e.renderSlot(P.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),t.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:b,style:e.normalizeStyle({zIndex:e.unref(p)}),class:e.normalizeClass(e.unref(r).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,Z)]),_: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(u)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["to","disabled"]))}}),ae=ne;const oe=s.withInstall(ae),re=s.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:G.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:N.iconPropType},activeActionIcon:{type:N.iconPropType},activeIcon:{type:N.iconPropType},inactiveIcon:{type:N.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:s.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...w.useAriaProps(["ariaLabel"])}),ie={[w.UPDATE_MODEL_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t),[w.CHANGE_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t),[w.INPUT_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t)},se=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],ce=["aria-hidden"],ue={key:1},de={key:1},me=["aria-hidden"],D="ElSwitch";var ve=e.defineComponent({name:D,__name:"switch",props:re,emits:ie,setup(t,{expose:f,emit:y}){const i=t,k=y,{formItem:d}=N.useFormItem(),g=N.useFormSize(),n=s.useNamespace("switch"),{inputId:b}=N.useFormItemInputId(i,{formItemContext:d}),r=N.useFormDisabled(e.computed(()=>{if(i.loading)return!0})),B=e.ref(i.modelValue!==!1),V=e.shallowRef(),h=e.computed(()=>[n.b(),n.m(g.value),n.is("disabled",r.value),n.is("checked",c.value)]),S=e.computed(()=>[n.e("label"),n.em("label","left"),n.is("active",!c.value)]),u=e.computed(()=>[n.e("label"),n.em("label","right"),n.is("active",c.value)]),l=e.computed(()=>({width:s.addUnit(i.width)}));e.watch(()=>i.modelValue,()=>{B.value=!0});const C=e.computed(()=>B.value?i.modelValue:!1),c=e.computed(()=>C.value===i.activeValue);[i.activeValue,i.inactiveValue].includes(C.value)||(s.debugWarn(D,"model-value must be active-value or inactive-value"),k(w.UPDATE_MODEL_EVENT,i.inactiveValue),k(w.CHANGE_EVENT,i.inactiveValue),k(w.INPUT_EVENT,i.inactiveValue)),e.watch(c,a=>{var v;V.value.checked=a,i.validateEvent&&((v=d==null?void 0:d.validate)==null||v.call(d,"change").catch(s.NOOP))});const p=()=>{const a=c.value?i.inactiveValue:i.activeValue;k(w.UPDATE_MODEL_EVENT,a),k(w.CHANGE_EVENT,a),k(w.INPUT_EVENT,a),e.nextTick(()=>{V.value.checked=c.value})},I=()=>{if(r.value)return;const{beforeChange:a}=i;if(!a){p();return}const v=a();[s.isPromise(v),s.isBoolean(v)].includes(!0)||s.throwError(D,"beforeChange must return type `Promise<boolean>` or `boolean`"),s.isPromise(v)?v.then(x=>{x&&p()}).catch(x=>{s.debugWarn(D,`some error occurred: ${x}`)}):v&&p()},m=()=>{var a,v;(v=(a=V.value)==null?void 0:a.focus)==null||v.call(a)};return e.onMounted(()=>{V.value.checked=c.value}),f({focus:m,checked:c}),(a,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(h.value),onClick:e.withModifiers(I,["prevent"])},[e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:V,class:e.normalizeClass(e.unref(n).e("input")),type:"checkbox",role:"switch","aria-checked":c.value,"aria-disabled":e.unref(r),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(r),tabindex:t.tabindex,onChange:p,onKeydown:e.withKeys(I,["enter"])},null,42,se),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText||a.$slots.inactive)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(S.value)},[e.renderSlot(a.$slots,"inactive",{},()=>[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(z.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":c.value},e.toDisplayString(t.inactiveText),9,ce)):e.createCommentVNode("v-if",!0)])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("core")),style:e.normalizeStyle(l.value)},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("inner"))},[c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).e("inner-wrapper"))},[e.renderSlot(a.$slots,"active",{},()=>[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(z.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",de,e.toDisplayString(t.activeText),1)):e.createCommentVNode("v-if",!0)])],2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("inner-wrapper"))},[e.renderSlot(a.$slots,"inactive",{},()=>[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(z.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",ue,e.toDisplayString(t.inactiveText),1)):e.createCommentVNode("v-if",!0)])],2))],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(z.ElIcon),{key:0,class:e.normalizeClass(e.unref(n).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.loading_default))]),_:1},8,["class"])):c.value?e.renderSlot(a.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(z.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):c.value?e.createCommentVNode("v-if",!0):e.renderSlot(a.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(z.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||a.$slots.active)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(u.value)},[e.renderSlot(a.$slots,"active",{},()=>[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(z.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":!c.value},e.toDisplayString(t.activeText),9,me)):e.createCommentVNode("v-if",!0)])],2)):e.createCommentVNode("v-if",!0)],2))}}),fe=ve;const pe=s.withInstall(fe);const be=[{label:"买卖",value:0},{label:"开平",value:1}],$=()=>({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}),Ve=(t,f)=>{var y;return((y=f.find(i=>i.value===t))==null?void 0:y.label)??"-"};const ye={class:"kline-config element-dark"},ke={class:"setting-item"},ge={class:"setting-item"},Ce={class:"setting-item"},Ee={class:"setting-item"},Ne={class:"setting-item"},Be={class:"mode"},we={class:"cycleName"},he={class:"content"},Se={class:"setting-item"},xe={class:"setting-item"},ze={class:"setting-item"},Ie={class:"setting-item"},Te={class:"setting-item"},Pe={class:"setting-item"},qe={class:"setting-item"},Le={class:"setting-footer"},De={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(t,{expose:f,emit:y}){const{request:i}=e.inject("stConfig"),k=y,d=t,g=e.ref(!1),n=e.reactive({}),b=e.ref([]),r=e.ref([]),B=()=>{Object.assign(n,$())},V=async()=>{const u=JSON.stringify(n);d.origin==="server"?await i.post("/common/qt/updateUserConfig",{appId:1,json:u}):localStorage.setItem("userKlineConfig",u),k("callBack",u),g.value=!1},h=async()=>{if(d.origin==="server"){const{body:u}=await i.post("/common/qt/getUserConfig",{appId:1});Object.assign(n,$(),u?JSON.parse(u):{})}else{const u=localStorage.getItem("userKlineConfig");Object.assign(n,$(),u?JSON.parse(u):{})}},S=async()=>{if(d.origin==="server"){const{body:u}=await i.post("/common/qt/getDict",{dictIds:[1002]});b.value=u[1002].map(l=>({label:l.dictName,value:l.dictCode}))}else b.value=d.cycleOptions};return e.onMounted(()=>{S(),r.value=d.indicatorStore.mainIndicatorList??[]}),e.watch(()=>d.indicatorStore.mainIndicatorList,()=>{r.value=d.indicatorStore.mainIndicatorList??[]}),f({open:async()=>{await h(),g.value=!0},getDefaultUserKlineConfig:$}),(u,l)=>{const C=H.ElDivider,c=O.ElOption,p=O.ElSelect,I=K.ElCheckbox,m=J.ElSegmented,a=pe,v=F.ElScrollbar,x=M.ElButton,T=oe;return e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(T,{modelValue:g.value,"onUpdate:modelValue":l[12]||(l[12]=o=>g.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(v,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(C,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("偏好设置",-1)])]),_:1}),e.createElementVNode("div",ke,[l[14]||(l[14]=e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),e.createVNode(p,{modelValue:n.mainIndicator,"onUpdate:modelValue":l[0]||(l[0]=o=>n.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ge,[l[15]||(l[15]=e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),e.createVNode(p,{modelValue:n.sellBuy,"onUpdate:modelValue":l[1]||(l[1]=o=>n.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(be),(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",Ce,[l[16]||(l[16]=e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),e.createVNode(I,{modelValue:n.sellBuyByPrice,"onUpdate:modelValue":l[2]||(l[2]=o=>n.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ee,[l[17]||(l[17]=e.createElementVNode("span",{class:"label"},"单周期: ",-1)),e.createVNode(p,{modelValue:n.singelCycle,"onUpdate:modelValue":l[3]||(l[3]=o=>n.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",Ne,[l[18]||(l[18]=e.createElementVNode("span",{class:"label"},"多周期: ",-1)),e.createVNode(m,{size:"small",modelValue:n.multiCycleNum,"onUpdate:modelValue":l[4]||(l[4]=o=>n.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-${n.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.multiCycleList.slice(0,n.multiCycleNum),(o,E)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",we,[e.createElementVNode("span",null,e.toDisplayString(e.unref(Ve)(n.multiCycleList[E],b.value)),1),e.createVNode(p,{modelValue:n.multiCycleList[E],"onUpdate:modelValue":q=>n.multiCycleList[E]=q,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(q,U)=>(e.openBlock(),e.createBlock(c,{key:U,label:q.label,value:q.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",he,e.toDisplayString(E+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Se,[l[19]||(l[19]=e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),e.createVNode(m,{size:"small",modelValue:n.pageType,"onUpdate:modelValue":l[5]||(l[5]=o=>n.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(C,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[...l[20]||(l[20]=[e.createTextVNode("功能配置",-1)])]),_:1}),e.createElementVNode("div",xe,[l[21]||(l[21]=e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),e.createVNode(a,{modelValue:n.enable_tradeLogBrush,"onUpdate:modelValue":l[6]||(l[6]=o=>n.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[l[22]||(l[22]=e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),e.createVNode(a,{modelValue:n.enable_showScreenTimeRange,"onUpdate:modelValue":l[7]||(l[7]=o=>n.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[l[23]||(l[23]=e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),e.createVNode(a,{modelValue:n.enable_showScreenMaxPrice,"onUpdate:modelValue":l[8]||(l[8]=o=>n.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",Te,[l[24]||(l[24]=e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),e.createVNode(a,{modelValue:n.enable_dbClickOpenSingel,"onUpdate:modelValue":l[9]||(l[9]=o=>n.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(C,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[...l[25]||(l[25]=[e.createTextVNode("组件开关",-1)])]),_:1}),e.createElementVNode("div",Pe,[l[26]||(l[26]=e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),e.createVNode(a,{modelValue:n.enable_subChart,"onUpdate:modelValue":l[10]||(l[10]=o=>n.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",qe,[l[27]||(l[27]=e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),e.createVNode(a,{modelValue:n.enable_sliderChart,"onUpdate:modelValue":l[11]||(l[11]=o=>n.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Le,[e.createVNode(x,{onClick:B},{default:e.withCtx(()=>[...l[28]||(l[28]=[e.createTextVNode(" 恢复默认 ",-1)])]),_:1}),e.createVNode(x,{type:"primary",onClick:V},{default:e.withCtx(()=>[...l[29]||(l[29]=[e.createTextVNode(" 保存配置 ",-1)])]),_:1})])]),_:1},8,["modelValue"])])}}},$e=X._export_sfc(De,[["__scopeId","data-v-cbe82a27"]]),Ae={install(t){t.component("st-klineConfig",$e)}};module.exports=Ae;
1
+ "use strict";const F=require("./index-beb5cb7d.cjs"),M=require("./el-button-fac5e058.cjs"),O=require("./el-select-c317294a.cjs"),K=require("./el-checkbox-6cf1a71c.cjs"),H=require("./el-divider-3f0320be.cjs"),s=require("./base-d987e5c9.cjs"),j=require("./index-f5474dcc.cjs"),W=require("./index-d372e68f.cjs"),z=require("./index-5cada1ed.cjs"),w=require("./el-popper-acd0ff35.cjs"),A=require("./el-overlay-9f36e73c.cjs"),N=require("./use-form-item-76516e50.cjs"),e=require("vue"),G=require("./validator-1926345b.cjs"),J=require("./el-segmented-eb3c8e65.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-tag-dca1292c.cjs");const X=require("./_plugin-vue_export-helper-f246444f.cjs");require("./use-global-config-7ff9a1c2.cjs");require("./index-6a36e1fc.cjs");require("./index-71ba4c28.cjs");require("./castArray-d9ffe84a.cjs");require("./vnode-6f7b84f0.cjs");require("./index-21a3dc89.cjs");require("./scroll-07bade1e.cjs");require("./index-11181b5f.cjs");require("./toNumber-b47ceb68.cjs");require("./clamp-17c4d8aa.cjs");require("./_baseClone-f8e5d3ba.cjs");const Y=s.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"}}),_={...A.dialogEmits,"resize-start":(t,f)=>t instanceof MouseEvent&&typeof f=="number",resize:(t,f)=>t instanceof MouseEvent&&typeof f=="number","resize-end":(t,f)=>t instanceof MouseEvent&&typeof f=="number"};function Q(t,f,y){const{width:i,height:k}=N.useWindowSize(),d=e.computed(()=>["ltr","rtl"].includes(t.direction)),g=e.computed(()=>["ltr","ttb"].includes(t.direction)?1:-1),n=e.computed(()=>d.value?i.value:k.value),b=e.computed(()=>s.clamp(r.value+g.value*B.value,4,n.value)),r=e.ref(0),B=e.ref(0),V=e.ref(!1),h=e.ref(!1);let S=[],u=[];const l=()=>{var a;const m=(a=f.value)==null?void 0:a.closest('[aria-modal="true"]');return m?d.value?m.offsetWidth:m.offsetHeight:100};e.watch(()=>[t.size,t.resizable],()=>{h.value=!1,r.value=0,B.value=0,p()});const C=m=>{t.resizable&&(h.value||(r.value=l(),h.value=!0),S=[m.pageX,m.pageY],V.value=!0,y("resize-start",m,r.value),u.push(N.useEventListener(window,"mouseup",p),N.useEventListener(window,"mousemove",c)))},c=m=>{const{pageX:a,pageY:v}=m,x=a-S[0],T=v-S[1];B.value=d.value?x:T,y("resize",m,b.value)},p=m=>{V.value&&(S=[],r.value=b.value,B.value=0,V.value=!1,u.forEach(a=>a==null?void 0:a()),u=[],m&&y("resize-end",m,r.value))},I=N.useEventListener(f,"mousedown",C);return e.onBeforeUnmount(()=>{I(),p()}),{size:e.computed(()=>h.value?`${b.value}px`:s.addUnit(t.size)),isResizing:V,isHorizontal:d}}const Z=["aria-label","aria-labelledby","aria-describedby"],ee=["id","aria-level"],te=["aria-label"],le=["id"];var ne=e.defineComponent({name:"ElDrawer",inheritAttrs:!1,__name:"drawer",props:Y,emits:_,setup(t,{expose:f,emit:y}){const i=t,k=y,d=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(()=>!!d.title));const g=e.ref(),n=e.ref(),b=e.ref(),r=s.useNamespace("drawer"),{t:B}=W.useLocale(),{afterEnter:V,afterLeave:h,beforeLeave:S,visible:u,rendered:l,titleId:C,bodyId:c,zIndex:p,onModalClick:I,onOpenAutoFocus:m,onCloseAutoFocus:a,onFocusoutPrevented:v,onCloseRequested:x,handleClose:T}=A.useDialog(i,g),{isHorizontal:o,size:E,isResizing:q}=Q(i,b,k),U=e.computed(()=>i.modalPenetrable&&!i.modal);return f({handleClose:T}),(P,L)=>(e.openBlock(),e.createBlock(e.Teleport,{to:t.appendTo,disabled:t.appendTo!=="body"?!1:!t.appendToBody},[e.createVNode(e.Transition,{name:e.unref(r).b("fade"),onAfterEnter:e.unref(V),onAfterLeave:e.unref(h),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:t.modal,"overlay-class":[e.unref(r).is("drawer"),t.modalClass??"",`${e.unref(r).namespace.value}-modal-drawer`,e.unref(r).is("penetrable",U.value)],"z-index":e.unref(p),onClick:e.unref(I)},{default:e.withCtx(()=>[e.createVNode(e.unref(w.focus_trap_default$1),{loop:"",trapped:e.unref(u),"focus-trap-el":g.value,"focus-start-el":n.value,onFocusAfterTrapped:e.unref(m),onFocusAfterReleased:e.unref(a),onFocusoutPrevented:e.unref(v),onReleaseRequested:e.unref(x)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:g,"aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:e.unref(C),"aria-describedby":e.unref(c)},P.$attrs,{class:[e.unref(r).b(),t.direction,e.unref(u)&&"open",e.unref(r).is("dragging",e.unref(q))],style:{[e.unref(o)?"width":"height"]:e.unref(E)},role:"dialog",onClick:L[1]||(L[1]=e.withModifiers(()=>{},["stop"]))}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:n,class:e.normalizeClass(e.unref(r).e("sr-focus")),tabindex:"-1"},null,2),t.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(r).e("header"),t.headerClass])},[P.$slots.title?e.renderSlot(P.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(P.$slots,"header",{key:0,close:e.unref(T),titleId:e.unref(C),titleClass:e.unref(r).e("title")},()=>[e.createElementVNode("span",{id:e.unref(C),role:"heading","aria-level":t.headerAriaLevel,class:e.normalizeClass(e.unref(r).e("title"))},e.toDisplayString(t.title),11,ee)]),t.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(B)("el.drawer.close"),class:e.normalizeClass(e.unref(r).e("close-btn")),type:"button",onClick:L[0]||(L[0]=(...R)=>e.unref(T)&&e.unref(T)(...R))},[e.createVNode(e.unref(z.ElIcon),{class:e.normalizeClass(e.unref(r).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.close_default))]),_:1},8,["class"])],10,te)):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(l)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(c),class:e.normalizeClass([e.unref(r).e("body"),t.bodyClass])},[e.renderSlot(P.$slots,"default")],10,le)):e.createCommentVNode("v-if",!0),P.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(r).e("footer"),t.footerClass])},[e.renderSlot(P.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),t.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:b,style:e.normalizeStyle({zIndex:e.unref(p)}),class:e.normalizeClass(e.unref(r).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,Z)]),_: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(u)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["to","disabled"]))}}),ae=ne;const oe=s.withInstall(ae),re=s.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:void 0},loading:Boolean,size:{type:String,validator:G.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:N.iconPropType},activeActionIcon:{type:N.iconPropType},activeIcon:{type:N.iconPropType},inactiveIcon:{type:N.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:s.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...w.useAriaProps(["ariaLabel"])}),ie={[w.UPDATE_MODEL_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t),[w.CHANGE_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t),[w.INPUT_EVENT]:t=>s.isBoolean(t)||s.isString(t)||s.isNumber(t)},se=["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex"],ce=["aria-hidden"],ue={key:1},de={key:1},me=["aria-hidden"],D="ElSwitch";var ve=e.defineComponent({name:D,__name:"switch",props:re,emits:ie,setup(t,{expose:f,emit:y}){const i=t,k=y,{formItem:d}=N.useFormItem(),g=N.useFormSize(),n=s.useNamespace("switch"),{inputId:b}=N.useFormItemInputId(i,{formItemContext:d}),r=N.useFormDisabled(e.computed(()=>{if(i.loading)return!0})),B=e.ref(i.modelValue!==!1),V=e.shallowRef(),h=e.computed(()=>[n.b(),n.m(g.value),n.is("disabled",r.value),n.is("checked",c.value)]),S=e.computed(()=>[n.e("label"),n.em("label","left"),n.is("active",!c.value)]),u=e.computed(()=>[n.e("label"),n.em("label","right"),n.is("active",c.value)]),l=e.computed(()=>({width:s.addUnit(i.width)}));e.watch(()=>i.modelValue,()=>{B.value=!0});const C=e.computed(()=>B.value?i.modelValue:!1),c=e.computed(()=>C.value===i.activeValue);[i.activeValue,i.inactiveValue].includes(C.value)||(s.debugWarn(D,"model-value must be active-value or inactive-value"),k(w.UPDATE_MODEL_EVENT,i.inactiveValue),k(w.CHANGE_EVENT,i.inactiveValue),k(w.INPUT_EVENT,i.inactiveValue)),e.watch(c,a=>{var v;V.value.checked=a,i.validateEvent&&((v=d==null?void 0:d.validate)==null||v.call(d,"change").catch(s.NOOP))});const p=()=>{const a=c.value?i.inactiveValue:i.activeValue;k(w.UPDATE_MODEL_EVENT,a),k(w.CHANGE_EVENT,a),k(w.INPUT_EVENT,a),e.nextTick(()=>{V.value.checked=c.value})},I=()=>{if(r.value)return;const{beforeChange:a}=i;if(!a){p();return}const v=a();[s.isPromise(v),s.isBoolean(v)].includes(!0)||s.throwError(D,"beforeChange must return type `Promise<boolean>` or `boolean`"),s.isPromise(v)?v.then(x=>{x&&p()}).catch(x=>{s.debugWarn(D,`some error occurred: ${x}`)}):v&&p()},m=()=>{var a,v;(v=(a=V.value)==null?void 0:a.focus)==null||v.call(a)};return e.onMounted(()=>{V.value.checked=c.value}),f({focus:m,checked:c}),(a,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(h.value),onClick:e.withModifiers(I,["prevent"])},[e.createElementVNode("input",{id:e.unref(b),ref_key:"input",ref:V,class:e.normalizeClass(e.unref(n).e("input")),type:"checkbox",role:"switch","aria-checked":c.value,"aria-disabled":e.unref(r),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(r),tabindex:t.tabindex,onChange:p,onKeydown:e.withKeys(I,["enter"])},null,42,se),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText||a.$slots.inactive)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(S.value)},[e.renderSlot(a.$slots,"inactive",{},()=>[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(z.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":c.value},e.toDisplayString(t.inactiveText),9,ce)):e.createCommentVNode("v-if",!0)])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(n).e("core")),style:e.normalizeStyle(l.value)},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("inner"))},[c.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(n).e("inner-wrapper"))},[e.renderSlot(a.$slots,"active",{},()=>[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(z.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",de,e.toDisplayString(t.activeText),1)):e.createCommentVNode("v-if",!0)])],2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n).e("inner-wrapper"))},[e.renderSlot(a.$slots,"inactive",{},()=>[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(z.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",ue,e.toDisplayString(t.inactiveText),1)):e.createCommentVNode("v-if",!0)])],2))],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(z.ElIcon),{key:0,class:e.normalizeClass(e.unref(n).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(z.loading_default))]),_:1},8,["class"])):c.value?e.renderSlot(a.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(z.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):c.value?e.createCommentVNode("v-if",!0):e.renderSlot(a.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(z.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||a.$slots.active)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(u.value)},[e.renderSlot(a.$slots,"active",{},()=>[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(z.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":!c.value},e.toDisplayString(t.activeText),9,me)):e.createCommentVNode("v-if",!0)])],2)):e.createCommentVNode("v-if",!0)],2))}}),fe=ve;const pe=s.withInstall(fe);const be=[{label:"买卖",value:0},{label:"开平",value:1}],$=()=>({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}),Ve=(t,f)=>{var y;return((y=f.find(i=>i.value===t))==null?void 0:y.label)??"-"};const ye={class:"kline-config element-dark"},ke={class:"setting-item"},ge={class:"setting-item"},Ce={class:"setting-item"},Ee={class:"setting-item"},Ne={class:"setting-item"},Be={class:"mode"},we={class:"cycleName"},he={class:"content"},Se={class:"setting-item"},xe={class:"setting-item"},ze={class:"setting-item"},Ie={class:"setting-item"},Te={class:"setting-item"},Pe={class:"setting-item"},qe={class:"setting-item"},Le={class:"setting-footer"},De={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(t,{expose:f,emit:y}){const{request:i}=e.inject("stConfig"),k=y,d=t,g=e.ref(!1),n=e.reactive({}),b=e.ref([]),r=e.ref([]),B=()=>{Object.assign(n,$())},V=async()=>{const u=JSON.stringify(n);d.origin==="server"?await i.post("/common/qt/updateUserConfig",{appId:1,json:u}):localStorage.setItem("userKlineConfig",u),k("callBack",u),g.value=!1},h=async()=>{if(d.origin==="server"){const{body:u}=await i.post("/common/qt/getUserConfig",{appId:1});Object.assign(n,$(),u?JSON.parse(u):{})}else{const u=localStorage.getItem("userKlineConfig");Object.assign(n,$(),u?JSON.parse(u):{})}},S=async()=>{if(d.origin==="server"){const{body:u}=await i.post("/common/qt/getDict",{dictIds:[1002]});b.value=u[1002].map(l=>({label:l.dictName,value:l.dictCode}))}else b.value=d.cycleOptions};return e.onMounted(()=>{S(),r.value=d.indicatorStore.mainIndicatorList??[]}),e.watch(()=>d.indicatorStore.mainIndicatorList,()=>{r.value=d.indicatorStore.mainIndicatorList??[]}),f({open:async()=>{await h(),g.value=!0},getDefaultUserKlineConfig:$}),(u,l)=>{const C=H.ElDivider,c=O.ElOption,p=O.ElSelect,I=K.ElCheckbox,m=J.ElSegmented,a=pe,v=F.ElScrollbar,x=M.ElButton,T=oe;return e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(T,{modelValue:g.value,"onUpdate:modelValue":l[12]||(l[12]=o=>g.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(v,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(C,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[...l[13]||(l[13]=[e.createTextVNode("偏好设置",-1)])]),_:1}),e.createElementVNode("div",ke,[l[14]||(l[14]=e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),e.createVNode(p,{modelValue:n.mainIndicator,"onUpdate:modelValue":l[0]||(l[0]=o=>n.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ge,[l[15]||(l[15]=e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),e.createVNode(p,{modelValue:n.sellBuy,"onUpdate:modelValue":l[1]||(l[1]=o=>n.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(be),(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",Ce,[l[16]||(l[16]=e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),e.createVNode(I,{modelValue:n.sellBuyByPrice,"onUpdate:modelValue":l[2]||(l[2]=o=>n.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ee,[l[17]||(l[17]=e.createElementVNode("span",{class:"label"},"单周期: ",-1)),e.createVNode(p,{modelValue:n.singelCycle,"onUpdate:modelValue":l[3]||(l[3]=o=>n.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(o,E)=>(e.openBlock(),e.createBlock(c,{key:E,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",Ne,[l[18]||(l[18]=e.createElementVNode("span",{class:"label"},"多周期: ",-1)),e.createVNode(m,{size:"small",modelValue:n.multiCycleNum,"onUpdate:modelValue":l[4]||(l[4]=o=>n.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-${n.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.multiCycleList.slice(0,n.multiCycleNum),(o,E)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",we,[e.createElementVNode("span",null,e.toDisplayString(e.unref(Ve)(n.multiCycleList[E],b.value)),1),e.createVNode(p,{modelValue:n.multiCycleList[E],"onUpdate:modelValue":q=>n.multiCycleList[E]=q,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(q,U)=>(e.openBlock(),e.createBlock(c,{key:U,label:q.label,value:q.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",he,e.toDisplayString(E+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Se,[l[19]||(l[19]=e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),e.createVNode(m,{size:"small",modelValue:n.pageType,"onUpdate:modelValue":l[5]||(l[5]=o=>n.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(C,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[...l[20]||(l[20]=[e.createTextVNode("功能配置",-1)])]),_:1}),e.createElementVNode("div",xe,[l[21]||(l[21]=e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),e.createVNode(a,{modelValue:n.enable_tradeLogBrush,"onUpdate:modelValue":l[6]||(l[6]=o=>n.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[l[22]||(l[22]=e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),e.createVNode(a,{modelValue:n.enable_showScreenTimeRange,"onUpdate:modelValue":l[7]||(l[7]=o=>n.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[l[23]||(l[23]=e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),e.createVNode(a,{modelValue:n.enable_showScreenMaxPrice,"onUpdate:modelValue":l[8]||(l[8]=o=>n.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",Te,[l[24]||(l[24]=e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),e.createVNode(a,{modelValue:n.enable_dbClickOpenSingel,"onUpdate:modelValue":l[9]||(l[9]=o=>n.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(C,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[...l[25]||(l[25]=[e.createTextVNode("组件开关",-1)])]),_:1}),e.createElementVNode("div",Pe,[l[26]||(l[26]=e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),e.createVNode(a,{modelValue:n.enable_subChart,"onUpdate:modelValue":l[10]||(l[10]=o=>n.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",qe,[l[27]||(l[27]=e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),e.createVNode(a,{modelValue:n.enable_sliderChart,"onUpdate:modelValue":l[11]||(l[11]=o=>n.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Le,[e.createVNode(x,{onClick:B},{default:e.withCtx(()=>[...l[28]||(l[28]=[e.createTextVNode(" 恢复默认 ",-1)])]),_:1}),e.createVNode(x,{type:"primary",onClick:V},{default:e.withCtx(()=>[...l[29]||(l[29]=[e.createTextVNode(" 保存配置 ",-1)])]),_:1})])]),_:1},8,["modelValue"])])}}},$e=X._export_sfc(De,[["__scopeId","data-v-cbe82a27"]]),Ae={install(t){t.component("st-klineConfig",$e)}};module.exports=Ae;
package/es/KlineConfig.js CHANGED
@@ -1,32 +1,32 @@
1
- import { E as ye } from "./index-a0522466.js";
2
- import { E as ge } from "./el-button-8a9721f8.js";
3
- import { E as we, a as he } from "./el-select-a34348e1.js";
4
- import { E as ke } from "./el-checkbox-c328b097.js";
1
+ import { E as ye } from "./index-d9379af4.js";
2
+ import { E as ge } from "./el-button-ee9fe159.js";
3
+ import { E as we, a as he } from "./el-select-a573c78b.js";
4
+ import { E as ke } from "./el-checkbox-b5ac7f04.js";
5
5
  import { E as Ce } from "./el-divider-c5d72961.js";
6
6
  import { b as re, o as Ve, p as ue, u as de, w as ce, c as Se, q as Q, a as ee, s as te, v as ie, N as Ee, x as oe, t as Ie } from "./base-dd156b8e.js";
7
7
  import { u as ze } from "./index-de9ad85c.js";
8
8
  import { u as Te } from "./index-a181f161.js";
9
- import { E as D, c as Be, l as xe } from "./index-60900c6c.js";
10
- import { f as Ne, u as Pe, U as ae, C as se, I as ne } from "./el-popper-852446fd.js";
11
- import { d as $e, a as Le, u as Ae, E as Oe } from "./el-overlay-36f223e9.js";
12
- import { b as le, c as Ue, i as X, d as Re, e as De, f as Me, g as Fe } from "./use-form-item-187cd7db.js";
9
+ import { E as D, c as Be, l as xe } from "./index-6a52dc7c.js";
10
+ import { f as Ne, u as Pe, U as ae, C as se, I as ne } from "./el-popper-0454c8e8.js";
11
+ import { d as $e, a as Le, u as Ae, E as Oe } from "./el-overlay-cb5c85aa.js";
12
+ import { b as le, c as Ue, i as X, d as Re, e as De, f as Me, g as Fe } from "./use-form-item-784142b4.js";
13
13
  import { computed as E, ref as P, watch as Z, onBeforeUnmount as Ke, defineComponent as ve, useSlots as qe, openBlock as n, createBlock as h, Teleport as je, createVNode as d, Transition as He, unref as l, withCtx as m, withDirectives as Je, createElementVNode as o, mergeProps as We, withModifiers as me, normalizeClass as g, createElementBlock as f, renderSlot as O, toDisplayString as F, createCommentVNode as y, normalizeStyle as fe, vShow as Xe, shallowRef as Ye, onMounted as be, withKeys as Ge, resolveDynamicComponent as q, nextTick as Qe, inject as Ze, reactive as _e, createTextVNode as j, Fragment as H, renderList as J } from "vue";
14
- import { i as et } from "./validator-800ed2ba.js";
15
- import { E as tt } from "./el-segmented-bf08279f.js";
14
+ import { i as et } from "./validator-a66ec4f8.js";
15
+ import { E as tt } from "./el-segmented-64dc7258.js";
16
16
  import "./el-scrollbar-0a42c1d0.js";
17
- import "./el-tag-9bcfae32.js";
17
+ import "./el-tag-2d8a3fe7.js";
18
18
  import { _ as lt } from "./_plugin-vue_export-helper-dad06003.js";
19
- import "./use-global-config-17dafd40.js";
20
- import "./index-47d30a52.js";
19
+ import "./use-global-config-9a4ccf33.js";
20
+ import "./index-9573f74b.js";
21
21
  import "./index-3806160e.js";
22
22
  import "./castArray-18eb6a41.js";
23
23
  import "./vnode-8ee9bf4e.js";
24
- import "./index-86678b72.js";
24
+ import "./index-c09fc6f5.js";
25
25
  import "./scroll-70271cb1.js";
26
- import "./index-7c4d8f5d.js";
26
+ import "./index-dddacf80.js";
27
27
  import "./toNumber-f077c66a.js";
28
28
  import "./clamp-c7512966.js";
29
- import "./_baseClone-98af8b33.js";
29
+ import "./_baseClone-fb6a3947.js";
30
30
  const at = re({
31
31
  ...$e,
32
32
  direction: {
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-94131fd7.cjs"),R=require("./el-select-d2958ae8.cjs");require("./base-d987e5c9.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-popper-f824c63b.cjs");require("./el-tag-527f06f0.cjs");const $=require("echarts");require("./index-d372e68f.cjs");require("./castArray-d9ffe84a.cjs");require("./index-3ed0c678.cjs");require("./use-form-item-0a831287.cjs");require("./index-3e7d5ffb.cjs");require("./vnode-6f7b84f0.cjs");require("./index-3a0a7c36.cjs");require("./index-5e76a22d.cjs");require("./scroll-07bade1e.cjs");require("./index-7711aa69.cjs");require("./toNumber-b47ceb68.cjs");require("./clamp-17c4d8aa.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-3856aa74"]]),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-c87d5c87"]]),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-03eea29e"]]),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-0d08cda9"]]),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-94131fd7.cjs"),R=require("./el-select-c317294a.cjs");require("./base-d987e5c9.cjs");require("./el-scrollbar-225c6c9e.cjs");require("./el-popper-acd0ff35.cjs");require("./el-tag-dca1292c.cjs");const $=require("echarts");require("./index-d372e68f.cjs");require("./castArray-d9ffe84a.cjs");require("./index-6a36e1fc.cjs");require("./use-form-item-76516e50.cjs");require("./index-5cada1ed.cjs");require("./vnode-6f7b84f0.cjs");require("./index-beb5cb7d.cjs");require("./index-21a3dc89.cjs");require("./scroll-07bade1e.cjs");require("./index-11181b5f.cjs");require("./toNumber-b47ceb68.cjs");require("./clamp-17c4d8aa.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-3856aa74"]]),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-c87d5c87"]]),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-03eea29e"]]),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-0d08cda9"]]),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;