Ver a proveniência

乳山信息港

RongCheng
庞东旭 há 1 ano
ascendente
cometimento
8864d7bacd
4 ficheiros alterados com 604 adições e 1 eliminações
  1. +1
    -1
      infoport/index.html
  2. +224
    -0
      infoport/resourceNew.html
  3. +5
    -0
      infoport/static/js/api/index.js
  4. +374
    -0
      infoport/static/js/project/resourceNew.js

+ 1
- 1
infoport/index.html Ver ficheiro

@@ -41,7 +41,7 @@
</a>
</div>
<div class="header_nav">
<a href="resource.html">
<a href="resourceNew.html">
<div>
<i class="i3"></i>
</div>


+ 224
- 0
infoport/resourceNew.html Ver ficheiro

@@ -0,0 +1,224 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN" xml:lang="zh-CN">

<head>
<meta charset="utf-8">
<title>农村资源信息港</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" cxontent="" />
<link href="static/css/main.css" rel="stylesheet" type="text/css" />
<link href="static/css/index.css" rel="stylesheet" type="text/css" />
<link href="static/css/property.css" rel="stylesheet" type="text/css" />
<link href="static/css/page_common.css" rel="stylesheet" type="text/css" />
<link href="../static/css/ol/ol.css" rel="stylesheet" type="text/css" />
<script src="../static/js/common/ol.js"></script>
</head>

<body>
<div class="main" id="page">

<div class="header flex_dom flex_item_between flex_item_mid">
<p id="titContent">
<script id="titData" type="text/html">
{{webList.top.contentValue}}
</script>
</p>
<div class="select">
<select id="treeselectContent" onchange="selectChange()">
<script id="treeselectData" type="text/html">
{{each treeselect as value i}}
<option value="{{value.value}}">{{value.label}}</option>
{{/each}}
</script>
</select>
<select id="treeselectSecondContent" onchange="selectSecondChange()">
<script id="treeselectSecondData" type="text/html">
{{each treeselectSecond as value i}}
<option value="{{value.value}}">{{value.label}}</option>
{{/each}}
</script>
</select>
<select id="useTypeContent" onchange="useTypeChange()">
<option value="">全部</option>
<option value="1">未流转</option>
<option value="2">部分流转</option>
<option value="3">已流转</option>
<!-- <script id="useTypeData" type="text/html">-->
<!-- {{each useType as value i}}-->
<!-- {{/each}}-->
<!-- </script>-->
</select>
</div>

<div class="wid25 flex_dom flex_item_between flex_item_mid">
<div class="header_nav">
<a href="index.html">
<div>
<i class="i1"></i>
</div>
<p>新闻资讯</p>
</a>
</div>
<div class="header_nav">
<a href="property.html">
<div>
<i class="i2"></i>
</div>
<p>资产信息</p>
</a>
</div>
<div class="header_nav active">
<a href="resource.html">
<div>
<i class="i3"></i>
<img src="static/images/nav_bg.png" class="i_bg xuanzhuan" alt="">
</div>
<p>资源信息</p>
</a>
</div>
<div class="header_nav">
<a href="homestead.html">
<div>
<i class="i4"></i>
</div>
<p>宅基地信息</p>
</a>
</div>
</div>
</div>

<div class="new">

<div class="table_main">
<table align="center" cellspacing="0" cellpadding="0" border="0" width="100%" id="propertyContent">
<script id="propertyData" type="text/html">
<tr>
<td>镇</td>
<td>村</td>
<td>资源编码</td>
<td>资源名称</td>
<td>资源分类</td>
<td>资源类型</td>
<td>面积/亩</td>
<td>使用情况</td>
</tr>
{{each propertyList as value i}}
<tr onclick="openDialog({{value.id}})">
<td>{{value.townName}}</td>
<td>{{value.deptName}}</td>
<td>{{value.code}}</td>
<td>{{value.name}}</td>
<td>{{value.useType}}</td>
<td>{{value.useType}}</td>
<td>{{value.totalArea}}</td>
<td>{{value.status}}</td>
</tr>
{{/each}}
</script>
</table>
</div>
<div class="pageNum">
<div style="display: inline-block;margin: 0 auto;" class="page_s1"></div>
<p style="display: inline-block;margin: 0 auto;" id="page_s1"></p>
</div>
<div id="map_main" style="box-shadow: 0px 5px 20px #999 inset;width: 100%;height: 16vh;position:relative;">
<div id="container"></div>
<img src="static/images/openBig.png" id="open" onclick="openBig()" style="position:absolute;right: 10px;top: 10px;" alt="">
<img src="static/images/closeBig.png" id="close" onclick="closeBig()" style="display:none;position:absolute;right: 10px;top: 10px;" alt="">
</div>
</div>

