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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/main.js"></script>
</head>
<body>
  <div id="app">
    <el-container>
      <el-header>
        <el-date-picker
          v-model="dateSelect"
          type="datetimerange"
          :picker-options="pickerOptions"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          align="right"
          value-format="yyyy-MM-dd HH:mm:ss"
          >
        
        </el-date-picker>
        
        <el-input style="width: 175px;"
          placeholder="请输入机器ID"
          v-model="machineid"
          clearable>
        </el-input>
      </el-header>
      <el-main style="height: 90vh;">
        <show-table :tablehead="tableHead" :tabledata="tableData"></show-table> 
 
      </el-main>
    </el-container>
 
 
    
    
    
    
  </div>
</body>
<script>
  let app= new Vue({
    el: '#app',
    mixins:[mixin],
    data(){
      return{
        pickerOptions: {
          shortcuts: [{
            text: '最近一周',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近一个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit('pick', [start, end]);
            }
          }, {
            text: '最近三个月',
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit('pick', [start, end]);
            }
          }]
        },
        dateSelect:["",""],
        machineid:"",
        tableData:[{}],
        tableHead:[{
          "0_machine_id":'机器ID',
          "1_machine_name":'机器名称',
          "2_jishu":'产量',
          "3_tingji":'停机时间'
        }]
 
      }
      
    },
    methods:{
    },
    async mounted() {
      let timer1=await setInterval(()=>{
          let arrObj={
            machineid:this.machineid,
            stateData:this.dateSelect[0],
            endeData:this.dateSelect[1]
          }
          sql="{call glog.datetimeMachineGlassSum(?,?,?,?)}~"+JSON.stringify(arrObj)
          this.interValLoadAjxs('产量查询',sql,2,"tableData",timer1)
        },5000)
    },
 
   })
 
 
 
 </script>
</html>