timeComponent(url, date, height) {
let ele = document.createElement("div");
ele.id = "ele"
let content = new Vue({
data() {
return {
time: date, // 北京时
UTCtime: new Date(date.getTime() - 8 * 3600000), // 世界时
specialtime: new Date(date.getTime() - (date.getMinutes() -
parseInt(date.getMinutes() / 6) * 6) * 60000), //当前时间最近的6分钟
height: height // 高空产品,有高度选择项
};
},
template: "<div>" + url + "</div>"
}).$mount('#ele')
return content.$el.innerHTML.trim()
}
普通模板
"image": {
"url": "radar_image_mercator/WPPP_PP_{{time.format('yyyyMMdd_hh0000')}}.png",
"extent": [
[12.2, 73.0],
[54.2, 135.0]
],
"historyrules": "product/radar/mercator/PP/{{time.format('yyyy')}}/{{time.format('yyyyMMdd')}}/WPPP_PP_{{time.format('yyyyMMdd_hh0000')}}.png"
},
带有高度选择项
"image": {
"url": "product_aws/MOC_3D_T_{{time.format('yyyyMMdd_hh0000')}}_{{height}}.png",
"extent": [
[8, 73.0],
[62, 135.0]
"historyrules": "product/laps/3D_T/{{time.format('yyyy')}}/{{time.format('yyyyMMdd')}}/MOC_3D_T_{{time.format('yyyyMMdd_hh0000')}}_{{height}}.png"
},