This commit is contained in:
2019-03-13 16:03:59 +08:00
commit ca2f3f4822
224 changed files with 56136 additions and 0 deletions

100
tpl/front/CtrlTpl.js Normal file
View File

@@ -0,0 +1,100 @@
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('#(fileDir)ListCtrl', ["$scope", "rootMap", "$state", "yService", "toolsFactory","$stateParams","$sce",
function($scope, rootMap, $state, yService, toolsFactory,$stateParams,$sce) {
yService.initService("/#(beanL)");
var funs = {
#for(x : fieldList)
#if(x.tag == "SELECT")
#(x.field):function(v) {
var arr = #(x.selects);
for (i in arr){
if (v == arr[i].key){
return arr[i]["value"];
}
}
return "";
},
#end
#end
};
yCommon.initScope($scope, $sce,rootMap,funs,yService);
$scope.queryCondition = yCommon.getConditon($state);
//conf
$scope.cfg = {
title:"#(remark)#if(pagePath == 'verify')-核验#end"
,url:"/#(bean.toLowerCase())"
,field_label: [#(label)]
,field:[#(field)]
,conditionLabel:"#(conditionLabel)"
};
//页面加载
function pageInit() {
//初始化分页数据值
$scope.pageOptions = {
server: config.services.assetmag,
url: $scope.cfg.url,
id: "xxPaging"
};
$scope.query();
}
//分页插件查询回调
$scope.operatePaging = function(total, rows) {
$scope.rows = rows;
$scope.total = total;
};
//条件查询弹出层
$scope.condition = function(){
toolsFactory.openDialog($scope, app.tplsBasePath + '#(pageModel)/#(fileDir)/condition.html');
}
//查询功能实现
$scope.query = function() { //点击查询 更新查询条件缓存
#if(pagePath == "verify")
$scope.queryCondition.verify = 1;
#end
$scope.pageOptions.param = angular.copy($scope.queryCondition);
$scope.pageOptions.reload = true;
toolsFactory.closeDialog();
yCommon.setCondition($scope.queryCondition);//预存查询条件
};
//回车键查询
$scope.keySearch = function(e){
var keycode = window.event ? e.keyCode : e.which;
if(keycode == 13){
$scope.query();
}
};
//重置按钮
$scope.reset = function() {
var queryCondition = $scope.queryCondition;
commonTools.resetQueryParmeter(queryCondition);
};
$scope.add = function(){
$scope.title = "#(remark) 添加";
$state.$go('#(pageModel).#(fileDir).edit',{});
}
$scope.detail = function(row){
$state.$go('#(pageModel).#(fileDir).detail',{row:row});
}
$scope.update = function(row){
$scope.title = "#(remark) 修改";
$state.$go('#(pageModel).#(fileDir).edit',{row:row});
}
pageInit();
}
]);
})

11
tpl/front/ServiceTpl.js Normal file
View File

@@ -0,0 +1,11 @@
/**
* Created by 恒安 on 2016/8/4.
*/
define(['app', 'config', 'system_constant', 'http_service'], function(app, config, system_constant) {
app.register.service("#(fileDir)Service", ["$resource", "httpResource", function($resource, httpResource) {
return {
#(beanFL)Service:httpResource.resource("/#(beanL)/:id",config.services.assetmag)
};
}])
})

View File

@@ -0,0 +1,58 @@
<div class="ngdialog-message">
<div class="modal-header">
<h4 class="modal-title">筛选</h4>
</div>
<div class="card">
<div class="card-block">
<div class="row t-martop">
#for(x : fieldList)
#if(x.filter == "1" || x.filter == "like")
<div class="col-lg-6">
<div class="form-group row">
<label class="col-md-4 col-form-label" for="#(x.field)">#(x.remark1)</label>
<div class="col-md-8">
#if(x.tag == "SELECT_EXT")
<select class="form-control" ng-model="queryCondition.#(x.field)">
<option value="">--请选择--</option>
<option id="#(x.field)" ng-repeat="m in dict('#(x.selects)')" value="{{m.key}}">{{m.value}}</option>
</select>
#else
<input id="#(x.field)" type="text" class="form-control" ng-model="queryCondition.#(x.field)" placeholder="#(x.remark1)" >
#end
</div>
</div>
</div>
#elseif(x.filter == "2")
<div class="col-lg-6">
<div class="form-group row">
<label class="col-md-4 col-form-label" for="start_#(x.field)">开始#(x.remark1)</label>
<div class="col-md-8">
<input id="start_#(x.field)" type="text" class="form-control" ng-model="queryCondition.start_#(x.field)" placeholder="开始#(x.remark1)" >
</div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group row">
<label class="col-md-4 col-form-label" for="start_#(x.field)">结束#(x.remark1)</label>
<div class="col-md-8">
<input id="end_#(x.field)" type="text" class="form-control" ng-model="queryCondition.end_#(x.field)" placeholder="结束#(x.remark1)" >
</div>
</div>
</div>
#end
#end
</div>
<div class="row t-martop">
<div class="col-lg-12">
<div style="margin-left:40%">
<button class="btn btn-primary mr-2 mb-2" ng-click="query(queryCondition)"> <i class="fa fa-arrow-right icon-on-right">查询</i>
</button>
<button class="btn btn-default mr-2 mb-2" ng-click="reset()"> <i class="fa fa-undo">重置</i>
</button>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,20 @@
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('#(fileDir)DetailCtrl', ["$scope", "rootMap", "$state", "yService", "toolsFactory","$stateParams","$sce","$http",
function($scope, rootMap, $state, yService, toolsFactory,$stateParams,$sce,$http) {
yService.initService("/#(beanL)");
yCommon.initScope($scope, $sce,rootMap,{},yService);
//页面加载
function pageInit() {
if($stateParams.params){
if($stateParams.params.row){
$scope.row = angular.copy($stateParams.params.row);
}
}
}
pageInit();
}
]);
})