<div class="dialog" id="dialog" style="display: none;">
<div class="bg-mengban"></div>
<div class="dialog_table" id="propertyDetailContent">
<script id="propertyDetailData" type="text/html">
<div class="dialog_header">
<p><img src="static/images/dialog_icon_1.png" alt=""></p>
<p class="name">基本信息</p>
<p class="bigWin" onclick="window.location='resourceDetail.html?id='+{{propertyDetail.id}}"><img src="static/images/dialog_icon_2.png" alt=""></p>
<p class="phoneIcon"><img src="static/images/dialog_icon_3.png" alt=""></p>
<i class="sanjiao-left"></i>
<p class="phone">{{phone}} {{leader}}</p>
<img src="static/images/dialog_icon_close.png" onclick="closeDialog()" style="margin-left: auto;" alt="">
</div>

<div class="dialog_main">
<table cellpadding="0" cellspacing="0" width="100%">

<tr>
<td>镇</td>
<td>{{propertyDetail.townName}}</td>
<td>村</td>
<td>{{propertyDetail.deptName}}</td>
<td>地块代码</td>
<td>{{propertyDetail.dkbm}}</td>
</tr>

<tr>
<td>地块类别</td>
<td>{{propertyDetail.dklb}}</td>
<td>土地利用类型</td>
<td>{{propertyDetail.tdlylx}}</td>
<td>地力等级</td>
<td>{{propertyDetail.dldj}}</td>
</tr>

<tr>
<td>土地用途</td>
<td>{{propertyDetail.tdyt}}</td>
<td>是否基本农田</td>
<td>{{propertyDetail.sfjbnt}}</td>
<td>实测面积</td>
<td>{{propertyDetail.scmjm}}(亩)</td>
</tr>

<tr>
<td>流转状态</td>
<td>{{propertyDetail.dkzt}}</td>
</tr>

</table>
</div>
</script>
</div>
</div>

<div class="footer" id="webContent">

<script id="webData" type="text/html">
<div class="footer_link">
<p class="footer_link_tit">友情链接</p>
{{each webList.botoom1 as value i}}
<a class="hotFile" target="_blank" href="{{value.contentUrl}}">{{value.contentValue}}</a>
{{/each}}
</div>

<div class="footer_link_filings">
{{each webList.botoom2 as value i}}
<div class="footer_link_filings_left">
<p style="background-image: url('static/images/{{value.contentIcon}}')">{{value.contentTitle}}</p>
<a href="#">{{value.contentValue}}</a>
</div>
{{/each}}
</div>

<div class="footer_link_company">
{{each webList.botoom3 as value i}}
<div>
<p>{{value.contentTitle}}</p>
<a target="{{value.contentUrl ? '_blank' : '_self' }}" href="{{value.contentUrl ? value.contentUrl : 'javascript:void(0)' }}">{{value.contentValue}}</a>
</div>
{{/each}}
</div>
</script>

</div>


</div>
</body>
<script src="./static/js/common/require.js" data-main="./static/js/common/main.js?t=101" id="require-page" target-module="./static/js/project/resourceNew.js" defer type="text/javascript"></script>
</html>

+ 5
- 0
infoport/static/js/api/index.js Ver ficheiro

@@ -64,6 +64,11 @@ var treeselectSecond = '/open/dept/get/' //查询部门下拉树结构
*/
var resourceList = '/open/resource/list' //查询资源列表

/*
@purl /open/assetresource/list
*/
var assetresourceList = '/open/assetresource/list' //查询资源列表

/*
@purl /open/resource/list
*/


+ 374
- 0
infoport/static/js/project/resourceNew.js Ver ficheiro

