angularJS——高级筛选
来源:互联网 发布:姜维 知乎 编辑:程序博客网 时间:2024/05/21 04:15
angularJS——高级筛选
1.效果图
2.前台代码
<ons-scroller class="hlyw-bg-seek" ng-class="{'isIOStop':isIOS}"> <div class="hlyw-filtrate-bt">分公司</div> <div class="hlyw-filtrate-bt-an-d"> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.partyGroupId==deptCode}" ng-click="chooseChargeParam('partyGroupId',deptCode)">全部</div> <div class="hlyw-filtrate-bt-an" ng-repeat="item in childCompanyInfos" ng-class="{'hlyw-gjsx-true':screenParam.partyGroupId==item.deptCode}" ng-click="chooseChargeParam('partyGroupId',item.deptCode)">{{item.deptName}}</div> </div> <div class="hlyw-filtrate-bt">电压等级</div> <div class="hlyw-filtrate-bt-an-d"> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel==''}" ng-click="chooseChargeParam('voltLevel','')">全部</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='07'}" ng-click="chooseChargeParam('voltLevel','07')">6kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='08'}" ng-click="chooseChargeParam('voltLevel','08')">10kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='09'}" ng-click="chooseChargeParam('voltLevel','09')">20kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='10'}" ng-click="chooseChargeParam('voltLevel','10')">35kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='12'}" ng-click="chooseChargeParam('voltLevel','12')">110kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='13'}" ng-click="chooseChargeParam('voltLevel','13')">220kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='14'}" ng-click="chooseChargeParam('voltLevel','14')">330kV</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.voltLevel=='OTHER'}" ng-click="chooseChargeParam('voltLevel','OTHER')">其他</div> </div> <div class="hlyw-filtrate-bt">用电类别</div> <div class="hlyw-filtrate-bt-an-d"> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType==''}" ng-click="chooseChargeParam('elecType','')" >全部</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='100'}" ng-click="chooseChargeParam('elecType','100')">大工业用电</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='200'}" ng-click="chooseChargeParam('elecType','200')">普通工业</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='260'}" ng-click="chooseChargeParam('elecType','260')">非工业</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='300'}" ng-click="chooseChargeParam('elecType','300')">商业</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='500'}" ng-click="chooseChargeParam('elecType','500')">居民生活</div> <div class="hlyw-filtrate-bt-an" ng-class="{'hlyw-gjsx-true':screenParam.elecType=='OTHER'}" ng-click="chooseChargeParam('elecType','OTHER')">其他</div> </div> </ons-scroller> <div class="hlyw-filtrate-bottom"> <div class="hlyw-filtrate-bottom-L" ng-click="chooseReset()" >恢复默认</div> <div class="hlyw-filtrate-bottom-R"> <div class="hlyw-filtrate-button" ng-click="chooseTRUE($event)">确定</div> </div> </div>
3.控制器代码
$scope.chooseChargeParam = function(paramType,paramValue){ if(paramType=='partyGroupId'){ var oriValue = $scope.screenParam[paramType];//原有选择数据 if(oriValue==paramValue){ $scope.screenParam[paramType]=$scope.deptCode; }else{ $scope.screenParam[paramType]=paramValue; } }else{ var oriValue = $scope.screenParam[paramType];//原有选择数据 if(oriValue==paramValue){ $scope.screenParam[paramType]=''; }else{ $scope.screenParam[paramType]=paramValue; } } }; //恢复默认 $scope.chooseReset = function() { $scope.screenParam = { partyGroupId: $scope.deptCode, 'voltLevel': '', 'elecType': '' }; }; //点击确定跳转列表页 $scope.chooseTRUE= function($event) { //防止多次点击 var btn = angular.element($event.target); btn.attr('disabled','disabled'); $scope.$evalAsync(); mainNavi.replacePage($scope.baseUrl+"pagesV2/enterpreneur/filtrateEnterpriseList.html",{screenParam:$scope.screenParam,onTransitionEnd:function(){ btn.removeAttr('disabled'); $scope.$evalAsync(); }}); }
阅读全文
1 0
- angularJS——高级筛选
- 实用编程——高级筛选
- AngularJS筛选器
- AngularJS高级程序设计——互动出版网
- Excel 中用公式列出唯一值——模拟高级筛选功能
- EXCEL中的高级筛选
- 素数筛选——爱拉托逊斯筛选法
- AngularJS+添加+条件筛选+排序
- AngularJS一系列筛选,添加、显示
- AngularJS一筛选,添加、过滤
- Excel中的数据筛选和高级筛选
- AngularJS 高级程序设计
- Excel表格高级筛选教程
- VBA Excel 高级筛选AdvancedFilter
- VBA代码实例---高级筛选
- AngularJS学习-(左侧导航栏筛选、input输入框筛选)
- angularJs中筛选功能-angular.filter-1
- angularJS自定义过滤器筛选列表/下拉框
- ListView遇到的坑
- pullToRefreshListView
- js二维数组转换json
- 求两个字符串的编辑距离
- shell读取文件的每一行
- angularJS——高级筛选
- 【笔记】tarjian算法 求强连通分量
- AlexNet -翻译
- 支持IE浏览器的渐变效果
- navicat for mysql 注册码
- 10.18
- 正则限制 input 输入框只能输入整数、小数
- 通过jQuery和Bootstrap来分别实现轮播图
- unity一 Transform类基础介绍