57
tpl/front/detailTpl.html Normal file
View File

@@ -0,0 +1,57 @@
<!-- head -->
<style>
.boxBg {
width: 1060px;
background-size: 100% 100%;
overflow: hidden;
margin: 0 auto;
}
.mianContent {
margin: 0;
background-size: 100% 100%;
overflow: hidden;
padding: 17px 20px;
position: relative;
}
</style>
<div class="cat__core__top-sidebar cat__core__top-sidebar--bg">
<span class="cat__core__title"> <strong>#(remark)详情</strong>
</span>
<button class="btn btn-warning btn-circle mr-2 mb-2" onclick="javascript:history.back(-1);" style="float: right;margin-top: -12px;">
<i class="fa fa-reply">返回</i>&nbsp;
</button>
</div>
<!-- body -->
<div class="card-block animated bounceInRight">
<div class="card">
<div class="mianContent">
<div class="card-block">
<div class="row">
<div class="col-lg-12">
<div class="row table-responsive">
<table class="table table-hover nowrap table-bordered" width="100%" >
<tbody>
#set(i=0)
#for(x : fieldList)
#if(x.edit)
#if(i%2 == 0)
<tr>
#end
<th>#(x.remark1)</th>#set(i=i+1)
<td>{{ dealField(row, "#(x.field)") }}</td>
#if(i%2 == 0)
</tr>
#end
#end
#end
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

36
tpl/front/editCtrlTpl.js Normal file
View File

@@ -0,0 +1,36 @@
define(["app", "constant", "config", "yCommon","bootbox","common_tools", "dir_datepicker", "dir_paging", "yService", "dir_table_column_config", "tools_factory","dir_select","dir_file_upload"],
function(app, constant, config, yCommon, bootbox, commonTools) {
app.register.controller('#(fileDir)EditCtrl', ["$scope", "rootMap", "$state", "yService", "toolsFactory","$stateParams","$sce",
function($scope, rootMap, $state, yService, toolsFactory,$stateParams,$sce) {
yService.initService("/#(beanL)");
yCommon.initScope($scope, $sce,rootMap,{},yService);
$scope.model = {};
//页面加载
function pageInit() {
$scope.title="#(remark)编辑";
if($stateParams.params){
if($stateParams.params.row){
var row = angular.copy($stateParams.params.row);
#for(x : fieldList)
#if(x.edit == "1" && x.tag == "INPUT_DT")
row["#(x.field)"] = $scope.funs.dt(row["#(x.field)"]);
#end
#end
$scope.model = row;
$scope.title="#(remark)修改";
}
}
}
$scope.getSelection = function($event,id){
$scope.model.platformId = id;
toolsFactory.closeDialog();
};
pageInit();
}
]);
})

58
tpl/front/editTpl.html Normal file
View File

