| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- {% load staticfiles %}
- <div class="nullData" style="display:none">暂无数据</div>
- <div style="margin-bottom:10px;text-align:right">
- <a class="refresh" href="ybq_pest_data?imei={{imei}}" class="pestBtn">
- <i class="add">
- <img src="{% static '/img/echarts.png' %}" alt="" width="32">
- </i>查看害虫统计 </a>
- </div>
- <div class="popup-gallery">
- {% for i in img %}
- <div class="imgParent">
- <a class="popupA" href="{{ i.addr }}" title="path: {{ i.addr }}">
- <img src="{{ i.addr }}" width="300" height="300">
- <p>{{ i.upl_time }} </p>
- </a>
- <input type="hidden" value="{{i.equip_id}}">
- <!-- 管理员显示删除图片按钮 -->
- {% if current_user.is_superuser == True or current_user.is_staff == True %}
- <span class="delBtn" onclick="del($(this))"></span>
- {% else %}
- {% endif %}
- <a href="#test-popup" class="open-popup-link addDetial">添加描述</a>
- <a href="#lookDescribe" class="open-popup-link lookDetial">查看描述</a>
- <!-- <div> -->
- <label class="imgcheckbox">
- <input type="checkbox" class="check" onclick="checkAllSelect()" value="2014" name="check_box_list">
- <span></span>
- </label>
- <!-- </div> -->
- </div>
- {% endfor %}
- </div>
- <script src="{% static '/lib/js/jquery.magnific-popup.js' %}" type="text/javascript"></script>
- <script src="{% static '/js/reportmanage/ybq_imageList.js' %}?versions=0.5.0" type="text/javascript"></script>
- <script>
- var topicid = []; //imei数组
- // 单个复选框
- function checkAllSelect() {
- $('.check').each(function () {
- if ($(this).prop("checked") == true) {
- if (!contains(topicid, $(this).parents('.imgParent').find('img').attr('src'))) {
- topicid.push($(this).parents('.imgParent').find('img').attr('src'));
- }
- } else {
- removeByValue(topicid, $(this).parents('.imgParent').find('img').attr('src'));
- }
- });
- console.log(topicid)
- }
- //移除数组元素
- function removeByValue(arr, val) {
- for (var i = 0; i < arr.length; i++) {
- if (arr[i] == val) {
- arr.splice(i, 1);
- break;
- }
- }
- }
- //判断数组中是否包含元素
- function contains(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) {
- return true;
- }
- }
- return false;
- }
- // 刷新页面
- function reload(){
- var page = $('.layui-laypage-curr em').eq(1).html() || 1;
- $.ajax({
- url: 'ybq_img_list?imei=' + $('#imei').val() + '&page=' + page,
- type: 'get',
- success: function (data) {
- $('#imgList').html('');
- $('#imgList').html(data);
- if ($('.content').height() > 750) {
- $('#iframe-main', parent.document).css('height', $('.content').height() + 20)
- } else {
- $('#iframe-main', parent.document).css('height', '750px')
- }
- canceldelimg(document.getElementById('canceldel'))
- }
- })
- }
- </script>
|