@@ -0,0 +1,374 @@
/**
* Created by Administrator on 2021/4/5.
*/
define(['jquery', "template", "Tools", "paging", 'dateTime', 'swiper'], function ($, template, Tools) {
//数据存储
var module = {
data: {
propertyList:'',
treeselect:[{
value:100,
label:'全部'
}],
treeselectSecond:[{
value:100,
label:'全部'
}],
useType:[{
dictValue:'',
dictLabel:'全部'
}],
propertyDetail:{},
map: '', // 地图图层
resourceLayer: '', // 资源图层
},
};
var tools = new Tools();

module.init = function (page) {
tools.doGet(treeselect, {}, module.treeselect , true);
tools.doGet(webList, {}, module.webList , true);
// tools.doGet(webDeptType+'use_code', {}, module.webDeptType , true);

};

module.useContent = function (data) {
if (data.code == 200) {
module.data.treeselectA = data.data;
module.data.phone = data.data.phone;
module.data.leader = data.data.leader;
var propertyDetailData = template('propertyDetailData', module.data);
$("#propertyDetailContent").html(propertyDetailData);
module.data.map.getView().setCenter(ol.proj.fromLonLat([data.data.lng, data.data.lat]));
module.data.map.getView().setZoom(13);
}
}

module.webDeptType = function (data) {
if (data.code == 200) {
var content = data.data;
content.map(res=>{
module.data.useType.push(res)
})
// module.data.useType = content;
var useTypeData = template('useTypeData', module.data);
$("#useTypeContent").html(useTypeData);
}
}

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.assetList = function (data) {
if (data.code == 200) {
var content = data.rows;
if (module.data.propertyList == '') {
var page_s1 = createPage('.page_s1');
//设置分页
setPage(page_s1, {
pageTotal: data.total, // 数据总条数
pageSize: 10, // 每页显示条数
pageCurrent: 1, // 当前页
maxBtnNum: 5, // 最多按钮个数 (最少5个)
})
}
module.data.propertyList = content;
// 添加资源图层
addResourceLayer(content);
// $('#page_s1').html('共' + 10 + '页')
var propertyData = template('propertyData', module.data);
$("#propertyContent").html(propertyData);
}
}

// 添加资源图层
addResourceLayer = function (content) {
if (module.data.resourceLayer) {
module.data.map.removeLayer(module.data.resourceLayer);
module.data.resourceLayer = '';
}
let features = [];
content.forEach(item => {
if (item.theGeomJson != null && item.theGeomJson !== '') {
const iconFeature = new ol.Feature({
geometry: new ol.geom.MultiPolygon(JSON.parse(item.theGeomJson).coordinates),
// name: item.centerName,
// centerDeptId: item.deptId,
level: 'resource',
id: item.id
});
features.push(iconFeature);
}
});
const vectorSource = new ol.source.Vector({
features: features,
});
module.data.resourceLayer = new ol.layer.Vector({
source: vectorSource,
name: 'resourceLayer',
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.getLayers().insertAt(3, module.data.resourceLayer);
}

openDialog = function(id){
tools.doGet(resourceGet+id, {translate_dict: 1}, module.assetDetail , true);
}

closeDialog = function(id){
$('#dialog').css('display','none');
}

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);
// 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');
}
}

module.treeselect = function(data){
if (data.code == 200) {
var content = data.data[0].children;
content.map(res=>{
module.data.treeselect.push(res)
})
// module.data.treeselect = content[0].children;
// module.data.treeselectA = data.data[0];
var treeselectData = template('treeselectData', module.data);
$("#treeselectContent").html(treeselectData);
var treeselectSecondData = template('treeselectSecondData', module.data);
$("#treeselectSecondContent").html(treeselectSecondData);
initMap(data.data[0]);
//资产列表
tools.doGet(assetresourceList, {
deptId: 100,
// translate_dict: 1,
pageNum: 1,
pageSize: 10,
useType:''
}, module.assetList , true);
tools.doGet(treeselectSecond+'100', {}, module.useContent, true);
}
}

initMap = function (dept) {
let mapCenterLocation;
if (dept.lng && dept.lat) {
mapCenterLocation = [dept.lng, dept.lat];
} else {
mapCenterLocation = [116.391461, 39.902359];
}

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(mapCenterLocation), // 地图中心坐标
zoom: 13,
minZoom: 1, //地图缩小限制
maxZoom: 18, //地图放大限制
// extent: [13481224.75161,5667110.83528,13811063.06278,5880284.11416]
}),
/*interactions: ol.interaction.defaults({
doubleClickZoom: false, // 双击放大地图
// mouseWheelZoom: false, // 鼠标滚轮放大地图
// shiftDragZoom: false, // shift + 鼠标左键拖拽 放大地图
})*/
});
// 地图点击事件
module.data.map.on("click", (evt) => {
let feature = module.data.map.forEachFeatureAtPixel(
evt.pixel,
(feature) => feature
);
if (feature) {
if (feature.get('level') === 'resource') {
openDialog(feature.get('id'));
}
}
});
// 鼠标指针移动到指定的feature上,改变鼠标指针的样式为 pointer(小手)
module.data.map.on('pointermove', (evt) => {
if (evt.dragging) {
return ;
}
const pixel = module.data.map.getEventPixel(evt.originalEvent);
// const hit = module.data.map.hasFeatureAtPixel(pixel);
// let features = module.data.map.getFeaturesAtPixel(pixel);
const hit = module.data.map.forEachFeatureAtPixel(pixel, function (feature) {
if (feature && feature.get('level') === 'resource') {
return true;
}
});
module.data.map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});
}

