提交 6d7017b7 编写于 作者: Skyeye云's avatar Skyeye云

支持通过修改属性去修改提交参数

上级 a9fc0953
...@@ -157,7 +157,7 @@ layui.config({ ...@@ -157,7 +157,7 @@ layui.config({
var params = { var params = {
title: $("#title").html(), title: $("#title").html(),
remark: $("#remark").val(), remark: $("#remark").val(),
assetArticles: JSON.stringify(tableData), applyUseLnk: JSON.stringify(tableData),
enclosureInfo: JSON.stringify({enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')}), enclosureInfo: JSON.stringify({enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')}),
formSubType: subType, formSubType: subType,
approvalId: approvalId approvalId: approvalId
......
...@@ -31,7 +31,7 @@ layui.config({ ...@@ -31,7 +31,7 @@ layui.config({
initTable(); initTable();
initTableChooseUtil.deleteAllRow('articlesList'); initTableChooseUtil.deleteAllRow('articlesList');
$.each(json.bean.assetArticles, function(i, item) { $.each(json.bean.applyUseLnk, function(i, item) {
var list = findArticlesByTypeId(item.assetArticles.typeId); var list = findArticlesByTypeId(item.assetArticles.typeId);
var params = { var params = {
"typeId": { "typeId": {
...@@ -188,7 +188,7 @@ layui.config({ ...@@ -188,7 +188,7 @@ layui.config({
id: parent.rowId, id: parent.rowId,
title: $("#title").html(), title: $("#title").html(),
remark: $("#remark").val(), remark: $("#remark").val(),
assetArticles: JSON.stringify(tableData), applyUseLnk: JSON.stringify(tableData),
enclosureInfo: JSON.stringify({enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')}), enclosureInfo: JSON.stringify({enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')}),
formSubType: subType, formSubType: subType,
approvalId: approvalId, approvalId: approvalId,
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</tr> </tr>
</thead> </thead>
<tbody id="useTable" class="insurance-table"> <tbody id="useTable" class="insurance-table">
{{#each assetArticles}} {{#each applyUseLnk}}
<tr> <tr>
<td>{{assetArticles.typeName}}</td> <td>{{assetArticles.typeName}}</td>
<td>{{assetArticles.name}}</td> <td>{{assetArticles.name}}</td>
......
...@@ -23,7 +23,7 @@ layui.config({ ...@@ -23,7 +23,7 @@ layui.config({
elem: '#messageTable', elem: '#messageTable',
method: 'post', method: 'post',
url: reqBasePath + 'queryAttrDefinitionList', url: reqBasePath + 'queryAttrDefinitionList',
where: {className: objectId}, where: getTableParams(),
even: true, even: true,
page: false, page: false,
limits: getLimits(), limits: getLimits(),
...@@ -46,14 +46,61 @@ layui.config({ ...@@ -46,14 +46,61 @@ layui.config({
return ''; return '';
} }
return ''; return '';
}} }},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 120, toolbar: '#tableBar' }
]], ]],
done: function(json) { done: function(json) {
matchingLanguage(); matchingLanguage();
} }
}); });
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { // 编辑
edit(data);
} else if (layEvent === 'restore') { // 还原
restore(data);
}
});
// 删除
function restore(data) {
layer.confirm('还原操作', {icon: 3, title: '确定还原该数据吗?'}, function (index) {
layer.close(index);
var params = {
className: objectId,
attrKey: data.attrKey
};
AjaxPostUtil.request({url: flowableBasePath + "deleteAttrDefinitionCustom", params: params, type: 'json', method: 'DELETE', callback: function (json) {
winui.window.msg('还原成功', {icon: 1, time: 2000});
loadTable();
}});
});
}
// 编辑
function edit(data) {
_openNewWindows({
url: "../../tpl/attr/writeAttr.html?className=" + objectId + '&attrKey=' + data.attrKey,
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "writeAttr",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}
});
}
form.render(); form.render();
function loadTable() {
table.reloadData("messageTable", {where: getTableParams()});
}
function getTableParams() {
return {className: objectId};
}
exports('attrList', {}); exports('attrList', {});
}); });
\ No newline at end of file
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
<body> <body>
<div style="margin:auto 10px;"> <div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# if(!isNull(d.attrDefinitionCustomId)) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="restore">还原</a>
{{# } }}
</script>
</div> </div>
<script src="../../assets/lib/layui/layui.js"></script> <script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script> <script src="../../assets/lib/layui/custom.js"></script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册