提交 83bb03e0 编写于 作者: doc_wei's avatar doc_wei

报表模块----echarts模型配置新增分类属性

上级 41a82f5a
......@@ -10,13 +10,17 @@ layui.config({
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
reportModelTypeUtil.showModelTypeOperator(form, "typeBox", null, null);
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
fileName: $("#fileName").val(),
modelId: $("#modelId").val()
modelId: $("#modelId").val(),
firstTypeId: $("#firstTypeId").val(),
secondTypeId: $("#secondTypeId").val(),
};
AjaxPostUtil.request({url:reportBasePath + "reportimportmodel002", params: params, type:'json', method: "POST", callback:function(json){
if(json.returnCode == 0){
......
......@@ -20,6 +20,9 @@ layui.config({
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(j){
reportModelTypeUtil.showModelTypeOperator(form, "typeBox", j.bean.firstTypeId, j.bean.secondTypeId);
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
......@@ -27,6 +30,8 @@ layui.config({
var params = {
fileName: $("#fileName").val(),
modelId: $("#modelId").val(),
firstTypeId: $("#firstTypeId").val(),
secondTypeId: $("#secondTypeId").val(),
id: parent.rowId
};
AjaxPostUtil.request({url:reportBasePath + "reportimportmodel004", params: params, type:'json', method: "PUT", callback:function(json){
......
......@@ -26,12 +26,14 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'fileName', title: '文件名称', align: 'left', width: 250},
{ field: 'fileName', title: 'Echarts名称', align: 'left', width: 250},
{ field: 'modelId', title: '模型ID', align: 'left', width: 250 },
{ field: 'createName', title: '创建人', align: 'left', width: 100 },
{ field: 'createTime', title: '创建时间', align: 'center', width: 140 },
{ field: 'lastUpdateName', title: '最后修改人', align: 'left', width: 100 },
{ field: 'lastUpdateTime', title: '最后修改时间', align: 'center', width: 140},
{ field: 'firstTypeName', title: '一级分类', align: 'left', width: 120 },
{ field: 'secondTypeName', title: '二级分类', align: 'left', width: 120 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'}
]],
done: function(){
......
......@@ -10,19 +10,7 @@ layui.config({
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
showGrid({
id: "parentId",
url: reportBasePath + "reportmodeltype006",
params: {"parentId": 0},
pagination: false,
method: "GET",
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('select');
}
});
reportModelTypeUtil.loadModelType("parentId", getFileContent('tpl/template/select-option.tpl'), "0", form);
matchingLanguage();
form.render();
......
......@@ -21,20 +21,8 @@ layui.config({
},
ajaxSendAfter:function(j){
showGrid({
id: "parentId",
url: reportBasePath + "reportmodeltype006",
params: {"parentId": 0},
pagination: false,
method: "GET",
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
$("#parentId").val(j.bean.parentId);
form.render('select');
}
});
reportModelTypeUtil.loadModelType("parentId", getFileContent('tpl/template/select-option.tpl'), "0", form);
$("#parentId").val(j.bean.parentId);
matchingLanguage();
form.render();
......
......@@ -13,9 +13,9 @@
<span class="hr-title">基础信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">文件名称<i class="red">*</i></label>
<label class="layui-form-label">Echarts名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="fileName" name="fileName" win-verify="required" placeholder="请输入文件名称" class="layui-input" maxlength="50"/>
<input type="text" id="fileName" name="fileName" win-verify="required" placeholder="请输入Echarts名称" class="layui-input" maxlength="50"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
......@@ -24,6 +24,9 @@
<input type="text" id="modelId" name="modelId" win-verify="required" placeholder="请输入模型ID" class="layui-input" maxlength="100"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12" id="typeBox">
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
......
......@@ -19,9 +19,9 @@
<span class="hr-title">基础信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">文件名称<i class="red">*</i></label>
<label class="layui-form-label">Echarts名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="fileName" name="fileName" win-verify="required" placeholder="请输入文件名称" class="layui-input" maxlength="50" value="{{fileName}}"/>
<input type="text" id="fileName" name="fileName" win-verify="required" placeholder="请输入Echarts名称" class="layui-input" maxlength="50" value="{{fileName}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
......@@ -29,6 +29,9 @@
<div class="layui-input-block">
<input type="text" id="modelId" name="modelId" win-verify="required" placeholder="请输入模型ID" class="layui-input" maxlength="100" value="{{modelId}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12" id="typeBox">
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
......
......@@ -11,9 +11,9 @@
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">文件名称</label>
<label class="layui-form-label">Echarts名称</label>
<div class="layui-input-inline">
<input type="text" id="fileName" name="fileName" placeholder="请输入文件名称" class="layui-input" />
<input type="text" id="fileName" name="fileName" placeholder="请输入Echarts名称" class="layui-input" />
</div>
<label class="layui-form-label">模型ID</label>
<div class="layui-input-inline">
......
......@@ -4,7 +4,7 @@ var reportModelTypeUtil = {
modelTypeChooseHtml: '<div class="layui-form-item layui-col-xs6">\n' +
' <label class="layui-form-label">一级分类<i class="red">*</i></label>\n' +
' <div class="layui-input-block">\n' +
' <select id="firstTypeId" lay-filter="firstTypeId" lay-search="">\n' +
' <select id="firstTypeId" lay-filter="firstTypeId" lay-search="" win-verify="required">\n' +
' <option value="">请选择</option>\n' +
' </select>\n' +
' </div>\n' +
......@@ -12,22 +12,64 @@ var reportModelTypeUtil = {
' <div class="layui-form-item layui-col-xs6">\n' +
' <label class="layui-form-label">二级分类<i class="red">*</i></label>\n' +
' <div class="layui-input-block">\n' +
' <select id="secondTypeId" lay-filter="secondTypeId" lay-search="">\n' +
' <select id="secondTypeId" lay-filter="secondTypeId" lay-search="" win-verify="required">\n' +
' <option value="">请选择</option>\n' +
' </select>\n' +
' </div>\n' +
' </div>',
/**
*
* 加载模型分类选择的html
*
* @param form form对象
* @param showTemplate 数据的模板
* @param boxId 加载的目标dom的id
* @param firstTypeId 一级分类id
* @param secondTypeId 二级分类id
*/
showModelTypeOperator: function (form, showTemplate, boxId){
showModelTypeOperator: function (form, boxId, firstTypeId, secondTypeId) {
$("#" + boxId).html(reportModelTypeUtil.modelTypeChooseHtml);
var selOption = getFileContent('tpl/template/select-option.tpl');
// 加载一级模型分类
reportModelTypeUtil.loadModelType("firstTypeId", selOption, "0", form);
if (!isNull(firstTypeId)) {
$("#firstTypeId").val(firstTypeId);
// 加载二级模型分类
reportModelTypeUtil.loadModelType("secondTypeId", selOption, firstTypeId, form);
}
if (!isNull(secondTypeId)) {
$("#secondTypeId").val(secondTypeId);
}
form.render('select');
form.on('select(firstTypeId)', function (data) {
var value = data.value;
// 加载二级模型分类
reportModelTypeUtil.loadModelType("secondTypeId", selOption, value, form);
});
},
/**
* 获取模型分类信息
*
* @param id 展示对象id
* @param template 模板
* @param parentId 父id
* @param form form对象
*/
loadModelType: function (id, template, parentId, form) {
showGrid({
id: id,
url: reportBasePath + "reportmodeltype006",
params: {"parentId": parentId},
pagination: false,
method: "GET",
template: template,
ajaxSendLoadBefore: function (hdb) {
},
ajaxSendAfter: function (json) {
form.render('select');
}
});
}
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册