#
Junjie
2024-01-05 69cfd1cfd760e6af3f0c5353eacdf38c7af8b56a
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>API开放平台 - API管理</title>
    <link rel="stylesheet" href="../static/css/element.css">
    <link rel="stylesheet" href="../static/css/common.css">
    <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../static/js/vue.min.js"></script>
    <script type="text/javascript" src="../static/js/showdown.min.js"></script>
    <script type="text/javascript" src="../static/js/common.js"></script>
    <script type="text/javascript" src="../static/js/element.js"></script>
</head>
<body>
    <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
        <div style="width: 80%;">
            <el-card class="box-card">
                <el-form :inline="true" :model="tableSearchParam" class="demo-form-inline">
                    <el-form-item label="">
                        <el-input v-model="tableSearchParam.task_no" placeholder="任务号"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="getTableData">查询</el-button>
                        <el-button type="primary" @click="resetParam">重置</el-button>
                    </el-form-item>
                </el-form>
                <el-table ref="singleTable" :data="tableData" style="width: 100%;">
                    <el-table-column property="id" label="#ID">
                    </el-table-column>
                    <el-table-column property="wrkNo" label="工作号">
                    </el-table-column>
                    <el-table-column property="taskNo" label="任务号">
                    </el-table-column>
                    <el-table-column property="commandStatus$" label="指令状态">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip property="durationTime" label="持续时长">
                    </el-table-column>
                    <el-table-column property="commandType" label="指令类型">
                    </el-table-column>
                    <el-table-column property="device" label="设备">
                    </el-table-column>
                    <el-table-column property="deviceLog" label="设备执行信息">
                    </el-table-column>
                    <el-table-column property="commandDesc" label="命令描述">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip property="startTime$" label="开始时间">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip property="executeTime$" label="执行时间">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip property="completeTime$" label="完成时间">
                    </el-table-column>
                    <el-table-column show-overflow-tooltip property="command" label="命令报文" width="250">
                    </el-table-column>
                </el-table>
 
                <div style="margin-top: 10px;">
                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                                   :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize"
                                   layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
                    </el-pagination>
                </div>
            </el-card>
        </div>
 
        <div style="position: fixed;top: 20px;right: 20px;width: 150px;border-left: 3px solid #f0f0f0;padding-left: 15px;">
            <div><el-button type="text" @click="switchPage('index.html')">规范说明</el-button></div>
            <div><el-button type="text" @click="switchPage('reportCompleted.html')">任务完成上报</el-button></div>
            <div><el-button type="text" @click="switchPage('reportCompleted.html')">任务取消上报</el-button></div>
            <div><el-button type="text" @click="switchPage('reportCompleted.html')">库存上报</el-button></div>
            <div><el-button type="text" @click="switchPage('reportApiManage.html')">上报API管理</el-button></div>
        </div>
    </div>
 
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                tableData: [],
                currentPage: 1,
                pageSizes: [16, 30, 50, 100, 150, 200],
                pageSize: 16,
                pageTotal: 0,
                tableSearchParam: {
                    task_no: null,
                },
            },
            created() {
                this.init()
            },
            methods: {
                init() {
                    this.getTableData()
                },
                getTableData() {
                    let that = this;
                    let data = this.tableSearchParam
                    data.curr = this.currentPage
                    data.limit = this.pageSize
                    $.ajax({
                        url: baseUrl + "/commandInfoLog/list/auth",
                        headers: {
                            'token': localStorage.getItem('token')
                        },
                        data: data,
                        dataType: 'json',
                        contentType: 'application/json;charset=UTF-8',
                        method: 'GET',
                        success: function(res) {
                            if (res.code == 200) {
                                that.tableData = res.data.records
                                that.pageTotal = res.data.total
                            } else {
                                that.$message({
                                    message: res.msg,
                                    type: 'error'
                                });
                            }
                        }
                    });
                },
                handleSizeChange(val) {
                    console.log(`每页 ${val} 条`);
                    this.pageSize = val
                    this.getTableData()
                },
                handleCurrentChange(val) {
                    console.log(`当前页: ${val}`);
                    this.currentPage = val
                    this.getTableData()
                },
                resetParam() {
                    this.tableSearchParam = {
                        task_no: null,
                        status: null,
                        wrk_no: null
                    }
                    this.getTableData()
                },
                switchPage(url) {
                    location.href = url
                }
            }
        })
    </script>
</body>
</html>