From 443ce34bafc3e7aa716728a7b8cd0288bf923287 Mon Sep 17 00:00:00 2001 From: shentao Date: Wed, 20 Sep 2017 18:39:35 +0800 Subject: Upload alarm display pages Change-Id: I1dce4ae37288adc57bce21845c6f9469b6defa77 Issue-Id: USECASEUI-33 Signed-off-by: shentao --- .../scripts/controller/performanceController.js | 103 +++++++++++++-------- 1 file changed, 62 insertions(+), 41 deletions(-) (limited to 'usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js') diff --git a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js index e16673d0..02e74c98 100644 --- a/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js +++ b/usecaseui-monitor/src/main/webapp/app/uui/fusion/scripts/controller/performanceController.js @@ -1,3 +1,18 @@ +/* + Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ app.controller('perCtrl',function ($scope) { }); @@ -13,17 +28,20 @@ app.controller('perGridCtrl', ['$scope', '$http', '$timeout', '$interval', 'uiG { name: "shebei1", State: 50, Cpu: "40%", Memory: "60,000", Disk: "60,000", Network: "60,000" }, { name: "shebei1", State: 50, Cpu: "40%", Memory: "60,000", Disk: "60,000", Network: "60,000" } ]; - + $scope.jump = function (){ + console.log(1); + $scope.currentTab = '#/pre-details'; + }; $scope.gridOptions = { data: 'myData', columnDefs: [{ field: 'name', displayName: 'name', width: '10%', - enableColumnMenu: false,// 是否显示列头部菜单按钮 + enableColumnMenu: false, enableHiding: false, suppressRemoveSort: true, - enableCellEdit: false ,// 是否可编辑 - cellTemplate:'{{data.name}}', + enableCellEdit: false , + cellTemplate:'shebei1' }, { field: "Id",}, { field: "State"}, @@ -33,76 +51,79 @@ app.controller('perGridCtrl', ['$scope', '$http', '$timeout', '$interval', 'uiG { field: "Network"} ], - enableSorting: true, //是否排序 - useExternalSorting: false, //是否使用自定义排序规则 - enableGridMenu: true, //是否显示grid 菜单 - showGridFooter: true, //是否显示grid footer - enableHorizontalScrollbar : 1, //grid水平滚动条是否显示, 0-不显示 1-显示 - enableVerticalScrollbar : 0, //grid垂直滚动条是否显示, 0-不显示 1-显示 + enableSorting: true, + useExternalSorting: false, + enableGridMenu: true, + showGridFooter: true, + enableHorizontalScrollbar : 1, + enableVerticalScrollbar : 0, enableFiltering: true, - //-------- 分页属性 ---------------- - enablePagination: true, //是否分页,默认为true - enablePaginationControls: true, //使用默认的底部分页 - paginationPageSizes: [10, 15, 20], //每页显示个数可选项 - paginationCurrentPage:1, //当前页码 - paginationPageSize: 10, //每页显示个数 - //paginationTemplate:"
", //自定义底部分页代码 - totalItems : 0, // 总数量 - useExternalPagination: true,//是否使用分页按钮 - - - //----------- 选中 ---------------------- - enableFooterTotalSelected: true, // 是否显示选中的总数,默认为true, 如果显示,showGridFooter 必须为true - enableFullRowSelection : true, //是否点击行任意位置后选中,默认为false,当为true时,checkbox可以显示但是不可选中 - enableRowHeaderSelection : true, //是否显示选中checkbox框 ,默认为true - enableRowSelection : true, // 行选择是否可用,默认为true; - enableSelectAll : true, // 选择所有checkbox是否可用,默认为true; - enableSelectionBatchEvent : true, //默认true - isRowSelectable: function(row){ //GridRow + // + enablePagination: true, + enablePaginationControls: true, + paginationPageSizes: [10, 15, 20], + paginationCurrentPage:1, + paginationPageSize: 10, + //paginationTemplate:"
", + totalItems : 0, + useExternalPagination: true, + + + //- + enableFooterTotalSelected: true, + enableFullRowSelection : true, + enableRowHeaderSelection : true, + enableRowSelection : false, + enableSelectAll : true, + enableSelectionBatchEvent : true, + isRowSelectable: function(row){ if(row.entity.age > 45){ - row.grid.api.selection.selectRow(row.entity); // 选中行 + row.grid.api.selection.selectRow(row.entity); } }, - modifierKeysToMultiSelect: false ,//默认false,为true时只能 按ctrl或shift键进行多选, multiSelect 必须为true; - multiSelect: true ,// 是否可以选择多个,默认为true; - noUnselect: false,//默认false,选中后是否可以取消选中 - selectionRowHeaderWidth:30 ,//默认30 ,设置选择列的宽度; + modifierKeysToMultiSelect: false , + multiSelect: true , + noUnselect: false, + selectionRowHeaderWidth:30 , //---------------api--------------------- onRegisterApi: function(gridApi) { $scope.gridApi = gridApi; - //分页按钮事件 + gridApi.pagination.on.paginationChanged($scope,function(newPage, pageSize) { if(getPage) { getPage(newPage, pageSize); } }); - //行选中事件 - $scope.gridApi.selection.on.rowSelectionChanged($scope,function(row,event){ + + /*$scope.gridApi.selection.on.rowSelectionChanged($scope,function(row,event){ if(row){ $scope.testRow = row.entity; } - }); + });*/ } }; + var getPage = function(curPage, pageSize) { var firstRow = (curPage - 1) * pageSize; $scope.gridOptions.totalItems = mydefalutData.length; $scope.gridOptions.data = mydefalutData.slice(firstRow, firstRow + pageSize); - //或者像下面这种写法 + //$scope.myData = mydefalutData.slice(firstRow, firstRow + pageSize); }; getPage(1, $scope.gridOptions.paginationPageSize); - //input框 + //input $scope.menuState={show: false} $scope.toggleMenu=function() { $scope.menuState.show=!$scope.menuState.show; } - }]); \ No newline at end of file + }]); + + \ No newline at end of file -- cgit 1.2.3-korg