@idmui/spot 0.0.2

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.
@@ -0,0 +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:{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-a8325fc3"]]),ve={install(n){n.component("SpotReport",$)}};b.SpotReport=$,b.SpotReportPlugin=ve,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @page{size:1200px;margin:20px auto 40px}.spot-report[data-v-a8325fc3]{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-a8325fc3]{width:100%;padding:10px 0;background-color:var(--idm-white)}.spot-report .header-box .search-box .input[data-v-a8325fc3]{width:300px}.spot-report .header-box .search-box .info[data-v-a8325fc3]{margin:0 10px;color:var(--idm-info-color);font-size:12px}.spot-report .content-box[data-v-a8325fc3]{flex:1;width:100%;box-sizing:border-box}.spot-report .content-box .title-box[data-v-a8325fc3]{margin-top:10px}.spot-report .content-box .title-box .main-title[data-v-a8325fc3]{font-size:16px;font-weight:700}.spot-report .content-box .title-box .sub-title[data-v-a8325fc3]{font-size:13px;padding:2px 0}.spot-report .content-box .title-box .icon[data-v-a8325fc3]{cursor:pointer;margin-left:10px;font-size:16px}.spot-report .content-box .title-box .icon[data-v-a8325fc3]:hover{color:var(--idm-primary-color)}.spot-report .content-box .title-box .icon.active[data-v-a8325fc3]{color:var(--idm-warning-color)}.spot-report .content-box #weather-chart[data-v-a8325fc3],.spot-report .content-box .weather-chart[data-v-a8325fc3]{height:225px;width:100%;border:1px solid var(--idm-gray-light);box-sizing:border-box}.spot-report .content-box .card-box[data-v-a8325fc3]{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-a8325fc3]{padding:2px 10px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table[data-v-a8325fc3],.spot-report .content-box .card-box .wave-current-table[data-v-a8325fc3]{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-a8325fc3],.spot-report .content-box .card-box .wave-current-table .tr-title[data-v-a8325fc3]{width:200px;padding-right:10px;text-align:right!important;background:none}.spot-report .content-box .card-box .basic-table .tr-title .unit[data-v-a8325fc3],.spot-report .content-box .card-box .wave-current-table .tr-title .unit[data-v-a8325fc3]{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-a8325fc3],.spot-report .content-box .card-box .wave-current-table td[data-v-a8325fc3]{text-align:center;line-height:21px;width:40px;background:var(--idm-white)}.spot-report .content-box .card-box .basic-table td.active[data-v-a8325fc3],.spot-report .content-box .card-box .wave-current-table td.active[data-v-a8325fc3]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table th[data-v-a8325fc3],.spot-report .content-box .card-box .wave-current-table th[data-v-a8325fc3]{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-a8325fc3],.spot-report .content-box .card-box .wave-current-table th.active[data-v-a8325fc3]{background:#e1f7ff}.spot-report .content-box .card-box .basic-table .weather-icon[data-v-a8325fc3],.spot-report .content-box .card-box .wave-current-table .weather-icon[data-v-a8325fc3]{width:24px;height:24px}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@idmui/spot",
3
+ "private": false,
4
+ "version": "0.0.2",
5
+ "description": "idm ui spot",
6
+ "type": "module",
7
+ "keywords": [
8
+ "idm",
9
+ "idmwx"
10
+ ],
11
+ "author": "idm",
12
+ "contributors": [
13
+ "ChenHeng"
14
+ ],
15
+ "license": "GPL-3.0",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "main": "./dist/index.umd.cjs",
20
+ "module": "./dist/index.js",
21
+ "types": "index.d.ts",
22
+ "scripts": {
23
+ "dev": "vite --config ./build/base.config.ts --host 0.0.0.0",
24
+ "build": "vue-tsc --noEmit && vite build --config ./build/lib.config.ts",
25
+ "lint:fix": "eslint --fix --ext .js,.ts,.vue .",
26
+ "prettier": "yarn lint:fix && prettier --write '**/*.{js,ts,vue}'",
27
+ "release": "yarn build && yarn publish --access public"
28
+ },
29
+ "dependencies": {
30
+ "@element-plus/icons-vue": "^2.1.0",
31
+ "@idm-plugin/geo": "^1.5.7",
32
+ "@idm-plugin/meteo": "^0.1.6",
33
+ "@idmui/brand": "^0.0.2",
34
+ "@idmui/style": "^0.1.4",
35
+ "axios": "^1.3.5",
36
+ "echarts": "^5.4.1",
37
+ "element-plus": "^2.2.13",
38
+ "moment": "^2.29.4",
39
+ "moment-timezone": "^0.5.47",
40
+ "vue": "^3.2.36"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^18.14.2",
44
+ "@typescript-eslint/eslint-plugin": "^5.53.0",
45
+ "@typescript-eslint/parser": "^5.53.0",
46
+ "@vitejs/plugin-vue": "^4.0.0",
47
+ "eslint": "^8.35.0",
48
+ "eslint-config-prettier": "^8.6.0",
49
+ "eslint-define-config": "^1.15.0",
50
+ "eslint-plugin-prettier": "^4.2.1",
51
+ "eslint-plugin-vue": "^9.9.0",
52
+ "lint-staged": "^13.1.2",
53
+ "prettier": "^2.8.4",
54
+ "sass": "^1.58.3",
55
+ "simple-git-hooks": "^2.8.1",
56
+ "stylelint": "^15.2.0",
57
+ "typescript": "^4.9.3",
58
+ "vite": "^4.1.0",
59
+ "vite-plugin-dts": "^2.0.2",
60
+ "vue-tsc": "^1.0.24"
61
+ },
62
+ "lint-staged": {
63
+ "*.{ts,tsx,js,vue}": "eslint --fix",
64
+ "*.{ts,tsx,js,vue,scss}": "prettier --write"
65
+ },
66
+ "simple-git-hooks": {
67
+ "pre-commit": "npx lint-staged"
68
+ }
69
+ }