.
This commit is contained in:
115
tpl/front/ext/CtrlExtTpl.js
Normal file
115
tpl/front/ext/CtrlExtTpl.js
Normal file
@@ -0,0 +1,115 @@
|
||||
define(["app", "constant", "config","yCommon", "bootbox","common_tools", "dir_datepicker", "dir_paging", "yService", "dir_table_column_config", "tools_factory","dir_select","dir_file_upload",'dir_echart2'],
|
||||
function(app, constant, config, yCommon, bootbox, commonTools) {
|
||||
app.register.controller('aqsjListCtrl', ["$scope", "rootMap", "$state", "yService", "toolsFactory","$stateParams","$sce",
|
||||
function($scope, rootMap, $state, yService, toolsFactory,$stateParams,$sce) {
|
||||
|
||||
$scope.cfgAll = {
|
||||
#for(x : data)
|
||||
#(x.beanFL):{
|
||||
title:"#(x.remark)"
|
||||
,url:"/#(x.beanL)"
|
||||
,field_label: [#(x.label)]
|
||||
,field:[#(x.field)]
|
||||
},
|
||||
#end
|
||||
};
|
||||
|
||||
var pk = "#(data[0].beanFL)";
|
||||
$scope.cfg = $scope.cfgAll[pk];
|
||||
var cfg = $scope.cfg;
|
||||
|
||||
//页面加载
|
||||
function pageInit() {
|
||||
$("#"+ pk).addClass('t-active');
|
||||
initTab();
|
||||
$scope.query();
|
||||
}
|
||||
|
||||
function initTab(){
|
||||
$scope.cfg = $scope.cfgAll[pk];
|
||||
cfg = $scope.cfg;
|
||||
$scope.type= pk;
|
||||
|
||||
yService.initService(cfg["url"]);
|
||||
yCommon.initScope($scope, $sce,rootMap,{},yService);
|
||||
$scope[pk] = $scope[pk] || {};
|
||||
$scope.queryCondition = yCommon.getConditon($state);
|
||||
|
||||
//初始化分页数据值
|
||||
$scope["pageOptions"] = {
|
||||
server: config.services.assetmag,
|
||||
url: cfg.url,
|
||||
id: "xxPaging"
|
||||
};
|
||||
|
||||
//查询功能实现
|
||||
$scope.query = function() { //点击查询 更新查询条件缓存
|
||||
$scope.pageOptions = $scope.pageOptions || {};
|
||||
$scope.pageOptions.param = angular.copy($scope[pk].queryCondition);
|
||||
$scope.pageOptions.reload = true;
|
||||
yCommon.setCondition($scope.queryCondition);//预存查询条件
|
||||
|
||||
toolsFactory.closeDialog();
|
||||
};
|
||||
|
||||
//重置按钮
|
||||
$scope.reset = function() {
|
||||
var queryCondition = $scope.queryCondition;
|
||||
commonTools.resetQueryParmeter(queryCondition);
|
||||
yCommon.setCondition({});//预存查询条件
|
||||
};
|
||||
|
||||
//分页插件查询回调
|
||||
$scope.operatePaging = function(total, rows) {
|
||||
$scope.rows = rows;
|
||||
$scope.total = total;
|
||||
};
|
||||
|
||||
$scope[pk]["queryCondition"] = $scope[pk]["queryCondition"] || {};
|
||||
}
|
||||
|
||||
$('#ul1 li').click(function() {
|
||||
|
||||
$('#ul1 li').removeClass('t-active');
|
||||
$(this).addClass('t-active');
|
||||
|
||||
$scope.type = $(this).attr("id");
|
||||
if(pk == $(this).attr("id")) return false;
|
||||
pk = $(this).attr("id");
|
||||
|
||||
initTab();
|
||||
$scope.query();
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
//条件查询弹出层
|
||||
$scope.condition = function(){
|
||||
toolsFactory.openDialog($scope, app.tplsBasePath + 'threatmag/'+ pk +'/condition.html');
|
||||
}
|
||||
|
||||
//回车键查询
|
||||
$scope.keySearch = function(e){
|
||||
var keycode = window.event ? e.keyCode : e.which;
|
||||
if(keycode == 13){
|
||||
$scope.query();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.add = function(){
|
||||
$scope.title = cfg.title +"添加";
|
||||
$state.$go('threatmag.'+ pk +'.edit',{});
|
||||
}
|
||||
|
||||
$scope.detail = function(row){
|
||||
$state.$go('threatmag.'+ pk +'.detail',{row:row});
|
||||
}
|
||||
|
||||
$scope.update = function(row){
|
||||
$scope.title = cfg.title + "修改";
|
||||
$state.$go('threatmag.'+ pk +'.edit',{row:row});
|
||||
}
|
||||
|
||||
pageInit();
|
||||
}
|
||||
]);
|
||||
})
|
80
tpl/front/ext/listExtTpl.html
Normal file
80
tpl/front/ext/listExtTpl.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<style>
|
||||
#ul1 li,#ul2 li {
|
||||
list-style: none; /* 将默认的列表符号去掉 */
|
||||
padding: 0; /* 将默认的内边距去掉 */
|
||||
margin: 0; /* 将默认的外边距去掉 */
|
||||
float: left; /* 往左浮动 */
|
||||
height: 30px;
|
||||
width: 180px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.t-form-control{
|
||||
padding: 0.5rem 1.14rem;
|
||||
}
|
||||
.t-center{
|
||||
text-align: center;
|
||||
}
|
||||
.t-rowtop{
|
||||
margin-top: .8rem;
|
||||
}
|
||||
.t-col-lg-1{
|
||||
text-align: right;
|
||||
padding-right: .2rem;
|
||||
}
|
||||
.t-col-lg-1 label{
|
||||
margin-top: .6rem;
|
||||
}
|
||||
.t-active{
|
||||
color: #fff;
|
||||
background: #58abff;
|
||||
width: 180px;
|
||||
text-align: center;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.t-active:hover{
|
||||
color: #fff !important;
|
||||
}
|
||||
#ul1 li:hover,#ul2 li:hover{
|
||||
color: #58abff;
|
||||
}
|
||||
.t-btn{
|
||||
margin-bottom: 1rem !important;
|
||||
margin-right: 1rem !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- head -->
|
||||
<div class="cat__core__top-sidebar cat__core__top-sidebar--bg">
|
||||
<span class="cat__core__title"> <strong>安全事件</strong>
|
||||
</span>
|
||||
</div>
|
||||
<!-- body -->
|
||||
<div class="card-block animated bounceInRight">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="row t-rowtop">
|
||||
<div class="col-lg-1 t-col-lg-1">
|
||||
<label>威胁类型:</label>
|
||||
</div>
|
||||
<div class="col-lg-11">
|
||||
<ul id="ul1">
|
||||
#for(x : data)
|
||||
<li id="#(x.beanFL)"><span></span>#(x.remark)</li>
|
||||
#end
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
#for(x : data)
|
||||
<div ng-include="'app/src/modules/threatmag/#(x.beanFL)/list.html'" ng-if="'#(x.beanFL)'==type"></div>
|
||||
#end
|
||||
</div>
|
Reference in New Issue
Block a user