diff --git a/report/src/main/resources/template/js/reportImportModel/reportImportModelAdd.js b/report/src/main/resources/template/js/reportImportModel/reportImportModelAdd.js index 0d7eace8f985445732dfb638fb3708e4a7748b47..8060bc006d4df2b3746137bbb4dc889b77211f81 100644 --- a/report/src/main/resources/template/js/reportImportModel/reportImportModelAdd.js +++ b/report/src/main/resources/template/js/reportImportModel/reportImportModelAdd.js @@ -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){ diff --git a/report/src/main/resources/template/js/reportImportModel/reportImportModelEdit.js b/report/src/main/resources/template/js/reportImportModel/reportImportModelEdit.js index 0cd64550ed2c23b61c63e2760f0d8329b898ea21..f1ab51bf6df0ee96ec536006f35b9c5b17ba5bc9 100644 --- a/report/src/main/resources/template/js/reportImportModel/reportImportModelEdit.js +++ b/report/src/main/resources/template/js/reportImportModel/reportImportModelEdit.js @@ -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){ diff --git a/report/src/main/resources/template/js/reportImportModel/reportImportModelList.js b/report/src/main/resources/template/js/reportImportModel/reportImportModelList.js index ece03c0cf9920bb335960f88520489a538d4bae2..6d800ce35123c227809d14787fadde3539e78371 100644 --- a/report/src/main/resources/template/js/reportImportModel/reportImportModelList.js +++ b/report/src/main/resources/template/js/reportImportModel/reportImportModelList.js @@ -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(){ diff --git a/report/src/main/resources/template/js/reportModelType/reportModelTypeAdd.js b/report/src/main/resources/template/js/reportModelType/reportModelTypeAdd.js index d9e1d4f91453dbebda8dac5875b198c4c0b99a77..db7e23739015404c0461638aa2f07406de8b6181 100644 --- a/report/src/main/resources/template/js/reportModelType/reportModelTypeAdd.js +++ b/report/src/main/resources/template/js/reportModelType/reportModelTypeAdd.js @@ -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(); diff --git a/report/src/main/resources/template/js/reportModelType/reportModelTypeEdit.js b/report/src/main/resources/template/js/reportModelType/reportModelTypeEdit.js index 55a9d0be5678b13e96c2f2f1e13db3baee7ce761..0af54262acc3a62d7e52fa9bc43ed1f551c7d9fa 100644 --- a/report/src/main/resources/template/js/reportModelType/reportModelTypeEdit.js +++ b/report/src/main/resources/template/js/reportModelType/reportModelTypeEdit.js @@ -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(); diff --git a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelAdd.html b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelAdd.html index 971dcfb189e3dac9cb52d71342fce453c7686c58..180a13bd4ba330408b87a50841c693cce853c79d 100644 --- a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelAdd.html +++ b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelAdd.html @@ -13,9 +13,9 @@ 基础信息
- +
- +
@@ -24,6 +24,9 @@
+
+ +
diff --git a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelEdit.html b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelEdit.html index ac3c149c5693e674234b8e4b0a7a4a686ce34227..5777dba18252ad5d1e9436336612db4658b52065 100644 --- a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelEdit.html +++ b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelEdit.html @@ -19,9 +19,9 @@ 基础信息
- +
- +
@@ -29,6 +29,9 @@
+
+
+
diff --git a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelList.html b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelList.html index 6f7c4c1f46ed38bf137cf78fbe527d6874a1c583..4fa8ad9ff026e991770fd2e502fefa88ea7effb8 100644 --- a/report/src/main/resources/template/tpl/reportImportModel/reportImportModelList.html +++ b/report/src/main/resources/template/tpl/reportImportModel/reportImportModelList.html @@ -11,9 +11,9 @@
- +
- +
diff --git a/web/src/main/resources/template/assets/lib/layui/customer/reportModelTypeUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/reportModelTypeUtil.js index c36caf7f98b91e6d4338628b3031fc5f8e3a938f..4e71ce5c4de6612307a3771b4fe868be100597eb 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/reportModelTypeUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/reportModelTypeUtil.js @@ -4,7 +4,7 @@ var reportModelTypeUtil = { modelTypeChooseHtml: '
\n' + ' \n' + '
\n' + - ' \n' + ' \n' + ' \n' + '
\n' + @@ -12,22 +12,64 @@ var reportModelTypeUtil = { '
\n' + ' \n' + '
\n' + - ' \n' + ' \n' + ' \n' + '
\n' + '
', /** + * * 加载模型分类选择的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