Browse Source

分页套打

xiongchao 3 years ago
parent
commit
13cf934e63

+ 50 - 33
public/hitch-screen/point.html

@@ -47,8 +47,53 @@
   var id = window.location.search.split("id=")[1]
   id = filterUrlData(id);
 
-  var xx =  0;
-  var yy =  0;
+  var xx =  window.location.search.split("zjm=")[1];
+  xx = filterUrlData(xx) || 0;
+
+  var yy = window.location.search.split("jbdh=")[1] || 0;
+  yy = filterUrlData(yy);
+  // 初始化设备位置
+  $(function(){
+    $('#x').text(xx);
+    $('#y').text(yy);
+    alert($('.point').html());
+    alert(xx);
+    alert(yy);
+    $('.point').css('left',xx).css('top',yy).css('position', 'absolute');
+
+    $('#echart').click(function(e) {
+      xx = e.pageX || 0;
+      yy = e.pageY || 0;
+      console.log(xx+'   '+yy);
+      $('#x').text(xx);
+      $('#y').text(yy);
+      $('.point').css('left',xx).css('top',yy);
+    })
+    $('.ahref').click(function(e) {
+      if(id == null){
+        alert('请设置设备')
+        return
+      }
+      if(xx==null || yy==null || xx == 0 || yy==0){
+        alert('请点击位置,该位置将作为设备的显示位置')
+        return
+      }
+      var data = {id: id, zjm:xx, jbdh: yy}
+      $.ajax({
+        type: "PUT",
+        url: "/api/sb/infos/" + id,
+        headers: getHeader(),
+        data: JSON.stringify(data),
+        success: function(response) {
+          const data = response.data;
+          alert("保存成功。")
+        },
+        error: function(xhr, textStatus, errorThrown) {
+          error(xhr, textStatus, errorThrown);
+        }
+      });
+    })
+  })
 
   /**
    * filterUrlData 过滤url数据
@@ -205,37 +250,7 @@ var option = {
 // 使用刚指定的配置项和数据显示图表
 myChart.setOption(option);
 
-  $('#echart').click(function(e) {
-    xx = e.pageX || 0;
-    yy = e.pageY || 0;
-    console.log(xx+'   '+yy);
-    $('#x').text(xx);
-    $('#y').text(yy);
-    $('.point').css('left',xx).css('top',yy);
-  })
-  $('.ahref').click(function(e) {
-    if(id == null){
-      alert('请设置设备')
-      return
-    }
-    if(xx == 0|| yy==0){
-      alert('请点击位置,该位置将作为设备的显示位置')
-      return
-    }
-    var data = {id: id, zjm:xx, jbdh: yy}
-    $.ajax({
-      type: "PUT",
-      url: "/api/sb/infos/" + id,
-      headers: getHeader(),
-      data: JSON.stringify(data),
-      success: function(response) {
-        const data = response.data;
-      },
-      error: function(xhr, textStatus, errorThrown) {
-        error(xhr, textStatus, errorThrown);
-      }
-    });
-  })
+
 function getHeader(){
   return {
     Authorization: getToken(),
@@ -262,6 +277,8 @@ function getToken(){
     position: absolute;
     padding: 5px;
     background: red;
+    left:0;
+    top:0;
     z-index: 1000;
   }
   .ahref{

+ 5 - 1
src/views/sb/info/SbInfo.vue

@@ -589,7 +589,11 @@ export default {
     },
     doExport () {
       const parameter = {
-        ...this.queryParam
+        ...this.queryParam,
+        dataScope: {
+          sortBy: 'desc',
+          sortName: 'no'
+        }
       }
       exportSbInfo(parameter).then(file => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)

+ 4 - 1
src/views/sb/info/modules/BaseForm.vue

@@ -1400,8 +1400,11 @@ export default {
       }
     },
     handlePoint () {
+      const { form: { getFieldValue } } = this
+      const zjm = getFieldValue('zjm')
+      const jbdh = getFieldValue('jbdh')
       const a = document.createElement('a')
-      a.href = '/hitch-screen/point.html?id=' + this.id
+      a.href = '/hitch-screen/point.html?id=' + this.id + '&zjm=' + zjm + '&jbdh=' + jbdh
       a.target = '_blank'
       a.click()
     }