<ul class='list-inline my-list-inline'>
<li class="action-check" ng-class="{'active':allHasChoice}" ng-click="clicktarget(true,tmp,dataList)">
<li>中文名称</li>
<li>英文名称</li>
<li>申请人类型</li>
<ul>
<div class="list-data">
<table>
<tbody>
<tr ng-repeat="tmp in dataList track by tmp.idTell"
ng-class="{true:'active',false:''}[targetChoice[tmp.idTell]==true]"
ng-click="ctmlicktarget(false,tmp,dataList)"
>
<td>
<span class="choice-icon"></span>
<span class="company-name over-flow-handel-style" title="{{tmp.chineseName}}"
ng-bind="tmp.cineseName"></span>
</td>
<td>
<span class="english-name over-flow-handel-style" title="{{tmp.englishName}}"
ng-bind="tmp.englishName"></span>
</td>
<td>
<span class="english-name over-flow-handel-style" title="{{tmp.abbreviation}}"
ng-bind="tmp.abbreviation"></span>
</td>
</tr>
</tbody>
</table>
$scope.dataList=[
{'chineseName':'百度科技','englishName':'baidukeji','abbreviation':'小度','idTell':'bd'},
{'chineseName':'小牛科技','englishName':'xiaoniukeji','abbreviation':'小牛','idTell':'xn'},
{'chineseName':'京东科技','englishName':'jdkeji','abbreviation':'小京','idTell':'xj'},
{'chineseName':'顺风科技','englishName':'sfkeji','abbreviation':'小风','idTell':'xf'},
{'chineseName':'阿里科技','englishName':'alkeji','abbreviation':'小里','idTell':'xl'},
{'chineseName':'淘宝科技','englishName':'tbkeji','abbreviation':'小宝','idTell':'xb'},
{'chineseName':'天猫科技','englishName':'tmkeji','abbreviation':'小猫','idTell':'xm'}
];
$scope.targetChoice=[];
$scope.clicktarget=function(isAllChoiceBtn,tmp,dataList){
//isAllChoiceBtn:用于表示用户点击的是否是全选按钮,tmp:是数据集合中的一个数据对象
var count=0;//记录被选中的子选项的个数
//说明用户点击的不是“全选”按钮
isAllChoiceBtn==false?(function(){
//当前选项取反
$scope.targetChoice[tmp.idTell]=!$scope.targetChoice[tmp.idTell];
//遍历数据集合,统计已经被购中的单选项
angular.foreach(dataList,function(v,k){
$scope.targetChoice[v.idTell]&& count++;
});
//如果count等于数据集合得长度,说明所有的单选被购中
count==dataList.length && $scope.allHasChoice=true:$scope.allHasChoice==false;
})()
//说明点击的"全选"按钮
:(function(){
$scope.allHasChoice=!$scope.allHasChoice;//状态取反
$scope.allHasChoice==false?
//说明取消全选
:angular.forEach(dataList,function(v,k){
$scope.targetChoice[v.idTell]=$scope.allHasChoice;
count=0;
})
//说明选中全选
:angular.forEach(dataList,function(v,k){
$scope.targetChioce[v.idTell]=$scope.allHasChoice;
count++;
});
})()
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有