UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,488 lines (1,487 loc) 228 kB
import { ref as I, computed as L, watch as Cr, createVNode as S, createTextVNode as t0, resolveComponent as Xr, defineComponent as he, onMounted as gr, Fragment as Zr, inject as Vr } from "vue"; import { useResizeObserver as Yr } from "@vueuse/core"; import { isPlainObject as Re, cloneDeep as yr } from "lodash-es"; import * as f0 from "echarts"; import Kr from "../progress/index.esm.js"; const Er = {}, Ar = {}; function pe(i) { const { properties: B, title: o, ignore: r } = i, x = r && Array.isArray(r), g = Object.keys(B).reduce((E, p) => ((!x || !r.find((C) => C === p)) && (E[p] = B[p].type === "object" && B[p].properties ? pe(B[p]) : yr(B[p].default)), E), {}); if (o && (!x || !r.find((E) => E === "id"))) { const E = o.toLowerCase().replace(/-/g, "_"); g.id = `${E}_${Math.random().toString().slice(2, 6)}`; } return g; } function Qr(i) { const { properties: B, title: o, required: r } = i; if (r && Array.isArray(r)) { const x = r.reduce((g, E) => (g[E] = B[E].type === "object" && B[E].properties ? pe(B[E]) : yr(B[E].default), g), {}); if (o && r.find((g) => g === "id")) { const g = o.toLowerCase().replace(/-/g, "_"); x.id = `${g}_${Math.random().toString().slice(2, 6)}`; } return x; } return { type: o }; } function mr(i, B = {}, o) { const r = Er[i]; if (r) { let x = Qr(r); const g = Ar[i]; return x = g ? g({ getSchemaByType: mr }, x, B, o) : x, x; } return null; } function Jr(i, B) { const o = pe(B); return Object.keys(o).reduce((r, x) => (Object.prototype.hasOwnProperty.call(i, x) && (r[x] && Re(r[x]) && Re(i[x] || !i[x]) ? Object.assign(r[x], i[x] || {}) : r[x] = i[x]), r), o), o; } function Fr(i, B) { return Object.keys(i).filter((r) => i[r] != null).reduce((r, x) => { if (B.has(x)) { const g = B.get(x); if (typeof g == "string") r[g] = i[x]; else { const E = g(x, i[x], i); Object.assign(r, E); } } else r[x] = i[x]; return r; }, {}); } function et(i, B, o = /* @__PURE__ */ new Map()) { const r = Jr(i, B); return Fr(r, o); } function rt(i = {}) { function B(e, t, l, n) { if (typeof l == "number") return n[e].length === l; if (typeof l == "object") { const c = Object.keys(l)[0], u = l[c]; if (c === "not") return Number(n[e].length) !== Number(u); if (c === "moreThan") return Number(n[e].length) >= Number(u); if (c === "lessThan") return Number(n[e].length) <= Number(u); } return !1; } function o(e, t, l, n) { return n[e] && n[e].propertyValue && String(n[e].propertyValue.value) === String(l); } const r = /* @__PURE__ */ new Map([ ["length", B], ["getProperty", o] ]); Object.keys(i).reduce((e, t) => (e.set(t, i[t]), e), r); function x(e, t) { const l = e; return typeof t == "number" ? [{ target: l, operator: "length", param: null, value: Number(t) }] : typeof t == "boolean" ? [{ target: l, operator: "getProperty", param: e, value: !!t }] : typeof t == "object" ? Object.keys(t).map((n) => { if (n === "length") return { target: l, operator: "length", param: null, value: t[n] }; const c = n, u = t[n]; return { target: l, operator: "getProperty", param: c, value: u }; }) : []; } function g(e) { return Object.keys(e).reduce((l, n) => { const c = x(n, e[n]); return l.push(...c), l; }, []); } function E(e, t) { if (r.has(e.operator)) { const l = r.get(e.operator); return l && l(e.target, e.param, e.value, t) || !1; } return !1; } function p(e, t) { return g(e).reduce((c, u) => c && E(u, t), !0); } function C(e, t) { const l = Object.keys(e), n = l.includes("allOf"), c = l.includes("anyOf"), u = n || c, d = (u ? e[u ? n ? "allOf" : "anyOf" : "allOf"] : [e]).map((s) => p(s, t)); return n ? !d.includes(!1) : d.includes(!0); } return { parseValueSchema: C }; } const tt = {}, nt = {}; rt(); function Dr(i, B, o = /* @__PURE__ */ new Map(), r = (E, p, C, e) => p, x = {}, g = (E) => E) { return Er[B.title] = B, Ar[B.title] = r, tt[B.title] = x, nt[B.title] = g, (E = {}, p = !0) => { if (!p) return Fr(E, o); const C = et(E, B, o), e = Object.keys(i).reduce((t, l) => (t[l] = i[l].default, t), {}); return Object.assign(e, C); }; } function br(i, B) { return { customClass: B.class, customStyle: B.style }; } const at = /* @__PURE__ */ new Map([ ["appearance", br] ]); function ot(i, B, o) { return B; } const it = "https://json-schema.org/draft/2020-12/schema", st = "https://farris-design.gitee.io/weather.schema.json", xt = "weather", ct = "A Farris Input Component", ut = "object", ft = { id: { description: "The unique identifier for a weather", type: "string" }, type: { description: "The type string of weather component", type: "string", default: "weather" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} } }, lt = [ "id", "type" ], dt = { $schema: it, $id: st, title: xt, description: ct, type: ut, properties: ft, required: lt }, vt = "weather", ht = "A Farris Component", pt = "object", Bt = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, Ct = { title: vt, description: ht, type: pt, categories: Bt }, gt = { /** 城市列表 */ cityItems: { type: Array, default: [ { province: "北京", city: ["北京"] }, { province: "山东", city: ["济南", "青岛"] }, { province: "黑龙江", city: ["牡丹江", "齐齐哈尔"] } ] }, /** 主题列表 */ themeItems: { type: Array, default: [ { title: "school", adviceItems: ["clothes", "sports", "sunscreen"] }, { title: "office", adviceItems: ["clothes", "traffic", "umbrella"] }, { title: "construction", adviceItems: ["clothes", "chill", "heatstroke"] }, { title: "tourism", adviceItems: ["clothes", "sunscreen", "tourism"] } ] }, /** 天气数据 */ data: { type: Object, default: { // 日出时间 sunriseTime: I(/* @__PURE__ */ new Date()), // 日落时间 sunsetTime: I(/* @__PURE__ */ new Date()), // 温度 temperature: I(0), // 最高温 max: I(0), // 最低温 min: I(0), // 天气现象 weather: I("阴"), // 空气质量 air: I(0), // 建议 adviceItems: [ { key: "clothes", value: { name: "穿衣", info: "毛衣", detail: "建议穿长袖毛衣等服装。" } }, { key: "sports", value: { name: "运动", info: "适宜", detail: "各项气象条件都很好,很适合户外运动。" } }, { key: "sunscreen", value: { name: "防晒", info: "强", detail: "建议涂抹SPF在15-20之间,PA++的防晒护肤品。" } }, { key: "traffic", value: { name: "交通", info: "良好", detail: "天气较好,路面干燥,交通气象条件良好,车辆可以正常行驶。" } }, { key: "umbrella", value: { name: "雨伞", info: "不带伞", detail: "天气较好,您在出门的时候无须带雨伞。" } }, { key: "chill", value: { name: "风寒", info: "无", detail: "温度未达到风寒所需的低温,稍作防寒准备即可。" } }, { key: "heatstroke", value: { name: "中暑", info: "无中暑风险", detail: "天气不热,在炎炎夏日中十分难得,可以告别暑气漫漫啦~" } }, { key: "tourism", value: { name: "旅游", info: "适宜", detail: "天气较好,温度适宜,是个好天气哦。这样的天气适宜旅游,您可以尽情地享受大自然的风光。" } } ], // 专业参数 proindexItemsSet: [[ { title: "紫外线", icon: "UV", value: "中等", info: "16:00前注意防晒", explain: "紫外线指数(UVI)测量紫外线辐射。UVI越高,潜在伤害就越大,造成伤害的速度也越快。" }, { title: "降水量", icon: "rainfall", value: "0mm", info: "过去24小时", explain: "降水量,是指12或24小时内降雨(雪)量的总和。" } ], [ { title: "湿度", icon: "humidity", value: "31%", info: "露点温度为4°", explain: "空气中含水量与空气可容纳水量的比值。气温越高,空气可容纳的水量就越多。湿度高意味着可能结露或起雾。" }, { title: "体感温度", icon: "apparentTemp", value: "14°", info: "风较大,体感更凉", explain: "体感温度传达身体感觉有多暖或多冷,可能与实际温度不同。体感温度受湿度和风影响。" } ], [ { title: "气压", icon: "pressure", value: "1010mpa", info: "当前气压较稳定", explain: "气压的显著急剧变化用于预测天气变化。例如,气压降低表示雨雪即将来临,升高则表示天气将好转。" }, { title: "能见度", icon: "visibility", value: "19km", info: "目前非常好", explain: "能见度会告诉你可以清晰地看到多远以外的物体。能见度测量大气透明度,不考虑光照强度或障碍物。" } ]], // 每小时天气 dayItemsSet: [ [ { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 16 }, { icon: "sunny", temp: 20 }, { icon: "sunny", temp: 22 }, { icon: "sunny", temp: 24 }, { icon: "cloudy", temp: 23 }, { icon: "cloudy", temp: 20 }, { icon: "cloudy", temp: 19 }, { icon: "cloudy", temp: 19 }, { icon: "cloudy", temp: 18 }, { icon: "rainy1", temp: 18 }, { icon: "rainy1", temp: 17 }, { icon: "rainy1", temp: 15 }, { icon: "rainy1", temp: 15 }, { icon: "rainy2", temp: 15 }, { icon: "rainy2", temp: 15 }, { icon: "rainy2", temp: 15 }, { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 18 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 20 }, { icon: "sunny", temp: 20 } ], [ { icon: "rainy2", temp: 15 }, { icon: "rainy2", temp: 15 }, { icon: "rainy2", temp: 15 }, { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 18 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 20 }, { icon: "sunny", temp: 20 }, { icon: "rainy2", temp: 21 }, { icon: "rainy2", temp: 21 }, { icon: "rainy2", temp: 21 }, { icon: "sunny", temp: 21 }, { icon: "sunny", temp: 22 }, { icon: "sunny", temp: 24 }, { icon: "sunny", temp: 24 }, { icon: "sunny", temp: 23 }, { icon: "sunny", temp: 20 }, { icon: "sunny", temp: 20 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 19 }, { icon: "sunny", temp: 15 }, { icon: "sunny", temp: 15 } ] // [ // { icon: "foggy", temp: 11 }, // { icon: "foggy", temp: 12 }, // { icon: "foggy", temp: 14 }, // { icon: "foggy", temp: 15 }, // { icon: "foggy", temp: 17 }, // { icon: "foggy", temp: 18 }, // { icon: "foggy", temp: 19 }, // { icon: "foggy", temp: 19 }, // { icon: "foggy", temp: 20 }, // { icon: "foggy", temp: 20 }, // { icon: "foggy", temp: 21 }, // { icon: "foggy", temp: 21 }, // { icon: "foggy", temp: 21 }, // { icon: "foggy", temp: 21 }, // { icon: "sunny", temp: 22 }, // { icon: "sunny", temp: 26 }, // { icon: "sunny", temp: 26 }, // { icon: "sunny", temp: 25 }, // { icon: "sunny", temp: 20 }, // { icon: "sunny", temp: 20 }, // { icon: "foggy", temp: 19 }, // { icon: "foggy", temp: 19 }, // { icon: "foggy", temp: 15 }, // { icon: "foggy", temp: 15 }, // ],[ // { icon: "cloudy", temp: 7 }, // { icon: "cloudy", temp: 8 }, // { icon: "cloudy", temp: 10 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 14 }, // { icon: "cloudy", temp: 18 }, // { icon: "cloudy", temp: 19 }, // { icon: "cloudy", temp: 19 }, // { icon: "sunny", temp: 20 }, // { icon: "sunny", temp: 20 }, // { icon: "cloudy", temp: 21 }, // { icon: "cloudy", temp: 21 }, // { icon: "cloudy", temp: 21 }, // { icon: "cloudy", temp: 21 }, // { icon: "cloudy", temp: 22 }, // { icon: "cloudy", temp: 22 }, // { icon: "sunny", temp: 21 }, // { icon: "sunny", temp: 21 }, // { icon: "sunny", temp: 20 }, // { icon: "sunny", temp: 20 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 15 }, // { icon: "sunny", temp: 15 }, // ],[ // { icon: "snowy1", temp: 3 }, // { icon: "snowy1", temp: 3 }, // { icon: "snowy1", temp: 3 }, // { icon: "snowy1", temp: 4 }, // { icon: "sunny", temp: 4 }, // { icon: "sunny", temp: 4 }, // { icon: "sunny", temp: 5 }, // { icon: "sunny", temp: 6 }, // { icon: "sunny", temp: 8 }, // { icon: "sunny", temp: 8 }, // { icon: "snowy1", temp: 10 }, // { icon: "snowy1", temp: 10 }, // { icon: "snowy1", temp: 10 }, // { icon: "snowy1", temp: 10 }, // { icon: "snowy1", temp: 10 }, // { icon: "snowy1", temp: 9 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 5 }, // ],[ // { icon: "sunny", temp: 5 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 15 }, // { icon: "sunny", temp: 15 }, // { icon: "sunny", temp: 15 }, // { icon: "sunny", temp: 16 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 19 }, // { icon: "sunny", temp: 18 }, // { icon: "sunny", temp: 17 }, // { icon: "sunny", temp: 17 }, // { icon: "sunny", temp: 17 }, // { icon: "sunny", temp: 17 }, // { icon: "sunny", temp: 16 }, // { icon: "sunny", temp: 10 }, // ],[ // { icon: "snowy2", temp: 4 }, // { icon: "snowy2", temp: 4 }, // { icon: "snowy2", temp: 4 }, // { icon: "sunny", temp: 4 }, // { icon: "sunny", temp: 4 }, // { icon: "sunny", temp: 6 }, // { icon: "sunny", temp: 6 }, // { icon: "sunny", temp: 6 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 8 }, // { icon: "snowy2", temp: 8 }, // { icon: "snowy2", temp: 8 }, // { icon: "snowy2", temp: 8 }, // { icon: "sunny", temp: 8 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 9 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 10 }, // { icon: "sunny", temp: 8 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // { icon: "sunny", temp: 7 }, // ] ], // 每日天气 weekItems: [ { icon: "rainy1", max: 24, min: 15 }, { icon: "rainy2", max: 24, min: 15 }, { icon: "foggy", max: 26, min: 11 }, { icon: "cloudy", max: 22, min: 7 }, { icon: "snowy1", max: 10, min: 3 }, { icon: "sunny", max: 19, min: 5 }, { icon: "snowy2", max: 10, min: 4 } ] } } }, Be = { /** 默认数据 */ data: { type: Object, default: gt }, /** 主题参数 */ theme: { type: Number, default: 1 } }, Te = Dr(Be, dt, at, ot, Ct); function wr(i, B) { function o(r) { return r < 10 ? "0" + r : r; } return { addZero: o }; } function _0(i, B) { const o = I(i.data.data); return { colorTheme: L(() => (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime() < 0 || o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 0 ? ["#151276", "#7939e0", "#332396", "#814ca7"] : (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime() < 36e5 ? ["#49417b", "#f1b655", "#b1785b", "#d99877"] : o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime() < 36e5 ? ["#9e2e2e", "#f59b0b", "#c15334", "#ff7361"] : ["#0273D7", "#76BAFF", "#388FFF", "#75C6FE"]) }; } function Ce(i, B) { const o = I(i.data.data), r = _0(i); function x() { let e = f0.getInstanceByDom(document.getElementById("sunset")); e || (e = f0.init(document.getElementById("sunset"), null, { height: 170, width: 380 })), e.setOption({ series: [{ data: [{ value: (/* @__PURE__ */ new Date()).getTime() - o.value.default.sunriseTime.getTime(), itemStyle: { borderRadius: 10, color: { type: "linear", x: 1, y: 0, x2: 0, y2: 0, colorStops: [{ offset: 1, color: r.colorTheme.value ? r.colorTheme.value[3] : "white" }, { offset: 0, color: "white" }] } } }, { value: o.value.default.sunsetTime.getTime() - (/* @__PURE__ */ new Date()).getTime(), itemStyle: { opacity: 0 } }], type: "pie", center: ["50%", "100%"], radius: ["200%", "190%"], startAngle: 180, endAngle: 360, label: { show: !1 }, emphasis: { scale: !1 }, // 占位圆 emptyCircleStyle: { borderType: "dashed" } }, { type: "gauge", center: ["50%", "100%"], radius: "220%", startAngle: 180, endAngle: 360, // x轴刻度 axisTick: { show: !1 }, // x轴标签 axisLabel: { show: !1 }, axisLine: { show: !1 }, // 切分短线份数 splitNumber: 20, // 单条短线 splitLine: { length: 3, lineStyle: { width: 10, color: "white" } } }] }); } function g(e) { let t = f0.getInstanceByDom(document.getElementById("chart24h")); t || (t = f0.init(document.getElementById("chart24h"), null, { width: 1885, height: 75 })), t.setOption({ xAxis: { type: "category", show: !1 }, yAxis: { type: "value", show: !1 }, series: [{ data: o.value.default.dayItemsSet[e].map((l) => l.temp), type: "line", itemStyle: { color: "white" } }] }); } function E() { const e = document.getElementById("background"); if (e) { const t = e.getBoundingClientRect().width, l = Math.max(t, 400) * 1.11; let n = f0.getInstanceByDom(document.getElementById("chart7d")); n ? n.resize({ width: l, height: 90 }) : n = f0.init(document.getElementById("chart7d"), null, { width: l, height: 90 }), n.setOption({ grid: { left: 0 }, xAxis: { type: "category", show: !1 }, yAxis: { type: "value", show: !1 }, series: [{ data: o.value.default.weekItems.map((c) => c.min), type: "line", itemStyle: { color: "#5C90F9" } }, { data: o.value.default.weekItems.map((c) => c.max), type: "line", itemStyle: { color: "#FC9657" } }] }); } } function p() { const e = document.getElementById("airPoint"), t = document.getElementById("background"); e && t && (e.style.marginLeft = o.value.default.air / 500 * (t.getBoundingClientRect().width - 50) - 5 + "px"); } function C(e) { x(), g(e), E(), p(); } return { renderChart24h: g, renderChart7d: E, renderCharts: C }; } function yt(i, B) { const o = I(), r = I(i.data.data), x = I(0), g = wr(), E = Ce(i); function p(f) { x.value = f; } function C(f) { switch (f) { case 0: return "今天"; case 1: return "明天"; default: const d = new Date((/* @__PURE__ */ new Date()).getTime() + 24 * 60 * 60 * 1e3 * f).getDay(), a = "周"; switch (d) { case 0: return a + "日"; case 1: return a + "一"; case 2: return a + "二"; case 3: return a + "三"; case 4: return a + "四"; case 5: return a + "五"; case 6: return a + "六"; } break; } } function e(f) { const d = new Date((/* @__PURE__ */ new Date()).getTime() + 864e5 * f); return g.addZero(d.getMonth() + 1) + "/" + g.addZero(d.getDate()); } function t() { const d = o.value.getBoundingClientRect().width - 120, a = document.getElementById("f-weather-24h-content"); a && (a.offsetLeft + d > -32 ? a.style.marginLeft = "-32px" : a.style.marginLeft = a.offsetLeft + d + "px"); } function l() { const f = o.value.getBoundingClientRect().width, d = f - 120, a = document.getElementById("f-weather-24h-content"); if (a) { const s = a.scrollWidth - f - 130; a.offsetLeft - d < -s ? a.style.marginLeft = "-" + s + "px" : a.style.marginLeft = a.offsetLeft - d + "px"; } } function n(f, d) { if (f === 0) { const a = /* @__PURE__ */ new Date(); return d === 0 ? "现在" : g.addZero((a.getHours() + d) % 24); } else return g.addZero(d); } Cr(x, () => { const f = document.getElementById("f-weather-24h-content"); f.style.marginLeft = "-32px", E.renderChart24h(x.value); }); function c() { return S("div", { class: "f-weather-24h-container" }, [S("div", { class: "f-weather-24h-title" }, [t0("24小时天气预报")]), S("div", { class: "f-weather-lrbutton-container" }, [S("img", { src: "/components/weather/src/image/arrow-left.png", class: "f-weather-lrbutton-l", onClick: t }, null), S("img", { src: "/components/weather/src/image/arrow-right.png", class: "f-weather-lrbutton-r", onClick: l }, null)]), S("div", { class: "f-weather-24h-content-scroll" }, [S("div", { id: "f-weather-24h-content" }, [r.value.default.dayItemsSet.map((f, d) => d === x.value ? S("div", null, [S("tr", { id: "report" + d, class: "f-weather-24h-tr" }, [f.map((a, s) => S("td", { class: "f-weather-24h-td" }, [S("div", null, [n(d, s)]), S("img", { src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + a.icon + ".png", class: "f-weather-24h-img" }, null), S("div", null, [a.temp + "°"])]))])]) : ""), S("div", { id: "chart24h", class: "f-weather-chart24h" }, null)])])]); } function u() { return S("div", { class: "f-weather-7d-container" }, [S("div", { class: "f-weather-7d-title" }, [t0("七日天气预报")]), S("tr", { class: "f-weather-7d-tr" }, [r.value.default.weekItems.map((f, d) => S("td", { id: "day" + d, class: "f-weather-7d-td", style: "background-color: " + (d === x.value ? "rgba(0, 0, 0, 0.05)" : "none"), onClick: () => p(d) }, [S("div", { class: "f-weather-7d-td-title" }, [C(d)]), S("div", { class: "f-weather-7d-td-date" }, [e(d)]), S("img", { src: "http://mat1.gtimg.com/pingjs/ext2020/weather/pc/icon/weather/day/" + f.icon + ".png", class: "f-weather-7d-td-img" }, null), S("div", { class: "f-weather-7d-td-margin" }, [f.max + "°"]), S("div", null, [f.min + "°"])]))]), S("div", { id: "chart7d", class: "f-weather-chart7d" }, null)]); } function v() { return S("div", { ref: o }, [c(), u()]); } return { renderWeatherReport: v }; } function Et(i, B) { const o = I(i.data.data); function r() { return S("div", null, [o.value.default.proindexItemsSet.map((x) => S("tr", { class: "f-weather-proindex-tr" }, [x.map((g) => S("td", { class: "f-weather-proindex-td" }, [S("div", { class: "f-weather-proindex-content-scroll" }, [S("div", { class: "f-weather-proindex-content" }, [S("img", { src: "/components/weather/src/image/proindexImage/" + g.icon + ".png", class: "f-weather-proindex-icon" }, null), S("div", { class: "f-weather-proindex-text" }, [S("div", { class: "f-weather-proindex-title" }, [g.title]), S("div", { class: "f-weather-proindex-value" }, [g.value])]), S("div", { class: "f-weather-proindex-line" }, null), S("br", null, null), S("div", { class: "f-weather-proindex-info" }, [g.info]), S("br", null, null), S("div", null, [g.explain])])])]))]))]); } return { renderWeatherProindex: r }; } function At(i, B) { const o = I(!0), r = _0(i), { renderWeatherReport: x } = yt(i), { renderWeatherProindex: g } = Et(i), E = L(() => ({ "background-color": o.value ? r.colorTheme.value[2] : "", color: o.value ? "white" : "" })), p = L(() => ({ "background-color": o.value ? "" : r.colorTheme.value[2], color: o.value ? "" : "white" })), C = L(() => ({ display: o.value ? "block" : "none" })), e = L(() => ({ display: o.value ? "none" : "block" })); function t() { o.value = !0; } function l() { o.value = !1; } function n() { return S("div", { class: "f-weather-container f-weather-detail" }, [S("div", { style: "display:flex" }, [S("button", { class: "f-weather-button f-weather-button-report", style: E.value, onClick: t }, [t0("天气预报")]), S("button", { class: "f-weather-button f-weather-button-proindex", style: p.value, onClick: l }, [t0("其它参数")])]), S("div", { style: C.value }, [x()]), S("div", { style: e.value }, [g()])]); } return { renderWeatherDetail: n }; } var O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function _r(i) { return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i; } function mt(i) { if (i.__esModule) return i; var B = i.default; if (typeof B == "function") { var o = function r() { return this instanceof r ? Reflect.construct(B, arguments, this.constructor) : B.apply(this, arguments); }; o.prototype = B.prototype; } else o = {}; return Object.defineProperty(o, "__esModule", { value: !0 }), Object.keys(i).forEach(function(r) { var x = Object.getOwnPropertyDescriptor(i, r); Object.defineProperty(o, r, x.get ? x : { enumerable: !0, get: function() { return i[r]; } }); }), o; } var de = { exports: {} }, ve = { exports: {} }, g0 = 1e3, y0 = g0 * 60, E0 = y0 * 60, A0 = E0 * 24, Ft = A0 * 365.25, Dt = function(i, B) { B = B || {}; var o = typeof i; if (o === "string" && i.length > 0) return bt(i); if (o === "number" && isNaN(i) === !1) return B.long ? _t(i) : wt(i); throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(i) ); }; function bt(i) { if (i = String(i), !(i.length > 100)) { var B = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( i ); if (B) { var o = parseFloat(B[1]), r = (B[2] || "ms").toLowerCase(); switch (r) { case "years": case "year": case "yrs": case "yr": case "y": return o * Ft; case "days": case "day": case "d": return o * A0; case "hours": case "hour": case "hrs": case "hr": case "h": return o * E0; case "minutes": case "minute": case "mins": case "min": case "m": return o * y0; case "seconds": case "second": case "secs": case "sec": case "s": return o * g0; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return o; default: return; } } } } function wt(i) { return i >= A0 ? Math.round(i / A0) + "d" : i >= E0 ? Math.round(i / E0) + "h" : i >= y0 ? Math.round(i / y0) + "m" : i >= g0 ? Math.round(i / g0) + "s" : i + "ms"; } function _t(i) { return b0(i, A0, "day") || b0(i, E0, "hour") || b0(i, y0, "minute") || b0(i, g0, "second") || i + " ms"; } function b0(i, B, o) { if (!(i < B)) return i < B * 1.5 ? Math.floor(i / B) + " " + o : Math.ceil(i / B) + " " + o + "s"; } (function(i, B) { B = i.exports = x.debug = x.default = x, B.coerce = C, B.disable = E, B.enable = g, B.enabled = p, B.humanize = Dt, B.names = [], B.skips = [], B.formatters = {}; var o; function r(e) { var t = 0, l; for (l in e) t = (t << 5) - t + e.charCodeAt(l), t |= 0; return B.colors[Math.abs(t) % B.colors.length]; } function x(e) { function t() { if (t.enabled) { var l = t, n = +/* @__PURE__ */ new Date(), c = n - (o || n); l.diff = c, l.prev = o, l.curr = n, o = n; for (var u = new Array(arguments.length), v = 0; v < u.length; v++) u[v] = arguments[v]; u[0] = B.coerce(u[0]), typeof u[0] != "string" && u.unshift("%O"); var f = 0; u[0] = u[0].replace(/%([a-zA-Z%])/g, function(a, s) { if (a === "%%") return a; f++; var h = B.formatters[s]; if (typeof h == "function") { var m = u[f]; a = h.call(l, m), u.splice(f, 1), f--; } return a; }), B.formatArgs.call(l, u); var d = t.log || B.log || console.log.bind(console); d.apply(l, u); } } return t.namespace = e, t.enabled = B.enabled(e), t.useColors = B.useColors(), t.color = r(e), typeof B.init == "function" && B.init(t), t; } function g(e) { B.save(e), B.names = [], B.skips = []; for (var t = (typeof e == "string" ? e : "").split(/[\s,]+/), l = t.length, n = 0; n < l; n++) t[n] && (e = t[n].replace(/\*/g, ".*?"), e[0] === "-" ? B.skips.push(new RegExp("^" + e.substr(1) + "$")) : B.names.push(new RegExp("^" + e + "$"))); } function E() { B.enable(""); } function p(e) { var t, l; for (t = 0, l = B.skips.length; t < l; t++) if (B.skips[t].test(e)) return !1; for (t = 0, l = B.names.length; t < l; t++) if (B.names[t].test(e)) return !0; return !1; } function C(e) { return e instanceof Error ? e.stack || e.message : e; } })(ve, ve.exports); var kt = ve.exports; (function(i, B) { B = i.exports = kt, B.log = x, B.formatArgs = r, B.save = g, B.load = E, B.useColors = o, B.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : p(), B.colors = [ "lightseagreen", "forestgreen", "goldenrod", "dodgerblue", "darkorchid", "crimson" ]; function o() { return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } B.formatters.j = function(C) { try { return JSON.stringify(C); } catch (e) { return "[UnexpectedJSONParseError]: " + e.message; } }; function r(C) { var e = this.useColors; if (C[0] = (e ? "%c" : "") + this.namespace + (e ? " %c" : " ") + C[0] + (e ? "%c " : " ") + "+" + B.humanize(this.diff), !!e) { var t = "color: " + this.color; C.splice(1, 0, t, "color: inherit"); var l = 0, n = 0; C[0].replace(/%[a-zA-Z%]/g, function(c) { c !== "%%" && (l++, c === "%c" && (n = l)); }), C.splice(n, 0, t); } } function x() { return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments); } function g(C) { try { C == null ? B.storage.removeItem("debug") : B.storage.debug = C; } catch { } } function E() { var C; try { C = B.storage.debug; } catch { } return !C && typeof process < "u" && "env" in process && (C = process.env.DEBUG), C; } B.enable(E()); function p() { try { return window.localStorage; } catch { } } })(de, de.exports); var St = de.exports, We = St("jsonp"), Pt = Tt, Ht = 0; function Rt() { } function Tt(i, B, o) { typeof B == "function" && (o = B, B = {}), B || (B = {}); var r = B.prefix || "__jp", x = B.name || r + Ht++, g = B.param || "callback", E = B.timeout != null ? B.timeout : 6e4, p = encodeURIComponent, C = document.getElementsByTagName("script")[0] || document.head, e, t; E && (t = setTimeout(function() { l(), o && o(new Error("Timeout")); }, E)); function l() { e.parentNode && e.parentNode.removeChild(e), window[x] = Rt, t && clearTimeout(t); } function n() { window[x] && l(); } return window[x] = function(c) { We("jsonp got", c), l(), o && o(null, c); }, i += (~i.indexOf("?") ? "&" : "?") + g + "=" + p(x), i = i.replace("?&", "?"), We('jsonp req "%s"', i), e = document.createElement("script"), e.src = i, C.parentNode.insertBefore(e, C), n; } const Wt = /* @__PURE__ */ _r(Pt); var kr = { exports: {} }; function zt(i) { throw new Error('Could not dynamically require "' + i + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var H0 = { exports: {} }; const qt = {}, Ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: qt }, Symbol.toStringTag, { value: "Module" })), $t = /* @__PURE__ */ mt(Ot); var ze; function j() { return ze || (ze = 1, function(i, B) { (function(o, r) { i.exports = r(); })(O, function() { var o = o || function(r, x) { var g; if (typeof window < "u" && window.crypto && (g = window.crypto), typeof self < "u" && self.crypto && (g = self.crypto), typeof globalThis < "u" && globalThis.crypto && (g = globalThis.crypto), !g && typeof window < "u" && window.msCrypto && (g = window.msCrypto), !g && typeof O < "u" && O.crypto && (g = O.crypto), !g && typeof zt == "function") try { g = $t; } catch { } var E = function() { if (g) { if (typeof g.getRandomValues == "function") try { return g.getRandomValues(new Uint32Array(1))[0]; } catch { } if (typeof g.randomBytes == "function") try { return g.randomBytes(4).readInt32LE(); } catch { } } throw new Error("Native crypto module could not be used to get secure random number."); }, p = Object.create || /* @__PURE__ */ function() { function a() { } return function(s) { var h; return a.prototype = s, h = new a(), a.prototype = null, h; }; }(), C = {}, e = C.lib = {}, t = e.Base = /* @__PURE__ */ function() { return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function(a) { var s = p(this); return a && s.mixIn(a), (!s.hasOwnProperty("init") || this.init === s.init) && (s.init = function() { s.$super.init.apply(this, arguments); }), s.init.prototype = s, s.$super = this, s; }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function() { var a = this.extend(); return a.init.apply(a, arguments), a; }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function() { }, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function(a) { for (var s in a) a.hasOwnProperty(s) && (this[s] = a[s]); a.hasOwnProperty("toString") && (this.toString = a.toString); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function() { return this.init.prototype.extend(this); } }; }(), l = e.WordArray = t.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function(a, s) { a = this.words = a || [], s != x ? this.sigBytes = s : this.sigBytes = a.length * 4; }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function(a) { return (a || c).stringify(this); }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function(a) { var s = this.words, h = a.words, m = this.sigBytes, A = a.sigBytes; if (this.clamp(), m % 4) for (var b = 0; b < A; b++) { var D = h[b >>> 2] >>> 24 - b % 4 * 8 & 255; s[m + b >>> 2] |= D << 24 - (m + b) % 4 * 8; } else for (var P = 0; P < A; P += 4) s[m + P >>> 2] = h[P >>> 2]; return this.sigBytes += A, this; }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function() { var a = this.words, s = this.sigBytes; a[s >>> 2] &= 4294967295 << 32 - s % 4 * 8, a.length = r.ceil(s / 4); }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function() { var a = t.clone.call(this); return a.words = this.words.slice(0), a; }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function(a) { for (var s = [], h = 0; h < a; h += 4) s.push(E()); return new l.init(s, a); } }), n = C.enc = {}, c = n.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function(a) { for (var s = a.words, h = a.sigBytes, m = [], A = 0; A < h; A++) { var b = s[A >>> 2] >>> 24 - A % 4 * 8 & 255; m.push((b >>> 4).toString(16)), m.push((b & 15).toString(16)); } return m.join(""); }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function(a) { for (var s = a.length, h = [], m = 0; m < s; m += 2) h[m >>> 3] |= parseInt(a.substr(m, 2), 16) << 24 - m % 8 * 4; return new l.init(h, s / 2); } }, u = n.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function(a) { for (var s = a.words, h = a.sigBytes, m = [], A = 0; A < h; A++) { var b = s[A >>> 2] >>> 24 - A % 4 * 8 & 255; m.push(String.fromCharCode(b)); } return m.join(""); }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function(a) { for (var s = a.length, h = [], m = 0; m < s; m++) h[m >>> 2] |= (a.charCodeAt(m) & 255) << 24 - m % 4 * 8; return new l.init(h, s); } }, v = n.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function(a) { try { return decodeURIComponent(escape(u.stringify(a))); } catch { throw new Error("Malformed UTF-8 data"); } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function(a) { return u.parse(unescape(encodeURIComponent(a))); } }, f = e.BufferedBlockAlgorithm = t.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function() { this._data = new l.init(), this._nDataBytes = 0; }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function(a) { typeof a == "string" && (a = v.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes; }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function(a) { var s, h = this._data, m = h.words, A = h.sigBytes, b = this.blockSize, D = b * 4, P = A / D; a ? P = r.ceil(P) : P = r.max((P | 0) - this._minBufferSize, 0); var y = P * b, F = r.min(y * 4, A); if (y) { for (var w = 0; w < y; w += b) this._doProcessBlock(m, w); s = m.splice(0, y), h.sigBytes -= F; } return new l.init(s, F); }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function() { var a = t.clone.call(this); return a._data = this._data.clone(), a; }, _minBufferSize: 0 }); e.Hasher = f.extend({ /** * Configuration options. */ cfg: t.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function(a) { this.cfg = this.cfg.extend(a), this.reset(); }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function() { f.reset.call(this), this._doReset(); }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. *