.
This commit is contained in:
126
tpl/ActionTpl.java
Normal file
126
tpl/ActionTpl.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package #(pkg).controller;
|
||||
|
||||
import com.eversec.common.AbstractBaseController;
|
||||
import com.eversec.common.JBean;
|
||||
import com.eversec.common.Domain;
|
||||
import #(pkg).domain.#(bean);
|
||||
import #(pkg).service.#(bean)Service;
|
||||
import com.eversec.framework.core.data.QueryResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
#if(hasDate)
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
#end
|
||||
|
||||
/**
|
||||
* 类名称: #(bean)Controller<br>
|
||||
* 类描述: #(remark)<br>
|
||||
* 修改时间: #(ctime)<br>
|
||||
* @author #(author)
|
||||
*/
|
||||
@Api(tags = "#(remark)")
|
||||
@RestController
|
||||
public class #(bean)Controller extends AbstractBaseController {
|
||||
@Autowired
|
||||
private #(bean)Service #(beanFL)Service;
|
||||
|
||||
@ApiOperation(value = "新增操作", notes = "新增")
|
||||
@RequestMapping(value = "/#(beanL)", method = RequestMethod.POST)
|
||||
public String save(@RequestBody #(bean) #(beanFL)) {
|
||||
JBean jBean = JBean.by(200, "成功", "");
|
||||
try {
|
||||
#(beanFL)Service.insert(#(beanFL));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
jBean.set(-1, "操作失败");
|
||||
}
|
||||
return jBean.toJson();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "列表数据", notes = "统计列表数据")
|
||||
@RequestMapping(value = "/#(beanL)", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public String tolistPage(HttpServletRequest request) {
|
||||
#(bean) m = new #(bean)();
|
||||
|
||||
//查询条件
|
||||
setCommonAttr(request, m);
|
||||
#if(hasDate)
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
#end
|
||||
|
||||
#for(x : fieldList)
|
||||
#set(field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
,toUpperCaseFirst = field.substring(0, 1).toUpperCase() + field.substring(1)
|
||||
)
|
||||
#if((x.filter == "1" || x.filter == "like") && x.field != "tru" )
|
||||
#if(x.fieldType == "Long")
|
||||
if (!isEmpty(request.getParameter("#(field)"))) {
|
||||
m.set#(toUpperCaseFirst)(Long.parseLong(request.getParameter("#(field)")));
|
||||
}
|
||||
#elseif(x.fieldType == "Integer")
|
||||
if (!isEmpty(request.getParameter("#(field)"))) {
|
||||
m.set#(toUpperCaseFirst)(Integer.parseInt(request.getParameter("#(field)")));
|
||||
}
|
||||
#elseif(x.fieldType == "Date")
|
||||
if (!isEmpty(request.getParameter("#(field)"))) {
|
||||
try {
|
||||
m.set#(toUpperCaseFirst)(sdf.parse(request.getParameter("#(field)")));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
#else
|
||||
m.set#(toUpperCaseFirst)(request.getParameter("#(field)"));
|
||||
#end
|
||||
#elseif(x.filter == "2")
|
||||
try {
|
||||
if (!isEmpty(request.getParameter("start_#(field)"))) {
|
||||
m.setExtPara("start_#(field)", sdf.parse(request.getParameter("start_#(field)")));
|
||||
}
|
||||
if (!isEmpty(request.getParameter("end_#(field)"))) {
|
||||
m.setExtPara("end_#(field)", sdf.parse(request.getParameter("end_#(field)")));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
#end
|
||||
#end
|
||||
|
||||
QueryResult pageBean = #(beanFL)Service.findPage(m);
|
||||
return JBean.by(200, "成功", pageBean).toJson();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询一条记录", notes = "查询一条记录")
|
||||
@RequestMapping(value = "/#(beanL)/findfirst", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public String findFirst(HttpServletRequest request) {
|
||||
#(bean) m = new #(bean)();
|
||||
|
||||
//查询条件
|
||||
setCommonAttr(request, m);
|
||||
|
||||
Domain domain = #(beanFL)Service.findFirst(m);
|
||||
return JBean.by(200, "成功", domain).toJson();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除")
|
||||
@RequestMapping(path = "/#(beanL)/{id}", method = RequestMethod.DELETE)
|
||||
public String delete(@ApiParam(value = "主键ID", required = true) @PathVariable final Long id) {
|
||||
|
||||
#(beanFL)Service.deleteById(id);
|
||||
return JBean.by(200, "成功").toJson();
|
||||
}
|
||||
}
|
42
tpl/BeanTpl.java
Normal file
42
tpl/BeanTpl.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package #(pkg).domain;
|
||||
|
||||
import com.eversec.common.Domain;
|
||||
#if(hasDate)
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
#end
|
||||
|
||||
/**
|
||||
* 类名称: #(bean)<br>
|
||||
* 类描述: #(remark)<br>
|
||||
* 修改时间: #(ctime)<br>
|
||||
* @author #(author)
|
||||
*/
|
||||
public class #(bean) extends Domain {
|
||||
|
||||
#for(x : fieldList)
|
||||
#set(field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
)
|
||||
#if(x.fieldType == "Date")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#end
|
||||
private #(x.fieldType) #(field); //#(x.remark)
|
||||
#end
|
||||
|
||||
#for(x : fieldList)
|
||||
#set(field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
,toUpperCaseFirst = field.substring(0, 1).toUpperCase() + field.substring(1)
|
||||
)
|
||||
public #(x.fieldType) get#(toUpperCaseFirst)() {
|
||||
return #(field);
|
||||
}
|
||||
|
||||
public void set#(toUpperCaseFirst)(#(x.fieldType) #(field)) {
|
||||
this.#(field) = #(field);
|
||||
}
|
||||
|
||||
#end
|
||||
}
|
13
tpl/DictSqlTpl.sql
Normal file
13
tpl/DictSqlTpl.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
#for(m : maps)
|
||||
#set(
|
||||
arr = m.key.split("[|]"),
|
||||
remark = arr.length >= 2 ? arr[1] : arr[0],
|
||||
dic_type = arr.length >= 3 ? arr[2] : remark
|
||||
)
|
||||
# #(arr[0]).#(remark)
|
||||
INSERT INTO `sys_cfg_dictionary`(app_id,dic_key,dic_value,dic_type,remark) VALUES
|
||||
#for(x : m.value)
|
||||
(23, "#(x.code)", "#(x.name)","#(dic_type)","#(remark)")#if(for.last);#else ,#end
|
||||
#end
|
||||
|
||||
#end
|
13
tpl/MapperTpl.java
Normal file
13
tpl/MapperTpl.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package #(pkg).dao;
|
||||
|
||||
import #(pkg).domain.#(bean);
|
||||
import com.eversec.common.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* Created by #(author) at #(ctime).
|
||||
*/
|
||||
@Mapper
|
||||
public interface #(bean)Mapper extends BaseMapper<#(bean)> {
|
||||
|
||||
}
|
142
tpl/MapperTpl.xml
Normal file
142
tpl/MapperTpl.xml
Normal file
@@ -0,0 +1,142 @@
|
||||
#define buildIF(x)
|
||||
<if test="#(x.field) != null#if((!x.isNumber)) and #(x.field) != ''#end">
|
||||
#end
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="#(pkg).dao.#(bean)Mapper">
|
||||
<!-- insert -->
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="#(pkg).domain.#(bean)">
|
||||
insert into #(table)
|
||||
(#for(x : fields)`#(x.field)`#if(!for.last),#end #end)
|
||||
values
|
||||
(#for(x : fields)#{#(x.field)}#if(!for.last),#end #end)
|
||||
</insert>
|
||||
|
||||
<!-- findCount -->
|
||||
<select id="findCount" parameterType="#(pkg).domain.#(bean)" resultType="Long">
|
||||
select count(1) from #(table) where 1=1
|
||||
|
||||
<!-- 加入查询条件 -->
|
||||
#if(condition && condition.length > 0)
|
||||
<if test="condition != null and condition != ''">
|
||||
and (
|
||||
#for(x : condition)
|
||||
#if(x)
|
||||
#set(str=x)
|
||||
#(str.substring(0, 1).toLowerCase() + str.substring(1)) like CONCAT('%',#{condition},'%') #if(!for.last)or #end
|
||||
#end
|
||||
#end
|
||||
)
|
||||
</if>
|
||||
#end
|
||||
|
||||
#for(x : fields)
|
||||
#if(x.filter == "1")
|
||||
#@buildIF(x)
|
||||
and `#(x.field)` = #{#(x.field)}
|
||||
</if>
|
||||
#elseif(x.filter == "like")
|
||||
#@buildIF(x)
|
||||
and `#(x.field)` like CONCAT('%',#{#(x.field)},'%')
|
||||
</if>
|
||||
#elseif(x.filter == "2")
|
||||
<if test="extPara != null and extPara.start_#(x.field) != null">
|
||||
and `datatime` > #{start_#(x.field)}
|
||||
</if>
|
||||
<if test="extPara != null and extPara.end_#(x.field) != null">
|
||||
and `datatime` < #{start_#(x.field)}
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
#if(verify)
|
||||
<if test="extPara != null and extPara.verify != null">
|
||||
and id in (
|
||||
select ids from (
|
||||
select group_concat(id) ids,count(*) count from #(table) where `status` !=9 group by
|
||||
#(verify)
|
||||
) n where n.count > 1
|
||||
)
|
||||
</if>
|
||||
#end
|
||||
and `status` != 9
|
||||
</select>
|
||||
|
||||
<!-- findList -->
|
||||
<select id="findList" parameterType="java.util.Map" resultType="#(pkg).domain.#(bean)">
|
||||
select
|
||||
#for(x : fields)`#(x.field)`#if(!for.last),#end #end
|
||||
from #(table) where 1=1
|
||||
|
||||
<!-- 加入查询条件 -->
|
||||
#if(condition)
|
||||
<if test="condition != null and condition != ''">
|
||||
and (
|
||||
#for(x : condition)
|
||||
#if(x)
|
||||
#(x.substring(0, 1).toLowerCase() + x.substring(1)) like CONCAT('%',#{condition},'%') #if(!for.last)or #end
|
||||
#end
|
||||
#end
|
||||
)
|
||||
</if>
|
||||
#end
|
||||
|
||||
#for(x : fields)
|
||||
#if(x.filter == "1")
|
||||
#@buildIF(x)
|
||||
and `#(x.field)` = #{#(x.field)}
|
||||
</if>
|
||||
#elseif(x.filter == "like")
|
||||
#@buildIF(x)
|
||||
and `#(x.field)` like CONCAT('%',#{#(x.field)},'%')
|
||||
</if>
|
||||
#elseif(x.filter == "2")
|
||||
<if test="extPara != null and extPara.start_#(x.field) != null">
|
||||
and `datatime` > #{start_#(x.field)}
|
||||
</if>
|
||||
<if test="extPara != null and extPara.end_#(x.field) != null">
|
||||
and `datatime` < #{start_#(x.field)}
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
|
||||
#if(verify)
|
||||
<if test="extPara != null and extPara.verify != null">
|
||||
and id in (
|
||||
select ids from (
|
||||
select group_concat(id) ids,count(*) count from #(table) where `status` !=9 group by
|
||||
#(verify)
|
||||
) n where n.count > 1
|
||||
)
|
||||
</if>
|
||||
#end
|
||||
and `status` != 9
|
||||
<if test="maxResult != null and maxResult != ''">
|
||||
#(order) limit #{startPosition},#{maxResult}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- update -->
|
||||
<update id="update" parameterType="#(pkg).domain.#(bean)">
|
||||
update #(table)
|
||||
set
|
||||
id=id
|
||||
#for(x : fields)
|
||||
<if test="#(x.field) != null">
|
||||
,`#(x.field)`=#{#(x.field)}
|
||||
</if>
|
||||
#end
|
||||
where `id`=#{id}
|
||||
</update>
|
||||
|
||||
<!-- deleteById 程序中只提供逻辑删除 -->
|
||||
<delete id="deleteById" parameterType="Long">
|
||||
update #(table) set status=9 where id=#{id}
|
||||
</delete>
|
||||
|
||||
<!-- findById -->
|
||||
<select id="findById" parameterType="Long" resultType="#(pkg).domain.#(bean)">
|
||||
select #for(x : fields)#(x.field)#if(!for.last), #end #end
|
||||
from #(table) where id=#{id}
|
||||
</select>
|
||||
</mapper>
|
26
tpl/ServiceImpTpl.java
Normal file
26
tpl/ServiceImpTpl.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package #(pkg).service.impl;
|
||||
|
||||
import #(pkg).domain.#(bean);
|
||||
import com.eversec.common.AbstractBaseService;
|
||||
import com.eversec.common.BaseMapper;
|
||||
import #(pkg).dao.#(bean)Mapper;
|
||||
import #(pkg).service.#(bean)Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 类名称: #(bean)<br>
|
||||
* 类描述: #(remark)<br>
|
||||
* 修改时间: #(ctime)<br>
|
||||
* @author #(author)
|
||||
*/
|
||||
@Service
|
||||
public class #(bean)ServiceImpl extends AbstractBaseService<#(bean)> implements #(bean)Service {
|
||||
@Autowired
|
||||
private #(bean)Mapper #(beanFL)Mapper;
|
||||
|
||||
@Override
|
||||
public BaseMapper getMapper() {
|
||||
return #(beanFL)Mapper;
|
||||
}
|
||||
}
|
19
tpl/SqlTpl.sql
Normal file
19
tpl/SqlTpl.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
##(remark)
|
||||
# drop table if exists `#(tableName)`;
|
||||
CREATE TABLE `#(tableName)` (
|
||||
`id` bigint(20) auto_increment comment '主键',
|
||||
#for(x : fieldList)
|
||||
#set(
|
||||
field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
,isMust = x.isMust? "not null" : ""
|
||||
,autoIncrement = "id".equals(field)? "auto_increment" : ""
|
||||
)
|
||||
#if(field != "id")
|
||||
`#(field)` #(x.fieldType) #(isMust) #(autoIncrement) comment '#(x.remark)',
|
||||
#end
|
||||
#end
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '#(remark)';
|
||||
|
||||
|
42
tpl/Table2BeanTpl.java
Normal file
42
tpl/Table2BeanTpl.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package #(pkg).domain;
|
||||
|
||||
import com.eversec.common.Domain;
|
||||
#if(hasDate)
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
#end
|
||||
|
||||
/**
|
||||
* 类名称: #(clazzName)<br>
|
||||
* 类描述: #(comment)<br>
|
||||
* 修改时间: #(ctime)<br>
|
||||
* @author #(author)
|
||||
*/
|
||||
public class #(clazzName) extends Domain {
|
||||
|
||||
#for(x : fields)
|
||||
#set(field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
)
|
||||
#if(x.type == "Date")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
#end
|
||||
private #(x.fieldType) #(field); //#(x.remark1)
|
||||
#end
|
||||
|
||||
#for(x : fields)
|
||||
#set(field=x.field
|
||||
,field=field.substring(0, 1).toLowerCase() + field.substring(1)
|
||||
,toUpperCaseFirst = field.substring(0, 1).toUpperCase() + field.substring(1)
|
||||
)
|
||||
public #(x.fieldType) get#(toUpperCaseFirst)() {
|
||||
return #(field);
|
||||
}
|
||||
|
||||
public void set#(toUpperCaseFirst)(#(x.fieldType) #(field)) {
|
||||
this.#(field) = #(field);
|
||||
}
|
||||
|
||||
#end
|
||||
}
|
100
tpl/front/CtrlTpl.js
Normal file
100
tpl/front/CtrlTpl.js
Normal 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
11
tpl/front/ServiceTpl.js
Normal 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)
|
||||
};
|
||||
}])
|
||||
})
|
58
tpl/front/conditionTpl.html
Normal file
58
tpl/front/conditionTpl.html
Normal 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>
|
20
tpl/front/detailCtrlTpl.js
Normal file
20
tpl/front/detailCtrlTpl.js
Normal 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
57
tpl/front/detailTpl.html
Normal 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>
|
||||
</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
36
tpl/front/editCtrlTpl.js
Normal 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
58
tpl/front/editTpl.html
Normal 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
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>
|
72
tpl/front/listTpl.html
Normal file
72
tpl/front/listTpl.html
Normal 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>
|
175
tpl/wordTpl.xml
Normal file
175
tpl/wordTpl.xml
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user