/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2022-02-23 10:46 * 描 述:人事模板配置 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/Form?type=2', width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/Form?type=2&keyValue=' + keyValue, width: 600, height: 400, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/LR_Desktop/EnrollTemplate/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); //文件预览 $('#lr-preview').on('click', function () { var keyValue = $("#gridtable").jfGridValue("Id"); var Path = $("#gridtable").jfGridValue("Path"); if (keyValue) { learun.layerForm({ id: 'PreviewForm', title: '文件预览', url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + Path, width: 1080, height: 850, btn: null, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } else { learun.alert.warning('请选择要预览的文件!'); } }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/GetPageList', headData: [ { label: "模板名称", name: "Name", width: 200, align: "left" }, { label: "文件名称", name: "F_FileName", width: 200, align: "left" }, //{ label: "模板上传", name: "Path", width: 100, align: "left"}, { label: "是否启用", name: "Enabled", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == 1 ? "" : ""; } }, { label: "备注", name: "Remark", width: 200, align: "left" }, ], mainId: 'Id', isPage: true }); page.search(); }, search: function (param) { param = param || {}; param.Type = 2; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }