kt-factor-legend 1.0.4 → 1.0.6
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,4 +1,4 @@
|
|
|
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,
|
|
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, watch as u, onMounted as _, toRefs as g } from "vue";
|
|
2
2
|
const s = [
|
|
3
3
|
{
|
|
4
4
|
name: "积水深度(cm)",
|
|
@@ -517,12 +517,12 @@ const s = [
|
|
|
517
517
|
}
|
|
518
518
|
]
|
|
519
519
|
}
|
|
520
|
-
],
|
|
520
|
+
], y = (e, n) => {
|
|
521
521
|
const t = e.__vccOpts || e;
|
|
522
522
|
for (const [x, c] of n)
|
|
523
523
|
t[x] = c;
|
|
524
524
|
return t;
|
|
525
|
-
},
|
|
525
|
+
}, k = {
|
|
526
526
|
name: "legendIndex",
|
|
527
527
|
props: {
|
|
528
528
|
elements: {
|
|
@@ -534,13 +534,13 @@ const s = [
|
|
|
534
534
|
const t = D({
|
|
535
535
|
factors: []
|
|
536
536
|
});
|
|
537
|
-
return
|
|
537
|
+
return u(
|
|
538
538
|
() => e.elements,
|
|
539
539
|
() => {
|
|
540
540
|
processData();
|
|
541
541
|
},
|
|
542
542
|
{ deep: !0 }
|
|
543
|
-
),
|
|
543
|
+
), _(() => {
|
|
544
544
|
processData();
|
|
545
545
|
}), {
|
|
546
546
|
...{
|
|
@@ -549,24 +549,24 @@ const s = [
|
|
|
549
549
|
(c = e.elements) != null && c.length ? t.factors = s.filter((i) => e.elements.includes(i.key)) : t.factors = s;
|
|
550
550
|
}
|
|
551
551
|
},
|
|
552
|
-
...
|
|
552
|
+
...g(t)
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
},
|
|
555
|
+
}, A = { class: "legend-index" }, f = {
|
|
556
556
|
key: 0,
|
|
557
557
|
class: "legend-group"
|
|
558
|
-
},
|
|
559
|
-
function
|
|
560
|
-
return l(), r("div",
|
|
558
|
+
}, w = { class: "legend-item" }, C = { class: "legend-name" }, $ = { class: "legend-color" };
|
|
559
|
+
function M(e, n, t, x, c, i) {
|
|
560
|
+
return l(), r("div", A, [
|
|
561
561
|
(l(!0), r(a, null, E(e.factors, (o) => {
|
|
562
562
|
var m;
|
|
563
563
|
return l(), r(a, {
|
|
564
564
|
key: o.key
|
|
565
565
|
}, [
|
|
566
|
-
(m = o == null ? void 0 : o.children) != null && m.length ? (l(), r("div",
|
|
567
|
-
F("div",
|
|
568
|
-
F("div",
|
|
569
|
-
F("div",
|
|
566
|
+
(m = o == null ? void 0 : o.children) != null && m.length ? (l(), r("div", f, [
|
|
567
|
+
F("div", w, [
|
|
568
|
+
F("div", C, p(o.name), 1),
|
|
569
|
+
F("div", $, [
|
|
570
570
|
(l(!0), r(a, null, E(o.children, (d, B) => (l(), r("div", {
|
|
571
571
|
key: B,
|
|
572
572
|
style: v({ backgroundColor: d.color })
|
|
@@ -578,8 +578,8 @@ function $(e, n, t, x, c, i) {
|
|
|
578
578
|
}), 128))
|
|
579
579
|
]);
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const N = /* @__PURE__ */ y(k, [["render", M]]);
|
|
582
582
|
export {
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
N as KtFactorLegend,
|
|
584
|
+
N as default
|
|
585
585
|
};
|
|
@@ -1 +1 @@
|
|
|
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"}})});
|
|
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 e.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"}})});
|
package/package.json
CHANGED
package/src/KtFactorLegend.vue
CHANGED