@idmui/spot 0.0.4 → 0.0.5
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/Spot/src/index.vue.d.ts +2 -1
- package/dist/index.js +516 -452
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(b,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],f):(b=typeof globalThis<"u"?globalThis:b||self,f(b["idmui-report"]={},b.moment,b["moment-timezone"],b["@element-plus/icons-vue"],b["@idm-plugin/geo"],b.echarts,b.Vue,b.axios))})(this,function(b,f,O,se,Y,ae,e,Q){"use strict";function oe(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return s.default=n,Object.freeze(s)}const X=oe(ae);class v{static pickHourly(s,t){var r,a,h,D,V,B,N,z,S,g,x,o,i,L,C,M,P,I,H,T,F,W,R,p,y,E,A,q,j,_,k,d,w,m;const U=typeof t=="string"?f(t):t,J=s.weather,$e=s.marine,ee=f(J[0].hourly.date).utc(),Z=ee.clone().add(J[0].hourly.time.at(0),"h"),et=ee.clone().add(J[0].hourly.time.at(-1),"h"),te=[];if(U.isBetween(Z,et,"millisecond","[]")){const l=U.utc().diff(Z,"h",!1);let G,u;for(const K of J){const c=K.hourly;G={temp:(r=c.temperature_2m)==null?void 0:r.at(l),apparentTemp:(a=c.apparent_temperature)==null?void 0:a.at(l),rh:(h=c.relative_humidity_2m)==null?void 0:h.at(l),dp:(D=c.dew_point_2m)==null?void 0:D.at(l),precip:{probability:(V=c.precipitation_probability)==null?void 0:V.at(l),sum:(B=c.precipitation)==null?void 0:B.at(l)},code:(N=c.weather_code)==null?void 0:N.at(l),visibility:this.m2nm((z=c.visibility)==null?void 0:z.at(l)),wind:{speed:(S=c.wind_speed_10m)==null?void 0:S.at(l),kts:(g=c.wind_speed_10m)==null?void 0:g.at(l),degree:(x=c.wind_direction_10m)==null?void 0:x.at(l),bearing:(((o=c.wind_direction_10m)==null?void 0:o.at(l))+180)%360,gusts:(i=c.wind_gusts_10m)==null?void 0:i.at(l)},isDay:(L=c.is_day)==null?void 0:L.at(l)};const{name:tt,url:st}=this.parseWeatherCode(G.code,G.isDay);G.name=tt,G.url=st,G.wind.scale=this.beaufort(this.kts2ms(G.wind.kts)),G.wind.direction=this.degree2Direction(G.wind.degree)}for(const K of $e){const c=K.hourly;u={wave:{sig:{height:(C=c.wave_height)==null?void 0:C.at(l),degree:(M=c.wave_direction)==null?void 0:M.at(l),bearing:(((P=c.wave_direction)==null?void 0:P.at(l))+180)%360,period:(I=c.wave_period)==null?void 0:I.at(l)},swell:{height:(H=c.swell_wave_height)==null?void 0:H.at(l),degree:(T=c.swell_wave_direction)==null?void 0:T.at(l),bearing:(((F=c.swell_wave_direction)==null?void 0:F.at(l))+180)%360,period:(W=c.swell_wave_period)==null?void 0:W.at(l),peakPeriod:(R=c.swell_wave_peak_period)==null?void 0:R.at(l)},wd:{height:(p=c.wind_wave_height)==null?void 0:p.at(l),degree:(y=c.wind_wave_direction)==null?void 0:y.at(l),bearing:(((E=c.wind_wave_direction)==null?void 0:E.at(l))+180)%360,period:(A=c.wind_wave_period)==null?void 0:A.at(l),peakPeriod:(q=c.wind_wave_peak_period)==null?void 0:q.at(l)}},current:{speed:(j=c.ocean_current_velocity)==null?void 0:j.at(l),kts:(_=c.ocean_current_velocity)==null?void 0:_.at(l),degree:(k=c.ocean_current_direction)==null?void 0:k.at(l),bearing:(d=c.ocean_current_direction)==null?void 0:d.at(l)},sst:(w=c.sea_surface_temperature)==null?void 0:w.at(l),height:(m=c.sea_level_height_msl)==null?void 0:m.at(l)},u.wave.sig.direction=this.degree2Direction(u.wave.sig.degree),u.wave.swell.direction=this.degree2Direction(u.wave.swell.degree),u.wave.wd.direction=this.degree2Direction(u.wave.wd.degree),u.wave.sig.scale=this.douglas(u.wave.sig.height),u.wave.swell.scale=this.douglas(u.wave.swell.height),u.wave.wd.scale=this.douglas(u.wave.wd.height),u.current.direction=this.degree2Direction(u.current.degree)}te.push({utc:Z.add(l,"h").format(),weather:{...G},...u})}return te}static pickDaily(s,t){var r,a,h,D,V,B,N,z,S,g,x,o,i,L,C,M,P,I,H,T,F,W,R;const p=typeof t=="string"?f(t):t,y=s.weather,E=s.marine,A=f(y[0].daily.time.at(0)),q=f(y[0].daily.time.at(-1)),j=[];if(p.isBetween(A,q,"millisecond","[]")){let _,k;const d=p.diff(A,"d",!1);for(const w of y){const m=w.daily;_={code:(r=m.weather_code)==null?void 0:r.at(d),temp:{max:(a=m.temperature_2m_max)==null?void 0:a.at(d),min:(h=m.temperature_2m_min)==null?void 0:h.at(d)},apparentTemp:{max:(D=m.apparent_temperature_max)==null?void 0:D.at(d),min:(V=m.apparent_temperature_min)==null?void 0:V.at(d)},precip:{sum:(B=m.precipitation_sum)==null?void 0:B.at(d),hours:(N=m.precipitation_hours)==null?void 0:N.at(d),probability:(z=m.precipitation_probability_max)==null?void 0:z.at(d)},wind:{speed:(S=m.wind_speed_10m_max)==null?void 0:S.at(d),kts:(g=m.wind_speed_10m_max)==null?void 0:g.at(d),degree:(x=m.wind_direction_10m_dominant)==null?void 0:x.at(d),gusts:(o=m.wind_gusts_10m_max)==null?void 0:o.at(d)}};const{name:U,url:J}=this.parseWeatherCode(_.code,!0);_.name=U,_.url=J,_.wind.scale=this.beaufort(this.kts2ms(_.wind.kts)),_.wind.direction=this.degree2Direction(_.wind.degree)}for(const w of E){const m=w.daily;k={wave:{sig:{height:(i=m.wave_height_max)==null?void 0:i.at(d),degree:(L=m.wave_direction_dominant)==null?void 0:L.at(d),period:(C=m.wave_period_max)==null?void 0:C.at(d)},swell:{height:(M=m.swell_wave_height_max)==null?void 0:M.at(d),degree:(P=m.wave_direction_dominant)==null?void 0:P.at(d),period:(I=m.swell_wave_period_max)==null?void 0:I.at(d),peakPeriod:(H=m.swell_wave_peak_period_max)==null?void 0:H.at(d)},wd:{height:(T=m.wind_wave_height_max)==null?void 0:T.at(d),degree:(F=m.wind_wave_direction_dominant)==null?void 0:F.at(d),period:(W=m.wind_wave_period_max)==null?void 0:W.at(d),peakPeriod:(R=m.wind_wave_peak_period_max)==null?void 0:R.at(d)}}},k.wave.sig.direction=this.degree2Direction(k.wave.sig.degree),k.wave.swell.direction=this.degree2Direction(k.wave.swell.degree),k.wave.wd.direction=this.degree2Direction(k.wave.wd.degree),k.wave.sig.scale=this.douglas(k.wave.sig.height),k.wave.swell.scale=this.douglas(k.wave.swell.height),k.wave.wd.scale=this.douglas(k.wave.wd.height)}j.push({utc:A.add(d,"d").utc().format(),weather:{..._},...k})}return j}static parseWeatherCode(s,t){const r=this.weatherCode(s);return t?r.day:r.night}static weatherCode(s){const t={code:s};switch(s){case 0:t.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},t.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:t.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},t.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:t.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},t.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:t.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},t.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:t.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},t.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:t.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},t.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:t.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:t.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:t.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:t.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:t.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:t.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},t.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:t.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},t.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:t.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},t.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:t.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},t.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:t.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},t.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:t.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:t.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:t.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:t.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:t.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:t.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:t.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},t.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:t.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:t.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},t.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:t.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},t.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:t.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},t.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:t.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},t.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return t}static kts2ms(s){return Number.isNaN(s)?s:Math.round(s*1852/3600*1e4)/1e4}static kts2kmh(s){return Number.isNaN(s)?s:s*1.852}static m2nm(s){return Number.isNaN(s)?s:Math.round(s/1e3/1.852*1e4)/1e4}static kmh2kts(s){return Number.isNaN(s)?s:this.ms2kts(s*1e3/3600)}static ms2kts(s){return Number.isNaN(s)?s:Math.round(s*3600/1852*1e4)/1e4}static degree2Radian(s){if(Number.isNaN(s))return s;let t=s%360/360*2*Math.PI;return t=t<0?t+2*Math.PI:t,t}static degree2Direction(s){const t=this.degree2Radian(s);let r="N/A";const a=Math.PI/16;return t<a?r="N":t>=a&&t<3*a?r="NNE":t>=3*a&&t<5*a?r="NE":t>=5*a&&t<7*a?r="ENE":t>=7*a&&t<9*a?r="E":t>=9*a&&t<11*a?r="ESE":t>=11*a&&t<13*a?r="SE":t>=13*a&&t<15*a?r="SSE":t>=15*a&&t<17*a?r="S":t>=17*a&&t<19*a?r="SSW":t>=19*a&&t<21*a?r="SW":t>=21*a&&t<23*a?r="WSW":t>=23*a&&t<25*a?r="W":t>=25*a&&t<27*a?r="WNW":t>=27*a&&t<29*a?r="NW":t>=29*a&&t<31*a?r="NNW":t>=31*a&&t<32*a&&(r="N"),r}static beaufort(s){let t=0;return isNaN(s)||(s=Math.round(s*10)/10,s<=.2?t=0:s<=1.5?t=1:s<=3.3?t=2:s<=5.4?t=3:s<=7.9?t=4:s<=10.7?t=5:s<=13.8?t=6:s<=17.1?t=7:s<=20.7?t=8:s<=22.4?t=9:s<=28.4?t=10:s<=32.6?t=11:s>32.6&&(t=12)),t}static douglas(s){let t="Calm";return isNaN(s)||s<=.1?t="Calm":s<=.5?t="Smooth":s<=1.25?t="Slight":s<=2.5?t="Moderate":s<=4?t="Rough":s<=6?t="VeryRough":s<=9?t="High":s<=14?t="VeryHigh":t="Precipitous",t}}const at="",ne=(n,s)=>{const t=n.__vccOpts||n;for(const[r,a]of s)t[r]=a;return t},ie={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:f().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(se.Search),positionGmt:void 0,localDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,collectList:[],isCollected:!1}},computed:{computeHourL(){return function(n){return n?`${O(n).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(n){return n?`${f(n).utc().format("HH")}Z`:"-"}},computeWeek(){return function(n){return n?`${O(n).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(n){return n?`${O(n).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(n,s=4){return Y.LngLatHelper.lat2pretty(n,s).pretty}},computeLng(){return function(n,s=4){return Y.LngLatHelper.lng2pretty(n,s).pretty}},roundPrecision(){return function(n,s=4){return isNaN(n)?"-":Y.LngLatHelper.roundPrecision(n,s)}}},watch:{"report.version":{handler(){var n,s;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(n=this.report)==null?void 0:n.lat,lng:(s=this.report)==null?void 0:s.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){var n,s;this.loading=!1,this.positionGmt=(s=(n=this.meteoData.weather)==null?void 0:n[0])==null?void 0:s.timezone,this.localDate=O(this.ts).tz(this.positionGmt).format("MMM-DD/HHmm, YYYY [LT]"),this.activeIndex=O(this.ts).tz(this.positionGmt).hour(),this.pickedDate=O(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.$nextTick(()=>{this.initInfo(),this.initTableData(),this.initEchart()})},initInfo(){this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(n=>{var s;return n.name===((s=this.position)==null?void 0:s.name)})},initTableData(){var n,s,t,r,a,h,D,V,B,N,z,S,g,x,o,i,L,C,M,P,I,H,T,F,W,R,p,y,E,A,q,j,_;this.tableData={hours:[],utcHours:[],weatherUrls:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[]};for(let k=0;k<24;k++){const d=f(this.pickedDate).clone().add(k,"h").format();this.tableData.hours.push(d);const w=((n=v.pickHourly(this.meteoData,d))==null?void 0:n[0])||{};this.tableData.weatherUrls.push((s=w.weather)==null?void 0:s.url),this.tableData.temp.push(this.roundPrecision((t=w.weather)==null?void 0:t.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((a=(r=w.weather)==null?void 0:r.precip)==null?void 0:a.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((D=(h=w.weather)==null?void 0:h.precip)==null?void 0:D.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((V=w.weather)==null?void 0:V.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((B=w.weather)==null?void 0:B.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((z=(N=w.weather)==null?void 0:N.wind)==null?void 0:z.kts,1)),this.tableData.windDir.push((g=(S=w.weather)==null?void 0:S.wind)==null?void 0:g.bearing),this.tableData.windGust.push(this.roundPrecision((o=(x=w.weather)==null?void 0:x.wind)==null?void 0:o.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((L=(i=w.wave)==null?void 0:i.sig)==null?void 0:L.height,1)??"-"),this.tableData.sigwaveDir.push((M=(C=w.wave)==null?void 0:C.sig)==null?void 0:M.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((I=(P=w.wave)==null?void 0:P.wd)==null?void 0:I.height,1)??"-"),this.tableData.windwaveDir.push((T=(H=w.wave)==null?void 0:H.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((W=(F=w.wave)==null?void 0:F.wd)==null?void 0:W.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((p=(R=w.wave)==null?void 0:R.swell)==null?void 0:p.height,1)??"-"),this.tableData.swellDir.push((E=(y=w.wave)==null?void 0:y.swell)==null?void 0:E.bearing),this.tableData.swellPeriod.push(this.roundPrecision((q=(A=w.wave)==null?void 0:A.swell)==null?void 0:q.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((j=w.current)==null?void 0:j.speed,1)??"-"),this.tableData.currentDir.push((_=w.current)==null?void 0:_.bearing)}},initEchart(){var i,L,C,M,P,I,H,T,F,W,R;const n=[],s=[],t=[],r=[],a=[],h=[],D=[],V=[],B=[];for(let p=0;p<7;p++){const y=f(this.pickedDate).clone().add(p,"d");n.push(O(y).tz(this.positionGmt).format("yyyy-MM-DD")),s.push(this.computeMMMDD(y)),t.push(this.computeWeek(y));const E=((i=v.pickDaily(this.meteoData,y))==null?void 0:i[0])||{};r.push(this.roundPrecision((C=(L=E.weather)==null?void 0:L.temp)==null?void 0:C.min,0)),a.push(this.roundPrecision((P=(M=E.weather)==null?void 0:M.temp)==null?void 0:P.max,0)),D.push(this.roundPrecision((H=(I=E.weather)==null?void 0:I.wind)==null?void 0:H.kts,1)+" kts"),B.push(this.roundPrecision((F=(T=E.weather)==null?void 0:T.precip)==null?void 0:F.sum,0)+" mm"),h.push({symbol:"image://"+((W=E.weather)==null?void 0:W.url)}),V.push({symbol:"image://"+((R=E.weather)==null?void 0:R.url)})}const N=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),z=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*N,S=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*N,g=4+.5/n.length*92+"%",x=X.init(document.getElementById("weather-chart")),o={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"none",show:!1},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:n,show:!1},singleAxis:[{left:g,right:g,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"5%",height:"2%"},{left:g,right:g,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"14%",height:"2%"},{left:g,right:g,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"27%",height:"2%"},{left:g,right:g,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"84%",height:"2%"},{left:g,right:g,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:n,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:z,max:S,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:h,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"#2a57b7"},label:{show:!0,position:[-10,12],formatter:"{c} °C",fontSize:10},markArea:{itemStyle:{color:"#e1f7ff"},data:[[{x:"4%"},{x:4+1/n.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"#a7c4ff"},label:{show:!0,position:[-10,-12],formatter:"{c} °C",fontSize:10}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:D,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:B,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0}]};x.setOption(o),x.on("click",p=>{const y=p.dataIndex;this.pickedDate=O(n[y]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.initTableData(),o.series[3].markArea={itemStyle:{color:"#e1f7ff"},data:[[{x:4+y/n.length*92+"%"},{x:4+(y+1)/n.length*92+"%"}]]},x.setOption(o)})},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(n=>n.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(n){var r;const s=n.replaceAll(",",",");if(!s)return this.positionList=this.collectList,!1;const t=await Q.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${s}`,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.positionList=(r=t==null?void 0:t.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var t,r,a;if(!this.searchName)return!1;this.position={portId:(t=this.positionList.find(h=>h.name===this.searchName))==null?void 0:t.id,lat:(r=this.positionList.find(h=>h.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(h=>h.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const n={lat:this.position.lat,lng:this.position.lng,datetime:this.ts?f(this.ts).utc().add(-1,"d").format():f().add(-1,"d").utc().format(),forecastDays:8,selfHosted:!1},s=await Q.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",n,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.meteoData={...s==null?void 0:s.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,X.dispose(document.getElementById("weather-chart"))}}},re={class:"spot-report"},le={class:"header-box flex-between"},ce={class:"bg"},de={class:"search-box flex-start"},he={class:"content-box"},me={class:"title-box flex-between"},pe={class:"main-title"},we={class:"sub-title"},ge={class:"flex-end"},ke={key:0,id:"weather-chart"},ye={key:1,class:"weather-chart flex-center"},ue={key:2,class:"weather-chart flex-center"},fe={key:3,class:"card-box"},xe={class:"date"},_e={class:"basic-table"},be={class:"day"},Ne={rowspan:"1",colspan:"1",class:"tr-title"},Ee={class:"hour"},De={class:"icon"},Be=["src"],ze={class:"text"},Se={class:"text"},Ve={class:"text"},Le={class:"text"},Ce={class:"text"},Me={class:"text"},Pe={key:1},Ie={class:"text"},He={class:"text"},Te={class:"wave-current-table"},Fe={class:"text"},We={class:"text"},Re={key:1},Ge={class:"text"},Ae={class:"text"},Oe={class:"text"},je={key:1},qe={class:"text"},Je={class:"text"},Ue={class:"text"},Ye={key:1},Ze={class:"text"},Ke={key:4,class:"card-box flex-center"},Qe={key:5,class:"card-box flex-center"};function Xe(n,s,t,r,a,h){var N,z,S,g,x;const D=e.resolveComponent("ElOption"),V=e.resolveComponent("ElSelect"),B=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",le,[e.createElementVNode("div",ce,[e.createElementVNode("div",de,[e.createVNode(V,{modelValue:a.searchName,"onUpdate:modelValue":s[0]||(s[0]=o=>a.searchName=o),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:s[1]||(s[1]=o=>a.placeholder=""),onBlur:s[2]||(s[2]=o=>a.placeholder="search for port name or coordinates"),"remote-method":h.fetchSuggestPosition,onChange:h.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,o=>(e.openBlock(),e.createBlock(D,{key:o.name,label:o.name,value:o.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",he,[e.createElementVNode("div",me,[e.createElementVNode("div",null,[e.createElementVNode("div",pe,"Weather forecast for "+e.toDisplayString(((N=a.position)==null?void 0:N.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",we,"At "+e.toDisplayString((z=a.position)!=null&&z.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.localDate),1)]),e.createElementVNode("div",ge,[e.createVNode(B,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:s[3]||(s[3]=(...o)=>h.handleCollect&&h.handleCollect(...o))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:s[4]||(s[4]=(...o)=>h.handleCollect&&h.handleCollect(...o))},""))]),_:1},8,["content"])])]),(S=a.position)!=null&&S.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",ke)):a.loading?(e.openBlock(),e.createElementBlock("div",ye,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ue,"No Data")),(g=a.position)!=null&&g.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",xe,e.toDisplayString(h.computeWeek(a.pickedDate))+" "+e.toDisplayString(h.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",_e,[e.createElementVNode("tr",be,[e.createElementVNode("th",Ne,"Local time ("+e.toDisplayString(a.positionGmt)+")",1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(h.computeHourL(o)),3))),128))]),e.createElementVNode("tr",Ee,[s[5]||(s[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(o,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(h.computeHourZ(o)),3))),128))]),e.createElementVNode("tr",De,[s[6]||(s[6]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},"Weather",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[o?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:o},null,8,Be)):e.createCommentVNode("",!0)],2))),128))]),e.createElementVNode("tr",ze,[s[7]||(s[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Se,[s[8]||(s[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ve,[s[9]||(s[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Le,[s[10]||(s[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ce,[s[11]||(s[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Me,[s[12]||(s[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[o?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4)):(e.openBlock(),e.createElementBlock("span",Pe,"-"))],2))),128))]),e.createElementVNode("tr",Ie,[s[13]||(s[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",He,[s[14]||(s[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])]),s[24]||(s[24]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px 0 3px 200px"}},"Wave & Current",-1)),e.createElementVNode("table",Te,[e.createElementVNode("tr",Fe,[s[15]||(s[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",We,[s[16]||(s[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[o?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4)):(e.openBlock(),e.createElementBlock("span",Re,"-"))],2))),128))]),e.createElementVNode("tr",Ge,[s[17]||(s[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ae,[s[18]||(s[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Oe,[s[19]||(s[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[o?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4)):(e.openBlock(),e.createElementBlock("span",je,"-"))],2))),128))]),e.createElementVNode("tr",qe,[s[20]||(s[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Je,[s[21]||(s[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))]),e.createElementVNode("tr",Ue,[s[22]||(s[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},[o?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${o}deg)`})},"",4)):(e.openBlock(),e.createElementBlock("span",Ye,"-"))],2))),128))]),e.createElementVNode("tr",Ze,[s[23]||(s[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(o,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+o},e.toDisplayString(o),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",Ke,"Loading....")):(x=a.position)!=null&&x.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,"No Data"))])])}const $=ne(ie,[["render",Xe],["__scopeId","data-v-94729511"]]),ve={install(n){n.component("SpotReport",$)}};b.SpotReport=$,b.SpotReportPlugin=ve,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(f,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("moment"),require("moment-timezone"),require("@element-plus/icons-vue"),require("@idm-plugin/geo"),require("echarts"),require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","moment","moment-timezone","@element-plus/icons-vue","@idm-plugin/geo","echarts","vue","axios"],k):(f=typeof globalThis<"u"?globalThis:f||self,k(f["idmui-report"]={},f.moment,f["moment-timezone"],f["@element-plus/icons-vue"],f["@idm-plugin/geo"],f.echarts,f.Vue,f.axios))})(this,function(f,k,O,ie,Y,re,e,X){"use strict";function le(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>o[s]})}}return t.default=o,Object.freeze(t)}const v=le(re);class ${static pickHourly(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F,h,A,l,U,Z,te,se;const ae=typeof s=="string"?k(s):s,J=t.weather,ot=t.marine,ne=k(J[0].hourly.date).utc(),K=ne.clone().add(J[0].hourly.time.at(0),"h"),it=ne.clone().add(J[0].hourly.time.at(-1),"h"),oe=[];if(ae.isBetween(K,it,"millisecond","[]")){const c=ae.utc().diff(K,"h",!1);let W,q;for(const Q of J){const d=Q.hourly;W={temp:(r=d.temperature_2m)==null?void 0:r.at(c),apparentTemp:(a=d.apparent_temperature)==null?void 0:a.at(c),rh:(m=d.relative_humidity_2m)==null?void 0:m.at(c),dp:(N=d.dew_point_2m)==null?void 0:N.at(c),precip:{probability:(B=d.precipitation_probability)==null?void 0:B.at(c),sum:(x=d.precipitation)==null?void 0:x.at(c)},code:(_=d.weather_code)==null?void 0:_.at(c),visibility:this.m2nm((E=d.visibility)==null?void 0:E.at(c)),wind:{speed:(D=d.wind_speed_10m)==null?void 0:D.at(c),kts:(w=d.wind_speed_10m)==null?void 0:w.at(c),degree:(y=d.wind_direction_10m)==null?void 0:y.at(c),bearing:((n=d.wind_direction_10m)==null?void 0:n.at(c))!==null?(((i=d.wind_direction_10m)==null?void 0:i.at(c))+180)%360:null,gusts:(z=d.wind_gusts_10m)==null?void 0:z.at(c)},isDay:(V=d.is_day)==null?void 0:V.at(c)};const{name:rt,url:lt}=this.parseWeatherCode(W.code,W.isDay);W.name=rt,W.url=lt,W.wind.scale=this.beaufort(this.kts2ms(W.wind.kts)),W.wind.direction=this.degree2Direction(W.wind.degree)}for(const Q of ot){const d=Q.hourly;q={wave:{sig:{height:(S=d.wave_height)==null?void 0:S.at(c),degree:(L=d.wave_direction)==null?void 0:L.at(c),bearing:((C=d.wave_direction)==null?void 0:C.at(c))!==null?(((M=d.wave_direction)==null?void 0:M.at(c))+180)%360:null,period:(P=d.wave_period)==null?void 0:P.at(c)},swell:{height:(T=d.swell_wave_height)==null?void 0:T.at(c),degree:(I=d.swell_wave_direction)==null?void 0:I.at(c),bearing:((H=d.swell_wave_direction)==null?void 0:H.at(c))!==null?(((p=d.swell_wave_direction)==null?void 0:p.at(c))+180)%360:null,period:(g=d.swell_wave_period)==null?void 0:g.at(c),peakPeriod:(b=d.swell_wave_peak_period)==null?void 0:b.at(c)},wd:{height:(R=d.wind_wave_height)==null?void 0:R.at(c),degree:(j=d.wind_wave_direction)==null?void 0:j.at(c),bearing:((G=d.wind_wave_direction)==null?void 0:G.at(c))!==null?(((u=d.wind_wave_direction)==null?void 0:u.at(c))+180)%360:null,period:(F=d.wind_wave_period)==null?void 0:F.at(c),peakPeriod:(h=d.wind_wave_peak_period)==null?void 0:h.at(c)}},current:{speed:(A=d.ocean_current_velocity)==null?void 0:A.at(c),kts:(l=d.ocean_current_velocity)==null?void 0:l.at(c),degree:(U=d.ocean_current_direction)==null?void 0:U.at(c),bearing:((Z=d.ocean_current_direction)==null?void 0:Z.at(c))??null},sst:(te=d.sea_surface_temperature)==null?void 0:te.at(c),height:(se=d.sea_level_height_msl)==null?void 0:se.at(c)},q.wave=this.parseWave(q.wave),q.current.direction=this.degree2Direction(q.current.degree)}oe.push({utc:K.add(c,"h").format(),weather:{...W},...q})}return oe}static pickDaily(t,s){var r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H;const p=typeof s=="string"?k(s):s,g=t.weather,b=t.marine,R=k(g[0].daily.time.at(0)),j=k(g[0].daily.time.at(-1)),G=[];if(p.isBetween(R,j,"millisecond","[]")){let u,F;const h=p.diff(R,"d",!1);for(const A of g){const l=A.daily;u={code:(r=l.weather_code)==null?void 0:r.at(h),temp:{max:(a=l.temperature_2m_max)==null?void 0:a.at(h),min:(m=l.temperature_2m_min)==null?void 0:m.at(h)},apparentTemp:{max:(N=l.apparent_temperature_max)==null?void 0:N.at(h),min:(B=l.apparent_temperature_min)==null?void 0:B.at(h)},precip:{sum:(x=l.precipitation_sum)==null?void 0:x.at(h),hours:(_=l.precipitation_hours)==null?void 0:_.at(h),probability:(E=l.precipitation_probability_max)==null?void 0:E.at(h)},wind:{speed:(D=l.wind_speed_10m_max)==null?void 0:D.at(h),kts:(w=l.wind_speed_10m_max)==null?void 0:w.at(h),degree:(y=l.wind_direction_10m_dominant)==null?void 0:y.at(h),gusts:(n=l.wind_gusts_10m_max)==null?void 0:n.at(h)}};const{name:U,url:Z}=this.parseWeatherCode(u.code,!0);u.name=U,u.url=Z,u.wind.scale=this.beaufort(this.kts2ms(u.wind.kts)),u.wind.direction=this.degree2Direction(u.wind.degree)}for(const A of b){const l=A.daily;F={wave:{sig:{height:(i=l.wave_height_max)==null?void 0:i.at(h),degree:(z=l.wave_direction_dominant)==null?void 0:z.at(h),period:(V=l.wave_period_max)==null?void 0:V.at(h)},swell:{height:(S=l.swell_wave_height_max)==null?void 0:S.at(h),degree:(L=l.wave_direction_dominant)==null?void 0:L.at(h),period:(C=l.swell_wave_period_max)==null?void 0:C.at(h),peakPeriod:(M=l.swell_wave_peak_period_max)==null?void 0:M.at(h)},wd:{height:(P=l.wind_wave_height_max)==null?void 0:P.at(h),degree:(T=l.wind_wave_direction_dominant)==null?void 0:T.at(h),period:(I=l.wind_wave_period_max)==null?void 0:I.at(h),peakPeriod:(H=l.wind_wave_peak_period_max)==null?void 0:H.at(h)}}},F.wave=this.parseWave(F.wave)}G.push({utc:R.add(h,"d").utc().format(),weather:{...u},...F})}return G}static parseWave(t){return t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t}static parseWeatherCode(t,s){const r=this.weatherCode(t);return s?r.day:r.night}static weatherCode(t){const s={code:t};switch(t){case 0:s.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 1:s.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg"},s.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg"};break;case 2:s.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg"},s.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg"};break;case 3:s.day={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03d.svg"},s.night={name:"Cloudy",url:"https://osshz.idmwx.com/asset/weather/03n.svg"};break;case 45:s.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 48:s.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg"},s.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg"};break;case 51:s.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 53:s.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 55:s.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 56:s.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 57:s.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 61:s.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 63:s.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 65:s.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 66:s.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 67:s.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10d.svg"},s.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg"};break;case 71:s.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 73:s.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 75:s.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 77:s.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 80:s.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 81:s.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 82:s.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg"},s.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg"};break;case 85:s.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 86:s.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg"},s.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg"};break;case 95:s.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 96:s.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break;case 99:s.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg"},s.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg"};break}return s}static kts2ms(t){return isNaN(t)?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)?t:t*1.852}static m2nm(t){return isNaN(t)?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let s=t%360/360*2*Math.PI;return s=s<0?s+2*Math.PI:s,s}static degree2Direction(t){const s=this.degree2Radian(t);if(isNaN(s)||s===null)return null;let r="N/A";const a=Math.PI/16;return s<a?r="N":s>=a&&s<3*a?r="NNE":s>=3*a&&s<5*a?r="NE":s>=5*a&&s<7*a?r="ENE":s>=7*a&&s<9*a?r="E":s>=9*a&&s<11*a?r="ESE":s>=11*a&&s<13*a?r="SE":s>=13*a&&s<15*a?r="SSE":s>=15*a&&s<17*a?r="S":s>=17*a&&s<19*a?r="SSW":s>=19*a&&s<21*a?r="SW":s>=21*a&&s<23*a?r="WSW":s>=23*a&&s<25*a?r="W":s>=25*a&&s<27*a?r="WNW":s>=27*a&&s<29*a?r="NW":s>=29*a&&s<31*a?r="NNW":s>=31*a&&s<32*a&&(r="N"),r}static beaufort(t){let s=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?s=0:t<=1.5?s=1:t<=3.3?s=2:t<=5.4?s=3:t<=7.9?s=4:t<=10.7?s=5:t<=13.8?s=6:t<=17.1?s=7:t<=20.7?s=8:t<=22.4?s=9:t<=28.4?s=10:t<=32.6?s=11:t>32.6&&(s=12)),s}static douglas(t){let s="Calm";return isNaN(t)||t<=.1?s="Calm":t<=.5?s="Smooth":t<=1.25?s="Slight":t<=2.5?s="Moderate":t<=4?s="Rough":t<=6?s="VeryRough":t<=9?s="High":t<=14?s="VeryHigh":s="Precipitous",s}}const ct="",ce=(o,t)=>{const s=o.__vccOpts||o;for(const[r,a]of t)s[r]=a;return s},de={name:"SpotReport",props:{token:{type:String,default:""},ts:{type:String,default:k().utc().format()},timeZone:{type:Number,default:8},report:{type:Object,default:()=>({})}},data(){return{placeholder:"search for port name or coordinates",searchName:void 0,rawSearchIcon:e.markRaw(ie.Search),positionGmt:void 0,issuedDate:void 0,meteoData:{},a:void 0,positionList:[],position:void 0,loading:!0,activeIndex:void 0,tableData:{},pickedDate:void 0,pickedWeek:"Today",collectList:[],isCollected:!1}},computed:{computeHourL(){return function(o){return o?`${O(o).tz(this.positionGmt).format("HH")}`:"-"}},computeHourZ(){return function(o){return o?`${k(o).utc().format("HH")}Z`:"-"}},computeWeek(){return function(o){return o?`${O(o).tz(this.positionGmt).format("dddd")}`:"-"}},computeMMMDD(){return function(o){return o?`${O(o).tz(this.positionGmt).format("MMM-DD")}`:"-"}},computeLat(){return function(o,t=4){return Y.LngLatHelper.lat2pretty(o,t).pretty}},computeLng(){return function(o,t=4){return Y.LngLatHelper.lng2pretty(o,t).pretty}},roundPrecision(){return function(o,t=4){return isNaN(o)?"-":Y.LngLatHelper.roundPrecision(o,t)}}},watch:{"report.version":{handler(){var o,t;this.report&&(this.meteoData=this.report,this.position={id:this.report.portId,lat:(o=this.report)==null?void 0:o.lat,lng:(t=this.report)==null?void 0:t.lng,name:this.computeLat(this.report.lat)+","+this.computeLng(this.report.lng)},this.handleRender())}}},methods:{handleRender(){this.initInfo(),this.initTableData(),this.$nextTick(()=>{this.initEchart()})},initInfo(){var o,t;this.loading=!1,this.positionGmt=(t=(o=this.meteoData.weather)==null?void 0:o[0])==null?void 0:t.timezone,this.issuedDate=k(this.ts).utc().format("MMM-DD/HHmm,YYYY[Z]"),this.activeIndex=O(this.ts).tz(this.positionGmt).hour(),this.pickedDate=O(this.ts).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.collectList=JSON.parse(localStorage.getItem("idmCollectList")||"[]"),this.positionList=JSON.parse(JSON.stringify(this.collectList)),this.isCollected=this.collectList.some(s=>{var r;return s.name===((r=this.position)==null?void 0:r.name)})},initTableData(){var o,t,s,r,a,m,N,B,x,_,E,D,w,y,n,i,z,V,S,L,C,M,P,T,I,H,p,g,b,R,j,G,u,F;this.tableData={hours:[],utcHours:[],weatherUrls:[],weatherNames:[],temp:[],precipProbability:[],precip1h:[],visibility:[],humidity:[],windSpeed:[],windDir:[],windGust:[],sigwaveHeight:[],sigwaveDir:[],windwaveHeight:[],windwaveDir:[],windwavePeriod:[],swellHeight:[],swellDir:[],swellPeriod:[],currentSpeed:[],currentDir:[],seaLevel:[],seaTemp:[]};for(let h=0;h<24;h++){const A=k(this.pickedDate).clone().add(h,"h").format();this.tableData.hours.push(A);const l=((o=$.pickHourly(this.meteoData,A))==null?void 0:o[0])||{};this.tableData.weatherUrls.push((t=l.weather)==null?void 0:t.url),this.tableData.weatherNames.push(((s=l.weather)==null?void 0:s.name)??"-"),this.tableData.temp.push(this.roundPrecision((r=l.weather)==null?void 0:r.temp,0)??"-"),this.tableData.precipProbability.push(this.roundPrecision((m=(a=l.weather)==null?void 0:a.precip)==null?void 0:m.probability,0)??"-"),this.tableData.precip1h.push(this.roundPrecision((B=(N=l.weather)==null?void 0:N.precip)==null?void 0:B.sum,0)??"-"),this.tableData.visibility.push(this.roundPrecision((x=l.weather)==null?void 0:x.visibility,0)??"-"),this.tableData.humidity.push(this.roundPrecision((_=l.weather)==null?void 0:_.rh,0)??"-"),this.tableData.windSpeed.push(this.roundPrecision((D=(E=l.weather)==null?void 0:E.wind)==null?void 0:D.kts,1)),this.tableData.windDir.push((y=(w=l.weather)==null?void 0:w.wind)==null?void 0:y.bearing),this.tableData.windGust.push(this.roundPrecision((i=(n=l.weather)==null?void 0:n.wind)==null?void 0:i.gusts,1)??"-"),this.tableData.sigwaveHeight.push(this.roundPrecision((V=(z=l.wave)==null?void 0:z.sig)==null?void 0:V.height,1)??"-"),this.tableData.sigwaveDir.push((L=(S=l.wave)==null?void 0:S.sig)==null?void 0:L.bearing),this.tableData.windwaveHeight.push(this.roundPrecision((M=(C=l.wave)==null?void 0:C.wd)==null?void 0:M.height,1)??"-"),this.tableData.windwaveDir.push((T=(P=l.wave)==null?void 0:P.wd)==null?void 0:T.bearing),this.tableData.windwavePeriod.push(this.roundPrecision((H=(I=l.wave)==null?void 0:I.wd)==null?void 0:H.period,1)??"-"),this.tableData.swellHeight.push(this.roundPrecision((g=(p=l.wave)==null?void 0:p.swell)==null?void 0:g.height,1)??"-"),this.tableData.swellDir.push((R=(b=l.wave)==null?void 0:b.swell)==null?void 0:R.bearing),this.tableData.swellPeriod.push(this.roundPrecision((G=(j=l.wave)==null?void 0:j.swell)==null?void 0:G.period,1)??"-"),this.tableData.currentSpeed.push(this.roundPrecision((u=l.current)==null?void 0:u.speed,1)??"-"),this.tableData.currentDir.push((F=l.current)==null?void 0:F.bearing),this.tableData.seaLevel.push(this.roundPrecision(l.height,1)??"-"),this.tableData.seaTemp.push(this.roundPrecision(l.sst,1)??"-")}},initEchart(){var i,z,V,S,L,C,M,P,T,I,H;const o=[],t=[],s=[],r=[],a=[],m=[],N=[],B=[],x=[];for(let p=0;p<7;p++){const g=k(this.pickedDate).clone().add(p,"d");o.push(O(g).tz(this.positionGmt).format("yyyy-MM-DD")),t.push(this.computeMMMDD(g)),s.push(p===0?"Today":this.computeWeek(g));const b=((i=$.pickDaily(this.meteoData,g))==null?void 0:i[0])||{};r.push(this.roundPrecision((V=(z=b.weather)==null?void 0:z.temp)==null?void 0:V.min,0)),a.push(this.roundPrecision((L=(S=b.weather)==null?void 0:S.temp)==null?void 0:L.max,0)),N.push(this.roundPrecision((M=(C=b.weather)==null?void 0:C.wind)==null?void 0:M.kts,1)+" kts"),x.push(this.roundPrecision((T=(P=b.weather)==null?void 0:P.precip)==null?void 0:T.sum,0)+" mm"),m.push({symbol:"image://"+((I=b.weather)==null?void 0:I.url)}),B.push({symbol:"image://"+((H=b.weather)==null?void 0:H.url)})}const _=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))-Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p))),E=Math.min(...r.filter(p=>typeof p=="number"&&!isNaN(p)))-1.5*_,D=Math.max(...a.filter(p=>typeof p=="number"&&!isNaN(p)))+2*_,w=4+.5/o.length*92+"%",y=v.init(document.getElementById("weather-chart")),n={grid:{bottom:0,top:0,left:"4%",right:"4%"},tooltip:{trigger:"none",show:!1},legend:{show:!1},xAxis:{left:0,right:0,top:"50%",height:"50%",type:"category",data:o,show:!1},singleAxis:[{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"7%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"16%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"27%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"84%",height:"2%"},{left:w,right:w,type:"category",show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},boundaryGap:!1,data:o,top:"93%",height:"2%"}],yAxis:{type:"value",name:"温度(℃)",show:!1,min:E,max:D,axisLabel:{formatter:"{value} °C"}},series:[{singleAxisIndex:0,coordinateSystem:"singleAxis",type:"scatter",data:s,label:{show:!0,color:"#000",fontSize:14,formatter:"{c}"},symbolSize:0},{singleAxisIndex:1,coordinateSystem:"singleAxis",type:"scatter",data:t,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:2,coordinateSystem:"singleAxis",type:"scatter",data:m,symbolSize:36},{name:"温度(℃)",type:"line",data:r,smooth:!0,itemStyle:{color:"#2a57b7"},label:{show:!0,position:[-10,12],formatter:"{c} °C",fontSize:10},markArea:{itemStyle:{color:"#e1f7ff"},data:[[{x:"4%"},{x:4+1/o.length*92+"%"}]]}},{name:"温度(℃)",type:"line",data:a,smooth:!0,itemStyle:{color:"#a7c4ff"},label:{show:!0,position:[-10,-12],formatter:"{c} °C",fontSize:10}},{singleAxisIndex:3,coordinateSystem:"singleAxis",type:"scatter",data:N,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0},{singleAxisIndex:4,coordinateSystem:"singleAxis",type:"scatter",data:x,label:{show:!0,color:"#000",formatter:"{c}"},symbolSize:0}]};y.setOption(n),y.on("click",p=>{const g=p.dataIndex;this.pickedDate=O(o[g]).tz(this.positionGmt).set({hour:0,minute:0,second:0,millisecond:0}).format(),this.pickedWeek=g===0?"Today":this.computeWeek(this.pickedDate),this.initTableData(),n.series[3].markArea={itemStyle:{color:"#e1f7ff"},data:[[{x:4+g/o.length*92+"%"},{x:4+(g+1)/o.length*92+"%"}]]},y.setOption(n)})},handleCollect(){this.isCollected=!this.isCollected,this.isCollected?this.collectList.push({name:this.position.name,lat:this.position.lat,lng:this.position.lng}):this.collectList=this.collectList.filter(o=>o.name!==this.position.name),localStorage.setItem("idmCollectList",JSON.stringify(this.collectList))},async fetchSuggestPosition(o){var r;const t=o.replaceAll(",",",");if(!t)return this.positionList=this.collectList,!1;const s=await X.get(`https://cbe.idmwx.com/api/arc/ports/suggest?n=${t}`,{headers:{Authorization:this.token}});(s==null?void 0:s.data.code)===0&&(this.positionList=(r=s==null?void 0:s.data.data)==null?void 0:r.map(a=>(a.name=a.id?a.name:this.computeLat(a.lat)+", "+this.computeLng(a.lng),a)))},async handleFetchMeteo(){var s,r,a;if(!this.searchName)return!1;this.position={portId:(s=this.positionList.find(m=>m.name===this.searchName))==null?void 0:s.id,lat:(r=this.positionList.find(m=>m.name===this.searchName))==null?void 0:r.lat,lng:(a=this.positionList.find(m=>m.name===this.searchName))==null?void 0:a.lng,name:this.searchName},this.handleClear();const o={lat:this.position.lat,lng:this.position.lng,datetime:this.ts?k(this.ts).utc().add(-1,"d").format():k().add(-1,"d").utc().format(),forecastDays:8,selfHosted:!1},t=await X.post("https://cbe.idmwx.com/api/arc/meteo2/spot/forecast",o,{headers:{Authorization:this.token}});(t==null?void 0:t.data.code)===0&&(this.meteoData={...t==null?void 0:t.data.data}),this.handleRender()},handleClear(){this.loading=!0,this.meteoData={},this.isCollected=!1,v.dispose(document.getElementById("weather-chart"))}}},he={class:"spot-report"},me={class:"header-box flex-between"},pe={class:"bg"},we={class:"search-box flex-start"},ge={class:"content-box"},ke={class:"title-box flex-between"},ye={class:"main-title"},ue={class:"sub-title"},fe={class:"flex-end"},xe={key:0,id:"weather-chart"},_e={key:1,class:"weather-chart flex-center"},be={key:2,class:"weather-chart flex-center"},Ne={key:3,class:"card-box"},Ee={class:"date"},De={class:"basic-table"},Be={class:"day"},ze={class:"hour"},Ve={class:"icon"},Se=["src"],Le={class:"text"},Ce={class:"text"},Me={class:"text"},Pe={class:"text"},Te={class:"text"},Ie={class:"text"},He={key:1},Fe={class:"text"},We={class:"text"},Re={class:"wave-current-table"},Ae={class:"text"},Ge={class:"text"},Oe={key:1},je={class:"text"},qe={class:"text"},Ue={class:"text"},Ze={key:1},Je={class:"text"},Ye={class:"text"},Ke={class:"text"},Qe={key:1},Xe={class:"text"},ve={class:"sea-table"},$e={class:"text"},et={class:"text"},tt={key:4,class:"card-box flex-center"},st={key:5,class:"card-box flex-center"};function at(o,t,s,r,a,m){var _,E,D,w,y;const N=e.resolveComponent("ElOption"),B=e.resolveComponent("ElSelect"),x=e.resolveComponent("ElTooltip");return e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",me,[e.createElementVNode("div",pe,[e.createElementVNode("div",we,[e.createVNode(B,{modelValue:a.searchName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.searchName=n),filterable:"",class:"input",clearable:"",remote:"",placeholder:a.placeholder,autocomplete:"","remote-show-suffix":"",onFocus:t[1]||(t[1]=n=>a.placeholder=""),onBlur:t[2]||(t[2]=n=>a.placeholder="search for port name or coordinates"),"remote-method":m.fetchSuggestPosition,onChange:m.handleFetchMeteo},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.positionList,n=>(e.openBlock(),e.createBlock(N,{key:n.name,label:n.name,value:n.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","remote-method","onChange"])])])]),e.createElementVNode("div",ge,[e.createElementVNode("div",ke,[e.createElementVNode("div",null,[e.createElementVNode("div",ye,"Weather forecast for "+e.toDisplayString(((_=a.position)==null?void 0:_.name)||"-")+" ( "+e.toDisplayString(a.positionGmt)+" )",1),e.createElementVNode("div",ue,"At "+e.toDisplayString((E=a.position)!=null&&E.portId?"port":"coordinates")+", issued "+e.toDisplayString(a.issuedDate),1)]),e.createElementVNode("div",fe,[e.createVNode(x,{placement:"left",effect:"light",content:a.isCollected?"remove the port/coordinate from the search list":"add the port/coordinate to the search list","show-after":1e3},{default:e.withCtx(()=>[a.isCollected?(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon active",onClick:t[3]||(t[3]=(...n)=>m.handleCollect&&m.handleCollect(...n))},"")):(e.openBlock(),e.createElementBlock("span",{key:1,class:"iconfont icon",onClick:t[4]||(t[4]=(...n)=>m.handleCollect&&m.handleCollect(...n))},""))]),_:1},8,["content"])])]),(D=a.position)!=null&&D.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",xe)):a.loading?(e.openBlock(),e.createElementBlock("div",_e,"Loading....")):a.position.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",be,"No Data")),(w=a.position)!=null&&w.name&&!a.loading?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("div",Ee,e.toDisplayString(a.pickedWeek)+" "+e.toDisplayString(m.computeMMMDD(a.pickedDate)),1),e.createElementVNode("table",De,[e.createElementVNode("tr",Be,[t[5]||(t[5]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Local time"),e.createElementVNode("span",{class:"unit"},"(LT)")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"local"},e.toDisplayString(m.computeHourL(n)),3))),128))]),e.createElementVNode("tr",ze,[t[6]||(t[6]=e.createElementVNode("th",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("UTC"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.hours,(n,i)=>(e.openBlock(),e.createElementBlock("th",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"z"},e.toDisplayString(m.computeHourZ(n)),3))),128))]),e.createElementVNode("tr",Ve,[t[7]||(t[7]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Weather"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.weatherUrls,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+"url"},[e.createVNode(x,{placement:"top",effect:"light",content:a.tableData.weatherNames[i],"show-after":500},{default:e.withCtx(()=>[n?(e.openBlock(),e.createElementBlock("img",{key:0,class:"iconfont weather-icon",src:n},null,8,Se)):e.createCommentVNode("",!0)]),_:2},1032,["content"])],2))),128))]),e.createElementVNode("tr",Le,[t[8]||(t[8]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.temp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ce,[t[9]||(t[9]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation Probability"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precipProbability,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Me,[t[10]||(t[10]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Precipitation 1h"),e.createElementVNode("span",{class:"unit"},"mm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.precip1h,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Pe,[t[11]||(t[11]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Visibility"),e.createElementVNode("span",{class:"unit"},"nm")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.visibility,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Te,[t[12]||(t[12]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Relative Humidity"),e.createElementVNode("span",{class:"unit"},"%")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.humidity,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ie,[t[13]||(t[13]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",He,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Fe,[t[14]||(t[14]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",We,[t[15]||(t[15]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind gust"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windGust,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[27]||(t[27]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",Re,[e.createElementVNode("tr",Ae,[t[16]||(t[16]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ge,[t[17]||(t[17]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwaveDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Oe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",je,[t[18]||(t[18]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Wind wave period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.windwavePeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",qe,[t[19]||(t[19]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ue,[t[20]||(t[20]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Ze,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Je,[t[21]||(t[21]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Swell period"),e.createElementVNode("span",{class:"unit"},"s")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.swellPeriod,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ye,[t[22]||(t[22]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sig wave height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.sigwaveHeight,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",Ke,[t[23]||(t[23]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current direction"),e.createElementVNode("span",{class:"unit"})],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentDir,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},[isNaN(n)?(e.openBlock(),e.createElementBlock("span",Qe,"-")):(e.openBlock(),e.createElementBlock("span",{key:0,class:"iconfont icon",style:e.normalizeStyle({display:"inline-block",transform:`rotate(${n}deg)`})},"",4))],2))),128))]),e.createElementVNode("tr",Xe,[t[24]||(t[24]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Current speed"),e.createElementVNode("span",{class:"unit"},"kts")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.currentSpeed,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])]),t[28]||(t[28]=e.createElementVNode("div",{style:{"text-align":"center",padding:"3px"}},null,-1)),e.createElementVNode("table",ve,[e.createElementVNode("tr",$e,[t[25]||(t[25]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea level height"),e.createElementVNode("span",{class:"unit"},"m")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaLevel,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))]),e.createElementVNode("tr",et,[t[26]||(t[26]=e.createElementVNode("td",{rowspan:"1",colspan:"1",class:"tr-title"},[e.createTextVNode("Sea surface temperature"),e.createElementVNode("span",{class:"unit"},"°C")],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.tableData.seaTemp,(n,i)=>(e.openBlock(),e.createElementBlock("td",{rowspan:"1",colspan:"1",class:e.normalizeClass(a.activeIndex===i?"active":""),key:Math.random()+n},e.toDisplayString(n),3))),128))])])])):a.loading?(e.openBlock(),e.createElementBlock("div",tt,"Loading....")):(y=a.position)!=null&&y.name?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",st,"No Data"))])])}const ee=ce(de,[["render",at],["__scopeId","data-v-7b348412"]]),nt={install(o){o.component("SpotReport",ee)}};f.SpotReport=ee,f.SpotReportPlugin=nt,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-
|
|
1
|
+
@page{size:1200px;margin:20px auto 40px}.spot-report[data-v-7b348412]{height:100%;width:1160px;margin:0 auto;padding:0;display:flex;flex-direction:column;color:var(--idm-black-8)}.spot-report .header-box[data-v-7b348412]{width:100%;padding:10px 0;background-color:var(--idm-white)}.spot-report .header-box .search-box .input[data-v-7b348412]{width:300px}.spot-report .header-box .search-box .info[data-v-7b348412]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-7b348412]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box[data-v-7b348412]{margin-top:5px}.spot-report .content-box .title-box .main-title[data-v-7b348412]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-7b348412]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-7b348412]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-7b348412]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-7b348412]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-7b348412],.spot-report .content-box .weather-chart[data-v-7b348412]{height:225px;width:100%;border:1px solid var(--idm-gray-light);box-sizing:border-box}.spot-report .content-box .card-box[data-v-7b348412]{min-height:500px;margin:10px 0;background:var(--idm-gray-light);border-radius:4px;font-size:14px;color:var(--idm-black-8);line-height:26px}.spot-report .content-box .card-box .date[data-v-7b348412]{font-weight:700;padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table[data-v-7b348412],.spot-report .content-box .card-box .sea-table[data-v-7b348412]{width:100%;font-size:12px;padding:5px;border-collapse:collapse;border:1px solid var(--idm-gray-light)}.spot-report .content-box .card-box .basic-table .tr-title[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-7b348412],.spot-report .content-box .card-box .sea-table .tr-title[data-v-7b348412]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-7b348412],.spot-report .content-box .card-box .sea-table .tr-title .unit[data-v-7b348412]{width:20px;padding:0 5px;text-align:left;display:inline-block;color:var(--idm-info-color)}.spot-report .content-box .card-box .basic-table td[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table td[data-v-7b348412],.spot-report .content-box .card-box .sea-table td[data-v-7b348412]{text-align:center;line-height:21px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table td.active[data-v-7b348412],.spot-report .content-box .card-box .sea-table td.active[data-v-7b348412]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table th[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table th[data-v-7b348412],.spot-report .content-box .card-box .sea-table th[data-v-7b348412]{color:var(--idm-info-color);font-weight:400;text-align:center;line-height:21px;width:40px}.spot-report .content-box .card-box .basic-table th.active[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table th.active[data-v-7b348412],.spot-report .content-box .card-box .sea-table th.active[data-v-7b348412]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-7b348412],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-7b348412],.spot-report .content-box .card-box .sea-table .weather-icon[data-v-7b348412]{width:24px;height:24px;cursor:pointer}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idmui/spot",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "idm ui spot",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@element-plus/icons-vue": "^2.1.0",
|
|
31
31
|
"@idm-plugin/geo": "^1.5.7",
|
|
32
|
-
"@idm-plugin/meteo": "^0.1.
|
|
32
|
+
"@idm-plugin/meteo": "^0.1.7",
|
|
33
33
|
"@idmui/brand": "^0.0.2",
|
|
34
34
|
"@idmui/style": "^0.1.4",
|
|
35
35
|
"axios": "^1.3.5",
|