guoyuji
2023-10-08 7dbbcd0e54b4094e9f2b620197147e69911669c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<%@page import="builder.Manager"%>
<%@page import="ng.db.*"%>
<%@ page language="java" import="java.sql.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="../js/main.js"></script>
<style type="text/css">
<style>
  .el-table .warning-row {
    background: oldlace;
  }
 
  .el-table .success-row {
    background: oldlace;
  }
</style>
 
</style>
<title>Insert title here</title>
</head>
<body>
<% 
String a=null;
try{
    a=Manager.getDevice().toString();
}
catch(Exception e){
    a="[{}]";
}
 
 
%>
 <div id="app" style="width:100%">
     <el-table border
      :data="machine"
      height='100%'
      style="width: 100%;"
       :cell-class-name="tableRowClassName"
      >
      <el-table-column
        prop="name"
        label="设备">
      </el-table-column>
      <el-table-column
        prop="ip"
        label="IP">
      </el-table-column>
      <el-table-column
        prop="port"
        label="port">
      </el-table-column>
      <el-table-column
        prop="st"
        label="状态">
      </el-table-column>
      <el-table-column
        prop="count"
        label="调用次数">
      </el-table-column>
     </el-table>
</div>
    <script type="text/javascript">
    Vue.prototype.$echarts = echarts
    let app =new Vue({
      el: '#app',
      mixins:[mixin],
      data:{
         machine:<%=  a%>,
      },
      methods:{
          tableRowClassName({row,column,rowIndex,columnIndex}) {
              
               if (row['st'] == '未连接' && columnIndex==3 ) {
                 return 'success-row';
               }else{
                 return ''; 
               }
               
          }
      }
     })
   // console.log(app.$data.machine);
    </script>
</body>
</html>