tremble преди 4 години
родител
ревизия
b2bac75e94
променени са 5 файла, в които са добавени 64 реда и са изтрити 53 реда
  1. 5 1
      index.html
  2. 1 1
      js/main_2020_show.js
  3. 2 2
      js/myShow-edit.js
  4. 2 2
      js/myShow.js
  5. 54 47
      js/showHardware.js

+ 5 - 1
index.html

@@ -805,8 +805,12 @@
     <div class="hardware-list">
         <div class="hard-header">
             <span>硬件列表</span>
+            <img id="shousuo" src="./images/introduce_close.png" alt="">
         </div>
-        <table id="gridtb"></table>
+        <div class="hard-body">
+            <table id="gridtb"></table>
+        </div>
+        
     </div>
     <script>
         if(number == "TEST"){

+ 1 - 1
js/main_2020_show.js

@@ -26,7 +26,7 @@ $("#hotPannel .close").on('click',()=>{
 
 $("#hotPannel input.mui-switch").on('change',()=>{
     var ifOn = $('#hotPannel input.mui-switch').is(':checked');
-   
+    console.log('切换')
 })
 
 

+ 2 - 2
js/myShow-edit.js

@@ -1,7 +1,7 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
- var g_Prefix="http://super.4dage.com/";
+//  var g_Prefix="http://super.4dage.com/";
 // var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/edit.html")+1);
-//var g_Prefix=window.location.origin+'/';
+var g_Prefix=window.location.origin+'/';
 
 var s = window.location.href.split('/');
 s.pop();

+ 2 - 2
js/myShow.js

@@ -1,7 +1,7 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
- var g_Prefix="https://super.4dage.com/";
+//  var g_Prefix="https://super.4dage.com/";
 // var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
-//var g_Prefix=window.location.origin+'/';
+var g_Prefix=window.location.origin+'/';
 
 var s = window.location.href.split('/');
 s.pop();

+ 54 - 47
js/showHardware.js

@@ -1,16 +1,16 @@
 $(function () {
-  let url = `http://8.135.106.227:8004/`
-  let gName = 'Gridtable'
-  let grtable = document.querySelector("#gridtb")
+  let url = `http://8.135.106.227:8004/`;
+  let gName = "Gridtable";
+  let grtable = document.querySelector("#gridtb");
   grtable.GM({
     gridManagerName: gName,
-    height: '400px',
+    height: "400px",
     ajaxData: function (setting) {
       // 传入分页及排序的配置项
       return getList(Object.assign({}, setting.pageData, setting.sortData));
     },
     ajaxType: "POST",
-    supportCheckbox:false,
+    supportCheckbox: false,
     supportAjaxPage: true,
     useNoTotalsMode: true,
     columnData: [
@@ -26,59 +26,66 @@ $(function () {
         key: "name",
         text: "热点名字",
       },
-      ,{
-        key: 'id',
-        width: '100px',
-        align: 'center',
-        text: '查看',
-        template: function(username){
-            var titleNode = document.createElement('div');
-						// titleNode.attr('href', `https://www.lovejavascript.com/#!zone/blog/content.html?id=${rowObject.id}`);
-						titleNode.setAttribute('title', username);
-						titleNode.classList.add('plugin-action');
-						titleNode.innerHTML = `<img src="./images/jiantou2.png" alt="">`;
-          return titleNode
-        }
+      ,
+      {
+        key: "id",
+        width: "100px",
+        align: "center",
+        text: "查看",
+        template: function (username) {
+          var titleNode = document.createElement("div");
+          // titleNode.attr('href', `https://www.lovejavascript.com/#!zone/blog/content.html?id=${rowObject.id}`);
+          titleNode.setAttribute("title", username);
+          titleNode.classList.add("plugin-action");
+          titleNode.innerHTML = `<img src="./images/jiantou2.png" alt="">`;
+          return titleNode;
+        },
       },
     ],
   });
 
-
   // 阻止冒泡
-  $('.hardware-list').on('click keydown keyup keypress',function (event) {
+  $(".hardware-list").on("click keydown keyup keypress", function (event) {
     event.stopPropagation();
-  })
+  });
 
   //点击前往查看
-  $(grtable).on('click', '.plugin-action', function(e) {
-    const row = GridManager.getRowData(gName, e.currentTarget.parentElement.parentElement);
+  $(grtable).on("click", ".plugin-action", function (e) {
+    const row = GridManager.getRowData(
+      gName,
+      e.currentTarget.parentElement.parentElement
+    );
     console.log(row);
-    window.hardwareHotList[row.code] && window.hardwareHotList[row.code].showPannel({focus:true})
+    window.hardwareHotList[row.code] &&
+      window.hardwareHotList[row.code].showPannel({ focus: true });
   });
 
-let getList = function(params) {
-		return new Promise((resolve, reject) => {
+  $(".hard-header").click(function () {
+      $(".hard-body").toggle();
+    }
+  )
+
+  let getList = function (params) {
+    return new Promise((resolve, reject) => {
       $.ajax({
-        method: 'GET',
+        method: "GET",
         headers: {
-            'Content-Type': 'application/json'
+          "Content-Type": "application/json",
+        },
+        dataType: "json",
+        contentType: "application/json",
+        url: url + "/api/device/list",
+        success: function (data) {
+          if (data.code === 0) {
+            resolve({
+              ...data,
+              totals: data.data.length,
+            });
+          } else {
+            reject(data);
+          }
         },
-        dataType: 'json',
-        contentType: 'application/json',
-        url: url + '/api/device/list',
-        success: function(data) {
-          console.log(data);
-            if (data.code === 0) {
-					    resolve({
-                ...data,
-                totals:data.data.length
-              });
-            }
-            else {
-              reject(data);
-            }
-        }
-      })
-    })
-	};
-})
+      });
+    });
+  };
+});