btxtgxq-system-city/src/main/resources/static/route/reportcase/show.html
wans 01ca20b474 修改所有片长为网格长 所有N员为专管员
修改地图首页点击网格查看详情数据为空的问题
2021-07-05 12:54:56 +08:00

305 lines
15 KiB
HTML
Executable File

<!doctype html>
<html lang="en">
<head>
<base href="/servicecity/">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.input-border-skin{
border: 1px solid #e6e6e6;
}
.photo-show{border: 1px solid #e6e6e6;}
.photo-show .photo-show-wrap{margin-right:10px;}
.photo-show .photo-show-wrap .photo-wrap{display:inline-block;background-color:white;padding:5px;margin-bottom:5px;position:relative;}
.photo-show .photo-show-wrap .photo-wrap img{height:100px;}
.photo-show .photo-show-wrap .photo-wrap a{position:absolute;top:0px;right:0px;border-color:#CCC;background-color: #ff3939;
height: 20px;
width: 20px;
text-align: center;
line-height: 20px;
border-radius: 5px;
color: #fff;}
.audio-a{position: absolute;top: 40px;right: 0px;border-color: #CCC;background-color: #ff3939;height: 20px;width: 20px;text-align: center;line-height: 20px;border-radius: 5px;color: #fff;}
</style>
</head>
<body>
<div class="layui-anim layui-anim-fadein" style="padding: 5px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-row">
<div class="layui-col-md6 layui-col-sm6">
<div class="layui-form-item">
<label class="layui-form-label">地区名称</label>
<div class="layui-input-block">
<input type="text" id="areaName" name="areaName" autocomplete="off" style="cursor:pointer;"
class="layui-input" value="" placeholder="请选择地区" readonly="readonly">
</div>
</div>
</div>
<div class="layui-col-md6 layui-col-sm6">
<div class="layui-form-item">
<label class="layui-form-label">社区名称</label>
<div class="layui-input-block">
<input type="text" id="communityName" name="communityName" autocomplete="off" style="cursor: pointer"
class="layui-input" value="" placeholder="请选择社区" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md4 layui-col-sm4">
<div class="layui-form-item">
<label class="layui-form-label">案件类型</label>
<div class="layui-input-block">
<input type="text" id="caseTypeName" name="caseTypeName" autocomplete="off" style="cursor: pointer"
class="layui-input" value="" placeholder="请选择案件类型" readonly="readonly" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-sm4">
<div class="layui-form-item">
<label class="layui-form-label">来源</label>
<div class="layui-input-block">
<select id="caseSource" name="caseSource" disabled>
<option value="">选择来源</option>
<option value="1">群众举报</option>
<option value="2">巡检采集</option>
<option value="3">专管员上报</option>
</select>
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-sm4">
<div class="layui-form-item">
<label class="layui-form-label">自行处理</label>
<div class="layui-input-block input-border-skin">
<input type="radio" name="isSelf" value="0" title="否" disabled>
<input type="radio" name="isSelf" value="1" title="是" disabled>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">内容</label>
<div class="layui-input-block">
<input id="caseContent" name="caseContent" autocomplete="off" placeholder="请输入内容" class="layui-input" readonly="readonly">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">案件图片</label>
<div class="photo-show" id="casePhotosSelectTemplateBox"></div>
<script id="casePhotosSelectTemplate" type="text/html">
{{# for(var i = 0, item; item = d[i++];) { }}
<span class="photo-show-wrap">
<span class="photo-wrap">
<img src="route/file/downloadfile/true/{{item}}"/>
</span>
</span>
{{# } }}
</script>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">案件音频</label>
<div class="photo-show" id="caseAudioSelectTemplateBox"></div>
<script id="caseAudioSelectTemplate" type="text/html">
<span class="photo-wrap">
{{# if(d != null && d.length != '' && d.length > 0 ) { }}
<span class="photo-show-wrap">
<audio id="caseAudio" controls="true" style="width: 98%">
<source src="assets/images/test.mp3" type="audio/mpeg">
<source src="assets/images/test.mp3" type="audio/wav">
<source src="assets/images/test.mp3" type="audio/ogg">
您的浏览器不支持 audio 标签
</audio>
</span>
{{# } }}
</span>
</script>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md6 layui-col-sm6">
<div class="layui-form-item">
<label class="layui-form-label">经度</label>
<div class="layui-input-block">
<input type="text" id="caseLongitude" name="caseLongitude" placeholder="点击地图选择" autocomplete="off" style="cursor:pointer;"
class="layui-input" value="" readonly="readonly" lay-verify="required">
</div>
</div>
</div>
<div class="layui-col-md6 layui-col-sm6">
<div class="layui-form-item">
<label class="layui-form-label">纬度</label>
<div class="layui-input-block">
<input type="text" id="caseLatitude" name="caseLatitude" placeholder="点击地图选择" autocomplete="off" style="cursor: pointer"
class="layui-input" value="" readonly="readonly" lay-verify="required">
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12">
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">位置</label>
<div class="layui-input-block">
<input id="casePosition" name="casePosition" autocomplete="off" placeholder="请输入内容" class="layui-input" lay-verify="required">
</div>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12 layui-col-sm12" style="padding: 0 15px;">
<div id="mapContainer" style="width: 100%;height: 350px;"></div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=oWU9RD4ihDHAafexgI6XOrTK8lDatRju"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'form','laydate', 'laytpl'], function() {
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var reportCaseId = top.restAjax.params(window.location.href).reportCaseId;
var areaId = '';
var areaName = '';
var communityId = '';
var communityName = '';
var caseTypeId = '';
var caseTypeName = '';
var caseSource = '';
var isSelf = '1';
var casePhotos = [];
var caseAudio = [];
var caseLongitude = '';
var caseLatitude = '';
function initData(){
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/reportcase/getreportcase/{reportCaseId}', [reportCaseId]), {}, null, function(code, data) {
var dataFormData = {};
for(var i in data) {
dataFormData[i] = data[i];
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
areaId = data.areaId;
areaName = data.areaName;
casePhotos = data.casePhotos.split(',');
caseAudio = data.caseAudio.split(',');
communityId = data.communityId;
communityName = data.communityName;
caseSource = data.caseSource;
caseTypeId = data.caseTypeId;
caseTypeName = data.caseTypeName;
caseLongitude = data.caseLongitude;
caseLatitude = data.caseLatitude;
isSelf = data.isSelf;
$('[name="isSelf"]').each(function () {
if ($(this).val() == isSelf) {
$(this).attr("checked", "checked");
return false;
}
})
form.render('radio');
initCasePhotos();
initCaseAudio();
initMap();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
// 初始化案件图片
function initCasePhotos(){
if(casePhotos == null ||casePhotos.length == 0 || casePhotos[0] == '' ){
casePhotos = [];
}
laytpl(document.getElementById('casePhotosSelectTemplate').innerHTML).render(casePhotos, function(html) {
document.getElementById('casePhotosSelectTemplateBox').innerHTML = html;
});
}
// 初始化案件音频
function initCaseAudio(){
if(caseAudio == null || caseAudio.length == 0 || caseAudio[0] == '' ){
caseAudio = [];
}
laytpl(document.getElementById('caseAudioSelectTemplate').innerHTML).render(caseAudio, function(html) {
document.getElementById('caseAudioSelectTemplateBox').innerHTML = html;
});
}
//初始化地图
function initMap() {
var map = new BMap.Map('mapContainer', {enableMapClick: false});
var point = new BMap.Point(caseLongitude, caseLatitude);
mapMarkPoint(map, point);
map.centerAndZoom(point, 12);
map.addControl(new BMap.NavigationControl());
map.addControl(new BMap.ScaleControl());
map.addControl(new BMap.OverviewMapControl());
map.addControl(new BMap.MapTypeControl());
// 点击获取地址
//var geocoder= new BMap.Geocoder();
/*map.addEventListener("click", function(e) {
map.clearOverlays();
caseLongitude = e.point.lng;
caseLatitude = e.point.lat;
$('#caseLongitude').val(e.point.lng);
$('#caseLatitude').val(e.point.lat);
point = new BMap.Point(caseLongitude, caseLatitude);
mapMarkPoint(map, point);
geocoder.getLocation(e.point, function(rs) {
$('#casePosition').val(rs.address);
});
});*/
}
function mapMarkPoint(map, point) {
var marker = new BMap.Marker(point);
map.addOverlay(marker);
}
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
$('.close').on('click', function() {
closeBox();
});
});
</script>
</body>
</html>