From 96863a61704cd88c198e8c3de2de437f65c2c9f7 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 17 Jan 2022 15:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=91=8A=E5=8F=91=E5=B8=83=E6=9D=83?= =?UTF-8?q?=E9=99=90=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E9=80=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DepartmentReleasePermissions/Index.js | 65 +++++++++++++------ 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/DepartmentReleasePermissions/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/DepartmentReleasePermissions/Index.js index 66a0baee9..e56261ee0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/DepartmentReleasePermissions/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Permission/Views/DepartmentReleasePermissions/Index.js @@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#DepartmentID').lrDataSourceSelect({ code: 'classdata',value: 'id',text: 'name' }); + $('#DepartmentID').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -29,7 +29,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'form1', title: '新增', - url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Form?departmentId='+departmentId, + url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/Form?departmentId=' + departmentId, width: 600, height: 400, callBack: function (id) { @@ -59,7 +59,7 @@ var bootstrap = function ($, learun) { if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/Permission/DepartmentReleasePermissions/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/Permission/DepartmentReleasePermissions/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -72,29 +72,52 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/Permission/DepartmentReleasePermissions/GetPageList', headData: [ - { label: "发布人员", name: "UserID", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', - key: value, - keyId: 'f_userid', - callback: function (_data) { - callback(_data['f_realname']); - } - }); - }}, - { label: "公告类型", name: "Permission", width: 100, align: "left", + { + label: "发布人员", name: "UserID", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getsAsync('dataItem', { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', key: value, - code: 'NoticeCategory', + keyId: 'f_userid', callback: function (_data) { - callback(_data); + callback(_data['f_realname']); } }); - }}, + } + }, + { + label: "公告类型", name: "Permission", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + if (value && value.indexOf(',') != -1) { + var content = ''; + var texts = value.split(','); + for (var i = 0; i < texts.length; i++) { + learun.clientdata.getAsync('dataItem', + { + key: texts[i], + code: 'NoticeCategory', + callback: function (_data) { + content += _data.text + ','; + + } + }); + } + content = content.substring(0, content.length - 1); + callback(content); + } else { + learun.clientdata.getAsync('dataItem', + { + key: value, + code: 'NoticeCategory', + callback: function (_data) { + callback(_data.text); + } + }); + } + } + }, ], - mainId:'ID', + mainId: 'ID', isPage: true }); page.search(); @@ -102,7 +125,7 @@ var bootstrap = function ($, learun) { search: function (param) { param = param || {}; param.DepartmentID = departmentId; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () {