#大屏开发

This commit is contained in:
xieshen 2022-01-06 16:00:49 +08:00
parent 315c3c849f
commit 8f7e89e425
7 changed files with 256 additions and 79 deletions

View File

@ -28,62 +28,14 @@
</select>
</component>
<component name="ChangeListManager">
<list default="true" id="277fc01b-8137-4ff9-9e99-821b4918940b" name="Default Changelist" comment="#图片展示">
<change afterPath="$PROJECT_DIR$/daping/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/admin.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/apps.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/migrations/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/models.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/base.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/bootstrap.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/datepicker.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/index.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/ol.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/style.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/css/zzsc.css" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/line.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/line1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/logo.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/mintitle.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/mintitle_1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_3.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_4.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_5.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_6.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/t_7.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/title.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/images/true.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/all-data-count.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/china.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/dataTool.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/dna-count.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/echarts.common.min.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/echarts.min.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/findings-plan.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/index-data-list.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/index-echarts.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/index.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/index_Instrument_distribution.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/jquery.min.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/ol.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/soil-count.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/task-data.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/templates/daping/base.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/templates/daping/index.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/tests.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/daping/views.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/DesertVegetationCommunitySurvey.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/DesertVegetationCommunitySurvey.iml" afterDir="false" />
<list default="true" id="277fc01b-8137-4ff9-9e99-821b4918940b" name="Default Changelist" comment="#大屏开发">
<change afterPath="$PROJECT_DIR$/daping/static/daping/js/image.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DesertVegetationCommunitySurvey/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/DesertVegetationCommunitySurvey/settings.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/DesertVegetationCommunitySurvey/urls.py" beforeDir="false" afterPath="$PROJECT_DIR$/DesertVegetationCommunitySurvey/urls.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/batch_issue_gis_temperature.py" beforeDir="false" afterPath="$PROJECT_DIR$/batch_issue_gis_temperature.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/urls.py" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/urls.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/views.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/display/urls.py" beforeDir="false" afterPath="$PROJECT_DIR$/display/urls.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/import_area.py" beforeDir="false" afterPath="$PROJECT_DIR$/import_area.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daping/static/daping/js/index-data-list.js" beforeDir="false" afterPath="$PROJECT_DIR$/daping/static/daping/js/index-data-list.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daping/templates/daping/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/daping/templates/daping/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daping/urls.py" beforeDir="false" afterPath="$PROJECT_DIR$/daping/urls.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/daping/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/daping/views.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/fabfile.py" beforeDir="false" afterPath="$PROJECT_DIR$/fabfile.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -594,14 +546,7 @@
<workItem from="1640309163413" duration="5854000" />
<workItem from="1640827634828" duration="17251000" />
<workItem from="1640914128734" duration="14816000" />
<workItem from="1641258174066" duration="14505000" />
</task>
<task id="LOCAL-00079" summary="#功能开发">
<created>1593314276895</created>
<option name="number" value="00079" />
<option name="presentableId" value="LOCAL-00079" />
<option name="project" value="LOCAL" />
<updated>1593314276895</updated>
<workItem from="1641258174066" duration="23712000" />
</task>
<task id="LOCAL-00080" summary="#功能开发">
<created>1593338798066</created>
@ -939,7 +884,14 @@
<option name="project" value="LOCAL" />
<updated>1636604036542</updated>
</task>
<option name="localTasksCounter" value="128" />
<task id="LOCAL-00128" summary="#大屏开发">
<created>1641352626097</created>
<option name="number" value="00128" />
<option name="presentableId" value="LOCAL-00128" />
<option name="project" value="LOCAL" />
<updated>1641352626097</updated>
</task>
<option name="localTasksCounter" value="129" />
<servers />
</component>
<component name="TodoView">
@ -1011,7 +963,8 @@
<MESSAGE value="#四月份大修改" />
<MESSAGE value="#wu月份大修改" />
<MESSAGE value="#图片展示" />
<option name="LAST_COMMIT_MESSAGE" value="#图片展示" />
<MESSAGE value="#大屏开发" />
<option name="LAST_COMMIT_MESSAGE" value="#大屏开发" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/desertvegetationcommunitysurvey$DNA.coverage" NAME="DNA Coverage Results" MODIFIED="1626678320304" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />

View File

