craneRope.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. var _this;
  2. var nowTime;
  3. new Vue({
  4. el: '#app',
  5. data: function() {
  6. return {
  7. lidarLi: [{
  8. value: 'alivesb',
  9. label: '心跳识别'
  10. },{
  11. value: 'cameraoffline',
  12. label: '摄像头掉线'
  13. },{
  14. value: 'cameraonline',
  15. label: '摄像头重连'
  16. },{
  17. value: 'breakin',
  18. label: '目标闯入'
  19. },{
  20. value: 'leave',
  21. label: '目标离开'
  22. },{
  23. value: 'collision',
  24. label: '目标碰撞'
  25. }],
  26. wiraData: [],
  27. queryParem: {
  28. user: "",
  29. msgType: "",
  30. enddate: "",
  31. startdate: "",
  32. pageNum: 1,
  33. pageSize: 20
  34. },
  35. allTotal: 0,
  36. wramImg: "",
  37. dialogVisible: false,
  38. showPreview: false,
  39. imagePreview: [],
  40. endPicker: false,
  41. starPicker: false
  42. }
  43. },
  44. created() {
  45. _this = this;
  46. nowTime = parseTime(new Date(), '{y}-{m}-{d}');
  47. _this.getList();
  48. },
  49. methods: {
  50. getList(){
  51. const loading = _this.$toast({
  52. type: 'loading',
  53. loadingType: 'spinner',
  54. duration: 0
  55. });
  56. setTimeout(()=>{
  57. // let _opts = {
  58. // url: vipUrl + "/receive",
  59. // type:"GET"
  60. // };
  61. // _this.queryParem.user = "yzkj";
  62. // let _data = _this.queryParem;
  63. // let _hea = {};
  64. // getAxios(_opts, _data, _hea).then((res) => {
  65. let res = {
  66. data: [{
  67. createDate: "2023/07/10 18:13:44",
  68. camera: "摄像头左",
  69. type: "alivesb",
  70. msgType: "心跳",
  71. level: 1
  72. },{
  73. createDate: "2023/07/10 18:03:44",
  74. camera: "摄像头左",
  75. type: "cameraonline",
  76. msgType: "重连",
  77. level: 1
  78. },{
  79. createDate: "2023/07/10 17:53:29",
  80. camera: "摄像头左",
  81. type: "cameraoffline",
  82. msgType: "掉线",
  83. level: 1,
  84. imgUrl: ""
  85. },{
  86. createDate: "2023/07/10 17:43:52",
  87. camera: "摄像头左",
  88. type: "breakin",
  89. msgType: "闯入",
  90. level: 2,
  91. imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
  92. },{
  93. createDate: "2023/07/10 17:03:34",
  94. camera: "摄像头左",
  95. type: "leave",
  96. msgType: "离开",
  97. level: 2,
  98. imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
  99. },{
  100. createDate: "2023/07/10 16:07:20",
  101. camera: "摄像头左",
  102. type: "collision",
  103. msgType: "碰撞",
  104. level: 2,
  105. imgUrl: "http://210.76.81.182//hwService/cos/getObject/d4c2646fcd343d2c8f01e4d3b5555f140010.jpg"
  106. }],
  107. success: true,
  108. total: 6
  109. };
  110. if(res.success&&res.data.length){
  111. _this.allTotal = res.total;
  112. _this.wiraData = res.data;
  113. }else{
  114. _this.allTotal = 0;
  115. _this.wiraData = [];
  116. }
  117. loading.close();
  118. // })
  119. },200)
  120. },
  121. seachLi(){
  122. _this.queryParem.pageNum = 1;
  123. _this.checkQuery();
  124. },
  125. handleCurrentChange(){
  126. if(val != _this.queryParem.pageNum){
  127. _this.queryParem.pageNum = val;
  128. _this.initAjax();
  129. }
  130. },
  131. checkQuery(){
  132. if((isNaN(_this.queryParem.enddate)&&!isNaN(Date.parse(_this.queryParem.enddate)))&&(!isNaN(_this.queryParem.startdate)||isNaN(Date.parse(_this.queryParem.startdate)))){
  133. _this.$message({
  134. message: '请选择开始时间!',
  135. type: 'warning'
  136. });
  137. return;
  138. }
  139. if((isNaN(_this.queryParem.enddate)&&!isNaN(Date.parse(_this.queryParem.enddate)))&&(isNaN(_this.queryParem.startdate)&&!isNaN(Date.parse(_this.queryParem.startdate)))){
  140. if(new Date(_this.queryParem.enddate).getTime()<new Date(_this.queryParem.startdate).getTime()){
  141. let a = _this.queryParem.enddate;
  142. _this.queryParem.enddate = _this.queryParem.startdate;
  143. _this.queryParem.startdate = a;
  144. }
  145. }else if((!isNaN(_this.queryParem.enddate)||!isNaN(Date.parse(_this.queryParem.enddate)))&&(isNaN(_this.queryParem.startdate)&&!isNaN(Date.parse(_this.queryParem.startdate)))){
  146. _this.queryParem.enddate = nowTime;
  147. }
  148. _this.getList();
  149. },
  150. seeImg(row){
  151. _this.imagePreview = [row.imgUrl];
  152. _this.showPreview = true;
  153. },
  154. goBack(){
  155. top.location.href = "../mainPh.html?sn=4";
  156. },
  157. endConfirm(val){
  158. _this.queryParem.enddate = getDTime(val)[0];
  159. _this.endPicker = false;
  160. },
  161. startConfirm(val){
  162. _this.queryParem.startdate = getDTime(val)[0];
  163. _this.starPicker = false;
  164. },
  165. changePage(val){
  166. _this.queryParem.pageNum = val;
  167. _this.getList();
  168. }
  169. }
  170. })