kt-factor-legend 1.0.2 → 1.0.4

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.
@@ -1,6 +1,5 @@
1
- import { reactive as g, onMounted as B, toRefs as v, openBlock as l, createElementBlock as r, Fragment as i, renderList as d, createElementVNode as x, toDisplayString as s, normalizeStyle as D, createCommentVNode as _, resolveComponent as f, createBlock as w, createApp as k } from "vue";
2
- import y from "element-plus";
3
- const h = [
1
+ import { openBlock as l, createElementBlock as r, Fragment as a, renderList as E, createElementVNode as F, toDisplayString as p, normalizeStyle as v, createCommentVNode as h, reactive as D, onMounted as u, toRefs as _ } from "vue";
2
+ const s = [
4
3
  {
5
4
  name: "积水深度(cm)",
6
5
  key: "waterDepth",
@@ -168,7 +167,7 @@ const h = [
168
167
  {
169
168
  name: "风级",
170
169
  key: "wind-l",
171
- Children: [
170
+ children: [
172
171
  { name: "静风", value: 0, icon: "/wind-level/0.png" },
173
172
  { name: "1级风", value: 1, icon: "/wind-level/1.png" },
174
173
  { name: "2级风", value: 2, icon: "/wind-level/2.png" },
@@ -518,12 +517,12 @@ const h = [
518
517
  }
519
518
  ]
520
519
  }
521
- ], F = (t, n) => {
522
- const o = t.__vccOpts || t;
523
- for (const [c, a] of n)
524
- o[c] = a;
525
- return o;
526
- }, A = {
520
+ ], g = (e, n) => {
521
+ const t = e.__vccOpts || e;
522
+ for (const [x, c] of n)
523
+ t[x] = c;
524
+ return t;
525
+ }, y = {
527
526
  name: "legendIndex",
528
527
  props: {
529
528
  elements: {
@@ -531,231 +530,56 @@ const h = [
531
530
  required: !1
532
531
  }
533
532
  },
534
- setup(t, n) {
535
- const o = g({
533
+ setup(e, n) {
534
+ const t = D({
536
535
  factors: []
537
536
  });
538
- return B(() => {
539
- o.factors = t.elements || h, console.log(h);
537
+ return watch(
538
+ () => e.elements,
539
+ () => {
540
+ processData();
541
+ },
542
+ { deep: !0 }
543
+ ), u(() => {
544
+ processData();
540
545
  }), {
541
- ...{},
542
- ...v(o)
546
+ ...{
547
+ processData() {
548
+ var c;
549
+ (c = e.elements) != null && c.length ? t.factors = s.filter((i) => e.elements.includes(i.key)) : t.factors = s;
550
+ }
551
+ },
552
+ ..._(t)
543
553
  };
544
554
  }
545
- }, b = { class: "legend-index" }, L = {
555
+ }, k = { class: "legend-index" }, A = {
546
556
  key: 0,
547
557
  class: "legend-group"
548
- }, C = { class: "legend-item" }, T = { class: "legend-name" }, $ = { class: "legend-color" };
549
- function P(t, n, o, c, a, u) {
550
- return l(), r("div", b, [
551
- (l(!0), r(i, null, d(t.factors, (e) => {
558
+ }, f = { class: "legend-item" }, w = { class: "legend-name" }, C = { class: "legend-color" };
559
+ function $(e, n, t, x, c, i) {
560
+ return l(), r("div", k, [
561
+ (l(!0), r(a, null, E(e.factors, (o) => {
552
562
  var m;
553
- return l(), r(i, {
554
- key: e.key
563
+ return l(), r(a, {
564
+ key: o.key
555
565
  }, [
556
- (m = e == null ? void 0 : e.children) != null && m.length ? (l(), r("div", L, [
557
- x("div", C, [
558
- x("div", T, s(e.name), 1),
559
- x("div", $, [
560
- (l(!0), r(i, null, d(e.children, (p, E) => (l(), r("div", {
561
- key: E,
562
- style: D({ backgroundColor: p.color })
563
- }, s(p.text), 5))), 128))
566
+ (m = o == null ? void 0 : o.children) != null && m.length ? (l(), r("div", A, [
567
+ F("div", f, [
568
+ F("div", w, p(o.name), 1),
569
+ F("div", C, [
570
+ (l(!0), r(a, null, E(o.children, (d, B) => (l(), r("div", {
571
+ key: B,
572
+ style: v({ backgroundColor: d.color })
573
+ }, p(d.text), 5))), 128))
564
574
  ])
565
575
  ])
566
- ])) : _("", !0)
576
+ ])) : h("", !0)
567
577
  ], 64);
568
578
  }), 128))
569
579
  ]);
570
580
  }
571
- const M = /* @__PURE__ */ F(A, [["render", P]]), R = {
572
- name: "App",
573
- components: {
574
- LegendIndex: M
575
- }
576
- };
577
- function I(t, n, o, c, a, u) {
578
- const e = f("LegendIndex");
579
- return l(), w(e);
580
- }
581
- const z = /* @__PURE__ */ F(R, [["render", I]]);
582
- var S = {
583
- name: "zh-cn",
584
- el: {
585
- breadcrumb: { label: "面包屑" },
586
- colorpicker: {
587
- confirm: "确定",
588
- clear: "清空",
589
- defaultLabel: "颜色选择器",
590
- description: "当前颜色 {color},按 Enter 键选择新颜色",
591
- alphaLabel: "选择透明度的值",
592
- alphaDescription: "透明度 {alpha}, 当前颜色 {color}",
593
- hueLabel: "选择色相值",
594
- hueDescription: "色相 {hue}, 当前颜色 {color}",
595
- svLabel: "选择饱和度与明度的值",
596
- svDescription: "饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",
597
- predefineDescription: "选择 {value} 作为颜色"
598
- },
599
- datepicker: {
600
- now: "此刻",
601
- today: "今天",
602
- cancel: "取消",
603
- clear: "清空",
604
- confirm: "确定",
605
- dateTablePrompt: "使用方向键与 Enter 键可选择日期",
606
- monthTablePrompt: "使用方向键与 Enter 键可选择月份",
607
- yearTablePrompt: "使用方向键与 Enter 键可选择年份",
608
- selectedDate: "已选日期",
609
- selectDate: "选择日期",
610
- selectTime: "选择时间",
611
- startDate: "开始日期",
612
- startTime: "开始时间",
613
- endDate: "结束日期",
614
- endTime: "结束时间",
615
- prevYear: "前一年",
616
- nextYear: "后一年",
617
- prevMonth: "上个月",
618
- nextMonth: "下个月",
619
- year: "年",
620
- month1: "1 月",
621
- month2: "2 月",
622
- month3: "3 月",
623
- month4: "4 月",
624
- month5: "5 月",
625
- month6: "6 月",
626
- month7: "7 月",
627
- month8: "8 月",
628
- month9: "9 月",
629
- month10: "10 月",
630
- month11: "11 月",
631
- month12: "12 月",
632
- weeks: {
633
- sun: "日",
634
- mon: "一",
635
- tue: "二",
636
- wed: "三",
637
- thu: "四",
638
- fri: "五",
639
- sat: "六"
640
- },
641
- weeksFull: {
642
- sun: "星期日",
643
- mon: "星期一",
644
- tue: "星期二",
645
- wed: "星期三",
646
- thu: "星期四",
647
- fri: "星期五",
648
- sat: "星期六"
649
- },
650
- months: {
651
- jan: "一月",
652
- feb: "二月",
653
- mar: "三月",
654
- apr: "四月",
655
- may: "五月",
656
- jun: "六月",
657
- jul: "七月",
658
- aug: "八月",
659
- sep: "九月",
660
- oct: "十月",
661
- nov: "十一月",
662
- dec: "十二月"
663
- }
664
- },
665
- inputNumber: {
666
- decrease: "减少数值",
667
- increase: "增加数值"
668
- },
669
- select: {
670
- loading: "加载中",
671
- noMatch: "无匹配数据",
672
- noData: "无数据",
673
- placeholder: "请选择"
674
- },
675
- mention: { loading: "加载中" },
676
- dropdown: { toggleDropdown: "切换下拉选项" },
677
- cascader: {
678
- noMatch: "无匹配数据",
679
- loading: "加载中",
680
- placeholder: "请选择",
681
- noData: "暂无数据"
682
- },
683
- pagination: {
684
- goto: "前往",
685
- pagesize: "条/页",
686
- total: "共 {total} 条",
687
- pageClassifier: "页",
688
- page: "页",
689
- prev: "上一页",
690
- next: "下一页",
691
- currentPage: "第 {pager} 页",
692
- prevPages: "向前 {pager} 页",
693
- nextPages: "向后 {pager} 页",
694
- deprecationWarning: "你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"
695
- },
696
- dialog: { close: "关闭此对话框" },
697
- drawer: { close: "关闭此对话框" },
698
- messagebox: {
699
- title: "提示",
700
- confirm: "确定",
701
- cancel: "取消",
702
- error: "输入的数据不合法!",
703
- close: "关闭此对话框"
704
- },
705
- upload: {
706
- deleteTip: "按 Delete 键可删除",
707
- delete: "删除",
708
- preview: "查看图片",
709
- continue: "继续上传"
710
- },
711
- slider: {
712
- defaultLabel: "滑块介于 {min} 至 {max}",
713
- defaultRangeStartLabel: "选择起始值",
714
- defaultRangeEndLabel: "选择结束值"
715
- },
716
- table: {
717
- emptyText: "暂无数据",
718
- confirmFilter: "筛选",
719
- resetFilter: "重置",
720
- clearFilter: "全部",
721
- sumText: "合计",
722
- selectAllLabel: "选择所有行",
723
- selectRowLabel: "选择当前行",
724
- expandRowLabel: "展开当前行",
725
- collapseRowLabel: "收起当前行",
726
- sortLabel: "按 {column} 排序",
727
- filterLabel: "按 {column} 过滤"
728
- },
729
- tag: { close: "关闭此标签" },
730
- tour: {
731
- next: "下一步",
732
- previous: "上一步",
733
- finish: "结束导览",
734
- close: "关闭此对话框"
735
- },
736
- tree: { emptyText: "暂无数据" },
737
- transfer: {
738
- noMatch: "无匹配数据",
739
- noData: "无数据",
740
- titles: ["列表 1", "列表 2"],
741
- filterPlaceholder: "请输入搜索内容",
742
- noCheckedFormat: "共 {total} 项",
743
- hasCheckedFormat: "已选 {checked}/{total} 项"
744
- },
745
- image: { error: "加载失败" },
746
- pageHeader: { title: "返回" },
747
- popconfirm: {
748
- confirmButtonText: "确定",
749
- cancelButtonText: "取消"
750
- },
751
- carousel: {
752
- leftArrow: "上一张幻灯片",
753
- rightArrow: "下一张幻灯片",
754
- indicator: "幻灯片切换至索引 {index}"
755
- }
756
- }
757
- };
758
- k(z).use(y, { locale: S }).mount("#app");
581
+ const L = /* @__PURE__ */ g(y, [["render", $]]);
759
582
  export {
760
- M as StationIndex
583
+ L as KtFactorLegend,
584
+ L as default
761
585
  };
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.KtFactorLegend={},t.Vue,t.ElementPlus))})(this,function(t,e,s){"use strict";const i=[{name:"积水深度(cm)",key:"waterDepth",children:[{text:"<10",color:"#70DFA6"},{text:"10-15",color:"#8ED6FD"},{text:"15-27",color:"#0098FA"},{text:"27-40",color:"#FDCC00"},{text:"40-60",color:"#F07E2C"},{text:">60",color:"#EA0000"}]},{name:"温度(℃)",key:"temp",children:[{text:"-30",color:"#1875B6"},{text:"-20",color:"#2ABBE5"},{text:"-10",color:"#D1F4F2"},{text:"0",color:"#CBE4BE"},{text:"10",color:"#B1D162"},{text:"20",color:"#D3DD52"},{text:"30",color:"#F0E94B"},{text:"40",color:"#E48529"},{text:"",color:"#E74526"}]},{name:"气压(hPa)",key:"pres",children:[{text:"948",color:"#DFF5FD"},{text:"964",color:"#AEE5FA"},{text:"981",color:"#76D6F8"},{text:"997",color:"#38C3F5"},{text:"1015",color:"#00B7F2"},{text:"1020",color:"#00AAF1"},{text:"1030",color:"#009CE2"},{text:"1040",color:"#0089CD"},{text:"1050",color:"#0078BA"},{text:"",color:"#0B599A"}]},{name:"湿度(%)",key:"rh",children:[{text:"10",color:"#E74526"},{text:"20",color:"#E48529"},{text:"30",color:"#F0E94B"},{text:"40",color:"#D3DD52"},{text:"50",color:"#B1D162"},{text:"60",color:"#CBE4BE"},{text:"70",color:"#D1F4F2"},{text:"80",color:"#2ABBE5"},{text:"90",color:"#1875B6"},{text:"100",color:"#133DB5"}]},{name:"风级",key:"wind-l",Children:[{name:"静风",value:0,icon:"/wind-level/0.png"},{name:"1级风",value:1,icon:"/wind-level/1.png"},{name:"2级风",value:2,icon:"/wind-level/2.png"},{name:"3级风",value:3,icon:"/wind-level/3.png"},{name:"4级风",value:4,icon:"/wind-level/4.png"},{name:"5级风",value:5,icon:"/wind-level/5.png"},{name:"6级风",value:6,icon:"/wind-level/6.png"},{name:"7级风",value:7,icon:"/wind-level/7.png"},{name:"8级风",value:8,icon:"/wind-level/8.png"},{name:"9级风",value:9,icon:"/wind-level/9.png"},{name:"10级风",value:10,icon:"/wind-level/10.png"},{name:"11级风",value:11,icon:"/wind-level/11.png"},{name:"12级风",value:12,icon:"/wind-level/12.png"},{name:"13级风",value:13,icon:"/wind-level/13.png"},{name:"14级风",value:14,icon:"/wind-level/14.png"},{name:"15级风",value:15,icon:"/wind-level/15.png"},{name:"16级风",value:16,icon:"/wind-level/16.png"}]},{name:"5分钟累积降雨(mm)",key:"prep_5min",children:[{text:"0.4",color:"#BDF071"},{text:"1.0",color:"#4B7902"},{text:"2.0",color:"#1BB1F1"},{text:"5.0",color:"#0000FF"},{text:"10",color:"#EC808D"},{text:"",color:"#D900B6"}]},{name:"1小时降雨(mm)",key:"prep_1h",children:[{text:"<1.5",color:"#B8EF9E"},{text:"1.6-6.9",color:"#66B755"},{text:"7-14.9",color:"#7AB8F7"},{text:"15-39.9",color:"#8792FD"},{text:"40-49.9",color:"#E440EF"},{text:">50",color:"#74173F"}]},{name:"3小时降雨(mm)",key:"prep_3h",children:[{text:"<2.9",color:"#B8EF9E"},{text:"3-9.9",color:"#66B755"},{text:"10-19.9",color:"#7AB8F7"},{text:"20-49.9",color:"#8792FD"},{text:"50-69.9",color:"#E440EF"},{text:">70",color:"#74173F"}]},{name:"6小时降雨(mm)",key:"prep_6h",children:[{text:"<3.9",color:"#B8EF9E"},{text:"4-12.9",color:"#66B755"},{text:"13-24.9",color:"#7AB8F7"},{text:"25-59.9",color:"#8792FD"},{text:"60-119.9",color:"#E440EF"},{text:">120",color:"#74173F"}]},{name:"12小时降雨(mm)",key:"prep_12h",children:[{text:"<4.9",color:"#B8EF9E"},{text:"5-14.9",color:"#66B755"},{text:"15-29.9",color:"#7AB8F7"},{text:"30-69.9",color:"#8792FD"},{text:"70-139.9",color:"#E440EF"},{text:">140",color:"#74173F"}]},{name:"24小时降雨(mm)",key:"prep_24h",children:[{text:"<9.9",color:"#B8EF9E"},{text:"10-24.9",color:"#66B755"},{text:"25-49.9",color:"#7AB8F7"},{text:"50-99.9",color:"#8792FD"},{text:"100-250",color:"#E440EF"},{text:">250",color:"#74173F"}]},{name:"未来1小时降雨预报(mm)",key:"prep_f_1h",children:[{text:"<1.5",color:"#B8EF9E"},{text:"1.6-6.9",color:"#66B755"},{text:"7-14.9",color:"#7AB8F7"},{text:"15-39.9",color:"#8792FD"},{text:"40-49.9",color:"#E440EF"},{text:">50",color:"#74173F"}]},{name:"未来3小时降雨预报(mm)",key:"prep_f_3h",children:[{text:"<2.9",color:"#B8EF9E"},{text:"3-9.9",color:"#66B755"},{text:"10-19.9",color:"#7AB8F7"},{text:"20-49.9",color:"#8792FD"},{text:"50-69.9",color:"#E440EF"},{text:">70",color:"#74173F"}]},{name:"未来6小时降雨预报(mm)",key:"prep_f_6h",children:[{text:"<3.9",color:"#B8EF9E"},{text:"4-12.9",color:"#66B755"},{text:"13-24.9",color:"#7AB8F7"},{text:"25-59.9",color:"#8792FD"},{text:"60-119.9",color:"#E440EF"},{text:">120",color:"#74173F"}]},{name:"未来12小时降雨预报(mm)",key:"prep_f_12h",children:[{text:"<4.9",color:"#B8EF9E"},{text:"5-14.9",color:"#66B755"},{text:"15-29.9",color:"#7AB8F7"},{text:"30-69.9",color:"#8792FD"},{text:"70-139.9",color:"#E440EF"},{text:">140",color:"#74173F"}]},{name:"未来24小时降雨预报(mm)",key:"prep_f_24h",children:[{text:"<9.9",color:"#B8EF9E"},{text:"10-24.9",color:"#66B755"},{text:"25-49.9",color:"#7AB8F7"},{text:"50-99.9",color:"#8792FD"},{text:"100-250",color:"#E440EF"},{text:">250",color:"#74173F"}]}],d=(l,r)=>{const n=l.__vccOpts||l;for(const[c,a]of r)n[c]=a;return n},h={name:"legendIndex",props:{elements:{type:Array,required:!1}},setup(l,r){const n=e.reactive({factors:[]});return e.onMounted(()=>{n.factors=l.elements||i,console.log(i)}),{...{},...e.toRefs(n)}}},F={class:"legend-index"},E={key:0,class:"legend-group"},B={class:"legend-item"},g={class:"legend-name"},u={class:"legend-color"};function f(l,r,n,c,a,w){return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.factors,o=>{var m;return e.openBlock(),e.createElementBlock(e.Fragment,{key:o.key},[(m=o==null?void 0:o.children)!=null&&m.length?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("div",B,[e.createElementVNode("div",g,e.toDisplayString(o.name),1),e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.children,(x,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,style:e.normalizeStyle({backgroundColor:x.color})},e.toDisplayString(x.text),5))),128))])])])):e.createCommentVNode("",!0)],64)}),128))])}const p=d(h,[["render",f]]),D={name:"App",components:{LegendIndex:p}};function _(l,r,n,c,a,w){const o=e.resolveComponent("LegendIndex");return e.openBlock(),e.createBlock(o)}const k=d(D,[["render",_]]);var y={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值",alphaDescription:"透明度 {alpha}, 当前颜色 {color}",hueLabel:"选择色相值",hueDescription:"色相 {hue}, 当前颜色 {color}",svLabel:"选择饱和度与明度的值",svDescription:"饱和度 {saturation}, 明度 {brightness}, 当前颜色 {color}",predefineDescription:"选择 {value} 作为颜色"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},mention:{loading:"加载中"},dropdown:{toggleDropdown:"切换下拉选项"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 Delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计",selectAllLabel:"选择所有行",selectRowLabel:"选择当前行",expandRowLabel:"展开当前行",collapseRowLabel:"收起当前行",sortLabel:"按 {column} 排序",filterLabel:"按 {column} 过滤"},tag:{close:"关闭此标签"},tour:{next:"下一步",previous:"上一步",finish:"结束导览",close:"关闭此对话框"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};e.createApp(k).use(s,{locale:y}).mount("#app"),t.StationIndex=p,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.KtFactorLegend={},t.Vue))})(this,function(t,e){"use strict";const x=[{name:"积水深度(cm)",key:"waterDepth",children:[{text:"<10",color:"#70DFA6"},{text:"10-15",color:"#8ED6FD"},{text:"15-27",color:"#0098FA"},{text:"27-40",color:"#FDCC00"},{text:"40-60",color:"#F07E2C"},{text:">60",color:"#EA0000"}]},{name:"温度(℃)",key:"temp",children:[{text:"-30",color:"#1875B6"},{text:"-20",color:"#2ABBE5"},{text:"-10",color:"#D1F4F2"},{text:"0",color:"#CBE4BE"},{text:"10",color:"#B1D162"},{text:"20",color:"#D3DD52"},{text:"30",color:"#F0E94B"},{text:"40",color:"#E48529"},{text:"",color:"#E74526"}]},{name:"气压(hPa)",key:"pres",children:[{text:"948",color:"#DFF5FD"},{text:"964",color:"#AEE5FA"},{text:"981",color:"#76D6F8"},{text:"997",color:"#38C3F5"},{text:"1015",color:"#00B7F2"},{text:"1020",color:"#00AAF1"},{text:"1030",color:"#009CE2"},{text:"1040",color:"#0089CD"},{text:"1050",color:"#0078BA"},{text:"",color:"#0B599A"}]},{name:"湿度(%)",key:"rh",children:[{text:"10",color:"#E74526"},{text:"20",color:"#E48529"},{text:"30",color:"#F0E94B"},{text:"40",color:"#D3DD52"},{text:"50",color:"#B1D162"},{text:"60",color:"#CBE4BE"},{text:"70",color:"#D1F4F2"},{text:"80",color:"#2ABBE5"},{text:"90",color:"#1875B6"},{text:"100",color:"#133DB5"}]},{name:"风级",key:"wind-l",children:[{name:"静风",value:0,icon:"/wind-level/0.png"},{name:"1级风",value:1,icon:"/wind-level/1.png"},{name:"2级风",value:2,icon:"/wind-level/2.png"},{name:"3级风",value:3,icon:"/wind-level/3.png"},{name:"4级风",value:4,icon:"/wind-level/4.png"},{name:"5级风",value:5,icon:"/wind-level/5.png"},{name:"6级风",value:6,icon:"/wind-level/6.png"},{name:"7级风",value:7,icon:"/wind-level/7.png"},{name:"8级风",value:8,icon:"/wind-level/8.png"},{name:"9级风",value:9,icon:"/wind-level/9.png"},{name:"10级风",value:10,icon:"/wind-level/10.png"},{name:"11级风",value:11,icon:"/wind-level/11.png"},{name:"12级风",value:12,icon:"/wind-level/12.png"},{name:"13级风",value:13,icon:"/wind-level/13.png"},{name:"14级风",value:14,icon:"/wind-level/14.png"},{name:"15级风",value:15,icon:"/wind-level/15.png"},{name:"16级风",value:16,icon:"/wind-level/16.png"}]},{name:"5分钟累积降雨(mm)",key:"prep_5min",children:[{text:"0.4",color:"#BDF071"},{text:"1.0",color:"#4B7902"},{text:"2.0",color:"#1BB1F1"},{text:"5.0",color:"#0000FF"},{text:"10",color:"#EC808D"},{text:"",color:"#D900B6"}]},{name:"1小时降雨(mm)",key:"prep_1h",children:[{text:"<1.5",color:"#B8EF9E"},{text:"1.6-6.9",color:"#66B755"},{text:"7-14.9",color:"#7AB8F7"},{text:"15-39.9",color:"#8792FD"},{text:"40-49.9",color:"#E440EF"},{text:">50",color:"#74173F"}]},{name:"3小时降雨(mm)",key:"prep_3h",children:[{text:"<2.9",color:"#B8EF9E"},{text:"3-9.9",color:"#66B755"},{text:"10-19.9",color:"#7AB8F7"},{text:"20-49.9",color:"#8792FD"},{text:"50-69.9",color:"#E440EF"},{text:">70",color:"#74173F"}]},{name:"6小时降雨(mm)",key:"prep_6h",children:[{text:"<3.9",color:"#B8EF9E"},{text:"4-12.9",color:"#66B755"},{text:"13-24.9",color:"#7AB8F7"},{text:"25-59.9",color:"#8792FD"},{text:"60-119.9",color:"#E440EF"},{text:">120",color:"#74173F"}]},{name:"12小时降雨(mm)",key:"prep_12h",children:[{text:"<4.9",color:"#B8EF9E"},{text:"5-14.9",color:"#66B755"},{text:"15-29.9",color:"#7AB8F7"},{text:"30-69.9",color:"#8792FD"},{text:"70-139.9",color:"#E440EF"},{text:">140",color:"#74173F"}]},{name:"24小时降雨(mm)",key:"prep_24h",children:[{text:"<9.9",color:"#B8EF9E"},{text:"10-24.9",color:"#66B755"},{text:"25-49.9",color:"#7AB8F7"},{text:"50-99.9",color:"#8792FD"},{text:"100-250",color:"#E440EF"},{text:">250",color:"#74173F"}]},{name:"未来1小时降雨预报(mm)",key:"prep_f_1h",children:[{text:"<1.5",color:"#B8EF9E"},{text:"1.6-6.9",color:"#66B755"},{text:"7-14.9",color:"#7AB8F7"},{text:"15-39.9",color:"#8792FD"},{text:"40-49.9",color:"#E440EF"},{text:">50",color:"#74173F"}]},{name:"未来3小时降雨预报(mm)",key:"prep_f_3h",children:[{text:"<2.9",color:"#B8EF9E"},{text:"3-9.9",color:"#66B755"},{text:"10-19.9",color:"#7AB8F7"},{text:"20-49.9",color:"#8792FD"},{text:"50-69.9",color:"#E440EF"},{text:">70",color:"#74173F"}]},{name:"未来6小时降雨预报(mm)",key:"prep_f_6h",children:[{text:"<3.9",color:"#B8EF9E"},{text:"4-12.9",color:"#66B755"},{text:"13-24.9",color:"#7AB8F7"},{text:"25-59.9",color:"#8792FD"},{text:"60-119.9",color:"#E440EF"},{text:">120",color:"#74173F"}]},{name:"未来12小时降雨预报(mm)",key:"prep_f_12h",children:[{text:"<4.9",color:"#B8EF9E"},{text:"5-14.9",color:"#66B755"},{text:"15-29.9",color:"#7AB8F7"},{text:"30-69.9",color:"#8792FD"},{text:"70-139.9",color:"#E440EF"},{text:">140",color:"#74173F"}]},{name:"未来24小时降雨预报(mm)",key:"prep_f_24h",children:[{text:"<9.9",color:"#B8EF9E"},{text:"10-24.9",color:"#66B755"},{text:"25-49.9",color:"#7AB8F7"},{text:"50-99.9",color:"#8792FD"},{text:"100-250",color:"#E440EF"},{text:">250",color:"#74173F"}]}],p=(o,n)=>{const l=o.__vccOpts||o;for(const[a,r]of n)l[a]=r;return l},s={name:"legendIndex",props:{elements:{type:Array,required:!1}},setup(o,n){const l=e.reactive({factors:[]});return watch(()=>o.elements,()=>{processData()},{deep:!0}),e.onMounted(()=>{processData()}),{...{processData(){var r;(r=o.elements)!=null&&r.length?l.factors=x.filter(d=>o.elements.includes(d.key)):l.factors=x}},...e.toRefs(l)}}},E={class:"legend-index"},B={key:0,class:"legend-group"},h={class:"legend-item"},D={class:"legend-name"},g={class:"legend-color"};function _(o,n,l,a,r,d){return e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.factors,c=>{var m;return e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[(m=c==null?void 0:c.children)!=null&&m.length?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",h,[e.createElementVNode("div",D,e.toDisplayString(c.name),1),e.createElementVNode("div",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.children,(F,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,style:e.normalizeStyle({backgroundColor:F.color})},e.toDisplayString(F.text),5))),128))])])])):e.createCommentVNode("",!0)],64)}),128))])}const i=p(s,[["render",_]]);t.KtFactorLegend=i,t.default=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});