@ -0,0 +1,93 @@
$(function () {
console.log(66666666666666666666666666666666666)
$.getJSON('/daping/image/', function (res) {
console.log(res.res)
var str = '';
var Items = res.res;
$.each(Items, function (i, item) {
str = '<div class="wrap"><img src="' + item.image + '" alt="">';
$('.Plantimages .wrap').append(str);
});
});
var wrap = document.querySelector(".wrap");
var next = document.querySelector(".arrow_right");
var prev = document.querySelector(".arrow_left");
next.onclick = function () {
next_pic();
}
prev.onclick = function () {
prev_pic();
}
function next_pic() {
index++;
if (index > 4) {
index = 0;
}
var newLeft;
if (wrap.style.left === "-3600px") {
newLeft = -1200;
} else {
newLeft = parseInt(wrap.style.left) - 600;
}
wrap.style.left = newLeft + "px";
}
function prev_pic() {
index--;
if (index < 0) {
index = 4;
}
var newLeft;
if (wrap.style.left === "0px") {
newLeft = -2400;
} else {
newLeft = parseInt(wrap.style.left) + 600;
}
wrap.style.left = newLeft + "px";
}
var timer = null;
function autoPlay() {
timer = setInterval(function () {
next_pic();
}, 2000);
}
autoPlay();
var Plantimages = document.querySelector(".Plantimages");
Plantimages.onmouseenter = function () {
clearInterval(timer);
}
Plantimages.onmouseleave = function () {
autoPlay();
}
var index = 0;
var dots = document.getElementsByTagName("span");
for (var i = 0, len = dots.length; i < len; i++) {
(function (i) {
dots[i].onclick = function () {
var dis = index - i;
if (index == 4 && parseInt(wrap.style.left) !== -3000) {
dis = dis - 5;
}
//和使用prev和next相同在最开始的照片5和最终的照片1在使用时会出现问题导致符号和位数的出错做相应地处理即可
if (index == 0 && parseInt(wrap.style.left) !== -600) {
dis = 5 + dis;
}
wrap.style.left = (parseInt(wrap.style.left) + dis * 600) + "px";
index = i;
};
})(i);
}
})

View File

