startOrStop.html
1.59 KB
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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/ajax/libs/jquery-layout/jquery.layout-latest.css" th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
<link href="/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<style>
.btn{
width: 100px;
height: 50px;
}
</style>
<body class="gray-bg">
<div class="container-div ui-layout-center">
<div class="row">
<div style="float: left;width: 30%;margin-top: 200px;margin-left:200px;">
<button onclick="startClick()" class="btn btn-danger" type="button">开始</button>
</div>
<div style="margin-top: 200px;">
<button onclick="stopClick()" class="btn btn-danger" type="button">停止</button>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var prefix = ctx + "plc/connectPlc"
function startClick(){
$.ajax({
type: "post",
dataType: "json",
contentType: "application/json",
url: prefix + "/startClick",
//data: JSON.stringify(result),
success: function (r) {
if (r.code == 200) {
}
}
})
}
function stopClick(){
$.ajax({
type: "post",
dataType: "json",
contentType: "application/json",
url: prefix + "/stopClick",
//data: JSON.stringify(result),
success: function (r) {
if (r.code == 200) {
}
}
})
}
</script>
</body>
</html>