g214/base/templates/base/drilling_details.html

228 lines
6.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends 'base/base.html' %}
{% load static %}
{% block breadcrumb %}
<li>
<a href="{% url 'land_details' %}?id={{ drilling.section.land.id }}&&type={{ type }}">{{ drilling.section.land.name }}</a>
</li>
<li>
<a href="{% url 'section_details' %}?id={{ drilling.section.id}}&&type={{ type }}">{{ drilling.section.name }}</a>
</li>
<li class="active">{{ drilling }}</li>
{% endblock %}
{% block table %}
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#x" role="tab" data-toggle="tab">{{ drilling.name }}的详情</a></li>
<li role="presentation"><a href="#z" role="tab" data-toggle="tab">探头</a></li>
<li role="presentation"><a href="#y" role="tab" data-toggle="tab">钻孔岩心</a></li>
<li role="presentation"><a href="#s" role="tab" data-toggle="tab">土工试验报告</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="x">
<table class="table table-bordered" style="text-align: center; margin-top:15px">
<tr>
<td class="col-md-2">编号:</td>
<td>{{ drilling.code }}</td>
</tr>
<tr>
<td>名称;</td>
<td>{{ drilling.name }}</td>
</tr>
<tr>
<td>类型:</td>
<td>
{% if drilling.type == 1 %}
竖向测温孔
{% elif drilling.type == 2 %}
天然孔
{% elif drilling.type == 3 %}
横孔
{% endif %}
</td>
</tr>
<tr>
<td>深度:</td>
<td>
{% if drilling.depth %}
{{ drilling.depth }}
{% endif %}
</td>
</tr>
<tr>
<td>所属断面:</td>
<td>
{% if drilling.section.name %}
<a target="_blank" href="{% url 'section_details' %}?id={{ drilling.section.id }}&&type={{ type }}">
{{ drilling.section.name }}
</a>
{% endif %}
</td>
</tr>
</table>
</div>
<div role="tabpanel" class="tab-pane fade" id="z">
<table class="table table-bordered" style="margin-top: 15px; text-align: center">
<tr>
<td>名称</td>
<td>编号</td>
<td>深度</td>
</tr>
{% for p in drilling_probe %}
<tr>
<td>
<a href="{% url 'probe_details' %}?id={{ p.id }}&&type={{ type }}"
target="_blank">{{ p.name }}</a>
</td>
<td>
{{ p.code }}
</td>
<td>
{{ p.depth }}
</td>
</tr>
{% empty %}
<a href="#" class="list-group-item">暂无数据</a>
{% endfor %}
</table>
</div>
<div role="tabpanel" class="tab-pane fade" id="y">
<div style="margin-top: 15px">
{% if drilling.file %}
<embed src="{{ drilling.file.url }}" width="100%" height="1000px"/>
{% else %}
<a href="#" class="list-group-item">暂无数据</a>
{% endif %}
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="s">
<table class="table table-bordered" style="margin-top: 15px; text-align: center">
{% if drilling_soiltest %}
<tr>
<td>钻孔编号</td>
<td>取样编号</td>
<td>取样顶深</td>
<td>取样长度</td>
<td>取样类型</td>
<td>含水率(%)</td>
</tr>
{% for s in drilling_soiltest %}
<tr>
<td>
{{ s.drilling_code }}
<td>
{{ s.sample_code }}
</td>
<td>
{{ s.top_depth }}
</td>
<td>
{{ s.sample_length }}
</td>
<td>
{{ s.sample_type }}
</td>
<td>
{{ s.water_content }}
</td>
</tr>
{% endfor %}
{% else %}
<a href="#" class="list-group-item" style="margin-top: 15px">暂无数据</a>
{% endif %}
</table>
</div>
</div>
{% endblock %}
{% block add_css %}
<link rel="StyleSheet" href="{% static "bower_components/datetimepicker-master/build/jquery.datetimepicker.min.css" %}" />
{% endblock %}
{% block add_script %}
<script src="{% static "bower_components/echarts/dist/echarts.min.js" %}"></script>
<script src="{% static "bower_components/datetimepicker-master/build/jquery.datetimepicker.full.min.js" %}"></script>
<script type="text/javascript">
$(function () {
var myChart = echarts.init(document.getElementById('main'));
var data = [];
$.datetimepicker.setLocale('zh');
$('.timepicker').datetimepicker({
language: 'zh',
format: 'Y-m-d H:i'
});
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var tab = $(e.target);
myChart.setOption({
tooltip: {
trigger: 'axis',
formatter: function (params) {
return params[0]['name'] + ':' + params[0]['value'];
},
axisPointer: {
animation: false
}
},
legend: {
data: []
},
xAxis: {
data: []
},
yAxis: {},
dataZoom: [
{ // 这个dataZoom组件默认控制x轴。
type: 'slider', // 这个 dataZoom 组件是 slider 型 dataZoom 组件
start: 0, // 左边在 10% 的位置。
end: 20 // 右边在 60% 的位置。
}
],
series: [{
name: '温度',
type: 'line',
data: []
}]
});
$("#startButton").click(function(){
myChart.showLoading();
startTime = $('#startTime').val();
endTime = $('#endTime').val();
showChart( myChart, startTime, endTime );
});
});
});
function showChart( myChart, starttime, endtime ){
$.getJSON("/base/land/drilling/probedata_json/?drilling_id={{ drilling.id }}&starttime=" + starttime + "&endtime=" + endtime, function (datas) {
l = [];
s = [];
$.each(datas, function(index, value){
l.push(index);
});
$.each(datas, function(index, value){
a = {};
d = [];
t = [];
value.map(function(e){
d.push(e[1]);
t.push(e[0]);
});
a['name'] = index;
a['type'] = 'line';
a['data'] = d;
s.push(a);
});
myChart.hideLoading();
myChart.setOption({
legend: {
data: l,
},
xAxis: {
data: t,
},
series: s,
});
});
};
</script>
{% endblock %}