@ -12,7 +12,6 @@ $(function () {
var str = '';
var Items = res.res;
$.each(Items, function (i, item) {
console.log(i, item);
str = '<tr style="text-align: center">' +

View File

@ -20,8 +20,7 @@
.tablebox, .tablebox2, .tablebox3 {
height: 280px;
overflow: hidden;
{#position: relative;#}
width: 100%;
{#position: relative;#} width: 100%;
margin: 0 auto;
}
@ -37,7 +36,7 @@
width: 100%;
position: absolute;
top: 0;
left:0;
left: 0;
text-align: center;
}
@ -91,6 +90,113 @@
font-size: 12px;
}
.t_btn button,
.t_a {
display: inline-block;
padding: 10px 5px;
width: 80px;
border-style: solid;
border-width: 0;
cursor: pointer;
font-family: inherit;
font-weight: bold;
line-height: normal;
margin: 0 0 0.5em 0;
position: relative;
text-decoration: none;
text-align: center;
display: inline-block;
font-size: 1em;
background-color: #2C58A6;
border-color: #0263ff;
color: white;
box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.2) inset !important;
margin-right: 0.5em;
border-radius: 4px;
}
.t_height {
line-height: 80px;
position: absolute;
right: 28px;
top: 0;
}
a {
text-decoration: none;
}
.Plantimages {
position: relative;
width: 100%;
height: 280px;
overflow: hidden;
}
.Plantimages .wrap {
position: absolute;
width: 100%;
height: 280px;
z-index: 1;
}
.Plantimages .wrap img {
float: left;
width: 100%;
height: 280px;
}
.Plantimages .buttons {
position: absolute;
right: 5px;
bottom: 40px;
width: 150px;
height: 10px;
z-index: 2;
}
.Plantimages .buttons span {
margin-left: 5px;
display: inline-block;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: green;
text-align: center;
color: white;
cursor: pointer;
}
.Plantimages .buttons span.on {
background-color: red;
}
.Plantimages .arrow {
position: absolute;
top: 35%;
color: green;
padding: 0px 14px;
border-radius: 50%;
font-size: 50px;
z-index: 2;
display: none;
}
.Plantimages .arrow_left {
left: 10px;
}
.Plantimages .arrow_right {
right: 10px;
}
.Plantimages:hover .arrow {
display: block;
}
.Plantimages .arrow:hover {
background-color: rgba(0, 0, 0, 0.2);
}
</style>
{% endblock %}
{% block content %}
@ -103,6 +209,11 @@
中国荒漠植被调查
</div>
</div>
<div class="header_nav fl">
</div>
<div class="header_myself fr t_height">
<a class="t_a" href="http://210.77.68.250:8080/c/#/index2">进入数据库</a>
</div>
</div>
<!--main-->
@ -223,11 +334,20 @@
<i class="r_b_line"></i>
<i class="b_r_line"></i>
</div>
<div class="main_title" style="width: 225px">
<div class="main_title" style="width: 225px;z-index: 10">
<img src="{% static 'daping/images/t_4.png' %}" alt="">
课题组数据量
植物影像
</div>
<div id="chart_3" class="echart t_btn7 Plantimages">
<div class="wrap">
</div>
<div class="buttons">
</div>
<a href="javascript:;" class="arrow arrow_left">&lt;</a>
<a href="javascript:;" class="arrow arrow_right">&gt;</a>
</div>
<div id="chart_3" class="echart t_btn7" style="width:100%;height: 280px;"></div>
</div>
<div class="right_2">
<!--左上边框-->
@ -452,9 +572,10 @@
<script src="{% static 'daping/js/index.js' %}"></script>
<script src="{% static 'daping/js/dataTool.js' %}"></script>
<script src="{% static 'daping/js/findings-plan.js' %}"></script>
<script src="{% static 'daping/js/task-data.js' %}"></script>
{# <script src="{% static 'daping/js/task-data.js' %}"></script>#}
<script src="{% static 'daping/js/dna-count.js' %}"></script>
<script src="{% static 'daping/js/soil-count.js' %}"></script>
<script src="{% static 'daping/js/index-data-list.js' %}"></script>
<script src="{% static 'daping/js/all-data-count.js' %}"></script>
<script src="{% static 'daping/js/image.js' %}"></script>
{% endblock %}

View File

@ -14,4 +14,5 @@ urlpatterns = [
path('herbals/list/', views.herbal_list),
path('soils/list/', views.soil_list),
path('all/data/count/', views.all_data_count),
path('image/', views.image),
]

View File

@ -5,7 +5,7 @@ from django.shortcuts import render
# Create your views here.
from dashboard.models import Findings, Task, Sampletrees, Samplebush, Sampleherbal, Simplesoil, Weather, Landuse, \
Dronephotos, Scenephoto, Barcodes, Special
Dronephotos, Scenephoto, Barcodes, Special, Sampleherbalphotos, Sampleherbalplantimages
def index(request):
@ -260,7 +260,6 @@ def trees_list(request):
o['enforcement'] = t.enforcement
o['findingscode'] = t.findings.findingscode
res.append(o)
print(res)
return HttpResponse(json.dumps({
'status': 0,
'res': res
@ -280,7 +279,6 @@ def bush_list(request):
res.append(o)
print(res)
return HttpResponse(json.dumps({
'status': 0,
'res': res
@ -298,7 +296,6 @@ def herbal_list(request):
o['enforcement'] = h.enforcement
o['findingscode'] = h.findings.findingscode
res.append(o)
print(res)
return HttpResponse(json.dumps({
'status': 0,
'res': res
@ -316,7 +313,6 @@ def soil_list(request):
o['color'] = h.color
o['findingscode'] = h.findings.findingscode
res.append(o)
print(res)
return HttpResponse(json.dumps({
'status': 0,
'res': res
@ -343,3 +339,17 @@ def all_data_count(request):
'res':res
}))
def image(request):
herbal = Sampleherbalplantimages.objects.all()[:10]
res = []
for h in herbal:
o = dict()
if h.file:
o['image'] = h.file.url
res.append(o)
print(res)
return HttpResponse(json.dumps({
'status':0,
'res':res
}))

2
fabfile.py vendored
View File

@ -4,7 +4,7 @@ from fabric.api import env
env.hosts = ["g214@210.77.68.250"] # Replace with your host name or IP
env.base_dir = '/var/www/p3' # Set to your app's directory
env.app_name = 'DesertVegetationCommunitySurvey' # This will deploy the app to /www/app_name.com/
env.git_clone = 'http://210.77.77.77/xieshen/desertvegetationcommunitysurvey.git' # Your git url
env.git_clone = 'http://210.77.68.250:30010/xieshen/desertvegetationcommunitysurvey.git' # Your git url
env.remote_owner = 'g214'
env.remote_group = 'www-data'
env.restart_cmd = 'sudo service apache2 restart'