selectChange = function(){
// tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.selectSecondChange , true);
if ($('#treeselectContent').val() == 100){
module.data.treeselectSecond = [{
value:100,
label:'全部'
}]
tools.doGet(treeselectSecond+'100', {}, module.useContent , true);
}else{
module.data.treeselectSecond = module.data.treeselect.filter(function (e) { return e.value == $('#treeselectContent').val(); })[0].children;
tools.doGet(treeselectSecond+$('#treeselectContent').val(), {}, module.useContent , true);
}
var treeselectSecondData = template('treeselectSecondData', module.data);
$("#treeselectSecondContent").html(treeselectSecondData);

selectSecondChange();
}

selectSecondChange = function(){
$('.page_s1').html('');
module.data.propertyList = "";
tools.doGet(resourceList, {
deptId: $('#treeselectSecondContent').val(),
translate_dict: 1,
pageNum: 1,
pageSize: 10,
}, module.assetList , true);
tools.doGet(treeselectSecond+$('#treeselectSecondContent').val(), {}, module.useContent , true);

//资产列表
// tools.doGet(assetList, {
// deptId: $('#treeselectSecondContent').val(),
// useType: $('#useTypeContent').val() == null ? 1 : $('#useTypeContent').val(),
// operationType: 1,
// translate_dict: 1,
// pageNum: 1,
// pageSize: 10,
// orderByColumn: 'code',
// isAsc: 'asc',
// }, module.assetList , true);
}

useTypeChange = function () {
$('.page_s1').html('');
module.data.propertyList = "";
tools.doGet(resourceList, {
deptId: $('#treeselectSecondContent').val() == null ? 100 : $('#treeselectSecondContent').val(),
dkzt:$('#useTypeContent').val(),
translate_dict: 1,
pageNum: 1,
pageSize: 10,
}, module.assetList , true);
}

turnThePage = function (pageNum) {
tools.doGet(resourceList, {
deptId: $('#treeselectSecondContent').val() == null ? 100 : $('#treeselectSecondContent').val(),
translate_dict: 1,
pageNum: pageNum,
pageSize: 10,
}, module.assetList , true);
}

openBig = function () {
$("#open").css('display','none');
$(".table_main").css('display','none');
$(".pageNum").css('display','none');
$("#close").css('display','block');
$("#map_main").css({
'height': '59vh',
'position': 'absolute',
'top': '1vh',
'width': 'calc(100% - 2vh)',

})
$("#container").css('height','59vh')
initMap(module.data.treeselectA);
// 添加资源图层
addResourceLayer(module.data.propertyList);
}

closeBig = function () {
$("#open").css('display','block');
$(".table_main").css('display','block');
$(".pageNum").css('display','block');
$("#close").css('display','none');
$("#map_main").css({
'height': '16vh',
'position': 'relative',
'width': '100%',
'top': '0vh',
})
$("#container").css('height','16vh')
initMap(module.data.treeselectA);
// 添加资源图层
addResourceLayer(module.data.propertyList);
}

return module;
});

Carregando…
Cancelar
Guardar