diff --git a/application/admin/controller/oa/Doc.php b/application/admin/controller/oa/Doc.php index db9759a..317fc05 100644 --- a/application/admin/controller/oa/Doc.php +++ b/application/admin/controller/oa/Doc.php @@ -88,9 +88,20 @@ class Doc extends Backend ->order($sort, $order) ->paginate($limit); + $groupName = AuthGroup::column('id,name'); + foreach ($list as $k => $row) { $list[$k]['fileurl'] = cdnurl($row['path']); $list[$k]['filetype'] = pathinfo($list[$k]['fileurl'], PATHINFO_EXTENSION); + + $groupIds = $row['group_ids']; + $groupIds = json_decode($groupIds); + $groupText = ''; + foreach ($groupIds as $groupId) { + $groupText .= $groupName[$groupId] ?? ''; + $groupText .= ','; + } + $list[$k]['group_text'] = $groupText; } $result = ['total' => $list->total(), 'rows' => $list->items()]; diff --git a/public/assets/js/backend/oa/doc.js b/public/assets/js/backend/oa/doc.js index a4dda4e..19dd754 100644 --- a/public/assets/js/backend/oa/doc.js +++ b/public/assets/js/backend/oa/doc.js @@ -26,6 +26,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, + { + field: 'group_text', + title: '角色组', + operate: false, + formatter: Table.api.formatter.label + }, {field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},