|
|
@@ -720,7 +720,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- app.controller('MyCtrl', ['$scope', '$rootScope', '$modal', function($scope, $rootScope, $modal) {
|
|
|
+ app.controller('MyCtrl', ['$scope', '$rootScope', '$modal', 'toaster', function($scope, $rootScope, $modal, toaster) {
|
|
|
$rootScope.$on('$locationChangeSuccess', function(evt, newUrl) {
|
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
|
if (routeState.indexOf('/') > -1)
|
|
|
@@ -731,9 +731,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
});
|
|
|
|
|
|
$scope.search = function(keyword) {
|
|
|
- if(keyword != null ) {
|
|
|
+ if(keyword != null && keyword != '') {
|
|
|
$rootScope.searchKeyword = keyword;
|
|
|
window.location.hash = '#/search?keyword='+keyword;
|
|
|
+ } else {
|
|
|
+ toaster.pop('info', '提示', '请输入有效字符');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -13798,10 +13800,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
|
|
|
// 搜索框回车
|
|
|
$scope.onSearch = function(keyword) {
|
|
|
- $rootScope.searchKeyword = keyword;
|
|
|
- $scope.keyword = keyword;
|
|
|
- $scope.tableParams.page(1);
|
|
|
- $scope.tableParams.reload();
|
|
|
+ if($scope.keyword != null && $scope.keyword != '') {
|
|
|
+ $rootScope.searchKeyword = keyword;
|
|
|
+ $scope.keyword = keyword;
|
|
|
+ $scope.tableParams.page(1);
|
|
|
+ $scope.tableParams.reload();
|
|
|
+ } else {
|
|
|
+ toaster.pop('info', '提示', '请输入有效字符');
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 添加合作关系
|