diff --git a/infoport/resourceNew.html b/infoport/resourceNew.html index ffc9ce3..f88db76 100644 --- a/infoport/resourceNew.html +++ b/infoport/resourceNew.html @@ -137,7 +137,7 @@

基本信息

-

+

{{phone}} {{leader}}

@@ -152,31 +152,26 @@ {{propertyDetail.townName}} 村 {{propertyDetail.deptName}} - 地块代码 - {{propertyDetail.dkbm}} - - - - 地块类别 - {{propertyDetail.dklb}} - 土地利用类型 - {{propertyDetail.tdlylx}} - 地力等级 - {{propertyDetail.dldj}} + 资源编码 + {{propertyDetail.code}} - 土地用途 - {{propertyDetail.tdyt}} - 是否基本农田 - {{propertyDetail.sfjbnt}} - 实测面积 - {{propertyDetail.scmjm}}(亩) + 资源名称 + {{propertyDetail.name}} + 资源分类 + {{propertyDetail.resourceType}} + 资源类型 + {{propertyDetail.resourceSort}} - 流转状态 - {{propertyDetail.dkzt}} + 面积/亩 + {{propertyDetail.totalArea}} + 使用情况 + {{propertyDetail.status}} + + diff --git a/infoport/resourceNewDetail.html b/infoport/resourceNewDetail.html new file mode 100644 index 0000000..c8b5315 --- /dev/null +++ b/infoport/resourceNewDetail.html @@ -0,0 +1,163 @@ + + + + + + 农村资源信息港 + + + + + + + + + + + + +
+ + + +
+ +
+ + + + +
+ + + diff --git a/infoport/static/js/api/index.js b/infoport/static/js/api/index.js index e64ed67..5d8aa4a 100644 --- a/infoport/static/js/api/index.js +++ b/infoport/static/js/api/index.js @@ -74,6 +74,11 @@ var assetresourceList = '/open/assetresource/list' //查询资源列表 */ var resourceGet = '/open/resource/get/' //查询资源详情 +/* +@purl /open/resource/list +*/ +var assetresourceGet = '/open/assetresource/get/' //查询资源详情 + /* @purl /open/house/zjdzdxx/list */ diff --git a/infoport/static/js/project/resourceNew.js b/infoport/static/js/project/resourceNew.js index adcb79a..35bbbb4 100644 --- a/infoport/static/js/project/resourceNew.js +++ b/infoport/static/js/project/resourceNew.js @@ -130,7 +130,7 @@ define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function } openDialog = function(id){ - tools.doGet(resourceGet+id, {translate_dict: 1}, module.assetDetail , true); + tools.doGet(assetresourceGet+id, {translate_dict: 1}, module.assetDetail , true); } closeDialog = function(id){ diff --git a/infoport/static/js/project/resourceNewDetail.js b/infoport/static/js/project/resourceNewDetail.js new file mode 100644 index 0000000..c175e1d --- /dev/null +++ b/infoport/static/js/project/resourceNewDetail.js @@ -0,0 +1,155 @@ +/** + * Created by Administrator on 2021/4/5. + */ +define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function ($, template, Tools) { + //数据存储 + var module = { + data: { + propertyList:'', + map: '', // 地图图层 + }, + }; + var tools = new Tools(); + + module.init = function (page) { + tools.doGet(assetresourceGet+getQueryVariable('id'), {translate_dict: 1}, module.assetDetail , true); + tools.doGet(webList, {}, module.webList , true); + // var map = new BMapGL.Map('container'); // 创建Map实例 + // map.centerAndZoom(new BMapGL.Point(116.320938,39.950026), 18); // 初始化地图,设置中心点坐标和地图级别 + // map.enableScrollWheelZoom(false); // 开启鼠标滚轮缩放 + }; + + module.useContent = function (data) { + if (data.code == 200) { + module.data.phone = data.data.phone; + module.data.leader = data.data.leader; + var propertyDetailData = template('propertyDetailData', module.data); + $("#propertyDetailContent").html(propertyDetailData); + setTimeout(() => { + initMap(data.data); + }, 500); + } + } + + initMap = function (dept) { + document.getElementById("container").innerHTML = ""; + // 定义地图投影 + let projection = new ol.proj.Projection({ + code: "EPSG:3857", + units: "degrees", + }); + // 定义地图图层 + let aerial = new ol.layer.Tile({ + source: new ol.source.XYZ({ + url: "http://t{0-7}.tianditu.com/img_w/wmts?" + + "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" + + "&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=cc4aba6e967096098249efa069733067", + }), + isGroup: true, + name: "卫星影像图", + }); + let yingxzi = new ol.layer.Tile({ + source: new ol.source.XYZ({ + url: "http://t{0-7}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=cc4aba6e967096098249efa069733067", + }), + isGroup: true, + name: "天地图文字标注--卫星影像图", + }); + //加载地图 + module.data.map = new ol.Map({ + controls: ol.control.defaults({attribution: false, zoom: false, rotate: false}).extend([]), + layers: [aerial, yingxzi], + projection: projection, + target: "container", + view: new ol.View({ + center: ol.proj.fromLonLat([dept.lng, dept.lat]), // 地图中心坐标 + zoom: 16, + minZoom: 1, //地图缩小限制 + maxZoom: 18, //地图放大限制 + }), + /*interactions: ol.interaction.defaults({ + doubleClickZoom: false, // 双击放大地图 + // mouseWheelZoom: false, // 鼠标滚轮放大地图 + // shiftDragZoom: false, // shift + 鼠标左键拖拽 放大地图 + })*/ + }); + + if (module.data.propertyDetail && module.data.propertyDetail.theGeomJson) { + const resourceDetail = new ol.layer.Vector({ + source: new ol.source.Vector({ + features: new ol.format.GeoJSON().readFeatures(module.data.propertyDetail.theGeomJson), + }), + name: 'resourceDetail', + style: new ol.style.Style({ + fill: new ol.style.Fill({ + //矢量图层填充颜色,以及透明度 + color: "rgba(255, 255, 0, 0.3)", + }), + stroke: new ol.style.Stroke({ + //边界样式 + color: "#ffff00", + width: 2, + }), + }) + }); + module.data.map.addLayer(resourceDetail); + module.data.map.getView().setCenter(ol.extent.getCenter(resourceDetail.getSource().getExtent())); + } + } + + module.webList = function (data) { + if (data.code == 200) { + var content = data.data; + module.data.webList = content; + var webData = template('webData', module.data); + $("#webContent").html(webData); + var titData = template('titData', module.data); + $("#titContent").html(titData); + } + } + + module.assetDetail = function(data){ + if (data.code == 200) { + var content = data.data; + module.data.propertyDetail = content; + tools.doGet(attachmentList, { + tableId:content.id, + tableName: 't_asset_resource', + bizPath: 'asset' + }, module.attachmentDetail , true); + tools.doGet(treeselectSecond+content.deptId, {}, module.useContent , true); + // var propertyDetailData = template('propertyDetailData', module.data); + // $("#propertyDetailContent").html(propertyDetailData); + // $('#dialog').css('display','block'); + } + } + + module.attachmentDetail = function(data){ + if (data.code == 200) { + var content = data.rows; + var attachmentList = []; + content.map(res=>{ + if (res.fileName.indexOf('png')>-1||res.fileName.indexOf('jpg')>-1){ + attachmentList.push(res); + } + }) + module.data.attachment = attachmentList; + var propertyDetailData = template('propertyDetailData', module.data); + $("#propertyDetailContent").html(propertyDetailData); + $('#dialog').css('display','block'); + } + } + + //获取地址栏参数 + function getQueryVariable(variable){ + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i=0;i