/**
* 覆写定位方法
* @param {string} tabName 数据表名称
* @param {string} fedId 要素Id
*/
function CallMapLocation(tabName, fedId) {
$('.jt-map-location-panel').css({
position: 'relative',
left: '0px',
});
$('.jt-map-location-panel').show();
const frame = document.getElementById('frameWrapper');
frame.contentWindow.location_tabName_feaId(tabName, fedId);
}
/**
* 查询地块数据
* @param {Object} obj 执行该事件的按钮
* @param {string} tabName 数据表名称
* @param {string} fldName 字段名称
* @param {string} fldValue 字段值
* @param {string} showFldName 展示字段名称
* @param {string} domId 展示查询内容的容器
*/
function queryPolygonFeatures(obj, tabName, fldName, fldValue, showFldName, domId) {
let txt = $(obj).text();
if (txt === '隐藏图斑') {
$(obj).text("图斑");
$(".jt-feature-data-row").remove();
return;
} else {
$(obj).text("隐藏图斑");
}
var iData = {
tabName: tabName,
fldName: fldName,
fldValue: fldValue,
queryType: 'equal',
showFldName: showFldName === undefined ? '' : showFldName,
start: '1',
count: '100',
}
sendAjax({
url: 'appQueryFeatureData',
data: iData,
waitMessage: '查询中...',
success: function(resData) {
var data = resData[0];
if (data.dataCount == 0) {
muiAlert('未查询到任何数据!', '警告');
} else {
showPolygonQueryResult(data, domId);
}
},
error: function(err) {
muiAlertError(err);
}
})
}
/**
* 地块数据展示
* @param {JSON} jsonData 数据集
* @param {string} domId 装载地块数据的容器
*/
function showPolygonQueryResult(jsonData, domId) {
let divRoot = $("#" + domId);
/* 加入数据 */
for (var i in jsonData.dataList) {
var item = jsonData.dataList[i];
var divItem = document.createElement('div');
if (i % 2 == 0) {
divItem.className = 'jt-feature-data-row jt-row-even-number';
} else {
divItem.className = 'jt-feature-data-row jt-row-odd-number';
}
divRoot.append(divItem);
var html = "";
html += "" + item.feaNumber + "";
html += "" + item.feaName + "";
html += "" + item.feaArea + "亩";
html += ""
divItem.innerHTML = html;
}
}