startOrStop.html 1.59 KB
<!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>