js 导出csv格式文件,如果字段中存在逗号,将整个字段拼接上引号:如下
if(!Curent_noflyZoneList||Curent_noflyZoneList.length==0){
layerOpen(“没有可导出的数据!”);
return;
}
var obj={};
obj.title=[“序号”,“禁飞区名称”,“类型”,“半径”,“起始方位”,“截止方位”,“长度”,“宽度”,“离地高度”,“海拔高度”,“位置点”,“备注”];
obj.titleForKey=[“number”,“name”,“type”,“round_radius”,“sector_startLocation”,“sector_endLocation”,“ellipse_length”,“ellipse_width”,“height”,“altitude”,“locationList”,“remarks”];
var dataTmp=[];
for(let k in Curent_noflyZoneList){
let data={};
data.number=k+1;
data.name=Curent_noflyZoneList[k].name;
data.type=“多边形”;
data.round_radius="";
data.sector_startLocation="";
data.sector_endLocation="";
data.ellipse_length="";
data.ellipse_width="";
data.height=Curent_noflyZoneList[k].height;
data.alti
js 导出csv格式文件,并且处理逗号
最新推荐文章于 2023-07-25 09:55:05 发布