// 保存信息(新增/修改)
$scope.save = function() {
// 防止二次提交
$scope.btnSaveEnable = false;
$scope.error = "";
// check
if (!inputCheck()) {
// 防止二次提交
$scope.btnSaveEnable = true;
return;
}
url : "find/save",
data :$scope.searchInfo
}).success(function(rs, status, headers, config) {
if (rs.status == 0) {
$scope.success = "操作成功。";
var back = 1;
location.href = base + "/backplayroom-" + back;
} else {
$scope.error = rs.message;
$scope.btnSaveEnable = true;
}
}).error(function(rs, status, headers, config) {
$scope.error = "保存时,发生系统异常。";
$scope.btnSaveEnable = true;
});
$scope.save = function() {
// 防止二次提交
$scope.btnSaveEnable = false;
$scope.error = "";
// check
if (!inputCheck()) {
// 防止二次提交
$scope.btnSaveEnable = true;
return;
}
$scope.searchInfo.type=$("#type").val();
$http({
method : "post",url : "find/save",
data :$scope.searchInfo
}).success(function(rs, status, headers, config) {
if (rs.status == 0) {
$scope.success = "操作成功。";
var back = 1;
location.href = base + "/backplayroom-" + back;
} else {
$scope.error = rs.message;
$scope.btnSaveEnable = true;
}
}).error(function(rs, status, headers, config) {
$scope.error = "保存时,发生系统异常。";
$scope.btnSaveEnable = true;
});
};
function inputCheck() {
if (isEmpty($scope.searchInfo.playbackName)) {
$scope.error = "请输入回播室名称";
return false;
}
return true;
};