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.
- package/dist/kt-factor-legend.es.js +45 -221
- package/dist/kt-factor-legend.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/{components/index.vue → KtFactorLegend.vue} +19 -6
- package/src/{util/factorJson.js → factorJson.js} +1 -1
- package/src/index.js +4 -9
- package/src/{style/index.scss → index.scss} +5 -0
- package/src/App.vue +0 -14
- package/src/api/index.js +0 -9
- package/src/util/form.js +0 -8
- package/src/util/mixin.js +0 -31
- package/src/util/table.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
],
|
|
522
|
-
const
|
|
523
|
-
for (const [
|
|
524
|
-
|
|
525
|
-
return
|
|
526
|
-
},
|
|
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(
|
|
535
|
-
const
|
|
533
|
+
setup(e, n) {
|
|
534
|
+
const t = D({
|
|
536
535
|
factors: []
|
|
537
536
|
});
|
|
538
|
-
return
|
|
539
|
-
|
|
537
|
+
return watch(
|
|
538
|
+
() => e.elements,
|
|
539
|
+
() => {
|
|
540
|
+
processData();
|
|
541
|
+
},
|
|
542
|
+
{ deep: !0 }
|
|
543
|
+
), u(() => {
|
|
544
|
+
processData();
|
|
540
545
|
}), {
|
|
541
|
-
...{
|
|
542
|
-
|
|
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
|
-
},
|
|
555
|
+
}, k = { class: "legend-index" }, A = {
|
|
546
556
|
key: 0,
|
|
547
557
|
class: "legend-group"
|
|
548
|
-
},
|
|
549
|
-
function
|
|
550
|
-
return l(), r("div",
|
|
551
|
-
(l(!0), r(
|
|
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(
|
|
554
|
-
key:
|
|
563
|
+
return l(), r(a, {
|
|
564
|
+
key: o.key
|
|
555
565
|
}, [
|
|
556
|
-
(m =
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
(l(!0), r(
|
|
561
|
-
key:
|
|
562
|
-
style:
|
|
563
|
-
},
|
|
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
|
-
])) :
|
|
576
|
+
])) : h("", !0)
|
|
567
577
|
], 64);
|
|
568
578
|
}), 128))
|
|
569
579
|
]);
|
|
570
580
|
}
|
|
571
|
-
const
|
|
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
|
-
|
|
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")
|
|
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"}})});
|