Files
2023-01-13 15:30:20 +08:00

84 lines
2.2 KiB
JavaScript

angular.module('myApp', ['tm.pagination']).controller('listdata', function ($scope, $http) {
// 重新获取数据条目
var reGetAddressstorage = function () {
// 发送给后台的请求数据
var postData = {
Matchid: $scope.Matchid,
};
$http.post('/Home/MatchsList', postData).success(function (data) {
// 变更分页的总数
$scope.paginationConf.totalItems = data.TotalCount;
// 变更产品条目
$scope.addrlist = data.List;
});
};
// 重新获取数据条目
var AddAddressstorage = function () {
// 发送给后台的请求数据
var postData = {
PageIndex: $scope.paginationConf.currentPage,
PageSize: $scope.paginationConf.itemsPerPage,
Matchid: $scope.Matchid,
};
};
// 配置分页基本参数
$scope.paginationConf = {
currentPage: 1,
itemsPerPage: 10
};
// 通过$watch currentPage和itemperPage 当他们一变化的时候,重新获取数据条目
$scope.$watch('paginationConf.currentPage + paginationConf.itemsPerPage', reGetAddressstorage);
$scope['Search'] = function () { // 当按钮被点击之后,调用,设置当前的按钮
reGetAddressstorage();
}
$scope['StartUp'] = function (Matchid, readdate) { // 当按钮被点击之后,调用,设置当前的按钮
console.log(Matchid);
var postData = {
Matchid: Matchid,
ReadDate: readdate
};
$http.post('/Home/StartUpMatch', postData).success(function (data) {
$("#showMessage").html(data.msg);
reGetAddressstorage();
});
}
$scope['BackMatch'] = function (Matchid) { // 当按钮被点击之后,调用,设置当前的按钮
var r = confirm("确定要取消波次" + Matchid+"吗!");
if (r == true) {
var postData = {
Matchid: Matchid,
};
$http.post('/Home/CancelMatch', postData).success(function (data) {
$("#showMessage").html(data.msg);
reGetAddressstorage();
});
}
}
})