export let allLayerInfo = [
	{
		name: '农业规划',
		layer: 1,
		children: [
			{
				name: '养殖水域滩涂规划',
				url: 'http://10.121.226.95:8081/OneMapServer/rest/services/tidalflat_shanghai/MapServer',
				title: 'yzsyttgh',
				id: 'yzsyttgh',
				layer: 2,
			},
			{
				name: '三区划定',
				layer: 2,
				url: 'http://10.121.226.95:8081/OneMapServer/rest/services/SANQUHUADING2021_new/MapServer',
				sublayers: [{ id: 18 }, { id: 19 }],
				title: 'sqhd',
				id: 'sqhd'
			},
			{
				name: '永久基本农田',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nygh/FeatureServer/0',
				title: 'yjjbnt',
				id: 'yjjbnt',
			},
			{
				name: '耕地保护空间',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nygh/FeatureServer/1',
				title: 'gdbhkj',
				id: 'gdbhkj',
			},
			{
				name: '生态保护红线',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nygh/FeatureServer/2',
				title: 'stbhhx',
				id: 'stbhhx',
			},
			{
				name: '城市开发边界',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nygh/FeatureServer/3',
				title: 'cskfbj',
				id: 'cskfbj',
			},
			{
				name: '高标准农田规划',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nygh/FeatureServer/4',
				title: 'gbzntgh',
				id: 'gbzntgh',
			},
		]
	},
	{
		name: '农业现状',
		layer: 1,
		children: [
			{
				name: '农用地现状',
				layer: 2,
				url: 'http://10.121.226.95:8081/OneMapServer/rest/services/Agri_land_CM/MapServer',
				id: 'nydxz',
				title: 'nydxz'
			},
			/* {
				name: '高标准农田',
				layer: 2,
				children: [
					{
						name: '已建项目',
						url: 'http://10.121.226.95:8081/OneMapServer/rest/services/gbznt_yj_202112/MapServer',
						id: 'gbznt-yjxm',
						title: 'gbznt-yjxm',
						layer: 3
					},
					{
						name: '在建项目',
						url: 'http://10.121.226.95:8081/OneMapServer/rest/services/gbznt_zj_202112/MapServer',
						id: 'gbznt-zjxm',
						title: 'gbznt-zjxm',
						layer: 3
					},
				]
			}, */
			{
				name: '高标准农田现状',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/0',
				id: 'gbzntxz',
				title: 'gbzntxz'
			},
			{
				name: '特色产业',
				layer: 2,
				/* children: [
					{
						name: '崇明大米',
						layer: 3
					},
					{
						name: '崇明水仙花',
						layer: 3
					},
					{
						name: '崇明蔬菜',
						layer: 3
					},
					{
						name: '崇明沙乌头猪',
						layer: 3
					},
					{
						name: '崇明白山羊',
						layer: 3
					},
					{
						name: '崇明清水蟹',
						layer: 3
					},
				] */
			},
			{
				name: '都市项目',
				layer: 2,
				// url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/1',
				url: 'dynamicLayer',
				id: 'dsxm',
				title: 'dsxm'
			},
			{
				name: '重点项目',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/2',
				id: 'zdxm',
				title: 'zdxm'
			},
			/* {
				name: '重点项目',
				layer: 2,
				children: [
					{
						name: '现代农业发展专项项目',
						layer: 3
					},
					{
						name: '农田建设项目',
						layer: 3
					},
					{
						name: '美丽乡村建设项目',
						layer: 3
					},
					{
						name: '都市蔬菜优势特色产业集群项目',
						layer: 3
					},
					{
						name: '水产绿色养殖推广项目',
						layer: 3
					}
				]
			}, */
			{
				name: '龙头企业',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/3',
				id: 'ltqy',
				title: 'ltqy'
			},
			{
				name: '水产健康养殖示范场',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/4',
				id: 'scjkyzsfc',
				title: 'scjkyzsfc'
			},
			/* {
				name: '基地分布',
				layer: 2,
				children: [
					{
						name: '畜牧基地',
						layer: 3,
					},
					{
						name: '水产基地',
						layer: 3,
					},
					{
						name: '蔬菜基地',
						layer: 3,
					},
					{
						name: '花卉基地',
						layer: 3,
					},
					{
						name: '林果基地',
						layer: 3,
					},
					{
						name: '种源基地',
						layer: 3,
					},
				]
			}, */
			{
				name: '规模化农业基地',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nyxz/FeatureServer/5',
				id: 'gmhnyjd',
				title: 'gmhnyjd',
			},
			/* {
				name: '土地流转',
				layer: 2,
			}, */
		]
	},

	{
		name: '动物防疫',
		layer: 1,
		children: [
			{
				name: '规模化养殖场',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/dwfy/FeatureServer/0',
				id: 'gmhyzc',
				title: 'gmhyzc'
				/* children: [
					{
						name: '（牛、羊、猪、禽）',
						layer: 3,
					}
				] */
			},
			{
				name: '乡镇畜牧兽医站',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/dwfy/FeatureServer/1',
				id: 'xzxmsyz',
				title: 'xzxmsyz'
			},
			/* {
				name: '乡镇兽医站',
				layer: 2,
			}, */
			{
				name: '宠物诊所',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/dwfy/FeatureServer/2',
				id: 'cwzs',
				title: 'cwzs',
			},
			/* {
				name: '宠物店',
				layer: 2,
			}, */
		]
	},
	{
		name: '绿色发展',
		layer: 1,
		children: [
			/* {
				name: '农资门店',
				id: 'nzmd',
				title: 'nzmd',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/cm/FeatureServer/1'
			}, */
			/* {
				name: '地理标志',
				layer: 2,
				id: 'dlbz',
				title: 'dlbz',
				url: 'http://10.121.226.95:8081/OneMapServer/rest/services/AgriGreen/MapServer/2',
				type: 'tile'
			},
			{
				name: '有机农产品',
				layer: 2,
				id: 'yjncp',
				title: 'yjncp',
				url: 'http://10.121.226.95:8081/OneMapServer/rest/services/AgriGreen/MapServer/1',
				type: 'tile'
			},
			{
				name: '菜篮子工程车',
				layer: 2,
			},
			{
				name: '恒温库',
				layer: 2,
			},
			{
				name: '冷藏库',
				layer: 2,
			},
			{
				name: '冷冻库',
				layer: 2,
			}, */
			{
				name: '农药门店',
				id: 'nymd',
				title: 'nymd',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/lsfz/FeatureServer/0'
			},
			{
				name: '安全监管站',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/lsfz/FeatureServer/1',
				id: "aqjgz",
				title: "aqjgz"
			},
			{
				name: '智慧速测设备分布',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/lsfz/FeatureServer/2',
				id: "zhcssbfb",
				title: "zhcssbfb"
			},
			{
				name: '绿色认证',
				layer: 2,
				id: 'lsrz',
				title: 'lsrz',
				url: 'http://10.108.3.5/ags_feature_svc/lsfz/FeatureServer/4',
			},
			{
				name: '耕地地力监测',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/lsfz/FeatureServer/3',
				id: 'gddljc',
				title: 'gddljc',
			},
		]
	},

	{
		name: '土地审批',
		layer: 1,
		children: [
			/* {
				name: '市级储备',
				layer: 2,
			},
			{
				name: '区级储备',
				layer: 2,
			},
			{
				name: '一般储备',
				layer: 2,
			}, */
			{
				name: '意向招商地块',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/tdsp/FeatureServer/0',
				id: "yxzsdk",
				title: "yxzsdk"
			},
			{
				name: '设施农用地',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/tdsp/FeatureServer/1',
				id: "ssnyd",
				title: "ssnyd"
			},
			// {
			// 	name: '土地权属',
			// 	layer: 2,
			// },
		]
	},
	{
		name: '农房管理',
		layer: 1,
		children: [
			{
				name: '郊野单元规划',
				layer: 2,
				children: [
					{
						name: '郊野单元保留村',
						layer: 3,
						url: 'http://10.108.3.5/ags_feature_svc/nfgl/FeatureServer/1',
						id: "jydyblc",
						title: "jydyblc"
					},
					{
						name: '郊野单元撤并村',
						layer: 3,
						url: 'http://10.108.3.5/ags_feature_svc/nfgl/FeatureServer/2',
						id: "jydycbc",
						title: "jydycbc"
					}
				]
			},
			{
				name: '农村宅基地',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nfgl/FeatureServer/3',
				id: 'nczjd',
				title: 'nczjd'
			},
			{
				name: '农房建筑',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nfgl/FeatureServer/4',
				id: 'nfjz',
				title: 'nfjz'
			},
			{
				name: '乡村振兴与美丽乡村示范村',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/nfgl/FeatureServer/0',
				id: "xczxymlxcsfc",
				title: "xczxymlxcsfc"
			},
			/* {
				name: '三维实景',
				layer: 2,
				children: [
					{
						name: '乡村振兴示范村',
						layer: 3,
					},
					{
						name: '美丽乡村示范村',
						layer: 3,
					},
				]
			}, */
		]
	},

	{
		name: '智慧物联',
		layer: 1,
		children: [
			{
				name: '物联设备分布',
				layer: 2,
				url: 'http://10.108.3.5/ags_feature_svc/zhwl/FeatureServer/0',
				id: 'wlsbfb',
				title: 'wlsbfb'
			},
			/* {
				name: '传感器、摄像头分布',
				layer: 2,
			},
			{
				name: '智慧速测设备分布',
				layer: 2,
			},
			{
				name: '水肥一体机分布',
				layer: 2,
			}, */
			{
				name: '无人农机分布',
				layer: 2,
			},
		]
	},
	{
		name: '基础地理',
		layer: 1,
		children: [
			{
				name: '基础底图',
				layer: 2,
				children: [
					{
						name: '政务底图',
						id: 'zwdt',
						title: 'zwdt',
						layer: 3,
						// url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/basemap_normal_kp_3857/MapServer',
						type: 'tile',
						url: 'http://10.108.3.5/ags_tile_svc/basemap_zw/MapServer'
					},
					{
						name: '暗色底图',
						layer: 3,
						id: 'asdt',
						title: 'asdt',
						// url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/basemap_dark_black_kp_3857/MapServer',
						type: 'tile',
						url: 'http://10.108.3.5/ags_tile_svc/basemap_as/MapServer'
					},
				]
			},
			{
				name: '行政区界',
				layer: 2,
				id:'xzqj',
				children: [
					{
						name: '镇界线',
						id: 'zjx',
						title: 'zjx',
						layer: 3,
						url: 'http://10.108.3.5/ags_feature_svc/xzqh/FeatureServer/2',
					},
					{
						name: '村界线',
						layer: 3,
						id: 'cjx',
						title: 'cjx',
						url: 'http://10.108.3.5/ags_feature_svc/xzqh/FeatureServer/3',
					},
				]
			},
			{
				name: '航空影像',
				layer: 2,
				children: [
					{
						name: '2022年',
						layer: 3,
						id: 'hwyx2022',
						title: 'hwyx2022',
						// url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/air_2022_3857/MapServer',
						type: 'tile',
						url: 'http://10.108.3.5/ags_tile_svc/air_2022/MapServer',
					},
					{
						name: '2021年',
						layer: 3,
						id: 'hwyx2021',
						title: 'hwyx2021',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/air_2021_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2020年',
						layer: 3,
						id: 'hwyx2020',
						title: 'hwyx2020',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/air_2020_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2019年',
						layer: 3,
						id: 'hwyx2019',
						title: 'hwyx2019',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/air_2019_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2018年',
						layer: 3,
						id: 'hwyx2018',
						title: 'hwyx2018',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/air_2018_3857/MapServer',
						type: 'tile'
					},
				]
			},
			{
				name: '卫星影像',
				layer: 2,
				children: [
					{
						name: '2023年第一季度',
						layer: 3,
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2023q1_3857/MapServer',
						type: 'tile',
						id: '2023-one',
						title: '2023-one'
					},
					{
						name: '2023年第二季度',
						layer: 3,
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2023q2_3857/MapServer',
						type: 'tile',
						id: '2023-two',
						title: '2023-two'
					},
					{
						name: '2022年第一季度',
						id: '2022-one',
						title: '2022-one',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2022q1_3857/MapServer',
						layer: 3,
						type: 'tile'
					},
					{
						name: '2022年第二季度',
						id: '2022-two',
						title: '2022-two',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2022q2_3857/MapServer',
						layer: 3,
						type: 'tile'
					},
					{
						name: '2022年第三季度',
						id: '2022-three',
						title: '2022-three',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2022q3_3857/MapServer',
						layer: 3,
						type: 'tile'
					},
					{
						name: '2022年第四季度',
						layer: 3,
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/Sat_gj1_2022q4_3857/MapServer',
						type: 'tile',
						id: '2022-four',
						title: '2022-four'
					},
					{
						name: '2021年第一季度',
						layer: 3,
						id: '2021-one',
						title: '2021-one',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/sat_gj1_2021q1_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2021年第二季度',
						layer: 3,
						id: '2021-two',
						title: '2021-two',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/sat_gj1_2021q2_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2021年第三季度',
						layer: 3,
						id: '2021-three',
						title: '2021-three',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/sat_gj1_2021q3_3857/MapServer',
						type: 'tile'
					},
					{
						name: '2021年第四季度',
						layer: 3,
						id: '2021-four',
						title: '2021-four',
						url: 'http://smiserver.gtj.sh.cegn.cn/OneMapServer/rest/services/sat_gj1_2021q4_3857/MapServer',
						type: 'tile'
					},
				]
			},
		]
	},
]

export function formatLayers(layers, preIndex) {
	layers.forEach((i, index) => {
		let fullIndex = (preIndex ? preIndex + '-' + index : index).toString()
		i.treeId = fullIndex
		if (i.children) {
			formatLayers(i.children, fullIndex)
		}
	})
	return layers
}
