var objectKey = ""; var objectId = ""; layui.config({ base: basePath, version: skyeyeVersion }).extend({ window: 'js/winui.window' }).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { winui.renderColor(); var $ = layui.$, form = layui.form, table = layui.table; objectKey = GetUrlParam("objectKey"); objectId = GetUrlParam("objectId"); id = GetUrlParam("id"); if (isNull(objectKey) || isNull(objectId)) { winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); return false; } table.render({ id: 'messageTable', elem: '#messageTable', method: 'post', url: sysMainMation.schoolBasePath + 'queryTopicCommentList', where: getTableParams(), even: false, page: false, cols: [[ { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, // { field: 'title', title: '标题', align: 'left', width: 300}, { field: 'content', title: '内容', align: 'left', width: 300}, { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 , templet: function(d) { return getNotUndefinedVal(d.createMation?.name); }}, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 , templet: function(d) { return getNotUndefinedVal(d.lastUpdateName); }}, { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 257, toolbar: '#tableBar' } ]], done: function(json) { matchingLanguage(); initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入名称", function () { table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); }); } }); table.on('tool(messageTable)', function (obj) { var data = obj.data; var layEvent = obj.event; if (layEvent === 'del') { //删除 del(data); } }); // 删除 function del(data, obj) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { layer.close(index); AjaxPostUtil.request({url: sysMainMation.schoolBasePath + "deleteTopicCommentById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); }); } form.render(); $("body").on("click", "#reloadTable", function() { loadTable(); }); function loadTable() { table.reloadData("messageTable", {where: getTableParams()}); } function getTableParams() { return $.extend(true, {objectKey: objectKey, objectId: objectId,holderId: id}, initTableSearchUtil.getSearchValue("messageTable")); } exports('details', {}); });