@@ -0,0 +1,58 @@
#if(hasEdit2)
<style>
.dropdown-menu{background:white;}
</style>
#end
<div class="cat__core__top-sidebar cat__core__top-sidebar--bg">
<div class="modal-header">
<h4 class="modal-title">{{title}}</h4>
</div>
<form ng-submit="submitForm(model)" id="#(beanFL)">
<div class="modal-body">
<div class="form-group row">
#for(x : fieldList)
#if(x.edit)
<!--#(x.remark1)-->
<div class="col-sm-6" style="padding-bottom: 20px">
<label class="col-md-8">#(x.remark1.replace(" ",""))</label>
<div class="col-md-11" #if(x.isMust)required #end>
#if(x.edit == "1")
#if(x.tag == "INPUT_DT")
<input type="text" class="form-control" placeholder="#(x.remark1)" id="#(x.field)" ng-model="model.#(x.field)" readonly calendar>
#elseif(x.tag == "SELECT")
<select ng-model="model.#(x.field)" class="form-control" #if(x.isMust)required #end>
<option value="">--请选择--</option>
<option ng-repeat='m in #(x.selects)' value="{{m.key}}">{{m.value}}</option>
</select>
#elseif(x.tag == "SELECT_EXT")
<select ng-model="model.#(x.field)" class="form-control" #if(x.isMust)required #end>
<option value="">--请选择--</option>
<option ng-repeat="m in dict('#(x.selects)')" value="{{m.key}}">{{m.value}}</option>
</select>
#elseif(x.tag == "TEXTAREA")
<textarea rows="3" class="form-control" placeholder="请输入#(x.remark1)" ng-model="model.#(x.field)"></textarea>
#elseif(x.tag == "FILE_EXT")
<input ng-file-select="onFileSelect($files, model, '#(x.selects)')" type="file">
#else
<input type="text" class="form-control" placeholder="" ng-model="model.#(x.field)">
#end
#elseif(x.edit == "2")
<select style="display:none" data-live-search="true" data-actions-box="true" ng-model="model.#(x.field)" class="form-control" multiple multiple-select event="optEvt" action="bbb(val)">
<option ng-repeat="m in dict('#(x.selects)')" value="{{m.key}}" on-finish-render-filters event="optEvt">{{m.value}}</option>
</select>
#end
</div>
</div>
#end
#end
</div>
</div>
<div class="modal-footer">
<div style="margin:0 auto">
<button style="position:relative; right:15px" type="submit" class="btn btn-sm btn-primary mr-2 mb-2"> <i class="fa fa-check icon-on-right"></i> 确认</button>
<button style="position:relative; left:15px" type="button" class="btn btn-sm btn-default mr-2 mb-2" ng-click="cancel()"> <i class="fa fa-close icon-on-right"></i> 取消</button>
</div>
</div>
</form>
</div>

115
tpl/front/ext/CtrlExtTpl.js Normal file
View 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();
}
]);
})

View 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>

72
tpl/front/listTpl.html Normal file
View File

@@ -0,0 +1,72 @@
<!-- head -->
<div class="cat__core__top-sidebar cat__core__top-sidebar--bg">
<span class="cat__core__title"> <strong>{{ cfg.title }}</strong></span>
</div>
<!-- body -->
<div class="card-block animated bounceInRight">
<div class="card">
<div class="card-block">
<div class="row t-martop">
<div class="col-lg-12">
<div class="form-group row">
<div class="col-md-3 pull-right">
<input type="text" class="form-control" ng-keyup="keySearch($event)" ng-model="queryCondition.condition" placeholder="{{cfg.conditionLabel}}">
</div>
<div class="col-md-9">
<button class="btn btn-primary mr-2 mb-2" ng-click="query()"><i class="fa fa-arrow-right icon-on-right">搜索</i></button>
<button type="button" class="btn btn-info mr-2 mb-2" ng-click="condition()"><i class="fa fa-search-plus icon-on-right">筛选</i></button>
<button type="button" class="btn btn-warning mr-2 mb-2"><i class="fa fa-download icon-on-right">导出</i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-block">
<div class="row">
<div class="col-lg-12">
<div class="mb-5">
<!-- 按钮区域-->
<div class="row">
<div class="col-lg-12" style="text-align: right;margin-left: 2px;">
<button type="button" class="btn btn-outline-primary mr-2 mb-2 btn-sm" ng-click="add()"><i class="fa fa-plus icon-on-left">添加</i></button>
<button type="button" class="btn btn-outline-success mr-2 mb-2 btn-sm" ><i class="fa fa-upload icon-on-left">导入</i></button>
<button type="button" class="btn btn-outline-secondary mr-2 mb-2 btn-sm" table-column-config data-target="rdTable" key="rdListCtrl"><i class="fa fa-cog icon-on-left">设置字段</i></button>
</div>
</div>
<!-- 按钮区域END-->
<!-- 表格区域-->
<div class="row table-responsive" style="min-height:400px">
<table class="table table-hover nowrap table-bordered" width="100%" id="rdTable" >
<thead>
<tr>
<th >序号</th>
<th title="操作">操作</th>
<th ng-repeat="field in cfg.field_label" title="{{ field }}">{{ field }}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in rows" on-finish-render-filters>
<td>{{pageOptions.param.startPosition + $index + 1}}</td>
<td>
<i class="fa fa-search-plus icon-info mr-2 mb-2" title="详情" ng-click="detail(row)"></i>
<i class="fa fa-pencil icon-primary mr-2" title="修改" ng-click="update(row)"></i>
<i class="fa fa-trash-o icon-danger mr-2" title="删除" ng-click="del(row.id)"></i>
</td>
<td ng-repeat="field in cfg.field" title="{{dealField(row, field)}}" ng-bind-html="dealField(row, field)"> </td>
</tr>
</tbody>
</table>
<paging action="operatePaging(total, rows)" options="pageOptions"></paging>
</div>
<!-- 表格区域END-->
</div>
</div>
</div>
</div>
</div>
</div>